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
+16-16
Original file line number
Diff line number
Diff line change
@@ -86,22 +86,22 @@ For a full description of Plotly chart types and attributes see the following re
86
86
87
87
**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/)|
92
-
|`layout`|`Object`|`undefined`| layout object (see https://plot.ly/javascript/reference/#layout)|
93
-
|`frames`|`Array`|`undefined`| list of frame objects (see https://plot.ly/javascript/reference/)|
94
-
|`config`|`Object`|`undefined`| config object (see https://plot.ly/javascript/configuration-options/)|
95
-
|`revision`|`Number`|`undefined`| When provided, causes the plot to update _only_ when the revision is incremented. |
96
-
|`onInitialized`|`Function(figure, graphDiv)`|`undefined`| Callback executed after plot is initialized. See below for parameter information. |
97
-
|`onUpdate`|`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. |
98
-
|`onPurge`|`Function(figure, graphDiv)`|`undefined`| Callback executed when component unmounts, before `Plotly.purge` strips the `graphDiv` of all private attributes. See below for parameter information. |
99
-
|`onError`|`Function(err)`|`undefined`| Callback executed when a plotly.js API method rejects |
100
-
|`divId`|`string`|`undefined`| id assigned to the `<div>` into which the plot is rendered. |
101
-
|`className`|`string`|`undefined`| applied to the `<div>` into which the plot is rendered |
102
-
|`style`|`Object`|`{position: 'relative', display: 'inline-block'}`| used to style the `<div>` into which the plot is rendered |
103
-
|`debug`|`Boolean`|`false`| Assign the graph div to `window.gd` for debugging |
104
-
|`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/)|
92
+
|`[layout]`|`Object`|`undefined`| layout object (see https://plot.ly/javascript/reference/#layout)|
93
+
|`[frames]`|`Array`|`undefined`| list of frame objects (see https://plot.ly/javascript/reference/)|
94
+
|`[config]`|`Object`|`undefined`| config object (see https://plot.ly/javascript/configuration-options/)|
95
+
|`[revision]`|`Number`|`undefined`| When provided, causes the plot to update _only_ when the revision is incremented. |
96
+
|`(initialized)`|`Function(figure, graphDiv)`|`undefined`| Callback executed after plot is initialized. See below for parameter information. |
97
+
|`(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. |
98
+
|`(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. |
99
+
|`(error)`|`Function(err)`|`undefined`| Callback executed when a plotly.js API method rejects |
100
+
|`[divId]`|`string`|`undefined`| id assigned to the `<div>` into which the plot is rendered. |
101
+
|`[className]`|`string`|`undefined`| applied to the `<div>` into which the plot is rendered |
102
+
|`[style]`|`Object`|`{position: 'relative', display: 'inline-block'}`| used to style the `<div>` into which the plot is rendered |
103
+
|`[debug]`|`Boolean`|`false`| Assign the graph div to `window.gd` for debugging |
104
+
|`[useResizeHandler]`|`Boolean`|`false`| When true, adds a call to `Plotly.Plot.resize()` as a `window.resize` event handler |
105
105
106
106
**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