Skip to content

Commit 6f17103

Browse files
authored
Merge pull request #4595 from plotly/make-docs-live
Merge master back to doc-prod to make docs changes live
2 parents 2fa17d9 + c562a65 commit 6f17103

File tree

2,149 files changed

+76819
-922
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,149 files changed

+76819
-922
lines changed

Diff for: CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
All notable changes to this project will be documented in this file.
33
This project adheres to [Semantic Versioning](http://semver.org/).
44

5+
## [5.22.0] - 2024-05-01
6+
7+
### Updated
8+
- Updated Plotly.js from version 2.31.1 to version 2.32.0. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2320----2024-04-23) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
9+
- Add "bold" weight, "italic" style and "small-caps" variant options to fonts [#6956]
10+
- Fix applying autotickangles on axes with showdividers as well as cases where tickson is set to "boundaries" [#6967], with thanks to @my-tien for the contribution!
11+
- Fix positioning of multi-line axis titles with standoff [#6970], with thanks to @my-tien for the contribution!
12+
513
## [5.21.0] - 2024-04-17
614

715
### Updated

Diff for: README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333

3434
## Quickstart
3535

36-
`pip install plotly==5.21.0`
36+
`pip install plotly==5.22.0`
3737

3838
Inside [Jupyter](https://jupyter.org/install) (installable with `pip install "jupyterlab>=3" "ipywidgets>=7.6"`):
3939

@@ -78,13 +78,13 @@ Built on top of [plotly.js](https://github.com/plotly/plotly.js), `plotly.py` is
7878
plotly.py may be installed using pip...
7979

8080
```
81-
pip install plotly==5.21.0
81+
pip install plotly==5.22.0
8282
```
8383

8484
or conda.
8585

8686
```
87-
conda install -c plotly plotly=5.21.0
87+
conda install -c plotly plotly=5.22.0
8888
```
8989

9090
### JupyterLab Support
@@ -106,7 +106,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
106106

107107
```
108108
# JupyterLab 2.x renderer support
109-
jupyter labextension install jupyterlab-plotly@5.21.0 @jupyter-widgets/jupyterlab-manager
109+
jupyter labextension install jupyterlab-plotly@5.22.0 @jupyter-widgets/jupyterlab-manager
110110
```
111111

112112
Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.

Diff for: binder/requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
jupytext
2-
plotly==5.21.0
2+
plotly==5.22.0
33
jupyter
44
notebook
55
pandas==1.2.0

Diff for: doc/apidoc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ""
2828
# The full version, including alpha/beta/rc tags
29-
release = "5.21.0"
29+
release = "5.22.0"
3030

3131

3232
# -- General configuration ---------------------------------------------------

Diff for: doc/python/figure-labels.md

+56-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jupyter:
66
extension: .md
77
format_name: markdown
88
format_version: '1.3'
9-
jupytext_version: 1.14.5
9+
jupytext_version: 1.16.1
1010
kernelspec:
1111
display_name: Python 3 (ipykernel)
1212
language: python
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.10.9
23+
version: 3.10.11
2424
plotly:
2525
description: How to set the global font, title, legend-entries, and axis-titles
2626
in python.
@@ -159,6 +159,60 @@ fig.update_layout(
159159
fig.show()
160160
```
161161

162+
### Configuring Font Variant, Style, and Weight
163+
164+
*New in 5.22*
165+
166+
You can configure a `variant`, `style`, and `weight` on `layout.font`. Here, we set the font variant to `small-caps`.
167+
168+
```python
169+
import plotly.graph_objects as go
170+
from plotly import data
171+
172+
df = data.iris()
173+
174+
setosa_df = df[df["species"] == "setosa"]
175+
versicolor_df = df[df["species"] == "versicolor"]
176+
virginica_df = df[df["species"] == "virginica"]
177+
178+
fig = go.Figure(
179+
data=[
180+
go.Scatter(
181+
x=setosa_df["sepal_width"],
182+
y=setosa_df["sepal_length"],
183+
mode="markers",
184+
name="setosa",
185+
),
186+
go.Scatter(
187+
x=versicolor_df["sepal_width"],
188+
y=versicolor_df["sepal_length"],
189+
mode="markers",
190+
name="versicolor",
191+
),
192+
go.Scatter(
193+
x=virginica_df["sepal_width"],
194+
y=virginica_df["sepal_length"],
195+
mode="markers",
196+
name="virginica",
197+
),
198+
],
199+
layout=go.Layout(
200+
title="Plot Title",
201+
xaxis=dict(title="X Axis Title"),
202+
yaxis=dict(title="Y Axis Title"),
203+
legend=dict(title="Legend Title"),
204+
font=dict(
205+
family="Courier New, monospace",
206+
size=18,
207+
color="RebeccaPurple",
208+
variant="small-caps",
209+
)
210+
)
211+
)
212+
213+
fig.show()
214+
```
215+
162216
The configuration of the legend is discussed in detail in the [Legends](/python/legend/) page.
163217

164218
### Align Plot Title

Diff for: doc/python/getting-started.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot
5858
`plotly` may be installed using `pip`:
5959

6060
```
61-
$ pip install plotly==5.21.0
61+
$ pip install plotly==5.22.0
6262
```
6363

6464
or `conda`:
6565

6666
```
67-
$ conda install -c plotly plotly=5.21.0
67+
$ conda install -c plotly plotly=5.22.0
6868
```
6969
This package contains everything you need to write figures to standalone HTML files.
7070

@@ -152,7 +152,7 @@ The instructions above apply to JupyterLab 3.x. **For JupyterLab 2 or earlier**,
152152

153153
```
154154
# JupyterLab 2.x renderer support
155-
jupyter labextension install jupyterlab-plotly@5.21.0 @jupyter-widgets/jupyterlab-manager
155+
jupyter labextension install jupyterlab-plotly@5.22.0 @jupyter-widgets/jupyterlab-manager
156156
```
157157

158158
Please check out our [Troubleshooting guide](/python/troubleshooting/) if you run into any problems with JupyterLab, particularly if you are using multiple python environments inside Jupyter.

Diff for: doc/python/text-and-annotations.md

+49-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,9 @@ fig.update_layout(
307307
fig.show()
308308
```
309309

310-
### Custom Text Color and Styling
310+
### Font Color, Size, and Familiy
311+
312+
Use `textfont` to specify a font `family`, `size`, or `color`.
311313

312314
```python
313315
import plotly.graph_objects as go
@@ -347,6 +349,52 @@ fig.update_layout(showlegend=False)
347349
fig.show()
348350
```
349351

352+
### Font Style, Variant, and Weight
353+
354+
*New in 5.22*
355+
356+
You can also configure a font's `variant`, `style`, and `weight` on `textfont`. Here, we configure an `italic` style on the first bar, `bold` weight on the second, and`small-caps` as the font variant on the third.
357+
358+
```python
359+
import plotly.graph_objects as go
360+
from plotly import data
361+
362+
df = data.medals_wide()
363+
364+
fig = go.Figure(
365+
data=[
366+
go.Bar(
367+
x=df.nation,
368+
y=df.gold,
369+
name="Gold",
370+
marker=dict(color="Gold"),
371+
text="Gold",
372+
textfont=dict(style="italic"),
373+
),
374+
go.Bar(
375+
x=df.nation,
376+
y=df.silver,
377+
name="Silver",
378+
marker=dict(color="MediumTurquoise"),
379+
text="Silver",
380+
textfont=dict(weight="bold"),
381+
),
382+
go.Bar(
383+
x=df.nation,
384+
y=df.bronze,
385+
name="Bronze",
386+
marker=dict(color="LightGreen"),
387+
text="Bronze",
388+
textfont=dict(variant="small-caps"),
389+
),
390+
],
391+
layout=dict(barcornerradius=15, showlegend=False),
392+
)
393+
394+
fig.show()
395+
396+
```
397+
350398
### Styling and Coloring Annotations
351399

352400
```python

Diff for: doc/requirements.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
plotly==5.21.0
1+
plotly==5.22.0
22
jupytext==1.1.1
33
ipywidgets==7.7.2
44
jupyter-client<7
@@ -45,3 +45,4 @@ jinja2<3.1
4545
parmed<=3.4.4; python_version<"3.8"
4646
dask==2022.2.0
4747
polars
48+
geoparse<=2.0.3

Diff for: packages/javascript/jupyterlab-plotly/package-lock.json

+19-18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: packages/javascript/jupyterlab-plotly/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jupyterlab-plotly",
3-
"version": "5.21.0",
3+
"version": "5.22.0",
44
"description": "The plotly Jupyter extension",
55
"author": "The plotly.py team",
66
"license": "MIT",
@@ -65,7 +65,7 @@
6565
"@lumino/messaging": "^1.2.3",
6666
"@lumino/widgets": "^1.8.1",
6767
"lodash": "^4.17.4",
68-
"plotly.js": "^2.31.1"
68+
"plotly.js": "^2.32.0"
6969
},
7070
"jupyterlab": {
7171
"extension": "lib/jupyterlab-plugin",

0 commit comments

Comments
 (0)