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: FAQ.md
+5
Original file line number
Diff line number
Diff line change
@@ -30,3 +30,8 @@ export class AppPlotlyComponent {
30
30
}
31
31
}
32
32
```
33
+
34
+
35
+
## The graph is too slow when interacting, what could I do ?
36
+
37
+
Angular checks all the data everytime to see if there is a change to be applied, sometimes this brings unexpected slowness when treating a large data to be displayed. To avoid this check, set the property `updateOnlyWithRevision` to `true`. When you need the component to update, you can use the `revision` property (a number) to force it to update. Simply incrementing it (e.g.: `this.revision += 1`) will force the component to be updated.
Copy file name to clipboardExpand all lines: README.md
+19-18
Original file line number
Diff line number
Diff line change
@@ -94,24 +94,25 @@ The `plotly.js` is bundled within the angular code. To avoid this, please read [
94
94
95
95
**Warning**: for the time being, this component may _mutate_ its `layout` and `data` props in response to user input, going against React rules. This behaviour will change in the near future once https://github.com/plotly/plotly.js/issues/2389 is completed.
|`[data]`|`Array`|`[]`| list of trace objects (see https://plot.ly/javascript/reference/)|
100
-
|`[layout]`|`Object`|`undefined`| layout object (see https://plot.ly/javascript/reference/#layout)|
101
-
|`[frames]`|`Array`|`undefined`| list of frame objects (see https://plot.ly/javascript/reference/)|
102
-
|`[config]`|`Object`|`undefined`| config object (see https://plot.ly/javascript/configuration-options/)|
103
-
|`[revision]`|`Number`|`undefined`| When provided, causes the plot to update _only_ when the revision is incremented. |
104
-
|`[updateOnLayoutChange]`|`Boolean`|`true`| Flag which determines if this component should watch to changes on `layout` property and update the graph |
105
-
|`[updateOnDataChange]`|`Boolean`|`true`| Flag which determines if this component should watch to changes on `data` property and update the graph |
106
-
|`(initialized)`|`Function(figure, graphDiv)`|`undefined`| Callback executed after plot is initialized. See below for parameter information. |
107
-
|`(update)`|`Function(figure, graphDiv)`|`undefined`| Callback executed when when a plot is updated due to new data or layout, or when user interacts with a plot. See below for parameter information. |
108
-
|`(purge)`|`Function(figure, graphDiv)`|`undefined`| Callback executed when component unmounts, before `Plotly.purge` strips the `graphDiv` of all private attributes. See below for parameter information. |
109
-
|`(error)`|`Function(err)`|`undefined`| Callback executed when a plotly.js API method rejects |
110
-
|`[divId]`|`string`|`undefined`| id assigned to the `<div>` into which the plot is rendered. |
111
-
|`[className]`|`string`|`undefined`| applied to the `<div>` into which the plot is rendered |
112
-
|`[style]`|`Object`|`{position: 'relative', display: 'inline-block'}`| used to style the `<div>` into which the plot is rendered |
113
-
|`[debug]`|`Boolean`|`false`| Assign the graph div to `window.gd` for debugging |
114
-
|`[useResizeHandler]`|`Boolean`|`false`| When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler |
|`[data]`|`Array`|`[]`| list of trace objects (see https://plot.ly/javascript/reference/)|
100
+
|`[layout]`|`Object`|`undefined`| layout object (see https://plot.ly/javascript/reference/#layout)|
101
+
|`[frames]`|`Array`|`undefined`| list of frame objects (see https://plot.ly/javascript/reference/)|
102
+
|`[config]`|`Object`|`undefined`| config object (see https://plot.ly/javascript/configuration-options/)|
103
+
|`[revision]`|`Number`|`undefined`| When provided, causes the plot to update _only_ when the revision is incremented. |
104
+
|`[updateOnLayoutChange]`|`Boolean`|`true`| Flag which determines if this component should watch to changes on `layout` property and update the graph. |
105
+
|`[updateOnDataChange]`|`Boolean`|`true`| Flag which determines if this component should watch to changes on `data` property and update the graph. |
106
+
|`[updateOnlyWithRevision]`|`Boolean`|`false`| If `true`, this component will update only when the property `revision` is increased. |
107
+
|`(initialized)`|`Function(figure, graphDiv)`|`undefined`| Callback executed after plot is initialized. See below for parameter information. |
108
+
|`(update)`|`Function(figure, graphDiv)`|`undefined`| Callback executed when when a plot is updated due to new data or layout, or when user interacts with a plot. See below for parameter information. |
109
+
|`(purge)`|`Function(figure, graphDiv)`|`undefined`| Callback executed when component unmounts, before `Plotly.purge` strips the `graphDiv` of all private attributes. See below for parameter information. |
110
+
|`(error)`|`Function(err)`|`undefined`| Callback executed when a plotly.js API method rejects |
111
+
|`[divId]`|`string`|`undefined`| id assigned to the `<div>` into which the plot is rendered. |
112
+
|`[className]`|`string`|`undefined`| applied to the `<div>` into which the plot is rendered |
113
+
|`[style]`|`Object`|`{position: 'relative', display: 'inline-block'}`| used to style the `<div>` into which the plot is rendered |
114
+
|`[debug]`|`Boolean`|`false`| Assign the graph div to `window.gd` for debugging |
115
+
|`[useResizeHandler]`|`Boolean`|`false`| When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler |
115
116
116
117
**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 will implement the behaviour documented here: https://plot.ly/javascript/responsive-fluid-layout/
0 commit comments