@praxisui/charts 10.0.0-rc.4 → 10.0.0-rc.41
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 +44 -5
- package/ai/component-registry.json +309 -23
- package/fesm2022/praxisui-charts.mjs +11298 -5760
- package/package.json +3 -3
- package/types/praxisui-charts.d.ts +417 -23
package/README.md
CHANGED
|
@@ -257,6 +257,39 @@ follows the host. Palette inheritance is preserved. Explicit chart surface/backg
|
|
|
257
257
|
and text colors remain authoritative; choosing them requires a coherent contrast pair.
|
|
258
258
|
Changing the host theme updates inherited colors without modifying the chart document.
|
|
259
259
|
|
|
260
|
+
Existing color strings in palette arrays, metric/series colors, surface backgrounds,
|
|
261
|
+
text colors and gauge bands can reference host CSS custom properties (for example,
|
|
262
|
+
`var(--md-sys-color-primary, #1263b4)`). The default engine resolves them against the
|
|
263
|
+
chart host on every render and projects modern CSS colors such as OKLCH into sRGB
|
|
264
|
+
for Canvas. Explicit literal colors and palette overrides retain precedence. Missing
|
|
265
|
+
or invalid tokens use bounded engine defaults; gauge bands retain their semantic
|
|
266
|
+
tone fallback. Persisted documents and source data remain unchanged. A string
|
|
267
|
+
`theme.palette` in `x-ui.chart` still names a registered Praxis palette; use an array
|
|
268
|
+
for individual CSS colors.
|
|
269
|
+
|
|
270
|
+
Palette array items must be non-empty strings; malformed persisted values are
|
|
271
|
+
rejected by canonical validation with the item path. Direct runtime color fields
|
|
272
|
+
also fall back safely when untyped JSON supplies another value type. Color probes
|
|
273
|
+
isolate their measured color from host CSS rules, including rules with `!important`.
|
|
274
|
+
|
|
275
|
+
The engine also derives tooltip background, foreground and border from the host's
|
|
276
|
+
existing popover roles, with card/foreground and Material fallbacks. Tooltip
|
|
277
|
+
formatting, triggers and disabled state keep their authored semantics; these
|
|
278
|
+
computed appearance values are transient and never saved into the chart document.
|
|
279
|
+
|
|
280
|
+
### Governed Motion and Data Transitions
|
|
281
|
+
|
|
282
|
+
`PraxisChartConfig.motion` and `PraxisXUiChartContract.motion` govern both initial entrance animations and data/filter transition animations without exposing raw engine timing properties:
|
|
283
|
+
|
|
284
|
+
- `enabled: false`: disables initial and update animations (`animationThreshold: 0`).
|
|
285
|
+
- `preset: 'subtle'`: fast, understated corporate cadence (`240ms` entrance, `200ms` update, `cubicOut`, `animationThreshold: 1000`).
|
|
286
|
+
- `preset: 'standard'` (default when motion is enabled): balanced analytical transition (`420ms` entrance, `320ms` update, `cubicOut` / `cubicInOut`, `animationThreshold: 1500`).
|
|
287
|
+
- `preset: 'expressive'`: emphasized storytelling cadence (`680ms` entrance, `520ms` update, `quinticOut` / `cubicInOut`, `animationThreshold: 2000`).
|
|
288
|
+
|
|
289
|
+
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.
|
|
290
|
+
|
|
291
|
+
`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.
|
|
292
|
+
|
|
260
293
|
## Micro Visualizations
|
|
261
294
|
|
|
262
295
|
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.
|
|
@@ -277,10 +310,12 @@ The table-safe kinds currently aligned with `PraxisPresentationVisualizationKind
|
|
|
277
310
|
- `delta`
|
|
278
311
|
- `processFlow`
|
|
279
312
|
|
|
280
|
-
The component does not instantiate ECharts. It renders lightweight HTML/CSS from `PraxisPresentationVisualizationConfig`
|
|
313
|
+
The component does not instantiate ECharts. It renders lightweight HTML/CSS/SVG from `PraxisPresentationVisualizationConfig`
|
|
281
314
|
and falls back to `fallbackText` when the visualization kind cannot be rendered for the current compact surface.
|
|
282
|
-
Use `points` as the canonical numeric series for `line`, `area`, `column`, and `comparison
|
|
315
|
+
Use `points` as the canonical numeric series for `line`, `area`, `column`, and `comparison` (accepting raw numbers or `{ value, label }` points);
|
|
283
316
|
use `segments` for `stackedBar`, `thresholds` for `bullet`, and `items` for item/step-oriented visualizations such as `processFlow`.
|
|
317
|
+
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 the interactive HUD pill and last-value badge.
|
|
318
|
+
On non-`table-cell` surfaces (`list-item`, `object-header`, `card-summary`, `form-presentation`), `line`, `area`, and `column` expose a single keyboard stop (`tabindex="0"`) on the figure container supporting `ArrowLeft`/`ArrowRight`/`Home`/`End`/`Escape` point scrubbing with polite `aria-live` announcements, while `surface: 'table-cell'` keeps zero internal `tabindex` stops so table grid navigation remains unobstructed.
|
|
284
319
|
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.
|
|
285
320
|
|
|
286
321
|
Neutral micro visualizations inherit foreground from their container unless the existing `--prx-micro-text-color` token overrides it. Radial indicators with `surface: 'card-summary'` and `size: 'md'` or `'responsive'` render at 6rem; table-cell indicators retain their compact 24px geometry. This materializes existing surface/size semantics without changing the configuration shape.
|
|
@@ -291,13 +326,17 @@ The Dynamic Page Lab's preset studio includes “Testar com componentes reais”
|
|
|
291
326
|
|
|
292
327
|
`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.
|
|
293
328
|
|
|
294
|
-
|
|
329
|
+
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`.
|
|
330
|
+
|
|
331
|
+
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.
|
|
295
332
|
|
|
296
333
|
`ChartResourceCapabilityCatalogAdapter` derives resource operations and eligible dimension, time and metric options directly from `ResourceCapabilitySnapshot`, including fail-closed comparison eligibility.
|
|
297
334
|
|
|
298
|
-
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.
|
|
335
|
+
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.
|
|
336
|
+
|
|
337
|
+
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.
|
|
299
338
|
|
|
300
|
-
|
|
339
|
+
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 }`).
|
|
301
340
|
|
|
302
341
|
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.
|
|
303
342
|
|