@praxisui/charts 10.0.0-rc.62 → 10.0.0-rc.64

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 CHANGED
@@ -317,33 +317,25 @@ When `queryContext`, `filterCriteria`, or `data` changes for the same governed c
317
317
 
318
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.
319
319
 
320
- `PraxisMicroVisualizationComponent` renders the first renderer-neutral presentation visualizations from `@praxisui/core`.
321
- It is intended for compact presentation surfaces, especially table cells, list items and read-only form summaries.
322
-
323
- The table-safe kinds currently aligned with `PraxisPresentationVisualizationKind` are:
324
-
325
- - `line`
326
- - `area`
327
- - `column`
328
- - `comparison`
329
- - `stackedBar`
330
- - `radial`
331
- - `harveyBall`
332
- - `bullet`
333
- - `delta`
334
- - `processFlow`
335
- - `waterfall` (compact flow bridges for cards and `kpiBand`)
336
-
337
- The component does not instantiate ECharts. It renders lightweight HTML/CSS/SVG from `PraxisPresentationVisualizationConfig`
338
- and falls back to `fallbackText` when the visualization kind cannot be rendered for the current compact surface.
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"`.
321
+
322
+ The supported `PraxisPresentationVisualizationKind` matrix is split across a hybrid platform architecture:
323
+
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.
329
+
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.
339
331
  Use `points` as the canonical numeric series for `line`, `area`, `column`, and `comparison` (accepting raw numbers or `{ value, label }` points);
340
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'`).
341
- For `line`, `area`, and `column`, optional `min`/`max` bounds control the vertical domain, `target` and `baseline` render dashed horizontal reference lines inside the SVG plot, and `valueSuffix` appends a unit suffix to readouts and endpoint labels.
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.
342
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.
343
- On non-`table-cell` surfaces (`list-item`, `object-header`, `card-summary`, `form-presentation`), multi-item visualizations (`stackedBar`, `comparison`, `line`, `area`, `column`, `processFlow`) expose a single keyboard stop (`tabindex="0"`) on the figure container supporting `ArrowLeft`/`ArrowRight`/`ArrowUp`/`ArrowDown`/`Home`/`End`/`Escape` scrubbing with polite `aria-live` announcements, while `surface: 'table-cell'` or `[interactiveContainer]="true"` (when nested inside a clickable KPI card) keeps zero internal `tabindex` stops so grid/card keyboard navigation remains unobstructed.
344
- 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 and form presentation surfaces.
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.
345
337
 
346
- Neutral micro visualizations inherit foreground from their container unless the existing `--prx-micro-text-color` token overrides it. 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 `3rem` (`size: 'sm'`) with side caption/target metadata or `5.5rem` (`size: 'md'` / `'responsive'`) with an inner medallion subtitle, while `table-cell` indicators retain their compact `24px` geometry.
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.
347
339
 
348
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.
349
341
 
@@ -371,7 +363,7 @@ Visual authoring now consumes this projection, and the backend handler, resolver
371
363
 
372
364
  ## Public API Snapshot
373
365
 
374
- 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`.
375
367
 
376
368
  ## Official Links
377
369
 
@@ -465,6 +457,12 @@ Formalized in [`ADR-0003`](./docs/adr/0003-hierarchical-sunburst-treemap-and-san
465
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.
466
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.
467
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
+ - **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`.
464
+ - **Detailed docs:** see [`praxis-kpi.json-api.md`](./src/lib/praxis-kpi.json-api.md).
465
+
468
466
  <!-- praxis-npm-catalog-links:start -->
469
467
  ## Official documentation and examples
470
468