@ojiepermana/angular-chart 22.0.27
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 +249 -0
- package/fesm2022/ojiepermana-angular-chart-area.mjs +266 -0
- package/fesm2022/ojiepermana-angular-chart-area.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-bar.mjs +674 -0
- package/fesm2022/ojiepermana-angular-chart-bar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-core.mjs +764 -0
- package/fesm2022/ojiepermana-angular-chart-core.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-line.mjs +281 -0
- package/fesm2022/ojiepermana-angular-chart-line.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-pie.mjs +248 -0
- package/fesm2022/ojiepermana-angular-chart-pie.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs +1186 -0
- package/fesm2022/ojiepermana-angular-chart-primitives.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-radar.mjs +329 -0
- package/fesm2022/ojiepermana-angular-chart-radar.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-radial.mjs +255 -0
- package/fesm2022/ojiepermana-angular-chart-radial.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs +253 -0
- package/fesm2022/ojiepermana-angular-chart-scatter.mjs.map +1 -0
- package/fesm2022/ojiepermana-angular-chart.mjs +20 -0
- package/fesm2022/ojiepermana-angular-chart.mjs.map +1 -0
- package/package.json +76 -0
- package/types/ojiepermana-angular-chart-area.d.ts +58 -0
- package/types/ojiepermana-angular-chart-bar.d.ts +171 -0
- package/types/ojiepermana-angular-chart-core.d.ts +369 -0
- package/types/ojiepermana-angular-chart-line.d.ts +57 -0
- package/types/ojiepermana-angular-chart-pie.d.ts +93 -0
- package/types/ojiepermana-angular-chart-primitives.d.ts +265 -0
- package/types/ojiepermana-angular-chart-radar.d.ts +89 -0
- package/types/ojiepermana-angular-chart-radial.d.ts +86 -0
- package/types/ojiepermana-angular-chart-scatter.d.ts +95 -0
- package/types/ojiepermana-angular-chart.d.ts +2 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { Type, TemplateRef } from '@angular/core';
|
|
3
|
+
import * as _ojiepermana_angular_chart_core from '@ojiepermana/angular-chart/core';
|
|
4
|
+
import { ChartTick, ChartDatum } from '@ojiepermana/angular-chart/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* X axis for a cartesian chart. Reads scales from `CartesianContext`.
|
|
8
|
+
*
|
|
9
|
+
* Renders as `<svg:g>` — must be placed inside the owning chart's SVG.
|
|
10
|
+
*/
|
|
11
|
+
declare class ChartAxisX {
|
|
12
|
+
private readonly ctx;
|
|
13
|
+
/** Approximate tick count for linear (value) scales. */
|
|
14
|
+
readonly tickCount: _angular_core.InputSignal<number>;
|
|
15
|
+
/** Show 6-px tick marks between the axis line and the labels. */
|
|
16
|
+
readonly tickLine: _angular_core.InputSignal<boolean>;
|
|
17
|
+
/** Formatter for numeric tick labels. */
|
|
18
|
+
readonly tickFormat: _angular_core.InputSignal<(value: number) => string>;
|
|
19
|
+
protected readonly innerWidth: _angular_core.WritableSignal<number>;
|
|
20
|
+
protected readonly transform: _angular_core.Signal<string>;
|
|
21
|
+
protected readonly ticks: _angular_core.Signal<ChartTick[]>;
|
|
22
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartAxisX, never>;
|
|
23
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartAxisX, "svg:g[ChartAxisX]", never, { "tickCount": { "alias": "tickCount"; "required": false; "isSignal": true; }; "tickLine": { "alias": "tickLine"; "required": false; "isSignal": true; }; "tickFormat": { "alias": "tickFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Y axis for a cartesian chart. Reads scales from `CartesianContext`.
|
|
28
|
+
*
|
|
29
|
+
* Renders as `<svg:g>` — must be placed inside the owning chart's SVG.
|
|
30
|
+
*/
|
|
31
|
+
declare class ChartAxisY {
|
|
32
|
+
private readonly ctx;
|
|
33
|
+
readonly tickCount: _angular_core.InputSignal<number>;
|
|
34
|
+
readonly tickLine: _angular_core.InputSignal<boolean>;
|
|
35
|
+
readonly tickFormat: _angular_core.InputSignal<(value: number) => string>;
|
|
36
|
+
protected readonly innerHeight: _angular_core.WritableSignal<number>;
|
|
37
|
+
protected readonly ticks: _angular_core.Signal<ChartTick[]>;
|
|
38
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartAxisY, never>;
|
|
39
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartAxisY, "svg:g[ChartAxisY]", never, { "tickCount": { "alias": "tickCount"; "required": false; "isSignal": true; }; "tickLine": { "alias": "tickLine"; "required": false; "isSignal": true; }; "tickFormat": { "alias": "tickFormat"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Horizontal / vertical grid lines for the cartesian plotting area.
|
|
44
|
+
*
|
|
45
|
+
* Reads tick positions from `CartesianContext.valueScale`. Direction of the
|
|
46
|
+
* grid lines follows `orientation`:
|
|
47
|
+
* - vertical → horizontal grid lines (one per y-tick)
|
|
48
|
+
* - horizontal → vertical grid lines (one per x-tick)
|
|
49
|
+
*/
|
|
50
|
+
declare class ChartGrid {
|
|
51
|
+
private readonly ctx;
|
|
52
|
+
readonly tickCount: _angular_core.InputSignal<number>;
|
|
53
|
+
protected readonly ticks: _angular_core.Signal<_ojiepermana_angular_chart_core.ChartTick[]>;
|
|
54
|
+
protected readonly line: (offset: number) => {
|
|
55
|
+
x1: number;
|
|
56
|
+
x2: number;
|
|
57
|
+
y1: number;
|
|
58
|
+
y2: number;
|
|
59
|
+
};
|
|
60
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartGrid, never>;
|
|
61
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartGrid, "svg:g[ChartGrid]", never, { "tickCount": { "alias": "tickCount"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Crosshair primitive — a line drawn through the currently active data point
|
|
66
|
+
* perpendicular to the categorical axis. Reads `activePoint` from
|
|
67
|
+
* `ChartContext` and the scales from `CartesianContext`.
|
|
68
|
+
*
|
|
69
|
+
* Place inside a cartesian chart's SVG inner group.
|
|
70
|
+
*/
|
|
71
|
+
declare class ChartCrosshair {
|
|
72
|
+
private readonly root;
|
|
73
|
+
private readonly cart;
|
|
74
|
+
protected readonly line: _angular_core.Signal<{
|
|
75
|
+
x1: number;
|
|
76
|
+
x2: number;
|
|
77
|
+
y1: number;
|
|
78
|
+
y2: number;
|
|
79
|
+
} | null>;
|
|
80
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartCrosshair, never>;
|
|
81
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartCrosshair, "svg:g[ChartCrosshair]", never, {}, {}, never, never, true, never>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare class ChartBrush {
|
|
85
|
+
private readonly hitbox;
|
|
86
|
+
private readonly cart;
|
|
87
|
+
private readonly categorical;
|
|
88
|
+
private readonly scatter;
|
|
89
|
+
private readonly mode;
|
|
90
|
+
private readonly activePointerId;
|
|
91
|
+
private readonly categoryStartIndex;
|
|
92
|
+
private readonly categoryPanStart;
|
|
93
|
+
private readonly scatterBrush;
|
|
94
|
+
private readonly scatterPan;
|
|
95
|
+
protected readonly width: _angular_core.Signal<number>;
|
|
96
|
+
protected readonly height: _angular_core.Signal<number>;
|
|
97
|
+
protected readonly categoryPreview: _angular_core.Signal<{
|
|
98
|
+
x: number;
|
|
99
|
+
y: number;
|
|
100
|
+
width: number;
|
|
101
|
+
height: number;
|
|
102
|
+
} | null>;
|
|
103
|
+
protected readonly scatterPreviewRect: _angular_core.Signal<{
|
|
104
|
+
x: number;
|
|
105
|
+
y: number;
|
|
106
|
+
width: number;
|
|
107
|
+
height: number;
|
|
108
|
+
} | null>;
|
|
109
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
110
|
+
protected onPointerMove(event: PointerEvent): void;
|
|
111
|
+
protected onPointerUp(event?: PointerEvent): void;
|
|
112
|
+
protected onPointerCancel(event: PointerEvent): void;
|
|
113
|
+
protected onWheel(event: WheelEvent): void;
|
|
114
|
+
protected resetZoom(): void;
|
|
115
|
+
private onScatterPointerDown;
|
|
116
|
+
private localPoint;
|
|
117
|
+
private pointerAxis;
|
|
118
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartBrush, never>;
|
|
119
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartBrush, "svg:g[ChartBrush]", never, {}, {}, never, never, true, never>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Attach to a chart's `<svg:svg>` to publish pointer-driven active-point
|
|
124
|
+
* state into the surrounding `ChartContext`.
|
|
125
|
+
*
|
|
126
|
+
* Computes the local (x, y) of the pointer relative to the inner plotting
|
|
127
|
+
* area, resolves the nearest category, and updates
|
|
128
|
+
* `ChartContext.activePoint`. Clears it on `pointerleave`.
|
|
129
|
+
*/
|
|
130
|
+
declare class ChartPointerTracker {
|
|
131
|
+
private readonly root;
|
|
132
|
+
private readonly cart;
|
|
133
|
+
private readonly viewport;
|
|
134
|
+
protected onMove(event: PointerEvent): void;
|
|
135
|
+
protected onLeave(): void;
|
|
136
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartPointerTracker, never>;
|
|
137
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ChartPointerTracker, "svg:svg[ChartPointerTracker]", never, {}, {}, never, never, true, never>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** Row of data fed to tooltip templates. */
|
|
141
|
+
interface ChartTooltipRow {
|
|
142
|
+
readonly seriesKey: string;
|
|
143
|
+
readonly label: string;
|
|
144
|
+
readonly value: unknown;
|
|
145
|
+
readonly color: string;
|
|
146
|
+
readonly icon?: Type<unknown>;
|
|
147
|
+
}
|
|
148
|
+
/** Payload available to a user-supplied tooltip template. */
|
|
149
|
+
interface ChartTooltipPayload {
|
|
150
|
+
readonly category: string;
|
|
151
|
+
readonly datum: ChartDatum;
|
|
152
|
+
readonly rows: readonly ChartTooltipRow[];
|
|
153
|
+
}
|
|
154
|
+
/** Indicator rendered beside each tooltip row. */
|
|
155
|
+
type ChartTooltipIndicator = 'dot' | 'line' | 'dashed' | 'none';
|
|
156
|
+
/** Signature for the per-row value formatter (string output). */
|
|
157
|
+
type ChartTooltipValueFormatter = (value: unknown, row: ChartTooltipRow, payload: ChartTooltipPayload) => string;
|
|
158
|
+
/** Signature for the tooltip header (label) formatter. */
|
|
159
|
+
type ChartTooltipLabelFormatter = (label: string, payload: ChartTooltipPayload) => string;
|
|
160
|
+
/**
|
|
161
|
+
* Tooltip overlay — renders the default tooltip card (or a user-supplied
|
|
162
|
+
* template) anchored to the currently active data point.
|
|
163
|
+
*
|
|
164
|
+
* Shadcn-compatible knobs:
|
|
165
|
+
* - `indicator="line"` / `"none"` / `"dashed"` — swap the row glyph
|
|
166
|
+
* - `hideLabel` — drop the header row
|
|
167
|
+
* - `label="Activities"` — override the header text
|
|
168
|
+
* - `labelKey="activities"` — resolve the header from `config[labelKey].label`
|
|
169
|
+
* - `labelFormatter` — transform the header (e.g. ISO date → long date)
|
|
170
|
+
* - `formatter` — format per-row values (e.g. `"380 kcal"`)
|
|
171
|
+
* - `valueKey` — for pie/radial/radar, read row value from a single field
|
|
172
|
+
* - Icons are picked up automatically from `config[key].icon`.
|
|
173
|
+
*/
|
|
174
|
+
declare class ChartTooltip {
|
|
175
|
+
private readonly root;
|
|
176
|
+
private readonly host;
|
|
177
|
+
/** Data key on each datum whose value is the category label (x-axis). */
|
|
178
|
+
readonly xKey: _angular_core.InputSignal<string | null>;
|
|
179
|
+
/** Data source (optional — if omitted tooltip reads from chart data via activePoint.datumIndex). */
|
|
180
|
+
readonly data: _angular_core.InputSignal<readonly Readonly<Record<string, unknown>>[] | null>;
|
|
181
|
+
/**
|
|
182
|
+
* Optional key for per-datum value lookup (pie / radial / radar datasets
|
|
183
|
+
* store values on a single field like `visitors` instead of one field per
|
|
184
|
+
* series). When set and `activePoint.seriesKey` is active, the tooltip row
|
|
185
|
+
* reads `datum[valueKey]` for its value.
|
|
186
|
+
*/
|
|
187
|
+
readonly valueKey: _angular_core.InputSignal<string | null>;
|
|
188
|
+
/** Indicator variant next to each row. Default `'dot'`. */
|
|
189
|
+
readonly indicator: _angular_core.InputSignal<ChartTooltipIndicator>;
|
|
190
|
+
/** Hide the header label entirely. */
|
|
191
|
+
readonly hideLabel: _angular_core.InputSignal<boolean>;
|
|
192
|
+
/** Override the header label with a fixed string. Takes precedence over `labelKey`. */
|
|
193
|
+
readonly label: _angular_core.InputSignal<string | null>;
|
|
194
|
+
/**
|
|
195
|
+
* Resolve the header label from `config[labelKey].label`. Useful when the
|
|
196
|
+
* header should come from a config entry rather than the datum itself
|
|
197
|
+
* (shadcn's "Custom label" variant).
|
|
198
|
+
*/
|
|
199
|
+
readonly labelKey: _angular_core.InputSignal<string | null>;
|
|
200
|
+
/** Transform the final header string (e.g. ISO date → long date). */
|
|
201
|
+
readonly labelFormatter: _angular_core.InputSignal<ChartTooltipLabelFormatter | null>;
|
|
202
|
+
/** Format each row's value (return string — HTML is not interpreted). */
|
|
203
|
+
readonly formatter: _angular_core.InputSignal<ChartTooltipValueFormatter | null>;
|
|
204
|
+
readonly customTpl: _angular_core.Signal<TemplateRef<any> | undefined>;
|
|
205
|
+
protected readonly visible: _angular_core.Signal<boolean>;
|
|
206
|
+
protected readonly payload: _angular_core.Signal<ChartTooltipPayload | null>;
|
|
207
|
+
/** Resolve the header string honoring `label`, `labelKey`, then `labelFormatter`. */
|
|
208
|
+
protected headerText(p: ChartTooltipPayload): string | null;
|
|
209
|
+
/** Apply per-row value formatter (or stringify). */
|
|
210
|
+
protected formatRow(row: ChartTooltipRow, p: ChartTooltipPayload): string;
|
|
211
|
+
protected readonly position: _angular_core.Signal<{
|
|
212
|
+
x: number;
|
|
213
|
+
y: number;
|
|
214
|
+
}>;
|
|
215
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartTooltip, never>;
|
|
216
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartTooltip, "ChartTooltip", never, { "xKey": { "alias": "xKey"; "required": false; "isSignal": true; }; "data": { "alias": "data"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "indicator": { "alias": "indicator"; "required": false; "isSignal": true; }; "hideLabel": { "alias": "hideLabel"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labelKey": { "alias": "labelKey"; "required": false; "isSignal": true; }; "labelFormatter": { "alias": "labelFormatter"; "required": false; "isSignal": true; }; "formatter": { "alias": "formatter"; "required": false; "isSignal": true; }; }, {}, ["customTpl"], never, true, never>;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Legend — renders a list of series swatches. Clicking an item toggles
|
|
221
|
+
* visibility via `ChartContext.toggleSeries`.
|
|
222
|
+
*
|
|
223
|
+
* Place as a child of `<Chart>`:
|
|
224
|
+
* ```html
|
|
225
|
+
* <Chart [config]="cfg">
|
|
226
|
+
* <ChartBar ... />
|
|
227
|
+
* <ChartLegend />
|
|
228
|
+
* </Chart>
|
|
229
|
+
* ```
|
|
230
|
+
*/
|
|
231
|
+
declare class ChartLegend {
|
|
232
|
+
private readonly root;
|
|
233
|
+
protected readonly items: _angular_core.Signal<{
|
|
234
|
+
seriesKey: string;
|
|
235
|
+
label: string;
|
|
236
|
+
color: string;
|
|
237
|
+
hidden: boolean;
|
|
238
|
+
}[]>;
|
|
239
|
+
protected toggle(key: string): void;
|
|
240
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartLegend, never>;
|
|
241
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartLegend, "ChartLegend", never, {}, {}, never, never, true, never>;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
declare class ChartZoomControls {
|
|
245
|
+
private readonly categorical;
|
|
246
|
+
private readonly scatter;
|
|
247
|
+
protected readonly status: _angular_core.Signal<string | null>;
|
|
248
|
+
protected readonly hint: _angular_core.Signal<"Drag to brush a region. Use the wheel to zoom and one-finger touch drag to pan while zoomed." | "Drag to select a category range. Use the wheel to zoom and one-finger touch drag to pan while zoomed.">;
|
|
249
|
+
protected resetZoom(): void;
|
|
250
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ChartZoomControls, never>;
|
|
251
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ChartZoomControls, "ChartZoomControls", never, {}, {}, never, never, true, never>;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
declare class PieCenter {
|
|
255
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<PieCenter, never>;
|
|
256
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<PieCenter, "ChartPieCenter", never, {}, {}, never, ["*"], true, never>;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
declare class RadialCenter {
|
|
260
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadialCenter, never>;
|
|
261
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadialCenter, "ChartRadialCenter", never, {}, {}, never, ["*"], true, never>;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
export { ChartAxisX, ChartAxisY, ChartBrush, ChartCrosshair, ChartGrid, ChartLegend, ChartPointerTracker, ChartTooltip, ChartZoomControls, PieCenter, RadialCenter };
|
|
265
|
+
export type { ChartTooltipIndicator, ChartTooltipLabelFormatter, ChartTooltipPayload, ChartTooltipRow, ChartTooltipValueFormatter };
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { ChartDatum, ChartMargin } from '@ojiepermana/angular-chart/core';
|
|
2
|
+
import * as _ojiepermana_angular_chart_radar from '@ojiepermana/angular-chart/radar';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
|
|
5
|
+
type RadarCurve = 'linear' | 'cardinal';
|
|
6
|
+
type RadarGrid = 'polygon' | 'circle' | 'none';
|
|
7
|
+
interface RadarLayoutInput {
|
|
8
|
+
readonly data: readonly ChartDatum[];
|
|
9
|
+
readonly axisKey: string;
|
|
10
|
+
readonly seriesKeys: readonly string[];
|
|
11
|
+
readonly innerWidth: number;
|
|
12
|
+
readonly innerHeight: number;
|
|
13
|
+
readonly maxValue?: number;
|
|
14
|
+
readonly levels: number;
|
|
15
|
+
readonly curve: RadarCurve;
|
|
16
|
+
readonly grid: RadarGrid;
|
|
17
|
+
}
|
|
18
|
+
interface RadarAxisInfo {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly angle: number;
|
|
21
|
+
readonly x: number;
|
|
22
|
+
readonly y: number;
|
|
23
|
+
}
|
|
24
|
+
interface RadarSeries {
|
|
25
|
+
readonly seriesKey: string;
|
|
26
|
+
readonly color: string;
|
|
27
|
+
readonly path: string;
|
|
28
|
+
readonly points: readonly {
|
|
29
|
+
readonly x: number;
|
|
30
|
+
readonly y: number;
|
|
31
|
+
readonly value: number;
|
|
32
|
+
readonly axis: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
interface RadarLevel {
|
|
36
|
+
readonly value: number;
|
|
37
|
+
readonly radius: number;
|
|
38
|
+
readonly path: string;
|
|
39
|
+
}
|
|
40
|
+
interface RadarLayout {
|
|
41
|
+
readonly centerX: number;
|
|
42
|
+
readonly centerY: number;
|
|
43
|
+
readonly radius: number;
|
|
44
|
+
readonly axes: readonly RadarAxisInfo[];
|
|
45
|
+
readonly levels: readonly RadarLevel[];
|
|
46
|
+
readonly maxValue: number;
|
|
47
|
+
readonly series: readonly RadarSeries[];
|
|
48
|
+
readonly grid: RadarGrid;
|
|
49
|
+
}
|
|
50
|
+
declare function computeRadarLayout(input: RadarLayoutInput): RadarLayout;
|
|
51
|
+
|
|
52
|
+
declare class RadarChart {
|
|
53
|
+
private readonly root;
|
|
54
|
+
readonly data: _angular_core.InputSignal<readonly Readonly<Record<string, unknown>>[]>;
|
|
55
|
+
readonly axisKey: _angular_core.InputSignal<string>;
|
|
56
|
+
readonly styles: _angular_core.InputSignal<"base">;
|
|
57
|
+
readonly margin: _angular_core.InputSignal<ChartMargin>;
|
|
58
|
+
readonly curve: _angular_core.InputSignal<RadarCurve>;
|
|
59
|
+
readonly levels: _angular_core.InputSignal<number>;
|
|
60
|
+
readonly maxValue: _angular_core.InputSignal<number | undefined>;
|
|
61
|
+
readonly strokeWidth: _angular_core.InputSignal<number>;
|
|
62
|
+
readonly fillOpacity: _angular_core.InputSignal<number>;
|
|
63
|
+
readonly showLabels: _angular_core.InputSignal<boolean>;
|
|
64
|
+
readonly showDots: _angular_core.InputSignal<boolean>;
|
|
65
|
+
readonly dotRadius: _angular_core.InputSignal<number>;
|
|
66
|
+
readonly grid: _angular_core.InputSignal<RadarGrid>;
|
|
67
|
+
readonly gridFilled: _angular_core.InputSignal<boolean>;
|
|
68
|
+
readonly showAxes: _angular_core.InputSignal<boolean>;
|
|
69
|
+
readonly linesOnly: _angular_core.InputSignal<boolean>;
|
|
70
|
+
protected readonly innerWidth: _angular_core.Signal<number>;
|
|
71
|
+
protected readonly innerHeight: _angular_core.Signal<number>;
|
|
72
|
+
protected readonly layout: _angular_core.Signal<_ojiepermana_angular_chart_radar.RadarLayout>;
|
|
73
|
+
protected readonly viewBox: _angular_core.Signal<string>;
|
|
74
|
+
protected readonly innerTransform: _angular_core.Signal<string>;
|
|
75
|
+
protected readonly ariaSummary: _angular_core.Signal<string>;
|
|
76
|
+
protected gridFill(): string;
|
|
77
|
+
protected gridFillOpacity(levelIndex: number): number | null;
|
|
78
|
+
protected dotAriaLabel(seriesKey: string, p: {
|
|
79
|
+
axis: string;
|
|
80
|
+
value: number;
|
|
81
|
+
}): string;
|
|
82
|
+
protected setActive(event: PointerEvent | FocusEvent, seriesKey: string, index: number): void;
|
|
83
|
+
protected clearActive(): void;
|
|
84
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadarChart, never>;
|
|
85
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadarChart, "ChartRadar", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "axisKey": { "alias": "axisKey"; "required": true; "isSignal": true; }; "styles": { "alias": "styles"; "required": false; "isSignal": true; }; "margin": { "alias": "margin"; "required": false; "isSignal": true; }; "curve": { "alias": "curve"; "required": false; "isSignal": true; }; "levels": { "alias": "levels"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "strokeWidth": { "alias": "strokeWidth"; "required": false; "isSignal": true; }; "fillOpacity": { "alias": "fillOpacity"; "required": false; "isSignal": true; }; "showLabels": { "alias": "showLabels"; "required": false; "isSignal": true; }; "showDots": { "alias": "showDots"; "required": false; "isSignal": true; }; "dotRadius": { "alias": "dotRadius"; "required": false; "isSignal": true; }; "grid": { "alias": "grid"; "required": false; "isSignal": true; }; "gridFilled": { "alias": "gridFilled"; "required": false; "isSignal": true; }; "showAxes": { "alias": "showAxes"; "required": false; "isSignal": true; }; "linesOnly": { "alias": "linesOnly"; "required": false; "isSignal": true; }; }, {}, never, ["*", "ChartTooltip", "ChartLegend"], true, never>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export { RadarChart, computeRadarLayout };
|
|
89
|
+
export type { RadarAxisInfo, RadarCurve, RadarGrid, RadarLayout, RadarLayoutInput, RadarLevel, RadarSeries };
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { ChartDatum, ChartMargin } from '@ojiepermana/angular-chart/core';
|
|
2
|
+
import * as _ojiepermana_angular_chart_radial from '@ojiepermana/angular-chart/radial';
|
|
3
|
+
import * as _angular_core from '@angular/core';
|
|
4
|
+
|
|
5
|
+
interface RadialLayoutInput {
|
|
6
|
+
readonly data: readonly ChartDatum[];
|
|
7
|
+
readonly nameKey: string;
|
|
8
|
+
readonly valueKey: string;
|
|
9
|
+
readonly innerWidth: number;
|
|
10
|
+
readonly innerHeight: number;
|
|
11
|
+
/** Optional explicit series-key list (same length as data). */
|
|
12
|
+
readonly seriesKeys?: readonly string[];
|
|
13
|
+
/** Gap between concentric tracks (px). */
|
|
14
|
+
readonly trackPadding: number;
|
|
15
|
+
/** Start / end angle (radians). */
|
|
16
|
+
readonly startAngle: number;
|
|
17
|
+
readonly endAngle: number;
|
|
18
|
+
readonly cornerRadius: number;
|
|
19
|
+
readonly maxValue?: number;
|
|
20
|
+
}
|
|
21
|
+
interface RadialBarRect {
|
|
22
|
+
readonly seriesKey: string;
|
|
23
|
+
readonly name: string;
|
|
24
|
+
readonly value: number;
|
|
25
|
+
readonly datumIndex: number;
|
|
26
|
+
readonly color: string;
|
|
27
|
+
readonly arcPath: string;
|
|
28
|
+
readonly backgroundPath: string;
|
|
29
|
+
readonly innerRadius: number;
|
|
30
|
+
readonly outerRadius: number;
|
|
31
|
+
readonly endAngle: number;
|
|
32
|
+
}
|
|
33
|
+
interface RadialLayout {
|
|
34
|
+
readonly centerX: number;
|
|
35
|
+
readonly centerY: number;
|
|
36
|
+
readonly outerRadius: number;
|
|
37
|
+
readonly bars: readonly RadialBarRect[];
|
|
38
|
+
readonly maxValue: number;
|
|
39
|
+
}
|
|
40
|
+
declare function computeRadialLayout(input: RadialLayoutInput): RadialLayout;
|
|
41
|
+
|
|
42
|
+
type RadialValueLabelFormatter = (value: number, name: string) => string;
|
|
43
|
+
interface RadialBarClickEvent {
|
|
44
|
+
readonly seriesKey: string;
|
|
45
|
+
readonly name: string;
|
|
46
|
+
readonly value: number;
|
|
47
|
+
readonly datumIndex: number;
|
|
48
|
+
readonly datum: ChartDatum;
|
|
49
|
+
}
|
|
50
|
+
declare class RadialChart {
|
|
51
|
+
private readonly root;
|
|
52
|
+
readonly data: _angular_core.InputSignal<readonly Readonly<Record<string, unknown>>[]>;
|
|
53
|
+
readonly nameKey: _angular_core.InputSignal<string>;
|
|
54
|
+
readonly valueKey: _angular_core.InputSignal<string>;
|
|
55
|
+
readonly seriesKeys: _angular_core.InputSignal<readonly string[] | undefined>;
|
|
56
|
+
readonly styles: _angular_core.InputSignal<"base">;
|
|
57
|
+
readonly margin: _angular_core.InputSignal<ChartMargin>;
|
|
58
|
+
readonly trackPadding: _angular_core.InputSignal<number>;
|
|
59
|
+
readonly cornerRadius: _angular_core.InputSignal<number>;
|
|
60
|
+
readonly startAngle: _angular_core.InputSignal<number>;
|
|
61
|
+
readonly endAngle: _angular_core.InputSignal<number>;
|
|
62
|
+
readonly maxValue: _angular_core.InputSignal<number | undefined>;
|
|
63
|
+
readonly showTrack: _angular_core.InputSignal<boolean>;
|
|
64
|
+
readonly showValueLabels: _angular_core.InputSignal<boolean>;
|
|
65
|
+
readonly valueLabelFormat: _angular_core.InputSignal<RadialValueLabelFormatter>;
|
|
66
|
+
readonly barClick: _angular_core.OutputEmitterRef<RadialBarClickEvent>;
|
|
67
|
+
protected readonly innerWidth: _angular_core.Signal<number>;
|
|
68
|
+
protected readonly innerHeight: _angular_core.Signal<number>;
|
|
69
|
+
protected readonly layout: _angular_core.Signal<_ojiepermana_angular_chart_radial.RadialLayout>;
|
|
70
|
+
protected readonly viewBox: _angular_core.Signal<string>;
|
|
71
|
+
protected readonly innerTransform: _angular_core.Signal<string>;
|
|
72
|
+
protected readonly ariaSummary: _angular_core.Signal<string>;
|
|
73
|
+
protected barAriaLabel(b: RadialBarRect): string;
|
|
74
|
+
protected formatValueLabel(b: RadialBarRect): string;
|
|
75
|
+
protected barLabelX(b: RadialBarRect): number;
|
|
76
|
+
protected barLabelY(b: RadialBarRect): number;
|
|
77
|
+
protected barLabelAnchor(b: RadialBarRect): 'start' | 'end';
|
|
78
|
+
protected emitClick(b: RadialBarRect): void;
|
|
79
|
+
protected setActive(event: PointerEvent | FocusEvent, b: RadialBarRect): void;
|
|
80
|
+
protected clearActive(): void;
|
|
81
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<RadialChart, never>;
|
|
82
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<RadialChart, "ChartRadial", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "nameKey": { "alias": "nameKey"; "required": true; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": true; "isSignal": true; }; "seriesKeys": { "alias": "seriesKeys"; "required": false; "isSignal": true; }; "styles": { "alias": "styles"; "required": false; "isSignal": true; }; "margin": { "alias": "margin"; "required": false; "isSignal": true; }; "trackPadding": { "alias": "trackPadding"; "required": false; "isSignal": true; }; "cornerRadius": { "alias": "cornerRadius"; "required": false; "isSignal": true; }; "startAngle": { "alias": "startAngle"; "required": false; "isSignal": true; }; "endAngle": { "alias": "endAngle"; "required": false; "isSignal": true; }; "maxValue": { "alias": "maxValue"; "required": false; "isSignal": true; }; "showTrack": { "alias": "showTrack"; "required": false; "isSignal": true; }; "showValueLabels": { "alias": "showValueLabels"; "required": false; "isSignal": true; }; "valueLabelFormat": { "alias": "valueLabelFormat"; "required": false; "isSignal": true; }; }, { "barClick": "barClick"; }, never, ["ChartRadialCenter", "ChartTooltip", "ChartLegend"], true, never>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export { RadialChart, computeRadialLayout };
|
|
86
|
+
export type { RadialBarClickEvent, RadialBarRect, RadialLayout, RadialLayoutInput, RadialValueLabelFormatter };
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { ScaleLinear } from 'd3-scale';
|
|
2
|
+
import * as _ojiepermana_angular_chart_core from '@ojiepermana/angular-chart/core';
|
|
3
|
+
import { NumericDomain, ChartDatum, ChartMargin } from '@ojiepermana/angular-chart/core';
|
|
4
|
+
import * as _ojiepermana_angular_chart_scatter from '@ojiepermana/angular-chart/scatter';
|
|
5
|
+
import * as _angular_core from '@angular/core';
|
|
6
|
+
|
|
7
|
+
interface ScatterLayoutInput {
|
|
8
|
+
readonly data: readonly ChartDatum[];
|
|
9
|
+
readonly xKey: string;
|
|
10
|
+
readonly yKey: string;
|
|
11
|
+
readonly sizeKey?: string;
|
|
12
|
+
readonly seriesKey?: string;
|
|
13
|
+
readonly seriesKeys: readonly string[];
|
|
14
|
+
readonly innerWidth: number;
|
|
15
|
+
readonly innerHeight: number;
|
|
16
|
+
readonly minPointRadius: number;
|
|
17
|
+
readonly maxPointRadius: number;
|
|
18
|
+
readonly xDomain?: readonly [number, number];
|
|
19
|
+
readonly yDomain?: readonly [number, number];
|
|
20
|
+
}
|
|
21
|
+
interface ScatterPoint {
|
|
22
|
+
readonly seriesKey: string;
|
|
23
|
+
readonly color: string;
|
|
24
|
+
readonly x: number;
|
|
25
|
+
readonly y: number;
|
|
26
|
+
readonly radius: number;
|
|
27
|
+
readonly datumIndex: number;
|
|
28
|
+
readonly rawX: number;
|
|
29
|
+
readonly rawY: number;
|
|
30
|
+
readonly rawSize: number;
|
|
31
|
+
}
|
|
32
|
+
interface ScatterLayout {
|
|
33
|
+
readonly points: readonly ScatterPoint[];
|
|
34
|
+
readonly xScale: ScaleLinear<number, number>;
|
|
35
|
+
readonly yScale: ScaleLinear<number, number>;
|
|
36
|
+
readonly xDomain: NumericDomain;
|
|
37
|
+
readonly yDomain: NumericDomain;
|
|
38
|
+
}
|
|
39
|
+
declare function resolveScatterDomains(input: Pick<ScatterLayoutInput, 'data' | 'xKey' | 'yKey' | 'xDomain' | 'yDomain'>): {
|
|
40
|
+
xDomain: NumericDomain;
|
|
41
|
+
yDomain: NumericDomain;
|
|
42
|
+
};
|
|
43
|
+
declare function computeScatterLayout(input: ScatterLayoutInput): ScatterLayout;
|
|
44
|
+
|
|
45
|
+
interface ScatterPointClickEvent {
|
|
46
|
+
readonly seriesKey: string;
|
|
47
|
+
readonly datumIndex: number;
|
|
48
|
+
readonly x: number;
|
|
49
|
+
readonly y: number;
|
|
50
|
+
readonly datum: ChartDatum;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Scatter chart — one dot per datum. Both axes are linear; color can
|
|
54
|
+
* come from a fixed series key or per-row via `seriesKey` field. Point
|
|
55
|
+
* radius optionally scales with `sizeKey`.
|
|
56
|
+
*/
|
|
57
|
+
declare class ScatterChart {
|
|
58
|
+
private readonly root;
|
|
59
|
+
private readonly viewport;
|
|
60
|
+
readonly data: _angular_core.InputSignal<readonly Readonly<Record<string, unknown>>[]>;
|
|
61
|
+
readonly xKey: _angular_core.InputSignal<string>;
|
|
62
|
+
readonly yKey: _angular_core.InputSignal<string>;
|
|
63
|
+
/** Optional numeric field to drive point radius. */
|
|
64
|
+
readonly sizeKey: _angular_core.InputSignal<string | undefined>;
|
|
65
|
+
/** Optional field on each datum used as color key. */
|
|
66
|
+
readonly seriesKey: _angular_core.InputSignal<string | undefined>;
|
|
67
|
+
readonly styles: _angular_core.InputSignal<"base">;
|
|
68
|
+
readonly margin: _angular_core.InputSignal<ChartMargin>;
|
|
69
|
+
readonly minPointRadius: _angular_core.InputSignal<number>;
|
|
70
|
+
readonly maxPointRadius: _angular_core.InputSignal<number>;
|
|
71
|
+
readonly xDomain: _angular_core.InputSignal<readonly [number, number] | undefined>;
|
|
72
|
+
readonly yDomain: _angular_core.InputSignal<readonly [number, number] | undefined>;
|
|
73
|
+
readonly pointClick: _angular_core.OutputEmitterRef<ScatterPointClickEvent>;
|
|
74
|
+
protected readonly innerWidth: _angular_core.Signal<number>;
|
|
75
|
+
protected readonly innerHeight: _angular_core.Signal<number>;
|
|
76
|
+
protected readonly resolvedDomains: _angular_core.Signal<{
|
|
77
|
+
xDomain: _ojiepermana_angular_chart_core.NumericDomain;
|
|
78
|
+
yDomain: _ojiepermana_angular_chart_core.NumericDomain;
|
|
79
|
+
}>;
|
|
80
|
+
protected readonly currentXDomain: _angular_core.Signal<_ojiepermana_angular_chart_core.NumericDomain>;
|
|
81
|
+
protected readonly currentYDomain: _angular_core.Signal<_ojiepermana_angular_chart_core.NumericDomain>;
|
|
82
|
+
protected readonly layout: _angular_core.Signal<_ojiepermana_angular_chart_scatter.ScatterLayout>;
|
|
83
|
+
protected readonly viewBox: _angular_core.Signal<string>;
|
|
84
|
+
protected readonly innerTransform: _angular_core.Signal<string>;
|
|
85
|
+
protected readonly clipPathId: _angular_core.Signal<string>;
|
|
86
|
+
protected readonly ariaSummary: _angular_core.Signal<string>;
|
|
87
|
+
constructor();
|
|
88
|
+
protected pointAriaLabel(p: ScatterPoint): string;
|
|
89
|
+
protected emitClick(p: ScatterPoint): void;
|
|
90
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ScatterChart, never>;
|
|
91
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<ScatterChart, "ChartScatter", never, { "data": { "alias": "data"; "required": true; "isSignal": true; }; "xKey": { "alias": "xKey"; "required": true; "isSignal": true; }; "yKey": { "alias": "yKey"; "required": true; "isSignal": true; }; "sizeKey": { "alias": "sizeKey"; "required": false; "isSignal": true; }; "seriesKey": { "alias": "seriesKey"; "required": false; "isSignal": true; }; "styles": { "alias": "styles"; "required": false; "isSignal": true; }; "margin": { "alias": "margin"; "required": false; "isSignal": true; }; "minPointRadius": { "alias": "minPointRadius"; "required": false; "isSignal": true; }; "maxPointRadius": { "alias": "maxPointRadius"; "required": false; "isSignal": true; }; "xDomain": { "alias": "xDomain"; "required": false; "isSignal": true; }; "yDomain": { "alias": "yDomain"; "required": false; "isSignal": true; }; }, { "pointClick": "pointClick"; }, never, ["svg:g[ChartBrush]", "ChartLegend", "ChartZoomControls"], true, never>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export { ScatterChart, computeScatterLayout, resolveScatterDomains };
|
|
95
|
+
export type { ScatterLayout, ScatterLayoutInput, ScatterPoint, ScatterPointClickEvent };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { AreaLayoutInput, AreaLayoutResult, CHART_DATA_ATTRIBUTE, CHART_THEMES, CartesianBase, CartesianContext, CategoricalViewportContext, CategoryScale, ChartActivePoint, ChartConfig, ChartContainer, ChartContext, ChartDatum, ChartDimensions, ChartIndexRange, ChartMargin, ChartOrientation, ChartSeriesConfig, ChartStyle, ChartStyleVariant, ChartThemeKey, ChartTick, ClientPoint, LineCurve, LineLayoutResult, LinePoint, LineSeriesPath, NumericDomain, ScatterViewportContext, ValueScale, bandTicks, buildCartesianScales, buildChartCss, cloneLinear, computeAreaLayout, computeLineLayout, effectiveIndexRange, elementClientCenter, indexRangeSize, linearTicks, nearestCategoryIndex, normalizeIndexRange, normalizeNumericDomain, panIndexRange, panNumericDomain, pointToBandAdapter, provideCartesianFromLineLayout, seriesColorVar, sliceByIndexRange, xScale, yScale, zoomIndexRange, zoomNumericDomain } from '@ojiepermana/angular-chart/core';
|
|
2
|
+
export { ChartAxisX, ChartAxisY, ChartBrush, ChartCrosshair, ChartGrid, ChartLegend, ChartPointerTracker, ChartTooltip, ChartTooltipIndicator, ChartTooltipLabelFormatter, ChartTooltipPayload, ChartTooltipRow, ChartTooltipValueFormatter, ChartZoomControls, PieCenter, RadialCenter } from '@ojiepermana/angular-chart/primitives';
|