Skip to content

Commit

Permalink
Refactor chart widget
Browse files Browse the repository at this point in the history
  • Loading branch information
tiberiuichim committed Jan 9, 2020
1 parent 8ee7886 commit b91d53e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/Widget/ModalEditor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,22 +96,22 @@ class Edit extends Component {
selection
options={selectProviders}
onChange={(ev, { value }) =>
this.props.onChangeValue({ ...this.props.data, url: value })
this.props.onChangeValue({ ...this.props.value, url: value })
}
/>
<LoadablePlotlyEditor
data={this.props.data?.data || []}
layout={this.props.data?.layout || {}}
data={this.props.value?.data || []}
layout={this.props.value?.layout || {}}
config={config}
frames={this.props.data?.frames || []}
frames={this.props.value?.frames || []}
dataSources={this.props.providerData || dataSources}
dataSourceOptions={
this.props.dataSourceOptions ||
getDataSourceOptions(dataSources)
}
plotly={plotly}
onUpdate={data =>
this.props.onChangeValue(data, this.props.url)
this.props.onChangeValue({ ...this.props.value, data })
}
useResizeHandler
debug
Expand Down
2 changes: 1 addition & 1 deletion src/Widget/Widget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ModalChartEditor extends Component {
<Modal open={true} size="fullscreen">
<Modal.Content scrolling>
<ChartEditor
data={this.props.value}
value={this.state.value}
onChangeValue={value => {
console.log('Set chart data', value);
this.setState({ value });
Expand Down

0 comments on commit b91d53e

Please sign in to comment.