Skip to content

Commit d9ba65c

Browse files
authored
Merge branch 'main' into plt-import
2 parents 622428a + 380eefa commit d9ba65c

36 files changed

+762
-609
lines changed

.github/workflows/check-js-build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ jobs:
2929
cd js
3030
npm ci
3131
npm run build
32+
npm ls
3233
- name: Check JupyterLab build artifacts
3334
run: |
3435
# 1. Hash contents of all static files, sort by content hash

CITATION.cff

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ authors:
99
- family-names: "Parmer"
1010
given-names: "Chris"
1111
title: "An interactive, open-source, and browser-based graphing library for Python"
12-
version: 5.24.1
12+
version: 6.3.0
1313
doi: 10.5281/zenodo.14503524
14-
date-released: 2024-09-12
14+
date-released: 2025-08-12
1515
url: "https://github.com/plotly/plotly.py"
16+

CONTRIBUTING.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,20 @@ you can install all packages with:
120120
pip install -e '.[dev]'
121121
```
122122

123+
If you're testing local changes in Jupyter Lab or Jupyter Notebook, you'll want to run these commands when you're setting up your development environment:
124+
```bash
125+
pip install jupyter
126+
jupyter labextension develop .
127+
```
128+
If you don't run that command, your figure will not render in the Jupyter Lab/ Jupyter Notebook editors.
129+
130+
If you're changing any of the code under the `js/` directory, you'll also want to run these commands:
131+
```
132+
cd js/
133+
npm ci
134+
npm run build
135+
```
136+
123137
These commands also create an *editable install* of plotly.py
124138
so that you can test your changes iteratively without having to rebuild the plotly.py package explicitly;
125139
for more information please see

codegen/resources/plot-schema.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4008,7 +4008,7 @@
40084008
"valType": "string"
40094009
},
40104010
"type": {
4011-
"description": "Sets the layer type, that is the how the layer data set in `source` will be rendered With `sourcetype` set to *geojson*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. but note that *line* and *fill* are not compatible with Point GeoJSON geometries. With `sourcetype` set to *vector*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. With `sourcetype` set to *raster* or `*image*`, only the *raster* value is allowed.",
4011+
"description": "Sets the layer type, that is the how the layer data set in `source` will be rendered With `sourcetype` set to *geojson*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. but note that *line* and *fill* are not compatible with Point GeoJSON geometries. With `sourcetype` set to *vector*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. With `sourcetype` set to *raster* or *image*, only the *raster* value is allowed.",
40124012
"dflt": "circle",
40134013
"editType": "plot",
40144014
"valType": "enumerated",
@@ -4414,7 +4414,7 @@
44144414
"valType": "string"
44154415
},
44164416
"type": {
4417-
"description": "Sets the layer type, that is the how the layer data set in `source` will be rendered With `sourcetype` set to *geojson*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. but note that *line* and *fill* are not compatible with Point GeoJSON geometries. With `sourcetype` set to *vector*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. With `sourcetype` set to *raster* or `*image*`, only the *raster* value is allowed.",
4417+
"description": "Sets the layer type, that is the how the layer data set in `source` will be rendered With `sourcetype` set to *geojson*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. but note that *line* and *fill* are not compatible with Point GeoJSON geometries. With `sourcetype` set to *vector*, the following values are allowed: *circle*, *line*, *fill* and *symbol*. With `sourcetype` set to *raster* or *image*, only the *raster* value is allowed.",
44184418
"dflt": "circle",
44194419
"editType": "plot",
44204420
"valType": "enumerated",
@@ -47932,7 +47932,7 @@
4793247932
"valType": "number"
4793347933
},
4793447934
"source": {
47935-
"description": "Specifies the data URI of the image to be visualized. The URI consists of \"data:image/[<media subtype>][;base64],<data>\"",
47935+
"description": "Specifies the data URI of the image to be visualized. The URI consists of \"data:image/[<media subtype\\\\>][;base64\\\\],<data\\\\>\"",
4793647936
"editType": "calc",
4793747937
"valType": "string"
4793847938
},
@@ -53288,7 +53288,7 @@
5328853288
]
5328953289
},
5329053290
"hovertemplate": {
53291-
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. This value here applies when hovering over dimensions. Note that `*categorycount`, *colorcount* and *bandcolorcount* are only available when `hoveron` contains the *color* flagFinally, the template string has access to variables `count`, `probability`, `category`, `categorycount`, `colorcount` and `bandcolorcount`. Anything contained in tag `<extra>` is displayed in the secondary box, for example `<extra>%{fullData.name}</extra>`. To hide the secondary box completely, use an empty tag `<extra></extra>`.",
53291+
"description": "Template string used for rendering the information that appear on hover box. Note that this will override `hoverinfo`. Variables are inserted using %{variable}, for example \"y: %{y}\" as well as %{xother}, {%_xother}, {%_xother_}, {%xother_}. When showing info for several points, *xother* will be added to those with different x positions from the first point. An underscore before or after *(x|y)other* will add a space on that side, only when this field is shown. Numbers are formatted using d3-format's syntax %{variable:d3-format}, for example \"Price: %{y:$.2f}\". https://github.com/d3/d3-format/tree/v1.4.5#d3-format for details on the formatting syntax. Dates are formatted using d3-time-format's syntax %{variable|d3-time-format}, for example \"Day: %{2019-01-01|%A}\". https://github.com/d3/d3-time-format/tree/v2.2.3#locale_format for details on the date formatting syntax. The variables available in `hovertemplate` are the ones emitted as event data described at this link https://plotly.com/javascript/plotlyjs-events/#event-data. Additionally, every attributes that can be specified per-point (the ones that are `arrayOk: true`) are available. This value here applies when hovering over dimensions. Note that *categorycount*, *colorcount* and *bandcolorcount* are only available when `hoveron` contains the *color* flag. Finally, the template string has access to variables `count`, `probability`, `category`, `categorycount`, `colorcount` and `bandcolorcount`. Anything contained in tag `<extra>` is displayed in the secondary box, for example `<extra>%{fullData.name}</extra>`. To hide the secondary box completely, use an empty tag `<extra></extra>`.",
5329253292
"dflt": "",
5329353293
"editType": "plot",
5329453294
"valType": "string"

commands.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -296,8 +296,8 @@ def update_plotlyjs_dev(args, outdir):
296296
perform_codegen(outdir)
297297

298298

299-
def parse_args():
300-
"""Parse command-line arguments."""
299+
def make_parser():
300+
"""Make argument parser."""
301301

302302
parser = argparse.ArgumentParser()
303303
subparsers = parser.add_subparsers(dest="cmd", help="Available subcommands")
@@ -322,6 +322,11 @@ def parse_args():
322322

323323
subparsers.add_parser("updateplotlyjs", help="update plotly.js")
324324

325+
return parser
326+
327+
328+
def parse_args(parser: argparse.ArgumentParser):
329+
"""Parse command line arguments."""
325330
return parser.parse_args()
326331

327332

@@ -331,7 +336,8 @@ def main():
331336
project_root = os.path.dirname(os.path.realpath(__file__))
332337
outdir = os.path.join(project_root, "plotly")
333338

334-
args = parse_args()
339+
parser = make_parser()
340+
args = parse_args(parser)
335341

336342
if args.cmd == "codegen":
337343
perform_codegen(outdir, noformat=args.noformat)
@@ -350,6 +356,10 @@ def main():
350356
print(version)
351357
update_plotlyjs(version, outdir)
352358

359+
elif args.cmd is None:
360+
parser.print_help()
361+
sys.exit(1)
362+
353363
else:
354364
print(f"unknown command {args.cmd}", file=sys.stderr)
355365
sys.exit(1)

doc/python/3d-mesh.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,8 @@ Whereas the previous example used the default `intensitymode='vertex'`, we plot
154154

155155
```python
156156
import plotly.graph_objects as go
157+
import numpy as np
158+
157159
fig = go.Figure(data=[
158160
go.Mesh3d(
159161
# 8 vertices of a cube

doc/python/axes.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ The PX `labels` argument can also be used without a data frame argument:
118118

119119
```python
120120
import plotly.express as px
121-
fig = px.bar(df, x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
121+
fig = px.bar(x=["Apples", "Oranges"], y=[10,20], color=["Here", "There"],
122122
labels=dict(x="Fruit", y="Amount", color="Place")
123123
)
124124
fig.show()
@@ -460,6 +460,7 @@ Here, `ticklabelstandoff=15` moves the labels 15 pixels further away from the x-
460460

461461
```python
462462
import plotly.express as px
463+
import pandas as pd
463464

464465
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
465466

@@ -487,6 +488,7 @@ To draw the label for the minor tick before each major tick, set `ticklabelindex
487488

488489
```python
489490
import plotly.express as px
491+
import pandas as pd
490492

491493
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/finance-charts-apple.csv')
492494

doc/python/box-plots.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -448,6 +448,7 @@ fig.show()
448448

449449
```python
450450
import plotly.graph_objects as go
451+
import numpy as np
451452

452453
x_data = ['Carmelo Anthony', 'Dwyane Wade',
453454
'Deron Williams', 'Brook Lopez',

doc/python/creating-and-updating-figures.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ fig.show()
206206
The `plotly.subplots.make_subplots()` function produces a graph object figure that is preconfigured with a grid of subplots that traces can be added to. The `add_trace()` function will be discussed more below.
207207

208208
```python
209+
import plotly.graph_objects as go
209210
from plotly.subplots import make_subplots
210211

211212
fig = make_subplots(rows=1, cols=2)
@@ -260,6 +261,7 @@ fig.show()
260261
If a figure was created using `plotly.subplots.make_subplots()`, then supplying the `row` and `col` arguments to `add_trace()` can be used to add a trace to a particular subplot.
261262

262263
```python
264+
import plotly.graph_objects as go
263265
from plotly.subplots import make_subplots
264266

265267
fig = make_subplots(rows=1, cols=2)
@@ -274,6 +276,7 @@ This also works for figures created by Plotly Express using the `facet_row` and
274276

275277
```python
276278
import plotly.express as px
279+
import plotly.graph_objects as go
277280

278281
df = px.data.iris()
279282

doc/python/imshow.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ jupyter:
55
text_representation:
66
extension: .md
77
format_name: markdown
8-
format_version: '1.2'
9-
jupytext_version: 1.4.2
8+
format_version: '1.3'
9+
jupytext_version: 1.17.2
1010
kernelspec:
11-
display_name: Python 3
11+
display_name: Python 3 (ipykernel)
1212
language: python
1313
name: python3
1414
language_info:
@@ -20,7 +20,7 @@ jupyter:
2020
name: python
2121
nbconvert_exporter: python
2222
pygments_lexer: ipython3
23-
version: 3.7.7
23+
version: 3.12.0
2424
plotly:
2525
description: How to display image data in Python with Plotly.
2626
display_as: scientific
@@ -61,7 +61,7 @@ In order to create a numerical array to be passed to `px.imshow`, you can use a
6161
```python
6262
import plotly.express as px
6363
from skimage import io
64-
img = io.imread('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
64+
img = io.imread('https://user-images.githubusercontent.com/72614349/179115668-2630e3e4-3a9f-4c88-9494-3412e606450a.jpg')
6565
fig = px.imshow(img)
6666
fig.show()
6767
```
@@ -274,6 +274,7 @@ fig.show()
274274
### Displaying an image and the histogram of color values
275275

276276
```python
277+
import plotly.graph_objects as go
277278
from plotly.subplots import make_subplots
278279
from skimage import data
279280
img = data.chelsea()

0 commit comments

Comments
 (0)