Skip to content

Commit ad2eeba

Browse files
Merge branch 'master' into renamefn
2 parents 23a6f92 + cf5c342 commit ad2eeba

File tree

2 files changed

+6
-41
lines changed

2 files changed

+6
-41
lines changed

examples/custom/src/App.js

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
import React, {Component} from 'react';
2-
import PropTypes from 'prop-types';
32
import plotly from 'plotly.js/dist/plotly';
43
import PlotlyEditor from 'react-chart-editor';
54
import CustomEditor from './CustomEditor';
6-
import {localizeString} from 'react-chart-editor/lib';
75
import 'react-chart-editor/lib/react-chart-editor.css';
86

97
const dataSources = {
@@ -35,12 +33,6 @@ class App extends Component {
3533
};
3634
}
3735

38-
getChildContext() {
39-
return {
40-
localize: key => localizeString({}, 'en', key),
41-
};
42-
}
43-
4436
render() {
4537
return (
4638
<div className="app">
@@ -52,9 +44,7 @@ class App extends Component {
5244
dataSources={dataSources}
5345
dataSourceOptions={dataSourceOptions}
5446
plotly={plotly}
55-
onUpdate={(data, layout, frames) =>
56-
this.setState({data, layout, frames})
57-
}
47+
onUpdate={(data, layout, frames) => this.setState({data, layout, frames})}
5848
useResizeHandler
5949
debug
6050
advancedTraceTypeSelector
@@ -66,8 +56,4 @@ class App extends Component {
6656
}
6757
}
6858

69-
App.childContextTypes = {
70-
localize: PropTypes.func,
71-
};
72-
7359
export default App;

examples/custom/src/CustomEditor.js

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ export default class CustomEditor extends Component {
3535
}
3636
<Info attr="title">
3737
<p>
38-
This custom editor demonstrates the general-purpose container
39-
and field components.
38+
This custom editor demonstrates the general-purpose container and field components.
4039
</p>
4140
<p>
4241
This is an <code>Info</code> component.
@@ -48,47 +47,27 @@ export default class CustomEditor extends Component {
4847
label="Dropdown"
4948
attr="xaxis.title"
5049
show
51-
options={[
52-
{label: 'Yes', value: 'yes'},
53-
{label: 'No', value: 'no'},
54-
]}
50+
options={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}]}
5551
/>
5652
<Radio
5753
label="Radio"
5854
attr="yaxis.title"
5955
show
60-
options={[
61-
{label: 'Yes', value: 'yes'},
62-
{label: 'No', value: 'no'},
63-
]}
56+
options={[{label: 'Yes', value: 'yes'}, {label: 'No', value: 'no'}]}
6457
/>
6558
<Flaglist
6659
label="Flaglist"
6760
attr="titlefont.family"
6861
show
69-
options={[
70-
{label: 'Yes', value: 'y'},
71-
{label: 'No', value: 'n'},
72-
]}
62+
options={[{label: 'Yes', value: 'y'}, {label: 'No', value: 'n'}]}
7363
/>
7464
<ColorPicker label="ColorPicker" attr="plot_bgcolor" show />
7565
<TextEditor attr="title" label="TextEditor default" />
76-
<TextEditor
77-
attr="title"
78-
label="TextEditor richTextOnly"
79-
richTextOnly
80-
/>
81-
<TextEditor attr="title" label="TextEditor htmlOnly" htmlOnly />
82-
<TextEditor attr="title" label="TextEditor latexOnly" latexOnly />
8366
</PlotlySection>
8467
</PlotlyFold>
8568
</LayoutPanel>
8669
<SingleSidebarItem>
87-
<Button
88-
variant="primary"
89-
label="save"
90-
onClick={() => alert('save button clicked!')}
91-
/>
70+
<Button variant="primary" label="save" onClick={() => alert('save button clicked!')} />
9271
</SingleSidebarItem>
9372
<SingleSidebarItem>
9473
<Button

0 commit comments

Comments
 (0)