Skip to content

Distributing partial plotly.js bundles #684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
etpinard opened this issue Jun 23, 2016 · 2 comments · Fixed by #740
Closed

Distributing partial plotly.js bundles #684

etpinard opened this issue Jun 23, 2016 · 2 comments · Fixed by #740

Comments

@etpinard
Copy link
Contributor

We currently distribute 3 plotly.js bundles:

  • plotly.js
  • plotly.min.js (minified version of plotly.js)
  • plotly-with-meta.js (plotly.js including attribute meta which are otherwise compressed)

All 3 bundles are generated using the same index file in lib/index.js.

For v1.14.0, plotly.min.js includes 14 trace modules and weighs a hefty 1.17 MB. So, it goes without saying that we should start distributing partial bundles. Determining how to split our modules into partial bundles isn't as obvious though.

I propose:

  • plotly.js, plotly.min.js and plotly-with-meta.js will always include all non-beta modules
  • plotly-basic.js would include scatter, bar and pie
  • plotly-cartesian would include all cartesian and ternary trace types
  • plotly-geo would include all geo trace types
  • plotly-gl3d.js would include all gl3d trace types
  • plotly-gl2d.js would include all gl2d trace types
  • or maybe a plotly-gl.js that would combine all gl3d and gl2d trace types
  • plotly-mapbox.js would include all mapbox trace types
@mdtusz
Copy link
Contributor

mdtusz commented Jun 23, 2016

Those sound like pretty sensible divisions to me. It would be really helpful if we add a very clear page that explains these different bundles as the very first section of the readme then (and on our docs pages too).

@rreusser
Copy link
Contributor

Maybe a table (for illustration; numbers etc totally made up here):

size scatter box hist
plotly.js 1.2M x x
plotly-basic.js 500K x x
plotly-cartesian.js 600K x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants