plotly / plotly.py

The interactive graphing library for Python :sparkles: This project now includes Plotly Express!
https://plotly.com/python/
MIT License
16.24k stars 2.55k forks source link

Default to go.FigureWidget in notebooks #4839

Open marthacryan opened 1 week ago

marthacryan commented 1 week ago

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 commented 5 days ago

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 https://github.com/plotly/plotly.py/issues/4827

slishak-PX commented 4 days ago

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.

https://github.com/plotly/plotly.py/blob/31b3ad87cdc4c0f7d703227b743f1b349daed8ed/packages/python/plotly/plotly/basewidget.py#L786-L800

marthacryan commented 4 days ago

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

ndrezn commented 3 days ago

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!