@praxisui/charts 10.0.0-rc.3 → 10.0.0-rc.31

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
@@ -257,6 +257,26 @@ 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
+
260
280
  ## Micro Visualizations
261
281
 
262
282
  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.
@@ -291,13 +311,17 @@ The Dynamic Page Lab's preset studio includes “Testar com componentes reais”
291
311
 
292
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.
293
313
 
294
- For the direct runtime editor, Apply updates the chart and emits `chartDocumentApplied`; Save emits `chartDocumentSaved`. Both also emit `chartDocumentPatchChange` with an independent `inputPatch.chartDocument` snapshot for dynamic widget hosts. Dynamic Page/Page Builder updates its authored page, so Apply followed by Save Page preserves the canonical document. Apply alone does not persist the page remotely. Unrelated widget inputs and transient catalogs remain owned by their existing host/context boundaries.
314
+ 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`.
315
+
316
+ 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
317
 
296
318
  `ChartResourceCapabilityCatalogAdapter` derives resource operations and eligible dimension, time and metric options directly from `ResourceCapabilitySnapshot`, including fail-closed comparison eligibility.
297
319
 
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.
320
+ 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.
321
+
322
+ 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
323
 
300
- Capabilities are loaded lazily from the exact catalog-published endpoint only after resource selection. Concurrent catalog and per-resource capability reads are deduplicated in flight and bounded by a 10-second 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. `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.
324
+ 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
325
 
302
326
  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
327
 
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "schemaVersion": "1.0.0",
3
- "generatedAt": "2026-10-07T02:07:06.204Z",
3
+ "generatedAt": "2026-10-16T17:45:27.774Z",
4
4
  "packageName": "@praxisui/charts",
5
- "packageVersion": "10.0.0-rc.3",
5
+ "packageVersion": "10.0.0-rc.31",
6
6
  "sourceRegistry": "praxis-component-registry-ingestion",
7
7
  "sourceRegistryVersion": "1.0.0",
8
- "componentCount": 3,
8
+ "componentCount": 4,
9
9
  "components": {
10
10
  "praxis-analytics-presentation": {
11
11
  "id": "praxis-analytics-presentation",
@@ -424,6 +424,13 @@
424
424
  }
425
425
  }
426
426
  },
427
+ {
428
+ "name": "resourceKey",
429
+ "type": "string | null",
430
+ "required": false,
431
+ "description": "Canonical resource identifier used to automatically discover and execute /stats services on the Praxis backend.",
432
+ "default": null
433
+ },
427
434
  {
428
435
  "name": "data",
429
436
  "type": "PraxisChartDataRow[]",
@@ -687,6 +694,22 @@
687
694
  "group": "config"
688
695
  }
689
696
  },
697
+ {
698
+ "id": "resourceKey",
699
+ "label": "Resource Key",
700
+ "direction": "input",
701
+ "semanticKind": "value",
702
+ "description": "Canonical resource identifier used to automatically discover and execute /stats services on the Praxis backend.",
703
+ "schema": {
704
+ "id": "string",
705
+ "kind": "ts-type",
706
+ "ref": "string"
707
+ },
708
+ "exposure": {
709
+ "public": true,
710
+ "group": "data"
711
+ }
712
+ },
690
713
  {
691
714
  "id": "pointClick",
692
715
  "label": "Point Click",
@@ -1244,7 +1267,6 @@
1244
1267
  }
1245
1268
  ],
1246
1269
  "configEditor": {
1247
- "component": "[ref:PraxisChartWidgetConfigEditor]",
1248
1270
  "title": "Configure chart"
1249
1271
  },
1250
1272
  "authoringManifestRef": {
@@ -3547,9 +3569,9 @@
3547
3569
  {
3548
3570
  "chunkIndex": 0,
3549
3571
  "chunkKind": "summary",
3550
- "content": "Component ID: praxis-chart\nSelector: praxis-chart\nFriendly Name: Praxis Chart\nDescription: Chart component for analytics and metadata-driven visualizations in Praxis UI.\nLib/Package: @praxisui/charts\nTags: chart, analytics, widget, visualization\nInputs:\n - config (PraxisChartConfig)\n - data (PraxisChartDataRow[])\n - chartDocument (PraxisXUiChartContract | null)\n - queryContext (PraxisDataQueryContext | null)\n - remoteDataResolver (PraxisChartRemoteDataResolver | null)\n - filterCriteria (Record<string, unknown> | null)\n - enableCustomization (boolean)\n - availableResources (ReadonlyArray<ChartEditorResourceOption>)\n - availableFields (ReadonlyArray<ChartEditorFieldOption>)\n - availableTargets (ReadonlyArray<ChartEditorTargetOption>)\nOutputs:\n - pointClick (PraxisChartPointEvent)\n - pointAction (PraxisChartPointActionEvent)\n - selectionChange (PraxisChartSelectionEvent)\n - drillDown (PraxisChartDrillDownEvent)\n - crossFilter (PraxisChartCrossFilterEvent)\n - queryRequest (PraxisChartQueryRequestEvent)\n - loadStateChange (PraxisChartLoadState)\n - chartDocumentApplied (PraxisXUiChartContract)\n - chartDocumentSaved (PraxisXUiChartContract)\n - chartDocumentPatchChange (PraxisChartDocumentPatchChangeEvent)\nInsertion Presets:\n - canonical-chart: Canonical chart - Creates a chart widget from the canonical x-ui.chart authoring document.\n",
3572
+ "content": "Component ID: praxis-chart\nSelector: praxis-chart\nFriendly Name: Praxis Chart\nDescription: Chart component for analytics and metadata-driven visualizations in Praxis UI.\nLib/Package: @praxisui/charts\nTags: chart, analytics, widget, visualization\nInputs:\n - config (PraxisChartConfig)\n - resourceKey (string | null)\n - data (PraxisChartDataRow[])\n - chartDocument (PraxisXUiChartContract | null)\n - queryContext (PraxisDataQueryContext | null)\n - remoteDataResolver (PraxisChartRemoteDataResolver | null)\n - filterCriteria (Record<string, unknown> | null)\n - enableCustomization (boolean)\n - availableResources (ReadonlyArray<ChartEditorResourceOption>)\n - availableFields (ReadonlyArray<ChartEditorFieldOption>)\n - availableTargets (ReadonlyArray<ChartEditorTargetOption>)\nOutputs:\n - pointClick (PraxisChartPointEvent)\n - pointAction (PraxisChartPointActionEvent)\n - selectionChange (PraxisChartSelectionEvent)\n - drillDown (PraxisChartDrillDownEvent)\n - crossFilter (PraxisChartCrossFilterEvent)\n - queryRequest (PraxisChartQueryRequestEvent)\n - loadStateChange (PraxisChartLoadState)\n - chartDocumentApplied (PraxisXUiChartContract)\n - chartDocumentSaved (PraxisXUiChartContract)\n - chartDocumentPatchChange (PraxisChartDocumentPatchChangeEvent)\nInsertion Presets:\n - canonical-chart: Canonical chart - Creates a chart widget from the canonical x-ui.chart authoring document.\n",
3551
3573
  "sourcePointer": "projects/praxis-charts/src/lib/praxis-chart.metadata.ts",
3552
- "contentHash": "2ca641ce6260ffda9f9278a77c49b6538d96b1bf61640cf269ba510b521af788",
3574
+ "contentHash": "e1c99961aba854e05112df6c72c6dd3d90a1d9ef8bc3b8d03c5f956f624835cc",
3553
3575
  "sourceKind": "component_definition",
3554
3576
  "sourceId": "praxis-chart",
3555
3577
  "corpusVersion": "1.0.0"
@@ -3839,6 +3861,181 @@
3839
3861
  "corpusVersion": "1.0.0"
3840
3862
  }
3841
3863
  ]
3864
+ },
3865
+ "praxis-micro-visualization": {
3866
+ "id": "praxis-micro-visualization",
3867
+ "description": "Renderiza micro-visualizações ultraleves e autônomas (bullet, radial, sparkline, processFlow, comparison, etc.) como widget independente no canvas ou célula.",
3868
+ "inputs": [
3869
+ {
3870
+ "name": "visualization",
3871
+ "type": "PraxisPresentationVisualizationConfig",
3872
+ "required": false,
3873
+ "description": "Configuração estruturada da micro-visualização (kind, value, target, points, thresholds, tone, etc.).",
3874
+ "default": {
3875
+ "kind": "radial",
3876
+ "value": 75,
3877
+ "total": 100,
3878
+ "tone": "primary",
3879
+ "fallbackText": "75%"
3880
+ }
3881
+ },
3882
+ {
3883
+ "name": "fallbackText",
3884
+ "type": "string",
3885
+ "required": false,
3886
+ "description": "Texto exibido caso a visualização não seja suportada ou esteja em fallback.",
3887
+ "default": ""
3888
+ }
3889
+ ],
3890
+ "outputs": [],
3891
+ "configSchemaId": null,
3892
+ "selector": "praxis-micro-visualization",
3893
+ "friendlyName": "Micro-visualização Analítica",
3894
+ "icon": "ssid_chart",
3895
+ "tags": [
3896
+ "chart",
3897
+ "analytics",
3898
+ "widget",
3899
+ "microchart",
3900
+ "visualization",
3901
+ "sparkline",
3902
+ "bullet",
3903
+ "radial"
3904
+ ],
3905
+ "lib": "@praxisui/charts",
3906
+ "insertionPresets": [
3907
+ {
3908
+ "id": "bullet-kpi",
3909
+ "label": "Bullet Graph KPI",
3910
+ "description": "Microchart do tipo bullet com faixas de tolerância e valor meta.",
3911
+ "icon": "linear_scale",
3912
+ "inputs": {
3913
+ "visualization": {
3914
+ "kind": "bullet",
3915
+ "value": 78,
3916
+ "target": 90,
3917
+ "total": 100,
3918
+ "tone": "success",
3919
+ "fallbackText": "Performance Operacional",
3920
+ "thresholds": [
3921
+ {
3922
+ "value": 50,
3923
+ "tone": "danger",
3924
+ "label": "Crítico"
3925
+ },
3926
+ {
3927
+ "value": 75,
3928
+ "tone": "warning",
3929
+ "label": "Atenção"
3930
+ },
3931
+ {
3932
+ "value": 100,
3933
+ "tone": "success",
3934
+ "label": "Ideal"
3935
+ }
3936
+ ]
3937
+ }
3938
+ }
3939
+ },
3940
+ {
3941
+ "id": "radial-score",
3942
+ "label": "Radial Score",
3943
+ "description": "Medidor circular compacto de pontuação ou progresso percentual.",
3944
+ "icon": "radio_button_checked",
3945
+ "inputs": {
3946
+ "visualization": {
3947
+ "kind": "radial",
3948
+ "value": 85,
3949
+ "total": 100,
3950
+ "tone": "primary",
3951
+ "fallbackText": "Prontidão: 85%"
3952
+ }
3953
+ }
3954
+ },
3955
+ {
3956
+ "id": "sparkline-area",
3957
+ "label": "Sparkline de Tendência (Área)",
3958
+ "description": "Minigráfico contínuo de área para visualização de tendência temporal.",
3959
+ "icon": "show_chart",
3960
+ "inputs": {
3961
+ "visualization": {
3962
+ "kind": "area",
3963
+ "tone": "info",
3964
+ "points": [
3965
+ {
3966
+ "value": 12,
3967
+ "label": "Jan"
3968
+ },
3969
+ {
3970
+ "value": 19,
3971
+ "label": "Fev"
3972
+ },
3973
+ {
3974
+ "value": 15,
3975
+ "label": "Mar"
3976
+ },
3977
+ {
3978
+ "value": 27,
3979
+ "label": "Abr"
3980
+ },
3981
+ {
3982
+ "value": 34,
3983
+ "label": "Mai"
3984
+ }
3985
+ ],
3986
+ "fallbackText": "Tendência Trimestral"
3987
+ }
3988
+ }
3989
+ },
3990
+ {
3991
+ "id": "process-flow",
3992
+ "label": "Fluxo de Etapas (Process Flow)",
3993
+ "description": "Indicador visual compacto de etapas sequenciais ou esteira de estados.",
3994
+ "icon": "route",
3995
+ "inputs": {
3996
+ "visualization": {
3997
+ "kind": "processFlow",
3998
+ "points": [
3999
+ {
4000
+ "label": "Triagem",
4001
+ "icon": "check",
4002
+ "tone": "success"
4003
+ },
4004
+ {
4005
+ "label": "Análise",
4006
+ "icon": "sync",
4007
+ "tone": "info"
4008
+ },
4009
+ {
4010
+ "label": "Aprovação",
4011
+ "icon": "schedule",
4012
+ "tone": "warning"
4013
+ },
4014
+ {
4015
+ "label": "Conclusão",
4016
+ "icon": "flag",
4017
+ "tone": "neutral"
4018
+ }
4019
+ ],
4020
+ "fallbackText": "Etapa 2/4: Em Análise"
4021
+ }
4022
+ }
4023
+ }
4024
+ ],
4025
+ "source": "projects/praxis-charts/src/lib/praxis-micro-visualization.metadata.ts",
4026
+ "exportName": "PRAXIS_MICRO_VISUALIZATION_COMPONENT_METADATA",
4027
+ "chunks": [
4028
+ {
4029
+ "chunkIndex": 0,
4030
+ "chunkKind": "summary",
4031
+ "content": "Component ID: praxis-micro-visualization\nSelector: praxis-micro-visualization\nFriendly Name: Micro-visualização Analítica\nDescription: Renderiza micro-visualizações ultraleves e autônomas (bullet, radial, sparkline, processFlow, comparison, etc.) como widget independente no canvas ou célula.\nLib/Package: @praxisui/charts\nTags: chart, analytics, widget, microchart, visualization, sparkline, bullet, radial\nInputs:\n - visualization (PraxisPresentationVisualizationConfig)\n - fallbackText (string)\nInsertion Presets:\n - bullet-kpi: Bullet Graph KPI - Microchart do tipo bullet com faixas de tolerância e valor meta.\n - radial-score: Radial Score - Medidor circular compacto de pontuação ou progresso percentual.\n - sparkline-area: Sparkline de Tendência (Área) - Minigráfico contínuo de área para visualização de tendência temporal.\n - process-flow: Fluxo de Etapas (Process Flow) - Indicador visual compacto de etapas sequenciais ou esteira de estados.\n",
4032
+ "sourcePointer": "projects/praxis-charts/src/lib/praxis-micro-visualization.metadata.ts",
4033
+ "contentHash": "455a9d78d9176e7b267f6cb9f0a511dffd981c889b810b09ea1b45952512d060",
4034
+ "sourceKind": "component_definition",
4035
+ "sourceId": "praxis-micro-visualization",
4036
+ "corpusVersion": "1.0.0"
4037
+ }
4038
+ ]
3842
4039
  }
3843
4040
  },
3844
4041
  "note": "Package-scoped Praxis component registry for source-free agent discovery. Use the canonical ingestion registry for cross-package aggregate analysis."