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
{{ message }}
Repository navigation
Commit db310b2
Browse filesBrowse the repository at this point in the historyBrowse files
* commit '2e2d1f0c8': (38 commits)
Switch to alternate fence syntax
docs: keep troubleshooting paragraph on one line
docs: move Jupyter troubleshooting section
docs: add Jupyter blank-render troubleshooting
skip changelog check if draft, and display messages for all outcomes
Apply suggestions from code review
update changelog instructions in CONTRIBUTING.md
Revert "add dummy changelog entry"
add dummy changelog entry
add CI workflow to make sure changelog gets updated with every PR
update changelog
update years in license and README
update instructions for updateplotlyjs command
update plotly.js to v4.1.0
update changelog
do not use full_html for google colab renderer
Add changelog entry
Add yticks test
Export tick text for FixedFormatter tick labels
Update uneven tick spacing warning to reflect explicit tickvals export
...
echo "::notice::This PR has the 'no-changelog' label, so a change to CHANGELOG.md is not required."
27
+
elif gh api "repos/${{ github.repository }}/pulls/${{ github.event.number }}/files" --paginate --jq '.[].filename' | grep -qx CHANGELOG.md; then
28
+
echo "::notice::CHANGELOG.md was updated."
29
+
else
30
+
echo "::error::CHANGELOG.md was not updated. Either add a changelog entry, or add the 'no-changelog' label to this PR if a changelog entry is not needed."
Copy file name to clipboardExpand all lines: CHANGELOG.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,21 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
5
5
## Unreleased
6
6
7
+
### Added
8
+
- Support `marginal_x`/`marginal_y="heatmap"` in `density_heatmap`, drawing a single-row/column heatmap strip in the margin colored by the same `z`/`histfunc` aggregate as the main plot and sharing its color scale [[#5706](https://github.com/plotly/plotly.py/issues/5706)], with thanks to @lucasjamar for the contribution!
9
+
- Add support for custom tick values in `mpl_to_plotly` when the matplotlib tick positions don't follow an arithmetic progression, including custom tick labels and tick values on date axes [[#5262](https://github.com/plotly/plotly.py/pull/5262)], with thanks to @robertoffmoura for the contribution!
10
+
7
11
### Fixed
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
+
- Fix rendering issue causing a too-large div when calling `Figure.show()` in Google Colab [[#5718](https://github.com/plotly/plotly.py/pull/5718)]
8
14
- Fix the sphinx-gallery scraper so that it generates thumbnails for figures shown with `fig.show()` or displayed as the last expression of a code block, warns once (instead of failing the build) when static image export is unavailable, and no longer scrapes files belonging to other examples during parallel builds [[#4722](https://github.com/plotly/plotly.py/issues/4722), [#4959](https://github.com/plotly/plotly.py/issues/4959)], with thanks to @larsoner for the contribution!
9
15
16
+
### Updated
17
+
- 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:
18
+
- 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)]
19
+
- 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
+47-27Lines changed: 47 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -181,7 +181,8 @@ When creating your pull request, please follow the guidelines below.
181
181
- If your PR modifies code of `plotly.graph_objects`, the modifications should be made to the code generator, *not* the generated files.
182
182
- You have added tests or modified existing tests, as needed.
183
183
- For a new feature, you have added documentation examples (please see the doc checklist as well).
184
-
- You have added a CHANGELOG entry if changing anything substantial.
184
+
- You have added a changelog entry to `CHANGELOG.md` if changing anything substantial.
185
+
- The CI job "Check changelog" will fail if the PR does not update `CHANGELOG.md`. To bypass this check for PRs which don't require a changelog entry (e.g. docs updates), add the `no-changelog` label to the PR.
185
186
- For a new feature or a change in behavior, you have updated the relevant docstrings in the code.
186
187
187
188
### Documentation pull request
@@ -264,39 +265,58 @@ Two kinds of Jupyter support are included:
264
265
265
266
### Updating to a New Version of plotly.js
266
267
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:
268
+
We typically update the plotly.js version in plotly.py after every new plotly.js release.
270
269
271
-
```bash
272
-
python commands.py updateplotlyjs
273
-
```
270
+
_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
271
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.
272
+
Steps to update plotly.js:
277
273
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`.
274
+
1. Create a new branch off of `main`.
282
275
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/`
276
+
2. Manually update the version of the `plotly.js` dependency in `js/package.json`.
290
277
291
-
If you need to skip the `npm` steps entirely (e.g. `npm` isn't available),
292
-
set the `SKIP_NPM=1` environment variable:
278
+
3. Run the `updateplotlyjs` command:
293
279
294
-
```bash
295
-
SKIP_NPM=1 python commands.py updateplotlyjs
296
-
```
280
+
```bash
281
+
python commands.py updateplotlyjs
282
+
```
297
283
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`.
284
+
This command does the following:
285
+
286
+
- Downloads new versions of `plot-schema.json` and `plotly.min.js` from the [plotly.js GitHub repository](https://github.com/plotly/plotly.js)
287
+
and places them in`codegen/resources/` and `plotly/package_data/`, respectively.
288
+
- Updates `plotly/offline/_plotlyjs_version.py` with the new version
289
+
- Regenerates all of the classes under `graph_objs/` (`go.Figure`, `go.Layout`, etc.), and `plotly/validators/_validators.json`, based on the new schema
290
+
- Runs `npm install`in`js/` to update `js/package-lock.json`
291
+
- 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`.
292
+
293
+
> Note: To skip the `npm` steps entirely (e.g. if`npm` isn't available), you can set the `SKIP_NPM=1` environment variable:
294
+
>
295
+
> ```bash
296
+
> SKIP_NPM=1 python commands.py updateplotlyjs
297
+
> ```
298
+
>
299
+
> 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`.
300
+
301
+
4. Commit the updated files under:
302
+
- `codegen/resources/`
303
+
- `js/`
304
+
- `plotly/graph_objs/`
305
+
- `plotly/labextension/`
306
+
- `plotly/offline/`
307
+
- `plotly/package_data/`
308
+
309
+
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.
316
+
317
+
6. Open a PR into `main`.
318
+
319
+
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*.",
Copy file name to clipboardExpand all lines: doc/python/marginal-plots.md
+22-1Lines changed: 22 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,7 +39,7 @@ Marginal distribution plots are small subplots above or to the right of a main p
39
39
40
40
### Scatter Plot Marginals
41
41
42
-
The `marginal_x` and `marginal_y` arguments accept one of `"histogram"`, `"rug"`, `"box"`, or `"violin"` (see also how to create [histograms](/python/histograms/), [box plots](/python/box-plots/) and [violin plots](/python/violin-plots/) as the main figure).
42
+
The `marginal_x` and `marginal_y` arguments accept one of `"histogram"`, `"rug"`, `"box"`, or `"violin"` (see also how to create [histograms](/python/histograms/), [box plots](/python/box-plots/) and [violin plots](/python/violin-plots/) as the main figure), plus `"heatmap"` for `density_heatmap` (see below).
43
43
44
44
Marginal plots are linked to the main plot: try zooming or panning on the main plot.
`marginal_x` and `marginal_y` also accept `"heatmap"` for [`density_heatmap`](/python/2D-Histogram/). This draws a single-row or single-column heatmap strip, colored by the same aggregate (`histfunc` of `z`, or count by default) as the main plot, and sharing its color scale. This is not supported for `density_contour`, since a contour plot's colorbar is discrete and not compatible with the continuous colorbar used by the marginal heatmap.
Set `text_auto=True` to display the aggregate value as text on both the main plot and the marginal heatmap strips, or pass a [d3-format](https://github.com/d3/d3-format) string such as `".2f"` to control the number of decimal places:
Copy file name to clipboardExpand all lines: doc/python/troubleshooting.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,3 +78,15 @@ The situation is similar for environments like Nteract and Streamlit: in these e
78
78
### Orca Problems
79
79
80
80
> The Orca image-generation utility is no longer supported in Plotly.py as of version 7.0.0. See the [Static Image Export page](/python/static-image-export/) for details on using Kaleido for static image generation.
81
+
82
+
### Jupyter and JupyterLab Problems
83
+
84
+
If a figure appears blank in JupyterLab, first check that the Jupyter server environment and the environment used by the notebook kernel can both access the Plotly packages they need. This is especially important when JupyterLab and `plotly` are installed in separate virtual environments.
85
+
86
+
As a workaround, try the `notebook` renderer explicitly:
87
+
88
+
~~~python
89
+
fig.show(renderer="notebook")
90
+
~~~
91
+
92
+
This can help when the default renderer does not display the figure correctly.
0 commit comments