Quoted from https://github.com/plotly/plotly.js/blob/main/CUSTOM_BUNDLE.md:
Please note that the scatter trace is currently included in all bundles and cannot be removed. This behaviour may change in the future, so we recommend that you explicitly include scatter anyway if you need it in your bundle.
There was previously an attempt to make scatter optional in #5535, but that PR was closed without being merged.
Since plotly.js is relatively large even when using a custom bundle, being able to exclude unused traces such as scatter would help further reduce the bundle size.
I'm not sure how much bundle size reduction this would result in, since scattergl, scatterternary and some other traces reuse parts of the scatter implementation. Still, it seems useful for custom bundles to avoid including trace modules that are not explicitly requested where possible.
Would it be worth to re-consider this optimization?
If scatter still needs to be included for architectural reasons, it may be worth updating the documentation? Since the PR is closed.
Quoted from https://github.com/plotly/plotly.js/blob/main/CUSTOM_BUNDLE.md:
There was previously an attempt to make scatter optional in #5535, but that PR was closed without being merged.
Since
plotly.jsis relatively large even when using a custom bundle, being able to exclude unused traces such asscatterwould help further reduce the bundle size.I'm not sure how much bundle size reduction this would result in, since
scattergl,scatterternaryand some other traces reuse parts of thescatterimplementation. Still, it seems useful for custom bundles to avoid including trace modules that are not explicitly requested where possible.Would it be worth to re-consider this optimization?
If
scatterstill needs to be included for architectural reasons, it may be worth updating the documentation? Since the PR is closed.