@aquera/nile-visualization 1.7.0 → 1.9.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 +1 -1
- package/dist/src/internal/dashboard-adapters.d.ts +1 -0
- package/dist/src/internal/dashboard-adapters.js +11 -1
- package/dist/src/internal/highcharts-provider.d.ts +6 -0
- package/dist/src/internal/highcharts-provider.js +32 -0
- package/dist/src/internal/types/aq-config.type.d.ts +5 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.js +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +1 -1
- package/dist/src/nile-area-chart/nile-area-chart.css.js +2 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +1 -1
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.css.js +2 -0
- package/dist/src/nile-area-negative-chart/nile-area-negative-chart.js +1 -1
- package/dist/src/nile-area-range-chart/nile-area-range-chart.css.js +2 -0
- package/dist/src/nile-area-range-chart/nile-area-range-chart.js +1 -1
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.css.js +2 -0
- package/dist/src/nile-area-spline-chart/nile-area-spline-chart.js +1 -1
- package/dist/src/nile-bar-chart/nile-bar-chart.css.js +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +1 -1
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.css.js +2 -0
- package/dist/src/nile-bellcurve-chart/nile-bellcurve-chart.js +1 -1
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.css.js +2 -0
- package/dist/src/nile-boxplot-chart/nile-boxplot-chart.js +1 -1
- package/dist/src/nile-bubble-chart/nile-bubble-chart.css.js +2 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +1 -1
- package/dist/src/nile-chart/index.d.ts +1 -1
- package/dist/src/nile-chart/nile-chart-config.d.ts +69 -1
- package/dist/src/nile-chart/nile-chart.css.d.ts +1 -0
- package/dist/src/nile-chart/nile-chart.css.js +194 -82
- package/dist/src/nile-chart/nile-chart.d.ts +25 -6
- package/dist/src/nile-chart/nile-chart.js +241 -100
- package/dist/src/nile-cluster-chart/nile-cluster-chart.css.js +2 -0
- package/dist/src/nile-cluster-chart/nile-cluster-chart.js +1 -1
- package/dist/src/nile-column-chart/nile-column-chart.css.js +2 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +1 -1
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.css.js +2 -0
- package/dist/src/nile-column-drilldown-chart/nile-column-drilldown-chart.js +1 -1
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.css.js +2 -0
- package/dist/src/nile-column-pyramid-chart/nile-column-pyramid-chart.js +1 -1
- package/dist/src/nile-column-range-chart/nile-column-range-chart.css.js +2 -0
- package/dist/src/nile-column-range-chart/nile-column-range-chart.js +1 -1
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.css.js +10 -0
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.d.ts +15 -6
- package/dist/src/nile-dashboard-viewer/nile-dashboard-viewer.js +47 -6
- package/dist/src/nile-donut-chart/nile-donut-chart.css.js +2 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +1 -1
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-chart/nile-dumbbell-chart.js +1 -1
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-lower-chart/nile-dumbbell-lower-chart.js +1 -1
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.css.js +2 -0
- package/dist/src/nile-dumbbell-upper-chart/nile-dumbbell-upper-chart.js +1 -1
- package/dist/src/nile-euler-chart/nile-euler-chart.css.js +2 -0
- package/dist/src/nile-euler-chart/nile-euler-chart.js +1 -1
- package/dist/src/nile-fan-chart/nile-fan-chart.css.js +2 -0
- package/dist/src/nile-fan-chart/nile-fan-chart.js +1 -1
- package/dist/src/nile-flame-chart/nile-flame-chart.css.js +2 -0
- package/dist/src/nile-flame-chart/nile-flame-chart.js +1 -1
- package/dist/src/nile-funnel-chart/nile-funnel-chart.css.js +2 -0
- package/dist/src/nile-funnel-chart/nile-funnel-chart.js +1 -1
- package/dist/src/nile-gauge-chart/nile-gauge-chart.css.js +2 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +1 -1
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.css.js +2 -0
- package/dist/src/nile-heatmap-chart/nile-heatmap-chart.js +1 -1
- package/dist/src/nile-histogram-chart/nile-histogram-chart.css.js +2 -0
- package/dist/src/nile-histogram-chart/nile-histogram-chart.js +1 -1
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.css.js +2 -0
- package/dist/src/nile-inverted-area-chart/nile-inverted-area-chart.js +1 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +54 -3
- package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +29 -1
- package/dist/src/nile-kpi-chart/nile-kpi-chart.js +164 -9
- package/dist/src/nile-line-chart/nile-line-chart.css.js +2 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +1 -1
- package/dist/src/nile-line-column-chart/nile-line-column-chart.css.js +2 -0
- package/dist/src/nile-line-column-chart/nile-line-column-chart.js +1 -1
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.css.js +2 -0
- package/dist/src/nile-lollipop-chart/nile-lollipop-chart.js +1 -1
- package/dist/src/nile-map-chart/nile-map-chart.css.js +2 -0
- package/dist/src/nile-map-chart/nile-map-chart.js +1 -1
- package/dist/src/nile-organization-chart/nile-organization-chart.css.js +2 -0
- package/dist/src/nile-organization-chart/nile-organization-chart.js +1 -1
- package/dist/src/nile-pie-chart/nile-pie-chart.css.js +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +1 -1
- package/dist/src/nile-polygon-chart/nile-polygon-chart.css.js +2 -0
- package/dist/src/nile-polygon-chart/nile-polygon-chart.js +1 -1
- package/dist/src/nile-radar-chart/nile-radar-chart.css.js +2 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +1 -1
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.css.js +2 -0
- package/dist/src/nile-radial-bar-chart/nile-radial-bar-chart.js +1 -1
- package/dist/src/nile-scatter-chart/nile-scatter-chart.css.js +2 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +1 -1
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.css.js +2 -0
- package/dist/src/nile-spiderweb-chart/nile-spiderweb-chart.js +1 -1
- package/dist/src/nile-spline-chart/nile-spline-chart.css.js +2 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +1 -1
- package/dist/src/nile-stacked-chart/nile-stacked-chart.css.js +2 -0
- package/dist/src/nile-stacked-chart/nile-stacked-chart.js +1 -1
- package/dist/src/nile-timeline-chart/nile-timeline-chart.css.js +2 -0
- package/dist/src/nile-timeline-chart/nile-timeline-chart.js +1 -1
- package/dist/src/nile-trendline-chart/nile-trendline-chart.css.js +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +1 -1
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.css.js +2 -0
- package/dist/src/nile-variable-pie-chart/nile-variable-pie-chart.js +1 -1
- package/dist/src/nile-vector-chart/nile-vector-chart.css.js +2 -0
- package/dist/src/nile-vector-chart/nile-vector-chart.js +1 -1
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.js +2 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +1 -1
- package/dist/src/nile-widget-viewer/nile-widget-viewer.d.ts +4 -0
- package/dist/src/nile-widget-viewer/nile-widget-viewer.js +18 -2
- package/dist/src/nile-xrange-chart/nile-xrange-chart.css.js +2 -0
- package/dist/src/nile-xrange-chart/nile-xrange-chart.js +1 -1
- package/package.json +1 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ export type { TrendlineSeriesData, ForecastConfig } from './nile-trendline-chart
|
|
|
7
7
|
export { NileAnomalyChart } from './nile-anomaly-chart/index.js';
|
|
8
8
|
export type { AnomalySeriesData, AnomalyConfig } from './nile-anomaly-chart/index.js';
|
|
9
9
|
export { NileChart } from './nile-chart/index.js';
|
|
10
|
-
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, NileMapChartConfig, NileKpiChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart/index.js';
|
|
10
|
+
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, NileMapChartConfig, NileKpiChartConfig, ChartType, SwitchAggregation, NileAiConfig, NileChartMenuConfig, NileChartMenuItem, } 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
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, ChartKpiConfigType, ChartKpiPropsType, ChartMapConfigType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from './nile-chart/index.js';
|
|
@@ -5,6 +5,7 @@ import type { NileDashboardConfig } from './types/dashboard-config.type.js';
|
|
|
5
5
|
*
|
|
6
6
|
* Handles:
|
|
7
7
|
* - `widgetType` → `type` rename
|
|
8
|
+
* - Gridster-native layout keys (`cols`/`rows`) → canonical (`w`/`h`)
|
|
8
9
|
* - API chart `series[].data[].value` → `data[].y` (pie/donut)
|
|
9
10
|
* - Multi-series format for bar/line/column/area etc.
|
|
10
11
|
* - KPI sub-object: adds the `type: 'kpi'` discriminator
|
|
@@ -61,8 +61,17 @@ function adaptKpiWidget(apiKpi) {
|
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
63
|
// ─── Widget adapter ──────────────────────────────────────────────────────────
|
|
64
|
+
function normalizeLayout(raw) {
|
|
65
|
+
const src = raw ?? { x: 0, y: 0 };
|
|
66
|
+
return {
|
|
67
|
+
x: src.x ?? 0,
|
|
68
|
+
y: src.y ?? 0,
|
|
69
|
+
w: src.w ?? src.cols ?? 6,
|
|
70
|
+
h: src.h ?? src.rows ?? 4,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
64
73
|
function adaptWidget(apiWidget) {
|
|
65
|
-
const layout = apiWidget.layout
|
|
74
|
+
const layout = normalizeLayout(apiWidget.layout);
|
|
66
75
|
const widgetType = apiWidget.widgetType ?? apiWidget.type;
|
|
67
76
|
// Already in NileWidgetConfig shape — pass through
|
|
68
77
|
if (apiWidget.nileConfig) {
|
|
@@ -101,6 +110,7 @@ function adaptWidget(apiWidget) {
|
|
|
101
110
|
*
|
|
102
111
|
* Handles:
|
|
103
112
|
* - `widgetType` → `type` rename
|
|
113
|
+
* - Gridster-native layout keys (`cols`/`rows`) → canonical (`w`/`h`)
|
|
104
114
|
* - API chart `series[].data[].value` → `data[].y` (pie/donut)
|
|
105
115
|
* - Multi-series format for bar/line/column/area etc.
|
|
106
116
|
* - KPI sub-object: adds the `type: 'kpi'` discriminator
|
|
@@ -11,4 +11,10 @@ type HighchartsStatic = typeof import('highcharts');
|
|
|
11
11
|
* The initialization runs only once and is shared across all callers.
|
|
12
12
|
*/
|
|
13
13
|
export declare function getHighcharts(): Promise<HighchartsStatic>;
|
|
14
|
+
/**
|
|
15
|
+
* Loads Highcharts exporting modules (exporting, offline-exporting, export-data).
|
|
16
|
+
* Called only by nile-chart — not part of the base provider used by individual chart types.
|
|
17
|
+
* Runs once and is shared if called multiple times.
|
|
18
|
+
*/
|
|
19
|
+
export declare function initNileChartExporting(): Promise<void>;
|
|
14
20
|
export {};
|
|
@@ -197,4 +197,36 @@ export function getHighcharts() {
|
|
|
197
197
|
}
|
|
198
198
|
return _initPromise;
|
|
199
199
|
}
|
|
200
|
+
let _exportingInitPromise = null;
|
|
201
|
+
/**
|
|
202
|
+
* Loads Highcharts exporting modules (exporting, offline-exporting, export-data).
|
|
203
|
+
* Called only by nile-chart — not part of the base provider used by individual chart types.
|
|
204
|
+
* Runs once and is shared if called multiple times.
|
|
205
|
+
*/
|
|
206
|
+
export async function initNileChartExporting() {
|
|
207
|
+
if (_exportingInitPromise)
|
|
208
|
+
return _exportingInitPromise;
|
|
209
|
+
_exportingInitPromise = (async () => {
|
|
210
|
+
const H = await getHighcharts();
|
|
211
|
+
try {
|
|
212
|
+
const mod = await import('highcharts/modules/exporting.js');
|
|
213
|
+
if (typeof mod.default === 'function')
|
|
214
|
+
mod.default(H);
|
|
215
|
+
}
|
|
216
|
+
catch { /* consumer may have loaded it globally */ }
|
|
217
|
+
try {
|
|
218
|
+
const mod = await import('highcharts/modules/offline-exporting.js');
|
|
219
|
+
if (typeof mod.default === 'function')
|
|
220
|
+
mod.default(H);
|
|
221
|
+
}
|
|
222
|
+
catch { /* offline-exporting not available */ }
|
|
223
|
+
try {
|
|
224
|
+
const mod = await import('highcharts/modules/export-data.js');
|
|
225
|
+
if (typeof mod.default === 'function')
|
|
226
|
+
mod.default(H);
|
|
227
|
+
}
|
|
228
|
+
catch { /* export-data not available */ }
|
|
229
|
+
})();
|
|
230
|
+
return _exportingInitPromise;
|
|
231
|
+
}
|
|
200
232
|
//# sourceMappingURL=highcharts-provider.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AiConfigType } from './ai-config.type.js';
|
|
2
2
|
import type { SwitchableConfigType } from './switchable-config.type.js';
|
|
3
|
+
import type { NileChartMenuConfig, NileChartMenuItem } from '../../nile-chart/nile-chart-config.js';
|
|
3
4
|
/** General-purpose config (summary, AI, titles, switching). */
|
|
4
5
|
export interface AqConfigType {
|
|
5
6
|
chartTitle?: string;
|
|
@@ -10,4 +11,8 @@ export interface AqConfigType {
|
|
|
10
11
|
ai?: AiConfigType;
|
|
11
12
|
/** Chart type switching configuration. */
|
|
12
13
|
switchable?: SwitchableConfigType;
|
|
14
|
+
/** Actions menu configuration. */
|
|
15
|
+
menu?: NileChartMenuConfig;
|
|
16
|
+
/** Extra items prepended before `menu.items`. Useful for injecting items from outer config layers. */
|
|
17
|
+
menuItems?: NileChartMenuItem[];
|
|
13
18
|
}
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -265,7 +265,7 @@ let NileAnomalyChart = class NileAnomalyChart extends NileElement {
|
|
|
265
265
|
const defaults = {
|
|
266
266
|
chart: {
|
|
267
267
|
type: 'line',
|
|
268
|
-
height: this.height,
|
|
268
|
+
...(this.height ? { height: this.height } : {}),
|
|
269
269
|
},
|
|
270
270
|
title: {
|
|
271
271
|
text: this.chartTitle || undefined,
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -157,7 +157,7 @@ let NileAreaChart = class NileAreaChart extends NileElement {
|
|
|
157
157
|
buildOptions() {
|
|
158
158
|
const self = this;
|
|
159
159
|
return deepMerge({
|
|
160
|
-
chart: { type: 'area', height: this.height },
|
|
160
|
+
chart: { type: 'area', ...(this.height ? { height: this.height } : {}) },
|
|
161
161
|
title: { text: this.chartTitle || undefined },
|
|
162
162
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
163
163
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -118,7 +118,7 @@ let NileAreaNegativeChart = class NileAreaNegativeChart extends NileElement {
|
|
|
118
118
|
buildOptions() {
|
|
119
119
|
const self = this;
|
|
120
120
|
return deepMerge({
|
|
121
|
-
chart: { type: 'area', height: this.height },
|
|
121
|
+
chart: { type: 'area', ...(this.height ? { height: this.height } : {}) },
|
|
122
122
|
title: { text: this.chartTitle || undefined },
|
|
123
123
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
124
124
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -116,7 +116,7 @@ let NileAreaRangeChart = class NileAreaRangeChart extends NileElement {
|
|
|
116
116
|
buildOptions() {
|
|
117
117
|
const self = this;
|
|
118
118
|
return deepMerge({
|
|
119
|
-
chart: { height: this.height },
|
|
119
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
120
120
|
title: { text: this.chartTitle || undefined },
|
|
121
121
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
122
122
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -118,7 +118,7 @@ let NileAreaSplineChart = class NileAreaSplineChart extends NileElement {
|
|
|
118
118
|
buildOptions() {
|
|
119
119
|
const self = this;
|
|
120
120
|
return deepMerge({
|
|
121
|
-
chart: { type: 'areaspline', height: this.height },
|
|
121
|
+
chart: { type: 'areaspline', ...(this.height ? { height: this.height } : {}) },
|
|
122
122
|
title: { text: this.chartTitle || undefined },
|
|
123
123
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
124
124
|
xAxis: { categories: this.categories },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -145,7 +145,7 @@ let NileBellcurveChart = class NileBellcurveChart extends NileElement {
|
|
|
145
145
|
const pts = this.pointsInInterval > 0 ? this.pointsInInterval : 40;
|
|
146
146
|
const iv = this.intervals > 0 ? this.intervals : 3;
|
|
147
147
|
return deepMerge({
|
|
148
|
-
chart: { height: this.height },
|
|
148
|
+
chart: { ...(this.height ? { height: this.height } : {}) },
|
|
149
149
|
title: { text: this.chartTitle || undefined },
|
|
150
150
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
151
151
|
legend: { enabled: this.showLegend },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -158,7 +158,7 @@ let NileBoxplotChart = class NileBoxplotChart extends NileElement {
|
|
|
158
158
|
return deepMerge({
|
|
159
159
|
chart: {
|
|
160
160
|
type: 'boxplot',
|
|
161
|
-
height: this.height,
|
|
161
|
+
...(this.height ? { height: this.height } : {}),
|
|
162
162
|
inverted: this.horizontal,
|
|
163
163
|
},
|
|
164
164
|
title: { text: this.chartTitle || undefined },
|
|
@@ -13,6 +13,7 @@ export const styles = css `
|
|
|
13
13
|
--nile-chart-loading-bg: transparent;
|
|
14
14
|
display: block;
|
|
15
15
|
width: 100%;
|
|
16
|
+
height: 100%;
|
|
16
17
|
position: relative;
|
|
17
18
|
}
|
|
18
19
|
|
|
@@ -22,6 +23,7 @@ export const styles = css `
|
|
|
22
23
|
|
|
23
24
|
.chart-container {
|
|
24
25
|
width: 100%;
|
|
26
|
+
height: 100%;
|
|
25
27
|
min-height: var(--nile-chart-min-height);
|
|
26
28
|
background: var(--nile-chart-bg);
|
|
27
29
|
border-radius: var(--nile-chart-border-radius);
|
|
@@ -154,7 +154,7 @@ let NileBubbleChart = class NileBubbleChart extends NileElement {
|
|
|
154
154
|
buildOptions() {
|
|
155
155
|
const self = this;
|
|
156
156
|
return deepMerge({
|
|
157
|
-
chart: { type: 'bubble', height: this.height, zoomType: 'xy' },
|
|
157
|
+
chart: { type: 'bubble', ...(this.height ? { height: this.height } : {}), zoomType: 'xy' },
|
|
158
158
|
title: { text: this.chartTitle || undefined },
|
|
159
159
|
subtitle: { text: this.chartSubtitle || undefined },
|
|
160
160
|
xAxis: { title: { text: this.xAxisTitle || undefined } },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { NileChart } from './nile-chart.js';
|
|
2
|
-
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, NileKpiChartConfig, NileMapChartConfig, ChartType, SwitchAggregation, NileAiConfig, } from './nile-chart-config.js';
|
|
2
|
+
export type { NileChartConfig, NileBarChartConfig, NilePieChartConfig, NileTrendlineChartConfig, NileAnomalyChartConfig, NileLineChartConfig, NileAreaChartConfig, NileColumnChartConfig, NileDonutChartConfig, NileScatterChartConfig, NileBubbleChartConfig, NileSplineChartConfig, NileRadarChartConfig, NileGaugeChartConfig, NileWaterfallChartConfig, NileKpiChartConfig, NileMapChartConfig, ChartType, SwitchAggregation, NileAiConfig, NileChartMenuConfig, NileChartMenuItem, } 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
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, ChartKpiConfigType, ChartKpiPropsType, ChartMapConfigType, PrimitiveChartConfigType, SeparatedChartConfigInputType, AllChartConfigType, ChartConfigType, NileChartConfigInputType, ChartAiPanelPayload, ChartAiSenderPayload, NileAiPanelConfigInputType, NileAiSenderConfigInputType, } from '../internal/types/index.js';
|
|
@@ -15,7 +15,7 @@ import type { SplineChartSeriesData } from '../nile-spline-chart/nile-spline-cha
|
|
|
15
15
|
import type { RadarChartSeriesData } from '../nile-radar-chart/nile-radar-chart.js';
|
|
16
16
|
import type { GaugeBand } from '../nile-gauge-chart/nile-gauge-chart.js';
|
|
17
17
|
import type { WaterfallDataPoint } from '../nile-waterfall-chart/nile-waterfall-chart.js';
|
|
18
|
-
import type { KpiVariant, SparklineType, TrendDirection } from '../nile-kpi-chart/nile-kpi-chart.js';
|
|
18
|
+
import type { KpiVariant, KpiValueFormat, SparklineType, TrendDirection } from '../nile-kpi-chart/nile-kpi-chart.js';
|
|
19
19
|
import type { MapChartDataPoint } from '../nile-map-chart/nile-map-chart.js';
|
|
20
20
|
import type { NileDataGridColumn } from '@aquera/nile-data-grid';
|
|
21
21
|
import type { StackedChartSeriesData } from '../nile-stacked-chart/nile-stacked-chart.js';
|
|
@@ -47,6 +47,64 @@ import type { VectorDataPoint } from '../nile-vector-chart/nile-vector-chart.js'
|
|
|
47
47
|
import type { XrangeDataPoint } from '../nile-xrange-chart/nile-xrange-chart.js';
|
|
48
48
|
import type { LineColumnSeriesPart } from '../nile-line-column-chart/nile-line-column-chart.js';
|
|
49
49
|
export type SwitchAggregation = 'by-category' | 'by-series' | 'flatten';
|
|
50
|
+
/**
|
|
51
|
+
* A built-in menu action (fullscreen, print, or a download).
|
|
52
|
+
* Set the matching flag to `true`; optionally override the displayed `label`.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* { type: 'default', downloadPng: true }
|
|
56
|
+
* { type: 'default', downloadCsv: true, label: 'Export CSV', divider: true }
|
|
57
|
+
*/
|
|
58
|
+
export interface NileChartMenuItemDefault {
|
|
59
|
+
type: 'default';
|
|
60
|
+
/** Override the default label (e.g. "Download PNG"). */
|
|
61
|
+
label?: string;
|
|
62
|
+
/** Show a divider line above this item. */
|
|
63
|
+
divider?: boolean;
|
|
64
|
+
fullscreen?: true;
|
|
65
|
+
print?: true;
|
|
66
|
+
downloadPng?: true;
|
|
67
|
+
downloadSvg?: true;
|
|
68
|
+
downloadCsv?: true;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A custom menu item. Clicking it fires a `nile-menu-change` event with `{ id }`.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* { type: 'custom', label: 'Send to Slack', id: 'send-slack' }
|
|
75
|
+
*/
|
|
76
|
+
export interface NileChartMenuItemCustom {
|
|
77
|
+
type: 'custom';
|
|
78
|
+
/** Label shown in the menu. */
|
|
79
|
+
label: string;
|
|
80
|
+
/** Identifier emitted in the `nile-menu-change` event when clicked. */
|
|
81
|
+
id: string;
|
|
82
|
+
/** Show a divider line above this item. */
|
|
83
|
+
divider?: boolean;
|
|
84
|
+
}
|
|
85
|
+
export type NileChartMenuItem = NileChartMenuItemDefault | NileChartMenuItemCustom;
|
|
86
|
+
/**
|
|
87
|
+
* Controls the chart's actions menu.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* menu: {
|
|
91
|
+
* enabled: true,
|
|
92
|
+
* items: [
|
|
93
|
+
* { type: 'default', downloadPng: true },
|
|
94
|
+
* { type: 'default', downloadCsv: true },
|
|
95
|
+
* { type: 'custom', label: 'Share report', id: 'share-report', divider: true },
|
|
96
|
+
* ]
|
|
97
|
+
* }
|
|
98
|
+
*/
|
|
99
|
+
export interface NileChartMenuConfig {
|
|
100
|
+
/** Show the menu trigger button. Must be `true` to enable the menu. */
|
|
101
|
+
enabled?: boolean;
|
|
102
|
+
/**
|
|
103
|
+
* Ordered list of menu items. Each item is either a built-in action
|
|
104
|
+
* (`type: 'default'`) or a custom event-driven item (`type: 'custom'`).
|
|
105
|
+
*/
|
|
106
|
+
items?: NileChartMenuItem[];
|
|
107
|
+
}
|
|
50
108
|
export interface NileAiConfig {
|
|
51
109
|
/** Show the AI chat icon on the chart. Default: false. */
|
|
52
110
|
enabled?: boolean;
|
|
@@ -70,6 +128,10 @@ export interface NileChartConfigBase {
|
|
|
70
128
|
switchAggregation?: SwitchAggregation;
|
|
71
129
|
/** AI chat configuration. When ai.enabled is true, shows the allsearch icon. */
|
|
72
130
|
ai?: NileAiConfig;
|
|
131
|
+
/** Controls the built-in actions menu in the chart header. */
|
|
132
|
+
menu?: NileChartMenuConfig;
|
|
133
|
+
/** Custom items appended at the bottom of the chart actions menu. */
|
|
134
|
+
menuItems?: NileChartMenuItem[];
|
|
73
135
|
/** Show the chart legend. Each chart's default varies; set explicitly to override. */
|
|
74
136
|
showLegend?: boolean;
|
|
75
137
|
chartBg?: string;
|
|
@@ -462,6 +524,12 @@ export interface NileKpiChartConfig extends NileChartConfigBase {
|
|
|
462
524
|
cardPaddingVertical?: string | number;
|
|
463
525
|
cardPaddingHorizontal?: string | number;
|
|
464
526
|
contentGap?: string | number;
|
|
527
|
+
/** Abbreviation scale. Default 'auto'. */
|
|
528
|
+
valueFormat?: KpiValueFormat;
|
|
529
|
+
/** Decimal places on the abbreviated value. */
|
|
530
|
+
precision?: number | null;
|
|
531
|
+
/** Base unit (e.g. 'L', 'g', 'm') combined with the magnitude prefix: "1.5KL", "2.5Kg". */
|
|
532
|
+
unit?: string;
|
|
465
533
|
tooltipEnabled?: boolean;
|
|
466
534
|
}
|
|
467
535
|
/** Discriminated union of every named chart config — use for typed `<nile-chart>` configs. */
|
|
@@ -1 +1,2 @@
|
|
|
1
|
+
export declare const tooltipCss = "\n .nile-chart-header-tooltip {\n position: fixed;\n display: none;\n transform: translate(-50%, calc(-100% - 10px));\n background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));\n color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));\n font-family: var(--nile-font-family-serif, var(--ng-font-family-body));\n font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));\n font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));\n line-height: 1.4;\n padding: 4px 10px;\n border-radius: 6px;\n border: 1px solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n pointer-events: none;\n white-space: nowrap;\n z-index: 2147483647;\n box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));\n }\n .nile-chart-header-tooltip::after {\n content: '';\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border: 5px solid transparent;\n border-top-color: var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));\n }\n";
|
|
1
2
|
export declare const styles: import("lit").CSSResult;
|