All plotly.js dist bundles inject an object Plotly
into the global scope.
Import plotly.js as:
<script src="plotly.min.js"></script>
or the un-minified version as:
<script src="plotly.js" charset="utf-8"></script>
Before the plotly.js script tag, add:
<script>if(typeof window.Int16Array !== 'function')document.write("<scri"+"pt src='extras/typedarray.min.js'></scr"+"ipt>");</script>
<script>document.write("<scri"+"pt src='extras/request_animation_frame.js'></scr"+"ipt>");</script>
Before the plotly.js script tag, add:
<script src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
You can grab the relevant MathJax files in ./dist/extras/mathjax/
.
By default, plotly.js will modify the global MathJax configuration on load.
This can lead to undesirable behavior if plotly.js is loaded alongside
other libraries that also rely on MathJax. To disable this global configuration
process, set the MathJaxConfig
property to 'local'
in the window.PlotlyConfig
object. This property must be set before the plotly.js script tag, for example:
<script>
window.PlotlyConfig = {MathJaxConfig: 'local'}
</script>
<script src="plotly.min.js"></script>
Plotly.js defaults to US English (en-US) and includes British English (en) in the standard bundle. Many other localizations are available - here is an example using Swiss-German (de-CH), see the contents of this directory for the full list. They are also available on our CDN as https://cdn.plot.ly/plotly-locale-de-ch-latest.js OR https://cdn.plot.ly/plotly-locale-de-ch-1.45.3.js Note that the file names are all lowercase, even though the region is uppercase when you apply a locale.
After the plotly.js script tag, add:
<script src="plotly-locale-de-ch.js"></script>
<script>Plotly.setPlotConfig({locale: 'de-CH'})</script>
The first line loads and registers the locale definition with plotly.js, the second sets it as the default for all Plotly plots.
You can also include multiple locale definitions and apply them to each plot separately as a config
parameter:
Plotly.newPlot(graphDiv, data, layout, {locale: 'de-CH'})
The main plotly.js bundle includes all the official (non-beta) trace modules.
It be can imported as minified javascript
- using dist file
dist/plotly.min.js
- using CDN URL https://cdn.plot.ly/plotly-latest.min.js OR https://cdn.plot.ly/plotly-1.45.3.min.js
or as raw javascript:
- using the
plotly.js-dist
npm package (starting inv1.39.0
) - using dist file
dist/plotly.js
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.45.3.js
- using CommonJS with
require('plotly.js')
If you would like to have access to the attribute meta information (including attribute descriptions as on the schema reference page), use dist file dist/plotly-with-meta.js
The main plotly.js bundle weights in at:
plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |
---|---|---|---|
6.2 MB | 2.9 MB | 865.3 kB | 6.5 MB |
Starting in v1.15.0
, plotly.js also ships with several partial bundles:
Starting in v1.39.0
, each plotly.js partial bundle has a corresponding npm package with no dependencies.
The basic
partial bundle contains trace modules scatter
, bar
and pie
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
2.3 MB | 817.3 kB | 267.1 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-basic-latest.js |
Latest minified | https://cdn.plot.ly/plotly-basic-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-basic-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-basic-1.45.3.min.js |
Install plotly.js-basic-dist
with
npm install plotly.js-basic-dist
ES6 module usage:
import Plotly from 'plotly.js-basic-dist'
CommonJS usage:
var Plotly = require('plotly.js-basic-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-basic.js |
dist bundle (minified) | dist/plotly-basic.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-basic' |
CommonJS | require('plotly.js/lib/index-basic') |
The cartesian
partial bundle contains trace modules scatter
, bar
, box
, heatmap
, histogram
, histogram2d
, histogram2dcontour
, pie
, contour
, scatterternary
and violin
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
2.6 MB | 932.8 kB | 303.5 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-cartesian-latest.js |
Latest minified | https://cdn.plot.ly/plotly-cartesian-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-cartesian-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-cartesian-1.45.3.min.js |
Install plotly.js-cartesian-dist
with
npm install plotly.js-cartesian-dist
ES6 module usage:
import Plotly from 'plotly.js-cartesian-dist'
CommonJS usage:
var Plotly = require('plotly.js-cartesian-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-cartesian.js |
dist bundle (minified) | dist/plotly-cartesian.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-cartesian' |
CommonJS | require('plotly.js/lib/index-cartesian') |
The geo
partial bundle contains trace modules scatter
, scattergeo
and choropleth
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
2.3 MB | 834.5 kB | 274.8 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-geo-latest.js |
Latest minified | https://cdn.plot.ly/plotly-geo-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-geo-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-geo-1.45.3.min.js |
Install plotly.js-geo-dist
with
npm install plotly.js-geo-dist
ES6 module usage:
import Plotly from 'plotly.js-geo-dist'
CommonJS usage:
var Plotly = require('plotly.js-geo-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-geo.js |
dist bundle (minified) | dist/plotly-geo.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-geo' |
CommonJS | require('plotly.js/lib/index-geo') |
The gl3d
partial bundle contains trace modules scatter
, scatter3d
, surface
, mesh3d
, cone
and streamtube
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
3.4 MB | 1.3 MB | 425.5 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-gl3d-latest.js |
Latest minified | https://cdn.plot.ly/plotly-gl3d-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-gl3d-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-gl3d-1.45.3.min.js |
Install plotly.js-gl3d-dist
with
npm install plotly.js-gl3d-dist
ES6 module usage:
import Plotly from 'plotly.js-gl3d-dist'
CommonJS usage:
var Plotly = require('plotly.js-gl3d-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-gl3d.js |
dist bundle (minified) | dist/plotly-gl3d.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-gl3d' |
CommonJS | require('plotly.js/lib/index-gl3d') |
The gl2d
partial bundle contains trace modules scatter
, scattergl
, splom
, pointcloud
, heatmapgl
, contourgl
and parcoords
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
3.4 MB | 1.4 MB | 444.7 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-gl2d-latest.js |
Latest minified | https://cdn.plot.ly/plotly-gl2d-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-gl2d-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-gl2d-1.45.3.min.js |
Install plotly.js-gl2d-dist
with
npm install plotly.js-gl2d-dist
ES6 module usage:
import Plotly from 'plotly.js-gl2d-dist'
CommonJS usage:
var Plotly = require('plotly.js-gl2d-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-gl2d.js |
dist bundle (minified) | dist/plotly-gl2d.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-gl2d' |
CommonJS | require('plotly.js/lib/index-gl2d') |
The mapbox
partial bundle contains trace modules scatter
and scattermapbox
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
2.8 MB | 1.4 MB | 412.8 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-mapbox-latest.js |
Latest minified | https://cdn.plot.ly/plotly-mapbox-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-mapbox-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-mapbox-1.45.3.min.js |
Install plotly.js-mapbox-dist
with
npm install plotly.js-mapbox-dist
ES6 module usage:
import Plotly from 'plotly.js-mapbox-dist'
CommonJS usage:
var Plotly = require('plotly.js-mapbox-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-mapbox.js |
dist bundle (minified) | dist/plotly-mapbox.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-mapbox' |
CommonJS | require('plotly.js/lib/index-mapbox') |
The finance
partial bundle contains trace modules scatter
, bar
, histogram
, pie
, ohlc
and candlestick
.
Raw size | Minified size | Minified + gzip size |
---|---|---|
2.4 MB | 850.8 kB | 277.3 kB |
Flavor | URL |
---|---|
Latest | https://cdn.plot.ly/plotly-finance-latest.js |
Latest minified | https://cdn.plot.ly/plotly-finance-latest.min.js |
Tagged | https://cdn.plot.ly/plotly-finance-1.45.3.js |
Tagged minified | https://cdn.plot.ly/plotly-finance-1.45.3.min.js |
Install plotly.js-finance-dist
with
npm install plotly.js-finance-dist
ES6 module usage:
import Plotly from 'plotly.js-finance-dist'
CommonJS usage:
var Plotly = require('plotly.js-finance-dist');
Flavor | Location |
---|---|
dist bundle | dist/plotly-finance.js |
dist bundle (minified) | dist/plotly-finance.min.js |
ES6 module | import Plotly from 'plotly.js/lib/index-finance' |
CommonJS | require('plotly.js/lib/index-finance') |
This file is auto-generated by npm run stats
. Please do not edit this file directly.