top | item 39175898

(no title)

throwaway143829 | 2 years ago

It looks like the one-liner function comes from their npm library... which requires a build step?

At that point you could just use an SVG charting library. Good charting libraries will have code snippets readily available for line charts that you can copy/paste. SVG can be styled with CSS just like text.

"Simpler code" seems like the main benefit but it comes with a big "weirdness" factor as the tradeoff. I'd bet there's a super lightweight SVG charting lib somewhere out there which is about as simple as this while being much more standard. i.e. supports line charts only, and has the simple type signature `(number[]) => SVGElement`.

discuss

order

dy108|2 years ago

Not just simpleness but also performance profit, since the premise is fonts are the most optimized rendering stack everywhere.

Btw that one-liner function is helper, you don't have to install it it, just do `String.fromCharCode(0x100 + value)` to render character.