Skip to content

feat: generic plotting engine — CTBase.Plotting + CTBasePlots (phase 1)#477

Merged
ocots merged 1 commit into
mainfrom
feat/plotting-engine
Jul 8, 2026
Merged

feat: generic plotting engine — CTBase.Plotting + CTBasePlots (phase 1)#477
ocots merged 1 commit into
mainfrom
feat/plotting-engine

Conversation

@ocots

@ocots ocots commented Jul 8, 2026

Copy link
Copy Markdown
Member

Summary

Phase 1 of the unified plotting engine. Adds a backend-agnostic intermediate representation (IR) — a weighted tree of titled axes carrying time series and decorations — plus the Plots.jl renderer.

  • IR (src/Plotting): Series/HLine/VLine, Axes, Leaf/HBox/VBox, Figure. Pure data, no backend dependency.
  • Domain-free building blocks: Panel (with per-component style), Stacked/Paired/Grid combinators.
  • Lowering: Panel → Axes/tree, with time normalization, ylims guarding, deterministic leaf traversal.
  • Backend contract: AbstractPlottingBackend + render/render! (stubs error; methods in ext).
  • Plots.jl renderer (ext/CTBasePlots): Generalizes the CTFlows PlotEngine. Weighted layout via Plots.grid, per-series style with attribute filtering, decorations, margin/font semantics.

Decisions applied

  • D1: Module name = CTBase.Plotting
  • D2: Style vocabulary = minimal (color, linewidth, linestyle, alpha, seriestype, z_order) + backend_kwargs escape hatch
  • D4: Stacked weights = :auto (proportional to cell count, reproduces CTModels behavior)

Testing

  • 98 tests across 5 files: IR/combinators/lowering/heuristics (no Plots), contract + rendering (with Plots)
  • Full CTBase suite + Aqua: ✅ green
  • Format (blue style): ✅ clean
  • CTModels/CTFlows: unchanged

Related

🤖 Generated with Claude Code

…sePlots)

Phase 1 of the unified plotting engine. Adds:
- Backend-agnostic IR: Series/Axes/weighted Leaf-HBox-VBox tree
- Panel + level-2 combinators (Stacked/Paired/Grid)
- Lowering (Panel→Axes), heuristics, deterministic leaf traversal
- Backend contract (AbstractPlottingBackend + render/render!)
- Plots.jl renderer (generalized PlotEngine: weights, x per cell,
  decorations, per-series style with Plots.attributes filtering)

98 tests (IR/combinators/lowering/heuristics without Plots;
contract + rendering with Plots). CTModels/CTFlows unchanged.

Decisions: D1=Plotting, D2=minimal style vocab + backend_kwargs,
D4=:auto weights ∝ cells.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@ocots
ocots merged commit 9a1a17a into main Jul 8, 2026
6 checks passed
@ocots
ocots deleted the feat/plotting-engine branch July 8, 2026 21:41
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