Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>HepMC VisualizerNew to Visual Studio Code? Get it now.
HepMC Visualizer

HepMC Visualizer

simonthor

|
4 installs
| (0) | Free
Visualize HepMC3 event files in VS Code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HepMC Visualizer

VS Code extension for viewing HepMC3 ASCII event files (.hepmc, .hepmc3).

Features

  • Opens HepMC files in a custom editor
  • Shows one event at a time with next/previous navigation
  • Supports pan and zoom
  • Right-click in the graph to save the current event as SVG
  • Layout and styling follow pyhepmc's graphviz view:
    • unicode particle names for every PDG ID pyhepmc knows (6,496 entries incl. nuclei)
    • track thickness scales with energy relative to the event's most energetic particle
    • color by category (hadron, quark/gluon, lepton/boson, generator-internal, …), dashed neutrals, arrowheads on beam and final-state particles only
  • Shows particle hover tooltips with:
    • name
    • PDG ID
    • status
    • mass
    • 4-momentum
    • electric charge

Supported input

The parser handles the common HepMC3 ASCII records used in this project:

  • E event headers
  • U units
  • W event weights
  • A attributes
  • P particles
  • V vertices

Architecture

  • src/common/ contains the portable HepMC parser, PDG lookup (pdg.ts + generated pdg-data.json), graph construction, the DOT builder (dot.ts) and the graphviz WASM wrapper (render.ts).
  • src/webview/ contains the browser-side shell: it injects the SVG produced by the host and adds zoom and tooltips.
  • src/extension.ts contains the VS Code custom editor host layer; it parses the file, lays events out with graphviz on request, and serves the theme stylesheet (src/common/theme.ts).
  • Vocabulary is in CONTEXT.md; design decisions are recorded in docs/adr/.

Build

npm install
npm run build

Regenerating particle data

src/common/pdg-data.json is generated from pyhepmc's unicode name table and the particle package. It is committed, so a normal build needs no Python. To refresh it:

uv run --with "pyhepmc,particle" python scripts/generate_pdg_data.py

Notes

  • The UI is intentionally browser-native so it can be reused in a standalone website later (@hpcc-js/wasm-graphviz runs in both Node and browsers).
  • d3-selection and d3-zoom are used for the lightweight interactive view layer.

Third-party notices

  • Particle names in src/common/pdg-data.json come from pyhepmc (BSD-3-Clause), with categories and charges derived from particle (BSD-3-Clause).
  • Layout uses Graphviz (EPL-1.0) via @hpcc-js/wasm-graphviz (Apache-2.0).
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft