Skip to content

Storybook catalog — phase 1: scaffold + five anchor stories - #5

Merged
aaltshuler merged 5 commits into
mainfrom
storybook-phase-1
Aug 27, 2026
Merged

Storybook catalog — phase 1: scaffold + five anchor stories#5
aaltshuler merged 5 commits into
mainfrom
storybook-phase-1

Conversation

@aaltshuler

@aaltshuler aaltshuler commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

What

New apps/storybook workspace: a Storybook 10 catalog over the live workspace packages, so stories can never drift from the source API.

  • Scaffold: Storybook 10.5.10 + @storybook/react-vite + docs addon (exact-pinned trio), port 5399, telemetry off, dark/light theme toolbar, ordered sidebar.
  • Fixtures (src/fixtures/): seeded deterministic generator + themes + scale descriptors + crossfilter dims + sunflower position seeding, copied from the demo (apps do not import across apps); concrete DemoGraph alias tames the Graph<N, E> generic for story typing; FakeEngine holder ready for the component stories.
  • Five anchor stories (all real WebGL via CosmosEngine): Minimal, Styling (categorical/sequential scale switching), Themes (live theme swap), Layout: force (sliders re-heat the sim), Selection (lasso + Actions panel).
  • Introduction MDX: What is orbit / Data shapes / Testing without WebGL.
  • Root wiring: storybook:dev / storybook:build, changesets ignore, eslint + gitignore for storybook-static. CI deliberately untouched.

Verification

  • pnpm run check exit 0 (boundaries, anchors, pin gate, lint, typecheck, 1,785 tests, perf gate)
  • Dev server verified in a real browser: live graph renders, controls switch scales, sidebar/docs pages correct
  • pnpm storybook:build exit 0; static output serves and lists all 13 entries; output is git- and eslint-ignored

Next phases per the approved structure: the 13 FakeEngine component stories, then Exploration / Analytics / Persistence / Scale.

🤖 Generated with Claude Code

https://claude.ai/code/session_018SeFxK217ZrHSERqK6kjcb

Greptile Summary

The PR adds a Storybook 10 workspace that catalogs Orbit’s live React and Cosmos APIs through deterministic fixtures, WebGL-backed graph stories, interaction examples, and introductory documentation.

  • Adds Storybook configuration, workspace scripts, dependency wiring, and generated-output exclusions.
  • Adds reusable graph fixtures, themes, scales, seeded topologies, and engine factories.
  • Adds graph, layout, and interaction stories plus introductory MDX documentation.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
apps/storybook/src/layouts/Force.stories.tsx Applies simulation prop updates before imperatively reheating the engine, resolving the previously reported settled-layout control behavior.
apps/storybook/.storybook/main.ts Configures Storybook 10 with docs support; the core-provided Actions panel remains enabled without a separate actions addon.
apps/storybook/src/interaction/Selection.stories.tsx Demonstrates selection and lasso callbacks using Storybook spies that are visible through Storybook 10’s core Actions panel.
apps/storybook/src/fixtures/topologies.ts Adds deterministic generators for force-directed and fixed-layout graph topology examples.
apps/storybook/package.json Defines the private Storybook workspace and pins the Storybook toolchain while using the repository lockfile for reproducible installs.

Reviews (3): Last reviewed commit: "Storybook: force stories reheat on simul..." | Re-trigger Greptile

Context used:

New apps/storybook workspace (Storybook 10.5.10, react-vite, exact-pinned):
- .storybook config: docs addon, autodocs, dark/light theme toolbar,
  section-ordered sidebar, telemetry off
- fixtures copied from the demo (seeded generator, themes, scale
  descriptors, crossfilter dims, sunflower positions) plus a concrete
  DemoGraph alias and FakeEngine holder for later component stories
- stories: Graph/Minimal, Graph/Styling (scale switching), Graph/Themes,
  Graph/Layout: force (live sim sliders), Interaction/Selection
  (lasso + actions) — all on CosmosEngine, framed per-story
- Introduction MDX: What is orbit, Data shapes, Testing without WebGL

Root wiring: storybook:dev/storybook:build scripts, changesets ignore,
eslint + gitignore entries for storybook-static. CI untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SeFxK217ZrHSERqK6kjcb
Comment thread apps/storybook/src/graph/LayoutForce.stories.tsx Outdated

const config: StorybookConfig = {
stories: ['../src/**/*.mdx', '../src/**/*.stories.@(ts|tsx)'],
addons: ['@storybook/addon-docs'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Selection actions panel is unavailable

When users perform the selection interactions documented by the new story, the callbacks execute but this configuration registers only the docs addon, so Storybook provides no Actions panel in which to inspect the promised onSelectionChange events.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Fix in Claude Code

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applicable on Storybook 10: controls and actions moved into core (addon-essentials no longer exists), so the Actions panel is present with only the docs addon registered — fn() spies from storybook/test log there. Verified in the running catalog: the Selection story shows Controls/Actions/Interactions tabs and onSelectionChange events stream into the Actions panel.

aaltshuler and others added 3 commits August 26, 2026 21:08
Addressing 'shallow, one dataset shape, no size control':

- fixtures/topologies.ts: six deterministic force topologies (clustered,
  tree, scale-free, bipartite, ring, islands) all emitting the same typed
  attrs so every scale/dimension/search fixture composes with every shape,
  plus three fixed-layout topologies with exact declared positions
  (circle, tidy radial tree partitioned by subtree share, lattice)
- global size toolbar (S 300 / M 1,500 / L 8,000 / XL 40,000) read by all
  stories through a per-size snapshot cache; theme toolbar unchanged
- catalog deepened reagraph-style, one story per prop value:
  Graph: Minimal, Topologies (radio), Nodes (function/categorical/
  sequential color, degree/uniform size), Edges (per-edge color/width,
  arrows, hidden), Labels (zoom threshold, pinned ids, custom JSX pills),
  Themes (base swap + custom tokens)
  Layouts: Force (preset radio + full tunables), Fixed (circular/radial
  tree/grid), Fixed-to-force handoff (declared positions double as
  simulation seeds — one prop flips designed geometry into organic motion)
  Interaction: Selection, Hover & emphasis, Context menu (find-path flow)
- DemoGraph now forwards refs (handle access in stories)

Verified live: 12 story files register, tree/radial/sequential/preset
stories render framed at natural node scale via the new clamp.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018SeFxK217ZrHSERqK6kjcb
@aaltshuler

Copy link
Copy Markdown
Contributor Author

Restructured per the catalog-depth review: topology fixture library (six force shapes + three exact fixed layouts), global S/M/L/XL size toolbar, and the Graph section split into per-prop-value stories (Nodes/Edges/Labels/Themes), Layouts (Force presets + Fixed gallery + fixed→force handoff), and three Interaction pages. Rides the settle-camera and fit-clamp merges from main. Next phases: Components (13, FakeEngine), Exploration, Analytics, Persistence, Scale, Use Cases.

Review finding: a simulation-only update deliberately preserves positions
and carries no restart (core contract), so once the calm preset settled,
preset/slider changes showed nothing. The force stories now resume the
simulation on config change through the shipped reheat API — verified
live: settled graph visibly rearranges on a slider move.
@aaltshuler
aaltshuler merged commit 0f9ea31 into main Aug 27, 2026
5 checks passed
@aaltshuler
aaltshuler deleted the storybook-phase-1 branch August 27, 2026 00:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant