Skip to content

Get started

  • Zensical or MkDocs

    A docs site: every feynman block in your Markdown becomes a diagram.

    extra_javascript = ["https://cdn.jsdelivr.net/npm/feynjs@0.10/dist/feynjs.min.js"]
    

    Set up a site

  • Sphinx

    A Sphinx project: feynman code blocks in reST or MyST Markdown become diagrams.

    # pip install feynjs
    extensions = ["feynjs.sphinx"]
    

    Set up Sphinx

  • Obsidian

    Your notes: the same feynman blocks, drawn in the note's own colours.

    feynjs-obsidian.zip  →  .obsidian/plugins/feynjs/
    

    Set up Obsidian

  • A web page

    Any page: one script tag, and every feynman block or <div class="feynman"> is drawn.

    <script src="https://cdn.jsdelivr.net/npm/feynjs@0.10/dist/feynjs.min.js"></script>
    

    Use it in a page

  • LaTeX

    A paper: write diagrams in feynjs syntax; they compile as TikZ-Feynman, on Overleaf and arXiv too.

    \usepackage{feynjs}
    \begin{feynjs}
    p p > t tbar
    \end{feynjs}
    

    Set up LaTeX

  • JavaScript

    Your own program: render gives the SVG, toTikz the TikZ.

    // npm install feynjs
    import { render } from "feynjs";
    const svg = render("g g > {t} > H");
    

    The API

  • Jupyter

    A notebook: a diagram is a Python object that draws itself.

    # pip install feynjs
    from feynjs import Diagram
    Diagram("g g > {t} > H")
    

    Use it in Jupyter

  • The command line

    A shell: draw, check, describe or measure a diagram from a file.

    npx feynjs render diagram.feyn > diagram.svg
    

    The commands

  • MadGraph

    Every diagram of a process MadGraph generates, decay chains joined into whole diagrams.

    mg5_aMC --mode=feynjs
    

    Set up MadGraph

  • Just try it

    No setup: type a diagram in the browser, drag its points, and take it away as SVG, PNG or TikZ.

    Open the playground

After a diagram is in place: check it, export it as SVG, PNG or TikZ, and upgrade to a new release. Browsers and Node says where it runs.

Next: Your first diagram explains what each line means, and How it works builds a diagram up a layer at a time.