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

Version 4 discussion #1420

Closed
jonmmease opened this issue Feb 2, 2019 · 7 comments
Closed

Version 4 discussion #1420

jonmmease opened this issue Feb 2, 2019 · 7 comments
Labels
V4 Issues/PRs for Plotly Version 4

Comments

@jonmmease
Copy link
Contributor

jonmmease commented Feb 2, 2019

Overview

This is an issue for discussing what we'd like to work towards in a future version 4, mostly focusing on changes that would not be backwards compatible. Nothing here is set in stone and feedback is welcome.

Theming

Lets make the defualt theme be plotly or plotly_white (#1224)

Integrate px

Integrate the px project for exploratory data analysis directly into plotly.py (https://github.com/plotly/px)

Redo subplot support

There are a bunch of outstanding issues with the make_subplots function. The most significant limitation being that it doesn't support non-Cartesian subplot types.

Last year, plotly.js introduced its own subplot layout system (layout.grid) so we could build the new subplot system on top of that (See plotly/plotly.js#3507 ). Hopefully we could still support the make_subplots API, but give most of the work to plotly.js

I would also like to add support for accessing traces by subplot. Something like
figure.get_traces(row=2, col=1). This would allow users to construct an initial figure using px, and then easily grab particular traces to customize using .update or property assignment syntax. See #1484.

Self displaying figures

I would like to allow go.Figure to display itself as a plotly.js figure when used in an ipython context. We have a prototype of this in px with FigurePx

https://github.com/plotly/px/blob/610910fd5f167de2482b01753db13cd0bd01c171/plotly_express/_px.py#L22-L33

I would like to extend this a bit so that it's possible to use a global setting to configure how go.Figure should display itself. FigurePx is using the init_notebook_mode/iplot approach, but I'd also like to support a static image display (using orca) that would be suitable for use in QtConsole/Spyder and for PDF export.

These changes would not affect FigureWidget. FigureWidget will remain a separate class that is distinct from go.Figure in that is is a widget subclass and supports updating properties in place.

Convert offline html export to plotly.io module

Replace the plotly.offline.plot function with functions in the plotly.io module (#1098)

Split off choropleth figure factory into a separate package

Splitting the county choropleth figure factories into a separate package would help a lot with reducing the plotly.py package size. Then we could add additional shape files to that geo-plotly package to support different geographic regions.

Split off plotly.plotly chart-studio integration into a separate package

Split off the functionality in plotly.plotly into a separate package called chart_studio. This will make it easier for people to understand that you can use plotly.py totally offline and without an account. Everything in the plotly package would be offline, and the chart_studio integration is in the chart_studio package.

Along with the change to make figures self-displaying and to move the html output to plotly.io, this would mean that users would no longer need to figure out the online/offline distinction. The plotly.py package just is offline, and you don't need to say offline anywhere to use it that way.

Documentation

If not before, documentation should be updated to remove use of iplot and allow figures to display themselves in "offline" mode (plotly/documentation#992)

Also, before the v3 to v4 jump we should finish working out how to version the documentation so that the version 3 docs can remain active alongside the version 4 docs.

cc @nicolaskruchten @jackparmer @chriddyp

@nicolaskruchten
Copy link
Member

Thanks for pulling this together! Agreed on all points I think!

@jonmmease jonmmease added the V4 Issues/PRs for Plotly Version 4 label Feb 4, 2019
@jackparmer
Copy link
Contributor

As discussed on Slack, v4 may also be a good opportunity to introduce default mobile support through the plotly.js breakpoints API. This would work well with the "Documentation" and "Theming" spirit of this release.

@PlatonB
Copy link

PlatonB commented Mar 5, 2019

Feedback for annotated heatmaps:

  • Support for None values. Currently Plotly returns an error: TypeError: '<' not supported between instances of 'NoneType' and 'NoneType'.
  • Heatmaps with one axis. They will be useful, at least, in bioinformatics. Examples:

jonmmease added a commit that referenced this issue Apr 12, 2019
## Overview
This PR is an important step towards the [version 4 goal](#1420) of removing all of the chart studio (i.e. cloud-service related) functionality from plotly.py, and putting it in a separate optional package.

## chart studio extraction
For the time being, I've done this by creating a new top-level `chart_studio` package next to the top-level `plotly` package.  I've moved all of the cloud-related functionality to the `chart_studio` package, following the same structure as in the current plotly package.  For example, the `plotly.plotly` module was moved to `chart_studio.plotly`.

This PR takes advantage of the `_future_plotly_` system introduced in #1474 to make this refactor backward compatible.

 - By default all of the old entry points are still usable and they are aliased to the `chart_studio` package.
 - If the `extract_chart_studio` future flag is set, then deprecation warnings are raised whenever the `chart_studio` modules/functions are used from their legacy locations under the `plotly` package.
 - If the `remove_deprecations` future flag is set then the chart studio functions are fully removed from the plotly package and are accessible only under `chart_studio`.  When `remove_deprecations`  is set, `plotly` has no dependency on the `chart_studio` package.

## Usage
To remove the chart_studio functionality from the main `plotly` module, use the

```python
from _plotly_future_ import remove_deprecations
```

This will further speed up imports, and will allow for testing code to make sure it will be compatible with the package structure of plotly.py version 4.


## Import optimization
This PR also makes a relatively minor change to the code generation logic for `graph_objs` and `validator` that yields an import time reduction of ~10-20% .  Rather that creating a single file for each datatype and validator class, all of the classes in a `graph_obj` or `validator` module are specified directly in the `__init__.py` file.  This reduces the number of files significantly, which seems to yield a modest but consistent speedup while being 100% backward compatible.
@astrojuanlu
Copy link
Contributor

Target date for 4.0.0 release? :)

@jonmmease
Copy link
Contributor Author

Hopefully next week. Cross reference release candidate announcement https://community.plot.ly/t/introducing-plotly-py-4-0-0rc1/25639.

@nicolaskruchten
Copy link
Member

@jonmmease I'll let you close this one out :) Nice job!

@gvwilson
Copy link
Contributor

Hi - we are currently trying to tidy up Plotly's public repositories to help us focus our efforts on things that will help users most. Since this issue has been sitting for several years, I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our backlog. Thanks for your help - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
V4 Issues/PRs for Plotly Version 4
Projects
None yet
Development

No branches or pull requests

6 participants