Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
828 changes: 650 additions & 178 deletions codegen/resources/plot-schema.json

Large diffs are not rendered by default.

1,620 changes: 810 additions & 810 deletions js/lib/mimeExtension.js

Large diffs are not rendered by default.

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@camdecoster can we keep the previous indentation here? Doesn't matter THAT much but it's like 60% of the diff for this PR and has a good chance of getting reverted the next time we bump the Plotly.js version.

(I guess I spoke too soon in saying we don't need a JSON/JS formatter for Plotly.py...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry about that. ESLint took over with a default of 2 spaces per level since no formatter is set for this repo.

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

67 changes: 33 additions & 34 deletions js/package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
{
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.0.1",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
},
"description": "The plotly Jupyter extension",
"author": "The plotly.py team",
"license": "MIT",
"scripts": {
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
"build:labextension": "jupyter labextension build .",
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
"watch": "npm run build -- --watch --sourcemap=inline",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"lodash-es": "^4.17.21",
"plotly.js": "3.1.1",
"@lumino/widgets": "~2.4.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.3.6 || ^3.6.8",
"@types/plotly.js": "^2.33.4",
"esbuild": "^0.23.1",
"typescript": "^5.6.2"
},
"jupyterlab": {
"mimeExtension": true,
"outputDir": "../plotly/labextension"
}
"name": "jupyterlab-plotly",
"main": "lib/mimeExtension.js",
"version": "6.0.1",
"repository": {
"type": "git",
"url": "https://github.com/plotly/plotly.py"
},
"description": "The plotly Jupyter extension",
"author": "The plotly.py team",
"license": "MIT",
"scripts": {
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
"build:labextension": "jupyter labextension build .",
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
"watch": "npm run build -- --watch --sourcemap=inline",
"typecheck": "tsc --noEmit"
},
"dependencies": {
"lodash-es": "^4.17.21",
"plotly.js": "3.2.0",
"@lumino/widgets": "~2.4.0"
},
"devDependencies": {
"@jupyterlab/builder": "^4.3.6 || ^3.6.8",
"@types/plotly.js": "^2.33.4",
"esbuild": "^0.23.1",
"typescript": "^5.6.2"
},
"jupyterlab": {
"mimeExtension": true,
"outputDir": "../plotly/labextension"
}
}
138 changes: 115 additions & 23 deletions plotly/graph_objs/_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class Bar(_BaseTraceType):
"hoverinfosrc",
"hoverlabel",
"hovertemplate",
"hovertemplatefallback",
"hovertemplatesrc",
"hovertext",
"hovertextsrc",
Expand Down Expand Up @@ -57,6 +58,7 @@ class Bar(_BaseTraceType):
"textpositionsrc",
"textsrc",
"texttemplate",
"texttemplatefallback",
"texttemplatesrc",
"type",
"uid",
Expand Down Expand Up @@ -379,16 +381,20 @@ def hovertemplate(self):
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. Finally, the
template string has access to variables `value` and `label`.
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>`.
formatting syntax. Variables that can't be found will be
replaced with the specifier. For example, a template of "data:
%{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1
and y is missing. Variables with an undefined value will be
replaced with the fallback value. 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, all attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Finally, the template string has access to variables `value`
and `label`. 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>`.

The 'hovertemplate' property is a string and must be specified as:
- A string
Expand All @@ -405,6 +411,25 @@ def hovertemplate(self):
def hovertemplate(self, val):
self["hovertemplate"] = val

@property
def hovertemplatefallback(self):
"""
Fallback string that's displayed when a variable referenced in
a template is missing. If the boolean value 'false' is passed
in, the specifier with the missing variable will be displayed.

The 'hovertemplatefallback' property accepts values of any type

Returns
-------
Any
"""
return self["hovertemplatefallback"]

@hovertemplatefallback.setter
def hovertemplatefallback(self, val):
self["hovertemplatefallback"] = val

@property
def hovertemplatesrc(self):
"""
Expand Down Expand Up @@ -1071,7 +1096,7 @@ def textsrc(self, val):
def texttemplate(self):
"""
Template string used for rendering the information text that
appear on points. Note that this will override `textinfo`.
appears on points. Note that this will override `textinfo`.
Variables are inserted using %{variable}, for example "y:
%{y}". Numbers are formatted using d3-format's syntax
%{variable:d3-format}, for example "Price: %{y:$.2f}".
Expand All @@ -1080,10 +1105,14 @@ def texttemplate(self):
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. Every attributes that can be specified per-
point (the ones that are `arrayOk: true`) are available.
Finally, the template string has access to variables `value`
and `label`.
formatting syntax. Variables that can't be found will be
replaced with the specifier. For example, a template of "data:
%{x}, %{y}" will result in a value of "data: 1, %{y}" if x is 1
and y is missing. Variables with an undefined value will be
replaced with the fallback value. All attributes that can be
specified per-point (the ones that are `arrayOk: true`) are
available. Finally, the template string has access to variables
`value` and `label`.

The 'texttemplate' property is a string and must be specified as:
- A string
Expand All @@ -1100,6 +1129,25 @@ def texttemplate(self):
def texttemplate(self, val):
self["texttemplate"] = val

@property
def texttemplatefallback(self):
"""
Fallback string that's displayed when a variable referenced in
a template is missing. If the boolean value 'false' is passed
in, the specifier with the missing variable will be displayed.

The 'texttemplatefallback' property accepts values of any type

Returns
-------
Any
"""
return self["texttemplatefallback"]

@texttemplatefallback.setter
def texttemplatefallback(self, val):
self["texttemplatefallback"] = val

@property
def texttemplatesrc(self):
"""
Expand Down Expand Up @@ -1722,18 +1770,28 @@ def _prop_descriptions(self):
%{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
date formatting syntax. Variables that can't be found
will be replaced with the specifier. For example, a
template of "data: %{x}, %{y}" will result in a value
of "data: 1, %{y}" if x is 1 and y is missing.
Variables with an undefined value will be replaced with
the fallback value. 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
data. Additionally, all attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Finally, the template string has access
to variables `value` and `label`. 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>`.
hovertemplatefallback
Fallback string that's displayed when a variable
referenced in a template is missing. If the boolean
value 'false' is passed in, the specifier with the
missing variable will be displayed.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
`hovertemplate`.
Expand Down Expand Up @@ -1878,7 +1936,7 @@ def _prop_descriptions(self):
`text`.
texttemplate
Template string used for rendering the information text
that appear on points. Note that this will override
that appears on points. Note that this will override
`textinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
Expand All @@ -1889,10 +1947,20 @@ def _prop_descriptions(self):
%{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. Every attributes that can be
date formatting syntax. Variables that can't be found
will be replaced with the specifier. For example, a
template of "data: %{x}, %{y}" will result in a value
of "data: 1, %{y}" if x is 1 and y is missing.
Variables with an undefined value will be replaced with
the fallback value. All attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Finally, the template string has access
to variables `value` and `label`.
texttemplatefallback
Fallback string that's displayed when a variable
referenced in a template is missing. If the boolean
value 'false' is passed in, the specifier with the
missing variable will be displayed.
texttemplatesrc
Sets the source reference on Chart Studio Cloud for
`texttemplate`.
Expand Down Expand Up @@ -2046,6 +2114,7 @@ def __init__(
hoverinfosrc=None,
hoverlabel=None,
hovertemplate=None,
hovertemplatefallback=None,
hovertemplatesrc=None,
hovertext=None,
hovertextsrc=None,
Expand Down Expand Up @@ -2079,6 +2148,7 @@ def __init__(
textpositionsrc=None,
textsrc=None,
texttemplate=None,
texttemplatefallback=None,
texttemplatesrc=None,
uid=None,
uirevision=None,
Expand Down Expand Up @@ -2188,18 +2258,28 @@ def __init__(
%{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
date formatting syntax. Variables that can't be found
will be replaced with the specifier. For example, a
template of "data: %{x}, %{y}" will result in a value
of "data: 1, %{y}" if x is 1 and y is missing.
Variables with an undefined value will be replaced with
the fallback value. 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
data. Additionally, all attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Finally, the template string has access
to variables `value` and `label`. 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>`.
hovertemplatefallback
Fallback string that's displayed when a variable
referenced in a template is missing. If the boolean
value 'false' is passed in, the specifier with the
missing variable will be displayed.
hovertemplatesrc
Sets the source reference on Chart Studio Cloud for
`hovertemplate`.
Expand Down Expand Up @@ -2344,7 +2424,7 @@ def __init__(
`text`.
texttemplate
Template string used for rendering the information text
that appear on points. Note that this will override
that appears on points. Note that this will override
`textinfo`. Variables are inserted using %{variable},
for example "y: %{y}". Numbers are formatted using
d3-format's syntax %{variable:d3-format}, for example
Expand All @@ -2355,10 +2435,20 @@ def __init__(
%{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. Every attributes that can be
date formatting syntax. Variables that can't be found
will be replaced with the specifier. For example, a
template of "data: %{x}, %{y}" will result in a value
of "data: 1, %{y}" if x is 1 and y is missing.
Variables with an undefined value will be replaced with
the fallback value. All attributes that can be
specified per-point (the ones that are `arrayOk: true`)
are available. Finally, the template string has access
to variables `value` and `label`.
texttemplatefallback
Fallback string that's displayed when a variable
referenced in a template is missing. If the boolean
value 'false' is passed in, the specifier with the
missing variable will be displayed.
texttemplatesrc
Sets the source reference on Chart Studio Cloud for
`texttemplate`.
Expand Down Expand Up @@ -2532,6 +2622,7 @@ def __init__(
self._set_property("hoverinfosrc", arg, hoverinfosrc)
self._set_property("hoverlabel", arg, hoverlabel)
self._set_property("hovertemplate", arg, hovertemplate)
self._set_property("hovertemplatefallback", arg, hovertemplatefallback)
self._set_property("hovertemplatesrc", arg, hovertemplatesrc)
self._set_property("hovertext", arg, hovertext)
self._set_property("hovertextsrc", arg, hovertextsrc)
Expand Down Expand Up @@ -2565,6 +2656,7 @@ def __init__(
self._set_property("textpositionsrc", arg, textpositionsrc)
self._set_property("textsrc", arg, textsrc)
self._set_property("texttemplate", arg, texttemplate)
self._set_property("texttemplatefallback", arg, texttemplatefallback)
self._set_property("texttemplatesrc", arg, texttemplatesrc)
self._set_property("uid", arg, uid)
self._set_property("uirevision", arg, uirevision)
Expand Down
Loading