Skip to content

Commit 848fef4

Browse files
authored
feat: Expose containerRef from ChartPanel (#1500)
This is needed so the plotly-express plugin can attach event handlers to the chart container to pause re-renders when the user is manipulating the view on a 3d plot
1 parent 8d890b7 commit 848fef4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

packages/dashboard-core-plugins/src/panels/ChartPanel.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,8 @@ export interface ChartPanelProps extends DashboardPanelProps {
135135
secondParam: undefined
136136
) => void;
137137
Plotly?: typeof PlotlyType;
138+
/** The panel container div */
139+
containerRef?: RefObject<HTMLDivElement>;
138140

139141
panelState: GLChartPanelState;
140142
settings: Partial<WorkspaceSettings>;
@@ -184,6 +186,7 @@ export class ChartPanel extends Component<ChartPanelProps, ChartPanelState> {
184186
sourcePanel: null,
185187
panelState: null,
186188
settings: {},
189+
containerRef: null,
187190
};
188191

189192
static displayName = 'ChartPanel';
@@ -219,7 +222,7 @@ export class ChartPanel extends Component<ChartPanelProps, ChartPanelState> {
219222
);
220223
this.handleClearAllFilters = this.handleClearAllFilters.bind(this);
221224

222-
this.panelContainer = React.createRef();
225+
this.panelContainer = props.containerRef ?? React.createRef();
223226
this.chart = React.createRef();
224227
this.pending = new Pending();
225228

0 commit comments

Comments
 (0)