@praxisui/charts 8.0.0-beta.0 → 8.0.0-beta.2

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
@@ -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 `PraxisChartPointEvent`
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
- - chama `PraxisChartStatsApiService`
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
- - `distinct-count` não é uma agregação aceita por `@praxisui/charts`
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 não são ações aceitas por `@praxisui/charts`
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 hoje segue a forma:
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
- - a execução remota automática é limitada a `praxis.stats`; o componente não expõe hook público de override do request
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,15 @@ 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`
345
381
 
346
382
  ## Current Non-Goals
347
383
 
348
- The current runtime does not yet expose as stable public surface:
384
+ The public chart contract keeps these concerns outside the stable surface:
349
385
 
350
386
  - direct host control over raw ECharts options as the primary contract
351
- - declarative cross-filter orchestration
352
- - declarative selectionChange runtime actions
353
387
 
354
388
  ## Notes for Hosts
355
389