Files
learnharness/docs/research
amosblomqvist 0513b1555c Research: graph rendering & cluster-first layout (decision basis)
Four research passes (two library fact-checkers, two prior-art explorers)
with all claims verified against shipped package code (npm tarballs of
sigma@3.0.3 and @sigma/layer-webgl@3.0.0), the sigma.js storybook source,
and primary docs. Nothing implemented yet — this is the decision document.

Headline verified facts:
- sigma v3.0.3 ships a PUBLIC createCanvas/createLayer API; our DOM
  injection was improvising a worse version of it. Sigma's own
  cluster-label storybook demonstrates our exact minimal-fix pattern
  (custom layer + afterRender + graphToViewport).
- @sigma/layer-webgl contours render METABALL fields, not hull polygons;
  no dashed strokes; one WebGL context per community (~16 browser cap).
  Our visual is not achievable with shipped sigma layer programs.
- Nobody in the graph-tool world ships hull regions (Gephi, Gephi Lite,
  Obsidian: node coloring only). Aesthetic references: ggforce
  geom_mark_hull, Bostock's thick-stroke hull trick, Excalidraw frames.
- Canvas 2D at 338→low-thousands of elements is comfortably within
  demonstrated 60fps territory; the cost driver is repaint count x
  pixel area, not element count.
- Cluster-first layout: two-level pattern (quotient anchors -> per-cluster
  layout -> compose) is well-trodden; LinLog FA2 is the one-afternoon A/B
  candidate; no turnkey JS package composes it (~150 lines of glue).

Options scored: sigma + public 2D canvas layer (7/10, ~1d minimal fix),
hand-rolled d3-zoom + single Canvas 2D (8/10, recommended target),
PixiJS v8 (7/10). Full matrix, facts-not-to-rely-on list, and open items
in the document.
2026-09-13 04:59:56 +03:00
..