Skip to content

refactor: extract GraphRenderer and TableRenderer from god objects - #75

Merged
veillette merged 1 commit into
mainfrom
claude/refactor-god-objects-B8gq7
Mar 1, 2026
Merged

refactor: extract GraphRenderer and TableRenderer from god objects#75
veillette merged 1 commit into
mainfrom
claude/refactor-god-objects-B8gq7

Conversation

@veillette

Copy link
Copy Markdown
Collaborator

ConfigurableGraph (805 → ~440 lines):

  • New GraphRenderer.ts owns all bamboo chart/grid/button rendering nodes, the clipped data container, axis labels, and axis interaction regions.
  • ConfigurableGraph is now a thin coordinator: creates ChartTransform, instantiates sub-modules, wires listeners, and delegates rendering and resize updates to GraphRenderer.
  • Extracted mapDataPoints() as a module-level function so setTrackData() no longer mixes data-mapping logic with plot management.

DataTableNode (839 → ~290 lines):

  • New TableRenderer.ts owns all HTML DOM construction and incremental-update state (lastTrackIds, lastUnit, tableBodyRef, frameRowMap, maxRenderedFrame).
  • TableRenderer.update() encapsulates the structural-vs-incremental decision previously nested deep inside the DataTableNode constructor.
  • DataTableNode now focuses solely on SceneryStack integration: Panel, drag listener, resize handles, and reactive property wiring.

https://claude.ai/code/session_01Ns5vMGXj1wSUU3pwzTfYco

ConfigurableGraph (805 → ~440 lines):
- New GraphRenderer.ts owns all bamboo chart/grid/button rendering nodes,
  the clipped data container, axis labels, and axis interaction regions.
- ConfigurableGraph is now a thin coordinator: creates ChartTransform,
  instantiates sub-modules, wires listeners, and delegates rendering and
  resize updates to GraphRenderer.
- Extracted mapDataPoints() as a module-level function so setTrackData()
  no longer mixes data-mapping logic with plot management.

DataTableNode (839 → ~290 lines):
- New TableRenderer.ts owns all HTML DOM construction and incremental-update
  state (lastTrackIds, lastUnit, tableBodyRef, frameRowMap, maxRenderedFrame).
- TableRenderer.update() encapsulates the structural-vs-incremental decision
  previously nested deep inside the DataTableNode constructor.
- DataTableNode now focuses solely on SceneryStack integration: Panel,
  drag listener, resize handles, and reactive property wiring.

https://claude.ai/code/session_01Ns5vMGXj1wSUU3pwzTfYco
@veillette
veillette merged commit fee72c1 into main Mar 1, 2026
2 checks passed
@veillette
veillette deleted the claude/refactor-god-objects-B8gq7 branch March 1, 2026 01:19
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.

2 participants