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

Add output_type option to figure_factory functions #1079

Open
jonmmease opened this issue Jul 28, 2018 · 0 comments
Open

Add output_type option to figure_factory functions #1079

jonmmease opened this issue Jul 28, 2018 · 0 comments
Labels
enhancement performance Issues related to performance on creating figures

Comments

@jonmmease
Copy link
Contributor

jonmmease commented Jul 28, 2018

I propose we add a new option to all figure factory methods named output_type. This may be set to 'Figure' (default), 'FigureWidget', or 'dict'.

Setting output_type to 'dict' would return only the dictionary version of the figure. This would be the fastest path, especially for figure factories that produce figures with lost of traces. It would provide an option for people to construct a complex figure with a figure factory, customize it, and then save it with plot/iplot without validation using the validate=False option. See dendrogram use-case described in #1052.

Setting output_type to 'FigureWidget' would directly return a FigureWidget instance. It would also open the door for figure factories to pre-install interactive functionality using callbacks for use in the Jupyter Notebook.

For example, we could add a datashader_scatter_plot figure factory that wraps the logic from this notebook: https://github.com/jonmmease/plotly_ipywidget_notebooks/blob/master/notebooks/DataShaderExample.ipynb. If ouput_type is 'Figure' or 'dict' then the datashader logic is executed once to build the data image for the initial axes ranges. If the ouput_type is 'FigureWidget' then, in addition, we would install the zoom/resize callback logic to automatically recompute the data image on zoom/resize.

@chriddyp @cldougl @Kully

@jonmmease jonmmease added enhancement performance Issues related to performance on creating figures labels Aug 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement performance Issues related to performance on creating figures
Projects
None yet
Development

No branches or pull requests

1 participant