@aquera/nile-visualization 2.9.32 → 2.9.34
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/README.md
CHANGED
|
@@ -36,6 +36,12 @@ To run a local development server that serves the basic demo located in `demo/in
|
|
|
36
36
|
|
|
37
37
|
In this section, you can find the updates for each release of `nile-visualization`. It's a good practice to maintain detailed release notes to help users and developers understand what changes have been made from one version to another and how these changes might affect their projects.
|
|
38
38
|
|
|
39
|
+
#### Version 2.9.34 (September 28, 2026)
|
|
40
|
+
- Nile KPI Chart: Added `valueInfo` / `valueInfoPlacement` for an info icon beside the value, updated the default sparkline and gauge colour to `#1868DB`, and fixed the hover dot to match the sparkline colour and hide on scroll. (UIF-1354)
|
|
41
|
+
|
|
42
|
+
#### Version 2.9.33 (September 15, 2026)
|
|
43
|
+
- Nile KPI Chart: Fixed the hover tooltip and marker sticking on screen after a scroll (UIF-1354)
|
|
44
|
+
|
|
39
45
|
#### Version 2.9.32 (September 10, 2026)
|
|
40
46
|
- Nile Chart: Added the `noBorder` config option — set `noBorder: true` on the chart config (root or `aq`) to remove the `border-bottom` divider under the card header, so the header and the plot read as one surface. Header padding, titles and actions are untouched; it composes with `noPadding` and has no effect when the header is hidden via `noHeader`. Reflected as the `no-border` attribute, so `<nile-chart no-border>` and `el.noBorder = true` work too, and the config is kept in sync both ways — assigning a config that omits `noBorder` clears it again, the same as `noHeader` / `noPadding`. Example at `examples/no-border.html` (UIF-1352)
|
|
41
47
|
|
|
@@ -70,6 +70,9 @@ export const styles = css `
|
|
|
70
70
|
--nile-kpi-forecast-font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
71
71
|
--nile-kpi-description-font-size: var(--nile-type-scale-2, var(--ng-font-size-text-xs));
|
|
72
72
|
--nile-kpi-description-color: var(--nile-colors-neutral-700, var(--ng-colors-text-secondary-700));
|
|
73
|
+
/* Value info icon (fixed 16px via the glyph's size attribute). */
|
|
74
|
+
--nile-kpi-info-color: var(--nile-colors-neutral-700, var(--ng-colors-fg-tertiary-600));
|
|
75
|
+
--nile-kpi-info-hover-color: var(--nile-colors-dark-900, var(--ng-colors-fg-tertiary-hover));
|
|
73
76
|
display: flex;
|
|
74
77
|
flex-direction: column;
|
|
75
78
|
width: 100%;
|
|
@@ -120,7 +123,7 @@ export const styles = css `
|
|
|
120
123
|
|
|
121
124
|
/* Accent variant — card chrome with a prominent left colour bar. */
|
|
122
125
|
:host([variant='accent']:not([embed-in-nile-chart])) {
|
|
123
|
-
--nile-kpi-accent-color:
|
|
126
|
+
--nile-kpi-accent-color: var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
124
127
|
background: var(--nile-kpi-card-bg);
|
|
125
128
|
border: var(--nile-kpi-card-border-width) solid var(--nile-kpi-card-border-color);
|
|
126
129
|
border-left: 4px solid var(--nile-kpi-accent-color);
|
|
@@ -186,6 +189,55 @@ export const styles = css `
|
|
|
186
189
|
flex: 0 0 auto;
|
|
187
190
|
}
|
|
188
191
|
|
|
192
|
+
.kpi-value-group {
|
|
193
|
+
display: inline-flex;
|
|
194
|
+
align-items: stretch;
|
|
195
|
+
flex: 0 0 auto;
|
|
196
|
+
min-width: 0;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.kpi-info {
|
|
200
|
+
display: inline-flex;
|
|
201
|
+
flex: 0 0 auto;
|
|
202
|
+
color: var(--nile-kpi-info-color);
|
|
203
|
+
border-radius: 50%;
|
|
204
|
+
cursor: pointer;
|
|
205
|
+
outline: none;
|
|
206
|
+
transition: color var(--nile-transition-duration-default, var(--ng-transition-duration-default)) ease;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/* currentColor follows .kpi-info's colour. */
|
|
210
|
+
.kpi-info nile-glyph {
|
|
211
|
+
display: block;
|
|
212
|
+
--nile-svg-fill: currentColor;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
.kpi-info:hover,
|
|
216
|
+
.kpi-info:focus-visible {
|
|
217
|
+
color: var(--nile-kpi-info-hover-color);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.kpi-info:focus-visible {
|
|
221
|
+
box-shadow: 0 0 0 2px var(--nile-colors-primary-600, var(--ng-colors-fg-brand-primary-600));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
/* top = superscript (level with the cap height), bottom = subscript (at the baseline). */
|
|
225
|
+
.kpi-info--top {
|
|
226
|
+
align-self: flex-start;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.kpi-info--bottom {
|
|
230
|
+
align-self: flex-end;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
.kpi-info--right {
|
|
234
|
+
margin-left: var(--nile-spacing-xs, var(--ng-spacing-xs));
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
.kpi-info--left {
|
|
238
|
+
margin-right: var(--nile-spacing-xs, var(--ng-spacing-xs));
|
|
239
|
+
}
|
|
240
|
+
|
|
189
241
|
.kpi-prefix,
|
|
190
242
|
.kpi-suffix {
|
|
191
243
|
font-family: var(--nile-font-family-serif, var(--ng-font-family-body));
|
|
@@ -486,10 +538,10 @@ export const styles = css `
|
|
|
486
538
|
}
|
|
487
539
|
|
|
488
540
|
/* Constrained both ways — only show the value. */
|
|
489
|
-
|
|
541
|
+
|
|
490
542
|
|
|
491
543
|
@container (max-width: 180px) and (max-height: 70px) {
|
|
492
|
-
|
|
544
|
+
|
|
493
545
|
.kpi-description,
|
|
494
546
|
.kpi-sparkline {
|
|
495
547
|
display: none;
|
|
@@ -7,6 +7,7 @@ export type KpiVariant = 'default' | 'card' | 'gauge' | 'accent';
|
|
|
7
7
|
export type SparklineType = 'area' | 'line' | 'column' | 'bar' | 'spline' | 'areaspline' | 'pie' | 'scatter';
|
|
8
8
|
export type KpiValueFormat = 'auto' | 'K' | 'M' | 'B' | 'T' | 'none';
|
|
9
9
|
export type KpiNumberSystem = 'indian' | 'international';
|
|
10
|
+
export type KpiInfoPlacement = 'top-right' | 'bottom-right' | 'top-left' | 'bottom-left';
|
|
10
11
|
/** `chart` slice for `<nile-kpi-chart>.config` (discriminated by `type: 'kpi'`). */
|
|
11
12
|
export interface ChartKpiSeparatedPayload {
|
|
12
13
|
type: 'kpi';
|
|
@@ -65,6 +66,10 @@ export interface ChartKpiSeparatedPayload {
|
|
|
65
66
|
valueFontSize?: string | number;
|
|
66
67
|
/** Override the KPI value text color. */
|
|
67
68
|
valueColor?: string;
|
|
69
|
+
/** Text for an info icon beside the value. Omitted/empty → no icon. */
|
|
70
|
+
valueInfo?: string;
|
|
71
|
+
/** Info icon position relative to the value (default: 'top-right'). */
|
|
72
|
+
valueInfoPlacement?: KpiInfoPlacement;
|
|
68
73
|
/** Custom text shown in the loading state (default: 'Loading...'). */
|
|
69
74
|
loadingText?: string;
|
|
70
75
|
/** Whether the hover tooltip is shown on value / sparkline / gauge (default: true). */
|
|
@@ -234,6 +239,10 @@ export declare class NileKpiChart extends NileElement {
|
|
|
234
239
|
valueFontSize: string | number;
|
|
235
240
|
/** Override the KPI value text color. */
|
|
236
241
|
valueColor: string;
|
|
242
|
+
/** Info text shown on hover/focus of an icon beside the value. Empty → no icon. */
|
|
243
|
+
valueInfo: string;
|
|
244
|
+
/** Info icon position: top-/bottom- (superscript/subscript), -left (before prefix) / -right (after suffix). */
|
|
245
|
+
valueInfoPlacement: KpiInfoPlacement;
|
|
237
246
|
/** Custom text shown in the loading state. */
|
|
238
247
|
loadingText: string;
|
|
239
248
|
/** Whether the hover tooltip is shown on value / sparkline / gauge. */
|
|
@@ -278,9 +287,11 @@ export declare class NileKpiChart extends NileElement {
|
|
|
278
287
|
*/
|
|
279
288
|
embedInNileChart: boolean;
|
|
280
289
|
private _createTipEl;
|
|
290
|
+
/** `force` bypasses `tooltipEnabled` — for the value info icon, whose only job is the tooltip. */
|
|
281
291
|
private _showTip;
|
|
282
292
|
private _showMarker;
|
|
283
293
|
private _hideTip;
|
|
294
|
+
private _onViewportChange;
|
|
284
295
|
private _syncCssVars;
|
|
285
296
|
private formatCssLength;
|
|
286
297
|
private parseNumericValue;
|
|
@@ -317,9 +328,11 @@ export declare class NileKpiChart extends NileElement {
|
|
|
317
328
|
private _onDescEnter;
|
|
318
329
|
private _onLabelEnter;
|
|
319
330
|
private _onTrendEnter;
|
|
331
|
+
private _onInfoEnter;
|
|
320
332
|
private _onGaugeEnter;
|
|
321
333
|
private _onTrendKeydown;
|
|
322
334
|
private _onTipLeave;
|
|
335
|
+
private renderValueInfo;
|
|
323
336
|
private renderTrend;
|
|
324
337
|
/**
|
|
325
338
|
* The projected-value line. Rendered only when `forecastValue` is set, so a
|
|
@@ -118,6 +118,10 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
118
118
|
this.valueFontSize = '';
|
|
119
119
|
/** Override the KPI value text color. */
|
|
120
120
|
this.valueColor = '';
|
|
121
|
+
/** Info text shown on hover/focus of an icon beside the value. Empty → no icon. */
|
|
122
|
+
this.valueInfo = '';
|
|
123
|
+
/** Info icon position: top-/bottom- (superscript/subscript), -left (before prefix) / -right (after suffix). */
|
|
124
|
+
this.valueInfoPlacement = 'top-right';
|
|
121
125
|
/** Custom text shown in the loading state. */
|
|
122
126
|
this.loadingText = 'Loading...';
|
|
123
127
|
/** Whether the hover tooltip is shown on value / sparkline / gauge. */
|
|
@@ -166,6 +170,9 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
166
170
|
* Set by nile-chart: skip host border/shadow (variant card/gauge) so the parent chart-card is the only frame.
|
|
167
171
|
*/
|
|
168
172
|
this.embedInNileChart = false;
|
|
173
|
+
this._onViewportChange = () => {
|
|
174
|
+
this._hideTip();
|
|
175
|
+
};
|
|
169
176
|
// ── Chart sizing ─────────────────────────────────────────────────────────
|
|
170
177
|
this._lastSparkSize = { w: 0, h: 0 };
|
|
171
178
|
this._lastGaugeSize = { w: 0, h: 0 };
|
|
@@ -182,6 +189,10 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
182
189
|
if (!series?.points?.length)
|
|
183
190
|
return;
|
|
184
191
|
const rect = this.sparklineContainer.getBoundingClientRect();
|
|
192
|
+
if (e.clientX < rect.left || e.clientX > rect.right || e.clientY < rect.top || e.clientY > rect.bottom) {
|
|
193
|
+
this._hideTip();
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
185
196
|
const inverted = !!chart.inverted;
|
|
186
197
|
const xAxis = series.xAxis;
|
|
187
198
|
const yAxis = series.yAxis;
|
|
@@ -205,7 +216,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
205
216
|
this._showTip(text, tipX, tipY);
|
|
206
217
|
const isBarLike = this.sparklineType === 'bar' || this.sparklineType === 'column';
|
|
207
218
|
if (!isBarLike) {
|
|
208
|
-
this._showMarker(tipX, tipY, this.sparklineColor || '#
|
|
219
|
+
this._showMarker(tipX, tipY, this.sparklineColor || '#1868DB');
|
|
209
220
|
}
|
|
210
221
|
};
|
|
211
222
|
this._onSparklineMouseLeave = () => {
|
|
@@ -249,6 +260,10 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
249
260
|
const text = `${arrow} ${pct}${this.trendLabel ? ' ' + this.trendLabel : ''}`.trim();
|
|
250
261
|
this._showTip(text, rect.left + rect.width / 2, rect.top);
|
|
251
262
|
};
|
|
263
|
+
this._onInfoEnter = (e) => {
|
|
264
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
265
|
+
this._showTip(this.valueInfo, rect.left + rect.width / 2, rect.top, true);
|
|
266
|
+
};
|
|
252
267
|
this._onGaugeEnter = (e) => {
|
|
253
268
|
const rect = e.currentTarget.getBoundingClientRect();
|
|
254
269
|
this._showTip(this.getTooltipContent(), rect.left + rect.width / 2, rect.top + rect.height / 2);
|
|
@@ -274,8 +289,9 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
274
289
|
document.body.appendChild(marker);
|
|
275
290
|
this._markerEl = marker;
|
|
276
291
|
}
|
|
277
|
-
|
|
278
|
-
|
|
292
|
+
/** `force` bypasses `tooltipEnabled` — for the value info icon, whose only job is the tooltip. */
|
|
293
|
+
_showTip(text, x, y, force = false) {
|
|
294
|
+
if (!this._tipEl || (!this.tooltipEnabled && !force))
|
|
279
295
|
return;
|
|
280
296
|
this._tipEl.textContent = text;
|
|
281
297
|
this._tipEl.style.left = `${x}px`;
|
|
@@ -574,6 +590,10 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
574
590
|
this.valueFontSize = c.valueFontSize;
|
|
575
591
|
if (c.valueColor !== undefined)
|
|
576
592
|
this.valueColor = c.valueColor;
|
|
593
|
+
if (c.valueInfo !== undefined)
|
|
594
|
+
this.valueInfo = c.valueInfo;
|
|
595
|
+
if (c.valueInfoPlacement !== undefined)
|
|
596
|
+
this.valueInfoPlacement = c.valueInfoPlacement;
|
|
577
597
|
if (c.loadingText !== undefined)
|
|
578
598
|
this.loadingText = c.loadingText;
|
|
579
599
|
if (c.tooltipEnabled !== undefined)
|
|
@@ -658,6 +678,9 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
658
678
|
super.connectedCallback();
|
|
659
679
|
ensureTooltipStyles();
|
|
660
680
|
this._createTipEl();
|
|
681
|
+
document.addEventListener('scroll', this._onViewportChange, { capture: true, passive: true });
|
|
682
|
+
document.addEventListener('wheel', this._onViewportChange, { capture: true, passive: true });
|
|
683
|
+
window.addEventListener('resize', this._onViewportChange, { passive: true });
|
|
661
684
|
if (!this._hc) {
|
|
662
685
|
getHighcharts().then(hc => { this._hc = hc; this.requestUpdate(); });
|
|
663
686
|
}
|
|
@@ -666,6 +689,9 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
666
689
|
}
|
|
667
690
|
disconnectedCallback() {
|
|
668
691
|
super.disconnectedCallback();
|
|
692
|
+
document.removeEventListener('scroll', this._onViewportChange, { capture: true });
|
|
693
|
+
document.removeEventListener('wheel', this._onViewportChange, { capture: true });
|
|
694
|
+
window.removeEventListener('resize', this._onViewportChange);
|
|
669
695
|
this._hideTip();
|
|
670
696
|
this._tipEl?.remove();
|
|
671
697
|
this._tipEl = null;
|
|
@@ -815,7 +841,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
815
841
|
}
|
|
816
842
|
// ── Chart options ────────────────────────────────────────────────────────
|
|
817
843
|
buildSparklineOptions() {
|
|
818
|
-
const brandColor = this.sparklineColor || '#
|
|
844
|
+
const brandColor = this.sparklineColor || '#1868DB';
|
|
819
845
|
const lineWidth = this.sparklineLineWidth;
|
|
820
846
|
const seriesType = this.sparklineType;
|
|
821
847
|
const topAlpha = Math.round(Math.min(1, Math.max(0, this.sparklineFillOpacity)) * 255).toString(16).padStart(2, '0');
|
|
@@ -912,7 +938,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
912
938
|
return { ...defaults, ...this.options };
|
|
913
939
|
}
|
|
914
940
|
buildGaugeOptions() {
|
|
915
|
-
const color = this.gaugeColor || '#
|
|
941
|
+
const color = this.gaugeColor || '#1868DB';
|
|
916
942
|
const trackColor = this.gaugeTrackColor || '#E5E7EB';
|
|
917
943
|
const innerRadius = this.gaugeInnerRadius || '80%';
|
|
918
944
|
const outerRadius = this.gaugeOuterRadius || '100%';
|
|
@@ -1050,6 +1076,23 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1050
1076
|
this.destroyGauge();
|
|
1051
1077
|
}
|
|
1052
1078
|
// ── Render ───────────────────────────────────────────────────────────────
|
|
1079
|
+
renderValueInfo() {
|
|
1080
|
+
if (!this.valueInfo)
|
|
1081
|
+
return nothing;
|
|
1082
|
+
const [vertical, side] = this.valueInfoPlacement.split('-');
|
|
1083
|
+
return html `<span
|
|
1084
|
+
class="kpi-info kpi-info--${vertical === 'bottom' ? 'bottom' : 'top'} kpi-info--${side === 'left' ? 'left' : 'right'}"
|
|
1085
|
+
part="value-info"
|
|
1086
|
+
role="img"
|
|
1087
|
+
tabindex="0"
|
|
1088
|
+
aria-label=${this.valueInfo}
|
|
1089
|
+
@mouseenter=${this._onInfoEnter}
|
|
1090
|
+
@mouseleave=${this._onTipLeave}
|
|
1091
|
+
@focus=${this._onInfoEnter}
|
|
1092
|
+
@blur=${this._onTipLeave}
|
|
1093
|
+
@keydown=${this._onTrendKeydown}
|
|
1094
|
+
><nile-glyph name="ng-info-circle" method="stroke" size="16"></nile-glyph></span>`;
|
|
1095
|
+
}
|
|
1053
1096
|
renderTrend() {
|
|
1054
1097
|
if (this.trendValue === null)
|
|
1055
1098
|
return undefined;
|
|
@@ -1113,6 +1156,7 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1113
1156
|
const fmt = rawNum != null ? this.formatValue(rawNum) : null;
|
|
1114
1157
|
const displayValue = fmt ? fmt.display : String(this.value ?? '');
|
|
1115
1158
|
const showTooltip = !!fmt && fmt.display !== fmt.full;
|
|
1159
|
+
const infoLeft = this.valueInfoPlacement.endsWith('-left');
|
|
1116
1160
|
return html `
|
|
1117
1161
|
<div class="kpi ${isGauge ? 'kpi--gauge' : ''}">
|
|
1118
1162
|
${this.label ? html `<p
|
|
@@ -1143,6 +1187,8 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1143
1187
|
|
|
1144
1188
|
<div class="kpi-value-row">
|
|
1145
1189
|
${!isGauge ? html `
|
|
1190
|
+
<span class="kpi-value-group">
|
|
1191
|
+
${infoLeft ? this.renderValueInfo() : nothing}
|
|
1146
1192
|
<h2
|
|
1147
1193
|
class="kpi-value"
|
|
1148
1194
|
tabindex=${showTooltip ? '0' : nothing}
|
|
@@ -1154,6 +1200,8 @@ let NileKpiChart = class NileKpiChart extends NileElement {
|
|
|
1154
1200
|
>
|
|
1155
1201
|
${this.prefix ? html `<span class="kpi-prefix">${this.prefix}</span>` : nothing}${displayValue}${this.suffix ? html `<span class="kpi-suffix">${this.suffix}</span>` : nothing}
|
|
1156
1202
|
</h2>
|
|
1203
|
+
${infoLeft ? nothing : this.renderValueInfo()}
|
|
1204
|
+
</span>
|
|
1157
1205
|
` : nothing}
|
|
1158
1206
|
${!isGauge ? this.renderTrend() : nothing}
|
|
1159
1207
|
</div>
|
|
@@ -1301,6 +1349,12 @@ __decorate([
|
|
|
1301
1349
|
__decorate([
|
|
1302
1350
|
property({ type: String, attribute: 'value-color' })
|
|
1303
1351
|
], NileKpiChart.prototype, "valueColor", void 0);
|
|
1352
|
+
__decorate([
|
|
1353
|
+
property({ type: String, attribute: 'value-info' })
|
|
1354
|
+
], NileKpiChart.prototype, "valueInfo", void 0);
|
|
1355
|
+
__decorate([
|
|
1356
|
+
property({ type: String, attribute: 'value-info-placement' })
|
|
1357
|
+
], NileKpiChart.prototype, "valueInfoPlacement", void 0);
|
|
1304
1358
|
__decorate([
|
|
1305
1359
|
property({ type: String, attribute: 'loading-text' })
|
|
1306
1360
|
], NileKpiChart.prototype, "loadingText", void 0);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aquera/nile-visualization",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.34",
|
|
4
4
|
"description": "A visualization Library for the Nile Design System",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Aquera Inc",
|
|
@@ -90,4 +90,4 @@
|
|
|
90
90
|
"@web/test-runner": "^0.14.0",
|
|
91
91
|
"@web/test-runner-puppeteer": "0.16.0"
|
|
92
92
|
}
|
|
93
|
-
}
|
|
93
|
+
}
|