Skip to content

Make docs updates for 5.21 live #4577

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 40 commits into from
Apr 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
c29e662
Providing doc and changelog URLs in setup.py for PyPi
Pierre-VF Feb 16, 2024
9e4f39e
Add --local flag to updateplotlyjsdev
ayjayt Feb 19, 2024
a8f5ad5
Update contributing.md for using a local plotly.js
ayjayt Feb 19, 2024
406c744
Lint
ayjayt Feb 19, 2024
cf0c61f
skip version test
archmoj Mar 11, 2024
0589e43
Merge pull request #4526 from geopozo/feature/pikul-local-updateplotl…
archmoj Mar 22, 2024
9f94cfa
Update packages/python/plotly/setup.py
archmoj Mar 22, 2024
be0e083
Merge branch 'master' into patch-1
archmoj Mar 22, 2024
246b520
Merge pull request #4525 from Pierre-VF/patch-1
archmoj Mar 22, 2024
586aeeb
Merge pull request #4547 from plotly/skip-version-test
archmoj Mar 22, 2024
186bd75
import orjson on initial load
emilykl Mar 29, 2024
564d2d8
improved logic for optional module loading
emilykl Apr 3, 2024
5ec780a
remove extra orjson load
emilykl Apr 3, 2024
6e59a50
remove else
emilykl Apr 3, 2024
51c5597
remove else
emilykl Apr 3, 2024
b8fd65e
bump pytest version to fix tests?
emilykl Apr 5, 2024
c8df8e3
update plotly.js version to 2.31.0
LiamConnors Apr 10, 2024
c220a9e
refresh cache
LiamConnors Apr 10, 2024
c026e49
add shape layer example
LiamConnors Apr 10, 2024
433ef1b
Update CHANGELOG.md
LiamConnors Apr 10, 2024
310db94
add hoversubplots examples
LiamConnors Apr 11, 2024
4f72c59
refresh doc test cache
emilykl Apr 11, 2024
2293ba8
update shape layer example
LiamConnors Apr 12, 2024
b2721ed
update example text
LiamConnors Apr 12, 2024
5a779bc
add zorder line example
LiamConnors Apr 12, 2024
cef9a23
Update splom.md
LiamConnors Apr 12, 2024
2260b65
Update cone-plot.md
LiamConnors Apr 12, 2024
69631b5
add zorder to multiple chart types
LiamConnors Apr 12, 2024
b909d48
Merge pull request #4562 from plotly/fix-3567-orjson-import
emilykl Apr 15, 2024
eb49162
update plotly.js to 2.31.1
LiamConnors Apr 15, 2024
09404d9
Merge branch 'master' into docs-updates-5-21
LiamConnors Apr 15, 2024
ae1ecc9
Update cone-plot.md
LiamConnors Apr 15, 2024
c39209a
remove unused line
LiamConnors Apr 16, 2024
4c722f2
Merge pull request #4569 from plotly/docs-updates-5-21
LiamConnors Apr 16, 2024
17bb2b5
Merge branch 'master' into recent-doc-prod-updates
LiamConnors Apr 16, 2024
2cbd7e8
Merge pull request #4572 from plotly/recent-doc-prod-updates
LiamConnors Apr 16, 2024
84456f3
version changes for v5.21.0
LiamConnors Apr 17, 2024
c86d025
Merge pull request #4575 from plotly/release-5.21.0
LiamConnors Apr 17, 2024
d6c8948
update-docs-versions-5-21
LiamConnors Apr 17, 2024
05aeeb3
Merge pull request #4576 from plotly/update-docs-5-21-0
LiamConnors Apr 17, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ jobs:
resource_class: xlarge
docker:
# specify the version you desire here
# use `-browsers` prefix for selenium tests, for example, `3.6.1-browsers`
# use `-browsers` prefix for selenium tests, for example, `3.9-browsers`
- image: cimg/python:3.9-browsers

steps:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,20 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [5.21.0] - 2024-04-17

### Updated
- Updated Plotly.js from version 2.30.0 to version 2.31.1. See the [plotly.js CHANGELOG](https://github.com/plotly/plotly.js/blob/master/CHANGELOG.md#2311----2024-04-15) for more information. These changes are reflected in the auto-generated `plotly.graph_objects` module. Notable changes include:
- Add `zorder` attribute to various cartesian traces for controlling stacking order of SVG traces drawn into a subplot [[#6918](https://github.com/plotly/plotly.js/pull/6918), [#6953](https://github.com/plotly/plotly.js/pull/6953)],
This feature was anonymously sponsored: thank you to our sponsor!
- Add "between" option to shape layer for placing them above grid lines and below traces [[#6927](https://github.com/plotly/plotly.js/pull/6927)],
with thanks to @my-tien for the contribution!
- Add "raw" `sizemode` to cone trace [[#6938](https://github.com/plotly/plotly.js/pull/6938)]
- Add `layout.hoversubplots` to enable hover effects across multiple cartesian suplots sharing one axis [[#6947](https://github.com/plotly/plotly.js/pull/6947), [#6950](https://github.com/plotly/plotly.js/pull/6950)]

### Fixed
- Fixed `orjson` loading issue [[#4562](https://github.com/plotly/plotly.py/pull/4562)]

## [5.20.0] - 2024-03-13

### Updated
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

## Quickstart

`pip install plotly==5.20.0`
`pip install plotly==5.21.0`

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

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

```
pip install plotly==5.20.0
pip install plotly==5.21.0
```

or conda.

```
conda install -c plotly plotly=5.20.0
conda install -c plotly plotly=5.21.0
```

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

```
# JupyterLab 2.x renderer support
jupyter labextension install jupyterlab-plotly@5.20.0 @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyterlab-plotly@5.21.0 @jupyter-widgets/jupyterlab-manager
```

Please check out our [Troubleshooting guide](https://plotly.com/python/troubleshooting/) if you run into any problems with JupyterLab.
Expand Down
2 changes: 1 addition & 1 deletion binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jupytext
plotly==5.20.0
plotly==5.21.0
jupyter
notebook
pandas==1.2.0
Expand Down
25 changes: 24 additions & 1 deletion contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,30 @@ the `plotly/plotly.js` GitHub repository (and place them in
`plotly/package_data`). It will then regenerate all of the `graph_objs`
classes based on the new schema.

For dev branches, it is also possible to use `updateplotlyjsdev --devrepo reponame --devbranch branchname` to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.
For dev branches, it is also possible to use `updateplotlyjsdev` in two configurations:

### CircleCI Release

If your devbranch is part of the official plotly.js repository, you can use
```bash
python setup.py updateplotlyjsdev --devrepo reponame --devbranch branchname
```
to update to development versions of `plotly.js`. This will fetch the `plotly.js` in the CircleCI artifact of the branch `branchname` of the repo `reponame`. If `--devrepo` or `--devbranch` are omitted, `updateplotlyjsdev` defaults using `plotly/plotly.js` and `master` respectively.

### Local Repository

If you have a local repository of `plotly.js` you'd like to try, you can run:

```bash
# In your plotly.js/ directory, prepare the package:

$ npm run build
$ npm pack
$ mv plotly.js-*.tgz plotly.js.tgz

# In your plotly.py/packages/python/plotly/ directory:
$ python setup.py updateplotlyjsdev --local /path/to/your/plotly.js/
```

## Testing

Expand Down
2 changes: 1 addition & 1 deletion doc/apidoc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = ""
# The full version, including alpha/beta/rc tags
release = "5.20.0"
release = "5.21.0"


# -- General configuration ---------------------------------------------------
Expand Down
48 changes: 43 additions & 5 deletions doc/python/cone-plot.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ jupyter:
text_representation:
extension: .md
format_name: markdown
format_version: '1.2'
jupytext_version: 1.3.0
format_version: '1.3'
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.7.3
version: 3.10.11
plotly:
description: How to make 3D Cone plots in Python with Plotly.
display_as: 3d_charts
Expand Down Expand Up @@ -126,5 +126,43 @@ fig.update_layout(scene=dict(aspectratio=dict(x=1, y=1, z=0.8),
fig.show()
```

### Sizemode

Earlier examples use `sizemode="absolute"` when adjusting the cone size scaling with `sizeref`. `sizemode` also supports `raw`(new in 5.21) and `scaled`.

```python
import plotly.graph_objects as go
import pandas as pd

df = pd.read_csv(
"https://raw.githubusercontent.com/plotly/datasets/master/cone_plot_data.csv"
)

fig = go.Figure(
data=go.Cone(
x=df["x"],
y=df["y"],
z=df["z"],
u=df["u"],
v=df["v"],
w=df["w"],
sizemode="raw",
sizeref=0.1,
colorscale="Portland",
cmin=0,
cmax=80,
hoverinfo="u+v+w+text",
text="-> wind <-",
),
layout=dict(
width=900, height=600, scene=dict(camera=dict(eye=dict(x=1.2, y=0, z=0.6)))
),
)


fig.show()

```

#### Reference
See https://plotly.com/python/reference/ for more information and chart attribute options!
See https://plotly.com/python/reference/ for more information and chart attribute options!
6 changes: 3 additions & 3 deletions doc/python/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ We also encourage you to join the [Plotly Community Forum](http://community.plot
`plotly` may be installed using `pip`:

```
$ pip install plotly==5.20.0
$ pip install plotly==5.21.0
```

or `conda`:

```
$ conda install -c plotly plotly=5.20.0
$ conda install -c plotly plotly=5.21.0
```
This package contains everything you need to write figures to standalone HTML files.

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

```
# JupyterLab 2.x renderer support
jupyter labextension install jupyterlab-plotly@5.20.0 @jupyter-widgets/jupyterlab-manager
jupyter labextension install jupyterlab-plotly@5.21.0 @jupyter-widgets/jupyterlab-manager
```

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.
Expand Down
40 changes: 38 additions & 2 deletions doc/python/graphing-multiple-chart-types.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.1
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.8.0
version: 3.10.11
plotly:
description: How to design figures with multiple chart types in python.
display_as: file_settings
Expand Down Expand Up @@ -208,5 +208,41 @@ fig.add_trace(
fig.show()
```

#### Trace Zorder

*New in 5.21*

You can move a trace in front of or behind another trace by setting its `zorder`. All traces have a default `zorder` of `0`. In the following example, we set `zorder` on the bar trace to `1` to move it in front of the scatter trace.

```python
import plotly.graph_objects as go

x = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
y_bar = [10, 15, 7, 10, 17, 15, 14, 20, 16, 19, 15, 17]
y_area = [12, 13, 10, 14, 15, 13, 16, 18, 15, 17, 14, 16]

area_trace = go.Scatter(
x=x,
y=y_area,
fill="tozeroy",
mode="lines+markers",
name="Area Trace with default `zorder` of 0",
line=dict(color="lightsteelblue"),
)

bar_trace = go.Bar(
x=x,
y=y_bar,
name="Bar Trace with `zorder` of 1",
zorder=1,
marker=dict(color="lightslategray"),
)

fig = go.Figure(data=[area_trace, bar_trace])

fig.show()

```

#### Reference
See https://plotly.com/python/reference/ for more information and attribute options!
37 changes: 34 additions & 3 deletions doc/python/hover-text-and-formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.1
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3
display_name: Python 3 (ipykernel)
language: python
name: python3
language_info:
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.8.8
version: 3.10.11
plotly:
description: How to use hover text and formatting in Python with Plotly.
display_as: file_settings
Expand Down Expand Up @@ -116,6 +116,37 @@ fig.update_layout(hovermode='x unified')
fig.show()
```

#### Hover on Subplots

*New in 5.21*

Use `hoversubplots` to define how hover effects expand to additional subplots. With `hoversubplots=axis`, hover effects are included on stacked subplots using the same axis when `hovermode` is set to `x`, `x unified`, `y`, or `y unified`.

```python
import plotly.graph_objects as go
import pandas as pd
from plotly import data

df = data.stocks()

layout = dict(
hoversubplots="axis",
title="Stock Price Changes",
hovermode="x",
grid=dict(rows=3, columns=1),
)

data = [
go.Scatter(x=df["date"], y=df["AAPL"], xaxis="x", yaxis="y", name="Apple"),
go.Scatter(x=df["date"], y=df["GOOG"], xaxis="x", yaxis="y2", name="Google"),
go.Scatter(x=df["date"], y=df["AMZN"], xaxis="x", yaxis="y3", name="Amazon"),
]

fig = go.Figure(data=data, layout=layout)

fig.show()
```

### Customizing Hover Label Appearance

Hover label text and colors default to trace colors in hover modes other than `unified`, and can be globally set via the `layout.hoverlabel` attributes. Hover label appearance can also be controlled per trace in `<trace>.hoverlabel`.
Expand Down
46 changes: 44 additions & 2 deletions doc/python/line-and-scatter.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jupyter:
extension: .md
format_name: markdown
format_version: '1.3'
jupytext_version: 1.14.1
jupytext_version: 1.16.1
kernelspec:
display_name: Python 3 (ipykernel)
language: python
Expand All @@ -20,7 +20,7 @@ jupyter:
name: python
nbconvert_exporter: python
pygments_lexer: ipython3
version: 3.8.0
version: 3.10.11
plotly:
description: How to make scatter plots in Python with Plotly.
display_as: basic
Expand Down Expand Up @@ -426,6 +426,48 @@ fig = go.Figure(data=go.Scatter(
fig.show()
```

#### Trace Zorder

*New in 5.21*

For many trace types, including `go.Scatter`, you can define the order traces are drawn in by setting a `zorder`. Traces with a higher `zorder` appear at the front, with traces with a lower `zorder` at the back. In this example, we give our trace for 'France' the highest `zorder`, meaning it is drawn in front of the other two traces:

```python
import plotly.graph_objects as go
import plotly.data as data

df = data.gapminder()

df_europe = df[df['continent'] == 'Europe']

trace1 = go.Scatter(x=df_europe[df_europe['country'] == 'France']['year'],
y=df_europe[df_europe['country'] == 'France']['lifeExp'],
mode='lines+markers',
zorder=3,
name='France',
marker=dict(size=15))

trace2 = go.Scatter(x=df_europe[df_europe['country'] == 'Germany']['year'],
y=df_europe[df_europe['country'] == 'Germany']['lifeExp'],
mode='lines+markers',
zorder=1,
name='Germany',
marker=dict(size=15))

trace3 = go.Scatter(x=df_europe[df_europe['country'] == 'Spain']['year'],
y=df_europe[df_europe['country'] == 'Spain']['lifeExp'],
mode='lines+markers',
zorder=2,
name='Spain',
marker=dict(size=15))

layout = go.Layout(title='Life Expectancy in Europe Over Time')

fig = go.Figure(data=[trace1, trace2, trace3], layout=layout)

fig.show()
```

#### Large Data Sets

Now in Plotly you can implement WebGL with `Scattergl()` in place of `Scatter()` <br>
Expand Down
Loading