Minimum size JavaScripts require for Gauge chart


« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Dennis on 9th April 2014
Dear Everyone,

Where can I get the minimum version of RGraph.common.core.js, RGraph.gauge.js, and jquery.min.js java scripts for gauge-basic.html?

My MCU program flash is limited and I need to stream down the java script to fit into memory.

Thanks,
Dennis
Posted by Richard on 9th April 2014
Hi there,

There's minified versions of the libraries here:

www.rgraph.net/RGraph.minified.zip

You could then also gzip compress them and they'll be quite small. The jquery.min.js file is already minified but you could compress it too with gzip:

ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js

If you wanted to get rid of jQuery entirely you would need to modify the source file of the Gauge - I don't think it's used too much yet. Search the source for "jq" to find any references to it and comment them out. If you do that though you'll have to do it each time you upgrade RGraph.






Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!
Posted by Dennis on 9th April 2014
Hi Richard,

Thanks for quickly response and useful information. I need to reduce the RGraph.common.core.js about half of the size - below 32 Kbytes mark. I'm planning to remove unrelated functions to gauge graph. My embedded application does not have zip capability so each character is counted.
I don't need to use jquery so I will remove it from my application.

Dennis
Posted by Richard on 9th April 2014
Hi there,

I would imagine there will be a lot that you can remove from RGraph.common.core.js (the RGraph.Background.draw function springs to mind for instance) - but keep in mind that functionality may be limited or may break as a result - and it will also make upgrading, should you want to, tricky to say the least.

My advice would be to remove a function, test, remove another function, test etc. Better still just comment them out instead of removing them as it will make putting them back in easier. Also if you comment them out when you minify the file the minifier will remove them for you - eg the files on the RGraph website have no comments:

www.rgraph.net/libraries/RGraph.common.core.js





Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!
Posted by Dennis on 10th April 2014
Hi Richard,
If I use the zip files, how can I tell browser to unzip the files.
Thank you,
Dennis
Posted by Richard on 10th April 2014
Hi there,

If you're talking about a .zip file - you can't do that. But if you're talking about gzip compression - then that's automatic. eg The files on the RGraph website are gzip compressed. You might need to enable it on your web server though nd the browser has to support it too.




Richard
www.rgraph.net
If RGraph has helped you - please share the website - thanks!
Posted by Dennis on 12th April 2014
Hi Richard,
Thanks for the information.
Dennis

Add a reply

 




« Back to message list
RGraph on social media