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

Switch to use anywidget #4663

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
marthacryan wants to merge 43 commits into plotly:master from marthacryan:anywidget
Closed

Conversation

@marthacryan
Copy link
Collaborator

@marthacryan marthacryan commented Jul 14, 2024
edited
Loading

Co-authored by @manzt! This updates the logic for the FigureWidget to rely on anywidget.
A quote about anywidget from the documentation for context:

anywidget is both a specification and toolset for authoring reusable web-based widgets for interactive computing environments. As a specification, it defines a standard for widget front-end code. As a toolkit, it provides tools for authoring widget front-end code according to the specification, as well as a Python library that simplifies creating and publishing custom Jupyter Widgets.

This will not affect the go.Figure class. High level explanation of the difference between using go.Figure and go.FigureWidget:

  • go.Figure: The chart generated by this object will be interactive on the client side. For many purposes, this is all a user needs to do with a chart. The interactions are things like zooming in, or any of the various operations in the toolbar.
  • go.FigureWidget: The difference here is that the figure is interactive on the server side as well.
    • Interactions with the plotly chart can be sent to the python kernel and used in other widgets.
    • Interactions with other widgets can be used to control the chart

@marthacryan marthacryan marked this pull request as draft July 14, 2024 17:57
@gvwilson gvwilson requested a review from emilykl July 17, 2024 18:28
@gvwilson gvwilson added feature something new P2 considered for next cycle community community contribution labels Aug 13, 2024
{
"scripts": {
"build": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/bundle.js widget.ts",
"watch": "npm run build -- --watch --sourcemap=inline",
Copy link
Contributor

@manzt manzt Sep 16, 2024
edited
Loading

Choose a reason for hiding this comment

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

sourcemaps will make it easier to debug when developing the widget using the browser developer tools.

marthacryan reacted with thumbs up emoji
@@ -0,0 +1,17 @@
{
"scripts": {
"build": "esbuild --bundle --alias:plotly.js=plotly.js/dist/plotly --format=esm --minify --outfile=../plotly/bundle.js widget.ts",
Copy link
Contributor

Choose a reason for hiding this comment

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

I added the --minify and --alias flags. minify makes the final bundle smaller.

The alias here is to make the import nicer for typescript type checking types (tsc), while esbuild needs to point to the actual files (./dist).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@emilykl emilykl Awaiting requested review from emilykl

1 more reviewer

@manzt manzt manzt left review comments

Reviewers whose approvals may not affect merge requirements

Labels

community community contribution feature something new P2 considered for next cycle

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /