@aurum-grid/charts 0.0.0-stage → 0.2.0
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/LICENSE.md +24 -0
- package/README.md +6 -2
- package/dist/chart.d.ts +146 -0
- package/dist/chart.js +1158 -0
- package/dist/chart.js.map +1 -0
- package/dist/icons.d.ts +2 -0
- package/dist/icons.js +54 -0
- package/dist/icons.js.map +1 -0
- package/dist/index.d.ts +55 -0
- package/dist/index.js +105 -0
- package/dist/index.js.map +1 -0
- package/dist/integrated.d.ts +78 -0
- package/dist/integrated.js +563 -0
- package/dist/integrated.js.map +1 -0
- package/dist/smart.d.ts +17 -0
- package/dist/smart.js +121 -0
- package/dist/smart.js.map +1 -0
- package/dist/sparkline.d.ts +14 -0
- package/dist/sparkline.js +61 -0
- package/dist/sparkline.js.map +1 -0
- package/dist/studio.d.ts +50 -0
- package/dist/studio.js +271 -0
- package/dist/studio.js.map +1 -0
- package/dist/styles.css +221 -0
- package/dist/transform.d.ts +62 -0
- package/dist/transform.js +274 -0
- package/dist/transform.js.map +1 -0
- package/package.json +37 -3
package/LICENSE.md
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Aurum Grid Commercial License (draft template)
|
|
2
|
+
|
|
3
|
+
> This is a starting-point template, not legal advice. Have a lawyer review it before you sell licences.
|
|
4
|
+
|
|
5
|
+
Copyright (c) 2026 the Aurum Grid authors. All rights reserved.
|
|
6
|
+
|
|
7
|
+
## 1. Evaluation
|
|
8
|
+
You may install and use Aurum Grid ("the Software") free of charge for **30 days** to evaluate it. During and after
|
|
9
|
+
evaluation the Software runs unmodified; after 30 days without a valid licence key it displays an
|
|
10
|
+
"unlicensed" watermark and console notice.
|
|
11
|
+
|
|
12
|
+
## 2. Annual developer licence
|
|
13
|
+
A licence costs **USD 50 per developer per year**. Each licensed developer may use the Software to build an
|
|
14
|
+
unlimited number of applications and deploy them to an unlimited number of end users. The licence key must be
|
|
15
|
+
renewed every year to keep receiving updates and to keep the watermark removed in newly built versions.
|
|
16
|
+
|
|
17
|
+
## 3. Restrictions
|
|
18
|
+
You may not: (a) redistribute the Software as a standalone component library or competing product;
|
|
19
|
+
(b) remove, alter or circumvent the licence checks or watermark; (c) share licence keys between developers
|
|
20
|
+
beyond the purchased seat count.
|
|
21
|
+
|
|
22
|
+
## 4. No warranty
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
|
|
24
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY ARISING FROM THE USE OF THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @aurum-grid/charts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Aurum Grid Charts: themeable SVG charts, standalone or grid-integrated.
|
|
4
|
+
|
|
5
|
+
Part of **Aurum Grid** — the enterprise data grid. See the main documentation: https://github.com/YOUR_ORG/aurum-grid#readme
|
|
6
|
+
|
|
7
|
+
Licensing: 30-day evaluation, then $50 per developer per year. See LICENSE.md.
|
package/dist/chart.d.ts
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { type Datum } from './transform.js';
|
|
2
|
+
export type ChartType = 'column' | 'bar' | 'stackedColumn' | 'stackedBar' | 'normalizedColumn' | 'normalizedBar' | 'line' | 'area' | 'stackedArea' | 'normalizedArea' | 'pie' | 'donut' | 'nightingale' | 'scatter' | 'bubble' | 'histogram' | 'boxPlot' | 'rangeBar' | 'heatmap' | 'waterfall' | 'funnel' | 'pyramid' | 'gauge' | 'radar' | 'radarArea' | 'radialBar' | 'treemap' | 'sunburst' | 'combo';
|
|
3
|
+
export declare const CHART_TYPES: Array<{
|
|
4
|
+
value: ChartType;
|
|
5
|
+
label: string;
|
|
6
|
+
}>;
|
|
7
|
+
/** Chart types grouped the way the chart gallery shows them. */
|
|
8
|
+
export declare const CHART_GROUPS: Array<{
|
|
9
|
+
group: string;
|
|
10
|
+
types: ChartType[];
|
|
11
|
+
}>;
|
|
12
|
+
export declare const PALETTES: Record<string, string[] | null>;
|
|
13
|
+
export interface SeriesDef {
|
|
14
|
+
key: string;
|
|
15
|
+
name?: string;
|
|
16
|
+
/** CSS colour; defaults to the theme palette (--agc-1..8). */
|
|
17
|
+
color?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface PointEvent {
|
|
20
|
+
category: string;
|
|
21
|
+
seriesKey: string;
|
|
22
|
+
value: number;
|
|
23
|
+
datum: Datum | null;
|
|
24
|
+
}
|
|
25
|
+
export interface ReferenceLine {
|
|
26
|
+
value: number;
|
|
27
|
+
label?: string;
|
|
28
|
+
}
|
|
29
|
+
export interface ThresholdBand {
|
|
30
|
+
from: number;
|
|
31
|
+
to: number;
|
|
32
|
+
tone: 'bad' | 'warn' | 'good';
|
|
33
|
+
label?: string;
|
|
34
|
+
}
|
|
35
|
+
export interface ChartOptions {
|
|
36
|
+
type: ChartType;
|
|
37
|
+
data: Datum[];
|
|
38
|
+
categoryKey: string;
|
|
39
|
+
series: SeriesDef[];
|
|
40
|
+
title?: string;
|
|
41
|
+
subtitle?: string;
|
|
42
|
+
/** Pixel height, or 'fill' to fill the container's height (the container must have a height). */
|
|
43
|
+
height?: number | 'fill';
|
|
44
|
+
width?: number;
|
|
45
|
+
legend?: boolean;
|
|
46
|
+
valueFormat?: (v: number) => string;
|
|
47
|
+
onPointClick?: (p: PointEvent) => void;
|
|
48
|
+
/** Highlight one category (others are dimmed) — used for cross-filter feedback. */
|
|
49
|
+
selectedCategory?: string | null;
|
|
50
|
+
xKey?: string;
|
|
51
|
+
yKey?: string;
|
|
52
|
+
sizeKey?: string;
|
|
53
|
+
bins?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
ariaLabel?: string;
|
|
56
|
+
emptyText?: string;
|
|
57
|
+
/** Dashed least-squares trend line for each line/column series. */
|
|
58
|
+
trendline?: boolean;
|
|
59
|
+
/** Forecast the first series this many periods ahead (Holt's linear method) with a shaded range. */
|
|
60
|
+
forecast?: number;
|
|
61
|
+
/** Annotate the highest and lowest points of the first series. */
|
|
62
|
+
highlights?: boolean;
|
|
63
|
+
referenceLines?: ReferenceLine[];
|
|
64
|
+
/** Gauge target marker (same units as the value). */
|
|
65
|
+
target?: number;
|
|
66
|
+
/** Gauge background bands. */
|
|
67
|
+
thresholds?: ThresholdBand[];
|
|
68
|
+
/** Radar: scale each axis 0–100 by its maximum so different units compare. */
|
|
69
|
+
normalize?: boolean;
|
|
70
|
+
/** Series keys drawn against a right-hand axis (as lines). */
|
|
71
|
+
secondaryAxis?: string[];
|
|
72
|
+
/** Sunburst: a second category field for the outer ring (raw, non-aggregated rows). */
|
|
73
|
+
subCategoryKey?: string;
|
|
74
|
+
dataLabels?: boolean;
|
|
75
|
+
palette?: string[] | null;
|
|
76
|
+
axisLabel?: string;
|
|
77
|
+
}
|
|
78
|
+
export declare const paletteVar: (i: number) => string;
|
|
79
|
+
export declare function looksLikeTime(labels: string[]): boolean;
|
|
80
|
+
export declare class Chart {
|
|
81
|
+
private container;
|
|
82
|
+
readonly root: HTMLDivElement;
|
|
83
|
+
private plot;
|
|
84
|
+
private svgEl;
|
|
85
|
+
private legendEl;
|
|
86
|
+
private tooltip;
|
|
87
|
+
private titleEl;
|
|
88
|
+
private tableEl;
|
|
89
|
+
private emptyEl;
|
|
90
|
+
private hidden;
|
|
91
|
+
private ro;
|
|
92
|
+
private lastSize;
|
|
93
|
+
private destroyed;
|
|
94
|
+
options: ChartOptions;
|
|
95
|
+
constructor(container: HTMLElement, options: ChartOptions);
|
|
96
|
+
update(patch: Partial<ChartOptions>): void;
|
|
97
|
+
setType(type: ChartType): void;
|
|
98
|
+
getSvg(): SVGSVGElement;
|
|
99
|
+
/** Standalone SVG with computed colours and fonts inlined, so it renders identically elsewhere. */
|
|
100
|
+
toSvgString(): string;
|
|
101
|
+
/** Rasterise the chart to PNG (2× by default). */
|
|
102
|
+
toPngBlob(scale?: number): Promise<Blob>;
|
|
103
|
+
private viewSize;
|
|
104
|
+
destroy(): void;
|
|
105
|
+
private fmt;
|
|
106
|
+
private visibleSeries;
|
|
107
|
+
private color;
|
|
108
|
+
private catColor;
|
|
109
|
+
render(): void;
|
|
110
|
+
private summary;
|
|
111
|
+
private renderLegend;
|
|
112
|
+
private renderTable;
|
|
113
|
+
/** The data table (for a visible "Show data" view). */
|
|
114
|
+
getDataTable(): HTMLTableElement;
|
|
115
|
+
private bindMark;
|
|
116
|
+
private text;
|
|
117
|
+
/** Text with a background "pill" so annotations stay legible over marks. */
|
|
118
|
+
private callout;
|
|
119
|
+
private renderCartesian;
|
|
120
|
+
private drawReferenceLines;
|
|
121
|
+
private renderPie;
|
|
122
|
+
private renderFunnel;
|
|
123
|
+
private renderTreemap;
|
|
124
|
+
private renderHeatmap;
|
|
125
|
+
private renderGauge;
|
|
126
|
+
private renderRadar;
|
|
127
|
+
private arcPath;
|
|
128
|
+
/** Nightingale rose: equal angles, radius ∝ √value so area stays proportional. */
|
|
129
|
+
private renderNightingale;
|
|
130
|
+
/** Radial bar: one ring per category, arc length ∝ value. */
|
|
131
|
+
private renderRadialBar;
|
|
132
|
+
/**
|
|
133
|
+
* Sunburst: inner ring = categories, outer ring = each category split by series
|
|
134
|
+
* (or by `subCategoryKey` when the data is not pre-aggregated).
|
|
135
|
+
*/
|
|
136
|
+
private renderSunburst;
|
|
137
|
+
/** Pyramid: segments stacked into a triangle, height ∝ value. */
|
|
138
|
+
private renderPyramid;
|
|
139
|
+
/**
|
|
140
|
+
* Box plot (quartiles) and range bar (min–max with mean) per category, computed from raw rows:
|
|
141
|
+
* every row is one observation of series[0] in its category.
|
|
142
|
+
*/
|
|
143
|
+
private renderStat;
|
|
144
|
+
private renderScatter;
|
|
145
|
+
}
|
|
146
|
+
export declare function createChart(container: HTMLElement, options: ChartOptions): Chart;
|