We encourage all interested developers to read the changelog carefully to find out about every change and bugfix, but here is a summary of the important changes along with some commentary.
We take stability and backwards-compatibility very seriously, so although in principle a new major version could introduce numerous breaking changes, we are bumping the major version number in Plotly.js only because we are removing the following functionality, which we feel is very seldom-used, has long been deprecated and/or has long been un/underdocumented. We are making these changes today so as to be able to continue maintaining the library without needing to invest in upkeep of legacy/unused functionality.
We are dropping:
- Support for Internet Explorer 9 and 10: our support for these browsers has been poor and degrading for months, and we’re officially ruling out supporting them at all starting now. For reference, Microsoft stopped supporting IE 10 more than 5 years ago.
contourgltrace type: this trace type is not currently in the main bundle, and this removal will only impact users of the
gl2dcustom bundle. This trace has many problems and is easily replaced by using the non-WebGL-powered
areatrace type: this trace type has been marked as deprecated and un/under-documented for years; the
barpolartrace types should be used instead.
The legacy polar
tattributes of the otherwise-cartesian
bartraces: these attributes have been marked as deprecated and un/under-documented for years; the
barpolartrace types should be used instead.
Plotly.plot()function: this function has been deprecated/under-documented for years, in favour of
Plotly.react()or a combination of
Beyond the removals above, we have made the following changes:
We are marking the
pointcloudtrace types as “deprecated”, and recommending that folks use the
scattergltrace types instead. These will be removed in a future major version, such as Plotly.js 3.0. If you are using these, please reach out and tell us why and how, so we can take your needs into consideration as we move forward!
We are marking the
transformsset of attributes in all traces as “deprecated” and recommending that folks use a dedicated data-processing library to compute aggregations.
-latest.min.jsCDN bundle will no longer be updated (it will stay pinned to 1.58.4) and there will not be an equivalent for v2. We recommend that folks using Plotly.js explicitly manage the version of the library that they are using.
We are no longer providing a build of MathJax in our
distfolder and are recommending that folks bring their own MathJax. We are testing with version 2.7.5 and are not yet compatible with version 3.
We have changed a few of the user-visible defaults such as setting the default
xand we have removed by default the spikeline/hovermode buttons from the modebar (although they can be added back in if you like). We have also streamlined the behaviour of our hoverlabels to make them more intuitive and consistent.
By popular demand, we have removed the
Aatext from legends when using text with lines or markers in scatter traces
bartraces now defaults to
autoso if you want to use
textwithout it appearing on the figure, you’ll need to explicitly set
Since this is mostly a maintenance/cleanup release for us, intended to allow us to move faster in the future, this particular version intentionally does not include many new features, and the ones that are included will be announced in a separate post once the documentation is live.
The one major improvement to the library we have made is that a number of our partial bundles now no longer use function constructors, and therefore do not trigger the corresponding
unsafe-eval Content Security Policy error. The bundles that are now function-constructor safe are:
geo , and
mapbox. We are committing to making this a permanent change. We have also added a new partial bundle called
strict, which contains the maximal subset of the library that works without using function constructors, and as we are able to refactor the rest of the functionality of Plotly.js to avoid using function constructors we will expand this partial bundle. This security-related work was generously sponsored by Equinor, and we sincerely thank them for their vision and support.
We have also added a new and easy-to-use mechanism for generating your own custom partial bundles, for cases when the distributed partial bundles don’t quite meet your needs.
Finally, we are pleased that you can now import Plotly.js using ES6
We’ve upgraded our README to try to cover as many installation/loading/building scenarios as we could to guide folks through starting to use Plotly.js. Please check it out as you consider upgrading!
plotly.graph_objects module in Plotly.py is automatically generated from Plotly.js, the removals of trace types and attributes listed above force us to change the major version number in Plotly.py as well, to 5.0. Update: Plotly.py 5.0 is now out!
Dash depends on Plotly.js via the
dcc.Graph component from
dash_core_components, although we don’t consider the portions of the Plotly.js schema that were deprecated before Dash was released to be part of the public Dash API. An upcoming minor version of
dash_core_components will be upgraded to use Plotly.js 2.0, meaning Dash users will get the new version of Plotly.js via a routine upgrade of the
dash package, which depends on
You can control the exact version of Plotly.js which
dcc.Graph loads by placing a specific Plotly.js/version bundle into your Dash app
assets directory, meaning that you can try using v2 in your apps right now, or you can control exactly when you upgrade. The same approach allows you to choose a specific partial bundle to use, for example if your app uses only a subset of Plotly.js features, or if your organization policies require to use the new
strict bundle to avoid Content Security Policy warnings. We have also added a new and easy-to-use mechanism for generating your own custom partial bundles, for cases when the distributed partial bundles don’t quite meet your needs.
We’ve done a lot of testing of the new version in various environments, but the Plotly ecosystem is pretty broad and the web can be a messy place, so we may have broken something in error. Please report issues on GitHub if you encounter them and we’ll try to be responsive with patch versions! In the meantime, we’re right back to work on 2.1 with a new trace type in the pipeline (
icicle!) and some other long-requested features.