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
Copy file name to clipboardExpand all lines: README.md
+10-9Lines changed: 10 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -74,24 +74,24 @@ For a full description of Plotly chart types and attributes see the following re
74
74
75
75
## State management
76
76
77
-
This is a "dumb" component with no internal state. This means that if a user interacts with the plot, by zooming or panning for example, any subsequent re-renders will lose this information unless it is captured and upstreamed via the `onUpdate` callback prop.
77
+
This is a "dumb" component that doesn't merge its internal state with any updates. This means that if a user interacts with the plot, by zooming or panning for example, any subsequent re-renders will lose this information unless it is captured and upstreamed via the `onUpdate` callback prop.
78
78
79
79
Here is a simple example of how to capture and store state in a parent object:
@@ -102,14 +102,15 @@ class App extends React.Component {
102
102
103
103
## Refreshing the Plot
104
104
105
-
This component will refresh the plot via `Plotly.react` if either of the following is true:
105
+
This component will refresh the plot via [`Plotly.react`](https://plot.ly/javascript/plotlyjs-function-reference/#plotlyreact) if any of the following are true:
106
106
107
107
* The `revision` prop is defined and has changed, OR;
108
-
* One of `data`, `layout`, `frames` or `config` has changed identity as checked via a shallow `===`.
108
+
* One of `data`, `layout` or `config` has changed identity as checked via a shallow `===`, OR;
109
+
* The number of elements in `frames` has changed
109
110
110
-
Furthermore, when called, `Plotly.react` will only refresh the data being plotted if the _identity_ of the data arrays (e.g. `x`, `y`, `color` etc) has changed, or if `layout.datarevision` has changed.
111
+
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.
111
112
112
-
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` are used to force a rerender.
113
+
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.
0 commit comments