Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
d21f904
re-add ipython.get_ipython() check in _renderers.py
emilykl Jun 30, 2025
f141978
add test to ensure default renderer is 'browser'
emilykl Jun 30, 2025
27b8e6d
Update CONTRIBUTING.md to include jupyter lab local development instr…
marthacryan Jul 10, 2025
a2a3d65
Update CONTRIBUTING.md
marthacryan Jul 18, 2025
c2a34e8
Update CONTRIBUTING.md
marthacryan Jul 18, 2025
36b21ab
add missing imports and variable definitions
LiamConnors Jul 29, 2025
776cf20
fix interp_mode typo
Lexachoc Aug 11, 2025
1528322
Use native legends when converting from matplotlib
robertoffmoura Aug 8, 2025
64d5be9
Run ruff format
robertoffmoura Aug 12, 2025
7e84f19
Merge pull request #5302 from plotly/fix-docs
gvwilson Aug 27, 2025
e37fa2b
fix
gmjw Sep 5, 2025
d1414e1
Add list of supported values
LiamConnors Sep 10, 2025
6da5669
update links
LiamConnors Sep 12, 2025
2c49b57
Merge pull request #5345 from plotly/fix-broken-docs-build
LiamConnors Sep 12, 2025
60276e2
Merge branch 'doc-prod' into add-maki
LiamConnors Sep 12, 2025
2d36a86
Merge pull request #5344 from plotly/add-maki
LiamConnors Sep 15, 2025
65e3b39
Merge branch 'main' into marthacryan-patch-1
marthacryan Sep 29, 2025
2d6771f
Merge pull request #5274 from plotly/marthacryan-patch-1
marthacryan Sep 29, 2025
7e5b564
update plotly.js to version 3.1.1
emilykl Oct 1, 2025
58cb13a
update FigureWidget and JupyterLab extension bundles
emilykl Oct 1, 2025
094e770
print help when no command supplied to commands.py
emilykl Oct 1, 2025
1275e01
update labextension files because they are different than CI for some…
emilykl Oct 1, 2025
ceaa943
add npm ls step in check-js-build
emilykl Oct 1, 2025
675a8e7
format
emilykl Oct 1, 2025
8cff585
Merge branch 'main' into changes-for-main
LiamConnors Oct 1, 2025
6c58277
Merge pull request #5359 from plotly/changes-for-main
LiamConnors Oct 1, 2025
ae5f7ae
Merge branch 'main' into update-plotlyjs-v3.1.1
emilykl Oct 1, 2025
d462ac6
Merge pull request #5357 from plotly/update-plotlyjs-v3.1.1
emilykl Oct 1, 2025
380eefa
Merge pull request #5315 from Lexachoc/patch-0
emilykl Oct 1, 2025
75ae9d3
Merge branch 'main' into fix-default-renderer-when-ipython-installed
emilykl Oct 1, 2025
98d7e8b
Merge branch 'main' into rm/use-native-legend
emilykl Oct 1, 2025
aa4c088
Merge pull request #5312 from robertoffmoura/rm/use-native-legend
emilykl Oct 1, 2025
d2af541
Merge pull request #5258 from plotly/fix-default-renderer-when-ipytho…
emilykl Oct 1, 2025
361ad31
Merge branch 'main' into fix-histogram-contour-construction
emilykl Oct 1, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/check-js-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
cd js
npm ci
npm run build
npm ls
- name: Check JupyterLab build artifacts
run: |
# 1. Hash contents of all static files, sort by content hash
Expand Down
14 changes: 14 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ you can install all packages with:
pip install -e '.[dev]'
```

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:
```bash
pip install jupyter
jupyter labextension develop .
```
If you don't run that command, your figure will not render in the Jupyter Lab/ Jupyter Notebook editors.

If you're changing any of the code under the `js/` directory, you'll also want to run these commands:
```
cd js/
npm ci
npm run build
```

These commands also create an *editable install* of plotly.py
so that you can test your changes iteratively without having to rebuild the plotly.py package explicitly;
for more information please see
Expand Down
8 changes: 4 additions & 4 deletions codegen/resources/plot-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -4008,7 +4008,7 @@
"valType": "string"
},
"type": {
"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.",
"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.",
"dflt": "circle",
"editType": "plot",
"valType": "enumerated",
Expand Down Expand Up @@ -4414,7 +4414,7 @@
"valType": "string"
},
"type": {
"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.",
"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.",
"dflt": "circle",
"editType": "plot",
"valType": "enumerated",
Expand Down Expand Up @@ -47932,7 +47932,7 @@
"valType": "number"
},
"source": {
"description": "Specifies the data URI of the image to be visualized. The URI consists of \"data:image/[<media subtype>][;base64],<data>\"",
"description": "Specifies the data URI of the image to be visualized. The URI consists of \"data:image/[<media subtype\\\\>][;base64\\\\],<data\\\\>\"",
"editType": "calc",
"valType": "string"
},
Expand Down Expand Up @@ -53288,7 +53288,7 @@
]
},
"hovertemplate": {
"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>`.",
"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>`.",
"dflt": "",
"editType": "plot",
"valType": "string"
Expand Down
16 changes: 13 additions & 3 deletions commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ def update_plotlyjs_dev(args, outdir):
perform_codegen(outdir)


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

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

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

return parser


def parse_args(parser: argparse.ArgumentParser):
"""Parse command line arguments."""
return parser.parse_args()


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

args = parse_args()
parser = make_parser()
args = parse_args(parser)

if args.cmd == "codegen":
perform_codegen(outdir, noformat=args.noformat)
Expand All @@ -350,6 +356,10 @@ def main():
print(version)
update_plotlyjs(version, outdir)

elif args.cmd is None:
parser.print_help()
sys.exit(1)

else:
print(f"unknown command {args.cmd}", file=sys.stderr)
sys.exit(1)
Expand Down
10 changes: 5 additions & 5 deletions doc/python/imshow.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.4.2
format_version: '1.3'
jupytext_version: 1.17.2
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.7
version: 3.12.0
plotly:
description: How to display image data in Python with Plotly.
display_as: scientific
Expand Down Expand Up @@ -61,7 +61,7 @@ In order to create a numerical array to be passed to `px.imshow`, you can use a
```python
import plotly.express as px
from skimage import io
img = io.imread('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
img = io.imread('https://user-images.githubusercontent.com/72614349/179115668-2630e3e4-3a9f-4c88-9494-3412e606450a.jpg')
fig = px.imshow(img)
fig.show()
```
Expand Down
6 changes: 3 additions & 3 deletions doc/python/plotly-express.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.7
jupytext_version: 1.17.2
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.10.4
version: 3.12.0
plotly:
description: Plotly Express is a terse, consistent, high-level API for creating
figures.
Expand Down Expand Up @@ -386,7 +386,7 @@ fig.show()
```python
import plotly.express as px
from skimage import io
img = io.imread('https://upload.wikimedia.org/wikipedia/commons/thumb/0/00/Crab_Nebula.jpg/240px-Crab_Nebula.jpg')
img = io.imread('https://user-images.githubusercontent.com/72614349/179115668-2630e3e4-3a9f-4c88-9494-3412e606450a.jpg')
fig = px.imshow(img)
fig.show()
```
Expand Down
32 changes: 30 additions & 2 deletions doc/python/tile-scatter-maps.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.16.3
jupytext_version: 1.16.4
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.10.0
version: 3.9.16
plotly:
description: How to make scatter plots on tile maps in Python.
display_as: maps
Expand Down Expand Up @@ -220,6 +220,34 @@ fig.update_layout(
fig.show()
```

#### Supported Symbols

Plotly uses [Maki v2.1.0](https://app.unpkg.com/maki@2.1.0/files/icons) for symbols and supports the following values for `symbol`:

"aerialway", "airfield", "airport", "alcohol-shop", "america-football",
"amusement-park", "aquarium", "art-gallery", "attraction", "bakery",
"bank", "bar", "baseball", "basketball", "beer", "bicycle", "bicycle-share",
"blood-bank", "buddhism", "building", "bus", "cafe", "campsite", "car",
"castle", "cemetery", "central-building", "cinema", "circle", "circle-stroked",
"clothing-store", "college", "commercial", "cricket", "cross", "dam",
"danger", "dentist", "doctor", "dog-park", "drinking-water", "embassy",
"entrance", "farm", "fast-food", "ferry", "fire-station", "fuel", "gaming",
"garden", "garden-center", "gift", "golf", "grocery", "hairdresser",
"harbor", "heart", "heliport", "hospital", "ice-cream", "industry",
"information", "karaoke", "landmark", "laundry", "library", "lighthouse",
"lodging", "marker", "monument", "mountain", "museum", "music", "park",
"parking", "parking-garage", "pharmacy", "picnic-site", "pitch",
"place-of-worship", "playground", "police", "post", "prison", "rail",
"rail-light", "rail-metro", "ranger-station", "religious-christian",
"religious-jewish", "religious-muslim", "residential-community",
"restaurant", "roadblock", "rocket", "school", "shelter", "shop",
"skiing", "soccer", "square", "square-stroked", "stadium", "star",
"star-stroked", "suitcase", "sushi", "swimming", "teahouse", "telephone",
"tennis", "theatre", "toilet", "town-hall", "triangle", "triangle-stroked",
"veterinary", "volcano", "warehouse", "waste-basket", "water", "wetland",
"wheelchair", "zoo"


#### Add Clusters

*New in 5.11*
Expand Down
461 changes: 232 additions & 229 deletions js/lib/mimeExtension.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"lodash-es": "^4.17.21",
"plotly.js": "3.1.0",
"plotly.js": "3.1.1",
"@lumino/widgets": "~2.4.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion plotly/express/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2290,7 +2290,7 @@ def infer_config(args, constructor, trace_patch, layout_patch):
layout_patch[mode] = "group"

if (
constructor == go.Histogram2d
constructor in [go.Histogram2d, go.Histogram2dContour]
and args["z"] is not None
and args["histfunc"] is None
):
Expand Down
2 changes: 1 addition & 1 deletion plotly/figure_factory/_ternary_contour.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ def _contour_trace(
ncontours=None,
colorscale="Electric",
linecolor="rgb(150,150,150)",
interp_mode="llr",
interp_mode="ilr",
coloring=None,
v_min=0,
v_max=1,
Expand Down
6 changes: 3 additions & 3 deletions plotly/graph_objs/_figure.py
Original file line number Diff line number Diff line change
Expand Up @@ -9980,7 +9980,7 @@ def add_image(
source
Specifies the data URI of the image to be visualized.
The URI consists of "data:image/[<media
subtype>][;base64],<data>"
subtype\\>][;base64\\],<data\\>"
stream
:class:`plotly.graph_objects.image.Stream` instance or
dict with compatible properties
Expand Down Expand Up @@ -11853,9 +11853,9 @@ def add_parcats(
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`,
over dimensions. Note that "categorycount",
"colorcount" and "bandcolorcount" are only available
when `hoveron` contains the "color" flagFinally, the
when `hoveron` contains the "color" flag. Finally, the
template string has access to variables `count`,
`probability`, `category`, `categorycount`,
`colorcount` and `bandcolorcount`. Anything contained
Expand Down
6 changes: 3 additions & 3 deletions plotly/graph_objs/_figurewidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -9982,7 +9982,7 @@ def add_image(
source
Specifies the data URI of the image to be visualized.
The URI consists of "data:image/[<media
subtype>][;base64],<data>"
subtype\\>][;base64\\],<data\\>"
stream
:class:`plotly.graph_objects.image.Stream` instance or
dict with compatible properties
Expand Down Expand Up @@ -11855,9 +11855,9 @@ def add_parcats(
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`,
over dimensions. Note that "categorycount",
"colorcount" and "bandcolorcount" are only available
when `hoveron` contains the "color" flagFinally, the
when `hoveron` contains the "color" flag. Finally, the
template string has access to variables `count`,
`probability`, `category`, `categorycount`,
`colorcount` and `bandcolorcount`. Anything contained
Expand Down
7 changes: 4 additions & 3 deletions plotly/graph_objs/_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,8 @@ def opacity(self, val):
def source(self):
"""
Specifies the data URI of the image to be visualized. The URI
consists of "data:image/[<media subtype>][;base64],<data>"
consists of "data:image/[<media
subtype\\>][;base64\\],<data\\>"

The 'source' property is a string and must be specified as:
- A string
Expand Down Expand Up @@ -1021,7 +1022,7 @@ def _prop_descriptions(self):
source
Specifies the data URI of the image to be visualized.
The URI consists of "data:image/[<media
subtype>][;base64],<data>"
subtype\\>][;base64\\],<data\\>"
stream
:class:`plotly.graph_objects.image.Stream` instance or
dict with compatible properties
Expand Down Expand Up @@ -1294,7 +1295,7 @@ def __init__(
source
Specifies the data URI of the image to be visualized.
The URI consists of "data:image/[<media
subtype>][;base64],<data>"
subtype\\>][;base64\\],<data\\>"
stream
:class:`plotly.graph_objects.image.Stream` instance or
dict with compatible properties
Expand Down
Loading