GSS-Cogs / chart-builder

The Chart Builder is a proof-of-concept app to understand the feasibility of using a CSV file (or SPARQL query) to generate and customise a chart or data visualisation
https://chart-builder-no4vxskx7a-nw.a.run.app
2 stars 0 forks source link

Use plotly modules/bundles #138

Closed ajtucker closed 1 year ago

ajtucker commented 2 years ago

According to https://github.com/plotly/plotly.js/blob/master/dist/README.md

The main plotly.js bundles weight in at:

plotly.js plotly.min.js plotly.min.js + gzip plotly-with-meta.js
8.4 MB 3.5 MB 1 MB 8.7 MB

However, we may be able to get away with some smaller subset of bundles, e.g.:

plotly.js basic

Raw size Minified size Minified + gzip size
2.7 MB 997.9 kB 324.5 kB

and plotly.js geo

Raw size Minified size Minified + gzip size
3.1 MB 1.1 MB 367.2 kB

for a bit of a smaller overall download.

charlesons commented 1 year ago

Suggested approach doesn't work as we are using react-plotly which wraps the Plotly import and by default imports the whole bundle.

An alternative solution outlined here may however prove useful:

https://github.com/plotly/react-plotly.js#customizing-the-plotlyjs-bundle