@praxisui/charts 8.0.0-beta.0 → 8.0.0-beta.100
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 +77 -10
- package/fesm2022/praxisui-charts.mjs +4861 -3492
- package/package.json +13 -8
- package/{index.d.ts → types/praxisui-charts.d.ts} +136 -30
package/README.md
CHANGED
|
@@ -57,6 +57,8 @@ import {
|
|
|
57
57
|
<praxis-chart
|
|
58
58
|
[config]="config"
|
|
59
59
|
(pointClick)="onPointClick($event)"
|
|
60
|
+
(selectionChange)="onSelectionChange($event)"
|
|
61
|
+
(crossFilter)="onCrossFilter($event)"
|
|
60
62
|
></praxis-chart>
|
|
61
63
|
`,
|
|
62
64
|
})
|
|
@@ -95,11 +97,39 @@ export class ChartDemoComponent {
|
|
|
95
97
|
name: 'Employees',
|
|
96
98
|
},
|
|
97
99
|
],
|
|
100
|
+
interactions: {
|
|
101
|
+
pointClick: true,
|
|
102
|
+
selection: true,
|
|
103
|
+
crossFilter: true,
|
|
104
|
+
eventActions: {
|
|
105
|
+
selectionChange: {
|
|
106
|
+
action: 'emit',
|
|
107
|
+
mapping: {
|
|
108
|
+
department: 'department',
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
crossFilter: {
|
|
112
|
+
action: 'filter-widget',
|
|
113
|
+
target: 'employeesTable',
|
|
114
|
+
mapping: {
|
|
115
|
+
department: 'department',
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
},
|
|
98
120
|
};
|
|
99
121
|
|
|
100
122
|
onPointClick(event: PraxisChartPointEvent) {
|
|
101
123
|
console.log('chart point', event);
|
|
102
124
|
}
|
|
125
|
+
|
|
126
|
+
onSelectionChange(event: unknown) {
|
|
127
|
+
console.log('chart selection', event);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
onCrossFilter(event: unknown) {
|
|
131
|
+
console.log('chart filters', event);
|
|
132
|
+
}
|
|
103
133
|
}
|
|
104
134
|
```
|
|
105
135
|
|
|
@@ -107,7 +137,7 @@ export class ChartDemoComponent {
|
|
|
107
137
|
|
|
108
138
|
- standalone components for charts, drilldown panel and runtime probe
|
|
109
139
|
- the initial standalone chart config editor shell for `x-ui.chart`
|
|
110
|
-
- chart contracts such as `PraxisChartConfig`, `PraxisChartDataSource` and `
|
|
140
|
+
- chart contracts such as `PraxisChartConfig`, `PraxisChartDataSource`, `PraxisChartPointEvent`, `PraxisChartSelectionEvent` and `PraxisChartCrossFilterEvent`
|
|
111
141
|
- providers and tokens for chart engine composition
|
|
112
142
|
- services for canonical mapping, backend payload adaptation and option building
|
|
113
143
|
|
|
@@ -123,7 +153,8 @@ O runtime de `@praxisui/charts` opera em duas trilhas principais:
|
|
|
123
153
|
No modo remoto, o componente:
|
|
124
154
|
|
|
125
155
|
- emite `queryRequest`
|
|
126
|
-
-
|
|
156
|
+
- usa `remoteDataResolver` quando o host fornece um resolvedor governado
|
|
157
|
+
- usa `PraxisChartStatsApiService` como resolvedor padrão para `praxis.stats`
|
|
127
158
|
- transforma a resposta agregada em `PraxisChartDataRow[]`
|
|
128
159
|
- renderiza o estado `loading`, `empty`, `error` ou `ready`
|
|
129
160
|
|
|
@@ -296,21 +327,22 @@ O mapper `x-ui.chart -> PraxisChartConfig` aplica as restrições públicas abai
|
|
|
296
327
|
|
|
297
328
|
- `source.kind` aceitos: `praxis.stats` e `derived`
|
|
298
329
|
- `source.kind = "praxis.stats"` exige `source.resource` e `source.operation`
|
|
299
|
-
- agregações aceitas: `count`, `sum`, `avg`, `min`, `max`
|
|
300
|
-
- `
|
|
330
|
+
- agregações aceitas: `count`, `distinct-count`, `sum`, `avg`, `min`, `max`
|
|
331
|
+
- `source.options.granularity` em `timeseries` aceita `day`, `week` e `month`
|
|
301
332
|
- charts `pie` e `donut` aceitam apenas uma métrica
|
|
302
333
|
- charts cartesianos `praxis.stats` podem declarar múltiplas métricas apenas em `group-by` e `timeseries`
|
|
303
334
|
- `distribution` aceita apenas uma métrica
|
|
304
335
|
- `combo` exige pelo menos duas métricas e, no modo `praxis.stats`, suporta apenas `group-by` ou `timeseries`
|
|
305
336
|
- `axis: "secondary"` é exclusivo de `combo`
|
|
306
|
-
- `selectionChange` e `crossFilter` declarativos
|
|
337
|
+
- `selectionChange` e `crossFilter` declarativos geram payloads canônicos derivados da seleção de ponto
|
|
338
|
+
- `events.*.mapping` remapeia campos do ponto selecionado para os nomes de filtro esperados pelo host
|
|
307
339
|
- `theme.variant` aceita `default`, `compact` e `executive`
|
|
308
340
|
- `theme.palette` aceita array explícito de cores ou os tokens registrados `brand-primary`, `brand-balanced`, `status` e `executive`
|
|
309
341
|
- campos explícitos de `theme.surface` têm precedência sobre os defaults aplicados por `theme.variant`
|
|
310
342
|
|
|
311
343
|
## Fluxo Canonico de `praxis.stats`
|
|
312
344
|
|
|
313
|
-
Quando o contrato remoto vem do mapper canônico, o caminho gerado
|
|
345
|
+
Quando o contrato remoto vem do mapper canônico, o caminho gerado segue a forma:
|
|
314
346
|
|
|
315
347
|
- `{resourcePath}/stats/group-by`
|
|
316
348
|
- `{resourcePath}/stats/timeseries`
|
|
@@ -327,7 +359,8 @@ Observação importante:
|
|
|
327
359
|
|
|
328
360
|
- a integração remota usa envelope com `data`
|
|
329
361
|
- `queryRequest` é emitido para observabilidade do host antes da execução remota
|
|
330
|
-
-
|
|
362
|
+
- `remoteDataResolver` permite que o host assuma a execução remota e entregue `PraxisChartDataRow[]`
|
|
363
|
+
- sem `remoteDataResolver`, a execução remota padrão permanece limitada a `praxis.stats`
|
|
331
364
|
- a trilha canônica `x-ui.chart -> PraxisChartConfig -> praxis.stats` já promove múltiplas métricas para charts cartesianos suportados; para evitar semântica enganosa, `combo` segue sendo o único caso com eixo secundário e mistura heterogênea de séries
|
|
332
365
|
|
|
333
366
|
## Current Scope
|
|
@@ -342,14 +375,48 @@ This first published version is focused on the core runtime:
|
|
|
342
375
|
- basic settings-panel-compatible authoring shell focused on canonical `x-ui.chart`
|
|
343
376
|
- optional runtime edit affordance in `PraxisChartComponent` when `chartDocument` and a settings-panel bridge are available
|
|
344
377
|
- canonical theme variants and registered palette tokens for `x-ui.chart`
|
|
378
|
+
- declarative `selectionChange` and `crossFilter` actions emitted from selected chart points
|
|
379
|
+
- `distinct-count` aggregation mapped to canonical `praxis.stats` `DISTINCT_COUNT`
|
|
380
|
+
- host-owned remote data resolution through `remoteDataResolver`
|
|
381
|
+
- executable agentic authoring manifest for `praxis-chart`, exported as `PRAXIS_CHARTS_AUTHORING_MANIFEST`
|
|
382
|
+
|
|
383
|
+
## Agentic Authoring Contract
|
|
384
|
+
|
|
385
|
+
`@praxisui/charts` publishes a component-level authoring manifest for `praxis-chart`.
|
|
386
|
+
The manifest is an executable backend/tooling contract for canonical
|
|
387
|
+
`PraxisXUiChartContract` documents, not prompt-routing documentation.
|
|
388
|
+
|
|
389
|
+
The governed authoring targets are:
|
|
390
|
+
|
|
391
|
+
- `chartType`
|
|
392
|
+
- `series`
|
|
393
|
+
- `axis`
|
|
394
|
+
- `dataBinding`
|
|
395
|
+
- `queryContext`
|
|
396
|
+
- `crossFilter`
|
|
397
|
+
- `drilldown`
|
|
398
|
+
- `selection`
|
|
399
|
+
- `legend`
|
|
400
|
+
- `tooltip`
|
|
401
|
+
|
|
402
|
+
Remote resource and field binding must come from governed API metadata,
|
|
403
|
+
`availableResources` and `availableFields`. Cross-filter, drilldown and
|
|
404
|
+
selection authoring persists structured `events.*` actions instead of command
|
|
405
|
+
strings or raw prompt examples. The visual editor remains the canonical
|
|
406
|
+
round-trip surface for this document: open, edit, apply/save, reset and reopen
|
|
407
|
+
must preserve the same `x-ui.chart` shape consumed by the runtime.
|
|
408
|
+
|
|
409
|
+
Each manifest operation declares its own editable target, resolver,
|
|
410
|
+
ambiguity policy, preconditions, validators, affected paths, effects and
|
|
411
|
+
`submissionImpact`. Chart document, type, series and axis changes are
|
|
412
|
+
`config-only`; remote data binding, query context and event mappings
|
|
413
|
+
`affect-remote-binding`; legend and tooltip changes are `visual-only`.
|
|
345
414
|
|
|
346
415
|
## Current Non-Goals
|
|
347
416
|
|
|
348
|
-
The
|
|
417
|
+
The public chart contract keeps these concerns outside the stable surface:
|
|
349
418
|
|
|
350
419
|
- direct host control over raw ECharts options as the primary contract
|
|
351
|
-
- declarative cross-filter orchestration
|
|
352
|
-
- declarative selectionChange runtime actions
|
|
353
420
|
|
|
354
421
|
## Notes for Hosts
|
|
355
422
|
|