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: CHANGELOG.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,13 @@ This project adheres to [Semantic Versioning](http://semver.org/).
12
12
- Fix `mpl_to_plotly` not setting `paper_bgcolor` and `plot_bgcolor` from the matplotlib figure and axes backgrounds, so converted figures match the source figure's background colors [[#5285](https://github.com/plotly/plotly.py/pull/5285)], with thanks to @robertoffmoura for the contribution!
13
13
- Fix rendering issue causing a too-large div when calling `Figure.show()` in Google Colab [[#5718](https://github.com/plotly/plotly.py/pull/5718)]
14
14
15
+
### Updated
16
+
- Update plotly.js from version 4.0.0 to version 4.1.0 [[#5722](https://github.com/plotly/plotly.py/pull/5722)]. See the [plotly.js release notes](https://github.com/plotly/plotly.js/releases/tag/v4.1.0) for details. Notable changes include:
17
+
- Add an opt-in modebar button for downloading Plotly figures as JSON [[#7990](https://github.com/plotly/plotly.js/pull/7990), [#8022](https://github.com/plotly/plotly.js/pull/8022)]
18
+
- Add `legend.groupdoubleclick` to set the group behavior for a legend double-click [[#7997](https://github.com/plotly/plotly.js/pull/7997)]
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+45-26Lines changed: 45 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -264,39 +264,58 @@ Two kinds of Jupyter support are included:
264
264
265
265
### Updating to a New Version of plotly.js
266
266
267
-
First, update the version of the `plotly.js` dependency in `js/package.json`.
268
-
Once you have done that,
269
-
run the `updateplotlyjs` command:
267
+
We typically update the plotly.js version in plotly.py after every new plotly.js release.
270
268
271
-
```bash
272
-
python commands.py updateplotlyjs
273
-
```
269
+
_Usually, the mostly-automated steps below are sufficient. However, in some cases, manual changes may be needed. For example, [plotly.js/#7580](https://github.com/plotly/plotly.js/pull/7580) required [#5464](https://github.com/plotly/plotly.py/pull/5464) and [#5465](https://github.com/plotly/plotly.py/pull/5465). This is most often the case when plotly.js is updated to accept additional value types for an attribute; plotly.py has its own validation layer which may need to be updated. When in doubt, test out a new plotly.js feature in plotly.py to verify that everything works._
274
270
275
-
This downloads new versions of `plot-schema.json` and `plotly.min.js` from the `plotly/plotly.js` GitHub repository
276
-
and places them in `codegen/resources/` and `plotly/package_data/`, respectively.
271
+
Steps to update plotly.js:
277
272
278
-
It then does the following:
279
-
- Regenerates all of the `graph_objs` classes based on the new schema
280
-
- Runs `npm install` in `js/` to refresh `js/package-lock.json` against the new `plotly.js`
281
-
- Runs `npm run build` to rebuild the JupyterLab extension and FigureWidget bundles in `plotly/labextension` and `plotly/package_data/widgetbundle.js`.
273
+
1. Create a new branch off of `main`.
282
274
283
-
Commit the updated files under:
284
-
-`codegen/resources/`
285
-
-`js/`
286
-
-`plotly/graph_objs/`
287
-
-`plotly/labextension/`
288
-
-`plotly/offline/`
289
-
-`plotly/package_data/`
275
+
2. Manually update the version of the `plotly.js` dependency in `js/package.json`.
290
276
291
-
If you need to skip the `npm` steps entirely (e.g. `npm` isn't available),
292
-
set the `SKIP_NPM=1` environment variable:
277
+
3. Run the `updateplotlyjs` command:
293
278
294
-
```bash
295
-
SKIP_NPM=1 python commands.py updateplotlyjs
296
-
```
279
+
```bash
280
+
python commands.py updateplotlyjs
281
+
```
297
282
298
-
If you do skip it, you'll need to find a way to manually run `npm install && npm run build` in `js/` before committing,
299
-
so that the lockfile and build artifacts stay in sync with `js/package.json`.
283
+
This command does the following:
284
+
285
+
- Downloads new versions of `plot-schema.json` and `plotly.min.js` from the [plotly.js GitHub repository](https://github.com/plotly/plotly.js)
286
+
and places them in`codegen/resources/` and `plotly/package_data/`, respectively.
287
+
- Updates `plotly/offline/_plotlyjs_version.py` with the new version
288
+
- Regenerates all of the classes under `graph_objs/` (`go.Figure`, `go.Layout`, etc.), and `plotly/validators/_validators.json`, based on the new schema
289
+
- Runs `npm install`in`js/` to update `js/package-lock.json`
290
+
- Runs `npm run build`in`js/` to rebuild the JupyterLab extension and FigureWidget bundles, which updates the artifacts in`plotly/labextension` and `plotly/package_data/widgetbundle.js`.
291
+
292
+
> Note: To skip the `npm` steps entirely (e.g. if`npm` isn't available), you can set the `SKIP_NPM=1` environment variable:
293
+
>
294
+
> ```bash
295
+
> SKIP_NPM=1 python commands.py updateplotlyjs
296
+
> ```
297
+
>
298
+
> However, before proceeding further, you'll still need to somehow run `npm install && npm run build`in`js/` before committing, so that the lockfile and build artifacts stay in sync with `js/package.json`.
299
+
300
+
4. Commit the updated files under:
301
+
- `codegen/resources/`
302
+
- `js/`
303
+
- `plotly/graph_objs/`
304
+
- `plotly/labextension/`
305
+
- `plotly/offline/`
306
+
- `plotly/package_data/`
307
+
308
+
5. To double-check that the update worked properly, you can use this one-liner:
The plot will open in a browser window; hover over the Plotly logo in the modebar in the upper-right corner to verify that the plotly.js version is correct.
315
+
316
+
6. Open a PR into `main`.
317
+
318
+
7. Add a changelog entry to `CHANGELOG.md` with a link to the PR. We typically mention the version update, link to the plotly.js GitHub release page, and list out the most important changes. Follow the format of previous plotly.js version bump changelog updates.
Copy file name to clipboardExpand all lines: codegen/resources/plot-schema.json
+14-5Lines changed: 14 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -142,7 +142,7 @@
142
142
},
143
143
"doubleClickDelay": {
144
144
"description": "Sets the delay for registering a double-click in ms. This is the time interval (in ms) between first mousedown and 2nd mouseup to constitute a double-click. This setting propagates to all on-subplot double clicks (except for geo and map) and on-legend double clicks.",
145
-
"dflt": 300,
145
+
"dflt": 500,
146
146
"min": 0,
147
147
"valType": "number"
148
148
},
@@ -244,7 +244,7 @@
244
244
"valType": "any"
245
245
},
246
246
"modeBarButtonsToAdd": {
247
-
"description": "Add mode bar button using config objects See ./components/modebar/buttons.js for list of arguments. To enable predefined modebar buttons e.g. shape drawing, hover and spikelines, simply provide their string name(s). This could include: *v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*, *drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect*and *eraseshape*. Please note that these predefined buttons will only be shown if they are compatible with all trace types used in a graph.",
247
+
"description": "Add mode bar button using config objects See ./components/modebar/buttons.js for list of arguments. To enable predefined modebar buttons e.g. shape drawing, hover and spikelines, simply provide their string name(s). This could include: *v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*, *drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect*, *eraseshape* and *downloadJson*. Please note that these predefined buttons will only be shown if they are compatible with all trace types used in a graph.",
248
248
"dflt": [],
249
249
"valType": "any"
250
250
},
@@ -3312,6 +3312,15 @@
3312
3312
"togglegroup"
3313
3313
]
3314
3314
},
3315
+
"groupdoubleclick": {
3316
+
"description": "Determines the behavior on legend group item double-click. *toggleitem* toggles the visibility of the individual item clicked on the graph. *togglegroup* toggles the visibility of all items in the same legendgroup as the item clicked on the graph. Defaults to the value of `groupclick`.",
3317
+
"editType": "legend",
3318
+
"valType": "enumerated",
3319
+
"values": [
3320
+
"toggleitem",
3321
+
"togglegroup"
3322
+
]
3323
+
},
3315
3324
"grouptitlefont": {
3316
3325
"color": {
3317
3326
"editType": "legend",
@@ -4167,7 +4176,7 @@
4167
4176
},
4168
4177
"add": {
4169
4178
"arrayOk": true,
4170
-
"description": "Determines which predefined modebar buttons to add. Please note that these buttons will only be shown if they are compatible with all trace types used in a graph. Similar to `config.modeBarButtonsToAdd` option. This may include *v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*, *drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect*, *eraseshape*.",
4179
+
"description": "Determines which predefined modebar buttons to add. Please note that these buttons will only be shown if they are compatible with all trace types used in a graph. Similar to `config.modeBarButtonsToAdd` option. This may include *v1hovermode*, *hoverclosest*, *hovercompare*, *togglehover*, *togglespikelines*, *drawline*, *drawopenpath*, *drawclosedpath*, *drawcircle*, *drawrect*, *eraseshape*, *downloadJson*.",
4171
4180
"dflt": "",
4172
4181
"editType": "modebar",
4173
4182
"valType": "string"
@@ -13953,7 +13962,7 @@
13953
13962
"valType": "boolean"
13954
13963
},
13955
13964
"showspikes": {
13956
-
"description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest",
13965
+
"description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note that spikes will never be drawn when `hovermode` is *false*.",
13957
13966
"dflt": false,
13958
13967
"editType": "modebar",
13959
13968
"valType": "boolean"
@@ -15202,7 +15211,7 @@
15202
15211
"valType": "boolean"
15203
15212
},
15204
15213
"showspikes": {
15205
-
"description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note: This only takes affect when hovermode = closest",
15214
+
"description": "Determines whether or not spikes (aka droplines) are drawn for this axis. Note that spikes will never be drawn when `hovermode` is *false*.",
0 commit comments