@aquera/nile-visualization 0.1.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 +35 -0
- package/dist/src/index.js +20 -0
- package/dist/src/internal/chart-adapters.d.ts +11 -0
- package/dist/src/internal/chart-adapters.js +159 -0
- package/dist/src/internal/highcharts-provider.d.ts +14 -0
- package/dist/src/internal/highcharts-provider.js +56 -0
- package/dist/src/internal/nile-element.d.ts +8 -0
- package/dist/src/internal/nile-element.js +21 -0
- package/dist/src/internal/utils.d.ts +1 -0
- package/dist/src/internal/utils.js +23 -0
- package/dist/src/nile-ai-panel/index.d.ts +1 -0
- package/dist/src/nile-ai-panel/index.js +2 -0
- package/dist/src/nile-ai-panel/nile-ai-panel.css.d.ts +1 -0
- package/dist/src/nile-ai-panel/nile-ai-panel.css.js +73 -0
- package/dist/src/nile-ai-panel/nile-ai-panel.d.ts +29 -0
- package/dist/src/nile-ai-panel/nile-ai-panel.js +98 -0
- package/dist/src/nile-ai-sender/index.d.ts +1 -0
- package/dist/src/nile-ai-sender/index.js +2 -0
- package/dist/src/nile-ai-sender/nile-ai-sender.css.d.ts +1 -0
- package/dist/src/nile-ai-sender/nile-ai-sender.css.js +71 -0
- package/dist/src/nile-ai-sender/nile-ai-sender.d.ts +20 -0
- package/dist/src/nile-ai-sender/nile-ai-sender.js +77 -0
- package/dist/src/nile-anomaly-chart/index.d.ts +2 -0
- package/dist/src/nile-anomaly-chart/index.js +2 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.d.ts +1 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.css.js +28 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.d.ts +59 -0
- package/dist/src/nile-anomaly-chart/nile-anomaly-chart.js +268 -0
- package/dist/src/nile-area-chart/index.d.ts +2 -0
- package/dist/src/nile-area-chart/index.js +2 -0
- package/dist/src/nile-area-chart/nile-area-chart.css.d.ts +1 -0
- package/dist/src/nile-area-chart/nile-area-chart.css.js +28 -0
- package/dist/src/nile-area-chart/nile-area-chart.d.ts +37 -0
- package/dist/src/nile-area-chart/nile-area-chart.js +122 -0
- package/dist/src/nile-bar-chart/index.d.ts +2 -0
- package/dist/src/nile-bar-chart/index.js +2 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.css.d.ts +1 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.css.js +28 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.d.ts +44 -0
- package/dist/src/nile-bar-chart/nile-bar-chart.js +185 -0
- package/dist/src/nile-bubble-chart/index.d.ts +2 -0
- package/dist/src/nile-bubble-chart/index.js +2 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.css.d.ts +1 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.css.js +28 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.d.ts +36 -0
- package/dist/src/nile-bubble-chart/nile-bubble-chart.js +123 -0
- package/dist/src/nile-chart/index.d.ts +3 -0
- package/dist/src/nile-chart/index.js +3 -0
- package/dist/src/nile-chart/nile-chart-config.d.ts +58 -0
- package/dist/src/nile-chart/nile-chart-config.js +2 -0
- package/dist/src/nile-chart/nile-chart.css.d.ts +1 -0
- package/dist/src/nile-chart/nile-chart.css.js +298 -0
- package/dist/src/nile-chart/nile-chart.d.ts +51 -0
- package/dist/src/nile-chart/nile-chart.js +303 -0
- package/dist/src/nile-column-chart/index.d.ts +2 -0
- package/dist/src/nile-column-chart/index.js +2 -0
- package/dist/src/nile-column-chart/nile-column-chart.css.d.ts +1 -0
- package/dist/src/nile-column-chart/nile-column-chart.css.js +28 -0
- package/dist/src/nile-column-chart/nile-column-chart.d.ts +36 -0
- package/dist/src/nile-column-chart/nile-column-chart.js +118 -0
- package/dist/src/nile-donut-chart/index.d.ts +2 -0
- package/dist/src/nile-donut-chart/index.js +2 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.css.d.ts +1 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.css.js +28 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.d.ts +40 -0
- package/dist/src/nile-donut-chart/nile-donut-chart.js +131 -0
- package/dist/src/nile-gauge-chart/index.d.ts +2 -0
- package/dist/src/nile-gauge-chart/index.js +2 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.css.d.ts +1 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.css.js +28 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.d.ts +38 -0
- package/dist/src/nile-gauge-chart/nile-gauge-chart.js +149 -0
- package/dist/src/nile-kpi-chart/index.d.ts +2 -0
- package/dist/src/nile-kpi-chart/index.js +2 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.d.ts +1 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.css.js +165 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.d.ts +80 -0
- package/dist/src/nile-kpi-chart/nile-kpi-chart.js +335 -0
- package/dist/src/nile-line-chart/index.d.ts +2 -0
- package/dist/src/nile-line-chart/index.js +2 -0
- package/dist/src/nile-line-chart/nile-line-chart.css.d.ts +1 -0
- package/dist/src/nile-line-chart/nile-line-chart.css.js +28 -0
- package/dist/src/nile-line-chart/nile-line-chart.d.ts +36 -0
- package/dist/src/nile-line-chart/nile-line-chart.js +115 -0
- package/dist/src/nile-pie-chart/index.d.ts +2 -0
- package/dist/src/nile-pie-chart/index.js +2 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.css.d.ts +1 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.css.js +28 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.d.ts +48 -0
- package/dist/src/nile-pie-chart/nile-pie-chart.js +197 -0
- package/dist/src/nile-radar-chart/index.d.ts +2 -0
- package/dist/src/nile-radar-chart/index.js +2 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.css.d.ts +1 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.css.js +28 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.d.ts +36 -0
- package/dist/src/nile-radar-chart/nile-radar-chart.js +137 -0
- package/dist/src/nile-scatter-chart/index.d.ts +2 -0
- package/dist/src/nile-scatter-chart/index.js +2 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.css.d.ts +1 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.css.js +28 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.d.ts +36 -0
- package/dist/src/nile-scatter-chart/nile-scatter-chart.js +124 -0
- package/dist/src/nile-spline-chart/index.d.ts +2 -0
- package/dist/src/nile-spline-chart/index.js +2 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.css.d.ts +1 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.css.js +28 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.d.ts +36 -0
- package/dist/src/nile-spline-chart/nile-spline-chart.js +118 -0
- package/dist/src/nile-trendline-chart/index.d.ts +2 -0
- package/dist/src/nile-trendline-chart/index.js +2 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.css.d.ts +1 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.css.js +28 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.d.ts +59 -0
- package/dist/src/nile-trendline-chart/nile-trendline-chart.js +246 -0
- package/dist/src/nile-waterfall-chart/index.d.ts +2 -0
- package/dist/src/nile-waterfall-chart/index.js +2 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.d.ts +1 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.css.js +28 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.d.ts +37 -0
- package/dist/src/nile-waterfall-chart/nile-waterfall-chart.js +137 -0
- package/package.json +62 -0
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([hidden]) {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* ── Unified Card Container ── */
|
|
14
|
+
|
|
15
|
+
.chart-card {
|
|
16
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
17
|
+
border: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
18
|
+
border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-xl));
|
|
19
|
+
box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));
|
|
20
|
+
transition: box-shadow var(--nile-transition-duration-default, var(--ng-transition-duration-default)) ease;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.chart-card:hover {
|
|
24
|
+
box-shadow: var(--nile-box-shadow-7, var(--ng-shadow-md));
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/* ── Card Header ── */
|
|
28
|
+
|
|
29
|
+
.chart-header {
|
|
30
|
+
display: flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
justify-content: space-between;
|
|
33
|
+
position: relative;
|
|
34
|
+
z-index: 10;
|
|
35
|
+
padding: var(--nile-spacing-2xl, var(--ng-spacing-2xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl)) var(--nile-spacing-xl, var(--ng-spacing-xl));
|
|
36
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
37
|
+
border-bottom: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
38
|
+
border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-xl)) var(--nile-radius-radius-3xl, var(--ng-radius-xl)) 0 0;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.chart-header-titles {
|
|
42
|
+
min-width: 0;
|
|
43
|
+
flex: 1;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.chart-header-title {
|
|
47
|
+
margin: 0;
|
|
48
|
+
font-family: var(--nile-font-family-serif-colfax-medium, var(--ng-font-family-display));
|
|
49
|
+
font-size: var(--nile-type-scale-6, var(--ng-font-size-text-xl));
|
|
50
|
+
font-weight: var(--nile-font-weight-semi-bold, var(--ng-font-weight-semibold));
|
|
51
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
|
|
52
|
+
line-height: 1.3;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.chart-header-subtitle {
|
|
56
|
+
margin: var(--nile-spacing-xs, var(--ng-spacing-xs)) 0 0;
|
|
57
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
58
|
+
font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
59
|
+
font-weight: var(--nile-font-weight-regular, var(--ng-font-weight-regular));
|
|
60
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
61
|
+
line-height: 1.4;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.chart-header-actions {
|
|
65
|
+
display: flex;
|
|
66
|
+
align-items: center;
|
|
67
|
+
gap: var(--nile-spacing-xs, var(--ng-spacing-xs));
|
|
68
|
+
flex-shrink: 0;
|
|
69
|
+
margin-left: var(--nile-spacing-lg, var(--ng-spacing-lg));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ── Card Body ── */
|
|
73
|
+
|
|
74
|
+
.chart-wrapper {
|
|
75
|
+
position: relative;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.chart-inner {
|
|
79
|
+
position: relative;
|
|
80
|
+
overflow: hidden;
|
|
81
|
+
border-radius: 0 0 var(--nile-radius-radius-3xl, var(--ng-radius-xl)) var(--nile-radius-radius-3xl, var(--ng-radius-xl));
|
|
82
|
+
contain: layout style;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
::slotted(*) {
|
|
86
|
+
width: 100%;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
nile-bar-chart,
|
|
90
|
+
nile-pie-chart,
|
|
91
|
+
nile-trendline-chart,
|
|
92
|
+
nile-anomaly-chart {
|
|
93
|
+
display: block;
|
|
94
|
+
width: 100%;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/* ── Summary Toggle ── */
|
|
98
|
+
|
|
99
|
+
.chart-toggle {
|
|
100
|
+
position: absolute;
|
|
101
|
+
bottom: 0;
|
|
102
|
+
left: 0;
|
|
103
|
+
z-index: 3;
|
|
104
|
+
display: inline-flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
gap: var(--nile-spacing-sm, var(--ng-spacing-sm));
|
|
107
|
+
padding: var(--nile-spacing-sm, var(--ng-spacing-sm)) var(--nile-spacing-14px, var(--ng-spacing-3-5));
|
|
108
|
+
border: none;
|
|
109
|
+
border-top: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
110
|
+
border-right: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
111
|
+
border-radius: 0 var(--nile-radius-radius-sm, var(--ng-radius-xs)) 0 0;
|
|
112
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
113
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
|
|
114
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
115
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
116
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
117
|
+
cursor: pointer;
|
|
118
|
+
box-shadow: var(--nile-box-shadow-1, var(--ng-shadow-xs));
|
|
119
|
+
transition: background var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease, box-shadow var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease, opacity var(--nile-transition-duration-default, var(--ng-transition-duration-default)) ease;
|
|
120
|
+
opacity: 0;
|
|
121
|
+
pointer-events: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.chart-inner:hover .chart-toggle,
|
|
125
|
+
.chart-toggle[aria-expanded='true'] {
|
|
126
|
+
opacity: 1;
|
|
127
|
+
pointer-events: auto;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
.chart-toggle:hover {
|
|
131
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
132
|
+
box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.chart-toggle:focus-visible {
|
|
136
|
+
outline: var(--nile-border-width-2, var(--ng-stroke-width-2)) solid var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
137
|
+
outline-offset: var(--nile-spacing-1px, var(--ng-outline-offset-1));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/* ── Summary Overlay ── */
|
|
141
|
+
|
|
142
|
+
.chart-overlay {
|
|
143
|
+
position: absolute;
|
|
144
|
+
left: 0;
|
|
145
|
+
right: 0;
|
|
146
|
+
bottom: 0;
|
|
147
|
+
height: 50%;
|
|
148
|
+
background: rgba(255, 255, 255, 0.95);
|
|
149
|
+
border-top: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
150
|
+
box-shadow: var(--nile-box-shadow-3, var(--ng-shadow-sm));
|
|
151
|
+
z-index: 2;
|
|
152
|
+
transform: translateY(100%);
|
|
153
|
+
transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
|
|
154
|
+
overflow-y: auto;
|
|
155
|
+
padding: var(--nile-spacing-2xl, var(--ng-spacing-2xl)) var(--nile-spacing-3xl, var(--ng-spacing-3xl));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.chart-overlay[data-open] {
|
|
159
|
+
transform: translateY(0);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.chart-content {
|
|
163
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
164
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
165
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
|
|
166
|
+
line-height: 1.6;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/* ── Type Switcher (in header) ── */
|
|
170
|
+
|
|
171
|
+
.chart-menu-anchor {
|
|
172
|
+
position: relative;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
.chart-menu-trigger {
|
|
176
|
+
display: flex;
|
|
177
|
+
align-items: center;
|
|
178
|
+
justify-content: center;
|
|
179
|
+
width: var(--nile-width-28px, var(--ng-height-28px));
|
|
180
|
+
height: var(--nile-width-28px, var(--ng-height-28px));
|
|
181
|
+
padding: 0;
|
|
182
|
+
border: none;
|
|
183
|
+
border-radius: var(--nile-radius-radius-lg, var(--ng-radius-sm));
|
|
184
|
+
background: transparent;
|
|
185
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
186
|
+
cursor: pointer;
|
|
187
|
+
transition: background var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease, color var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.chart-menu-trigger:hover {
|
|
191
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
192
|
+
color: var(--nile-colors-dark-900, var(--ng-colors-text-primary-900));
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.chart-menu-trigger:focus-visible {
|
|
196
|
+
outline: var(--nile-border-width-2, var(--ng-stroke-width-2)) solid var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
197
|
+
outline-offset: var(--nile-spacing-1px, var(--ng-outline-offset-1));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
.chart-menu-dropdown {
|
|
201
|
+
position: absolute;
|
|
202
|
+
top: 100%;
|
|
203
|
+
right: 0;
|
|
204
|
+
margin-top: var(--nile-spacing-xs, var(--ng-spacing-xs));
|
|
205
|
+
min-width: var(--nile-width-140px, var(--ng-height-140px));
|
|
206
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
207
|
+
border: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
208
|
+
border-radius: var(--nile-radius-radius-xl, var(--ng-radius-md));
|
|
209
|
+
box-shadow: var(--nile-box-shadow-7, var(--ng-shadow-md));
|
|
210
|
+
padding: var(--nile-spacing-xs, var(--ng-spacing-xs)) 0;
|
|
211
|
+
overflow: hidden;
|
|
212
|
+
z-index: 10;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.chart-menu-item {
|
|
216
|
+
display: block;
|
|
217
|
+
width: 100%;
|
|
218
|
+
padding: var(--nile-spacing-md, var(--ng-spacing-md)) var(--nile-spacing-14px, var(--ng-spacing-3-5));
|
|
219
|
+
border: none;
|
|
220
|
+
background: none;
|
|
221
|
+
color: var(--nile-colors-dark-500, var(--ng-colors-text-tertiary-600));
|
|
222
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
223
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
224
|
+
font-weight: var(--nile-font-weight-medium, var(--ng-font-weight-medium));
|
|
225
|
+
text-align: left;
|
|
226
|
+
cursor: pointer;
|
|
227
|
+
transition: background var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
.chart-menu-item:hover {
|
|
231
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.chart-menu-item.active {
|
|
235
|
+
color: var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
236
|
+
font-weight: 600;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.chart-menu-item:focus-visible {
|
|
240
|
+
outline: var(--nile-border-width-2, var(--ng-stroke-width-2)) solid var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
241
|
+
outline-offset: calc(var(--nile-spacing-2px, var(--ng-outline-offset-2)) * -1);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* ── AI Chat Trigger (in header) ── */
|
|
245
|
+
|
|
246
|
+
.ai-trigger {
|
|
247
|
+
display: flex;
|
|
248
|
+
align-items: center;
|
|
249
|
+
justify-content: center;
|
|
250
|
+
width: var(--nile-width-28px, var(--ng-height-28px));
|
|
251
|
+
height: var(--nile-width-28px, var(--ng-height-28px));
|
|
252
|
+
padding: 0;
|
|
253
|
+
border: none;
|
|
254
|
+
border-radius: var(--nile-radius-radius-lg, var(--ng-radius-sm));
|
|
255
|
+
background: transparent;
|
|
256
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
257
|
+
cursor: pointer;
|
|
258
|
+
transition: background var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease, color var(--nile-transition-duration-short, var(--ng-transition-duration-fast)) ease;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.ai-trigger:hover {
|
|
262
|
+
background: var(--nile-colors-neutral-100, var(--ng-colors-bg-secondary));
|
|
263
|
+
color: var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
.ai-trigger.active {
|
|
267
|
+
background: var(--nile-colors-primary-100, var(--ng-colors-bg-brand-primary));
|
|
268
|
+
color: var(--nile-colors-primary-700, var(--ng-colors-bg-brand-solid-hover));
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
.ai-trigger:focus-visible {
|
|
272
|
+
outline: var(--nile-border-width-2, var(--ng-stroke-width-2)) solid var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
273
|
+
outline-offset: var(--nile-spacing-1px, var(--ng-outline-offset-1));
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
/* ── AI Chat Panel Overlay ── */
|
|
277
|
+
|
|
278
|
+
.ai-panel-overlay {
|
|
279
|
+
position: absolute;
|
|
280
|
+
left: 0;
|
|
281
|
+
right: 0;
|
|
282
|
+
bottom: 0;
|
|
283
|
+
height: 70%;
|
|
284
|
+
background: var(--nile-colors-white-base, var(--ng-colors-bg-primary));
|
|
285
|
+
border-top: var(--nile-border-width-1, var(--ng-stroke-width-1)) solid var(--nile-colors-neutral-400, var(--ng-colors-border-secondary));
|
|
286
|
+
box-shadow: var(--nile-box-shadow-8, var(--ng-shadow-lg));
|
|
287
|
+
z-index: 5;
|
|
288
|
+
transform: translateY(100%);
|
|
289
|
+
transition: transform var(--nile-transition-duration-long, var(--ng-transition-duration-medium)) ease;
|
|
290
|
+
border-radius: var(--nile-radius-radius-3xl, var(--ng-radius-xl)) var(--nile-radius-radius-3xl, var(--ng-radius-xl)) 0 0;
|
|
291
|
+
overflow: hidden;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
.ai-panel-overlay[data-open] {
|
|
295
|
+
transform: translateY(0);
|
|
296
|
+
}
|
|
297
|
+
`;
|
|
298
|
+
//# sourceMappingURL=nile-chart.css.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
|
|
2
|
+
import NileElement from '../internal/nile-element.js';
|
|
3
|
+
import type { NileChartConfig } from './nile-chart-config.js';
|
|
4
|
+
import '../nile-bar-chart/index.js';
|
|
5
|
+
import '../nile-pie-chart/index.js';
|
|
6
|
+
import '../nile-trendline-chart/index.js';
|
|
7
|
+
import '../nile-anomaly-chart/index.js';
|
|
8
|
+
import '../nile-ai-panel/index.js';
|
|
9
|
+
export declare class NileChart extends NileElement {
|
|
10
|
+
static styles: CSSResultGroup;
|
|
11
|
+
/** Full chart configuration including type, data, and summary. */
|
|
12
|
+
config: NileChartConfig | null;
|
|
13
|
+
/** The summary/insight text displayed in the overlay (fallback when config is not set). */
|
|
14
|
+
summary: string;
|
|
15
|
+
/** Label for the toggle button (fallback when config is not set). */
|
|
16
|
+
toggleLabel: string;
|
|
17
|
+
/** Whether the insight overlay is visible. */
|
|
18
|
+
open: boolean;
|
|
19
|
+
private activeType;
|
|
20
|
+
private activeConfig;
|
|
21
|
+
private menuOpen;
|
|
22
|
+
private chatOpen;
|
|
23
|
+
private aiPanel;
|
|
24
|
+
private get effectiveSummary();
|
|
25
|
+
private get effectiveToggleLabel();
|
|
26
|
+
private get aiEnabled();
|
|
27
|
+
private handleOutsideClick;
|
|
28
|
+
connectedCallback(): void;
|
|
29
|
+
disconnectedCallback(): void;
|
|
30
|
+
protected updated(changedProperties: PropertyValues): void;
|
|
31
|
+
private toggle;
|
|
32
|
+
private toggleMenu;
|
|
33
|
+
private toggleChat;
|
|
34
|
+
/** Push an AI response into the chat panel. Call this from your AI handler. */
|
|
35
|
+
addAiResponse(text: string): void;
|
|
36
|
+
private handleAiSend;
|
|
37
|
+
private switchType;
|
|
38
|
+
private get headerTitle();
|
|
39
|
+
private get headerSubtitle();
|
|
40
|
+
private renderTypeSwitcher;
|
|
41
|
+
private renderAiTrigger;
|
|
42
|
+
private renderHeader;
|
|
43
|
+
private renderAiPanel;
|
|
44
|
+
private renderChartContent;
|
|
45
|
+
render(): TemplateResult;
|
|
46
|
+
}
|
|
47
|
+
declare global {
|
|
48
|
+
interface HTMLElementTagNameMap {
|
|
49
|
+
'nile-chart': NileChart;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,303 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
3
|
+
import { html, nothing } from 'lit';
|
|
4
|
+
import NileElement from '../internal/nile-element.js';
|
|
5
|
+
import { styles } from './nile-chart.css.js';
|
|
6
|
+
import { convertConfig } from '../internal/chart-adapters.js';
|
|
7
|
+
import '../nile-bar-chart/index.js';
|
|
8
|
+
import '../nile-pie-chart/index.js';
|
|
9
|
+
import '../nile-trendline-chart/index.js';
|
|
10
|
+
import '../nile-anomaly-chart/index.js';
|
|
11
|
+
import '../nile-ai-panel/index.js';
|
|
12
|
+
const TYPE_LABELS = {
|
|
13
|
+
bar: 'Bar',
|
|
14
|
+
pie: 'Pie',
|
|
15
|
+
trendline: 'Trendline',
|
|
16
|
+
anomaly: 'Anomaly',
|
|
17
|
+
};
|
|
18
|
+
let NileChart = class NileChart extends NileElement {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments);
|
|
21
|
+
/** Full chart configuration including type, data, and summary. */
|
|
22
|
+
this.config = null;
|
|
23
|
+
/** The summary/insight text displayed in the overlay (fallback when config is not set). */
|
|
24
|
+
this.summary = '';
|
|
25
|
+
/** Label for the toggle button (fallback when config is not set). */
|
|
26
|
+
this.toggleLabel = 'Summary';
|
|
27
|
+
/** Whether the insight overlay is visible. */
|
|
28
|
+
this.open = false;
|
|
29
|
+
this.activeType = null;
|
|
30
|
+
this.activeConfig = null;
|
|
31
|
+
this.menuOpen = false;
|
|
32
|
+
this.chatOpen = false;
|
|
33
|
+
this.handleOutsideClick = (e) => {
|
|
34
|
+
if (!this.contains(e.target)) {
|
|
35
|
+
this.open = false;
|
|
36
|
+
this.menuOpen = false;
|
|
37
|
+
this.emit('nile-chart-toggle', { open: this.open });
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
get effectiveSummary() {
|
|
42
|
+
return this.config?.summary ?? this.summary;
|
|
43
|
+
}
|
|
44
|
+
get effectiveToggleLabel() {
|
|
45
|
+
return this.config?.toggleLabel ?? this.toggleLabel;
|
|
46
|
+
}
|
|
47
|
+
get aiEnabled() {
|
|
48
|
+
return this.config?.ai?.enabled === true;
|
|
49
|
+
}
|
|
50
|
+
connectedCallback() {
|
|
51
|
+
super.connectedCallback();
|
|
52
|
+
document.addEventListener('click', this.handleOutsideClick);
|
|
53
|
+
}
|
|
54
|
+
disconnectedCallback() {
|
|
55
|
+
super.disconnectedCallback();
|
|
56
|
+
document.removeEventListener('click', this.handleOutsideClick);
|
|
57
|
+
}
|
|
58
|
+
updated(changedProperties) {
|
|
59
|
+
if (changedProperties.has('config') && this.config) {
|
|
60
|
+
this.activeType = this.config.type;
|
|
61
|
+
this.activeConfig = this.config;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
toggle(e) {
|
|
65
|
+
e.stopPropagation();
|
|
66
|
+
this.open = !this.open;
|
|
67
|
+
if (this.open)
|
|
68
|
+
this.chatOpen = false;
|
|
69
|
+
this.emit('nile-chart-toggle', { open: this.open });
|
|
70
|
+
}
|
|
71
|
+
toggleMenu(e) {
|
|
72
|
+
e.stopPropagation();
|
|
73
|
+
this.menuOpen = !this.menuOpen;
|
|
74
|
+
}
|
|
75
|
+
toggleChat(e) {
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
this.chatOpen = !this.chatOpen;
|
|
78
|
+
if (this.chatOpen)
|
|
79
|
+
this.open = false;
|
|
80
|
+
this.emit('nile-chart-ai-toggle', { open: this.chatOpen });
|
|
81
|
+
}
|
|
82
|
+
/** Push an AI response into the chat panel. Call this from your AI handler. */
|
|
83
|
+
addAiResponse(text) {
|
|
84
|
+
if (this.aiPanel) {
|
|
85
|
+
this.aiPanel.addAssistantMessage(text);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
handleAiSend(e) {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
this.emit('nile-chart-ai-send', {
|
|
91
|
+
message: e.detail.message,
|
|
92
|
+
chart: this.activeConfig,
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
switchType(toType) {
|
|
96
|
+
if (!this.config || toType === this.activeType)
|
|
97
|
+
return;
|
|
98
|
+
const fromType = this.activeType;
|
|
99
|
+
const converted = convertConfig(this.config, toType);
|
|
100
|
+
this.activeType = toType;
|
|
101
|
+
this.activeConfig = converted;
|
|
102
|
+
this.menuOpen = false;
|
|
103
|
+
this.emit('nile-chart-type-change', {
|
|
104
|
+
fromType,
|
|
105
|
+
toType,
|
|
106
|
+
config: converted,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
get headerTitle() {
|
|
110
|
+
return this.activeConfig?.chartTitle ?? this.config?.chartTitle ?? '';
|
|
111
|
+
}
|
|
112
|
+
get headerSubtitle() {
|
|
113
|
+
return this.activeConfig?.chartSubtitle ?? this.config?.chartSubtitle ?? '';
|
|
114
|
+
}
|
|
115
|
+
renderTypeSwitcher() {
|
|
116
|
+
const types = this.config?.switchableTypes;
|
|
117
|
+
if (!types || types.length === 0)
|
|
118
|
+
return nothing;
|
|
119
|
+
return html `
|
|
120
|
+
<div class="chart-menu-anchor">
|
|
121
|
+
<button
|
|
122
|
+
class="chart-menu-trigger"
|
|
123
|
+
aria-haspopup="true"
|
|
124
|
+
aria-expanded=${this.menuOpen ? 'true' : 'false'}
|
|
125
|
+
aria-label="Change chart type"
|
|
126
|
+
@click=${this.toggleMenu}
|
|
127
|
+
>
|
|
128
|
+
<nile-glyph name="options" size="16"></nile-glyph>
|
|
129
|
+
</button>
|
|
130
|
+
${this.menuOpen
|
|
131
|
+
? html `
|
|
132
|
+
<div class="chart-menu-dropdown" role="menu" aria-label="Chart type">
|
|
133
|
+
${types.map(type => html `
|
|
134
|
+
<button
|
|
135
|
+
class="chart-menu-item ${type === this.activeType ? 'active' : ''}"
|
|
136
|
+
role="menuitem"
|
|
137
|
+
@click=${() => this.switchType(type)}
|
|
138
|
+
>
|
|
139
|
+
${TYPE_LABELS[type] ?? type} Chart
|
|
140
|
+
</button>
|
|
141
|
+
`)}
|
|
142
|
+
</div>
|
|
143
|
+
`
|
|
144
|
+
: nothing}
|
|
145
|
+
</div>
|
|
146
|
+
`;
|
|
147
|
+
}
|
|
148
|
+
renderAiTrigger() {
|
|
149
|
+
if (!this.aiEnabled)
|
|
150
|
+
return nothing;
|
|
151
|
+
return html `
|
|
152
|
+
<button
|
|
153
|
+
class="ai-trigger ${this.chatOpen ? 'active' : ''}"
|
|
154
|
+
aria-label="Ask AI about this chart"
|
|
155
|
+
aria-expanded=${this.chatOpen ? 'true' : 'false'}
|
|
156
|
+
@click=${this.toggleChat}
|
|
157
|
+
>
|
|
158
|
+
<nile-glyph name="smart-code" size="16"></nile-glyph>
|
|
159
|
+
</button>
|
|
160
|
+
`;
|
|
161
|
+
}
|
|
162
|
+
renderHeader() {
|
|
163
|
+
const title = this.headerTitle;
|
|
164
|
+
const subtitle = this.headerSubtitle;
|
|
165
|
+
const hasTypeSwitcher = (this.config?.switchableTypes?.length ?? 0) > 0;
|
|
166
|
+
const hasActions = hasTypeSwitcher || this.aiEnabled;
|
|
167
|
+
if (!title && !subtitle && !hasActions)
|
|
168
|
+
return nothing;
|
|
169
|
+
return html `
|
|
170
|
+
<div class="chart-header">
|
|
171
|
+
<div class="chart-header-titles">
|
|
172
|
+
${title ? html `<h3 class="chart-header-title">${title}</h3>` : nothing}
|
|
173
|
+
${subtitle ? html `<p class="chart-header-subtitle">${subtitle}</p>` : nothing}
|
|
174
|
+
</div>
|
|
175
|
+
<div class="chart-header-actions">
|
|
176
|
+
${this.renderAiTrigger()}
|
|
177
|
+
${this.renderTypeSwitcher()}
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
`;
|
|
181
|
+
}
|
|
182
|
+
renderAiPanel() {
|
|
183
|
+
if (!this.aiEnabled)
|
|
184
|
+
return nothing;
|
|
185
|
+
const aiConfig = this.config.ai;
|
|
186
|
+
return html `
|
|
187
|
+
<div class="ai-panel-overlay" ?data-open=${this.chatOpen}>
|
|
188
|
+
<nile-ai-panel
|
|
189
|
+
.placeholder=${aiConfig.placeholder ?? 'Ask about this chart...'}
|
|
190
|
+
.welcomeMessage=${aiConfig.welcomeMessage ?? ''}
|
|
191
|
+
@nile-ai-send=${this.handleAiSend}
|
|
192
|
+
></nile-ai-panel>
|
|
193
|
+
</div>
|
|
194
|
+
`;
|
|
195
|
+
}
|
|
196
|
+
renderChartContent() {
|
|
197
|
+
const config = this.activeConfig;
|
|
198
|
+
// Suppress inner Highcharts title/subtitle — the card header shows them
|
|
199
|
+
const noTitle = { title: { text: undefined }, subtitle: { text: undefined } };
|
|
200
|
+
const mergedOptions = { ...(config.options ?? {}), ...noTitle };
|
|
201
|
+
switch (config.type) {
|
|
202
|
+
case 'bar':
|
|
203
|
+
return html `<nile-bar-chart
|
|
204
|
+
.data=${config.data}
|
|
205
|
+
.categories=${config.categories ?? []}
|
|
206
|
+
.height=${config.height ?? '400px'}
|
|
207
|
+
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
208
|
+
.options=${mergedOptions}
|
|
209
|
+
.loading=${config.loading ?? false}
|
|
210
|
+
></nile-bar-chart>`;
|
|
211
|
+
case 'pie':
|
|
212
|
+
return html `<nile-pie-chart
|
|
213
|
+
.data=${config.data}
|
|
214
|
+
.seriesName=${config.seriesName ?? ''}
|
|
215
|
+
.height=${config.height ?? '400px'}
|
|
216
|
+
.showDataLabels=${config.showDataLabels ?? true}
|
|
217
|
+
.showLegend=${config.showLegend ?? true}
|
|
218
|
+
.options=${mergedOptions}
|
|
219
|
+
.loading=${config.loading ?? false}
|
|
220
|
+
></nile-pie-chart>`;
|
|
221
|
+
case 'trendline':
|
|
222
|
+
return html `<nile-trendline-chart
|
|
223
|
+
.data=${config.data}
|
|
224
|
+
.categories=${config.categories ?? []}
|
|
225
|
+
.height=${config.height ?? '400px'}
|
|
226
|
+
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
227
|
+
.forecast=${config.forecast ?? null}
|
|
228
|
+
.options=${mergedOptions}
|
|
229
|
+
.loading=${config.loading ?? false}
|
|
230
|
+
></nile-trendline-chart>`;
|
|
231
|
+
case 'anomaly':
|
|
232
|
+
return html `<nile-anomaly-chart
|
|
233
|
+
.data=${config.data}
|
|
234
|
+
.categories=${config.categories ?? []}
|
|
235
|
+
.height=${config.height ?? '400px'}
|
|
236
|
+
.yAxisTitle=${config.yAxisTitle ?? ''}
|
|
237
|
+
.anomaly=${config.anomaly ?? {}}
|
|
238
|
+
.options=${mergedOptions}
|
|
239
|
+
.loading=${config.loading ?? false}
|
|
240
|
+
></nile-anomaly-chart>`;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
render() {
|
|
244
|
+
return html `
|
|
245
|
+
<div class="chart-card">
|
|
246
|
+
${this.renderHeader()}
|
|
247
|
+
<div class="chart-wrapper">
|
|
248
|
+
<div class="chart-inner">
|
|
249
|
+
${this.activeConfig ? this.renderChartContent() : html `<slot></slot>`}
|
|
250
|
+
<button
|
|
251
|
+
class="chart-toggle"
|
|
252
|
+
aria-expanded="${this.open}"
|
|
253
|
+
@click="${this.toggle}"
|
|
254
|
+
>
|
|
255
|
+
${this.effectiveToggleLabel}
|
|
256
|
+
</button>
|
|
257
|
+
<div class="chart-overlay" ?data-open="${this.open}">
|
|
258
|
+
<div class="chart-content">
|
|
259
|
+
${this.config
|
|
260
|
+
? this.effectiveSummary
|
|
261
|
+
: html `<slot name="insight">${this.summary}</slot>`}
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
${this.renderAiPanel()}
|
|
265
|
+
</div>
|
|
266
|
+
</div>
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
NileChart.styles = styles;
|
|
272
|
+
__decorate([
|
|
273
|
+
property({ type: Object })
|
|
274
|
+
], NileChart.prototype, "config", void 0);
|
|
275
|
+
__decorate([
|
|
276
|
+
property({ type: String })
|
|
277
|
+
], NileChart.prototype, "summary", void 0);
|
|
278
|
+
__decorate([
|
|
279
|
+
property({ type: String, attribute: 'toggle-label' })
|
|
280
|
+
], NileChart.prototype, "toggleLabel", void 0);
|
|
281
|
+
__decorate([
|
|
282
|
+
state()
|
|
283
|
+
], NileChart.prototype, "open", void 0);
|
|
284
|
+
__decorate([
|
|
285
|
+
state()
|
|
286
|
+
], NileChart.prototype, "activeType", void 0);
|
|
287
|
+
__decorate([
|
|
288
|
+
state()
|
|
289
|
+
], NileChart.prototype, "activeConfig", void 0);
|
|
290
|
+
__decorate([
|
|
291
|
+
state()
|
|
292
|
+
], NileChart.prototype, "menuOpen", void 0);
|
|
293
|
+
__decorate([
|
|
294
|
+
state()
|
|
295
|
+
], NileChart.prototype, "chatOpen", void 0);
|
|
296
|
+
__decorate([
|
|
297
|
+
query('nile-ai-panel')
|
|
298
|
+
], NileChart.prototype, "aiPanel", void 0);
|
|
299
|
+
NileChart = __decorate([
|
|
300
|
+
customElement('nile-chart')
|
|
301
|
+
], NileChart);
|
|
302
|
+
export { NileChart };
|
|
303
|
+
//# sourceMappingURL=nile-chart.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const styles: import("lit").CSSResult;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { css } from 'lit';
|
|
2
|
+
export const styles = css `
|
|
3
|
+
:host {
|
|
4
|
+
display: block;
|
|
5
|
+
width: 100%;
|
|
6
|
+
position: relative;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
:host([hidden]) {
|
|
10
|
+
display: none;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.chart-container {
|
|
14
|
+
width: 100%;
|
|
15
|
+
min-height: var(--nile-height-200px, var(--ng-height-200px));
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.chart-loading {
|
|
19
|
+
display: flex;
|
|
20
|
+
align-items: center;
|
|
21
|
+
justify-content: center;
|
|
22
|
+
min-height: inherit;
|
|
23
|
+
color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
24
|
+
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
25
|
+
font-size: var(--nile-type-scale-3, var(--ng-font-size-text-sm));
|
|
26
|
+
}
|
|
27
|
+
`;
|
|
28
|
+
//# sourceMappingURL=nile-column-chart.css.js.map
|