Skip to content

Commit 4dded6c

Browse files
authoredApr 16, 2025··
Merge pull request #5096 from plotly/notebook-connected-default
Add back the mime renderer JL extension
·
v6.3.0v6.1.0rc0
2 parents 3d262d7 + 60735fe commit 4dded6c

22 files changed

+14225
-4728
lines changed
 

‎.circleci/config.yml

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,6 @@ commands:
5858
source .venv/bin/activate
5959
uv pip install .
6060
uv pip install -r ./test_requirements/requirements_optional.txt
61-
cd js
62-
npm ci
63-
npm run build
6461
6562
- when:
6663
condition:
@@ -269,22 +266,18 @@ jobs:
269266

270267
steps:
271268
- checkout
272-
273269
- run:
274-
name: initial NPM Build
270+
name: PyPI Build
275271
command: |
276-
python -m venv venv
277-
. venv/bin/activate
272+
curl -LsSf https://astral.sh/uv/install.sh | sh
273+
uv venv
274+
source .venv/bin/activate
275+
uv pip install build
276+
uv pip install jupyter
278277
cd js
279278
npm ci
280279
npm run build
281-
git status
282-
283-
- run:
284-
name: PyPI Build
285-
command: |
286-
. venv/bin/activate
287-
pip install build
280+
cd ..
288281
python -m build --sdist --wheel -o dist
289282
cp -R dist output
290283
git status
@@ -310,7 +303,6 @@ jobs:
310303
- checkout
311304
- browser-tools/install-chrome
312305
- browser-tools/install-chromedriver
313-
314306
- run:
315307
name: Install dependencies
316308
command: |
@@ -319,16 +311,11 @@ jobs:
319311
uv venv
320312
source .venv/bin/activate
321313
uv pip install -r requirements.txt
314+
cd ..
322315
if [ "${CIRCLE_BRANCH}" != "doc-prod" ]; then
323316
uv pip uninstall plotly
324-
cd ..
325317
uv pip install -e .
326-
cd js
327-
npm ci
328-
npm run build
329-
cd ../doc
330318
fi
331-
cd ..
332319
333320
- run:
334321
name: make html
@@ -420,7 +407,7 @@ workflows:
420407
release_build:
421408
jobs:
422409
- full_build
423-
410+
424411
build:
425412
jobs:
426413
- test_core_py:
@@ -449,4 +436,4 @@ workflows:
449436
pandas_version: "1.2.4"
450437
numpy_version: "1.26.4"
451438
- python_311_percy
452-
- build-doc
439+
- build-doc

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

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
on: push
2+
3+
jobs:
4+
check-js-build:
5+
name: Check JS build artifacts
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v4
9+
- name: Set up Python
10+
uses: actions/setup-python@v5
11+
with:
12+
python-version: "3.x"
13+
14+
- name: Install Node
15+
uses: actions/setup-node@v2
16+
with:
17+
node-version: '22'
18+
19+
- name: Copy current files to a temporary directory
20+
run: |
21+
cp -R plotly/labextension/ plotly/labextension-tmp/
22+
23+
- name: Install dependencies and build
24+
run: |
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
uv venv
27+
source .venv/bin/activate
28+
uv pip install jupyter
29+
cd js
30+
npm ci
31+
npm run build
32+
- name: Check JupyterLab build artifacts
33+
run: |
34+
# 1. Hash contents of all static files, sort by content hash
35+
find plotly/labextension/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > new_hashes.txt
36+
find plotly/labextension-tmp/static -type f -exec sha256sum {} \; | awk '{print $1}' | sort > old_hashes.txt
37+
38+
# 2. Compare the sorted content hashes
39+
diff old_hashes.txt new_hashes.txt > content_diff.txt
40+
41+
# Remove the "load" line from both package.json files before comparing
42+
grep -v '"load": "static/' plotly/labextension/package.json > pkg1.json
43+
grep -v '"load": "static/' plotly/labextension-tmp/package.json > pkg2.json
44+
45+
# Compare stripped versions
46+
diff pkg1.json pkg2.json > package_json_diff.txt
47+
48+
# 5. Final check
49+
if [ -s content_diff.txt ] || [ -s package_json_diff.txt ]; then
50+
echo "❌ Build artifacts differ:"
51+
echo "--- Unexpected diffs ---"
52+
cat content_diff.txt
53+
echo "--- Unexpected package.json diffs ---"
54+
cat package_json_diff.txt
55+
echo "Please replace the 'plotly/labextension' directory with the artifacts of this CI run."
56+
exit 1
57+
else
58+
echo "✅ Build artifacts match expected output (ignoring known 'load' hash in package.json)."
59+
fi
60+
61+
- name: Store the build artifacts from plotly/labextension
62+
uses: actions/upload-artifact@v4
63+
if: failure()
64+
with:
65+
name: labextension
66+
path: plotly/labextension

‎.github/workflows/test-release.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ jobs:
1010

1111
steps:
1212
- uses: actions/checkout@v4
13-
with:
14-
persist-credentials: false
1513
- name: Set up Python
1614
uses: actions/setup-python@v5
1715
with:
@@ -20,7 +18,7 @@ jobs:
2018
- name: Install Node
2119
uses: actions/setup-node@v2
2220
with:
23-
node-version: '18'
21+
node-version: '22'
2422

2523
- name: Install npm dependencies
2624
run: |

‎.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ doc/python/.mapbox_token
5959
doc/.ipynb_checkpoints
6060
tags
6161
doc/check-or-enforce-order.py
62-
plotly/package_data/widgetbundle.js
6362

6463
tests/percy/*.html
6564
tests/percy/pandas2/*.html

‎CONTRIBUTING.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ and
169169
[`pip`](https://pip.pypa.io/en/stable/reference/pip_install/#install-editable)
170170
documentation on _development mode_.
171171

172+
### Updating the `js/` directory
173+
**This is only necessary if you're making changes to files in the `js/` directory.**
174+
If you make changes to any files in the `js/` directory, you must run `npm install && npm run build` from the `js/` directory to rebuild the FigureWidget and JupyterLab extension.
175+
You must then commit the build artifacts produced in `plotly/labextension`. A CI job will verify that this step has been done correctly.
176+
177+
**Notes on the contents of the `js/` directory:**
178+
The `js/` directory contains Javascript code which helps with using Plotly in Jupyter notebooks.
179+
180+
There are two kinds of Jupyter support included in the `js/` directory:
181+
1. **Mime Renderer JupyterLab extension**: This is the default renderer for Plotly `Figure()` objects in Jupyter notebooks. The Plotly mime renderer JupyterLab extension is used automatically by JupyterLab / Jupyter Notebook
182+
when it sees the mimetype `application/vnd.plotly.v1+json` in the notebook output. The mime renderer loads `plotly.js` a single time and references it each time a Plotly figure is used in the notebook. This allows us to avoid embedding `plotly.js` in the notebook output. The JupyterLab extension source code is located at `js/src/mimeExtension.ts` and the compiled extension code is located at `plotly/labextension` in the built Python package. The command `jupyter labextension build` (which is one of the steps called by `npm run build`) compiles the extension and places the build artifacts in `plotly/labextension`.
183+
2. **FigureWidget**: This is a more-interactive method for rendering Plotly charts in notebooks. FigureWidget used by creating a `FigureWidget()` object inside the notebook code (in place of a `Figure()`). It allows for communication between the Javascript frontend and Python backend, and requires the installation of an additional Python package (`anywidget`). The FigureWidget source code is located at `js/src/widget.ts`, and is included in the built Python package at `plotly/package_data/widgetbundle.js`.
184+
172185
### Configure black code formatting
173186

174187
This repo uses the [Black](https://black.readthedocs.io/en/stable/) code formatter,

‎js/install.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"schemaVersion": 1,
3+
"name": "jupyterlab-plotly",
4+
"version": "6.0.1",
5+
"jupyterlab": {
6+
"mimeExtension": "lib/mimeExtension.js"
7+
}
8+
}
9+

‎js/lib/mimeExtension.js

Lines changed: 3865 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎js/package-lock.json

Lines changed: 5882 additions & 4676 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎js/package.json

Lines changed: 34 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
11
{
2-
"scripts": {
3-
"build": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js widget.ts",
4-
"watch": "npm run build -- --watch --sourcemap=inline",
5-
"typecheck": "tsc --noEmit"
6-
},
7-
"dependencies": {
8-
"lodash-es": "^4.17.21",
9-
"plotly.js": "3.0.1"
10-
},
11-
"devDependencies": {
12-
"@types/plotly.js": "^2.33.4",
13-
"esbuild": "^0.23.1",
14-
"typescript": "^5.6.2"
2+
"name": "jupyterlab-plotly",
3+
"main": "lib/mimeExtension.js",
4+
"version": "6.0.1",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/plotly/plotly.py"
8+
},
9+
"description": "The plotly Jupyter extension",
10+
"author": "The plotly.py team",
11+
"license": "MIT",
12+
"scripts": {
13+
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
14+
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
15+
"build:labextension": "jupyter labextension build .",
16+
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
17+
"watch": "npm run build -- --watch --sourcemap=inline",
18+
"typecheck": "tsc --noEmit"
19+
},
20+
"dependencies": {
21+
"lodash-es": "^4.17.21",
22+
"plotly.js": "3.0.1",
23+
"@lumino/widgets": "~2.4.0"
24+
},
25+
"devDependencies": {
26+
"@jupyterlab/builder": "^4.3.6 || ^3.6.8",
27+
"@types/plotly.js": "^2.33.4",
28+
"esbuild": "^0.23.1",
29+
"typescript": "^5.6.2"
30+
},
31+
"jupyterlab": {
32+
"mimeExtension": true,
33+
"outputDir": "../plotly/labextension"
34+
}
1535
}
16-
}
36+

‎js/src/mimeExtension.ts

Lines changed: 248 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,248 @@
1+
// Copyright (c) Jupyter Development Team.
2+
// Distributed under the terms of the Modified BSD License.
3+
4+
import { IRenderMime } from '@jupyterlab/rendermime-interfaces';
5+
import { Widget } from '@lumino/widgets';
6+
import type PlotlyType from "plotly.js";
7+
8+
import { Message } from "@lumino/messaging";
9+
10+
/**
11+
* The CSS class to add to the Plotly Widget.
12+
*/
13+
const CSS_CLASS = "jp-RenderedPlotly";
14+
15+
/**
16+
* The CSS class for a Plotly icon.
17+
*/
18+
const CSS_ICON_CLASS = "jp-MaterialIcon jp-PlotlyIcon";
19+
20+
/**
21+
* The MIME type for Plotly.
22+
* The version of this follows the major version of Plotly.
23+
*/
24+
export const MIME_TYPE = "application/vnd.plotly.v1+json";
25+
26+
interface IPlotlySpec {
27+
data: PlotlyType.Data;
28+
layout: PlotlyType.Layout;
29+
frames?: PlotlyType.Frame[];
30+
}
31+
32+
export class RenderedPlotly extends Widget implements IRenderMime.IRenderer {
33+
/**
34+
* Create a new widget for rendering Plotly.
35+
*/
36+
constructor(options: IRenderMime.IRendererOptions) {
37+
super();
38+
this.addClass(CSS_CLASS);
39+
this._mimeType = options.mimeType;
40+
41+
// Create image element
42+
this._img_el = <HTMLImageElement>document.createElement("img");
43+
this._img_el.className = "plot-img";
44+
this.node.appendChild(this._img_el);
45+
46+
// Install image hover callback
47+
this._img_el.addEventListener("mouseenter", (event) => {
48+
this.createGraph(this._model);
49+
});
50+
}
51+
52+
/**
53+
* Render Plotly into this widget's node.
54+
*/
55+
renderModel(model: IRenderMime.IMimeModel): Promise<void> {
56+
if (this.hasGraphElement()) {
57+
// We already have a graph, don't overwrite it
58+
return Promise.resolve();
59+
}
60+
61+
// Save off reference to model so that we can regenerate the plot later
62+
this._model = model;
63+
64+
// Check for PNG data in mime bundle
65+
const png_data = <string>model.data["image/png"];
66+
if (png_data !== undefined && png_data !== null) {
67+
// We have PNG data, use it
68+
this.updateImage(png_data);
69+
return Promise.resolve();
70+
} else {
71+
// Create a new graph
72+
return this.createGraph(model);
73+
}
74+
}
75+
76+
private hasGraphElement() {
77+
// Check for the presence of the .plot-container element that plotly.js
78+
// places at the top of the figure structure
79+
return this.node.querySelector(".plot-container") !== null;
80+
}
81+
82+
private updateImage(png_data: string) {
83+
this.hideGraph();
84+
this._img_el.src = "data:image/png;base64," + <string>png_data;
85+
this.showImage();
86+
}
87+
88+
private hideGraph() {
89+
// Hide the graph if there is one
90+
let el = <HTMLDivElement>this.node.querySelector(".plot-container");
91+
if (el !== null && el !== undefined) {
92+
el.style.display = "none";
93+
}
94+
}
95+
96+
private showGraph() {
97+
// Show the graph if there is one
98+
let el = <HTMLDivElement>this.node.querySelector(".plot-container");
99+
if (el !== null && el !== undefined) {
100+
el.style.display = "block";
101+
}
102+
}
103+
104+
private hideImage() {
105+
// Hide the image element
106+
let el = <HTMLImageElement>this.node.querySelector(".plot-img");
107+
if (el !== null && el !== undefined) {
108+
el.style.display = "none";
109+
}
110+
}
111+
112+
private showImage() {
113+
// Show the image element
114+
let el = <HTMLImageElement>this.node.querySelector(".plot-img");
115+
if (el !== null && el !== undefined) {
116+
el.style.display = "block";
117+
}
118+
}
119+
120+
private createGraph(model: IRenderMime.IMimeModel): Promise<void> {
121+
const { data, layout, frames, config } = model.data[this._mimeType] as
122+
| any
123+
| IPlotlySpec;
124+
125+
if (!layout.height) {
126+
layout.height = 360;
127+
}
128+
129+
// Load plotly asynchronously
130+
const loadPlotly = async (): Promise<void> => {
131+
if (RenderedPlotly.Plotly === null) {
132+
RenderedPlotly.Plotly = await import("plotly.js");
133+
RenderedPlotly._resolveLoadingPlotly();
134+
}
135+
return RenderedPlotly.loadingPlotly;
136+
};
137+
138+
return loadPlotly()
139+
.then(() => RenderedPlotly.Plotly!.react(this.node, data, layout, config))
140+
.then((plot) => {
141+
this.showGraph();
142+
this.hideImage();
143+
this.update();
144+
if (frames) {
145+
RenderedPlotly.Plotly!.addFrames(this.node, frames);
146+
}
147+
if (this.node.offsetWidth > 0 && this.node.offsetHeight > 0) {
148+
RenderedPlotly.Plotly!.toImage(plot, {
149+
format: "png",
150+
width: this.node.offsetWidth,
151+
height: this.node.offsetHeight,
152+
}).then((url: string) => {
153+
const imageData = url.split(",")[1];
154+
if (model.data["image/png"] !== imageData) {
155+
model.setData({
156+
data: {
157+
...model.data,
158+
"image/png": imageData,
159+
},
160+
});
161+
}
162+
});
163+
}
164+
165+
// Handle webgl context lost events
166+
(<PlotlyType.PlotlyHTMLElement>this.node).on(
167+
"plotly_webglcontextlost",
168+
() => {
169+
const png_data = <string>model.data["image/png"];
170+
if (png_data !== undefined && png_data !== null) {
171+
// We have PNG data, use it
172+
this.updateImage(png_data);
173+
return Promise.resolve();
174+
}
175+
}
176+
);
177+
});
178+
}
179+
180+
/**
181+
* A message handler invoked on an `'after-show'` message.
182+
*/
183+
protected onAfterShow(msg: Message): void {
184+
this.update();
185+
}
186+
187+
/**
188+
* A message handler invoked on a `'resize'` message.
189+
*/
190+
protected onResize(msg: Widget.ResizeMessage): void {
191+
this.update();
192+
}
193+
194+
/**
195+
* A message handler invoked on an `'update-request'` message.
196+
*/
197+
protected onUpdateRequest(msg: Message): void {
198+
if (RenderedPlotly.Plotly && this.isVisible && this.hasGraphElement()) {
199+
RenderedPlotly.Plotly.redraw(this.node).then(() => {
200+
RenderedPlotly.Plotly!.Plots.resize(this.node);
201+
});
202+
}
203+
}
204+
205+
private _mimeType: string;
206+
private _img_el: HTMLImageElement;
207+
private _model: IRenderMime.IMimeModel;
208+
209+
private static Plotly: typeof PlotlyType | null = null;
210+
private static _resolveLoadingPlotly: () => void;
211+
private static loadingPlotly = new Promise<void>((resolve) => {
212+
RenderedPlotly._resolveLoadingPlotly = resolve;
213+
});
214+
}
215+
216+
/**
217+
* A mime renderer factory for Plotly data.
218+
*/
219+
export const rendererFactory: IRenderMime.IRendererFactory = {
220+
safe: true,
221+
mimeTypes: [MIME_TYPE],
222+
createRenderer: (options) => new RenderedPlotly(options),
223+
};
224+
225+
const extensions: IRenderMime.IExtension | IRenderMime.IExtension[] = [
226+
{
227+
id: "@jupyterlab/plotly-extension:factory",
228+
rendererFactory,
229+
rank: 2,
230+
dataType: "json",
231+
fileTypes: [
232+
{
233+
name: "plotly",
234+
mimeTypes: [MIME_TYPE],
235+
extensions: [".plotly", ".plotly.json"],
236+
iconClass: CSS_ICON_CLASS,
237+
},
238+
],
239+
documentWidgetFactoryOptions: {
240+
name: "Plotly",
241+
primaryFileType: "plotly",
242+
fileTypes: ["plotly", "json"],
243+
defaultFor: ["plotly"],
244+
},
245+
},
246+
];
247+
248+
export default extensions;
File renamed without changes.

‎plotly/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,3 +180,15 @@ def hist_series(data_frame, **kwargs):
180180
skip += ["figsize", "bins", "legend"]
181181
new_kwargs = {k: kwargs[k] for k in kwargs if k not in skip}
182182
return histogram(data_frame, **new_kwargs)
183+
184+
185+
def _jupyter_labextension_paths():
186+
"""Called by Jupyter Lab Server to detect if it is a valid labextension and
187+
to install the extension.
188+
"""
189+
return [
190+
{
191+
"src": "labextension/static",
192+
"dest": "jupyterlab-plotly",
193+
}
194+
]

‎plotly/io/_base_renderers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ def to_mimebundle(self, fig_dict):
7676
class PlotlyRenderer(MimetypeRenderer):
7777
"""
7878
Renderer to display figures using the plotly mime type. This renderer is
79-
compatible with JupyterLab (using the @jupyterlab/plotly-extension),
80-
VSCode, and nteract.
79+
compatible with VSCode and nteract.
8180
8281
mime type: 'application/vnd.plotly.v1+json'
8382
"""

‎plotly/io/_renderers.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ def show(fig, renderer=None, validate=True, **kwargs):
497497
)
498498

499499
default_renderer = env_renderer
500-
elif ipython and ipython.get_ipython():
500+
elif ipython:
501501
# Try to detect environment so that we can enable a useful
502502
# default renderer
503503
if not default_renderer:
@@ -543,13 +543,21 @@ def show(fig, renderer=None, validate=True, **kwargs):
543543
pass
544544

545545
# Check if we're running in ipython terminal
546-
if not default_renderer and (
547-
ipython.get_ipython().__class__.__name__ == "TerminalInteractiveShell"
548-
):
546+
ipython_info = ipython.get_ipython()
547+
shell = ipython_info.__class__.__name__
548+
if not default_renderer and (shell == "TerminalInteractiveShell"):
549549
default_renderer = "browser"
550550

551+
# Check if we're running in a Jupyter notebook or JupyterLab
552+
if (
553+
not default_renderer
554+
and (shell == "ZMQInteractiveShell")
555+
and (type(ipython_info).__module__.startswith("ipykernel."))
556+
):
557+
default_renderer = "plotly_mimetype"
558+
551559
# Fallback to renderer combination that will work automatically
552-
# in the classic notebook (offline), jupyterlab, nteract, vscode, and
560+
# in the jupyter notebook, jupyterlab, nteract, vscode, and
553561
# nbconvert HTML export.
554562
if not default_renderer:
555563
default_renderer = "plotly_mimetype+notebook"

‎plotly/labextension/package.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"name": "jupyterlab-plotly",
3+
"main": "lib/mimeExtension.js",
4+
"version": "6.0.1",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/plotly/plotly.py"
8+
},
9+
"description": "The plotly Jupyter extension",
10+
"author": "The plotly.py team",
11+
"license": "MIT",
12+
"scripts": {
13+
"build:widget": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/package_data/widgetbundle.js src/widget.ts",
14+
"build:mimerenderer": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=lib/mimeExtension.js src/mimeExtension.ts",
15+
"build:labextension": "jupyter labextension build .",
16+
"build": "npm run build:widget && npm run build:mimerenderer && npm run build:labextension",
17+
"watch": "npm run build -- --watch --sourcemap=inline",
18+
"typecheck": "tsc --noEmit"
19+
},
20+
"dependencies": {
21+
"lodash-es": "^4.17.21",
22+
"plotly.js": "3.0.1",
23+
"@lumino/widgets": "~2.4.0"
24+
},
25+
"devDependencies": {
26+
"@jupyterlab/builder": "^4.3.6 || ^3.6.8",
27+
"@types/plotly.js": "^2.33.4",
28+
"esbuild": "^0.23.1",
29+
"typescript": "^5.6.2"
30+
},
31+
"jupyterlab": {
32+
"mimeExtension": true,
33+
"outputDir": "../plotly/labextension",
34+
"_build": {
35+
"load": "static/remoteEntry.ee69569354eef8c6803d.js",
36+
"mimeExtension": "./mimeExtension"
37+
}
38+
}
39+
}

‎plotly/labextension/static/340.2a23c8275d47a2531dae.js

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
/*! Bundled license information:
2+
3+
plotly.js/dist/plotly.js:
4+
(*!
5+
* The buffer module from node.js, for the browser.
6+
*
7+
* @author Feross Aboukhadijeh <https://feross.org>
8+
* @license MIT
9+
*)
10+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
11+
(*!
12+
* Determine if an object is a Buffer
13+
*
14+
* @author Feross Aboukhadijeh <https://feross.org>
15+
* @license MIT
16+
*)
17+
(*!
18+
* pad-left <https://github.com/jonschlinkert/pad-left>
19+
*
20+
* Copyright (c) 2014-2015, Jon Schlinkert.
21+
* Licensed under the MIT license.
22+
*)
23+
(*!
24+
* repeat-string <https://github.com/jonschlinkert/repeat-string>
25+
*
26+
* Copyright (c) 2014-2015, Jon Schlinkert.
27+
* Licensed under the MIT License.
28+
*)
29+
(*! Bundled license information:
30+
31+
native-promise-only/lib/npo.src.js:
32+
(*! Native Promise Only
33+
v0.8.1 (c) Kyle Simpson
34+
MIT License: http://getify.mit-license.org
35+
*)
36+
37+
polybooljs/index.js:
38+
(*
39+
* @copyright 2016 Sean Connelly (@voidqk), http://syntheti.cc
40+
* @license MIT
41+
* @preserve Project Home: https://github.com/voidqk/polybooljs
42+
*)
43+
44+
ieee754/index.js:
45+
(*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
46+
47+
buffer/index.js:
48+
(*!
49+
* The buffer module from node.js, for the browser.
50+
*
51+
* @author Feross Aboukhadijeh <https://feross.org>
52+
* @license MIT
53+
*)
54+
55+
safe-buffer/index.js:
56+
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
57+
58+
assert/build/internal/util/comparisons.js:
59+
(*!
60+
* The buffer module from node.js, for the browser.
61+
*
62+
* @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
63+
* @license MIT
64+
*)
65+
66+
object-assign/index.js:
67+
(*
68+
object-assign
69+
(c) Sindre Sorhus
70+
@license MIT
71+
*)
72+
73+
maplibre-gl/dist/maplibre-gl.js:
74+
(**
75+
* MapLibre GL JS
76+
* @license 3-Clause BSD. Full text of license: https://github.com/maplibre/maplibre-gl-js/blob/v4.7.1/LICENSE.txt
77+
*)
78+
*)
79+
*/

‎plotly/labextension/static/remoteEntry.ee69569354eef8c6803d.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎plotly/labextension/static/style.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/* This is a generated file of CSS imports */
2+
/* It was generated by @jupyterlab/builder in Build.ensureAssets() */
3+
4+
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"packages": [
3+
{
4+
"name": "process",
5+
"versionInfo": "0.11.10",
6+
"licenseId": "MIT",
7+
"extractedText": "(The MIT License)\n\nCopyright (c) 2013 Roman Shtylman <shtylman@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
8+
}
9+
]
10+
}

‎plotly/package_data/widgetbundle.js

Lines changed: 3906 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[build-system]
2-
requires = ["setuptools"]
2+
requires = ["setuptools>=61", "hatch", "jupyter_packaging~=0.10.0", "wheel"]
33
build-backend = "setuptools.build_meta"
44

55
[project.urls]
@@ -66,7 +66,6 @@ include = '\.pyi?$'
6666
exclude = '''
6767
6868
(
69-
/(
7069
\.eggs # exclude a few common directories in the
7170
| \.git # root of the project
7271
| \.hg
@@ -77,9 +76,36 @@ exclude = '''
7776
| buck-out
7877
| build
7978
| dist
79+
| js
8080
| submodules
8181
| plotly/matplotlylib/mplexporter
82-
)/
83-
| versioneer.py
8482
)
8583
'''
84+
85+
[tool.jupyter-packaging.builder]
86+
factory = "jupyter_packaging.npm_builder"
87+
auto_data_files = true
88+
89+
[tool.jupyter-packaging.build-args]
90+
build_cmd = "build:prod"
91+
npm = ["jlpm"]
92+
93+
[tool.hatch.build.hooks.jupyter-builder]
94+
editable-frontend = true
95+
96+
[tool.hatch.build.hooks.jupyter-builder.editable-build-kwargs]
97+
build_cmd = "build"
98+
npm = ["jlpm"]
99+
source_dir = "js"
100+
build_dir = "plotly/labextension"
101+
skip_symlink = true
102+
103+
[tool.setuptools.data-files]
104+
"share/jupyter/labextensions/jupyterlab-plotly" = [
105+
"plotly/labextension/package.json",
106+
"js/install.json"
107+
]
108+
109+
"share/jupyter/labextensions/jupyterlab-plotly/static" = [
110+
"plotly/labextension/static/*.js"
111+
]

0 commit comments

Comments
 (0)
Please sign in to comment.