If you want to write tutorials with interactive diagrams like mine, here's some code to get you started. I have vanilla, lit-html, Vue v2, React, and Preact+HTM versions of a simple interactive diagram.