Repository navigation
feat(charts): add comark-charts, charts drawn from Markdown tables that agents read as data - #44
Conversation
… carry annotations
…at agents read as data
Latest result Pull request merged. Final answersSession Pull request merged. Verified HEAD and all current checks are green. Pullfrog’s prior P1 marked-chart zoom-context finding is fixed: `.cch-plot` is preserved in zoom clones. No actionable findings remain. Focused local Vitest was blocked by the protected `.git/config` prepare hook; `git diff --check` passed. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. Session Fixed Pullfrog P1: zoomed marked charts now retain the enclosing `.cch-plot` context, preserving theme colors and sizing. Pushed commit b0f0343 and resolved the review thread. `git diff --check` passed; local Vitest was unavailable because pnpm prepare requires writing protected `.git/config`. Awaiting current-head checks. |
🚀 Deploying Preview to Cloudflare 🚀Preview Deployments by commit
|
comark-annotate
comark-carousel
comark-charts
comark-embed
comark-github-callouts
comark-include
comark-lint
comark-tabs
comark-zoom
commit: |
There was a problem hiding this comment.
Important
Marked charts lose chart theming and sizing when opened in the zoom view.
Reviewed changes
This review covers the two commits adding comark-charts, the shared annotation helpers, chart validation and SVG rendering, docs and skill discovery, lint integration, and the chart test coverage.
- Chart package — Adds Markdown-table parsing, validation, server-side Flint/Vega SVG drawing, chart-specific CSS, and data-preserving HTML output.
- Chart annotations — Anchors
comark-annotatemarks to Vega scenegraph shapes and reuses the annotation zoom/runtime renderer. - Repository integration — Registers the package in docs, lint, workspace dependencies, and agent skill discovery.
gpt-5.6-sol | 𝕏
… and trim the SVG Vega compiled its expressions with new Function, which Workers forbid, so every chart fell back to its table there; it now uses vega-interpreter. Flint, Vega-Lite, and Vega load on the first chart, so importing comark-charts/html (and comark-lint) takes ~65 ms instead of ~285 ms. The SVG drops Vega's per-mark ARIA labels and group roles, which the root role=img hides, empty foreground paths, and float noise in coordinates; plain bars no longer stack, which gave every bar a clipped group. A 40-bar chart goes from 64 kB to 34 kB of SVG and draws in half the time.
…rouped bar its lane Without a canvas Vega guessed every character at 0.8em, so greedy overlap hid labels that fit, such as a waterfall step's; it now guesses per grapheme through textMetrics.width. Flint scaled text from 13.5px down to 8px with the plot and ignored the theme, so axes, legends, and value labels are set to 12px. Flint's local dodge found the band from the column's semantic type, so grouped bars over dates were laned by value and some drew zero wide; grouped bars use the global dodge.
There was a problem hiding this comment.
ℹ️ No new issues found in the incremental changes. The remaining open zoom-context concern from the prior review is unchanged and is not repeated here.
Reviewed changes
This review covers the changes since the prior Pullfrog review: Cloudflare-safe Vega interpretation, lazy chart drawing, SVG cleanup, and additional layout and accessibility adjustments.
- Enabled interpreted Vega execution — Parsed the compiled spec as an AST and supplied
vega-interpreterso server-side rendering does not depend onnew Function. - Deferred chart dependencies — Moved drawing behind a dynamic import so parsing and documents without charts avoid loading Flint and Vega.
- Refined chart output — Disabled redundant SVG accessibility roles, removed empty foreground paths and float noise, and adjusted bar stacking and layout behavior.
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
Important
The new label-width heuristic can make the rendered chart keep labels that overlap, or truncate labels that fit, for scripts and font shaping it does not model.
Reviewed changes
This review covers the two commits since the prior Pullfrog review: Vega text measurement and typography adjustments, plus grouped-bar lane layout and its regression test.
- Refined label measurement — Replaced Vega's no-canvas character-count estimate with grapheme-based width guesses and fixed chart label sizes.
- Adjusted grouped bars — Forced grouped bars to use global series lanes and added coverage for grouped bars over date-like x values.
- Retained server-safe rendering — Kept the interpreter-backed Vega path and the existing SVG cleanup while changing text layout decisions.
Note: 1 inline comment(s) dropped because they did not anchor to lines inside the PR diff:
packages/charts/src/draw.ts:1194-1195(RIGHT) — line 1195 (RIGHT) is not inside a diff hunk
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues in this delta. The duplicate-x bar adjustment preserves the intended visibility of invalid input rows; this review is non-approving because an earlier Pullfrog finding remains unresolved.
Reviewed changes
This review covers the single commit since the prior Pullfrog review: preserving visibility for invalid repeated-x bar rows.
- Preserved duplicate bar rows — Kept stacking enabled when repeated x values are present, so duplicate rows are rendered instead of one being hidden behind another.
- Kept valid grouped-bar behavior — Retained stack removal for unique x values and the existing grouped-bar lane behavior.
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
ℹ️ No new issues found in the incremental changes. The previously reported marked-chart zoom-context issue remains open and unchanged, so this review does not approve the PR.
Reviewed changes
This review covers the changes since the prior Pullfrog review: text measurement and label sizing, global grouped-bar lane assignment, and duplicate-x bar stacking.
- Improved label measurement — Estimated widths by grapheme and applied consistent 12px chart text sizing so fitting labels are retained without clipping.
- Assigned grouped-bar lanes globally — Prevented date-based grouped bars from collapsing into zero-width lanes.
- Preserved repeated-x bars — Kept repeated x values stacked while retaining the parser's diagnostic for duplicate rows.
gpt-5.6-sol | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
This review covers the change since the prior Pullfrog review: preserving chart context when a marked chart is opened in the zoom view.
- Preserved marked-chart zoom context — Passed
.cch-plotthroughannotateHtmlintodata-zoom-context, so zoomed chart clones retain the chart's theme substitutions and marked-chart sizing rules.
gpt-5.6-sol | 𝕏

Adds
comark-charts. A Markdown table inside::chartbecomes an SVG chart, and the table stays under it, so agents read the numbers.Types: bar, stacked, line, area, scatter, dumbbell, waterfall, pie.
Also:
comark-annotateexportsreadMarkandannotateHtml.comark-lintloads charts and puts their issues on the right line.Checks:
pnpm ready(194 tests), pluse2e/charts.e2e.ts, which renders 296 worst-case charts and fails on any colliding or clipped text.Upstream fixes: microsoft/flint-chart#147, vega/vega#4373.
Before release: add a trusted publisher for
comark-chartson npmjs.com.