@aquera/nile-visualization 0.3.0 → 0.4.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/dist/src/index.d.ts +7 -1
- package/dist/src/index.js +3 -0
- package/dist/src/internal/chart-adapters.js +86 -0
- package/dist/src/internal/highcharts-provider.js +27 -0
- package/dist/src/internal/types/all-chart-config.type.d.ts +2 -4
- package/dist/src/internal/types/chart-config.type.d.ts +3 -2
- package/dist/src/internal/types/chart-donut-config.type.d.ts +2 -0
- package/dist/src/internal/types/chart-heatmap-config.type.d.ts +19 -0
- package/dist/src/internal/types/chart-heatmap-config.type.js +2 -0
- package/dist/src/internal/types/chart-line-column-config.type.d.ts +14 -0
- package/dist/src/internal/types/chart-line-column-config.type.js +2 -0
- package/dist/src/internal/types/chart-organization-config.type.d.ts +13 -0
- package/dist/src/internal/types/chart-organization-config.type.js +2 -0
- package/dist/src/internal/types/index.d.ts +3 -0
- package/dist/src/internal/types/primitive-chart-config.type.d.ts +4 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +3 -1
- package/dist/src/nile-chart/index.d.ts +1 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +36 -96
- package/dist/src/nile-chart/nile-chart.css.js +1 -1
- package/dist/src/nile-chart/nile-chart.d.ts +36 -0
- package/dist/src/nile-chart/nile-chart.js +412 -5
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +2 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +16 -1
- package/dist/src/nile-heatmap-chart/index.d.ts +2 -0
- package/dist/src/nile-heatmap-chart/index.js +2 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.d.ts +1 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +28 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.d.ts +49 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +259 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +3 -1
- package/dist/src/nile-line-column-chart/index.d.ts +2 -0
- package/dist/src/nile-line-column-chart/index.js +2 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.css.d.ts +1 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +28 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.d.ts +42 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +205 -0
- package/dist/src/nile-organization-chart/index.d.ts +2 -0
- package/dist/src/nile-organization-chart/index.js +2 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.css.d.ts +1 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.css.js +28 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.d.ts +57 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +206 -0
- package/package.json +4 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { NileChart } from './nile-chart/index.js';
|
|
|
10
10
|
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart/index.js';
|
|
11
11
|
export { convertConfig, registerAdapter } from './nile-chart/index.js';
|
|
12
12
|
export { nileChartConfig } from './nile-chart/index.js';
|
|
13
|
-
export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from './nile-chart/index.js';
|
|
13
|
+
export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartOrganizationConfigType, ChartLineColumnConfigType, ChartHeatmapConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from './nile-chart/index.js';
|
|
14
14
|
export type { SeparatedChartDemoConfig } from './internal/separated-chart-config.js';
|
|
15
15
|
export { NileLineChart } from './nile-line-chart/index.js';
|
|
16
16
|
export type { LineChartSeriesData } from './nile-line-chart/index.js';
|
|
@@ -80,6 +80,12 @@ export { NileWaterfallChart } from './nile-waterfall-chart/index.js';
|
|
|
80
80
|
export type { WaterfallDataPoint } from './nile-waterfall-chart/index.js';
|
|
81
81
|
export { NileFunnelChart } from './nile-funnel-chart/index.js';
|
|
82
82
|
export type { FunnelDataPoint } from './nile-funnel-chart/index.js';
|
|
83
|
+
export { NileOrganizationChart } from './nile-organization-chart/index.js';
|
|
84
|
+
export type { OrgChartLink, OrgChartNode } from './nile-organization-chart/index.js';
|
|
85
|
+
export { NileLineColumnChart } from './nile-line-column-chart/index.js';
|
|
86
|
+
export type { LineColumnSeriesPart } from './nile-line-column-chart/index.js';
|
|
87
|
+
export { NileHeatmapChart } from './nile-heatmap-chart/index.js';
|
|
88
|
+
export type { HeatmapCell } from './nile-heatmap-chart/index.js';
|
|
83
89
|
export { NileFlameChart } from './nile-flame-chart/index.js';
|
|
84
90
|
export type { FlameChartPoint, FlameSunburstPoint, FlameChartLayout, } from './nile-flame-chart/index.js';
|
|
85
91
|
export { NileSpiderwebChart } from './nile-spiderweb-chart/index.js';
|
package/dist/src/index.js
CHANGED
|
@@ -43,6 +43,9 @@ export { NileRadarChart } from './nile-radar-chart/index.js';
|
|
|
43
43
|
export { NileGaugeChart } from './nile-gauge-chart/index.js';
|
|
44
44
|
export { NileWaterfallChart } from './nile-waterfall-chart/index.js';
|
|
45
45
|
export { NileFunnelChart } from './nile-funnel-chart/index.js';
|
|
46
|
+
export { NileOrganizationChart } from './nile-organization-chart/index.js';
|
|
47
|
+
export { NileLineColumnChart } from './nile-line-column-chart/index.js';
|
|
48
|
+
export { NileHeatmapChart } from './nile-heatmap-chart/index.js';
|
|
46
49
|
export { NileFlameChart } from './nile-flame-chart/index.js';
|
|
47
50
|
export { NileSpiderwebChart } from './nile-spiderweb-chart/index.js';
|
|
48
51
|
export { NileKpiChart } from './nile-kpi-chart/index.js';
|
|
@@ -136,6 +136,92 @@ const adapters = {
|
|
|
136
136
|
throw new Error('Expected anomaly config');
|
|
137
137
|
return { ...config, type: 'trendline', data: config.data, categories: config.categories };
|
|
138
138
|
},
|
|
139
|
+
// ── Bar-like (bar, column, stacked) ↔ each other ──
|
|
140
|
+
'bar->stacked': (config) => {
|
|
141
|
+
if (config.type !== 'bar')
|
|
142
|
+
throw new Error('Expected bar config');
|
|
143
|
+
return { ...config, type: 'stacked', stackMode: 'normal' };
|
|
144
|
+
},
|
|
145
|
+
'stacked->bar': (config) => {
|
|
146
|
+
if (config.type !== 'stacked')
|
|
147
|
+
throw new Error('Expected stacked config');
|
|
148
|
+
return { ...config, type: 'bar' };
|
|
149
|
+
},
|
|
150
|
+
'column->stacked': (config) => {
|
|
151
|
+
if (config.type !== 'column')
|
|
152
|
+
throw new Error('Expected column config');
|
|
153
|
+
return { ...config, type: 'stacked', stackMode: 'normal' };
|
|
154
|
+
},
|
|
155
|
+
'stacked->column': (config) => {
|
|
156
|
+
if (config.type !== 'stacked')
|
|
157
|
+
throw new Error('Expected stacked config');
|
|
158
|
+
return { ...config, type: 'column' };
|
|
159
|
+
},
|
|
160
|
+
'bar->column': (config) => {
|
|
161
|
+
if (config.type !== 'bar')
|
|
162
|
+
throw new Error('Expected bar config');
|
|
163
|
+
return { ...config, type: 'column' };
|
|
164
|
+
},
|
|
165
|
+
'column->bar': (config) => {
|
|
166
|
+
if (config.type !== 'column')
|
|
167
|
+
throw new Error('Expected column config');
|
|
168
|
+
return { ...config, type: 'bar' };
|
|
169
|
+
},
|
|
170
|
+
// ── Stacked ↔ pie / trendline / anomaly (same as bar) ──
|
|
171
|
+
'stacked->pie': (config) => {
|
|
172
|
+
if (config.type !== 'stacked')
|
|
173
|
+
throw new Error('Expected stacked config');
|
|
174
|
+
const agg = config.switchAggregation ?? 'by-category';
|
|
175
|
+
return {
|
|
176
|
+
...config,
|
|
177
|
+
type: 'pie',
|
|
178
|
+
data: barLikeToPie(config.data, config.categories ?? [], agg),
|
|
179
|
+
seriesName: config.chartTitle || 'Series',
|
|
180
|
+
};
|
|
181
|
+
},
|
|
182
|
+
'pie->stacked': (config) => {
|
|
183
|
+
if (config.type !== 'pie')
|
|
184
|
+
throw new Error('Expected pie config');
|
|
185
|
+
const { data, categories } = pieToBarLike(config.data, config.seriesName);
|
|
186
|
+
return { ...config, type: 'stacked', data, categories, stackMode: 'normal' };
|
|
187
|
+
},
|
|
188
|
+
'stacked->trendline': (config) => {
|
|
189
|
+
if (config.type !== 'stacked')
|
|
190
|
+
throw new Error('Expected stacked config');
|
|
191
|
+
return { ...config, type: 'trendline', data: config.data, categories: config.categories };
|
|
192
|
+
},
|
|
193
|
+
'trendline->stacked': (config) => {
|
|
194
|
+
if (config.type !== 'trendline')
|
|
195
|
+
throw new Error('Expected trendline config');
|
|
196
|
+
return { ...config, type: 'stacked', stackMode: 'normal', data: config.data, categories: config.categories };
|
|
197
|
+
},
|
|
198
|
+
'stacked->anomaly': (config) => {
|
|
199
|
+
if (config.type !== 'stacked')
|
|
200
|
+
throw new Error('Expected stacked config');
|
|
201
|
+
return { ...config, type: 'anomaly', data: config.data, categories: config.categories };
|
|
202
|
+
},
|
|
203
|
+
'anomaly->stacked': (config) => {
|
|
204
|
+
if (config.type !== 'anomaly')
|
|
205
|
+
throw new Error('Expected anomaly config');
|
|
206
|
+
return { ...config, type: 'stacked', stackMode: 'normal', data: config.data, categories: config.categories };
|
|
207
|
+
},
|
|
208
|
+
'column->pie': (config) => {
|
|
209
|
+
if (config.type !== 'column')
|
|
210
|
+
throw new Error('Expected column config');
|
|
211
|
+
const agg = config.switchAggregation ?? 'by-category';
|
|
212
|
+
return {
|
|
213
|
+
...config,
|
|
214
|
+
type: 'pie',
|
|
215
|
+
data: barLikeToPie(config.data, config.categories ?? [], agg),
|
|
216
|
+
seriesName: config.chartTitle || 'Series',
|
|
217
|
+
};
|
|
218
|
+
},
|
|
219
|
+
'pie->column': (config) => {
|
|
220
|
+
if (config.type !== 'pie')
|
|
221
|
+
throw new Error('Expected pie config');
|
|
222
|
+
const { data, categories } = pieToBarLike(config.data, config.seriesName);
|
|
223
|
+
return { ...config, type: 'column', data, categories };
|
|
224
|
+
},
|
|
139
225
|
};
|
|
140
226
|
/**
|
|
141
227
|
* Register a custom adapter for converting between chart types.
|
|
@@ -122,6 +122,33 @@ async function init() {
|
|
|
122
122
|
catch {
|
|
123
123
|
// xrange not available — consumer may have loaded it globally
|
|
124
124
|
}
|
|
125
|
+
try {
|
|
126
|
+
const sankey = await import('highcharts/modules/sankey.js');
|
|
127
|
+
if (typeof sankey.default === 'function') {
|
|
128
|
+
sankey.default(_Highcharts);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
// sankey not available — required base for organization; consumer may have loaded globally
|
|
133
|
+
}
|
|
134
|
+
try {
|
|
135
|
+
const organization = await import('highcharts/modules/organization.js');
|
|
136
|
+
if (typeof organization.default === 'function') {
|
|
137
|
+
organization.default(_Highcharts);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
catch {
|
|
141
|
+
// organization not available — consumer may have loaded it globally
|
|
142
|
+
}
|
|
143
|
+
try {
|
|
144
|
+
const heatmap = await import('highcharts/modules/heatmap.js');
|
|
145
|
+
if (typeof heatmap.default === 'function') {
|
|
146
|
+
heatmap.default(_Highcharts);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
catch {
|
|
150
|
+
// heatmap not available — consumer may have loaded it globally
|
|
151
|
+
}
|
|
125
152
|
}
|
|
126
153
|
catch {
|
|
127
154
|
// Fallback to global (works in CDN/browser context)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { ChartConfigType } from './chart-config.type.js';
|
|
2
|
-
import type { PrimitiveChartConfigType } from './primitive-chart-config.type.js';
|
|
3
2
|
/**
|
|
4
3
|
* Union of chart payload shapes (by `type`) across the package.
|
|
5
|
-
*
|
|
6
|
-
* - {@link PrimitiveChartConfigType}: `<nile-*-chart>` tags with `el.config = { chart, aq }`
|
|
4
|
+
* Same as {@link ChartConfigType}: primitives are included for `<nile-chart>` and `<nile-*-chart>`.
|
|
7
5
|
*/
|
|
8
|
-
export type AllChartConfigType = ChartConfigType
|
|
6
|
+
export type AllChartConfigType = ChartConfigType;
|
|
@@ -12,5 +12,6 @@ import type { ChartSplineConfigType } from './chart-spline-config.type.js';
|
|
|
12
12
|
import type { ChartRadarConfigType } from './chart-radar-config.type.js';
|
|
13
13
|
import type { ChartGaugeConfigType } from './chart-gauge-config.type.js';
|
|
14
14
|
import type { ChartWaterfallConfigType } from './chart-waterfall-config.type.js';
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
import type { PrimitiveChartConfigType } from './primitive-chart-config.type.js';
|
|
16
|
+
/** Core chart configs (bar, pie, …) plus all primitive series types — use with `<nile-chart>` via `chart.type`. */
|
|
17
|
+
export type ChartConfigType = ChartBarConfigType | ChartPieConfigType | ChartTrendlineConfigType | ChartAnomalyConfigType | ChartLineConfigType | ChartAreaConfigType | ChartColumnConfigType | ChartDonutConfigType | ChartScatterConfigType | ChartBubbleConfigType | ChartSplineConfigType | ChartRadarConfigType | ChartGaugeConfigType | ChartWaterfallConfigType | PrimitiveChartConfigType;
|
|
@@ -6,6 +6,8 @@ export interface ChartDonutConfigType {
|
|
|
6
6
|
data: DonutChartSeriesData[];
|
|
7
7
|
seriesName?: string;
|
|
8
8
|
innerSize?: string;
|
|
9
|
+
/** Half-donut (180°) with arc on top; adjusts center and angles. */
|
|
10
|
+
semiCircle?: boolean;
|
|
9
11
|
showDataLabels?: boolean;
|
|
10
12
|
showLegend?: boolean;
|
|
11
13
|
height?: string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Options } from 'highcharts';
|
|
2
|
+
import type { HeatmapCell } from '../../nile-heatmap-chart/nile-heatmap-chart.js';
|
|
3
|
+
/** Heatmap (`<nile-heatmap-chart>`): cells use category indices on x and y. */
|
|
4
|
+
export interface ChartHeatmapConfigType {
|
|
5
|
+
type: 'heatmap';
|
|
6
|
+
xCategories: string[];
|
|
7
|
+
yCategories: string[];
|
|
8
|
+
data: HeatmapCell[];
|
|
9
|
+
seriesName?: string;
|
|
10
|
+
colorMin?: number;
|
|
11
|
+
colorMax?: number;
|
|
12
|
+
minColor?: string;
|
|
13
|
+
maxColor?: string;
|
|
14
|
+
colorAxisTitle?: string;
|
|
15
|
+
showDataLabels?: boolean;
|
|
16
|
+
height?: string;
|
|
17
|
+
loading?: boolean;
|
|
18
|
+
options?: Options;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Options } from 'highcharts';
|
|
2
|
+
import type { LineColumnSeriesPart } from '../../nile-line-column-chart/nile-line-column-chart.js';
|
|
3
|
+
/** Dual-axis combo: columns on the left axis, line on the right (`<nile-line-column-chart>`). */
|
|
4
|
+
export interface ChartLineColumnConfigType {
|
|
5
|
+
type: 'line-column';
|
|
6
|
+
categories: string[];
|
|
7
|
+
columnSeries: LineColumnSeriesPart;
|
|
8
|
+
lineSeries: LineColumnSeriesPart;
|
|
9
|
+
columnAxisTitle?: string;
|
|
10
|
+
lineAxisTitle?: string;
|
|
11
|
+
height?: string;
|
|
12
|
+
loading?: boolean;
|
|
13
|
+
options?: Options;
|
|
14
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Options } from 'highcharts';
|
|
2
|
+
import type { OrgChartLink, OrgChartNode } from '../../nile-organization-chart/nile-organization-chart.js';
|
|
3
|
+
/** Organization chart config (`<nile-organization-chart>` / `config.chart`). */
|
|
4
|
+
export interface ChartOrganizationConfigType {
|
|
5
|
+
type: 'organization';
|
|
6
|
+
nodes: OrgChartNode[];
|
|
7
|
+
links: OrgChartLink[];
|
|
8
|
+
seriesName?: string;
|
|
9
|
+
inverted?: boolean;
|
|
10
|
+
height?: string;
|
|
11
|
+
loading?: boolean;
|
|
12
|
+
options?: Options;
|
|
13
|
+
}
|
|
@@ -39,6 +39,9 @@ export type { ChartVectorConfigType } from './chart-vector-config.type.js';
|
|
|
39
39
|
export type { ChartXrangeConfigType } from './chart-xrange-config.type.js';
|
|
40
40
|
export type { ChartFanConfigType } from './chart-fan-config.type.js';
|
|
41
41
|
export type { ChartFunnelConfigType } from './chart-funnel-config.type.js';
|
|
42
|
+
export type { ChartOrganizationConfigType } from './chart-organization-config.type.js';
|
|
43
|
+
export type { ChartLineColumnConfigType } from './chart-line-column-config.type.js';
|
|
44
|
+
export type { ChartHeatmapConfigType } from './chart-heatmap-config.type.js';
|
|
42
45
|
export type { ChartFlameConfigType } from './chart-flame-config.type.js';
|
|
43
46
|
export type { ChartSpiderwebConfigType } from './chart-spiderweb-config.type.js';
|
|
44
47
|
export type { ChartKpiPropsType } from './chart-kpi-config.type.js';
|
|
@@ -7,6 +7,9 @@ import type { ChartTimelineConfigType } from './chart-timeline-config.type.js';
|
|
|
7
7
|
import type { ChartDumbbellConfigType } from './chart-dumbbell-config.type.js';
|
|
8
8
|
import type { ChartFanConfigType } from './chart-fan-config.type.js';
|
|
9
9
|
import type { ChartFunnelConfigType } from './chart-funnel-config.type.js';
|
|
10
|
+
import type { ChartOrganizationConfigType } from './chart-organization-config.type.js';
|
|
11
|
+
import type { ChartLineColumnConfigType } from './chart-line-column-config.type.js';
|
|
12
|
+
import type { ChartHeatmapConfigType } from './chart-heatmap-config.type.js';
|
|
10
13
|
import type { ChartFlameConfigType } from './chart-flame-config.type.js';
|
|
11
14
|
import type { ChartSpiderwebConfigType } from './chart-spiderweb-config.type.js';
|
|
12
15
|
import type { ChartInvertedAreaConfigType } from './chart-area-config.type.js';
|
|
@@ -29,4 +32,4 @@ import type { ChartXrangeConfigType } from './chart-xrange-config.type.js';
|
|
|
29
32
|
* Chart configs for primitive `<nile-*-chart>` elements (`el.config = { chart, aq }`).
|
|
30
33
|
* Discriminated on `chart.type`.
|
|
31
34
|
*/
|
|
32
|
-
export type PrimitiveChartConfigType = ChartInvertedAreaConfigType | ChartColumnPyramidConfigType | ChartLollipopConfigType | ChartAreaSplineConfigType | ChartAreaNegativeConfigType | ChartAreaRangeConfigType | ChartColumnRangeConfigType | ChartColumnDrilldownConfigType | ChartRadialBarConfigType | ChartVariablePieConfigType | ChartDumbbellLowerConfigType | ChartDumbbellUpperConfigType | ChartEulerConfigType | ChartPolygonConfigType | ChartVectorConfigType | ChartXrangeConfigType | ChartClusterConfigType | ChartStackedConfigType | ChartHistogramConfigType | ChartBellcurveConfigType | ChartBoxplotConfigType | ChartTimelineConfigType | ChartDumbbellConfigType | ChartFanConfigType | ChartFunnelConfigType | ChartFlameConfigType | ChartSpiderwebConfigType;
|
|
35
|
+
export type PrimitiveChartConfigType = ChartInvertedAreaConfigType | ChartColumnPyramidConfigType | ChartLollipopConfigType | ChartAreaSplineConfigType | ChartAreaNegativeConfigType | ChartAreaRangeConfigType | ChartColumnRangeConfigType | ChartColumnDrilldownConfigType | ChartRadialBarConfigType | ChartVariablePieConfigType | ChartDumbbellLowerConfigType | ChartDumbbellUpperConfigType | ChartEulerConfigType | ChartPolygonConfigType | ChartVectorConfigType | ChartXrangeConfigType | ChartClusterConfigType | ChartStackedConfigType | ChartHistogramConfigType | ChartBellcurveConfigType | ChartBoxplotConfigType | ChartTimelineConfigType | ChartDumbbellConfigType | ChartFanConfigType | ChartFunnelConfigType | ChartOrganizationConfigType | ChartLineColumnConfigType | ChartHeatmapConfigType | ChartFlameConfigType | ChartSpiderwebConfigType;
|
|
@@ -100,7 +100,9 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
|
|
|
100
100
|
const self = this;
|
|
101
101
|
// Bell curve derives mean & σ from the **y** values of the base series (see Highcharts docs).
|
|
102
102
|
// Do not use [x, 0] — that makes every y zero and collapses the curve.
|
|
103
|
-
|
|
103
|
+
// Highcharts #15: scatter x must be ascending; raw samples are often unsorted.
|
|
104
|
+
const sorted = [...this.data].sort((a, b) => a - b);
|
|
105
|
+
const scatterData = sorted.map(v => [v, v]);
|
|
104
106
|
const pts = this.pointsInInterval > 0 ? this.pointsInInterval : 40;
|
|
105
107
|
const iv = this.intervals > 0 ? this.intervals : 3;
|
|
106
108
|
return deepMerge({
|
|
@@ -2,4 +2,4 @@ export { NileChart } from './nile-chart.js';
|
|
|
2
2
|
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart-config.js';
|
|
3
3
|
export { convertConfig, registerAdapter } from '../internal/chart-adapters.js';
|
|
4
4
|
export { nileChartConfig } from './nile-chart-config-builder.js';
|
|
5
|
-
export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from '../internal/types/index.js';
|
|
5
|
+
export type { AiConfigType, SwitchableConfigType, AqConfigType, ChartBarConfigType, ChartPieConfigType, ChartTrendlineConfigType, ChartAnomalyConfigType, ChartLineConfigType, ChartAreaConfigType, ChartInvertedAreaConfigType, ChartColumnConfigType, ChartDonutConfigType, ChartScatterConfigType, ChartBubbleConfigType, ChartSplineConfigType, ChartRadarConfigType, ChartGaugeConfigType, ChartWaterfallConfigType, ChartClusterConfigType, ChartStackedConfigType, ChartHistogramConfigType, ChartBellcurveConfigType, ChartBoxplotConfigType, ChartTimelineConfigType, ChartDumbbellConfigType, ChartDumbbellLowerConfigType, ChartDumbbellUpperConfigType, ChartColumnPyramidConfigType, ChartLollipopConfigType, ChartAreaSplineConfigType, ChartAreaNegativeConfigType, ChartAreaRangeConfigType, ChartColumnRangeConfigType, ChartColumnDrilldownConfigType, ChartRadialBarConfigType, ChartVariablePieConfigType, ChartEulerConfigType, ChartPolygonConfigType, ChartVectorConfigType, ChartXrangeConfigType, ChartFanConfigType, ChartFunnelConfigType, ChartOrganizationConfigType, ChartLineColumnConfigType, ChartHeatmapConfigType, ChartFlameConfigType, ChartSpiderwebConfigType, ChartKpiPropsType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from '../internal/types/index.js';
|
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { TrendlineSeriesData, ForecastConfig } from '../nile-trendline-chart/nile-trendline-chart.js';
|
|
5
|
-
import type { AnomalySeriesData, AnomalyConfig } from '../nile-anomaly-chart/nile-anomaly-chart.js';
|
|
6
|
-
import type { LineChartSeriesData } from '../nile-line-chart/nile-line-chart.js';
|
|
7
|
-
import type { AreaChartSeriesData } from '../nile-area-chart/nile-area-chart.js';
|
|
8
|
-
import type { ColumnChartSeriesData } from '../nile-column-chart/nile-column-chart.js';
|
|
9
|
-
import type { DonutChartSeriesData } from '../nile-donut-chart/nile-donut-chart.js';
|
|
10
|
-
import type { ScatterChartSeriesData } from '../nile-scatter-chart/nile-scatter-chart.js';
|
|
11
|
-
import type { BubbleChartSeriesData } from '../nile-bubble-chart/nile-bubble-chart.js';
|
|
12
|
-
import type { SplineChartSeriesData } from '../nile-spline-chart/nile-spline-chart.js';
|
|
13
|
-
import type { RadarChartSeriesData } from '../nile-radar-chart/nile-radar-chart.js';
|
|
14
|
-
import type { GaugeBand } from '../nile-gauge-chart/nile-gauge-chart.js';
|
|
15
|
-
import type { WaterfallDataPoint } from '../nile-waterfall-chart/nile-waterfall-chart.js';
|
|
16
|
-
export type ChartType = 'bar' | 'pie' | 'trendline' | 'anomaly' | 'line' | 'area' | 'column' | 'donut' | 'scatter' | 'bubble' | 'spline' | 'radar' | 'gauge' | 'waterfall';
|
|
1
|
+
import type { ChartConfigType } from '../internal/types/chart-config.type.js';
|
|
2
|
+
/** Every supported `chart.type` value for `<nile-chart>`. */
|
|
3
|
+
export type ChartType = ChartConfigType['type'];
|
|
17
4
|
export type SwitchAggregation = 'by-category' | 'by-series' | 'flatten';
|
|
18
5
|
export interface NileAiConfig {
|
|
19
6
|
/** Show the AI chat icon on the chart. Default: false. */
|
|
@@ -23,110 +10,63 @@ export interface NileAiConfig {
|
|
|
23
10
|
/** Initial assistant message shown when the chat panel opens. */
|
|
24
11
|
welcomeMessage?: string;
|
|
25
12
|
}
|
|
13
|
+
/** Fields merged from `aq` (and shared card chrome) onto `chart` for `<nile-chart>`. */
|
|
26
14
|
export interface NileChartConfigBase {
|
|
27
15
|
chartTitle?: string;
|
|
28
16
|
chartSubtitle?: string;
|
|
29
17
|
height?: string;
|
|
30
18
|
loading?: boolean;
|
|
31
|
-
options?: Options;
|
|
19
|
+
options?: import('highcharts').Options;
|
|
32
20
|
summary?: string;
|
|
33
21
|
toggleLabel?: string;
|
|
34
22
|
/** Chart types the user can switch to. Shows type-switch UI when set. */
|
|
35
23
|
switchableTypes?: ChartType[];
|
|
36
|
-
/** How to aggregate bar data when converting to pie. Default: 'by-category'. */
|
|
24
|
+
/** How to aggregate bar-like data when converting to pie. Default: 'by-category'. */
|
|
37
25
|
switchAggregation?: SwitchAggregation;
|
|
38
26
|
/** AI chat configuration. When ai.enabled is true, shows the allsearch icon. */
|
|
39
27
|
ai?: NileAiConfig;
|
|
40
28
|
}
|
|
41
|
-
|
|
29
|
+
/** Flat config for `<nile-chart>` after merging `chart` + `aq`. */
|
|
30
|
+
export type NileChartConfig = ChartConfigType & NileChartConfigBase;
|
|
31
|
+
export type NileBarChartConfig = Extract<NileChartConfig, {
|
|
42
32
|
type: 'bar';
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
yAxisTitle?: string;
|
|
46
|
-
}
|
|
47
|
-
export interface NilePieChartConfig extends NileChartConfigBase {
|
|
33
|
+
}>;
|
|
34
|
+
export type NilePieChartConfig = Extract<NileChartConfig, {
|
|
48
35
|
type: 'pie';
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
showDataLabels?: boolean;
|
|
52
|
-
showLegend?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export interface NileTrendlineChartConfig extends NileChartConfigBase {
|
|
36
|
+
}>;
|
|
37
|
+
export type NileTrendlineChartConfig = Extract<NileChartConfig, {
|
|
55
38
|
type: 'trendline';
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
yAxisTitle?: string;
|
|
59
|
-
forecast?: ForecastConfig;
|
|
60
|
-
}
|
|
61
|
-
export interface NileAnomalyChartConfig extends NileChartConfigBase {
|
|
39
|
+
}>;
|
|
40
|
+
export type NileAnomalyChartConfig = Extract<NileChartConfig, {
|
|
62
41
|
type: 'anomaly';
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
yAxisTitle?: string;
|
|
66
|
-
anomaly?: AnomalyConfig;
|
|
67
|
-
}
|
|
68
|
-
export interface NileLineChartConfig extends NileChartConfigBase {
|
|
42
|
+
}>;
|
|
43
|
+
export type NileLineChartConfig = Extract<NileChartConfig, {
|
|
69
44
|
type: 'line';
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
yAxisTitle?: string;
|
|
73
|
-
}
|
|
74
|
-
export interface NileAreaChartConfig extends NileChartConfigBase {
|
|
45
|
+
}>;
|
|
46
|
+
export type NileAreaChartConfig = Extract<NileChartConfig, {
|
|
75
47
|
type: 'area';
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
yAxisTitle?: string;
|
|
79
|
-
stacked?: boolean;
|
|
80
|
-
}
|
|
81
|
-
export interface NileColumnChartConfig extends NileChartConfigBase {
|
|
48
|
+
}>;
|
|
49
|
+
export type NileColumnChartConfig = Extract<NileChartConfig, {
|
|
82
50
|
type: 'column';
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
yAxisTitle?: string;
|
|
86
|
-
}
|
|
87
|
-
export interface NileDonutChartConfig extends NileChartConfigBase {
|
|
51
|
+
}>;
|
|
52
|
+
export type NileDonutChartConfig = Extract<NileChartConfig, {
|
|
88
53
|
type: 'donut';
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
innerSize?: string;
|
|
92
|
-
showDataLabels?: boolean;
|
|
93
|
-
showLegend?: boolean;
|
|
94
|
-
}
|
|
95
|
-
export interface NileScatterChartConfig extends NileChartConfigBase {
|
|
54
|
+
}>;
|
|
55
|
+
export type NileScatterChartConfig = Extract<NileChartConfig, {
|
|
96
56
|
type: 'scatter';
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
yAxisTitle?: string;
|
|
100
|
-
}
|
|
101
|
-
export interface NileBubbleChartConfig extends NileChartConfigBase {
|
|
57
|
+
}>;
|
|
58
|
+
export type NileBubbleChartConfig = Extract<NileChartConfig, {
|
|
102
59
|
type: 'bubble';
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
yAxisTitle?: string;
|
|
106
|
-
}
|
|
107
|
-
export interface NileSplineChartConfig extends NileChartConfigBase {
|
|
60
|
+
}>;
|
|
61
|
+
export type NileSplineChartConfig = Extract<NileChartConfig, {
|
|
108
62
|
type: 'spline';
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
yAxisTitle?: string;
|
|
112
|
-
}
|
|
113
|
-
export interface NileRadarChartConfig extends NileChartConfigBase {
|
|
63
|
+
}>;
|
|
64
|
+
export type NileRadarChartConfig = Extract<NileChartConfig, {
|
|
114
65
|
type: 'radar';
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
showArea?: boolean;
|
|
118
|
-
}
|
|
119
|
-
export interface NileGaugeChartConfig extends NileChartConfigBase {
|
|
66
|
+
}>;
|
|
67
|
+
export type NileGaugeChartConfig = Extract<NileChartConfig, {
|
|
120
68
|
type: 'gauge';
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
max?: number;
|
|
124
|
-
suffix?: string;
|
|
125
|
-
bands?: GaugeBand[];
|
|
126
|
-
}
|
|
127
|
-
export interface NileWaterfallChartConfig extends NileChartConfigBase {
|
|
69
|
+
}>;
|
|
70
|
+
export type NileWaterfallChartConfig = Extract<NileChartConfig, {
|
|
128
71
|
type: 'waterfall';
|
|
129
|
-
|
|
130
|
-
yAxisTitle?: string;
|
|
131
|
-
}
|
|
132
|
-
export type NileChartConfig = NileBarChartConfig | NilePieChartConfig | NileTrendlineChartConfig | NileAnomalyChartConfig | NileLineChartConfig | NileAreaChartConfig | NileColumnChartConfig | NileDonutChartConfig | NileScatterChartConfig | NileBubbleChartConfig | NileSplineChartConfig | NileRadarChartConfig | NileGaugeChartConfig | NileWaterfallChartConfig;
|
|
72
|
+
}>;
|
|
@@ -13,7 +13,7 @@ export const styles = css `
|
|
|
13
13
|
/* ── Unified Card Container ── */
|
|
14
14
|
|
|
15
15
|
.chart-card {
|
|
16
|
-
background: var(--nile-colors-white-base, var(--ng-colors-bg-
|
|
16
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-quaternary-alt));
|
|
17
17
|
border: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
18
18
|
border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-xl));
|
|
19
19
|
box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));
|
|
@@ -16,11 +16,46 @@ import '../nile-spline-chart/index.js';
|
|
|
16
16
|
import '../nile-radar-chart/index.js';
|
|
17
17
|
import '../nile-gauge-chart/index.js';
|
|
18
18
|
import '../nile-waterfall-chart/index.js';
|
|
19
|
+
import '../nile-cluster-chart/index.js';
|
|
20
|
+
import '../nile-stacked-chart/index.js';
|
|
21
|
+
import '../nile-histogram-chart/index.js';
|
|
22
|
+
import '../nile-bellcurve-chart/index.js';
|
|
23
|
+
import '../nile-boxplot-chart/index.js';
|
|
24
|
+
import '../nile-timeline-chart/index.js';
|
|
25
|
+
import '../nile-dumbbell-chart/index.js';
|
|
26
|
+
import '../nile-dumbbell-lower-chart/index.js';
|
|
27
|
+
import '../nile-dumbbell-upper-chart/index.js';
|
|
28
|
+
import '../nile-fan-chart/index.js';
|
|
29
|
+
import '../nile-funnel-chart/index.js';
|
|
30
|
+
import '../nile-organization-chart/index.js';
|
|
31
|
+
import '../nile-line-column-chart/index.js';
|
|
32
|
+
import '../nile-heatmap-chart/index.js';
|
|
33
|
+
import '../nile-flame-chart/index.js';
|
|
34
|
+
import '../nile-spiderweb-chart/index.js';
|
|
35
|
+
import '../nile-column-pyramid-chart/index.js';
|
|
36
|
+
import '../nile-lollipop-chart/index.js';
|
|
37
|
+
import '../nile-inverted-area-chart/index.js';
|
|
38
|
+
import '../nile-area-spline-chart/index.js';
|
|
39
|
+
import '../nile-area-negative-chart/index.js';
|
|
40
|
+
import '../nile-area-range-chart/index.js';
|
|
41
|
+
import '../nile-column-range-chart/index.js';
|
|
42
|
+
import '../nile-column-drilldown-chart/index.js';
|
|
43
|
+
import '../nile-radial-bar-chart/index.js';
|
|
44
|
+
import '../nile-variable-pie-chart/index.js';
|
|
45
|
+
import '../nile-euler-chart/index.js';
|
|
46
|
+
import '../nile-polygon-chart/index.js';
|
|
47
|
+
import '../nile-vector-chart/index.js';
|
|
48
|
+
import '../nile-xrange-chart/index.js';
|
|
19
49
|
import '../nile-ai-panel/index.js';
|
|
20
50
|
export declare class NileChart extends NileElement {
|
|
21
51
|
static styles: CSSResultGroup;
|
|
22
52
|
/** Full chart configuration. Accepts flat NileChartConfig or separated { chart, aq } input. */
|
|
23
53
|
config: NileChartConfig | NileChartConfigInputType | null;
|
|
54
|
+
/**
|
|
55
|
+
* When set, fills `chart.type` if the config omits it (same values as `chart.type`, e.g. `stacked`, `pie`).
|
|
56
|
+
* Usage: `<nile-chart chart-type="pie" />` plus `config.chart` with series data only.
|
|
57
|
+
*/
|
|
58
|
+
chartTypeAttr: string;
|
|
24
59
|
/** The summary/insight text displayed in the overlay (fallback when config is not set). */
|
|
25
60
|
summary: string;
|
|
26
61
|
/** Label for the toggle button (fallback when config is not set). */
|
|
@@ -38,6 +73,7 @@ export declare class NileChart extends NileElement {
|
|
|
38
73
|
private handleOutsideClick;
|
|
39
74
|
connectedCallback(): void;
|
|
40
75
|
disconnectedCallback(): void;
|
|
76
|
+
private mergeChartTypeFromAttr;
|
|
41
77
|
/** Resolve { chart, aq } input to flat NileChartConfig. */
|
|
42
78
|
private resolveConfig;
|
|
43
79
|
private resolvedConfig;
|