Skip to content
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

Default to go.FigureWidget in notebooks #4839

Open
marthacryan opened this issue Oct 28, 2024 · 4 comments
Open

Default to go.FigureWidget in notebooks #4839

marthacryan opened this issue Oct 28, 2024 · 4 comments
Assignees
Labels
feature something new P2 considered for next cycle

Comments

@marthacryan
Copy link
Collaborator

the FigureWidget class has more features than the Figure class without any major downsides (that we know of?) - we should consider defaulting to using the widget. One thought is that we could default to using it if anywidget is already installed.

@ndrezn
Copy link
Member

ndrezn commented Oct 30, 2024

I am curious if using AnyWidget gives us more control over the version of Plotly.js we bundle, which possibly means we could use this strategy to fix #4827

@slishak-PX
Copy link

the FigureWidget class has more features than the Figure class without any major downsides (that we know of?)

One downside is that FigureWidget does not fully support animations.

@staticmethod
def _display_frames_error():
"""
Display an informative error when user attempts to set frames on a
FigureWidget
Raises
------
ValueError
always
"""
msg = """
Frames are not supported by the plotly.graph_objs.FigureWidget class.
Note: Frames are supported by the plotly.graph_objs.Figure class"""
raise ValueError(msg)

@marthacryan
Copy link
Collaborator Author

@slishak-PX Thank you for that comment! That's really helpful to know.

@gvwilson gvwilson added feature something new P2 considered for next cycle labels Oct 31, 2024
@ndrezn
Copy link
Member

ndrezn commented Nov 1, 2024

Another potential problem with this approach is that FigureWidget probably isn't compatible with Dash, and because Dash runs in Jupyter, we'd need to figure out a clever solution on whether to render a FigureWidget outside Dash or a Figure for Dash.

Not insurmountable though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new P2 considered for next cycle
Projects
None yet
Development

No branches or pull requests

4 participants