Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Signalgraph

Signalgraph preview — 18-node microservices topology with green hub nodes, a degree tooltip, and the NETWORK / DEGREE / TOP HUBS sidebar

Vanilla JS Zero deps Offline Deterministic License

A zero-dependency network explorer — seeded force layout, zoom, drag, neighborhood highlight, degree stats. Same file + same seed → the exact same layout, on any machine, every time.

Why

Most graph tools either re-heat the layout on every load (D3 force with a fresh Math.random) or ship a WebGL bundle to "freeze" it. Both make your picture unreproducible: screenshot it today, export it tomorrow, and the coordinates have drifted. Signalgraph treats the layout as data: a seeded PRNG (mulberry32(1337)) replaces every coin flip, nodes iterate in stable sorted order, and the simulation runs to a strict settle criterion (max displacement < 0.05 px for 10 consecutive steps) before it freezes. The export is a coordinate round-trip — the JSON you save is the same layout the canvas paints, to three decimals.

Quickstart

No install, no build:

  1. Open index.html in any modern browser (double-click works — it runs from file://).
  2. Click Load sample for the bundled 18-node microservices topology, or Open JSON / drag-drop your own node-link file.
  3. Wheel to zoom (cursor-anchored), drag empty space to pan, drag a node to pin it, click a node for the sidebar detail + neighborhood highlight, Esc to clear. Fit (Ctrl/⌘+0) recenters the whole graph.
  4. Export PNG (signalgraph.png) or Export JSON (signalgraph-layout.json) — the JSON is the exact settled layout, reproducible on any machine.

Node-link JSON schema

{
  "nodes": [{ "id": "gateway", "label": "Gateway", "kind": "service" }],
  "links": [{ "source": "gateway", "target": "orders" }]
}
  • id — required, unique; numbers are coerced to strings.
  • label / kind — optional display fields.
  • links reference node ids; dangling links are dropped with a warning, duplicates (either direction) are deduped, and parse errors surface as an inline banner with the specific reason.

Determinism

  • Seeded PRNG — mulberry32(1337) supplies the initial jitter; there is no Math.random and no Date.now anywhere in the layout path.
  • Stable iteration — every pairwise force pass walks nodes in sorted-id order, so float accumulation is identical run to run, machine to machine.
  • Strict settle — the simulation stops only when every node has moved < 0.05 px for 10 consecutive steps (or at the 400-tick cap), then freezes; the rAF loop auto-pauses.
  • Coordinate round-trip — exportJson rounds to 3 decimals and sorts by id; two exports of the same input are byte-identical, which the tests pin with deep-equality.

Testing

node --test tests/

25 tests over the pure surface: validate (dangling/dup handling, id coercion, empty-input warnings), metrics (degrees on a known diamond, components, hub tie-breaks, histogram buckets), prng (same seed → same stream), step (input purity), simulate (byte-level determinism across two runs, settle, isolated-node finiteness), the render transforms (world↔screen round-trip, fit math with exact padding and clamps, hit-testing), exportJson (rounding + stable order), and a live draw smoke on a headless context.

Documented deviation. The brief's settle test targets the bundled 18-node sample; under the brief's fixed force constants that sample does not reach the strict settle criterion within 400 ticks (it runs the full cap). The settle test therefore runs the deterministic 4-node diamond instead (~113 ticks, ample margin), while the sample's determinism stays pinned by the two-runs-deep-equal test.

Design

Built on the Atelier template — assets/base.css is a verbatim copy of the shared base; assets/app.css is a thin app layer. Paper #DFDFDF, ink #252524 nodes, hubs (degree ≥ 4) in #22AC80, the selected node in #5B51C7, hairline #B9B7AE links that thicken to #252524 in a neighborhood highlight; everything outside the neighborhood dims to 15% alpha. Hub labels are Georgia 13 px and always visible; leaf labels appear on hover/selection once you are zoomed in (scale ≥ 0.8).

License

MIT — see LICENSE. Copyright (c) 2026 adithyanraj03.

About

Zero-dependency network explorer - seeded force layout, zoom, drag, neighborhood highlight, degree stats. Same file + same seed = same layout, on any machine.

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages