Skip to content

Plotly.js 2.0 compatibility #1911

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

Closed
nicolaskruchten opened this issue Jan 20, 2021 · 4 comments
Closed

Plotly.js 2.0 compatibility #1911

nicolaskruchten opened this issue Jan 20, 2021 · 4 comments

Comments

@nicolaskruchten
Copy link

Hi there,

I lead the graphing libraries team at Plotly where we're busy working on version 2.0 of Plotly.js. I'm reaching out to folks who we know are "downstream" of Plotly.js to give you a heads-up about the changes so you can let me know if/how disruptive they're likely to be for you :)

Our approach here is not to make gratuitous breaking changes, but mostly to drop support for un/under-used functionality that slows down development for frequently-used functionality. We expect that the vast majority of users of Plotly.js and downstream systems like Plotly.py, Plotly.R, PlotlyJS.jl, Plotly.NET etc will be unaffected by these changes. The tracking issue we've got going is here plotly/plotly.js#5395

The major changes include, at the Javascript layer:

  • dropping IE 9/10 support due to a switch in the Promise polyfill we're using, for security reasons
  • dropping exports of old versions of d3 modules under Plotly.d3 (so we can upgrade them internally)
  • dropping some exports of deprecated methods like Plotly.plot in favour of Plotly.newPlot and Plotly.react

The major changes at the schema layer:

  • dropping support for pointcloud, area and contourgl traces, as well as the legacy polar attributes from scatter like scatter.r and layout.angularaxis
  • dropping the role key from the schema altogether

I'm happy to answer any questions or consider changing our plans if it can avoid some major downstream disruption, so please get in touch or reply to this issue or to plotly/plotly.js#5395 :)

Nicolas

@cpsievert
Copy link
Collaborator

dropping some exports of deprecated methods like Plotly.plot in favour of Plotly.newPlot and Plotly.react

What are the newly suggested method(s) named?

@nicolaskruchten
Copy link
Author

We're dropping Plotly.plot() and the suggested replacement is Plotly.react() basically. Plotly.react() on an empty div has the same effect as Plotly.newPlot() and Plotly.react() on an existing plot with a new state internally figures out the equivalent Plotly.restyle() and Plotly.relayout() calls. If you like computing deltas yourself, or if your architecture mostly consumes deltas rather than full figures, then the suggested replacement is Plotly.newPlot() followed by Plotly.restyle() or `Plotly.relayout().

Note that this state of affairs is what's been documented here https://plotly.com/javascript/plotlyjs-function-reference/ for a few years now, we're just finally getting around to dropping support for Plotly.plot now.

In terms of other things being dropped, I mostly have a list of what's being kept (in plotly/plotly.js#5395) but we should indeed assemble a full list of what's being dropped. I'll comment to that effect in plotly/plotly.js#5395.

LMK if I can help you out with this transition @cpsievert! If you need dev bundles or you want to talk about this or whatever, I'm around to help.

@nicolaskruchten
Copy link
Author

Any update on your end @cpsievert ? We're about to push a release candidate up to NPM which should help with testing and will give you a preview of the full change log :)

@bersbersbers
Copy link
Contributor

This can be closed now that plotly.R 4.10.0 is released, or will more things change in the future?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants