From 4682d7bac75726c66dbf60e8e5a9080fc2c82420 Mon Sep 17 00:00:00 2001 From: Emily KL <4672118+emilykl@users.noreply.github.com> Date: Mon, 27 Jul 2026 21:45:54 -0400 Subject: [PATCH] update docs to remove references to kaleido v0 and orca --- doc/python/getting-started.md | 12 +- doc/python/orca-management.md | 232 +----------------------------- doc/python/renderers.md | 2 +- doc/python/static-image-export.md | 84 ++++------- doc/python/troubleshooting.md | 6 +- 5 files changed, 35 insertions(+), 301 deletions(-) diff --git a/doc/python/getting-started.md b/doc/python/getting-started.md index f9d21def422..235bbf1fa96 100644 --- a/doc/python/getting-started.md +++ b/doc/python/getting-started.md @@ -183,11 +183,9 @@ See [_Displaying Figures in Python_](/python/renderers/) for more information on ### Static Image Export plotly.py supports [static image export](https://plotly.com/python/static-image-export/), -using the [`kaleido`](https://github.com/plotly/Kaleido) package. (Support for the legacy [`orca`](https://github.com/plotly/orca) image export utility is deprecated and will be removed after September 2025.) +using the [`kaleido`](https://github.com/plotly/Kaleido) package (version 1.0.0 or greater). -#### Kaleido - -The [`kaleido`](https://github.com/plotly/Kaleido) package has no dependencies and can be installed +Kaleido has minimal dependencies and can be installed using pip... ``` @@ -200,6 +198,12 @@ or conda. $ conda install -c plotly python-kaleido ``` +Kaleido requires Chrome or Chromium to generate images. By default, Kaleido will use the Chrome or Chromium version already installed on your system. If you don't have it installed or Kaleido can't find it, you may need to install it by running the command: + +`plotly_get_chrome` + +on your command line. + ### Where to next? Once you've installed, you can use our documentation in three main ways: diff --git a/doc/python/orca-management.md b/doc/python/orca-management.md index d1ca867df59..0d96fadb9a4 100644 --- a/doc/python/orca-management.md +++ b/doc/python/orca-management.md @@ -33,234 +33,4 @@ jupyter: thumbnail: thumbnail/orca-management.png --- -> Orca support in Plotly.py is deprecated and will be removed after September 2025. See the [Static Image Export page](/python/static-image-export/) for details on using Kaleido for static image generation. - -### Overview -This section covers the lower-level details of how plotly.py can use orca to perform static image generation. - -Please refer to the [Static Image Export](/python/static-image-export/) section for general information on creating static images from plotly.py figures. - -### What is orca? -Orca is an [Electron](https://electronjs.org/) application that inputs plotly figure specifications and converts them into static images. Orca can run as a command-line utility or as a long-running server process. In order to provide the fastest possible image export experience, plotly.py launches orca in server mode, and communicates with it over a local port. See https://github.com/plotly/orca for more information. - -By default, plotly.py launches the orca server process the first time an image export operation is performed, and then leaves it running until the main Python process exits. Because of this, the first image export operation in an interactive session will typically take a couple of seconds, but then all subsequent export operations will be significantly faster, since the server is already running. - -### Installing orca -There are 3 general approaches to installing orca and its Python dependencies. - -##### conda -Using the [conda](https://conda.io/docs/) package manager, you can install these dependencies in a single command: - -$ conda install -c plotly plotly-orca==1.2.1 psutil requests - - -**Note:** Even if you do not want to use conda to manage your Python dependencies, it is still useful as a cross platform tool for managing native libraries and command-line utilities (e.g. git, wget, graphviz, boost, gcc, nodejs, cairo, etc.). For this use-case, start with [Miniconda](https://conda.io/miniconda.html) (~60MB) and tell the installer to add itself to your system `PATH`. Then run `conda install plotly-orca==1.2.1` and the orca executable will be available system wide. - -##### npm + pip -You can use the [npm](https://www.npmjs.com/get-npm) package manager to install `orca` (and its `electron` dependency), and then use pip to install `psutil`: - - -$ npm install -g electron@1.8.4 orca -$ pip install psutil requests - - -##### Standalone Binaries + pip -If you are unable to install conda or npm, you can install orca as a precompiled binary for your operating system. Follow the instructions in the orca [README](https://github.com/plotly/orca) to install orca and add it to your system `PATH`. Then use pip to install `psutil`. - - -$ pip install psutil requests - - - -### Install orca on Google Colab -``` -!pip install plotly>=4.7.1 -!wget https://github.com/plotly/orca/releases/download/v1.2.1/orca-1.2.1-x86_64.AppImage -O /usr/local/bin/orca -!chmod +x /usr/local/bin/orca -!apt-get install xvfb libgtk2.0-0 libgconf-2-4 -``` - -Once this is done you can use this code to make, show and export a figure: - -```python -import plotly.graph_objects as go -fig = go.Figure( go.Scatter(x=[1,2,3], y=[1,3,2] ) ) -fig.write_image("fig1.svg") -fig.write_image("fig1.png") -``` - -The files can then be downloaded with: - -```python -from google.colab import files -files.download('fig1.svg') -files.download('fig1.png') -``` - - -### Create a Figure -Now let's create a simple scatter plot with 100 random points of varying color and size. - -```python -import plotly.graph_objects as go - -import numpy as np -np.random.seed(1) - -# Generate scatter plot data -N = 100 -x = np.random.rand(N) -y = np.random.rand(N) -colors = np.random.rand(N) -sz = np.random.rand(N) * 30 - -# Build and display figure -fig = go.Figure() -fig.add_trace(go.Scatter( - x=x, - y=y, - mode="markers", - marker={"size": sz, - "color": colors, - "opacity": 0.6, - "colorscale": "Viridis" - } -)) - -fig.show() -``` - -### config -We can use the `plotly.io.orca.config` object to view the current orca configuration settings. - -```python -import plotly.io as pio -pio.orca.config -``` - -### status -We can use the `plotly.io.orca.status` object to see the current status of the orca server - -```python -import plotly.io as pio -pio.orca.status -``` - -Since no image export operations have been performed yet, the orca server is not yet running. - -Let's export this figure as an SVG image, and record the runtime. - -```python -%%time -import plotly.io as pio -from IPython.display import SVG, display -img_bytes = pio.to_image(fig, format="svg") -display(SVG(img_bytes)) -``` - -By checking the `status` object again, we see that the orca server is now running - -```python -import plotly.io as pio -pio.orca.status -``` - -Let's perform this same export operation again, now that the server is already running. - -```python -%%time -import plotly.io as pio -from IPython.display import SVG, display -img_bytes = pio.to_image(fig, format="svg") -display(SVG(img_bytes)) -``` - -The difference in runtime is dramatic. Starting the server and exporting the first image takes a couple seconds, while exporting an image with a running server is much faster. - - -### Shutdown the Server -By default, the orca server will continue to run until the main Python process exits. It can also be manually shut down by calling the `plotly.io.orca.shutdown_server()` function. Additionally, it is possible to configure the server to shut down automatically after a certain period of inactivity. See the `timeout` configuration parameter below for more information. - -Regardless of how the server is shut down, it will start back up automatically the next time an image export operation is performed. - -```python -import plotly.io as pio -pio.orca.shutdown_server() -pio.orca.status -``` - -```python -import plotly.io as pio -img_bytes = pio.to_image(fig, format="svg") -display(SVG(img_bytes)) -``` - -```python -import plotly.io as pio -pio.orca.status -``` - - -### Configuring the Executable -By default, plotly.py searches the `PATH` for an executable named `orca` and checks that it is a valid plotly orca executable. If plotly.py is unable to find the executable, you'll get an error message that looks something like this: - -``` ----------------------------------------------------------------------------- -ValueError: -The orca executable is required in order to export figures as static images, -but it could not be found on the system path. - -Searched for executable 'orca' on the following path: - /anaconda3/envs/plotly_env/bin - /usr/local/bin - /usr/bin - /bin - /usr/sbin - /sbin - -If you haven't installed orca yet, you can do so using conda as follows: - - $ conda install -c plotly plotly-orca==1.2.1 - -Alternatively, see other installation methods in the orca project README at -https://github.com/plotly/orca. - -After installation is complete, no further configuration should be needed. - -If you have installed orca, then for some reason plotly.py was unable to -locate it. In this case, set the `plotly.io.orca.config.executable` -property to the full path to your orca executable. For example: - - >>> plotly.io.orca.config.executable = '/path/to/orca' - -After updating this executable property, try the export operation again. -If it is successful then you may want to save this configuration so that it -will be applied automatically in future sessions. You can do this as follows: - - >>> plotly.io.orca.config.save() - -If you're still having trouble, feel free to ask for help on the forums at -https://community.plotly.com/c/api/python ----------------------------------------------------------------------------- -``` -If this happens, follow the instructions in the error message and specify the full path to you orca executable using the `plotly.io.orca.config.executable` configuration property. - - -### Other Configuration Settings -In addition to the `executable` property, the `plotly.io.orca.config` object can also be used to configure the following options: - - - **`server_url`**: The URL to an externally running instance of Orca. When this is set, plotly.py will not launch an orca server process and instead use the one provided. - - **`port`**: The specific port to use to communicate with the orca server, or `None` if the port will be chosen automatically. - - **`timeout`**: The number of seconds of inactivity required before the orca server is shut down. For example, if timeout is set to 20, then the orca server will shutdown once is has not been used for at least 20 seconds. If timeout is set to `None` (the default), then the server will not be automatically shut down due to inactivity. - - **`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"`, `"pdf"`, or `"eps"`. - - **`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. - - **`topojson`**: Location of the topojson files needed to render choropleth traces. Defaults to a CDN location. If fully offline export is required, set this to a local directory containing the [Plotly.js topojson files](https://github.com/plotly/plotly.js/tree/master/dist/topojson). - - **`mapbox_access_token`**: Mapbox access token required to render `scattermapbox` traces. - - **`use_xvfb`**: Whether to call orca using [Xvfb](https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml) on Linux. Xvfb is needed for orca to work in a Linux environment if an X11 display server is not available. By default, plotly.py will automatically use Xvfb if it is installed, and no active X11 display server is detected. This can be set to `True` to force the use of Xvfb, or it can be set to `False` to disable the use of Xvfb. - - -### Saving Configuration Settings -Configuration options can optionally be saved to the `~/.plotly/` directory by calling the `plotly.io.config.save()` method. Saved setting will be automatically loaded at the start of future sessions. +> 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. diff --git a/doc/python/renderers.md b/doc/python/renderers.md index ed59be6ee38..9fbcc0f4b2e 100644 --- a/doc/python/renderers.md +++ b/doc/python/renderers.md @@ -45,7 +45,7 @@ In general, there are six different approaches you can take in order to display - Using [Dash](https://dash.plot.ly) in a web app context - Using a [`FigureWidget` rather than a `Figure`](https://plotly.com/python/figurewidget/) in an [`ipywidgets` context](https://ipywidgets.readthedocs.io/en/stable/) - By [exporting to an HTML file](https://plotly.com/python/interactive-html-export/) and loading that file in a browser immediately or later - - By [rendering the figure to a static image file using Kaleido](https://plotly.com/python/static-image-export/) such as PNG, JPEG, SVG, PDF or EPS and loading the resulting file in any viewer + - By [rendering the figure to a static image file using Kaleido](https://plotly.com/python/static-image-export/) such as PNG, JPEG, SVG or PDF and loading the resulting file in any viewer Each of the first four approaches is discussed below. diff --git a/doc/python/static-image-export.md b/doc/python/static-image-export.md index e9b7b317841..9616313c4bb 100644 --- a/doc/python/static-image-export.md +++ b/doc/python/static-image-export.md @@ -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") -~~~ - - ## plotly.io Functions @@ -255,13 +226,31 @@ pio.write_image(fig, "fig.png") ~~~ -## 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 + +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. @@ -269,7 +258,7 @@ The following settings are available. `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,31 +270,6 @@ The following settings are available. `mapbox_access_token`: The default Mapbox access token (Kaleido v0 only). Mapbox traces are deprecated. See the [MapLibre Migration](https://plotly.com/python/mapbox-to-maplibre/) page for more details. -### Set Defaults - -Since Plotly.py 6.1, settings are available on `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 -~~~ - -In earlier versions of Plotly.py, these settings are available on `plotly.io.kaleido.scope`. This is deprecated since version 6.2. Use `plotly.io.defaults` instead. - -~~~python -import plotly.io as pio -# Example using deprecated `plotly.io.kaleido.scope` -pio.kaleido.scope.default_format = "jpeg" -~~~ ### Additional Information on Browsers with Kaleido diff --git a/doc/python/troubleshooting.md b/doc/python/troubleshooting.md index 09c274e3e60..c79a3727e50 100644 --- a/doc/python/troubleshooting.md +++ b/doc/python/troubleshooting.md @@ -77,8 +77,4 @@ The situation is similar for environments like Nteract and Streamlit: in these e ### Orca Problems -> Orca support in Plotly.py is deprecated and will be removed after September 2025. See the [Static Image Export page](/python/static-image-export/) for details on using Kaleido for static image generation. - -If you get an error message stating that the `orca` executable that was found is not valid, this may be because another executable with the same name was found on your system. Please specify the complete path to the Plotly-Orca binary that you downloaded (for instance in the Miniconda folder) with the following command: - -`plotly.io.orca.config.executable = '/home/your_name/miniconda3/bin/orca'` +> 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.