You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -99,15 +99,15 @@ class App extends React.Component {
99
99
100
100
## Refreshing the Plot
101
101
102
-
This component will refresh the plot via [`Plotly.react`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyreact) if any of the following are true:
102
+
This component will refresh the plot via [`Plotly.react`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact) if any of the following are true:
103
103
104
104
- The `revision` prop is defined and has changed, OR;
105
105
- One of `data`, `layout` or `config` has changed identity as checked via a shallow `===`, OR;
106
106
- The number of elements in `frames` has changed
107
107
108
-
Furthermore, when called, [`Plotly.react`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyreact) will only refresh the data being plotted if the _identity_ of the data arrays (e.g. `x`, `y`, `marker.color` etc) has changed, or if `layout.datarevision` has changed.
108
+
Furthermore, when called, [`Plotly.react`](https://plotly.com/javascript/plotlyjs-function-reference/#plotlyreact) will only refresh the data being plotted if the _identity_ of the data arrays (e.g. `x`, `y`, `marker.color` etc) has changed, or if `layout.datarevision` has changed.
109
109
110
-
In short, this means that simply adding data points to a trace in `data` or changing a value in `layout` will not cause a plot to update unless this is done immutably via something like [immutability-helper](https://github.com/kolodny/immutability-helper) if performance considerations permit it, or unless `revision` and/or [`layout.datarevision`](https://plot.ly/javascript/reference/#layout-datarevision) are used to force a rerender.
110
+
In short, this means that simply adding data points to a trace in `data` or changing a value in `layout` will not cause a plot to update unless this is done immutably via something like [immutability-helper](https://github.com/kolodny/immutability-helper) if performance considerations permit it, or unless `revision` and/or [`layout.datarevision`](https://plotly.com/javascript/reference/#layout-datarevision) are used to force a rerender.
111
111
112
112
## API Reference
113
113
@@ -117,10 +117,10 @@ In short, this means that simply adding data points to a trace in `data` or chan
|`data`|`Array`|`[]`| list of trace objects (see https://plot.ly/javascript/reference/)|
121
-
|`layout`|`Object`|`undefined`| layout object (see https://plot.ly/javascript/reference/#layout)|
122
-
|`frames`|`Array`|`undefined`| list of frame objects (see https://plot.ly/javascript/reference/)|
123
-
|`config`|`Object`|`undefined`| config object (see https://plot.ly/javascript/configuration-options/)|
120
+
|`data`|`Array`|`[]`| list of trace objects (see https://plotly.com/javascript/reference/)|
121
+
|`layout`|`Object`|`undefined`| layout object (see https://plotly.com/javascript/reference/#layout)|
122
+
|`frames`|`Array`|`undefined`| list of frame objects (see https://plotly.com/javascript/reference/)|
123
+
|`config`|`Object`|`undefined`| config object (see https://plotly.com/javascript/configuration-options/)|
124
124
|`revision`|`Number`|`undefined`| When provided, causes the plot to update when the revision is incremented. |
125
125
|`onInitialized`|`Function(figure, graphDiv)`|`undefined`| Callback executed after plot is initialized. See below for parameter information. |
126
126
|`onUpdate`|`Function(figure, graphDiv)`|`undefined`| Callback executed when a plot is updated due to new data or layout, or when user interacts with a plot. See below for parameter information. |
@@ -132,7 +132,7 @@ In short, this means that simply adding data points to a trace in `data` or chan
132
132
|`debug`|`Boolean`|`false`| Assign the graph div to `window.gd` for debugging |
133
133
|`useResizeHandler`|`Boolean`|`false`| When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler |
134
134
135
-
**Note**: To make a plot responsive, i.e. to fill its containing element and resize when the window is resized, use `style` or `className` to set the dimensions of the element (i.e. using `width: 100%; height: 100%` or some similar values) and set `useResizeHandler` to `true` while setting `layout.autosize` to `true` and leaving `layout.height` and `layout.width` undefined. This can be seen in action in [this CodePen](https://codepen.io/nicolaskruchten/pen/ERgBZX) and will implement the behaviour documented here: https://plot.ly/javascript/responsive-fluid-layout/
135
+
**Note**: To make a plot responsive, i.e. to fill its containing element and resize when the window is resized, use `style` or `className` to set the dimensions of the element (i.e. using `width: 100%; height: 100%` or some similar values) and set `useResizeHandler` to `true` while setting `layout.autosize` to `true` and leaving `layout.height` and `layout.width` undefined. This can be seen in action in [this CodePen](https://codepen.io/nicolaskruchten/pen/ERgBZX) and will implement the behaviour documented here: https://plotly.com/javascript/responsive-fluid-layout/
0 commit comments