@aquera/nile-visualization 1.2.0 → 1.3.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/internal/types/chart-config.type.d.ts +2 -1
- package/dist/src/internal/types/chart-grid-config.type.d.ts +16 -0
- package/dist/src/internal/types/chart-grid-config.type.js +2 -0
- package/dist/src/nile-chart/nile-chart-config.d.ts +11 -0
- package/dist/src/nile-chart/nile-chart.css.js +17 -18
- package/dist/src/nile-chart/nile-chart.d.ts +1 -0
- package/dist/src/nile-chart/nile-chart.js +23 -0
- package/package.json +8 -2
|
@@ -13,6 +13,7 @@ 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
15
|
import type { ChartMapConfigType } from './chart-map-config.type.js';
|
|
16
|
+
import type { ChartGridConfigType } from './chart-grid-config.type.js';
|
|
16
17
|
import type { PrimitiveChartConfigType } from './primitive-chart-config.type.js';
|
|
17
18
|
/** Core chart configs (bar, pie, …) plus all primitive series types — use with `<nile-chart>` via `chart.type`. */
|
|
18
|
-
export type ChartConfigType = ChartBarConfigType | ChartPieConfigType | ChartTrendlineConfigType | ChartAnomalyConfigType | ChartLineConfigType | ChartAreaConfigType | ChartColumnConfigType | ChartDonutConfigType | ChartScatterConfigType | ChartBubbleConfigType | ChartSplineConfigType | ChartRadarConfigType | ChartGaugeConfigType | ChartWaterfallConfigType | ChartMapConfigType | PrimitiveChartConfigType;
|
|
19
|
+
export type ChartConfigType = ChartBarConfigType | ChartPieConfigType | ChartTrendlineConfigType | ChartAnomalyConfigType | ChartLineConfigType | ChartAreaConfigType | ChartColumnConfigType | ChartDonutConfigType | ChartScatterConfigType | ChartBubbleConfigType | ChartSplineConfigType | ChartRadarConfigType | ChartGaugeConfigType | ChartWaterfallConfigType | ChartMapConfigType | ChartGridConfigType | PrimitiveChartConfigType;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Options } from 'highcharts';
|
|
2
|
+
import type { NileDataGridColumn } from '@aquera/nile-data-grid';
|
|
3
|
+
/** Tabular grid variant of `<nile-chart>`, renders a `<nile-data-grid>`. */
|
|
4
|
+
export interface ChartGridConfigType {
|
|
5
|
+
type: 'grid';
|
|
6
|
+
data: unknown[];
|
|
7
|
+
columns: NileDataGridColumn[];
|
|
8
|
+
loading?: boolean;
|
|
9
|
+
striped?: boolean;
|
|
10
|
+
hoverable?: boolean;
|
|
11
|
+
emptyMessage?: string;
|
|
12
|
+
loadingMessage?: string;
|
|
13
|
+
noMatchMessage?: string;
|
|
14
|
+
height?: string;
|
|
15
|
+
options?: Options;
|
|
16
|
+
}
|
|
@@ -16,6 +16,7 @@ import type { RadarChartSeriesData } from '../nile-radar-chart/nile-radar-chart.
|
|
|
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
18
|
import type { MapChartDataPoint } from '../nile-map-chart/nile-map-chart.js';
|
|
19
|
+
import type { NileDataGridColumn } from '@aquera/nile-data-grid';
|
|
19
20
|
export type SwitchAggregation = 'by-category' | 'by-series' | 'flatten';
|
|
20
21
|
export interface NileAiConfig {
|
|
21
22
|
/** Show the AI chat icon on the chart. Default: false. */
|
|
@@ -157,6 +158,16 @@ export interface NileMapChartConfig extends NileChartConfigBase {
|
|
|
157
158
|
/** Enable mouse-wheel zoom, double-click zoom, and +/− buttons. Default: true. */
|
|
158
159
|
zoom?: boolean;
|
|
159
160
|
}
|
|
161
|
+
export interface NileGridChartConfig extends NileChartConfigBase {
|
|
162
|
+
type: 'grid';
|
|
163
|
+
data: unknown[];
|
|
164
|
+
columns: NileDataGridColumn[];
|
|
165
|
+
striped?: boolean;
|
|
166
|
+
hoverable?: boolean;
|
|
167
|
+
emptyMessage?: string;
|
|
168
|
+
loadingMessage?: string;
|
|
169
|
+
noMatchMessage?: string;
|
|
170
|
+
}
|
|
160
171
|
/** Flat config for `<nile-chart>`: discriminated `chart` fields plus merged `aq` / card chrome. */
|
|
161
172
|
export type NileChartConfig = ChartConfigType & NileChartConfigBase;
|
|
162
173
|
export type NileKpiChartConfig = Extract<NileChartConfig, {
|
|
@@ -278,38 +278,37 @@ export const styles = css `
|
|
|
278
278
|
/* ── AI Chat Trigger (in header) ── */
|
|
279
279
|
|
|
280
280
|
.ai-trigger {
|
|
281
|
-
display: flex;
|
|
281
|
+
display: inline-flex;
|
|
282
282
|
align-items: center;
|
|
283
283
|
justify-content: center;
|
|
284
|
-
width:
|
|
285
|
-
height:
|
|
284
|
+
width: 28px;
|
|
285
|
+
height: 28px;
|
|
286
286
|
padding: 0;
|
|
287
|
-
border:
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
287
|
+
border-radius: var(--ng-radius-md, 10px);
|
|
288
|
+
background: var(--ng-componentcolors-utility-brand-50, #EFF4FF);
|
|
289
|
+
border: 1.5px solid var(--ng-componentcolors-utility-brand-200, #C7D7FE);
|
|
290
|
+
box-shadow: 0 4px 20px rgba(41, 112, 255, 0.12);
|
|
291
|
+
color: var(--ng-componentcolors-utility-brand-600, #2970FF);
|
|
291
292
|
cursor: pointer;
|
|
292
|
-
transition: background
|
|
293
|
+
transition: background 150ms ease;
|
|
294
|
+
flex-shrink: 0;
|
|
295
|
+
outline: none;
|
|
293
296
|
}
|
|
294
297
|
|
|
295
|
-
.ai-trigger:hover
|
|
296
|
-
|
|
297
|
-
|
|
298
|
+
.ai-trigger:hover,
|
|
299
|
+
.ai-trigger:focus-visible {
|
|
300
|
+
background: var(--ng-componentcolors-utility-brand-100, #DBE8FF);
|
|
298
301
|
}
|
|
302
|
+
|
|
299
303
|
.chart-inner--kpi {
|
|
300
304
|
overflow-x: hidden;
|
|
301
305
|
overflow-y: auto;
|
|
302
306
|
-webkit-overflow-scrolling: touch;
|
|
303
307
|
contain: none;
|
|
304
308
|
}
|
|
305
|
-
.ai-trigger.active {
|
|
306
|
-
background: var(--nile-colors-primary-100, var(--ng-colors-bg-brand-primary));
|
|
307
|
-
color: var(--nile-colors-primary-700, var(--ng-colors-bg-brand-solid-hover));
|
|
308
|
-
}
|
|
309
309
|
|
|
310
|
-
.ai-trigger
|
|
311
|
-
|
|
312
|
-
outline-offset: var(--nile-spacing-1px, var(--ng-outline-offset-1));
|
|
310
|
+
.ai-trigger.active {
|
|
311
|
+
background: var(--ng-componentcolors-utility-brand-100, #DBE8FF);
|
|
313
312
|
}
|
|
314
313
|
|
|
315
314
|
/* ── AI Chat Panel Overlay ── */
|
|
@@ -48,6 +48,7 @@ import '../nile-polygon-chart/index.js';
|
|
|
48
48
|
import '../nile-vector-chart/index.js';
|
|
49
49
|
import '../nile-xrange-chart/index.js';
|
|
50
50
|
import '../nile-kpi-chart/index.js';
|
|
51
|
+
import '@aquera/nile-data-grid';
|
|
51
52
|
import '../nile-ai-panel/index.js';
|
|
52
53
|
export declare class NileChart extends NileElement {
|
|
53
54
|
static styles: CSSResultGroup;
|
|
@@ -51,6 +51,7 @@ import '../nile-polygon-chart/index.js';
|
|
|
51
51
|
import '../nile-vector-chart/index.js';
|
|
52
52
|
import '../nile-xrange-chart/index.js';
|
|
53
53
|
import '../nile-kpi-chart/index.js';
|
|
54
|
+
import '@aquera/nile-data-grid';
|
|
54
55
|
import '../nile-ai-panel/index.js';
|
|
55
56
|
const CORE_CHART_LABELS = {
|
|
56
57
|
bar: 'Bar',
|
|
@@ -88,6 +89,7 @@ const CORE_CHART_LABELS = {
|
|
|
88
89
|
lollipop: 'Lollipop',
|
|
89
90
|
'line-column': 'Line + column',
|
|
90
91
|
kpi: 'KPI',
|
|
92
|
+
grid: 'Grid',
|
|
91
93
|
};
|
|
92
94
|
function chartTypeLabel(type) {
|
|
93
95
|
const hit = CORE_CHART_LABELS[type];
|
|
@@ -890,6 +892,27 @@ let NileChart = class NileChart extends NileElement {
|
|
|
890
892
|
},
|
|
891
893
|
}}
|
|
892
894
|
></nile-kpi-chart>`;
|
|
895
|
+
}
|
|
896
|
+
case 'grid': {
|
|
897
|
+
const gridChrome = '--nile-data-grid-radius:0;' +
|
|
898
|
+
'--nile-data-grid-border-color:transparent;' +
|
|
899
|
+
'--nile-data-grid-shadow:none;' +
|
|
900
|
+
'display:block;';
|
|
901
|
+
const gridStyle = config.height
|
|
902
|
+
? `${gridChrome}height:${config.height};`
|
|
903
|
+
: gridChrome;
|
|
904
|
+
return html `<nile-data-grid
|
|
905
|
+
class="nile-chart-grid"
|
|
906
|
+
.data=${config.data}
|
|
907
|
+
.columns=${config.columns}
|
|
908
|
+
.loading=${config.loading ?? false}
|
|
909
|
+
.striped=${config.striped ?? false}
|
|
910
|
+
.hoverable=${config.hoverable ?? false}
|
|
911
|
+
.emptyMessage=${config.emptyMessage ?? 'No data'}
|
|
912
|
+
.loadingMessage=${config.loadingMessage ?? 'Loading\u2026'}
|
|
913
|
+
.noMatchMessage=${config.noMatchMessage ?? 'No matching rows'}
|
|
914
|
+
style=${gridStyle}
|
|
915
|
+
></nile-data-grid>`;
|
|
893
916
|
}
|
|
894
917
|
default: {
|
|
895
918
|
const _exhaustive = config;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aquera/nile-visualization",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A visualization Library for the Nile Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aquera Inc",
|
|
@@ -59,7 +59,13 @@
|
|
|
59
59
|
"lit": "^3.0.0"
|
|
60
60
|
},
|
|
61
61
|
"peerDependencies": {
|
|
62
|
-
"highcharts": ">=10.0.0"
|
|
62
|
+
"highcharts": ">=10.0.0",
|
|
63
|
+
"@aquera/nile-data-grid": "0.1.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependenciesMeta": {
|
|
66
|
+
"@aquera/nile-data-grid": {
|
|
67
|
+
"optional": true
|
|
68
|
+
}
|
|
63
69
|
},
|
|
64
70
|
"devDependencies": {
|
|
65
71
|
"@rollup/plugin-babel": "^6.0.3",
|