Skip to content

🔪 editor revision #381

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions dev/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class App extends Component {
// _fullLayout etc in handlePlotUpdate()
this.state = {
graphDiv: {},
editorRevision: 0,
plotRevision: 0,
currentMockIndex: -1,
mocks: [],
Expand All @@ -51,7 +50,7 @@ class App extends Component {
}

handlePlotUpdate(graphDiv) {
this.setState(({editorRevision: x}) => ({editorRevision: x + 1, graphDiv}));
this.setState({graphDiv});
}

handleEditorUpdate() {
Expand Down Expand Up @@ -82,7 +81,6 @@ class App extends Component {
<PlotlyEditor
graphDiv={this.state.graphDiv}
onUpdate={this.handleEditorUpdate.bind(this)}
revision={this.state.editorRevision}
dataSources={dataSources}
dataSourceOptions={dataSourceOptions}
plotly={plotly}
Expand Down
13 changes: 0 additions & 13 deletions src/PlotlyEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,6 @@ class PlotlyEditor extends Component {
}
}

shouldComponentUpdate(nextProps) {
if (
nextProps.revision === void 0 ||
nextProps.revision !== this.props.revision ||
nextProps.dataSources !== this.props.dataSources ||
nextProps.dataSourceOptions !== this.props.dataSourceOptions
) {
return true;
}
return false;
}

getChildContext() {
const gd = this.props.graphDiv || {};
return {
Expand Down Expand Up @@ -253,7 +241,6 @@ PlotlyEditor.propTypes = {
locale: PropTypes.string,
onUpdate: PropTypes.func,
plotly: PropTypes.object,
revision: PropTypes.any,
traceTypesConfig: PropTypes.object,
};

Expand Down
50 changes: 0 additions & 50 deletions src/__tests__/PlotlyEditor-test.js

This file was deleted.

1 change: 1 addition & 0 deletions src/components/containers/Section.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Section extends Component {
// for now, only allowing for cartesian chart types
if (
data.length > 1 &&
data[fullContainer.index] &&
traceTypeToAxisType(data[fullContainer.index].type) === 'cartesian'
) {
this.sectionVisible = true;
Expand Down
2 changes: 1 addition & 1 deletion src/components/fields/TraceSelector.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ TraceSelector.propTypes = {
getValObject: PropTypes.func,
container: PropTypes.object.isRequired,
fullContainer: PropTypes.object.isRequired,
fullValue: PropTypes.any.isRequired,
fullValue: PropTypes.any,
localize: PropTypes.func,
updateContainer: PropTypes.func,
};
Expand Down