@praxisui/charts 1.0.0-beta.68
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 +126 -0
- package/fesm2022/praxisui-charts.mjs +2662 -0
- package/fesm2022/praxisui-charts.mjs.map +1 -0
- package/index.d.ts +639 -0
- package/package.json +46 -0
package/README.md
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
# @praxisui/charts
|
|
2
|
+
|
|
3
|
+
> Metadata-driven charting for Praxis UI Angular, with a stable public contract and an engine adapter boundary.
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
- Official documentation: https://praxisui.dev
|
|
8
|
+
- Repository: https://github.com/codexrodrigues/praxis-ui-angular
|
|
9
|
+
- Recommended for: Angular hosts that need declarative analytics widgets aligned with the `@praxisui/*` runtime
|
|
10
|
+
|
|
11
|
+
## What this package provides
|
|
12
|
+
|
|
13
|
+
- `PraxisChartComponent` for standalone chart rendering
|
|
14
|
+
- typed chart contracts for config, datasets, events and widget mapping
|
|
15
|
+
- internal Apache ECharts adapter behind a Praxis engine interface
|
|
16
|
+
- built-in `loading`, `empty` and `error` states
|
|
17
|
+
- mapping from canonical `x-ui.chart` contracts into Praxis widget/page structures
|
|
18
|
+
- support services for backend payload adaptation, stats requests and chart option building
|
|
19
|
+
|
|
20
|
+
## Why this package exists
|
|
21
|
+
|
|
22
|
+
- keep the public API business-oriented instead of exposing raw engine options as the main contract
|
|
23
|
+
- preserve the option to swap the rendering engine later without rewriting host integrations
|
|
24
|
+
- align charts with the same metadata-driven model used by the rest of the Praxis UI platform
|
|
25
|
+
|
|
26
|
+
## Install
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm i @praxisui/charts
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Peer dependencies (Angular v20):
|
|
33
|
+
- `@angular/core` `^20.0.0`
|
|
34
|
+
- `@angular/common` `^20.0.0`
|
|
35
|
+
- `@praxisui/core` `^1.0.0-beta.68`
|
|
36
|
+
|
|
37
|
+
Runtime dependency included by this package:
|
|
38
|
+
- `echarts` `^6.0.0`
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { Component } from '@angular/core';
|
|
44
|
+
import {
|
|
45
|
+
PraxisChartComponent,
|
|
46
|
+
type PraxisChartPointEvent,
|
|
47
|
+
type PraxisChartConfig,
|
|
48
|
+
} from '@praxisui/charts';
|
|
49
|
+
|
|
50
|
+
@Component({
|
|
51
|
+
selector: 'app-chart-demo',
|
|
52
|
+
standalone: true,
|
|
53
|
+
imports: [PraxisChartComponent],
|
|
54
|
+
template: `
|
|
55
|
+
<praxis-chart
|
|
56
|
+
[config]="config"
|
|
57
|
+
(pointClick)="onPointClick($event)"
|
|
58
|
+
></praxis-chart>
|
|
59
|
+
`,
|
|
60
|
+
})
|
|
61
|
+
export class ChartDemoComponent {
|
|
62
|
+
readonly config: PraxisChartConfig = {
|
|
63
|
+
title: 'Employees by Department',
|
|
64
|
+
type: 'bar',
|
|
65
|
+
dataSource: {
|
|
66
|
+
kind: 'local',
|
|
67
|
+
items: [
|
|
68
|
+
{ department: 'Engineering', total: 18 },
|
|
69
|
+
{ department: 'Finance', total: 6 },
|
|
70
|
+
{ department: 'HR', total: 4 },
|
|
71
|
+
],
|
|
72
|
+
},
|
|
73
|
+
axes: {
|
|
74
|
+
x: {
|
|
75
|
+
field: 'department',
|
|
76
|
+
type: 'category',
|
|
77
|
+
label: 'Department',
|
|
78
|
+
},
|
|
79
|
+
y: {
|
|
80
|
+
field: 'total',
|
|
81
|
+
type: 'value',
|
|
82
|
+
label: 'Employees',
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
series: [
|
|
86
|
+
{
|
|
87
|
+
id: 'employees',
|
|
88
|
+
type: 'bar',
|
|
89
|
+
metric: {
|
|
90
|
+
field: 'total',
|
|
91
|
+
aggregation: 'sum',
|
|
92
|
+
},
|
|
93
|
+
name: 'Employees',
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
onPointClick(event: PraxisChartPointEvent) {
|
|
99
|
+
console.log('chart point', event);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## Public Surface Highlights
|
|
105
|
+
|
|
106
|
+
- standalone components for charts, drilldown panel and runtime probe
|
|
107
|
+
- chart contracts such as `PraxisChartConfig`, `PraxisChartDataSource` and `PraxisChartPointEvent`
|
|
108
|
+
- providers and tokens for chart engine composition
|
|
109
|
+
- services for canonical mapping, backend payload adaptation and option building
|
|
110
|
+
|
|
111
|
+
See the public exports in `projects/praxis-charts/src/public-api.ts`.
|
|
112
|
+
|
|
113
|
+
## Current Scope
|
|
114
|
+
|
|
115
|
+
This first published version is focused on the core runtime:
|
|
116
|
+
|
|
117
|
+
- the `praxis-chart` component
|
|
118
|
+
- canonical chart contracts and runtime models
|
|
119
|
+
- the initial ECharts-based engine adapter
|
|
120
|
+
- metadata and mapping hooks for registry and dynamic widget composition
|
|
121
|
+
|
|
122
|
+
## Notes for Hosts
|
|
123
|
+
|
|
124
|
+
- the package is designed for the Praxis platform model, where chart semantics live in canonical contracts and not in engine-specific payloads
|
|
125
|
+
- if you are integrating charts into dynamic pages or widget shells, prefer the exported Praxis contracts and mappers over direct engine customization
|
|
126
|
+
- if you need raw ECharts tuning, treat it as adapter-level implementation detail unless the contract is promoted to the public surface intentionally
|