Another format to look at is Markdeep which has support for rendering ASCII diagrams and is very close to plain text: https://casual-effects.com/markdeep/features.md.html
Personally, I just wrote a thin wrapper around the somewhat verbose JS Canvas API that lets me write code such as
ctx4b.save();
ctx4b.translate(x+=10, 10);
new Line(ctx4b).b().m(36,50).lAD(180 + 50, 56).lXY(0, -7.1).lXY(7, 0).lAD(50, 55).f();
ctx4b.fillRect(36, 0, 10, 50);
ctx4b.restore();
when I want to draw diagrams in my Markdeep notes.