ianohara.com

Posts Notes Resume

Inline Diagrams and Drawings

27 Jan 2025

Background

For posts and notes, I want a way to make interactive drawings and diagrams. So far, I’ve been using vanilla javascript and canvas (e.g. the false peak post and the telescopic gauge error post). That’s been good for learning a bit about canvas, but it results in pretty janky visualizations since it’s up to my (lack of) skill with raw canvas. Instead of this, I want to figure out some lightweight library I can embed and have handle all the screen size issues, resolution issues, etc. It’d also be nice if it gives me some geometric primatives that help with the type of visualizations I do (what this means is still pretty ambiguous. Hopefully it’ll be less so as I explore options).

This note contains some experiments with different libraries for making visualizations on this website.

Existing Options

This reddit post has a bunch of suggestions.

Paper.js

Paper is suggested in a bunch of places. I’m following these directions for the example below.