Updating Cubism to a modern version of d3.js
cubism, grafana, javascript ·In a previous post, I mentioned working on a cubism plugin for grafana.
The core of this plugin is the cubism library, but it seems that this library is somehow stuck in 2014 and it’s not working well in the current Javascript ecosystem.
I found a somewhat newer version of the library that was ported to ES 6 (I must confess that I’m kind of clueless on what are the goodness that ES 6/2015 is bringing, but I guess that being compatible with a recent ES runtime is a good thing).
But it’s only somewhat recent and doesn’t seems to receive much update, so I took on me to learn a bit more of Javascript and the whole npm
ecosystem and make it work with the latest version of d3.js.
There was decent amount of work to get the whole npm
environment updated, it turns out that a bunch of stuff have changed in the last 5 years …
A lot of babel
plugins are now integrated in babel
same for rollup
.
Updating to d3 v6 and then v7 was fairly straightforward so I don’t get why people complained.
Because I like to see when I break things and where I am in term of coverage I added some Github workflows to build things, run e2e tests and gather coverage.
I’m still hopeful that the original author of the project will react and allow me to merge my diff and potentially give me access to his repository and also to the npm project, but I need also to start thinking how to properly publish it should this not happen.
In the meantime my fork is available in github/ekacnet/cubism-es.
If you find it useful don’t hesitate to tell me or buy me some coffee.