I needed a few simple graphs for a blog post [0]. Instead of slapping together a few SVGs and moving on, I decided to write a whole library to parse CSS keyframe animations and convert them to interactive graphs.
It ended up being a rabbit hole, with a lot of caveats. But it was fun to make, and I'm really happy with the graphs it produces.
I'm not sure how useful it will be for others. If you end up using it, I'd love to see how - feel free to reach out.
It's open source [1] under the MIT license. Written in TypeScript with no dependencies.
Let me know what you think!
It can definitely be improved. Using HSL or even OKLch would probably give nicer results. I may look into it.
return (r * 1000 + g * 100 + b * 10 + a * 255) / 10000;
https://github.com/Stanko/monorail/blob/2da287a4e822705a99d7...I thought about making all values on the chart draggable. It would then update the CSS animation in realtime. I think would be very cool, but I’m not sure if there is a real usage for something like that, so I haven’t touched it.