mirror of
https://github.com/lana-k/sqliteviz.git
synced 2025-12-07 02:28:54 +08:00
fix plot update
This commit is contained in:
@@ -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)
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user