# 🎉 Announcing Plotly.js 2.0!

**URL:** https://community.plotly.com/t/announcing-plotly-js-2-0/53675
**Category:** plotly.js
**Tags:** announcements
**Created:** [June 8, 2021, 1:20pm UTC](https://community.plotly.com/t/announcing-plotly-js-2-0/53675 "2021-06-08T13:20:39Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![nicolaskruchten](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/nicolaskruchten/32/7018_2.png) [@nicolaskruchten](https://community.plotly.com/u/nicolaskruchten)
#### Post date: [June 8, 2021, 1:20pm UTC](https://community.plotly.com/t/announcing-plotly-js-2-0/53675/1 "2021-06-08T13:20:39Z")

</div>

I’m very pleased to announce that **yesterday we released version 2.0 of Plotly.js** : the core Javascript library that renders all Plotly plots! This release has been more than 5 months in the making (not counting the 5 years of development before that) and I want to specifically praise and thank **[Mojtaba Samimi](https://github.com/archmoj)** (aka @archmoj) for doing essentially all of the implementation and maintenance work on this release – and indeed almost every release in the past year – with design/QA/review support from the rest of our team. 🏆

> Our commitment to semantic versioning requires us to make this release a major version bump because we are making some backwards-incompatible changes to older and deprecated features (see below), but we see this as a **low-risk maintenance release** and we expect that **the vast majority of users should plan to upgrade without fearing significant issues** , including Javascript developers who embed Plotly.js directly in their apps or websites, as well as data scientists using Plotly.js via Plotly.py in a notebook environment, and of course Dash app developers!

We encourage all interested developers to [read the changelog carefully](https://github.com/plotly/plotly.js/releases/tag/v2.0.0) to find out about every change and bugfix, but here is a summary of the important changes along with some commentary.

## ⚠ What is getting changed or removed?

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.
- **The `contourgl` trace type** : this trace type is not currently in the main bundle, and this removal will only impact users of the `gl2d` custom bundle. This trace has many problems and is easily replaced by using the non-WebGL-powered `contour` trace.
- **The `area` trace type** : this trace type has been marked as deprecated and un/under-documented for years; the `barpolar` trace types should be used instead.
- **The legacy polar `r` and `t` attributes of the otherwise-cartesian `scatter` and `bar` traces** : these attributes have been marked as deprecated and un/under-documented for years; the `scatterpolar` and `barpolar` trace types should be used instead.
- **The `Plotly.plot()` function**: this function has been deprecated/under-documented for years, [in favour of `Plotly.react()` or a combination of `Plotly.newPlot()`/`Plotly.restyle()`/`Plotly.relayout()`](https://plotly.com/javascript/plotlyjs-function-reference/)
- **The `Plotly.d3` object** : this object currently mirrors all of version 3 of the D3 library. Version 4 of D3 came out over 4 years ago (the current latest version is 6.5!) and the state of Javascript packaging has evolved such that it’s now much easier for Javascript developers to “bring their own” version of d3 to their app rather than rely on the one provided by Plotly.js.

Beyond the removals above, we have made the following changes:

- **We are marking the `heatmapgl` and `pointcloud` trace types as “deprecated”** , and recommending that folks use the `heatmap`/`image` or `scattergl` trace 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 `transforms` set of attributes in all traces as “deprecated”** and recommending that folks use a dedicated data-processing library to compute aggregations.
- **The `-latest.min.js` CDN 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 `dist` folder** 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 `layout.hovermode` to `closest` from `x` and 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 `Aa` text from legends when using text with lines or markers** in scatter traces 🙂
- **`textposition` for `bar` traces now defaults to `auto`** so if you want to use `text` without it appearing on the figure, you’ll need to explicitly set `textposition="none"`

## 🛠 Improvements to packaging and distribution

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](https://github.com/plotly/plotly.js/blob/v2.0.0-rc.0/dist/README.md) 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: `basic` , `cartesian` , `finance` , `geo` , and `mapbox`. We are committing to making this a permanent change. We have also added [a new partial bundle called `strict`](https://github.com/plotly/plotly.js/blob/v2.0.0-rc.0/dist/README.md#plotlyjs-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](https://github.com/plotly/plotly.js/issues/897#issuecomment-781422217) was generously sponsored by [Equinor](https://www.equinor.com/en.html), 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](https://github.com/plotly/plotly.js/blob/master/CUSTOM_BUNDLE.md)**, 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 `import`**.

> We’ve upgraded our [README](https://github.com/plotly/plotly.js/blob/master/README.md) 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!

## 🐍 What about Plotly.py?

Since [the `plotly.graph_objects` module in Plotly.py](https://plotly.com/python/graph-objects/) 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!](https://community.plotly.com/t/introducing-plotly-py-5-0-0-a-new-federated-jupyter-extension-icicle-charts-and-bar-chart-patterns/54039)**

## 💃 What about Dash?

Dash depends on Plotly.js via [the `dcc.Graph` component from `dash_core_components`](https://dash.plotly.com/dash-core-components/graph), 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 `dash_core_components`.

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](https://dash.plotly.com/dash-core-components/graph), 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](https://github.com/plotly/plotly.js/blob/master/dist/README.md), 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](https://github.com/plotly/plotly.js/blob/master/CUSTOM_BUNDLE.md), for cases when the distributed partial bundles don’t quite meet your needs.

## ➡ What now?

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](https://github.com/plotly/plotly.js/issues/new) 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.

---

_[View the full topic](https://community.plotly.com/t/announcing-plotly-js-2-0/53675)._
