All plotly.js dist bundles inject an object Plotly
into the global scope.
Import plotly.js as:
<script type="text/javascript" src="plotly.min.js"></script>
or the un-minified version as:
<script type="text/javascript" src="plotly.js" charset="utf-8"></script>
To support IE9, put:
<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.
To add MathJax, put
<script type="text/javascript" src="mathjax/MathJax.js?config=TeX-AMS-MML_SVG"></script>
before the plotly.js script tag. You can grab the relevant MathJax files in ./dist/extras/mathjax/
.
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.25.2.min.js
or as raw javascript:
- using dist file
dist/plotly.js
- using CDN URL https://cdn.plot.ly/plotly-latest.js OR https://cdn.plot.ly/plotly-1.25.2.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 |
---|---|---|---|
5.1 MB | 2.1 MB | 634.4 kB | 5.2 MB |
Starting in v1.15.0
, plotly.js also ships with several partial bundles:
The sankey
partial bundle contains the scatter
and sankey
trace modules.
Way to import | Location |
---|---|
dist bundle | dist/plotly-sankey.js |
dist bundle (minified) | dist/plotly-sankey.min.js |
CDN URL (latest) | https://cdn.plot.ly/plotly-sankey-latest.js |
CDN URL (latest minified) | https://cdn.plot.ly/plotly-sankey-latest.min.js |
CDN URL (tagged) | https://cdn.plot.ly/plotly-sankey-1.25.2.js |
CDN URL (tagged minified) | https://cdn.plot.ly/plotly-sankey-1.25.2.min.js |
CommonJS | require('plotly.js/lib/index-sankey') |
Raw size | Minified size | Minified + gzip size |
---|---|---|
1.7 MB | 665.9 kB | 216.4 kB |
This file is auto-generated by npm run stats
. Please do not edit this file directly.