Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Fix issue where user-specified `color_continuous_scale` was ignored when template had `autocolorscale=True` [[#5439](https://github.com/plotly/plotly.py/pull/5439)], with thanks to @antonymilne for the contribution!
- Use presence of `COLAB_NOTEBOOK_ID` env var to enable Colab renderer instead of testing import of `google.colab` [[#5473](https://github.com/plotly/plotly.py/pull/5473)], with thanks to @kevineger for the contribution!
- Update tests to be compatible with numpy 2.4 [[#5522](https://github.com/plotly/plotly.py/pull/5522)], with thanks to @thunze for the contribution!
- Add default headers to be passed in to Kaleido v1.3.0 to avoid blocked Open Street Map tiles [#5588](https://github.com/plotly/plotly.py/pull/5588)]

### Updated
- The `__eq__` method for `graph_objects` classes now returns `NotImplemented` to give the other operand an opportunity to handle the comparison [[#5547](https://github.com/plotly/plotly.py/pull/5547)], with thanks to @RazerM for the contribution!
Expand Down
3 changes: 3 additions & 0 deletions plotly/io/_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ def __init__(self):
self.mathjax = None
self.topojson = None
self.plotlyjs = None
# This header is necessary to comply with Open Street Map tile policy:
# https://openstreetmap.github.io/owg-website/policies/tiles/#31-identification
self.headers = {"X-Requested-With": "plotly.py"}


defaults = _Defaults()
4 changes: 4 additions & 0 deletions plotly/io/_kaleido.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,8 @@ def to_image(
kopts["plotlyjs"] = defaults.plotlyjs
if defaults.mathjax:
kopts["mathjax"] = defaults.mathjax
if defaults.headers:
kopts["headers"] = defaults.headers

width = (
width
Expand Down Expand Up @@ -712,6 +714,8 @@ def write_images(
kopts["plotlyjs"] = defaults.plotlyjs
if defaults.mathjax:
kopts["mathjax"] = defaults.mathjax
if defaults.headers:
kopts["headers"] = defaults.headers
kaleido.write_fig_from_object_sync(
kaleido_specs,
kopts=kopts,
Expand Down
Loading