Skip to content

[WIP] Excel and Plotly backend, and enhanced control#71

Open
Chenglong-MS wants to merge 19 commits into
mainfrom
dev
Open

[WIP] Excel and Plotly backend, and enhanced control#71
Chenglong-MS wants to merge 19 commits into
mainfrom
dev

Conversation

@Chenglong-MS

Copy link
Copy Markdown
Contributor

This pull request updates documentation across the project to clarify and expand on several major areas: it adds complete documentation for the new Plotly backend and Excel backend, improves the explanation of layout and overflow handling (including band sizing and elastic axis budgets), and updates release notes to better describe new features and improvements. It also refines the documentation for backend-specific chart support and font scaling options.

Major documentation updates:

Plotly backend documentation:

  • Added detailed release notes and changelog entries for the new Plotly backend, including a list of supported chart types, new features (like native colorscales and composite figures), and bug fixes. Also added a generated chart reference and a new test harness for Plotly. [1] [2] [3]

Excel backend documentation:

  • Added a new section explaining the Excel backend architecture, its intermediate representation (ExcelNativeChartSpec), and how it integrates with Office.js for rendering. Also updated the codebase structure to include the Excel backend and its test harness. [1] [2]

Layout and axis sizing improvements:

Overflow and band sizing:

  • Clarified how overflow is handled, describing the default overflow strategy and its prioritization of display order (user sort, semantic order, numeric, encounter order). [1] [2]
  • Expanded the layout model documentation to explain the band size calculation, including minimum, base, and maximum band sizes for each backend, and how the elastic axis budget works in dense and sparse regimes. [1] [2]

Font scaling options:

  • Documented new options for controlling base font sizes (baseLabelFontSize, baseTitleFontSize) and how fonts adapt to canvas size across backends.

Other documentation and release note improvements:

  • Updated the release notes for version 0.3.0 to provide clearer, more user-focused descriptions of new features and improvements.
  • Clarified backend-specific chart support in the authoring skill documentation, including new chart types for Chart.js.
  • Improved terminology and accuracy in the architecture documentation (e.g., "backend-native output" and details about code generation stages).

These updates make the documentation more comprehensive, accurate, and accessible for both end users and developers.

zl190 and others added 14 commits July 18, 2026 23:04
Port the Bump template to the Chart.js backend, mirroring the ECharts
implementation (ecBumpChartDef): line-with-points per series over a
shared x axis, with the rank axis reversed so rank 1 sits on top.
Chart.js reverses a linear scale in place (reverse: true), so unlike
the ECharts category-index workaround the series keep their real rank
values and the config stays pure JSON with no tooltip formatter.

Rank detection mirrors the shared rule (Rank/Score/Level semantic on
y and not on x); non-rank inputs fall back to a plain value axis with
the semantic zero decision, like the Line template. Discrete/temporal/
linear x handling and the continuous-extent pinning follow line.ts.

- register in cjsTemplateDefs (Line & Area group, same position as
  ECharts)
- tests: 6 cases (registry, datasets shape, reversed rank axis pinned
  to [1, maxRank], non-rank fallback, JSON round-trip purity,
  3-backend parity)
- docs: regenerate reference-chartjs.md; add Bump to the SKILL.md
  Chart.js coverage list (+ synced bundled asset)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Add a fourth rendering backend per docs/adding-a-backend.md: an
assemblePlotly orchestrator reusing the shared core pipeline
(Phase 0 semantics / Phase 1 layout), diverging only at Phase 2 to
emit Plotly figures ({ data: traces[], layout }). Figures are pure
JSON — temporal axes use Plotly's native date axis instead of tick
callbacks, so compiled specs survive serialization.

First-merge scope (§6 acceptance): Bar, Line, Area, Scatter templates
mirroring the Chart.js templates' decisions (category order, zero
baseline, color grouping, horizontal bar transposition, interpolate /
opacity / stackMode / showPoints properties). column/row facet
encodings are dropped with an 'unsupported-channel' warning; subplot
grids are a follow-up.

Wiring per §4: barrel export, tsup entry, ./plotly subpath export,
plotly.js as an optional peerDependency (mirrors chart.js), smoke
test, and tests/plotly-backend.test.ts (10 cases incl. a recursive
no-functions JSON-purity check).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PlotlyView (plotly.js-dist-min, designed-size wrapper mirroring
ChartjsView), a BACKENDS adapter entry, and the per-view dispatch
lines in WallChart / TripleChart / DocChart. Editor output language
and ChartWall result names gain their 'plotly' entries.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Facets: column/row encodings render as a subplot grid (facet.ts) —
per-panel axis pairs with explicit domains, mirroring the Chart.js
backend's facet decisions: shared nice-rounded y-domain, y tick
labels and title on the leftmost column only, column-only wrapping
from the shared facet budget, column headers above panels. Row
headers sit on the right (Vega-Lite style) because the left edge is
occupied by y labels in a single combined figure; x-axis titles show
on the bottom row only for the same reason. The first-merge
'unsupported-channel' warning path is gone — all four templates now
declare column/row.

Colors: colormap.ts mirrors chartjs/colormap.ts — core color
decisions (schemeType / schemeId / categoryCount) pick from
Plotly-native palettes (plotly10 / light24 qualitative, viridis
sequential, RdBu diverging); templates thread the resolved palette
instead of indexing the default colorway directly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
genPlotlyCoreTests (four templates, color on/off, horizontal bar) and
genPlotlyFacetTests (column / row / column-row grid), registered as
'Plotly: Core Templates' and 'Plotly: Facets' in TEST_GENERATORS per
the adding-a-chart-template §4 generator pattern. The backend test
file grows facet-grid assertions (axis pairs, shared range,
leftmost-only labels, header annotations, legend dedupe), a
diverging-vs-categorical scheme pick, a generator round-trip that
assembles every dedicated case, and keeps the JSON-purity check over
a facet figure.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Regenerate package-lock.json from origin/dev and re-add just the
plotly entries (plotly.js-dist-min package + site dependency,
plotly.js peerDependency + peerDependenciesMeta), dropping the
unrelated peer-flag churn a full npm install had introduced.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
feat(chartjs): add Bump Chart template
feat(plotly): add Plotly backend with the four acceptance templates
Comment thread test-harness/excel/evaluations/render-client.mjs Fixed
Comment thread test-harness/excel/office-runner/server.mjs Fixed
Comment thread test-harness/excel/office-runner/server.mjs Fixed
Chenglong-MS and others added 5 commits July 23, 2026 09:38
…e validation'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
…e validation'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

3 participants