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
Copy file name to clipboardExpand all lines: src/py/README.md
+21-8Lines changed: 21 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,8 @@
7
7
</div>
8
8
9
9
# Overview
10
-
Kaleido is a cross-platform Python library for generating static images (e.g. png, svg, pdf, etc.) for Plotly.js, to be used by Plotly.py.
10
+
Kaleido is a cross-platform Python library for generating static images
11
+
(e.g. png, svg, pdf, etc.) for Plotly.js, to be used by Plotly.py.
11
12
12
13
## Installation
13
14
@@ -17,7 +18,9 @@ Kaleido can be installed from [PyPI](https://pypi.org/project/kaleido) using `pi
17
18
$ pip install kaleido --upgrade
18
19
```
19
20
20
-
As of version 1.0.0, Kaleido requires Chrome to be installed. If you already have Chrome on your system, Kaleido should find it; otherwise, you can install a compatible Chrome version using the `kaleido_get_chrome` command:
21
+
As of version 1.0.0, Kaleido requires Chrome to be installed. If you already have
22
+
Chrome on your system, Kaleido should find it; otherwise, you can install
23
+
a compatible Chrome version using the `kaleido_get_chrome` command:
21
24
22
25
```bash
23
26
$ kaleido_get_chrome
@@ -32,12 +35,18 @@ kaleido.get_chrome_sync()
32
35
33
36
## Migrating from v0 to v1
34
37
35
-
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.
38
+
Kaleido v1 introduces a new API. If you're currently using v0, you'll need
39
+
to make changes to your code and environment where you are running Kaleido.
36
40
37
41
- If using Kaleido v1 with Plotly.py, you will need to install Plotly.py v6.1.1 or later.
38
-
- 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 installation section above for instructions.
39
-
- If your code uses Kaleido directly: `kaleido.scopes.plotly` has been removed in v1. Kaleido v1 provides `write_fig` and `write_fig_sync` for exporting Plotly figures.
40
-
```
42
+
- Chrome is no longer included with Kaleido. Kaleido will look for an existing Chrome
43
+
installation, but also provides commands for installing Chrome.
44
+
If you don't have Chrome, you'll need to install it.
45
+
See the installation section above for instructions.
46
+
- If your code uses Kaleido directly: `kaleido.scopes.plotly` has been removed in v1.
47
+
Kaleido v1 provides `write_fig` and `write_fig_sync` for exporting Plotly figures.
Below are examples of how to use Kaleido directly in your Python program.
51
60
52
-
If you want to export images of Plotly charts, it's not necessary to call Kaleido directly; you can use functions in the Plotly library. [See the Plotly documentation for instructions.](https://plotly.com/python/static-image-export/)
61
+
If you want to export images of Plotly charts, it's not necessary to call
62
+
Kaleido directly; you can use functions in the Plotly library.
63
+
[See the Plotly documentation for instructions.](https://plotly.com/python/static-image-export/)
53
64
54
65
### Usage examples
55
66
@@ -78,7 +89,8 @@ async with kaleido.Kaleido(n=4, timeout=90) as k:
78
89
# where `fig_objects` is a dict to be expanded to the fig, path, opts arguments.
79
90
```
80
91
81
-
There are shortcut functions which can be used to generate images without creating a `Kaleido()` object:
92
+
There are shortcut functions which can be used to generate images without
93
+
creating a `Kaleido()` object:
82
94
83
95
```python
84
96
import asyncio
@@ -98,6 +110,7 @@ The `page` argument takes a `kaleido.PageGenerator()` to customize versions.
98
110
Normally, kaleido looks for an installed plotly as uses that version. You can pass
99
111
`kaleido.PageGenerator(force_cdn=True)` to force use of a CDN version of plotly (the
100
112
default if plotly is not installed).
113
+
101
114
```
102
115
my_page = kaleido.PageGenerator(
103
116
plotly="A fully qualified link to plotly (https:// or file://)",
0 commit comments