Plotly.py: Allow Offline Usage of GraphWidget

Created on 21 Aug 2017  路  9Comments  路  Source: plotly/plotly.py

It currently seems like the GraphWidget is only able to be used with online plots. I think there's a lot of value in enabling it to be used offline in conjunction with ipywidgets.

Note: This is a dup of #573 however I'm opening this as that issue is poorly named which may mean it doesn't get the attention it deserves.

Most helpful comment

That's fine - I just opened this as a nice to have sometime in the future. I'm totally biased but I do think there will be a lot of value in it!

All 9 comments

Since I'm looking to use plotly in conjunction with ipywidgets in jupyterlab I'll also cross-reference #641

@dhirschfeld I get the impression that plotly are focusing on and endorsing their built in widget system. I don't think that it allows python functions to work as call backs, though I'm not 100% on that, but it does allow dynamic predefined changes to the plot.

The builtin widget system is fine but somewhat limited in its expressivity. For more dynamic behaviour I gather the recommended solution is to use dash but IIUC that builds independent flask? applications whereas I'm wanting something to work in jupyterlab.

My usecase which I don't think can be done with the builtin widgets is to update the data for multiple traces based on the state of two dropdown widgets.

Agreed.

Having used the underlying JS library before, which has useful plot updating and animating functions, I'm wondering how easy it might be to wrap these functions into some python functionality that is more expressive than their current system.

Having the built in widgets is nice in their ability to be defined in stand alone JSON strings. HoloViews has a way of permuting through all the options of any widgets, which is useful. Perhaps something like that, implemented as a nice expressive python function, employing the built in widgets, would be useful too.

It would be awesome to see an offline version of GraphWidget! We're big fans of the ipywidgets framework, but most of our current offline Python bandwidth is focused on Dash (https://plot.ly/dash/gallery, https://plot.ly/products/dash/).

My usecase which I don't think can be done with the builtin widgets is to update the data for multiple traces based on the state of two dropdown widgets.

Dash could definitely accommodate this use case, see here for example: https://plot.ly/dash/dash-core-components

What I'm after specifically is something which works in jupyterlab and AFAICS dash isn't designed to integrate with jupyterlab? It does seem pretty awesome though and I'm excited about it's possibilities but unless I'm wrong it seems aimed at building independent web apps rather than integrating as an extension for juypterlab.

@dhirschfeld I see, yes, what you wrote is correct.
We'd love to build offline ipywidgets integration and it's not impossible that we'll get to it this year. Plotly.js is currently rethinking plot updates so that incremental changes can occur without full redraws (see https://github.com/plotly/plotly.js/issues/1850 for example). Once that machinery is worked out, it will make (even more) sense to revisit offline ipywidgets.
Sorry we don't have a great solution for you right now.

That's fine - I just opened this as a nice to have sometime in the future. I'm totally biased but I do think there will be a lot of value in it!

Done in the new FigureWidget class in version 3.0.0! https://medium.com/@plotlygraphs/introducing-plotly-py-3-0-0-7bb1333f69c6

GraphWidget is going to be deprecated as soon as I get around to adding deprecation warnings.

Was this page helpful?
0 / 5 - 0 ratings