|
8 | 8 |
|
9 | 9 | # Pre-Launch Kaleido v1.0.0
|
10 | 10 |
|
11 |
| -**NOTE: New api versions of Kaleido v1.0.0rc1+ are only available through github.** |
12 |
| -This will change once [plotly.py](https://www.github.com/plotly/plotly.py) |
13 |
| -finishes its integration with the new api. |
| 11 | +Kaleido allows you to convert plotly figures to images. Kaleido v1 is currently available as a release candidate. |
14 | 12 |
|
15 |
| -```bash |
16 |
| -$ pip install git+https://github.com/plotly/kaleido@latest-tag#subdirectory=src/py |
| 13 | +## Migrating from v0 to v1 |
17 | 14 |
|
18 |
| -# also works with `uv add` and `uv run --with PACKAGE` |
19 |
| -``` |
| 15 | +Kaleido v1 introduces a new API. If you're currently using v0, you'll need to make changes to your code and environment where you are running Kaleido. |
| 16 | + |
| 17 | +- Chrome is no longer included with Kaleido. Kaleido will look for an existing Chrome installation, but also provides commands for installing Chrome. If you don't have Chrome, you'll need to install it. See the following installation section for more details. |
| 18 | +- `kaleido.scopes.plotly` has been removed in v1. Kaleido v1 provides `write_fig` and `write_fig_sync` for exporting Plotly figures. |
| 19 | + ``` |
| 20 | + from kaleido import write_fig_sync |
| 21 | + import plotly.graph_objects as go |
| 22 | +
|
| 23 | + fig = go.Figure(data=[go.Scatter(y=[1, 3, 2])]) |
| 24 | + kaleido.write_fig_sync(fig, path="figure.png") |
| 25 | + ``` |
| 26 | + See the Quickstart section below for more details on usage for v1. |
20 | 27 |
|
21 |
| -# Kaleido |
| 28 | +Note: Kaleido v1 works with Plotly v6.1.0 and later. |
22 | 29 |
|
23 |
| -Kaleido allows you to convert plotly figures to images. |
| 30 | +## Installation |
| 31 | + |
| 32 | +To install the Kaleido release candidate: |
24 | 33 |
|
25 | 34 | ```bash
|
26 |
| -$ pip install kaleido |
| 35 | +$ pip install kaleido --upgrade --pre |
27 | 36 | ```
|
28 | 37 |
|
29 |
| -Kaleido's strategy has changed: `chrome` is no longer included. On the other hand, |
30 |
| -it's *much* faster and supports parallel processing and memory-saving techniques. |
31 |
| - |
32 |
| -Kaleido will try to use your own platform's `chrome`, but we recommend the following: |
| 38 | +To install Chrome, we recommend using Kaleido's CLI command: |
33 | 39 |
|
34 | 40 | ```bash
|
35 | 41 | $ kaleido_get_chrome
|
36 | 42 | ```
|
37 | 43 |
|
38 |
| -or |
| 44 | +or functions in Python: |
39 | 45 |
|
40 | 46 | ```python
|
41 | 47 |
|
@@ -104,8 +110,6 @@ my_page = kaleido.PageGenerator(
|
104 | 110 |
|
105 | 111 | There are plenty of doc strings in the source code.
|
106 | 112 |
|
107 |
| -See the [Plotly static image export documentation][plotly-export] for more information. |
108 |
| - |
109 | 113 | [choreographer]: https://pypi.org/project/choreographer/
|
110 | 114 | [plotly]: https://plotly.com/
|
111 | 115 | [plotly-export]: https://plotly.com/python/static-image-export/
|
|
0 commit comments