From 488bc658c1fe30ff342b6022417aac7a30712b14 Mon Sep 17 00:00:00 2001 From: Nicolas Kruchten Date: Mon, 1 Oct 2018 22:58:55 -0400 Subject: [PATCH] fix custom editor --- examples/custom/src/App.js | 16 +-------------- examples/custom/src/CustomEditor.js | 31 +++++------------------------ 2 files changed, 6 insertions(+), 41 deletions(-) diff --git a/examples/custom/src/App.js b/examples/custom/src/App.js index 5840c6930..25a6d71f6 100644 --- a/examples/custom/src/App.js +++ b/examples/custom/src/App.js @@ -1,9 +1,7 @@ import React, {Component} from 'react'; -import PropTypes from 'prop-types'; import plotly from 'plotly.js/dist/plotly'; import PlotlyEditor from 'react-chart-editor'; import CustomEditor from './CustomEditor'; -import {localizeString} from 'react-chart-editor/lib'; import 'react-chart-editor/lib/react-chart-editor.css'; const dataSources = { @@ -35,12 +33,6 @@ class App extends Component { }; } - getChildContext() { - return { - localize: key => localizeString({}, 'en', key), - }; - } - render() { return (
@@ -52,9 +44,7 @@ class App extends Component { dataSources={dataSources} dataSourceOptions={dataSourceOptions} plotly={plotly} - onUpdate={(data, layout, frames) => - this.setState({data, layout, frames}) - } + onUpdate={(data, layout, frames) => this.setState({data, layout, frames})} useResizeHandler debug advancedTraceTypeSelector @@ -66,8 +56,4 @@ class App extends Component { } } -App.childContextTypes = { - localize: PropTypes.func, -}; - export default App; diff --git a/examples/custom/src/CustomEditor.js b/examples/custom/src/CustomEditor.js index e646d84a3..29aea3740 100644 --- a/examples/custom/src/CustomEditor.js +++ b/examples/custom/src/CustomEditor.js @@ -35,8 +35,7 @@ export default class CustomEditor extends Component { }

- This custom editor demonstrates the general-purpose container - and field components. + This custom editor demonstrates the general-purpose container and field components.

This is an Info component. @@ -48,47 +47,27 @@ export default class CustomEditor extends Component { label="Dropdown" attr="xaxis.title" show - options={[ - {label: 'Yes', value: 'yes'}, - {label: 'No', value: 'no'}, - ]} + options={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}]} /> - - - -