@praxisui/charts 3.0.0-beta.1 → 3.0.0-beta.10
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 +156 -1
- package/fesm2022/praxisui-charts.mjs +3349 -1623
- package/index.d.ts +489 -109
- package/package.json +2 -2
- package/fesm2022/praxisui-charts.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -11,6 +11,8 @@
|
|
|
11
11
|
## What this package provides
|
|
12
12
|
|
|
13
13
|
- `PraxisChartComponent` for standalone chart rendering
|
|
14
|
+
- `PraxisChartConfigEditor` as the initial authoring shell for canonical `x-ui.chart` documents
|
|
15
|
+
- optional runtime authoring bridge from `PraxisChartComponent` into the chart config editor when the host provides a settings-panel bridge
|
|
14
16
|
- typed chart contracts for config, datasets, events and widget mapping
|
|
15
17
|
- internal Apache ECharts adapter behind a Praxis engine interface
|
|
16
18
|
- built-in `loading`, `empty` and `error` states
|
|
@@ -32,7 +34,7 @@ npm i @praxisui/charts
|
|
|
32
34
|
Peer dependencies (Angular v20):
|
|
33
35
|
- `@angular/core` `^20.0.0`
|
|
34
36
|
- `@angular/common` `^20.0.0`
|
|
35
|
-
- `@praxisui/core` `^
|
|
37
|
+
- `@praxisui/core` `^3.0.0-beta.2`
|
|
36
38
|
|
|
37
39
|
Runtime dependency included by this package:
|
|
38
40
|
- `echarts` `^6.0.0`
|
|
@@ -104,12 +106,153 @@ export class ChartDemoComponent {
|
|
|
104
106
|
## Public Surface Highlights
|
|
105
107
|
|
|
106
108
|
- standalone components for charts, drilldown panel and runtime probe
|
|
109
|
+
- the initial standalone chart config editor shell for `x-ui.chart`
|
|
107
110
|
- chart contracts such as `PraxisChartConfig`, `PraxisChartDataSource` and `PraxisChartPointEvent`
|
|
108
111
|
- providers and tokens for chart engine composition
|
|
109
112
|
- services for canonical mapping, backend payload adaptation and option building
|
|
110
113
|
|
|
111
114
|
See the public exports in `projects/praxis-charts/src/public-api.ts`.
|
|
112
115
|
|
|
116
|
+
## Runtime Model
|
|
117
|
+
|
|
118
|
+
O runtime atual de `@praxisui/charts` opera em duas trilhas principais:
|
|
119
|
+
|
|
120
|
+
- `dataSource.kind = "local"` para datasets entregues diretamente ao componente
|
|
121
|
+
- `dataSource.kind = "remote"` para datasets remotos, com foco canônico em `praxis.stats`
|
|
122
|
+
|
|
123
|
+
No modo remoto, o componente:
|
|
124
|
+
|
|
125
|
+
- emite `queryRequest`
|
|
126
|
+
- chama `PraxisChartStatsApiService`
|
|
127
|
+
- transforma a resposta agregada em `PraxisChartDataRow[]`
|
|
128
|
+
- renderiza o estado `loading`, `empty`, `error` ou `ready`
|
|
129
|
+
|
|
130
|
+
## Declarative Query Contract
|
|
131
|
+
|
|
132
|
+
For dynamic pages and widget orchestration, the primary public input for remote chart queries is `queryContext`.
|
|
133
|
+
|
|
134
|
+
```html
|
|
135
|
+
<praxis-chart
|
|
136
|
+
[config]="chartConfig"
|
|
137
|
+
[queryContext]="{
|
|
138
|
+
filters: { departmentId: 10, status: 'ACTIVE' },
|
|
139
|
+
sort: ['competencia,asc'],
|
|
140
|
+
limit: 12
|
|
141
|
+
}"
|
|
142
|
+
></praxis-chart>
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Current rules:
|
|
146
|
+
|
|
147
|
+
- `queryContext.filters` is merged into remote datasource requests
|
|
148
|
+
- `queryContext.sort` and `queryContext.limit` are also propagated when the datasource path supports them
|
|
149
|
+
- `filterCriteria` is still accepted as a legacy compatibility bridge
|
|
150
|
+
- for new authoring, `DynamicPage` connections and examples, prefer `queryContext`
|
|
151
|
+
|
|
152
|
+
### Versão Pedagógica de Alto Nível
|
|
153
|
+
|
|
154
|
+
Esta é a leitura adequada para documentação pública e landing pages.
|
|
155
|
+
|
|
156
|
+
```mermaid
|
|
157
|
+
sequenceDiagram
|
|
158
|
+
participant Host as Host
|
|
159
|
+
participant Chart as praxis-chart
|
|
160
|
+
participant Stats as PraxisChartStatsApiService
|
|
161
|
+
participant Backend as API Praxis Stats
|
|
162
|
+
|
|
163
|
+
Host->>Chart: fornece config local ou remote
|
|
164
|
+
alt fonte local
|
|
165
|
+
Chart->>Chart: transforma dados locais e renderiza
|
|
166
|
+
else fonte remota
|
|
167
|
+
Chart-->>Host: emite queryRequest
|
|
168
|
+
Chart->>Stats: executa consulta praxis.stats
|
|
169
|
+
Stats->>Backend: POST /stats/*
|
|
170
|
+
Backend-->>Stats: retorna buckets/pontos agregados
|
|
171
|
+
Stats-->>Chart: entrega linhas canônicas
|
|
172
|
+
Chart->>Chart: renderiza loading, ready, empty ou error
|
|
173
|
+
end
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
Leitura pedagógica:
|
|
177
|
+
|
|
178
|
+
1. **O host entrega um contrato declarativo**, não opções brutas do engine.
|
|
179
|
+
2. **O componente resolve a fonte de dados**: local ou remota.
|
|
180
|
+
3. **Quando a fonte é remota, a integração canônica é `praxis.stats`**.
|
|
181
|
+
4. **O chart renderiza estados de UX e a visualização final a partir de linhas canônicas**.
|
|
182
|
+
|
|
183
|
+
### Versão Detalhada e Fiel ao Runtime Atual
|
|
184
|
+
|
|
185
|
+
```mermaid
|
|
186
|
+
sequenceDiagram
|
|
187
|
+
participant Host as Host
|
|
188
|
+
participant Chart as PraxisChartComponent
|
|
189
|
+
participant Mapper as Canonical Mapper / config remoto
|
|
190
|
+
participant Stats as PraxisChartStatsApiService
|
|
191
|
+
participant Backend as API /stats
|
|
192
|
+
participant Engine as Chart Engine Adapter
|
|
193
|
+
|
|
194
|
+
Host->>Chart: [config] e opcionalmente [data]
|
|
195
|
+
alt data explicito fornecido
|
|
196
|
+
Chart->>Chart: resolvedData = data input
|
|
197
|
+
else fonte local
|
|
198
|
+
Chart->>Chart: resolvedData = dataSource.items
|
|
199
|
+
else fonte remote
|
|
200
|
+
Chart->>Chart: buildRemoteSignature(config)
|
|
201
|
+
Chart-->>Host: queryRequest({ chartId, dataSource, query })
|
|
202
|
+
Chart->>Stats: execute(event, config)
|
|
203
|
+
Stats->>Stats: valida statsPath + statsRequest
|
|
204
|
+
Stats->>Backend: POST {statsPath}
|
|
205
|
+
Backend-->>Stats: envelope com data agregada
|
|
206
|
+
Stats->>Stats: converte buckets/points em PraxisChartDataRow[]
|
|
207
|
+
Stats-->>Chart: rows remotas resolvidas
|
|
208
|
+
end
|
|
209
|
+
|
|
210
|
+
Chart->>Chart: resolve loadState (loading/empty/error/ready)
|
|
211
|
+
alt ready
|
|
212
|
+
Chart->>Engine: render(host, { config, data })
|
|
213
|
+
else not ready
|
|
214
|
+
Chart->>Engine: destroy()
|
|
215
|
+
end
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
### Limites Atuais do Contrato Canônico
|
|
219
|
+
|
|
220
|
+
O mapper `x-ui.chart -> PraxisChartConfig` já impõe limites importantes que precisam aparecer na documentação pública:
|
|
221
|
+
|
|
222
|
+
- `source.kind` suportado hoje: `praxis.stats` e `derived`
|
|
223
|
+
- `source.kind = "praxis.stats"` exige `source.resource` e `source.operation`
|
|
224
|
+
- agregações suportadas: `count`, `sum`, `avg`, `min`, `max`
|
|
225
|
+
- `distinct-count` ainda não está implementado
|
|
226
|
+
- charts `pie` e `donut` aceitam apenas uma métrica
|
|
227
|
+
- charts cartesianos `praxis.stats` podem declarar múltiplas métricas apenas em `group-by` e `timeseries`
|
|
228
|
+
- `distribution` continua single-métrica
|
|
229
|
+
- `combo` exige pelo menos duas métricas e, no modo `praxis.stats`, suporta apenas `group-by` ou `timeseries`
|
|
230
|
+
- `axis: "secondary"` é exclusivo de `combo`
|
|
231
|
+
- `selectionChange` e `crossFilter` declarativos ainda não estão implementados
|
|
232
|
+
- `theme.variant` e `theme.palette` por token ainda não estão implementados
|
|
233
|
+
|
|
234
|
+
## Fluxo Canonico de `praxis.stats`
|
|
235
|
+
|
|
236
|
+
Quando o contrato remoto vem do mapper canônico, o caminho gerado hoje segue a forma:
|
|
237
|
+
|
|
238
|
+
- `{resourcePath}/stats/group-by`
|
|
239
|
+
- `{resourcePath}/stats/timeseries`
|
|
240
|
+
- `{resourcePath}/stats/distribution`
|
|
241
|
+
|
|
242
|
+
O `PraxisChartStatsApiService`:
|
|
243
|
+
|
|
244
|
+
- monta a URL final usando `API_URL`
|
|
245
|
+
- normaliza o path remoto
|
|
246
|
+
- envia `statsRequest` via `POST`
|
|
247
|
+
- converte buckets/pontos em linhas canônicas para o runtime do chart
|
|
248
|
+
|
|
249
|
+
Observação importante:
|
|
250
|
+
|
|
251
|
+
- o runtime atual assume envelope com `data`
|
|
252
|
+
- `queryRequest` é emitido para observabilidade do host antes da execução remota
|
|
253
|
+
- a execução remota automática hoje está acoplada a `praxis.stats`; não existe ainda um hook público de override do request dentro do componente
|
|
254
|
+
- 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
|
|
255
|
+
|
|
113
256
|
## Current Scope
|
|
114
257
|
|
|
115
258
|
This first published version is focused on the core runtime:
|
|
@@ -118,6 +261,18 @@ This first published version is focused on the core runtime:
|
|
|
118
261
|
- canonical chart contracts and runtime models
|
|
119
262
|
- the initial ECharts-based engine adapter
|
|
120
263
|
- metadata and mapping hooks for registry and dynamic widget composition
|
|
264
|
+
- remote execution focused on canonical `praxis.stats`
|
|
265
|
+
- basic settings-panel-compatible authoring shell focused on canonical `x-ui.chart`
|
|
266
|
+
- optional runtime edit affordance in `PraxisChartComponent` when `chartDocument` and a settings-panel bridge are available
|
|
267
|
+
|
|
268
|
+
## Current Non-Goals
|
|
269
|
+
|
|
270
|
+
The current runtime does not yet expose as stable public surface:
|
|
271
|
+
|
|
272
|
+
- direct host control over raw ECharts options as the primary contract
|
|
273
|
+
- declarative cross-filter orchestration
|
|
274
|
+
- declarative selectionChange runtime actions
|
|
275
|
+
- palette token indirection or theme variants from `x-ui.chart`
|
|
121
276
|
|
|
122
277
|
## Notes for Hosts
|
|
123
278
|
|