@praxisui/charts 10.0.0-rc.9 → 10.0.0-rc.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -47
- package/ai/component-registry.json +15775 -2646
- package/fesm2022/praxisui-charts.mjs +54870 -12026
- package/package.json +3 -3
- package/types/praxisui-charts.d.ts +4927 -446
package/README.md
CHANGED
|
@@ -15,14 +15,14 @@ The package renders `PraxisChartConfig` and canonical `x-ui.chart` documents thr
|
|
|
15
15
|
## Install
|
|
16
16
|
|
|
17
17
|
```bash
|
|
18
|
-
npm i @praxisui/charts@rc
|
|
18
|
+
npm i @praxisui/charts@rc @praxisui/core@rc @praxisui/table@rc
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
Peer dependencies:
|
|
22
22
|
|
|
23
23
|
- `@angular/common`, `@angular/core`, `@angular/forms`, `@angular/material` `^21.0.0`
|
|
24
|
-
- `@praxisui/core` `^
|
|
25
|
-
- `@praxisui/table` `^
|
|
24
|
+
- `@praxisui/core` `^10.0.0-rc.65`
|
|
25
|
+
- `@praxisui/table` `^10.0.0-rc.65`
|
|
26
26
|
- `rxjs` `~7.8.0`
|
|
27
27
|
|
|
28
28
|
Runtime dependency included by the package:
|
|
@@ -121,7 +121,9 @@ Use the component with either local data or governed remote execution:
|
|
|
121
121
|
|
|
122
122
|
- `dataSource.kind = 'local'`: the chart consumes rows supplied in `dataSource.items` or the `data` input.
|
|
123
123
|
- `dataSource.kind = 'remote'`: the chart emits `queryRequest`, then uses a host `remoteDataResolver` or the default `PraxisChartStatsApiService` path for `praxis.stats`.
|
|
124
|
-
- `praxis.stats/comparison`: analytics projections materialize one `Current` and one `Previous` series per governed metric.
|
|
124
|
+
- `praxis.stats/comparison`: analytics projections materialize one `Current` and one `Previous` series per governed metric, while `PraxisChartStatsApiService` also preserves backend `delta`, `deltaPercent`, and `baselineMissing` values. Configurable display via `comparison` (`showDelta`, `showDeltaPercent`, `showInTooltip`, `showInLabels`) surfaces variation cleanly in tooltips, compact non-overlapping series labels, the accessible table, and enriched KPI cards without cluttering `390px` viewports.
|
|
125
|
+
- Reference annotations (`referenceLines`, `referenceBands`, `targetMarkers`): renderer-neutral thresholds, tolerance bands, and coordinate milestones bound to governed semantic tones (`info`, `success`, `warning`, `danger`, `critical`, `neutral`) and surfaced in both ECharts (`MarkLine`, `MarkArea`, `MarkPoint`) and the accessible structured data panel.
|
|
126
|
+
- Declarative scalability & renderer options (`dataZoom`, `axisScaleBreak`, `labelLayout`, `renderer`): temporal/axis window zoom (`DataZoomComponent`), automatic or explicit ECharts 6 outlier scale breaks (`AxisBreak`), automatic label overlap prevention (`LabelLayout`), and `'canvas' | 'svg'` renderer selection (`SVGRenderer`) without exposing raw engine options.
|
|
125
127
|
- `queryContext`: primary input for dynamic-page orchestration; filters, sort and limit are merged into remote requests where supported.
|
|
126
128
|
- `filterCriteria`: accepted as a compatibility bridge, but new integrations should use `queryContext`.
|
|
127
129
|
- `pointClick`: raw renderer-neutral point evidence. Configured click actions are emitted separately through `pointAction`.
|
|
@@ -157,14 +159,15 @@ The public contract is `PraxisChartConfig` or the canonical `PraxisXUiChartContr
|
|
|
157
159
|
|
|
158
160
|
The structured alternative is automatic. It does not add an accessibility field to `PraxisChartConfig` or `x-ui.chart`, and custom engines remain responsible for an accessible visual rendering while the component-level data alternative remains renderer-neutral.
|
|
159
161
|
|
|
160
|
-
Standalone charts render that toggle inside the component. When the chart is loaded by `WidgetShell`, it contributes the same stateful action to the shell toolbar and suppresses the duplicate internal control. The visual canvas becomes hidden and inert while the opaque structured-data surface is active, so the two representations never compete visually or interactively.
|
|
162
|
+
Standalone charts render that toggle inside the component. When the chart is loaded by `WidgetShell`, it contributes the same stateful action to the shell toolbar and suppresses the duplicate internal control. When hosted inside `PraxisAnalyticsPresentationComponent` with an eligible `analytic-table` family, the presentation sets `dataAlternativeMode="external"` and `externalDataAlternativeLabel` so the compact switcher becomes the single table authority, suppresses the duplicate chart trigger/action, updates the ECharts ARIA description to point at that control, and shares raw `/stats/*` responses across families. Setting `dataAlternativeMode="none"` suppresses the built-in panel and omits the table hint from the ARIA description. The visual canvas becomes hidden and inert while the opaque built-in structured-data surface is active, so the two representations never compete visually or interactively.
|
|
161
163
|
|
|
162
164
|
Supported canonical kinds are `bar`, `horizontal-bar`, `line`, `area`, `stacked-bar`,
|
|
163
|
-
`stacked-area`, `combo`, `pie`, `donut`, `scatter`, `funnel`, `pyramid`, `treemap`,
|
|
164
|
-
|
|
165
|
-
and
|
|
166
|
-
stages by value.
|
|
167
|
-
|
|
165
|
+
`stacked-area`, `combo`, `pie`, `donut`, `scatter`, `funnel`, `pyramid`, `treemap`, `sunburst`,
|
|
166
|
+
`sankey`, `radar`, `gauge`, `heatmap`, `boxplot`, `calendar`, and `waterfall`. Funnel,
|
|
167
|
+
pyramid, and flat 1D treemap require one categorical dimension and exactly one non-negative metric. Funnel
|
|
168
|
+
stages by value. Flat 1D treemap preserves the governed category/metric bucket contract untouched,
|
|
169
|
+
while multilevel `treemap` and `sunburst` share an ordered `dimensions[]` / `path` / `parentId` /
|
|
170
|
+
`children` hierarchical tree builder (see [`ADR-0003`](./docs/adr/0003-hierarchical-sunburst-treemap-and-sankey-links.md)).
|
|
168
171
|
Gauge requires one dimension, exactly one metric and an explicit finite `gauge.scale` whose `max`
|
|
169
172
|
is greater than `min`. A remote gauge uses `praxis.stats` `group-by` with
|
|
170
173
|
`source.options.limit = 1`; zero or multiple buckets, non-finite values and values outside the
|
|
@@ -172,34 +175,54 @@ declared scale fail closed instead of being clamped. Pointer, ticks and angles r
|
|
|
172
175
|
details and are not part of the public contract.
|
|
173
176
|
Scatter accepts one or two metrics. With one metric, the first dimension is X and the metric is Y.
|
|
174
177
|
With two metrics, the first dimension remains the grouped bucket identity while the first and second
|
|
175
|
-
metrics map to X and Y; the canonical mapper derives the multi-metric stats request
|
|
178
|
+
metrics map to X and Y; the canonical mapper derives the multi-metric stats request, and
|
|
179
|
+
`AnalyticsChartConfigAdapterService` automatically maps `intent: 'correlation'` projections to
|
|
180
|
+
`scatter`.
|
|
181
|
+
Heatmap requires exactly two dimensions (X and Y matrix axes) and one numeric metric, rendering a
|
|
182
|
+
continuous `visualMap` gradient that distinguishes literal `0` values from missing cells (`null`).
|
|
183
|
+
Boxplot renders category quartile distributions (`min`, `Q1`, `median`, `Q3`, `max`) plus Tukey `1.5 × IQR` outliers and sample size (`n`); remote `praxis.stats` queries request `MIN`, `PERCENTILE_25`, `MEDIAN`/`PERCENTILE_50`, `PERCENTILE_75`, `MAX` (plus optional `COUNT`) while preserving LGPD `suppressed`/`suppressedBucketCount`/`minBucketCount` governance.
|
|
184
|
+
Calendar renders daily intensity heatmaps across a configurable `range` (`'YYYY'`, `'YYYY-MM'`, `'YYYY-S1'`, `'YYYY-S2'`, `'YYYY-H1'`, `'YYYY-H2'`, or `[startDate, endDate]`) from `praxis.stats` `timeseries` (`DAY`) or active intervals `[dtini, dtfim]`, strictly separating `0` (literal zero) from `null` (omitted/suppressed) and missing days, with accessible dark/light token palettes and `crossFilter` emitting `'YYYY-MM-DD'`.
|
|
185
|
+
Waterfall renders ordered cumulative flow steps (`start`, `increase`, `decrease`, `subtotal`, `total`) preserving declared input order, stacked transparent base bars, step connectors, and explicit `+`/`-`/`=` formatted deltas without double negatives (`-R$ -...`).
|
|
186
|
+
In `AnalyticsChartConfigAdapterService`, non-comparison multi-metric projections also infer
|
|
187
|
+
`combo` with a right-hand secondary axis (`axis: 'secondary'`) whenever `secondaryMetrics`
|
|
188
|
+
explicitly requests `'secondary'` or diverges in unit, format family, or aggregation scale, while
|
|
189
|
+
semantic hints (`sankey`, `sunburst`, `treemap`, `radar`, `heatmap`, `scatter`, `boxplot`, `calendar`, `waterfall`),
|
|
190
|
+
`correlation` intents, or quartile metric bundles materialize directly across `distribution`, `trend`, `composition`, and `correlation` intents.
|
|
176
191
|
|
|
177
192
|
## Governed chart/table presentation
|
|
178
193
|
|
|
179
|
-
`PraxisAnalyticsPresentationComponent` materializes an existing `x-ui.analytics` projection
|
|
180
|
-
chart
|
|
181
|
-
|
|
182
|
-
|
|
194
|
+
`PraxisAnalyticsPresentationComponent` materializes an existing `x-ui.analytics` projection across
|
|
195
|
+
`chart`, `analytic-table`, `kpi`, and `summary-list`. When `analytics.projections` publishes more
|
|
196
|
+
than one projection, the toolbar exposes an accessible projection selector that preserves active
|
|
197
|
+
presentation family eligibility and `queryContext`. The projection is selected by exact
|
|
198
|
+
`projectionId`; the component reuses `AnalyticsPresentationResolver` and the official Charts/Table
|
|
199
|
+
adapters instead of rebuilding stats requests.
|
|
183
200
|
|
|
184
201
|
```html
|
|
185
202
|
<praxis-analytics-presentation
|
|
186
203
|
[analytics]="analytics"
|
|
187
204
|
projectionId="supplier-procurement-funnel"
|
|
188
|
-
[availableFamilies]="['chart', 'analytic-table']"
|
|
205
|
+
[availableFamilies]="['chart', 'analytic-table', 'kpi', 'summary-list']"
|
|
189
206
|
[preferredFamily]="savedPreference"
|
|
190
207
|
[queryContext]="queryContext"
|
|
191
208
|
(presentationChange)="rememberTemporarily($event)"
|
|
192
209
|
/>
|
|
193
210
|
```
|
|
194
211
|
|
|
212
|
+
When rendered inside a `<praxis-widget-shell>` via `DynamicWidgetLoaderDirective`, `PraxisAnalyticsPresentationComponent` implements `WidgetShellActionContributor` to promote the eligible family switcher (`chart`, `analytic-table`, `kpi`, `summary-list`) into the shell header as an atomic segmented group (automatically falling back to icon-only with tooltips and then to a labeled radio section inside the `More actions` overflow menu when header width is constrained). Configure placement and display with `controlsPlacement` (`'auto' | 'shell-header' | 'inline'`, default `'auto'`) and `controlsDisplay` (`'auto' | 'icon-label' | 'icon-only' | 'menu'`, default `'auto'`). Standalone renders, hosts with `showHeader: false`, or `controlsPlacement="inline"` automatically keep the inline family toolbar rendered, while multi-projection selectors stay inline in the widget body so both controls remain independent.
|
|
213
|
+
|
|
195
214
|
Choice precedence is temporary user choice, persisted `preferredFamily`, then projection hints.
|
|
196
215
|
`availableFamilies` must already reflect host policy/capabilities; the runtime intersects it with
|
|
197
216
|
installed and semantically eligible renderers. Incompatible preferences fail closed. Switching
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
217
|
+
between `chart`, `analytic-table`, `kpi`, and `summary-list` reuses the shared in-memory
|
|
218
|
+
raw `/stats/*` response cache (`rawStatsValueCache` LRU up to 16 entries / `inFlightRawStats` keyed by normalized
|
|
219
|
+
`resourcePath + projectionId + statsPath + statsRequest + filterExpression + runtimeContextRevision`) whenever the remote stats
|
|
220
|
+
contract allows, avoiding duplicate HTTP calls for the same slice while invalidating cache entries and
|
|
221
|
+
cancelling in-flight cache writes when `EnterpriseRuntimeContextService.contextChanges$`, `analyticsChanged`, resource hydration, or destroy occurs. KPI is eligible for canonical
|
|
222
|
+
`group-by` and `comparison` projections with one primary metric, enriched with comparison delta
|
|
223
|
+
badges and `<praxis-micro-visualization [interactiveContainer]="true">`. `summary-list` renders an
|
|
224
|
+
ordered, keyboard-accessible proportional summary list with normalized bar shares and comparison
|
|
225
|
+
delta badges when published by the projection's `preferredFamilies`.
|
|
203
226
|
|
|
204
227
|
## Canonical Chart Documents
|
|
205
228
|
|
|
@@ -277,47 +300,60 @@ existing popover roles, with card/foreground and Material fallbacks. Tooltip
|
|
|
277
300
|
formatting, triggers and disabled state keep their authored semantics; these
|
|
278
301
|
computed appearance values are transient and never saved into the chart document.
|
|
279
302
|
|
|
303
|
+
### Governed Motion and Data Transitions
|
|
304
|
+
|
|
305
|
+
`PraxisChartConfig.motion` and `PraxisXUiChartContract.motion` govern both initial entrance animations and data/filter transition animations without exposing raw engine timing properties:
|
|
306
|
+
|
|
307
|
+
- `enabled: false`: disables initial and update animations (`animationThreshold: 0`).
|
|
308
|
+
- `preset: 'subtle'`: fast, understated corporate cadence (`220ms` entrance, `180ms` update, `cubicOut`, `animationThreshold: 1000`).
|
|
309
|
+
- `preset: 'standard'` (default when motion is enabled): balanced analytical transition (`450ms` entrance, `320ms` update, `cubicOut` / `cubicInOut`, `animationThreshold: 1500`).
|
|
310
|
+
- `preset: 'expressive'`: emphasized storytelling cadence (`750ms` entrance, `520ms` update, `quinticOut` / `cubicInOut`, `animationThreshold: 2000`).
|
|
311
|
+
|
|
312
|
+
When `queryContext`, `filterCriteria`, or `data` changes for the same governed chart structure and remote resource identity, the default ECharts adapter updates the existing instance with `{ notMerge: false, replaceMerge: ['series'] }` so bars, lines, slices, and gauges interpolate smoothly between filter states. Structural or chrome mutations (chart kind, axis bounds, legend/tooltip visibility, titles, or switching to a different remote `resourcePath`/`resourceKey`) force a clean state reset (`setOption(option, true)` or canvas teardown) so stale options never leak across resources.
|
|
313
|
+
|
|
314
|
+
`PraxisChartComponent` also respects `@media (prefers-reduced-motion: reduce)` at the host level, disabling visual transitions automatically when the operating system requests reduced motion. In `PraxisChartConfigEditor`, the Motion tab provides a **Simulate transition** action (`simulateMotionTransition()`) and automatically previews preset changes on the live chart.
|
|
315
|
+
|
|
280
316
|
## Micro Visualizations
|
|
281
317
|
|
|
282
318
|
Transparent charts inside `WidgetShell` inherit the shell foreground, including fixed dark finishes in a light application theme. The chart's opaque accessible-data panel pairs its own background with the corresponding foreground. Explicit chart text colors keep precedence.
|
|
283
319
|
|
|
284
|
-
`PraxisMicroVisualizationComponent` renders the
|
|
285
|
-
It is intended for compact presentation surfaces, especially table cells, list items and read-only form summaries.
|
|
320
|
+
`PraxisMicroVisualizationComponent` (`<praxis-micro-visualization>`) is canonically owned by `@praxisui/core/micro-visualization` (re-exported by `@praxisui/charts` without duplicate selector definitions), wraps `<praxis-micro-viz-host>` from `@praxisui/core`, and renders the compact presentation contract from `PraxisPresentationVisualizationConfig` across table cells, list items, object headers, card summaries, KPI bands, drawers, rich content, and form presentations. Because `@praxisui/core/micro-visualization` carries no hard dependency on ECharts, standalone consumers must register `providePraxisCharts()` (or provide `PRAXIS_MICRO_CHART_ENGINE`) in their injector hierarchy to activate `data-engine="echarts"`; without it, all visualizations degrade cleanly to `data-engine="primitive"`.
|
|
286
321
|
|
|
287
|
-
The
|
|
322
|
+
The supported `PraxisPresentationVisualizationKind` matrix is split across a hybrid platform architecture:
|
|
288
323
|
|
|
289
|
-
- `
|
|
290
|
-
- `area`
|
|
291
|
-
- `
|
|
292
|
-
- `comparison`
|
|
293
|
-
- `
|
|
294
|
-
- `radial`
|
|
295
|
-
- `harveyBall`
|
|
296
|
-
- `bullet`
|
|
297
|
-
- `delta`
|
|
298
|
-
- `processFlow`
|
|
324
|
+
- **Apache ECharts 6 `SVGRenderer` (`data-engine="echarts"` via `EChartsMicroSvgEngineService` when `providePraxisCharts()` / `PRAXIS_MICRO_CHART_ENGINE` is installed)**:
|
|
325
|
+
- All 6 vector/SVG kinds (`line`, `area`, `column`, `waterfall`, `radial`, and `harveyBall`) on **all surfaces** (`table-cell`, `card-summary`, `list-item`, `object-header`, `form-presentation`, or omitted), using compact `28px` / `20px` dial geometry on `table-cell` (`radial` pairs the ECharts ring with an accessible HTML center percentage overlay, while `harveyBall` pairs a borderless `pie` wedge with a refined `gauge` rim).
|
|
326
|
+
- **Lightweight native Core structural primitives (`data-engine="primitive"` inside `<praxis-micro-viz-host>`)**:
|
|
327
|
+
- `stackedBar`, `comparison`, `bullet`, `delta`, and `processFlow` on all surfaces (structured HTML/CSS layouts such as proportional tracks, tolerance bands, directional badges, and step timelines);
|
|
328
|
+
- Automatic full fallback for all 11 kinds when `PRAXIS_MICRO_CHART_ENGINE` is omitted or explicitly opted out via `providePraxisCharts({ microChartEngine: false })` (which registers `PRAXIS_MICRO_CHART_ENGINE_DISABLED`), or when the delegated engine fails.
|
|
299
329
|
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
330
|
+
`EChartsMicroSvgEngineService` runs tree-shakeable `echarts/core` in SSR mode (`renderer: 'svg'`, `ssr: true`, `renderToSVGString()`) with a bounded instance pool (`16` dimension buckets), a `500`-entry LRU SVG cache, per-instance deterministic `<defs>` ID scoping, and native preservation of `--prx-micro-*` CSS custom properties and `currentColor` inheritance.
|
|
331
|
+
Use `points` as the canonical numeric series for `line`, `area`, `column`, and `comparison` (accepting raw numbers or `{ value, label }` points);
|
|
332
|
+
use `segments` for `stackedBar` (with optional `title` and `legend: true` on non-`table-cell` surfaces), `thresholds` and `targetLabel` (e.g., `'Meta'`, `'Teto'`, `'Limite'`, `'Alerta'`) for `bullet` and `delta`, and `items` for item/step-oriented visualizations such as `processFlow` and `waterfall` (with optional `role`: `'start' | 'increase' | 'decrease' | 'subtotal' | 'total'`).
|
|
333
|
+
For `line`, `area`, `column`, and `waterfall`, optional `min`/`max` bounds control the vertical domain (`scaleScope: 'page'`), `target` and `baseline` render dashed horizontal reference lines inside the SVG plot, and `valueSuffix` appends a unit suffix to readouts and endpoint labels.
|
|
334
|
+
Floating hover/focus telemetry readouts (`data-micro-readout`) are rendered via `PraxisMicroTooltipOverlayService` directly in `document.body` / HTML Top Layer so ancestor `overflow: hidden`, sticky headers, virtual scroll viewports, and card `transform` states never clip or duplicate percentages.
|
|
335
|
+
When non-`table-cell` widgets expose keyboard focus (`line`, `area`, `column`, `waterfall`, `stackedBar`, `comparison`, `processFlow`, `bullet`, `radial`, `harveyBall`, and `delta` with readout), the container uses `role="group"` (switching to `role="img"` in `table-cell` or `[interactiveContainer]="true"` where focus stops are suppressed); multi-item series support `ArrowLeft`/`ArrowRight`/`ArrowUp`/`ArrowDown`/`Home`/`End`/`Escape` scrubbing with polite `aria-live` announcements.
|
|
336
|
+
Rich charts still use the canonical `x-ui.chart` document flow above; micro visualizations are the lightweight presentation contract for dense cells, list items, object headers, card summaries, KPI bands, drawers, and form presentation surfaces.
|
|
305
337
|
|
|
306
|
-
Neutral micro visualizations inherit foreground from their container
|
|
338
|
+
Neutral micro visualizations inherit foreground from their container (`currentColor` / `--prx-micro-text-color`). Sculpted radial rings (`radial`) and sector dials (`harveyBall`) preserve over-capacity readouts (`>100%`) while capping the visual SVG arc to `100%`; `radial` with `surface: 'card-summary'` renders at `4rem` (`size: 'sm'` or omitted) with side caption/target metadata or `6rem` (`size: 'md'` / `'responsive'`) with an inner medallion subtitle, while `table-cell` indicators retain compact `28px` (`radial`, `arcWidth: 3.5`) / `20px` (`harveyBall`, `rimWidth: 1.25`) ECharts dial geometry.
|
|
307
339
|
|
|
308
340
|
The Dynamic Page Lab's preset studio includes “Testar com componentes reais”: official Table, Chart, Dynamic Form and Micro Visualization components using identified local demonstration data. It supports changing shell finishes, local table selection/pagination, chart data inspection, form editing/read-only mode and supported demonstration states. This fixture does not save business records.
|
|
309
341
|
|
|
310
342
|
## Authoring Surface
|
|
311
343
|
|
|
312
|
-
`PraxisChartConfigEditor` is the initial editor shell for canonical `x-ui.chart` documents. It consumes governed resources, fields and targets and emits structured apply/save/reset events. The authoring manifest is exported as `PRAXIS_CHARTS_AUTHORING_MANIFEST` for backend/tooling workflows that need executable chart-edit operations.
|
|
344
|
+
`PraxisChartConfigEditor` is the initial frameless editor shell for canonical `x-ui.chart` documents. It consumes governed resources, fields and targets, provides frameless authoring for reference lines/bands/markers, scalability (`dataZoom`, `axisScaleBreak`, `labelLayout`, `renderer`), comparison delta visibility, and bidirectional `visual ↔ JSON` round-trip, and emits structured apply/save/reset events. The authoring manifest is exported as `PRAXIS_CHARTS_AUTHORING_MANIFEST` for backend/tooling workflows that need executable chart-edit operations.
|
|
313
345
|
|
|
314
|
-
|
|
346
|
+
The direct runtime host opens `PraxisChartWidgetConfigEditor` with the existing `{ inputs }` envelope so the canonical document, derived `data` and separate `queryContext` share the Apply/Save boundary. Apply updates the runtime and emits `chartDocumentApplied`; Save emits `chartDocumentSaved`. Both document outputs retain their `PraxisXUiChartContract` shape. `chartDocumentPatchChange` carries independent snapshots in `inputPatch.chartDocument`, `data` and `queryContext` when applicable, plus mapped `config` for a config-driven host. Switching to `praxis.stats` clears local data precedence with `inputPatch.data: null`; clearing query context uses `queryContext: null`.
|
|
347
|
+
|
|
348
|
+
The accepted editor state belongs to the opening owner inputs. An owner may echo the latest accepted value of each input one at a time, including fields omitted from a later patch; equivalent clones do not imply a new owner. Hosts must apply patches in order: an older value of the same input delivered after a newer accepted value is indistinguishable from an external override and is treated as one. A distinct external input change replaces the local document/data/context state, and old editor events are rejected even before the next render. Closing or destroying the owner releases the editor subscriptions. Cancel discards unapplied editor work; it does not undo a previous Apply. Dynamic Page/Page Builder can materialize the patch in its authored page, but external persistence remains the host's responsibility. Apply or Save alone is not proof of remote persistence; the standalone showcase keeps runtime state only. Transient catalogs remain outside the persisted input envelope.
|
|
315
349
|
|
|
316
350
|
`ChartResourceCapabilityCatalogAdapter` derives resource operations and eligible dimension, time and metric options directly from `ResourceCapabilitySnapshot`, including fail-closed comparison eligibility.
|
|
317
351
|
|
|
318
|
-
Applications should install `providePraxisCharts()` once. The registered `ComponentDocMeta.configEditor.contextResolver` materializes the editor context without making Page Builder own Chart semantics. Initial resolution groups `/schemas/catalog` endpoints by the stable `resourceKey`, exposes that value as `availableResources[].id`, and keeps the catalog's governed root-relative resource path as `availableResources[].path`. A selected `praxis.stats` source is normalized to that operational path before save; the discovery id is never persisted as an executable URL.
|
|
352
|
+
Applications should install `providePraxisCharts()` once. The registered `ComponentDocMeta.configEditor.contextResolver` materializes the editor context without making Page Builder own Chart semantics. Initial resolution groups `/schemas/catalog` endpoints by the stable `resourceKey`, exposes that value as `availableResources[].id`, and keeps the catalog's governed root-relative resource path as `availableResources[].path`. Coexisting `/stats/capabilities` endpoints do not conflict with the canonical collection `/capabilities` endpoint; `chart-resource-capabilities-endpoint-ambiguous` is emitted only when multiple distinct collection capability paths compete for the same resource. A selected `praxis.stats` source is normalized to that operational path before save; the discovery id is never persisted as an executable URL.
|
|
353
|
+
|
|
354
|
+
Capabilities are loaded lazily from the exact catalog-published endpoint only after resource selection. Concurrent reads are deduplicated in flight, with a 30-second catalog timeout and a 10-second per-resource capability timeout, but successful permission-sensitive projections are not cached across requests until the host publishes a canonical authentication/context epoch. Denied, unavailable, ambiguous, stale and empty evidence fails closed, and later requests remain retryable. In `PraxisChartWidgetConfigEditor`, authoring context diagnostics are grouped by diagnostic code with occurrence counts, scope impact, and expandable details (affected resource paths, next steps, and technical code) without dirtying the editor draft. `canonicalOperations` gates group-by, timeseries and distribution, while `stats.fields[]` gates dimensions, metrics, aggregations and exact `distributionModes` eligibility for terms versus histogram. `/schemas/filtered` enrichment of field titles, types and `x-ui` remains a later schema-flow gate; capabilities remain the authority for eligibility.
|
|
319
355
|
|
|
320
|
-
|
|
356
|
+
When `source.kind === 'derived'`, `PraxisChartConfigEditor` and `PraxisChartWidgetConfigEditor` expose local dataset authoring (`inputs.data` / `localData`) in the Data tab, align the live preview with the widget's local records (falling back to an explicitly labeled synthetic sample only when local records are empty), and validate predictable runtime constraints before save—including single-bucket consolidation and scale range checks for `gauge`. Consolidation preserves the authored aggregation: SUM40+80 remains120, and a gauge scale0..100 reports `gauge-value-out-of-range` until the author changes the scale, data or aggregation explicitly. The editor never substitutes an average or clamps the value to make it fit. For `pie` and `donut` charts, omitting `labels` preserves the engine's default callout visibility (`labels.enabled: undefined`), while explicit `labels: false` or `labels: { enabled: false }` hides both slice labels and leader lines (`labelLine: { show: false }`).
|
|
321
357
|
|
|
322
358
|
Target choices come only from existing top-level composition links whose source is the current Chart and whose exact structured source event port is public and non-deprecated. Raw `pointClick` evidence never authorizes a configured action; `events.pointClick` uses `pointAction`. Directly compatible widget ports are admitted; an explicit `transform.output.semanticKind` is inspected only as provisional local evidence. That local check does not replace a transform-output projection materialized and validated by Core, which remains a P2 gate. Destinations are limited to compatible public, non-deprecated widget inputs or explicitly writable declared page state. Each target carries `events[]`, so a link from `crossFilter` cannot authorize the same target for `pointClick`, `selectionChange` or `drillDown`; routes, nested ports, global actions, undeclared state and unconnected widgets are not synthesized.
|
|
323
359
|
|
|
@@ -327,7 +363,7 @@ Visual authoring now consumes this projection, and the backend handler, resolver
|
|
|
327
363
|
|
|
328
364
|
## Public API Snapshot
|
|
329
365
|
|
|
330
|
-
Main exports include `PraxisChartComponent`, `PraxisChartDocumentPatchChangeEvent`, `PraxisMicroVisualizationComponent`, `PraxisChartConfigEditor`, chart event/config models, `PraxisXUiChartContract`, engine adapter and factory tokens, `providePraxisCharts`, canonical mapping/normalization/validation services, analytics chart services, chart metadata and `PRAXIS_CHARTS_AUTHORING_MANIFEST`.
|
|
366
|
+
Main exports include `PraxisChartComponent`, `PraxisChartDocumentPatchChangeEvent`, `PraxisMicroVisualizationComponent`, `PraxisChartConfigEditor`, `EChartsMicroSvgEngineService`, `EChartsMicroOptionBuilderService`, `PraxisChartsProviderOptions` (including `microChartEngine?: PraxisMicroChartEngine | false`), chart event/config models, `PraxisXUiChartContract`, engine adapter and factory tokens, `providePraxisCharts`, canonical mapping/normalization/validation services, analytics chart services, chart metadata and `PRAXIS_CHARTS_AUTHORING_MANIFEST`.
|
|
331
367
|
|
|
332
368
|
## Official Links
|
|
333
369
|
|
|
@@ -394,9 +430,50 @@ a dirty draft, without emitting Save or asking to save a target that no longer e
|
|
|
394
430
|
A pending opening is cancelled as well. This applies to the chart-owned editor; other
|
|
395
431
|
consumers must explicitly supply their own owner to adopt the same lifecycle.
|
|
396
432
|
|
|
397
|
-
|
|
433
|
+
## `<praxis-timeline-lanes>` — Swimlane Chronological Timeline
|
|
434
|
+
|
|
435
|
+
`<praxis-timeline-lanes>` (`PraxisTimelineLanesComponent`) is the governed `@praxisui/charts` component for continuous intervals across synchronized swimlanes with an accessible table alternative (`timeline | split | table`), non-chromatic conflict detection, and open-ended period support (`endDate == null`).
|
|
436
|
+
|
|
437
|
+
- **Contract & Metadata:** `PraxisTimelineLanesConfig` (`x-ui.timelineLanes`), ports `config`, `queryContext`, `barSelect`, `rangeFilter`, `conflictClick`, and `actionClick` registered by `providePraxisTimelineLanesMetadata()` (included in `providePraxisCharts()`).
|
|
438
|
+
- **Datasources:** accepts inline items (`items` / `dataSource.data`), a single resource endpoint (`resourcePath` + `PraxisDataQueryContext`), or parallel per-lane sources (`dataSource.laneSources[]`).
|
|
439
|
+
- **Governance & Editor:** conditional rules via `PraxisJsonLogicService`, actions via `visibleWhen`/`disabledWhen`/`hateoasRel`/`quickView`/`globalAction`, persistence through `ASYNC_CONFIG_STORAGE`, and bidirectional frameless `visual ↔ JSON` editor (`PraxisTimelineLanesConfigEditorComponent`).
|
|
440
|
+
- **Detailed docs:** see [`praxis-timeline-lanes.json-api.md`](./src/lib/praxis-timeline-lanes.json-api.md) and [`praxis-timeline-lanes-landing.md`](./docs/praxis-timeline-lanes-landing.md).
|
|
441
|
+
|
|
442
|
+
### Axis Title Colors
|
|
443
|
+
|
|
444
|
+
The ECharts adapter applies the effective foreground text color (`theme.textColor`) to both axis tick labels and axis names across cartesian axes, including secondary axes, horizontal orientations, and scatter plots without adding raw engine properties to the public contract. Final readability depends on keeping `theme.textColor` consistent with the configured chart background.
|
|
445
|
+
|
|
446
|
+
## Multidimensional & Hierarchical Kinds (`sankey`, `sunburst` / multilevel `treemap`, `radar`)
|
|
447
|
+
|
|
448
|
+
Formalized in [`ADR-0003`](./docs/adr/0003-hierarchical-sunburst-treemap-and-sankey-links.md), [`praxis-chart.json-api.md`](./src/lib/praxis-chart.json-api.md), and [`praxis-charts-flow-hierarchy-radar-landing.md`](./docs/praxis-charts-flow-hierarchy-radar-landing.md):
|
|
449
|
+
|
|
450
|
+
- **`sankey` (Acyclic Flow & Cycle Guard):** accepts renderer-neutral `sankey.nodes` (`id`, `label`, `type`, `stage`) and `sankey.links` (`source`, `target`, `value`, `relation`, `evidence`) aligned with `<praxis-relationship-graph>` (`#668`), or 2D tabular aggregation (`sourceField`, `targetField`, `valueField`). Cycles and self-loops are detected deterministically before rendering, failing cleanly with an actionable recommendation to switch to `<praxis-relationship-graph>` (`#668`). Emits `crossFilter` on node and link clicks and exposes an accessible `Origem | Destino | Volume | %` table.
|
|
451
|
+
- **`sunburst` & multilevel `treemap`:** builds a proportional aggregated tree from ordered `dimensions[]` (`2+` levels, e.g. `['orgao', 'subempresa', 'setor']`) or explicit `path` / `parentId` / `children` data, keeping single-dimension 1D `treemap` configs unchanged. Supports interactive breadcrumb level zoom with `crossFilter` emission and hierarchical table fallback.
|
|
452
|
+
- **`radar` (Multidimensional Comparison vs. "Radar Preventivo"):** compares multiple series over `>= 3` indicators with explicit `[min, max]` bounds (`max > min`) and accessible tabular breakdown. **Semantic Disambiguation:** `kind = 'radar'` renders a geometric `RadarChart` comparing quantitative indicator axes; it must **not** be confused with business domain features/endpoints named **"Radar Preventivo"** (e.g. retirement eligibility or workforce vacancy monitoring, which map to KPIs, `gauge`, `bar`, `funnel`, or `<praxis-timeline-lanes>` unless explicitly plotting `>= 3` comparative `[min, max]` indicators).
|
|
453
|
+
|
|
454
|
+
## Micro-KPI Strip, Monthly Normalization & Override Sanitization
|
|
455
|
+
|
|
456
|
+
- **`PraxisMicroKpiStripComponent` & `providePraxisMicroKpiStripMetadata()`:** Integrated into `PraxisAnalyticsCockpitComponent` using `switchMap`, bounded TTL caching isolated per enterprise context/tenant/user (`EnterpriseRuntimeContextService`, `cacheScope`, `WeakMap` fetcher identity), `retry()`/`invalidateCache()`, non-interactive `<div>` cards when a KPI filter is empty, non-clobbering merge of cockpit widget and KPI cross-filters, and `aria-live="polite"` announcements. Switching or toggling active KPI filters removes prior KPI filter keys cleanly without leaking stale criteria.
|
|
457
|
+
- **Monthly & Calendar Normalization:** `normalizeYearMonthToken` (`'YYYY-MM'`), `normalizeMonthlyFilterValues` (`['YYYY-MM']`), `expandMonthlyRangeToIsoDates` (`['YYYY-MM-01', 'YYYY-MM-lastDay']`), and date-part extractors validate UTC calendar dates for timestamps and ISO strings, rejecting impossible dates (such as February 31) and formatting date tokens in a single-pass tokenizer respecting quoted literals.
|
|
458
|
+
- **Visual Overrides & Projection Eligibility:** `sanitizeChartDocumentOverride` and `sanitizeChartDocumentOverridesMap` recursively strip `source`, `dataSource`, `query`, `data`, prototype-pollution keys, empty nested containers/arrays, and circular references across nested structures while preserving DAG-shared visual branches; projection selectors surface proactive family eligibility hints when dataset shape constrains available chart kinds and suppress misleading fallback indicators on the active projection.
|
|
459
|
+
|
|
460
|
+
## Governed Executive KPIs (`<praxis-kpi-strip>` & `<praxis-kpi-card>`)
|
|
461
|
+
|
|
462
|
+
- **Runtime & Unified Stats Bus:** `<praxis-kpi-strip>` (`PraxisKpiStripConfig`) and `<praxis-kpi-card>` (`PraxisKpiCardSpec`, supporting `[config]` and `[card]`) execute `verified-recipe`, `stats-query`, and `analytics-projection` cards through `@praxisui/core` `PraxisStatsExecutionService` with automatic query deduplication, 3-channel `PraxisDataQueryContext` anti-feedback-loop filtering, inline `@praxisui/core/micro-visualization` renderers, and fail-closed epistemic/k-anonymity state handling.
|
|
463
|
+
- **Interactive Cross-Filter & Switching Lifecycle Contracts:** `PraxisKpiInteractionSpec['crossFilter']` supports explicit `cardinality` (`'scalar' | 'list'`) and `dimensionField` metadata; `stackedBar` composition cards perform incremental member removal on multi-value filters with clickable active-filter pills (`activate`) and atomic alias-key clearing in `filterPatch`; `<praxis-chart>` reconciles its active single-point selection against `queryContext.meta.crossFilterSources` (including singular/plural dimension aliases) without resetting on echo or triggering redundant remote reloads; and `<praxis-kpi-card>`, `<praxis-analytics-presentation>`, and `<praxis-chart>` honor `EnterpriseRuntimeContextService.isSwitching` and `state === 'ready'` so mid-switch mounts never fire premature queries.
|
|
464
|
+
- **2-Level Visual Authoring & AI Governance:** `PraxisKpiStripConfigEditorComponent` and `PraxisKpiCardConfigEditorComponent` integrate with `@praxisui/settings-panel` and Page Builder (`SettingsValueProvider`), exposing 10 strip / 6 card governed authoring operations via `PRAXIS_KPI_STRIP_AUTHORING_MANIFEST` and `PRAXIS_KPI_CARD_AUTHORING_MANIFEST`.
|
|
465
|
+
- **Detailed docs:** see [`praxis-kpi.json-api.md`](./src/lib/praxis-kpi.json-api.md).
|
|
466
|
+
|
|
467
|
+
## Statistical Inference, Uncertainty Primitives, Anomaly Scans & Epistemic Provenance
|
|
468
|
+
|
|
469
|
+
- **Canonical `'inference' | 'anomalies'` Operations:** `PraxisXUiChartStatsOperation`, `ChartCanonicalContractMapperService`, `ChartStatsApiService`, and `ChartResourceCapabilityCatalogAdapter` support `'inference'` (`PraxisAnalyticsInferenceStatsRequest`) and `'anomalies'` (`PraxisAnalyticsAnomalyScanStatsRequest`) stats sources alongside resource capability flags (`stats.inference`, `stats.anomalies`), normalizing `groupKey`/`cohortKey`/`opaqueEntityKey`/`findingId` response records and preserving `suppressionStatus`, backend `provenance`, and `modelCard` envelopes across cloning.
|
|
470
|
+
- **Line & Statistical Interval Primitives (`confidenceBands`, `lineStyle`, `step`, `connectNulls`, `errorBar`):** Metrics support dashed/dotted line styles, discrete step transitions (`'start' | 'middle' | 'end'`, automatically disabling curve smoothing), nested `confidenceBands` (`<= 3` per metric via ECharts `CustomChart` on non-stacked line/area series), and `errorBar` whiskers (`bar`, `horizontal-bar`, `line`, `scatter`, and `combo`, rejected on `stacked-bar` and `stacked-area`). Inverted interval bounds (`lower > upper`) fail closed (`confidence-band-inverted-bounds` / `error-bar-inverted-bounds`), continuous-series slots with k-anonymity suppression force `connectNulls: false` with `"Suppressed (k-anonymity)"` labels, and the accessible data panel exposes intervals in an `Interval / Band` column. See [`praxis-charts-uncertainty-epistemic-landing.md`](./docs/praxis-charts-uncertainty-epistemic-landing.md).
|
|
471
|
+
- **Frameless Epistemic & Fail-Closed Presentation:** `PraxisChartComponent` exposes `epistemicBadgeVariant` (`'compact' | 'detailed'`, default `'compact'`), merges static `document.epistemicMeta` with live response metadata (`readAnalyticsEpistemicMetadata`) or fail-closed HTTP/engine error states (`deriveFailClosedEpistemicMetaFromError`), automatically infers `suppressedCellCount` when derived datasets contain suppressed rows, and renders `<praxis-epistemic-badge>` without framing boilerplate while preserving `epistemicMeta`, `epistemicBadgeVariant`, and `'inference' | 'anomalies'` round-trips across editors and `PRAXIS_CHARTS_AUTHORING_MANIFEST`.
|
|
472
|
+
|
|
473
|
+
## ECharts 6 Core Capabilities (`matrix-grid`, `range-comparison`, `beeswarm`, `parallel`, `chord`)
|
|
398
474
|
|
|
399
|
-
|
|
475
|
+
- **5 Domain-Neutral Chart Kinds:** `<praxis-chart>` extends `PraxisXUiChartKind` to 26 kinds without exposing raw `EChartsOption`: `matrix-grid` (2D/3D categorical grid), `range-comparison` (min/current/target dumbbell intervals), `beeswarm` (non-overlapping jitter scatter), `parallel` (multivariate coordinate axes), and `chord` (relational origin-to-target flow).
|
|
476
|
+
- **Declarative Transversal Overlays & Coordination:** Supports pulsing `targetMarkers` (`emphasis: 'pulse'`), directional `trajectory` step paths, LGPD-safe area brushing (`brushSelection` -> `(brushSelect)` & `PRAXIS_BULK_PROPOSAL_BRIDGE`), `timeline` frame playback with `universalTransition`, refcounted `syncGroup` pointer synchronization, `'simulation' | 'counterfactual'` stats operations, and automatic static degradation under `prefers-reduced-motion: reduce`.
|
|
400
477
|
|
|
401
478
|
<!-- praxis-npm-catalog-links:start -->
|
|
402
479
|
## Official documentation and examples
|