feynjs¶
Write it, see it¶
Every diagram below is drawn live by your browser, from the source beside it. Written in syntax inspired by MadGraph and TikZ-Feynman.
Multiple syntax support¶
Write every line, as in TikZ-Feynman, without a tikzpicture, coordinates or a compile; or name the process, as in MadGraph. Both draw the same diagram, and feynjs places every vertex itself.
TikZ-Feynman edges
MadGraph process
Drawn in time order¶
feynjs knows when each particle lives: the collision, then each decay, left to right, as papers draw them. Every part of the drawing knows its step, so a page can build it up one at a time.
Particles draw themselves¶
A particle's name brings its line, arrow, label and colour: superpartners in red, a W wavy, a Higgs dashed. Over a hundred names are built in.
Loops in braces¶
Put a particle in braces to run it round a loop: the top-quark triangle of Higgs production by gluon fusion is one line.
Two layout engines¶
The force engine balances the diagram until it settles; the grid engine puts every line on a grid. One line switches between them, and the same diagram moves from one to the other.
More than lines¶
The final states a detector sees, drawn as it sees them: large-R jets with what they hold, semi-visible and emerging jets, missing energy.
Draw the eye¶
Add pulse to a point, or a line, and a glow beats round it and along every line that meets there:
here, the Higgs self-coupling in Higgs pair production.
Skills for AI assistants¶
Ask an assistant for a diagram in plain words, and it writes feynjs: two skills in the repository teach it the syntax, how physicists lay diagrams out, and the physics to check. What comes back is a few lines you can read, edit and keep.
Wherever you write¶
The same text is a diagram in a Markdown site, in an Obsidian note, on any web page with one script tag, and in a LaTeX paper, where it becomes TikZ-Feynman code.