doesn't have to be hard. I want to take this a little further and show
Which renders an SVG which contains a circle, a line and a rectangle:
The library itself
The code is almost 15 lines.
That's all. Can you make it smaller? Faster? Better? Leaner?
Create a primitive function to take out the guessing.
Or a function to create a group element:
No more guessing?
It takes some guessing to look up the
parameters. SVG isn't very consistent (x/y? cx/cy? x1/y1? dx/dy? transform? what me worry?).
To mitigate this I am currently working on a SVG library in TypeScript
that takes out the guessing. A preview: lib/esveegee.
Still I think a minimalistic library like this has its place.