Skip to content

Commit 1758ead

Browse files
authored
Merge branch 'plotly:master' into patch-2
2 parents e0b9ddf + 68b83c0 commit 1758ead

1 file changed

Lines changed: 24 additions & 10 deletions

File tree

src/py/README.md

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
</div>
88

99
# 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.
1112

1213
## Installation
1314

@@ -17,7 +18,9 @@ Kaleido can be installed from [PyPI](https://pypi.org/project/kaleido) using `pi
1718
$ pip install kaleido --upgrade
1819
```
1920

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:
2124

2225
```bash
2326
$ kaleido_get_chrome
@@ -32,12 +35,20 @@ kaleido.get_chrome_sync()
3235

3336
## Migrating from v0 to v1
3437

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.
3640

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.
50+
51+
```python
4152
from kaleido import write_fig_sync
4253
import plotly.graph_objects as go
4354

@@ -49,7 +60,9 @@ kaleido.write_fig_sync(fig, path="figure.png")
4960

5061
Below are examples of how to use Kaleido directly in your Python program.
5162

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/)
5366

5467
### Usage examples
5568

@@ -78,7 +91,8 @@ async with kaleido.Kaleido(n=4, timeout=90) as k:
7891
# where `fig_objects` is a dict to be expanded to the fig, path, opts arguments.
7992
```
8093

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:
8296

8397
```python
8498
import asyncio
@@ -98,11 +112,11 @@ The `page` argument takes a `kaleido.PageGenerator()` to customize versions.
98112
Normally, kaleido looks for an installed plotly as uses that version. You can pass
99113
`kaleido.PageGenerator(force_cdn=True)` to force use of a CDN version of plotly (the
100114
default if plotly is not installed).
115+
101116
```
102117
my_page = kaleido.PageGenerator(
103118
plotly="A fully qualified link to plotly (https:// or file://)",
104119
mathjax=False # no mathjax, or another fully quality link
105120
others=["a list of other script links to include"]
106121
)
107122
```
108-

0 commit comments

Comments
 (0)