https://tex.stackexchange.com/questions/92691/is-it-possible...
That said, looks cool and it is written in Haskell and React: https://github.com/penrose/penrose
...
Side note: when I hear "Penrose diagrams" I have in mind Penrose tensor notation, as in https://www.math3ma.com/blog/matrices-as-tensor-network-diag....
https://en.wikipedia.org/wiki/Oliver_Byrne_(mathematician)
Archive.org, print: https://news.ycombinator.com/item?id=11628606
Penrose, for mathematical drawings, might very well become what TeX, LaTeX, and Desktop Publishing programs are, to text!
I think you are on the right track to something grand!
Wishing you a lot of luck in this endeavor!