{"by":"andrewcourtice","descendants":35,"id":40009143,"kids":[40016929,40016372,40018031,40016013,40028895,40028728,40038854,40016957,40015343,40018397,40023420,40022875,40022249,40014393],"score":161,"text":"Here&#x27;s a project I&#x27;ve been working on for a little while now. Ripl is a JS library that provides a unified API for rendering shapes on both canvas and SVG interchangeably. Over the years I&#x27;ve used D3 extensively to create data visualisations so I figured I&#x27;d have a go at making my own version with a slightly more modern API and stricter TypeScript support.<p>I am aware there are already libraries that can draw to multiple contexts interchangeably, but I&#x27;ve added a few little niceties to Ripl that (as far as I know) some other libraries don&#x27;t have such as CSS-like query selectors, DOM-like event bubbling, and keyframe animation support.<p>The project is far from done and not published to NPM yet, but there are a few demos and source that you can look at in the repo.<p>I&#x27;m happy with how it has come along and the things I&#x27;ve learnt along the way, especially the math. My dream would be to one day work on this full-time and build out a full data-viz library.","time":1712892689,"title":"Show HN: A JavaScript library for data visualization in both SVG and Canvas","type":"story","url":"https://github.com/andrewcourtice/ripl"}