Ah that's a nice one, but the best guide I've seen so far is this one:
https://frontendbabel.info/articles/svg-grouping-and-reusing-elements/
Paired with D3, it really is a formidable spec for rendering almost anything!
The problem I've always had with HTML canvas, is that its virtually impossible to export scene as vector graphics