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
+24-10Lines changed: 24 additions & 10 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,20 @@ 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
-
- 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
-
```
41
+
- If using Kaleido v1 with Plotly.py, you will need to install
42
+
Plotly.py v6.1.1 or later.
43
+
- Chrome is no longer included with Kaleido. Kaleido will look for an existing Chrome
44
+
installation, but also provides commands for installing Chrome.
45
+
If you don't have Chrome, you'll need to install it.
46
+
See the installation section above for instructions.
47
+
- If your code uses Kaleido directly: `kaleido.scopes.plotly` has been
48
+
removed in v1.
49
+
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
62
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/)
63
+
If you want to export images of Plotly charts, it's not necessary to call
64
+
Kaleido directly; you can use functions in the Plotly library.
65
+
[See the Plotly documentation for instructions.](https://plotly.com/python/static-image-export/)
53
66
54
67
### Usage examples
55
68
@@ -78,7 +91,8 @@ async with kaleido.Kaleido(n=4, timeout=90) as k:
78
91
# where `fig_objects` is a dict to be expanded to the fig, path, opts arguments.
79
92
```
80
93
81
-
There are shortcut functions which can be used to generate images without creating a `Kaleido()` object:
94
+
There are shortcut functions which can be used to generate images without
95
+
creating a `Kaleido()` object:
82
96
83
97
```python
84
98
import asyncio
@@ -98,11 +112,11 @@ The `page` argument takes a `kaleido.PageGenerator()` to customize versions.
98
112
Normally, kaleido looks for an installed plotly as uses that version. You can pass
99
113
`kaleido.PageGenerator(force_cdn=True)` to force use of a CDN version of plotly (the
100
114
default if plotly is not installed).
115
+
101
116
```
102
117
my_page = kaleido.PageGenerator(
103
118
plotly="A fully qualified link to plotly (https:// or file://)",
104
119
mathjax=False # no mathjax, or another fully quality link
105
120
others=["a list of other script links to include"]
0 commit comments