11# Using distributed files
22
3+ All plotly.js dist bundles inject an object ` Plotly ` into the global scope.
4+
35Import plotly.js as:
46
57``` html
68<script type =" text/javascript" src =" plotly.min.js" ></script >
7-
89```
910
1011or the un-minified version as:
@@ -21,11 +22,154 @@ To support IE9, put:
2122
2223before the plotly.js script tag.
2324
24-
2525To add MathJax, put
2626
2727``` html
2828<script type =" text/javascript" src =" mathjax/MathJax.js?config=TeX-AMS-MML_SVG" ></script >
2929```
3030
31- before the plotly.js script tag. You can grab the relevant MathJax files in ` ./dist/extras/mathjax/ ` .
31+ before the plotly.js script tag. You can grab the relevant MathJax files in ` ./dist/extras/mathjax/ ` .
32+
33+ # Bundle information
34+
35+ The main plotly.js bundle includes all the official (non-beta) trace modules.
36+
37+ It be can imported as minified javascript
38+ - using dist file ` dist/plotly.min.js `
39+ - using CDN URL https://cdn.plot.ly/plotly-plotly-latest.min.js OR https://cdn.plot.ly/plotly-plotly-1.15.0.min.js
40+
41+ or as raw javascript:
42+ - using dist file ` dist/plotly.js `
43+ - using CDN URL https://cdn.plot.ly/plotly-plotly-latest.js OR https://cdn.plot.ly/plotly-plotly-1.15.0.js
44+ - using CommonJS with ` require('plotly.js') `
45+
46+ If you would like to have access to the attribute meta information (including attribute descriptions as on the [ schema reference page] ( https://plot.ly/javascript/reference/ ) ), use dist file ` dist/plotly-with-meta.js `
47+
48+ The main plotly.js bundle weights in at:
49+
50+ | plotly.js | plotly.min.js | plotly.min.js + gzip | plotly-with-meta.js |
51+ | -----------| ---------------| ----------------------| ---------------------|
52+ | 2.8 MB | 1.2 MB | 375.7 kB | 2.9 MB |
53+
54+ ## Partial bundles
55+
56+ Starting in ` v1.15.0 ` , plotly.js also ships with several _ partial_ bundles:
57+
58+ - [ basic] ( #plotlyjs-basic )
59+ - [ cartesian] ( #plotlyjs-cartesian )
60+ - [ geo] ( #plotlyjs-geo )
61+ - [ gl3d] ( #plotlyjs-gl3d )
62+ - [ gl2d] ( #plotlyjs-gl2d )
63+ - [ mapbox] ( #plotlyjs-mapbox )
64+
65+ ### plotly.js basic
66+
67+ The ` basic ` partial bundle contains the ` scatter ` , ` bar ` and ` pie ` trace modules.
68+
69+ | Way to import | Location |
70+ | ---------------| ----------|
71+ | dist bundle | ` dist/plotly-basic.js ` |
72+ | dist bundle (minified) | ` dist/plotly-basic.min.js ` |
73+ | CDN URL (latest) | https://cdn.plot.ly/plotly-basic-latest.js |
74+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-basic-latest.min.js |
75+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-basic-1.15.0.js |
76+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-basic-1.15.0.min.js |
77+ | CommonJS | ` require('plotly.js/lib/index-basic') ` |
78+
79+ | Raw size | Minified size | Minified + gzip size |
80+ | ------| -----------------| ------------------------|
81+ | 1.4 MB | 539 kB | 177.9 kB |
82+
83+ ### plotly.js cartesian
84+
85+ The ` cartesian ` partial bundle contains the ` scatter ` , ` bar ` , ` box ` , ` heatmap ` , ` histogram ` , ` histogram2d ` , ` histogram2dcontour ` , ` pie ` , ` contour ` and ` scatterternary ` trace modules.
86+
87+ | Way to import | Location |
88+ | ---------------| ----------|
89+ | dist bundle | ` dist/plotly-cartesian.js ` |
90+ | dist bundle (minified) | ` dist/plotly-cartesian.min.js ` |
91+ | CDN URL (latest) | https://cdn.plot.ly/plotly-cartesian-latest.js |
92+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-cartesian-latest.min.js |
93+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-cartesian-1.15.0.js |
94+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-cartesian-1.15.0.min.js |
95+ | CommonJS | ` require('plotly.js/lib/index-cartesian') ` |
96+
97+ | Raw size | Minified size | Minified + gzip size |
98+ | ------| -----------------| ------------------------|
99+ | 1.6 MB | 608 kB | 198.7 kB |
100+
101+ ### plotly.js geo
102+
103+ The ` geo ` partial bundle contains the ` scatter ` , ` scattergeo ` and ` choropleth ` trace modules.
104+
105+ | Way to import | Location |
106+ | ---------------| ----------|
107+ | dist bundle | ` dist/plotly-geo.js ` |
108+ | dist bundle (minified) | ` dist/plotly-geo.min.js ` |
109+ | CDN URL (latest) | https://cdn.plot.ly/plotly-geo-latest.js |
110+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-geo-latest.min.js |
111+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-geo-1.15.0.js |
112+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-geo-1.15.0.min.js |
113+ | CommonJS | ` require('plotly.js/lib/index-geo') ` |
114+
115+ | Raw size | Minified size | Minified + gzip size |
116+ | ------| -----------------| ------------------------|
117+ | 1.4 MB | 568.5 kB | 188.9 kB |
118+
119+ ### plotly.js gl3d
120+
121+ The ` gl3d ` partial bundle contains the ` scatter ` , ` scatter3d ` , ` surface ` and ` mesh3d ` trace modules.
122+
123+ | Way to import | Location |
124+ | ---------------| ----------|
125+ | dist bundle | ` dist/plotly-gl3d.js ` |
126+ | dist bundle (minified) | ` dist/plotly-gl3d.min.js ` |
127+ | CDN URL (latest) | https://cdn.plot.ly/plotly-gl3d-latest.js |
128+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl3d-latest.min.js |
129+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-gl3d-1.15.0.js |
130+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl3d-1.15.0.min.js |
131+ | CommonJS | ` require('plotly.js/lib/index-gl3d') ` |
132+
133+ | Raw size | Minified size | Minified + gzip size |
134+ | ------| -----------------| ------------------------|
135+ | 2.2 MB | 975 kB | 308 kB |
136+
137+ ### plotly.js gl2d
138+
139+ The ` gl2d ` partial bundle contains the ` scatter ` , ` scattergl ` , ` heatmapgl ` and ` contourgl ` trace modules.
140+
141+ | Way to import | Location |
142+ | ---------------| ----------|
143+ | dist bundle | ` dist/plotly-gl2d.js ` |
144+ | dist bundle (minified) | ` dist/plotly-gl2d.min.js ` |
145+ | CDN URL (latest) | https://cdn.plot.ly/plotly-gl2d-latest.js |
146+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-gl2d-latest.min.js |
147+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-gl2d-1.15.0.js |
148+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-gl2d-1.15.0.min.js |
149+ | CommonJS | ` require('plotly.js/lib/index-gl2d') ` |
150+
151+ | Raw size | Minified size | Minified + gzip size |
152+ | ------| -----------------| ------------------------|
153+ | 2 MB | 844.6 kB | 268.4 kB |
154+
155+ ### plotly.js mapbox
156+
157+ The ` mapbox ` partial bundle contains the ` scatter ` and ` scattermapbox ` trace modules.
158+
159+ | Way to import | Location |
160+ | ---------------| ----------|
161+ | dist bundle | ` dist/plotly-mapbox.js ` |
162+ | dist bundle (minified) | ` dist/plotly-mapbox.min.js ` |
163+ | CDN URL (latest) | https://cdn.plot.ly/plotly-mapbox-latest.js |
164+ | CDN URL (latest minified) | https://cdn.plot.ly/plotly-mapbox-latest.min.js |
165+ | CDN URL (tagged) | https://cdn.plot.ly/plotly-mapbox-1.15.0.js |
166+ | CDN URL (tagged minified) | https://cdn.plot.ly/plotly-mapbox-1.15.0.min.js |
167+ | CommonJS | ` require('plotly.js/lib/index-mapbox') ` |
168+
169+ | Raw size | Minified size | Minified + gzip size |
170+ | ------| -----------------| ------------------------|
171+ | 2.3 MB | 947.6 kB | 282.4 kB |
172+
173+ ----------------
174+
175+ _ This file is auto-generated by ` npm run stats ` . Please do not edit this file directly._
0 commit comments