Ideally I would be able to produce the diagrams in JS with KaTeX handling rendering the labels, but this doesn't seem to exist (I'm a software engineer so I'm wondering if I should try to make it...). Nice features also include having the diagram being controllable by JS or animatable, but that's not a requirement.
What are other people using?
Things I've considered:
TikZ options:
* TikZ exported to SVG
* Writing the TikZ in something else, e.g. I found this library PyTikZ which is old but I could update things to it, that way at least I don't have to wrangle TikZ's horrible syntax much myself. I could theoretically write a JS version of this.
* Maybe the same thing, JS -> TikZ, but also run TikZ in WebAssembly so that the whole thing lives in the browser.
* Writing TikZ but ... having ChatGPT do it so I don't have to learn to antiquated syntax.
Non-TikZ options:
* InkScape
* JSXGraph, but it isn't very pretty
* ???
Thanks for your help!
Feedback would be greatly welcome! It's made specifically for the usecase you mention, blog-like website with Katex to add pretty graphics. Example usage:
PS, I give you permission to use it in your personal website for free, alexkritchevsky.com
Also maybe Mathbox. https://github.com/unconed/mathbox From Steve Wittens / Acko.net. ( See also https://acko.net/blog/mathbox2/ )
InkScape is a vector drawing program. Do you want to put interactive graphics on your site or just some SVG/PNGs? If you want to create just some graphics, Sagemath should do the job: https://sagecell.sagemath.org/
"Writing TikZ but ... having ChatGPT do it so I don't have to learn to antiquated syntax."
A software engineer should be able to use Latex and I see nothing antiquated about it. I am writing a (non scientific) book soon. I would consider nothing else.
Saved me hours in undergrad, was what everyone at Stanford used for quickly communicating ideas and typing up :)
For example, draw math diagrams, etc. online free with Mathcha https://www.mathcha.io/
I am interested in the results, as I have supported (and barely used) the eqn/grap/pic/troff package and LaTeX.
I have been using it to produce images for my book and am very happy with it. There is tutorial here that shows you the syntax [3].
[1] https://pypi.org/project/pytikz/
[2] https://github.com/allefeld/pytikz
[3] https://nbviewer.org/github/allefeld/pytikz/blob/master/pyti...
It works well, but you have to figure out the markup and dynamically styling the images are difficult; For example, to make darkmode work, I have to apply css filters over the generated svgs.
It also doesn't show anything if javascript is not enabled, so I duplicate the contents into a noscript tag as part of my site's "build" process so users can at least know a tikz diagram is supposed to be there.
I have an entire custom build process though, so that might be why it was straightforward for me to incorporate it.
If you're going to build something in JS, you'd have to decide how a wide diagram should adjust to render legibly on a narrower viewport (mobile), and that sounds rough.
https://observablehq.com/@tomlarkworthy/robocoop-skills#mark...
If you give me a problem I can see if it can solve it
https://casual-effects.com/markdeep/
...which supports LaTeX math via MathJax.
I eventually settled on using Goodnotes on my iPad, drawing them by hand and just exporting the images.
Once we get arbitrary expression constraints you'll be able to turn on the grid and trace points to plot equations, for example.