Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Drop notebook 6#4822

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
marthacryan merged 21 commits intoanywidgetfromdrop-notebook-6
Nov 4, 2024
Merged

Drop notebook 6#4822

marthacryan merged 21 commits intoanywidgetfromdrop-notebook-6
Nov 4, 2024

Conversation

@marthacryan
Copy link
Collaborator

@marthacryanmarthacryan commentedOct 22, 2024
edited
Loading

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 entirepackages/javascript/jupyterlab_plotly directory 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/js directory 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 thepackages/javascript/jupyterlab_plotly directory inthis 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:

  • Checkout branch
  • Create a new python env (conda, mamba, pipenv, etc)
  • git clean -f -x -d
  • cd packages/python/plotly
  • pip install -e .
  • pip install jupyter
  • Try it out in jupyter lab:jupyter lab
  • Try it out in jupyter notebook:jupyter notebook

@fcollonval
Copy link
Contributor

I wasn't able to find evidence that having an extension installed in jupyterlab >=3 or jupyter notebook >= 7 is even necessary for plotly

This is correct because the produced output is using html that will includes plotly.js the first time:

classNotebookRenderer(HtmlRenderer):

Dropping themimerenderer factory will preventplotly.json file to be opened in JupyterLab.

@marthacryan
Copy link
CollaboratorAuthor

@fcollonval Thank you for the response! Also hi!

fcollonval reacted with heart emoji

@marthacryanmarthacryan marked this pull request as ready for reviewOctober 23, 2024 21:59
@gvwilsongvwilson added featuresomething new P1needed for current cycle labelsOct 24, 2024
@archmoj
Copy link
Contributor

This is looking good to me.
@marthacryan Would you please add a changelog entry?

@LiamConnors
Copy link
Member

@marthacryan, testing theFigureWidget in Notebook 7 and I get a JavaScript error:

Code is

import plotly.graph_objects as gof = go.FigureWidget()f
image

I haveanywidget=0.9.13

@marthacryan
Copy link
CollaboratorAuthor

@LiamConnors Looks like this wasn't happening for me because I hadn't added thenpm install && npm run build step intopip install -e ., so the necessary javascript wasn't generated! I'll look into adding that

@LiamConnors
Copy link
Member

LiamConnors commentedOct 24, 2024
edited
Loading

In VS Code, I see this:

image

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

Comment on lines 116 to 118
###JupyterWidget Support

For usein the JupyterNotebook, installthe`notebook` and`ipywidgets`
For useas a Jupyterwidget, install`jupyter` and`anywidget`
Copy link
Member

Choose a reason for hiding this comment

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

The section above this talks about "JupyterLab Support" and should now mention anywidget. Wondering if this section should stay as "Jupyter Notebook Support"

Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

I think maybe they should be combined. The usage is almost identical for jupyter Notebook and JupyterLab

@marthacryanmarthacryan merged commitee67f2e intoanywidgetNov 4, 2024
3 checks passed
@marthacryanmarthacryan deleted the drop-notebook-6 branchNovember 4, 2024 16:03
elif"jupyter-lab"inparent_processandjupyter_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`."
Copy link
CollaboratorAuthor

Choose a reason for hiding this comment

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

Maybe put this inFigureWidget instead?

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this pull requestJun 23, 2025
https://build.opensuse.org/request/show/1287194by 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
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@LiamConnorsLiamConnorsLiamConnors left review comments

Assignees

@marthacryanmarthacryan

Labels

featuresomething newP1needed for current cycle

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@marthacryan@fcollonval@archmoj@LiamConnors@gvwilson

[8]ページ先頭

©2009-2025 Movatter.jp