Conversation
b05cac4 to
4096595
Compare
This is correct because the produced output is using html that will includes plotly.js the first time: Dropping the mimerenderer factory will prevent |
|
@fcollonval Thank you for the response! Also hi! |
|
This is looking good to me. |
|
@marthacryan, testing the Code is
I have |
|
@LiamConnors Looks like this wasn't happening for me because I hadn't added the |
|
In VS Code, I see this:
Not really sure what to make of it. I'm using the same environment as in a notebook launched in the browser. I've commented here as I'm testing off this branch, but I guess this may be more related to #4823 |
| ### Jupyter Widget Support | ||
|
|
||
| For use in the Jupyter Notebook, install the `notebook` and `ipywidgets` | ||
| For use as a Jupyter widget, install `jupyter` and `anywidget` |
There was a problem hiding this comment.
The section above this talks about "JupyterLab Support" and should now mention anywidget. Wondering if this section should stay as "Jupyter Notebook Support"
There was a problem hiding this comment.
I think maybe they should be combined. The usage is almost identical for jupyter Notebook and JupyterLab
| elif "jupyter-lab" in parent_process and jupyter_lab.__version__ < "3": | ||
| # Add warning about upgrading jupyterlab | ||
| warnings.warn( | ||
| f"Plotly version >= 6 requires JupyterLab >= 3 but you have {jupyter_lab.__version__} installed. To upgrade JupyterLab, please run `pip install jupyterlab --upgrade`." |
There was a problem hiding this comment.
Maybe put this in FigureWidget instead?
https://build.opensuse.org/request/show/1287194 by user bnavigator + anag_factory - Drop upstream patch plotly-pr4622-np2.patch - Remove jupyter sub-package, not part of the package anymore after the switch to anywidget gh#plotly/plotly.py#4823 - Remove notebook from jupyter package, as part of jupyter notebook 6 drop, gh#plotly/plotly.py#4822 - Update to 6.1.2 (CVE-2025-5889, bsc#1244347) * Fix type checking and code highlighting for graph_objects classes [#5199] - Release 6.1.1 * Prevent swallowing of ValueError when creating a figure with subplots [#3888] * Fix issue causing fig.write_image() to not generate an image [#5193] - Release 6.1.0 ## Updated * Add support for Kaleido>=v1.0.0 for image generation [#5062, #5177] * Reduce package bundle size by 18-24% via changes to code generation [#4978] ## Fixed * Fix third-party widget displa


Note: this PR is on top of the changes from #4823 because the plotly.js version used in plotly.py is based on the jupyterlab extension code, and we needed a new place to store the plotly.js version. The widget seemed like a good place because all of the other javascript is removed in this PR.
Fixes #4779.
It appears that the entire
packages/javascript/jupyterlab_plotlydirectory contains code that is either used to support very old versions of jupyter lab/notebook/voila, or is not used at all. This PR removes the entire directory in favor of having a very smallpackages/python/plotly/jsdirectory that contains only the widget code (see #4663 for adding the widget code into that directory).The last time that the jupyter extension was significantly changed was 3 years ago in #3142. @fcollonval described the files in the
packages/javascript/jupyterlab_plotlydirectory in this comment. He did add support for federated extensions (new jupyter lab/notebook build), but I wasn't able to find evidence that having an extension installed in jupyterlab >=3 or jupyter notebook >= 7 is even necessary for plotly. @fcollonval if you know of any reason that that isn't true, please let me know!To test:
git clean -f -x -dcd packages/python/plotlypip install -e .pip install jupyterjupyter labjupyter notebook