This is surely possible.
You need to find the monospace whitespace characters (seems there's a few [0]). Then encode a compressed version of the logical diagram in the white space, steganography style.
Or do something with characters [1] to compress a lot of data into a tiny ball of hair at the end.
Draw.io smuggles the XML in a PNG which I've always admired.
Lovely idea! You're going to be fighting against editors and linters but it'd be a very cool proof of concept.