Skip to content
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

How to minimize library size if I want to use only line charts functionality ? #991

Closed
happytm opened this issue Aug 21, 2024 · 2 comments
Closed
Labels
question Further information is requested

Comments

@happytm
Copy link

happytm commented Aug 21, 2024

I am running your excellent chart code on ESP32 micro controller but I do not need all features except simple line charts. Since it is running on micro controller with limited flash I would like to reduce size of javascript and css files.

Is it possible to make it barebones like around 20kb? If so how can I do it.

Thanks.

@leeoniya
Copy link
Owner

leeoniya commented Mar 8, 2025

20kb might be tricky. it really depends on what features you need.

if you only need the line rendering, other renderers are easy to exclude. you can also exclude the points renderer and the uPlot.join() util func.

you can edit the feats.js file and run npm run build to make a custom build.

https://github.com/leeoniya/uPlot/blob/master/src/feats.js

i wouldn't recommend excluding time or legend features, it will probably cause errors since those are more deeply integrated and i havent checked if all the necessary ifdefs are there currently.

@leeoniya leeoniya added the question Further information is requested label Mar 8, 2025
@leeoniya
Copy link
Owner

leeoniya commented Mar 8, 2025

i just tried it and this only saves about 7kb in total (50kb -> 43kb). looking through what remains, there are no obvious things that can be removed easily i'm afraid

@leeoniya leeoniya closed this as completed Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants