diff --git a/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue b/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue index d473f3a..7c4dd8a 100644 --- a/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue +++ b/src/views/Main/Workspace/Tabs/Tab/DataView/Chart/index.vue @@ -115,17 +115,13 @@ export default { // https://github.com/plotly/react-chart-editor/issues/948 if (this.dataSources) { dereference.default(this.state.data, this.dataSources) + this.updatePlotly() } } }, methods: { async handleResize() { - const plotComponent = this.$refs.plotlyEditor.plotComponentRef.current - this.$refs.plotlyEditor.plotComponentRef.current.updatePlotly( - false, // shouldInvokeResizeHandler - plotComponent.props.onUpdate, // figureCallbackFunction - false // shouldAttachUpdateEvents - ) + this.updatePlotly() }, onRender(data, layout, frames) { // TODO: check changes and enable Save button if needed @@ -134,6 +130,14 @@ export default { this.state = { data, layout, frames } this.$emit('update') }, + updatePlotly() { + const plotComponent = this.$refs.plotlyEditor.plotComponentRef.current + plotComponent.updatePlotly( + false, // shouldInvokeResizeHandler + plotComponent.props.onUpdate, // figureCallbackFunction + false // shouldAttachUpdateEvents + ) + }, getOptionsForSave() { return chartHelper.getOptionsForSave(this.state, this.dataSources) },