@aquera/nile-visualization 1.8.0 → 2.0.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.
@@ -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';
@@ -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
  }
@@ -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;