Javascript libraries have certainly come a long way. The last time I wrote serious Javascript programs was four years ago. There were no libraries then, DHTML code was very brittle, … Well fast forward four years and wow, now you can do cross platform vector graphics in Javascript. One such a library is dojo. I started reading about it yesterday and decided to create a chart of my weight for the month of February and display it as a graph in dojo. I’ll update this graph during this month and see if I can lose a few pounds in the process.
You can view the HTML source to get an idea of how easy it is to create graphs in Javascript. The entire Javascript that gets downloaded for my weight graph application is less than 91K bytes. One of the key designs of dojo is its packaging framework where you end up only downloading the files that are needed. It is very impressive that all of the capability is at your service for just 91K bytes.
Here are the details of the files and their sizes in bytes that were downloaded.
| src/debug.js | 2963 |
| src/collections/Store.js | 7117 |
| src/charting/Chart.js | 2459 |
| src/charting/PlotArea.js | 5918 |
| src/gfx/color/hsl.js | 2549 |
| src/charting/Plot.js | 2918 |
| src/charting/Axis.js | 4702 |
| src/charting/svg/Axis.js | 7832 |
| src/charting/Series.js | 5783 |
| src/charting/Plotters.js | 620 |
| src/charting/svg/Plotters.js | 29348 |
| src/svg.js | 10435 |
| src/charting/svg/PlotArea.js | 3087 |
| src/json.js | 4308 |
| src/AdapterRegistry.js | 3054 |
| TOTAL Number of bytes | 93093 |
July 19, 2007 at 5:02 am |
[...] at creating a chart in Ruby so I started looking at charting libraries. I like the features of dojo, but the dojo documentation is kind of sparse and each quest for information ends up taking too [...]