Skip to content

Take charts v2 to bar #944

Description

@netchampfaris

Question

Take charts v2 (frappe-ui/charts) to the at-bar checklist.

#885 decided v2 ships in 1.0.0. Map rule 2 then applies to it like any other family: exported at 1.0.0 means frozen until 2.0.0, so it gets the same review every other export gets. The sweep tickets #871#884 were charted before v2 existed, so no ticket covers it.

Members: AreaChart, BarChart, DonutChart, FunnelChart, HeatmapChart, LineChart, NumberCard, useChart, registerChartModules, currentColorScheme, paletteColors, resolveChartTheme, useChartTheme, formatAxisValue, formatDate, formatLabel, formatPercent, formatValue, plus the exported types.

Blocked on combo support, which changes the frozen prop shape.

v2 starts well ahead of the families swept so far — it already has unit tests, docs pages, exported types and theme-reactive palettes. The real work is items 0, 6 and 9:

  • Item 0 — an explicit keep-or-un-export call per member. The format helpers (formatDate, formatValue, formatLabel, formatPercent, formatAxisValue) and the theme members are the ones to look hard at: several are building blocks that may have no consumer-facing reason to be public. registerChartModules is a bare re-export of echarts' use and is worth naming deliberately, since it is also the reason the subpath is justified at all (see below).
  • Item 6 — the P1–P15 verdict list. registerChartModules = use is the load-bearing one: it is what earns frappe-ui/charts its separate entry point under P15's registry limb, now that Root-surface audit: non-component exports from src/index.ts #870 killed the bundle-cost limb. See the note handed to #935.
  • Item 9spec/charts-parity.md lists several changes that are silent for anyone porting from v1 and so need a migration.md before/after, not just a changelog line: connectNulls default flipped truefalse; formatDate's argument order swapped, which breaks positional callers with no compiler error; formatValue shorten precision default 01; NumberCard value formatting changed from always-compact to full-precision; and v1's forced min-w-[300px] min-h-[300px] floor removed, so a chart in an unsized parent renders at zero height.
  • Item 3 — check the five named behaviors specifically, rather than relying on the existing suite's coverage.
  • Item 4 — descriptions on every prop, slot and emit.

Also settle the two integration items spec/charts-parity.md raises: src/charts is in neither sourceRoots nor colocatedRoots in docs/.vitepress/config.ts, and the frappe-ui/charts-style.css import requirement is undocumented. The stylesheet export itself is handed to #903.

Metadata

Metadata

Assignees

Labels

triagedSeen by baristawayfinder:taskWayfinder ticket — manual work that unblocks a decision

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions