LearnNewsExamplesConnect
Frontmatter
assigneesneo-opus-vega
createdAtNov 19, 2026, 3:39 PM
updatedAtNov 20, 2026, 12:01 AM
githubUrlhttps://github.com/neomjs/neo/issues/21488
authorneo-opus-vega
commentsCount0
parentIssue21367
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtNov 20, 2026, 12:01 AM

amCharts Pie gets a cover, taken once its chart says it is drawn

Closed v14.0.0/archive-v14-0-0-chunk-5 enhancementaicoreportal
neo-opus-vega
neo-opus-vega commented on Nov 19, 2026, 3:39 PM

Owned work, no contributor labels: Vega builds it under #21367 for the Engine 14 lock (Sun 22 Nov, 18:00 CET).

Context

The am-charts card in Charts, Canvas & Maps (apps/portal/resources/data/examples.json:928) has no cover ("image": null). Charts part 2 deferred it because its labels drew only after #21400 (PR #21401), which closed on 19 Nov (#21406, Out of Scope). The epic's cover rule (#21367): a card publishes only with a cover taken after its content is drawn, and a canvas scene needs a drawn signal on the DOM. #21406 left other renderers' signals for "when an example or test needs it". This card needs one now.

The Problem

Nothing tells a capture that the pie is drawn. Neo.main.addon.AmCharts#create() (src/main/addon/AmCharts.mjs:152) returns as soon as am4core.createFromConfig returns; amCharts validates the data and draws in later frames. The wrapper's onChartMounted() (src/component/wrapper/AmChart.mjs:240) runs on that early answer. A recipe that waits for the SVG or a fixed delay publishes whichever frame the timing gives it (#21406, Avoided Traps: a stable layout proves nothing).

The Architectural Reality

  • Neo.component.Canvas#drawn_ (src/component/Canvas.mjs:27, PR #21409): true while the pixels show the current content, set only by the part that knows that moment, reflected as data-drawn.
  • Neo.canvas.GraphScene#whenDrawn() (src/canvas/GraphScene.mjs:1508, PR #21409): a remote that answers after the owed frame drew; the example sets drawn from it.
  • The chart lives in the main thread. The wrapper knows it only through the addon's remotes; createChart() (AmChart.mjs:183) sends the create 50 ms late and cancels a stale one.
  • amCharts 4 has isReady() and the ready and datavalidated events (checked in the core.js that neomjs/pages serves as the fallback).
  • Six app views use the wrapper too (covid, sharedcovid, colors). They get the signal without a change.

The Fix

  1. Neo.main.addon.AmCharts gains a remote whenDrawn({id}). It answers true once the chart is ready and its latest data validated (at once when it already is), and false when the chart is destroyed or replaced first.
  2. Neo.component.wrapper.AmChart gains drawn_ with Canvas's contract and data-drawn reflection. It asks whenDrawn after each create and each chartData change, and drops to false on a new create (a theme change included), new data, unmount and destroy. An answer for a superseded create or data set is ignored.
  3. The am-charts capture recipe waits on [data-drawn='true']. The cover goes to neomjs/pages first, then examples.json names it.

Contract Ledger

Surface Source of authority Behavior Fallback Docs Evidence
Neo.component.wrapper.AmChart#drawn_ (new) Canvas#drawn_ (PR #21409) true while the chart shows its current data; data-drawn mirrors it false JSDoc unit spec
Neo.main.addon.AmCharts#whenDrawn (new remote, app) GraphScene#whenDrawn (PR #21409) true after ready + data validated; false if destroyed or replaced false JSDoc unit spec

Decision Record impact: none.

Acceptance Criteria

  • AC-1: whenDrawn({id}) answers true after ready and the latest data's datavalidated, true at once for a drawn chart, and false for a chart destroyed or replaced first (test/playwright/unit/main/addon/, stubbed am4core).
  • AC-2: the wrapper's drawn turns true only from the answer for its latest create and data; a theme re-create, new chartData, unmount and destroy set it false; data-drawn mirrors it (test/playwright/unit/component/).
  • AC-3: Charts, Canvas & Maps publishes am-charts with a cover captured after data-drawn; three capture runs give byte-identical covers; a merged neomjs/pages PR serves the cover before the neo PR merges.
  • AC-4: the portal catalog unit and e2e specs pass with the new cover (seo.json from getSeoJson()).

Out of Scope

  • amCharts v5 (Discussion #20309) and examples for the maps package.
  • Covers for the app views that use the wrapper.
  • Changing what create() answers: onChartMounted() keeps meaning "created".

Avoided Traps

  • The main thread stamping data-drawn on the DOM: the app worker would not know what the DOM shows, and NL tests read the component. The component owns the flag, as Canvas does.
  • Making create() answer late: create is queued until the addon is ready, and its answer means "created" to every onChartMounted() override.
  • A delay or an SVG-exists wait in the recipe: it captures whichever frame the timing gives.

Related

Parent #21367 · #21406 / PR #21409 (Canvas#drawn_, GraphScene#whenDrawn) · #21400 / PR #21401 (amCharts text) · #21484 / PR #21486 (catalog totals) · Discussion #20309.

Live latest-open + closed sweep: latest 20 open read, plus open and closed searches for "amCharts cover", "AmChart drawn", "am-charts" and "amCharts pie" at 2026-11-19T14:38Z; the closed hits #21400, #21406 and #21322 carry the deferral above and no exclusion. Open count 78 (red band), folded under #21367. A2A in-flight sweep: latest 30 messages in all read-states up to 14:35:59Z, no claim on this scope. Memory Core sweep ("amCharts pie card has no cover; chart wrapper cannot tell when it is drawn", 5 results): no prior decision. Own assignments: 12 open, none overlapping. Structure map: N/A (src/component/wrapper, src/main/addon, portal data; no Agent OS placement).

Retrieval Hint: "amCharts wrapper drawn signal whenDrawn am-charts cover"

tobiu referenced in commit 9f2f46d - "feat(examples): serve the amCharts Pie cover (#21488) (#134) on Nov 19, 2026, 5:12 PM