Skip to content

Commit 135aea4

Browse files
authored
Merge pull request #405 from plotly/animations
frames support + slider styling controls
2 parents 2ce7152 + 8a2aa18 commit 135aea4

File tree

24 files changed

+3279
-66
lines changed

24 files changed

+3279
-66
lines changed

dev/App.js

Lines changed: 2718 additions & 3 deletions
Large diffs are not rendered by default.

examples/custom/src/App.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class App extends Component {
2929
},
3030
],
3131
layout: {},
32+
frames: [],
3233
};
3334
}
3435

@@ -39,10 +40,13 @@ class App extends Component {
3940
data={this.state.data}
4041
layout={this.state.layout}
4142
config={config}
43+
frames={this.state.frames}
4244
dataSources={dataSources}
4345
dataSourceOptions={dataSourceOptions}
4446
plotly={plotly}
45-
onUpdate={(data, layout) => this.setState({data, layout})}
47+
onUpdate={(data, layout, frames) =>
48+
this.setState({data, layout, frames})
49+
}
4650
useResizeHandler
4751
debug
4852
advancedTraceTypeSelector

examples/demo/src/App.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class App extends Component {
2626
this.state = {
2727
data: [],
2828
layout: {},
29+
frames: [],
2930
currentMockIndex: -1,
3031
mocks: [],
3132
};
@@ -52,6 +53,7 @@ class App extends Component {
5253
currentMockIndex: mockIndex,
5354
data: figure.data,
5455
layout: figure.layout,
56+
frames: figure.frames,
5557
});
5658
});
5759
}
@@ -63,10 +65,13 @@ class App extends Component {
6365
data={this.state.data}
6466
layout={this.state.layout}
6567
config={config}
68+
frames={this.state.frames}
6669
dataSources={dataSources}
6770
dataSourceOptions={dataSourceOptions}
6871
plotly={plotly}
69-
onUpdate={(data, layout) => this.setState({data, layout})}
72+
onUpdate={(data, layout, frames) =>
73+
this.setState({data, layout, frames})
74+
}
7075
useResizeHandler
7176
debug
7277
advancedTraceTypeSelector

examples/redux/src/App.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,22 @@ class App extends Component {
2929
}
3030

3131
render() {
32-
const {actions, dataSources, dataSourceOptions, data, layout} = this.props;
32+
const {
33+
actions,
34+
dataSources,
35+
dataSourceOptions,
36+
data,
37+
layout,
38+
frames,
39+
} = this.props;
3340

3441
return (
3542
<div className="app">
3643
<PlotlyEditor
3744
data={data}
3845
layout={layout}
3946
config={config}
47+
frames={frames}
4048
dataSources={dataSources}
4149
dataSourceOptions={dataSourceOptions}
4250
plotly={plotly}
@@ -56,13 +64,15 @@ App.propTypes = {
5664
dataSources: PropTypes.object,
5765
data: PropTypes.array,
5866
layout: PropTypes.object,
67+
frames: PropTypes.array,
5968
};
6069

6170
const mapStateToProps = state => ({
6271
dataSourceOptions: state.dataSourceOptions,
6372
dataSources: state.dataSources,
6473
data: state.data,
6574
layout: state.layout,
75+
frames: state.frames,
6676
});
6777

6878
const mapDispatchToProps = dispatch => ({

examples/redux/src/actions.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ export function dataSourceOptionsUpdate(payload) {
1414
};
1515
}
1616

17-
export function editorUpdate(data, layout) {
17+
export function editorUpdate(data, layout, frames) {
1818
return {
1919
type: ACTIONS.EDITOR_UPDATE,
20-
payload: {data, layout},
20+
payload: {data, layout, frames},
2121
};
2222
}

examples/redux/src/reducer.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ const initialState = {
55
dataSourceOptions: [],
66
data: [],
77
layout: {},
8+
frames: [],
89
};
910

1011
export default (state = initialState, action) => {
@@ -18,6 +19,7 @@ export default (state = initialState, action) => {
1819
...state,
1920
data: action.payload.data,
2021
layout: action.payload.layout,
22+
frames: action.payload.frames,
2123
};
2224
default:
2325
return state;

examples/simple/src/App.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const config = {editable: true};
1919
class App extends Component {
2020
constructor() {
2121
super();
22-
this.state = {data: [], layout: {}};
22+
this.state = {data: [], layout: {}, frames: []};
2323
}
2424

2525
render() {
@@ -29,10 +29,13 @@ class App extends Component {
2929
data={this.state.data}
3030
layout={this.state.layout}
3131
config={config}
32+
frames={this.state.frames}
3233
dataSources={dataSources}
3334
dataSourceOptions={dataSourceOptions}
3435
plotly={plotly}
35-
onUpdate={(data, layout) => this.setState({data, layout})}
36+
onUpdate={(data, layout, frames) =>
37+
this.setState({data, layout, frames})
38+
}
3639
useResizeHandler
3740
debug
3841
advancedTraceTypeSelector

scripts/translationKeys/combined-translation-keys.txt

Lines changed: 59 additions & 46 deletions
Large diffs are not rendered by default.

scripts/translationKeys/translation-keys.txt

Lines changed: 22 additions & 9 deletions
Large diffs are not rendered by default.

src/DefaultEditor.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ import {
99
StyleLegendPanel,
1010
StyleNotesPanel,
1111
StyleShapesPanel,
12+
StyleSlidersPanel,
1213
StyleImagesPanel,
1314
StyleTracesPanel,
1415
StyleColorbarsPanel,
16+
StyleUpdateMenusPanel,
1517
} from './default_panels';
1618

1719
const DefaultEditor = ({localize: _}) => (
@@ -26,6 +28,8 @@ const DefaultEditor = ({localize: _}) => (
2628
<StyleColorbarsPanel group={_('Style')} name={_('Color Bars')} />
2729
<StyleShapesPanel group={_('Style')} name={_('Shapes')} />
2830
<StyleImagesPanel group={_('Style')} name={_('Images')} />
31+
<StyleSlidersPanel group={_('Style')} name={_('Sliders')} />
32+
<StyleUpdateMenusPanel group={_('Style')} name={_('Update Menus')} />
2933
</PanelMenuWrapper>
3034
</Fragment>
3135
);

0 commit comments

Comments
 (0)