-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Update docs for Kaleido v0 and Orca removal #5678
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
emilykl
wants to merge
2
commits into
v7.0
Choose a base branch
from
update-docs-kaleido-v0
base: v7.0
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,7 +42,8 @@ This page demonstrates how to export interactive Plotly figures to static image | |
|
|
||
| ### Kaleido | ||
|
|
||
| Static image generation requires [Kaleido](https://github.com/plotly/Kaleido). | ||
| Static image generation requires [Kaleido](https://github.com/plotly/Kaleido) version 1.0.0 or greater. | ||
|
|
||
| Install Kaleido with pip: | ||
| ``` | ||
| $ pip install --upgrade kaleido | ||
|
|
@@ -52,11 +53,10 @@ or with conda: | |
| $ conda install -c conda-forge python-kaleido | ||
| ``` | ||
|
|
||
| It's also possible to generate static images using [Orca](https://github.com/plotly/orca), though support for Orca will be removed after September 2025. See the [Orca Management](/python/orca-management/) page for more details. | ||
|
|
||
| ### Chrome | ||
|
|
||
| Kaleido uses Chrome for static image generation. Versions of Kaleido prior to v1 included Chrome as part of the Kaleido package. Kaleido v1 does not include Chrome; instead, it looks for a compatible version of Chrome (or Chromium) already installed on the machine on which it's running. | ||
| Kaleido uses Chrome for static image generation. Starting with Kaleido version 1.0.0, Chrome is not included in the package itself; instead, Kaleido looks for a compatible version of Chrome (or Chromium) already installed on the machine on which it's running. | ||
|
|
||
| If you don't have Chrome installed, you can install it directly from Google following the instructions for your operating system. | ||
|
|
||
|
|
@@ -122,18 +122,6 @@ fig.write_image("images/fig1.svg") | |
| fig.write_image("images/fig1.pdf") | ||
| ~~~ | ||
|
|
||
| --- | ||
|
|
||
| **EPS** (Kaleido<1.0.0) | ||
|
|
||
| Kaleido versions earlier than 1.0.0 also support **EPS** (requires the poppler library). If using Kaleido v1 or later, we recommend PDF or SVG format. | ||
|
|
||
| ~~~python | ||
| ... | ||
| fig.write_image("images/fig1.eps") | ||
| ~~~ | ||
|
|
||
|
|
||
| **Note:** Figures containing WebGL traces (i.e. of type `scattergl`, `contourgl`, `scatter3d`, `surface`, `mesh3d`, `scatterpolargl`, `cone`, `streamtube`, `splom`, or `parcoords`) that are exported in a vector format will include encapsulated rasters, instead of vectors, for some parts of the image. | ||
|
|
||
|
|
||
|
|
@@ -215,23 +203,6 @@ img_bytes = fig.to_image(format="png", width=600, height=350, scale=2) | |
| Image(img_bytes) | ||
| ``` | ||
|
|
||
| ## Specify Image Export Engine | ||
|
|
||
| > The `engine` parameter, as well as Orca support, is deprecated in Plotly.py 6.2.0 and will be removed after September 2025. | ||
|
|
||
| If `kaleido` is installed, it will automatically be used to perform image export. If it is not installed, plotly.py will attempt to use `orca` instead. The `engine` argument to the `to_image` and `write_image` functions can be used to override this default behavior. | ||
|
|
||
| Here is an example of specifying `orca` for the image export engine: | ||
| ~~~python | ||
| fig.to_image(format="png", engine="orca") | ||
| ~~~ | ||
|
|
||
| And, here is an example of specifying that Kaleido should be used: | ||
| ~~~python | ||
| fig.to_image(format="png", engine="kaleido") | ||
| ~~~ | ||
|
|
||
|
|
||
| <!-- #region --> | ||
| ## plotly.io Functions | ||
|
|
||
|
|
@@ -255,21 +226,39 @@ pio.write_image(fig, "fig.png") | |
| ~~~ | ||
| <!-- #endregion --> | ||
|
|
||
| ## Image Export Settings (Kaleido) | ||
| ## Image Export Settings | ||
|
|
||
| As well as configuring height, width, and other settings by passing arguments when calling `write_image` and `to_image`, you can also set a single default to be used throughout the duration of the program. | ||
|
|
||
| ### How to Configure | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This section seems to overlap with |
||
|
|
||
| Image export settings can be configured by setting their values in `plotly.io.defaults`. | ||
|
|
||
| To set the `default_format` to "jpeg": | ||
|
|
||
| ~~~python | ||
| import plotly.io as pio | ||
| pio.defaults.default_format = "jpeg" | ||
| ~~~ | ||
|
|
||
| You can also access current defaults. To see the default value for height: | ||
|
|
||
| ~~~python | ||
| import plotly.io as pio | ||
| pio.defaults.default_height | ||
| ~~~ | ||
|
|
||
| ### Available Settings | ||
|
|
||
| The following settings are available. | ||
| The following settings are available: | ||
|
|
||
| `default_width`: The default pixel width to use on image export. | ||
|
|
||
| `default_height`: The default pixel height to use on image export. | ||
|
|
||
| `default_scale`: The default image scale factor applied on image export. | ||
|
|
||
| `default_format`: The default image format used on export. One of "png", "jpeg", "webp", "svg", or "pdf". ("eps" support is available with Kaleido v0 only) | ||
| `default_format`: The default image format used on export. One of "png", "jpeg", "webp", "svg", or "pdf". | ||
|
|
||
| `mathjax`: Location of the MathJax bundle needed to render LaTeX characters. Defaults to a CDN location. If fully offline export is required, set this to a local MathJax bundle. | ||
|
|
||
|
|
@@ -281,7 +270,7 @@ The following settings are available. | |
|
|
||
| ### Set Defaults | ||
|
|
||
| Since Plotly.py 6.1, settings are available on `plotly.io.defaults` | ||
| Since Plotly.py 6.1, settings are available on `plotly.io.defaults`. | ||
|
|
||
| To set the `default_format` to "jpeg": | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.