ngx-core-components 0.3.15 → 0.3.16
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/charts/area-chart/area-chart.component.d.ts +3 -0
- package/charts/candlestick-chart/candlestick-chart.component.d.ts +3 -0
- package/charts/combo-chart/combo-chart.component.d.ts +2 -0
- package/charts/gauge-chart/gauge-chart.component.d.ts +8 -1
- package/charts/heatmap-chart/heatmap-chart.component.d.ts +1 -0
- package/charts/line-chart/line-chart.component.d.ts +1 -0
- package/charts/pie-chart/pie-chart.component.d.ts +2 -0
- package/charts/radar-chart/radar-chart.component.d.ts +1 -0
- package/charts/radial-bar-chart/radial-bar-chart.component.d.ts +8 -1
- package/charts/sparkline/sparkline.component.d.ts +7 -5
- package/charts/treemap-chart/treemap-chart.component.d.ts +1 -0
- package/charts/waterfall-chart/waterfall-chart.component.d.ts +1 -0
- package/fesm2022/ngx-core-components-charts.mjs +1014 -243
- package/fesm2022/ngx-core-components-charts.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -283,6 +283,14 @@ class BarChartComponent {
|
|
|
283
283
|
[attr.height]="chartHeight()"
|
|
284
284
|
class="chart-svg"
|
|
285
285
|
>
|
|
286
|
+
<defs>
|
|
287
|
+
@for (s of series(); track s.name; let i = $index) {
|
|
288
|
+
<linearGradient [attr.id]="'bar-grad-' + i" x1="0" y1="0" x2="0" y2="1">
|
|
289
|
+
<stop offset="0%" [attr.stop-color]="seriesColor(i)" stop-opacity="1"/>
|
|
290
|
+
<stop offset="100%" [attr.stop-color]="seriesColor(i)" stop-opacity="0.75"/>
|
|
291
|
+
</linearGradient>
|
|
292
|
+
}
|
|
293
|
+
</defs>
|
|
286
294
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
287
295
|
|
|
288
296
|
<!-- Y axis grid lines + labels -->
|
|
@@ -328,8 +336,8 @@ class BarChartComponent {
|
|
|
328
336
|
[attr.y]="barY(v)"
|
|
329
337
|
[attr.width]="singleBarWidth()"
|
|
330
338
|
[attr.height]="barH(v)"
|
|
331
|
-
[attr.fill]="
|
|
332
|
-
[attr.rx]="
|
|
339
|
+
[attr.fill]="s.color ? s.color : 'url(#bar-grad-' + si + ')'"
|
|
340
|
+
[attr.rx]="4"
|
|
333
341
|
class="bar-rect"
|
|
334
342
|
/>
|
|
335
343
|
@if (showLabels() && animateState()) {
|
|
@@ -364,7 +372,7 @@ class BarChartComponent {
|
|
|
364
372
|
</div>
|
|
365
373
|
}
|
|
366
374
|
</div>
|
|
367
|
-
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-bar-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text, #6c757d)}.legend-dot{width:10px;height:10px;border-radius:
|
|
375
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-bar-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text, #6c757d);font-weight:500}.legend-dot{width:10px;height:10px;border-radius:3px;display:inline-block}.chart-svg{display:block;overflow:visible}.axis-label{font-size:11px;fill:var(--ngx-chart-axis-text, #6c757d);-webkit-user-select:none;user-select:none;font-weight:500}.column-ruler{fill:#6366f108;stroke:#6366f114;stroke-width:1;rx:6;ry:6;pointer-events:none;transition:x .15s cubic-bezier(.16,1,.3,1),width .15s cubic-bezier(.16,1,.3,1)}.bar-rect{cursor:pointer;transition:y .5s cubic-bezier(.16,1,.3,1),height .5s cubic-bezier(.16,1,.3,1),fill-opacity .15s,stroke-width .15s;stroke:#fff;stroke-width:.5}.bar-rect:hover{fill-opacity:.9;stroke-width:1.5;filter:drop-shadow(0 4px 6px rgba(0,0,0,.08))}.bar-label{font-size:11px;fill:var(--ngx-chart-axis-text, #6c757d);pointer-events:none;font-weight:600}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
368
376
|
}
|
|
369
377
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BarChartComponent, decorators: [{
|
|
370
378
|
type: Component,
|
|
@@ -410,6 +418,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
410
418
|
[attr.height]="chartHeight()"
|
|
411
419
|
class="chart-svg"
|
|
412
420
|
>
|
|
421
|
+
<defs>
|
|
422
|
+
@for (s of series(); track s.name; let i = $index) {
|
|
423
|
+
<linearGradient [attr.id]="'bar-grad-' + i" x1="0" y1="0" x2="0" y2="1">
|
|
424
|
+
<stop offset="0%" [attr.stop-color]="seriesColor(i)" stop-opacity="1"/>
|
|
425
|
+
<stop offset="100%" [attr.stop-color]="seriesColor(i)" stop-opacity="0.75"/>
|
|
426
|
+
</linearGradient>
|
|
427
|
+
}
|
|
428
|
+
</defs>
|
|
413
429
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
414
430
|
|
|
415
431
|
<!-- Y axis grid lines + labels -->
|
|
@@ -455,8 +471,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
455
471
|
[attr.y]="barY(v)"
|
|
456
472
|
[attr.width]="singleBarWidth()"
|
|
457
473
|
[attr.height]="barH(v)"
|
|
458
|
-
[attr.fill]="
|
|
459
|
-
[attr.rx]="
|
|
474
|
+
[attr.fill]="s.color ? s.color : 'url(#bar-grad-' + si + ')'"
|
|
475
|
+
[attr.rx]="4"
|
|
460
476
|
class="bar-rect"
|
|
461
477
|
/>
|
|
462
478
|
@if (showLabels() && animateState()) {
|
|
@@ -491,7 +507,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
491
507
|
</div>
|
|
492
508
|
}
|
|
493
509
|
</div>
|
|
494
|
-
`, styles: [":host{display:block;position:relative}.ngx-bar-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text, #6c757d)}.legend-dot{width:10px;height:10px;border-radius:
|
|
510
|
+
`, styles: [":host{display:block;position:relative}.ngx-bar-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text, #6c757d);font-weight:500}.legend-dot{width:10px;height:10px;border-radius:3px;display:inline-block}.chart-svg{display:block;overflow:visible}.axis-label{font-size:11px;fill:var(--ngx-chart-axis-text, #6c757d);-webkit-user-select:none;user-select:none;font-weight:500}.column-ruler{fill:#6366f108;stroke:#6366f114;stroke-width:1;rx:6;ry:6;pointer-events:none;transition:x .15s cubic-bezier(.16,1,.3,1),width .15s cubic-bezier(.16,1,.3,1)}.bar-rect{cursor:pointer;transition:y .5s cubic-bezier(.16,1,.3,1),height .5s cubic-bezier(.16,1,.3,1),fill-opacity .15s,stroke-width .15s;stroke:#fff;stroke-width:.5}.bar-rect:hover{fill-opacity:.9;stroke-width:1.5;filter:drop-shadow(0 4px 6px rgba(0,0,0,.08))}.bar-label{font-size:11px;fill:var(--ngx-chart-axis-text, #6c757d);pointer-events:none;font-weight:600}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"] }]
|
|
495
511
|
}], ctorParameters: () => [], propDecorators: { closeExportMenu: [{
|
|
496
512
|
type: HostListener,
|
|
497
513
|
args: ['document:click']
|
|
@@ -516,6 +532,7 @@ class LineChartComponent {
|
|
|
516
532
|
animateState = signal(false);
|
|
517
533
|
containerWidth = signal(600);
|
|
518
534
|
crosshair = signal(null);
|
|
535
|
+
activeCategoryIndex = signal(null);
|
|
519
536
|
tooltip = signal(null);
|
|
520
537
|
chartHeight = computed(() => this.height());
|
|
521
538
|
innerW = computed(() => this.containerWidth() - this.PAD_LEFT - this.PAD_RIGHT);
|
|
@@ -567,6 +584,7 @@ class LineChartComponent {
|
|
|
567
584
|
const idx = Math.round(scale(mx, 0, this.innerW(), 0, cats.length - 1));
|
|
568
585
|
const ci = Math.max(0, Math.min(cats.length - 1, idx));
|
|
569
586
|
this.crosshair.set({ x: this.xPos(ci) });
|
|
587
|
+
this.activeCategoryIndex.set(ci);
|
|
570
588
|
const rows = this.series().map((s, si) => ({
|
|
571
589
|
name: s.name,
|
|
572
590
|
value: s.data[ci] ?? 0,
|
|
@@ -581,6 +599,7 @@ class LineChartComponent {
|
|
|
581
599
|
}
|
|
582
600
|
onMouseLeave() {
|
|
583
601
|
this.crosshair.set(null);
|
|
602
|
+
this.activeCategoryIndex.set(null);
|
|
584
603
|
this.tooltip.set(null);
|
|
585
604
|
}
|
|
586
605
|
toggleExportMenu(event) {
|
|
@@ -756,10 +775,11 @@ class LineChartComponent {
|
|
|
756
775
|
<circle
|
|
757
776
|
[attr.cx]="xPos(ci)"
|
|
758
777
|
[attr.cy]="yPos(v)"
|
|
759
|
-
r="4"
|
|
778
|
+
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
760
779
|
[attr.fill]="seriesColor(si, s)"
|
|
761
|
-
stroke="#fff"
|
|
762
|
-
stroke-width="2"
|
|
780
|
+
[attr.stroke]="activeCategoryIndex() === ci ? '#fff' : '#fff'"
|
|
781
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 2.5 : 2"
|
|
782
|
+
[attr.filter]="activeCategoryIndex() === ci ? 'drop-shadow(0 2px 4px rgba(0,0,0,0.25))' : null"
|
|
763
783
|
class="marker-dot"
|
|
764
784
|
/>
|
|
765
785
|
}
|
|
@@ -791,7 +811,7 @@ class LineChartComponent {
|
|
|
791
811
|
</div>
|
|
792
812
|
}
|
|
793
813
|
</div>
|
|
794
|
-
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-line-chart{position:relative;background:var(--ngx-chart-bg, #fff)}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text,#6c757d)}.legend-line{width:
|
|
814
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-line-chart{position:relative;background:var(--ngx-chart-bg, #fff)}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text,#6c757d);font-weight:500}.legend-line{width:18px;height:4px;border-radius:2px;display:inline-block}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:11px;fill:var(--ngx-chart-axis-text,#6c757d);-webkit-user-select:none;user-select:none;font-weight:500}.chart-crosshair{transition:x1 .12s cubic-bezier(.16,1,.3,1),x2 .12s cubic-bezier(.16,1,.3,1)}@keyframes lineDraw{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:lineDraw 1.2s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFadeIn{0%{opacity:0}to{opacity:1}}.area-path{animation:areaFadeIn 1s cubic-bezier(.16,1,.3,1) .3s both}.marker-dot{animation:areaFadeIn .5s ease .8s both;transition:r .15s cubic-bezier(.16,1,.3,1),stroke-width .15s}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
795
815
|
}
|
|
796
816
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: LineChartComponent, decorators: [{
|
|
797
817
|
type: Component,
|
|
@@ -886,10 +906,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
886
906
|
<circle
|
|
887
907
|
[attr.cx]="xPos(ci)"
|
|
888
908
|
[attr.cy]="yPos(v)"
|
|
889
|
-
r="4"
|
|
909
|
+
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
890
910
|
[attr.fill]="seriesColor(si, s)"
|
|
891
|
-
stroke="#fff"
|
|
892
|
-
stroke-width="2"
|
|
911
|
+
[attr.stroke]="activeCategoryIndex() === ci ? '#fff' : '#fff'"
|
|
912
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 2.5 : 2"
|
|
913
|
+
[attr.filter]="activeCategoryIndex() === ci ? 'drop-shadow(0 2px 4px rgba(0,0,0,0.25))' : null"
|
|
893
914
|
class="marker-dot"
|
|
894
915
|
/>
|
|
895
916
|
}
|
|
@@ -921,7 +942,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
921
942
|
</div>
|
|
922
943
|
}
|
|
923
944
|
</div>
|
|
924
|
-
`, styles: [":host{display:block;position:relative}.ngx-line-chart{position:relative;background:var(--ngx-chart-bg, #fff)}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text,#6c757d)}.legend-line{width:
|
|
945
|
+
`, styles: [":host{display:block;position:relative}.ngx-line-chart{position:relative;background:var(--ngx-chart-bg, #fff)}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-legend{display:flex;gap:16px;padding:4px 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--ngx-chart-axis-text,#6c757d);font-weight:500}.legend-line{width:18px;height:4px;border-radius:2px;display:inline-block}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:11px;fill:var(--ngx-chart-axis-text,#6c757d);-webkit-user-select:none;user-select:none;font-weight:500}.chart-crosshair{transition:x1 .12s cubic-bezier(.16,1,.3,1),x2 .12s cubic-bezier(.16,1,.3,1)}@keyframes lineDraw{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:lineDraw 1.2s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFadeIn{0%{opacity:0}to{opacity:1}}.area-path{animation:areaFadeIn 1s cubic-bezier(.16,1,.3,1) .3s both}.marker-dot{animation:areaFadeIn .5s ease .8s both;transition:r .15s cubic-bezier(.16,1,.3,1),stroke-width .15s}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"] }]
|
|
925
946
|
}], ctorParameters: () => [], propDecorators: { closeExportMenu: [{
|
|
926
947
|
type: HostListener,
|
|
927
948
|
args: ['document:click']
|
|
@@ -973,6 +994,8 @@ class PieChartComponent {
|
|
|
973
994
|
const path = this.mode() === 'donut'
|
|
974
995
|
? this.ringPath(start, end, r, this.holeR())
|
|
975
996
|
: this.arcPath(start, end, r);
|
|
997
|
+
const cos = Math.cos(mid);
|
|
998
|
+
const sin = Math.sin(mid);
|
|
976
999
|
start = end;
|
|
977
1000
|
return {
|
|
978
1001
|
index: i,
|
|
@@ -982,6 +1005,8 @@ class PieChartComponent {
|
|
|
982
1005
|
color: item.color || this.colors()[i % this.colors().length],
|
|
983
1006
|
path,
|
|
984
1007
|
midAngle: mid,
|
|
1008
|
+
cos,
|
|
1009
|
+
sin,
|
|
985
1010
|
};
|
|
986
1011
|
});
|
|
987
1012
|
});
|
|
@@ -1125,6 +1150,7 @@ class PieChartComponent {
|
|
|
1125
1150
|
stroke-width="2"
|
|
1126
1151
|
class="pie-slice"
|
|
1127
1152
|
[class.hovered]="hovered() === slice.index"
|
|
1153
|
+
[style.transform]="hovered() === slice.index ? 'translate(' + (slice.cos * 8) + 'px,' + (slice.sin * 8) + 'px)' : 'translate(0, 0)'"
|
|
1128
1154
|
(mouseenter)="hovered.set(slice.index); onSliceHover($event, slice)"
|
|
1129
1155
|
(mouseleave)="hovered.set(-1); tooltip.set(null)"
|
|
1130
1156
|
/>
|
|
@@ -1167,7 +1193,7 @@ class PieChartComponent {
|
|
|
1167
1193
|
</div>
|
|
1168
1194
|
}
|
|
1169
1195
|
</div>
|
|
1170
|
-
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-pie-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit;overflow:hidden}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-body{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.chart-svg{display:block;max-width:100%;height:auto;min-width:0;animation:pieGrow .75s cubic-bezier(.16,1,.3,1) both;transform-origin:center}@keyframes pieGrow{0%{transform:scale(.4) rotate(-90deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}.pie-group{transform-origin:center}.pie-slice{cursor:pointer;transition:transform .
|
|
1196
|
+
`, isInline: true, styles: [":host{display:block;position:relative}.ngx-pie-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit;overflow:hidden}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-body{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.chart-svg{display:block;max-width:100%;height:auto;min-width:0;animation:pieGrow .75s cubic-bezier(.16,1,.3,1) both;transform-origin:center}@keyframes pieGrow{0%{transform:scale(.4) rotate(-90deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}.pie-group{transform-origin:center}.pie-slice{cursor:pointer;transition:transform .25s cubic-bezier(.16,1,.3,1),fill-opacity .15s;transform-origin:0px 0px}.pie-slice.hovered{fill-opacity:.95;filter:drop-shadow(0 6px 10px rgba(0,0,0,.16))}.slice-label{font-size:11px;fill:#fff;font-weight:600;pointer-events:none;-webkit-user-select:none;user-select:none}.donut-center-text{font-size:11px;fill:var(--ngx-chart-axis-text,#6c757d);font-weight:600;text-transform:uppercase;letter-spacing:.5px}.donut-center-value{font-size:24px;font-weight:900;fill:var(--ngx-chart-text,#0f172a)}.chart-legend{display:flex;flex-direction:column;gap:6px;flex-shrink:0}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;padding:5px 10px;border-radius:8px;transition:all .15s}.legend-item:hover{background:var(--ngx-chart-grid,#f1f3f5)}.legend-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0}.legend-label{flex:1;color:var(--ngx-chart-axis-text,#6c757d);font-weight:500}.legend-pct{font-weight:600;color:var(--ngx-chart-text,#212529)}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:140px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;display:flex;align-items:center;gap:6px;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-dot{width:8px;height:8px;border-radius:50%}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1171
1197
|
}
|
|
1172
1198
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: PieChartComponent, decorators: [{
|
|
1173
1199
|
type: Component,
|
|
@@ -1207,6 +1233,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1207
1233
|
stroke-width="2"
|
|
1208
1234
|
class="pie-slice"
|
|
1209
1235
|
[class.hovered]="hovered() === slice.index"
|
|
1236
|
+
[style.transform]="hovered() === slice.index ? 'translate(' + (slice.cos * 8) + 'px,' + (slice.sin * 8) + 'px)' : 'translate(0, 0)'"
|
|
1210
1237
|
(mouseenter)="hovered.set(slice.index); onSliceHover($event, slice)"
|
|
1211
1238
|
(mouseleave)="hovered.set(-1); tooltip.set(null)"
|
|
1212
1239
|
/>
|
|
@@ -1249,7 +1276,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1249
1276
|
</div>
|
|
1250
1277
|
}
|
|
1251
1278
|
</div>
|
|
1252
|
-
`, styles: [":host{display:block;position:relative}.ngx-pie-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit;overflow:hidden}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-body{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.chart-svg{display:block;max-width:100%;height:auto;min-width:0;animation:pieGrow .75s cubic-bezier(.16,1,.3,1) both;transform-origin:center}@keyframes pieGrow{0%{transform:scale(.4) rotate(-90deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}.pie-group{transform-origin:center}.pie-slice{cursor:pointer;transition:transform .
|
|
1279
|
+
`, styles: [":host{display:block;position:relative}.ngx-pie-chart{position:relative;background:var(--ngx-chart-bg, #fff);font-family:inherit;overflow:hidden}.chart-header{display:flex;justify-content:space-between;align-items:center;min-height:24px;position:relative}.chart-body{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.chart-svg{display:block;max-width:100%;height:auto;min-width:0;animation:pieGrow .75s cubic-bezier(.16,1,.3,1) both;transform-origin:center}@keyframes pieGrow{0%{transform:scale(.4) rotate(-90deg);opacity:0}to{transform:scale(1) rotate(0);opacity:1}}.pie-group{transform-origin:center}.pie-slice{cursor:pointer;transition:transform .25s cubic-bezier(.16,1,.3,1),fill-opacity .15s;transform-origin:0px 0px}.pie-slice.hovered{fill-opacity:.95;filter:drop-shadow(0 6px 10px rgba(0,0,0,.16))}.slice-label{font-size:11px;fill:#fff;font-weight:600;pointer-events:none;-webkit-user-select:none;user-select:none}.donut-center-text{font-size:11px;fill:var(--ngx-chart-axis-text,#6c757d);font-weight:600;text-transform:uppercase;letter-spacing:.5px}.donut-center-value{font-size:24px;font-weight:900;fill:var(--ngx-chart-text,#0f172a)}.chart-legend{display:flex;flex-direction:column;gap:6px;flex-shrink:0}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;cursor:pointer;padding:5px 10px;border-radius:8px;transition:all .15s}.legend-item:hover{background:var(--ngx-chart-grid,#f1f3f5)}.legend-dot{width:10px;height:10px;border-radius:3px;flex-shrink:0}.legend-label{flex:1;color:var(--ngx-chart-axis-text,#6c757d);font-weight:500}.legend-pct{font-weight:600;color:var(--ngx-chart-text,#212529)}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:140px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;display:flex;align-items:center;gap:6px;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-dot{width:8px;height:8px;border-radius:50%}.chart-export-menu{position:absolute;top:0;right:0;z-index:50}.export-trigger{padding:4px 10px;font-size:11px;font-weight:600;color:var(--ngx-chart-axis-text, #6c757d);background:#ffffffb3;backdrop-filter:blur(8px);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:6px;cursor:pointer;transition:all .15s}.export-trigger:hover{background:#fff;color:var(--primary-color, #4f46e5);border-color:var(--primary-color, #4f46e5)}.export-dropdown{position:absolute;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:8px;box-shadow:0 10px 15px -3px #00000014;padding:4px;display:flex;flex-direction:column;gap:2px;min-width:120px}.export-dropdown button{background:none;border:none;padding:6px 10px;font-size:11px;text-align:left;cursor:pointer;color:#343a40;border-radius:4px;font-family:inherit;width:100%;transition:all .12s}.export-dropdown button:hover{background:#4f46e50f;color:var(--primary-color, #4f46e5)}\n"] }]
|
|
1253
1280
|
}], ctorParameters: () => [], propDecorators: { closeExportMenu: [{
|
|
1254
1281
|
type: HostListener,
|
|
1255
1282
|
args: ['document:click']
|
|
@@ -1264,6 +1291,7 @@ class SparklineComponent {
|
|
|
1264
1291
|
PAD = 2;
|
|
1265
1292
|
w = computed(() => this.width() - this.PAD * 2);
|
|
1266
1293
|
h = computed(() => this.height() - this.PAD * 2);
|
|
1294
|
+
hoveredIndex = signal(null);
|
|
1267
1295
|
yMin = computed(() => Math.min(...this.data(), 0));
|
|
1268
1296
|
yMax = computed(() => Math.max(...this.data(), 1));
|
|
1269
1297
|
pts = computed(() => {
|
|
@@ -1287,11 +1315,16 @@ class SparklineComponent {
|
|
|
1287
1315
|
const bottom = this.PAD + this.h();
|
|
1288
1316
|
return line + ` L ${last[0]} ${bottom} L ${first[0]} ${bottom} Z`;
|
|
1289
1317
|
});
|
|
1290
|
-
areaFill = computed(() => this.color() + '22');
|
|
1291
1318
|
endPoint = computed(() => {
|
|
1292
1319
|
const pts = this.pts();
|
|
1293
1320
|
return pts.length > 0 ? pts[pts.length - 1] : null;
|
|
1294
1321
|
});
|
|
1322
|
+
activePoint = computed(() => {
|
|
1323
|
+
const idx = this.hoveredIndex();
|
|
1324
|
+
if (this.type() === 'bar')
|
|
1325
|
+
return null; // Dot tracking only for lines/areas
|
|
1326
|
+
return idx !== null && this.pts()[idx] ? this.pts()[idx] : null;
|
|
1327
|
+
});
|
|
1295
1328
|
barItems = computed(() => {
|
|
1296
1329
|
const d = this.data();
|
|
1297
1330
|
const n = d.length;
|
|
@@ -1305,6 +1338,16 @@ class SparklineComponent {
|
|
|
1305
1338
|
return { x, y, w: bw, h: Math.abs(zero - y) };
|
|
1306
1339
|
});
|
|
1307
1340
|
});
|
|
1341
|
+
onMouseMove(event) {
|
|
1342
|
+
const el = event.currentTarget;
|
|
1343
|
+
const rect = el.getBoundingClientRect();
|
|
1344
|
+
const x = event.clientX - rect.left - this.PAD;
|
|
1345
|
+
const n = this.data().length;
|
|
1346
|
+
if (n === 0)
|
|
1347
|
+
return;
|
|
1348
|
+
const idx = Math.max(0, Math.min(n - 1, Math.round(scale(x, 0, this.w(), 0, n - 1))));
|
|
1349
|
+
this.hoveredIndex.set(idx);
|
|
1350
|
+
}
|
|
1308
1351
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SparklineComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1309
1352
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: SparklineComponent, isStandalone: true, selector: "ngx-sparkline", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, width: { classPropertyName: "width", publicName: "width", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1310
1353
|
<svg
|
|
@@ -1312,10 +1355,19 @@ class SparklineComponent {
|
|
|
1312
1355
|
[attr.height]="height()"
|
|
1313
1356
|
class="ngx-sparkline"
|
|
1314
1357
|
[attr.aria-label]="'Sparkline'"
|
|
1358
|
+
(mousemove)="onMouseMove($event)"
|
|
1359
|
+
(mouseleave)="hoveredIndex.set(null)"
|
|
1315
1360
|
>
|
|
1361
|
+
<defs>
|
|
1362
|
+
<linearGradient id="sparkline-grad" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
1363
|
+
<stop offset="0%" [attr.stop-color]="color()" stop-opacity="0.32" />
|
|
1364
|
+
<stop offset="100%" [attr.stop-color]="color()" stop-opacity="0" />
|
|
1365
|
+
</linearGradient>
|
|
1366
|
+
</defs>
|
|
1367
|
+
|
|
1316
1368
|
@if (type() === 'line' || type() === 'area') {
|
|
1317
1369
|
@if (type() === 'area') {
|
|
1318
|
-
<path [attr.d]="areaPath()"
|
|
1370
|
+
<path [attr.d]="areaPath()" fill="url(#sparkline-grad)" stroke="none" class="sparkline-area"/>
|
|
1319
1371
|
}
|
|
1320
1372
|
<path
|
|
1321
1373
|
[attr.d]="linePath()"
|
|
@@ -1324,14 +1376,17 @@ class SparklineComponent {
|
|
|
1324
1376
|
stroke-width="2"
|
|
1325
1377
|
stroke-linejoin="round"
|
|
1326
1378
|
stroke-linecap="round"
|
|
1379
|
+
class="sparkline-path"
|
|
1327
1380
|
/>
|
|
1328
|
-
<!-- End dot -->
|
|
1381
|
+
<!-- End dot (if not hovered) -->
|
|
1329
1382
|
@if (endPoint(); as ep) {
|
|
1330
|
-
|
|
1383
|
+
@if (hoveredIndex() === null) {
|
|
1384
|
+
<circle [attr.cx]="ep[0]" [attr.cy]="ep[1]" r="3" [attr.fill]="color()" class="end-dot"/>
|
|
1385
|
+
}
|
|
1331
1386
|
}
|
|
1332
1387
|
}
|
|
1333
1388
|
@if (type() === 'bar') {
|
|
1334
|
-
@for (item of barItems(); track $index) {
|
|
1389
|
+
@for (item of barItems(); track $index; let idx = $index) {
|
|
1335
1390
|
<rect
|
|
1336
1391
|
[attr.x]="item.x"
|
|
1337
1392
|
[attr.y]="item.y"
|
|
@@ -1339,25 +1394,70 @@ class SparklineComponent {
|
|
|
1339
1394
|
[attr.height]="item.h"
|
|
1340
1395
|
[attr.fill]="color()"
|
|
1341
1396
|
[attr.rx]="1"
|
|
1342
|
-
|
|
1397
|
+
[class.hovered]="hoveredIndex() === idx"
|
|
1398
|
+
[style.animation-delay]="(idx * 0.02) + 's'"
|
|
1399
|
+
class="sparkline-bar"
|
|
1343
1400
|
/>
|
|
1344
1401
|
}
|
|
1345
1402
|
}
|
|
1403
|
+
|
|
1404
|
+
<!-- Interactive Tracker overlay -->
|
|
1405
|
+
@if (activePoint(); as ap) {
|
|
1406
|
+
<!-- Vertical guide line -->
|
|
1407
|
+
<line
|
|
1408
|
+
[attr.x1]="ap[0]"
|
|
1409
|
+
[attr.x2]="ap[0]"
|
|
1410
|
+
[attr.y1]="PAD"
|
|
1411
|
+
[attr.y2]="PAD + h()"
|
|
1412
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
1413
|
+
stroke-width="1.2"
|
|
1414
|
+
stroke-dasharray="2,2"
|
|
1415
|
+
class="tracker-line"
|
|
1416
|
+
/>
|
|
1417
|
+
<!-- Outer glowing ring -->
|
|
1418
|
+
<circle
|
|
1419
|
+
[attr.cx]="ap[0]"
|
|
1420
|
+
[attr.cy]="ap[1]"
|
|
1421
|
+
r="5"
|
|
1422
|
+
[attr.fill]="color()"
|
|
1423
|
+
fill-opacity="0.25"
|
|
1424
|
+
class="tracker-ring"
|
|
1425
|
+
/>
|
|
1426
|
+
<!-- Inner solid dot -->
|
|
1427
|
+
<circle
|
|
1428
|
+
[attr.cx]="ap[0]"
|
|
1429
|
+
[attr.cy]="ap[1]"
|
|
1430
|
+
r="2.5"
|
|
1431
|
+
[attr.fill]="color()"
|
|
1432
|
+
stroke="#ffffff"
|
|
1433
|
+
stroke-width="1"
|
|
1434
|
+
class="tracker-dot"
|
|
1435
|
+
/>
|
|
1436
|
+
}
|
|
1346
1437
|
</svg>
|
|
1347
|
-
`, isInline: true, styles: [":host{display:inline-block}.ngx-sparkline{display:block}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1438
|
+
`, isInline: true, styles: [":host{display:inline-block}.ngx-sparkline{display:block;overflow:visible;cursor:crosshair}@keyframes lineDraw{0%{stroke-dashoffset:400}to{stroke-dashoffset:0}}.sparkline-path{stroke-dasharray:400;stroke-dashoffset:400;animation:lineDraw .8s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFade{0%{opacity:0}to{opacity:1}}.sparkline-area{animation:areaFade .6s cubic-bezier(.16,1,.3,1) .2s both}.end-dot{animation:areaFade .4s ease-out .8s both}.sparkline-bar{opacity:.85;transition:opacity .2s,fill .2s;animation:areaFade .4s ease-out both}.sparkline-bar:hover,.sparkline-bar.hovered{opacity:1;filter:brightness(1.1)}.tracker-line{pointer-events:none}.tracker-ring{pointer-events:none;animation:trackerPulse 1.5s infinite alternate}.tracker-dot{pointer-events:none}@keyframes trackerPulse{0%{r:4.5px;fill-opacity:.2}to{r:6.5px;fill-opacity:.4}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1348
1439
|
}
|
|
1349
1440
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: SparklineComponent, decorators: [{
|
|
1350
1441
|
type: Component,
|
|
1351
|
-
args: [{ selector: 'ngx-sparkline', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1442
|
+
args: [{ selector: 'ngx-sparkline', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
1352
1443
|
<svg
|
|
1353
1444
|
[attr.width]="width()"
|
|
1354
1445
|
[attr.height]="height()"
|
|
1355
1446
|
class="ngx-sparkline"
|
|
1356
1447
|
[attr.aria-label]="'Sparkline'"
|
|
1448
|
+
(mousemove)="onMouseMove($event)"
|
|
1449
|
+
(mouseleave)="hoveredIndex.set(null)"
|
|
1357
1450
|
>
|
|
1451
|
+
<defs>
|
|
1452
|
+
<linearGradient id="sparkline-grad" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
1453
|
+
<stop offset="0%" [attr.stop-color]="color()" stop-opacity="0.32" />
|
|
1454
|
+
<stop offset="100%" [attr.stop-color]="color()" stop-opacity="0" />
|
|
1455
|
+
</linearGradient>
|
|
1456
|
+
</defs>
|
|
1457
|
+
|
|
1358
1458
|
@if (type() === 'line' || type() === 'area') {
|
|
1359
1459
|
@if (type() === 'area') {
|
|
1360
|
-
<path [attr.d]="areaPath()"
|
|
1460
|
+
<path [attr.d]="areaPath()" fill="url(#sparkline-grad)" stroke="none" class="sparkline-area"/>
|
|
1361
1461
|
}
|
|
1362
1462
|
<path
|
|
1363
1463
|
[attr.d]="linePath()"
|
|
@@ -1366,14 +1466,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1366
1466
|
stroke-width="2"
|
|
1367
1467
|
stroke-linejoin="round"
|
|
1368
1468
|
stroke-linecap="round"
|
|
1469
|
+
class="sparkline-path"
|
|
1369
1470
|
/>
|
|
1370
|
-
<!-- End dot -->
|
|
1471
|
+
<!-- End dot (if not hovered) -->
|
|
1371
1472
|
@if (endPoint(); as ep) {
|
|
1372
|
-
|
|
1473
|
+
@if (hoveredIndex() === null) {
|
|
1474
|
+
<circle [attr.cx]="ep[0]" [attr.cy]="ep[1]" r="3" [attr.fill]="color()" class="end-dot"/>
|
|
1475
|
+
}
|
|
1373
1476
|
}
|
|
1374
1477
|
}
|
|
1375
1478
|
@if (type() === 'bar') {
|
|
1376
|
-
@for (item of barItems(); track $index) {
|
|
1479
|
+
@for (item of barItems(); track $index; let idx = $index) {
|
|
1377
1480
|
<rect
|
|
1378
1481
|
[attr.x]="item.x"
|
|
1379
1482
|
[attr.y]="item.y"
|
|
@@ -1381,12 +1484,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
1381
1484
|
[attr.height]="item.h"
|
|
1382
1485
|
[attr.fill]="color()"
|
|
1383
1486
|
[attr.rx]="1"
|
|
1384
|
-
|
|
1487
|
+
[class.hovered]="hoveredIndex() === idx"
|
|
1488
|
+
[style.animation-delay]="(idx * 0.02) + 's'"
|
|
1489
|
+
class="sparkline-bar"
|
|
1385
1490
|
/>
|
|
1386
1491
|
}
|
|
1387
1492
|
}
|
|
1493
|
+
|
|
1494
|
+
<!-- Interactive Tracker overlay -->
|
|
1495
|
+
@if (activePoint(); as ap) {
|
|
1496
|
+
<!-- Vertical guide line -->
|
|
1497
|
+
<line
|
|
1498
|
+
[attr.x1]="ap[0]"
|
|
1499
|
+
[attr.x2]="ap[0]"
|
|
1500
|
+
[attr.y1]="PAD"
|
|
1501
|
+
[attr.y2]="PAD + h()"
|
|
1502
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
1503
|
+
stroke-width="1.2"
|
|
1504
|
+
stroke-dasharray="2,2"
|
|
1505
|
+
class="tracker-line"
|
|
1506
|
+
/>
|
|
1507
|
+
<!-- Outer glowing ring -->
|
|
1508
|
+
<circle
|
|
1509
|
+
[attr.cx]="ap[0]"
|
|
1510
|
+
[attr.cy]="ap[1]"
|
|
1511
|
+
r="5"
|
|
1512
|
+
[attr.fill]="color()"
|
|
1513
|
+
fill-opacity="0.25"
|
|
1514
|
+
class="tracker-ring"
|
|
1515
|
+
/>
|
|
1516
|
+
<!-- Inner solid dot -->
|
|
1517
|
+
<circle
|
|
1518
|
+
[attr.cx]="ap[0]"
|
|
1519
|
+
[attr.cy]="ap[1]"
|
|
1520
|
+
r="2.5"
|
|
1521
|
+
[attr.fill]="color()"
|
|
1522
|
+
stroke="#ffffff"
|
|
1523
|
+
stroke-width="1"
|
|
1524
|
+
class="tracker-dot"
|
|
1525
|
+
/>
|
|
1526
|
+
}
|
|
1388
1527
|
</svg>
|
|
1389
|
-
`, styles: [":host{display:inline-block}.ngx-sparkline{display:block}\n"] }]
|
|
1528
|
+
`, styles: [":host{display:inline-block}.ngx-sparkline{display:block;overflow:visible;cursor:crosshair}@keyframes lineDraw{0%{stroke-dashoffset:400}to{stroke-dashoffset:0}}.sparkline-path{stroke-dasharray:400;stroke-dashoffset:400;animation:lineDraw .8s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFade{0%{opacity:0}to{opacity:1}}.sparkline-area{animation:areaFade .6s cubic-bezier(.16,1,.3,1) .2s both}.end-dot{animation:areaFade .4s ease-out .8s both}.sparkline-bar{opacity:.85;transition:opacity .2s,fill .2s;animation:areaFade .4s ease-out both}.sparkline-bar:hover,.sparkline-bar.hovered{opacity:1;filter:brightness(1.1)}.tracker-line{pointer-events:none}.tracker-ring{pointer-events:none;animation:trackerPulse 1.5s infinite alternate}.tracker-dot{pointer-events:none}@keyframes trackerPulse{0%{r:4.5px;fill-opacity:.2}to{r:6.5px;fill-opacity:.4}}\n"] }]
|
|
1390
1529
|
}] });
|
|
1391
1530
|
|
|
1392
1531
|
var GanttItemType;
|
|
@@ -3900,30 +4039,41 @@ class GaugeChartComponent {
|
|
|
3900
4039
|
showNeedle = input(true);
|
|
3901
4040
|
color = input('var(--primary-color, #4f46e5)');
|
|
3902
4041
|
thresholds = input([]);
|
|
4042
|
+
// State Signals
|
|
4043
|
+
hovered = signal(false);
|
|
4044
|
+
tooltipX = signal(0);
|
|
4045
|
+
tooltipY = signal(0);
|
|
4046
|
+
animateState = signal(false);
|
|
4047
|
+
constructor() {
|
|
4048
|
+
setTimeout(() => this.animateState.set(true), 50);
|
|
4049
|
+
}
|
|
3903
4050
|
// Gauge angles definitions
|
|
3904
4051
|
// 0 deg in polar is to the right (3 o'clock). 90 deg is straight down (6 o'clock).
|
|
3905
|
-
// A standard semi-circle speedometer goes from 180deg (left, 9 o'clock) to 360deg (right, 3 o'clock).
|
|
3906
|
-
// A full dial goes from 135deg (bottom-left) to 405deg (bottom-right).
|
|
3907
4052
|
startAngle = computed(() => {
|
|
3908
4053
|
return this.type() === 'semi' ? 180 : 135;
|
|
3909
4054
|
});
|
|
3910
4055
|
endAngle = computed(() => {
|
|
3911
4056
|
return this.type() === 'semi' ? 360 : 405;
|
|
3912
4057
|
});
|
|
3913
|
-
//
|
|
3914
|
-
|
|
3915
|
-
|
|
4058
|
+
// Arc length calculations
|
|
4059
|
+
arcLength = computed(() => {
|
|
4060
|
+
const radius = 72;
|
|
4061
|
+
const angleRange = this.endAngle() - this.startAngle();
|
|
4062
|
+
return (2 * Math.PI * radius * angleRange) / 360;
|
|
3916
4063
|
});
|
|
3917
|
-
|
|
3918
|
-
|
|
4064
|
+
progressDashOffset = computed(() => {
|
|
4065
|
+
const L = this.arcLength();
|
|
3919
4066
|
const minVal = this.min();
|
|
3920
4067
|
const maxVal = this.max();
|
|
3921
4068
|
const currentVal = Math.max(minVal, Math.min(maxVal, this.value()));
|
|
3922
4069
|
const range = maxVal - minVal;
|
|
3923
4070
|
const fraction = range === 0 ? 0 : (currentVal - minVal) / range;
|
|
3924
|
-
const
|
|
3925
|
-
|
|
3926
|
-
|
|
4071
|
+
const targetOffset = L - (fraction * L);
|
|
4072
|
+
return this.animateState() ? targetOffset : L;
|
|
4073
|
+
});
|
|
4074
|
+
// Calculate coordinates and build path for background track
|
|
4075
|
+
backgroundArcPath = computed(() => {
|
|
4076
|
+
return this.describeArc(100, 100, 72, this.startAngle(), this.endAngle());
|
|
3927
4077
|
});
|
|
3928
4078
|
// Needle rotation calculation
|
|
3929
4079
|
needleTransformString = computed(() => {
|
|
@@ -3933,7 +4083,8 @@ class GaugeChartComponent {
|
|
|
3933
4083
|
const range = maxVal - minVal;
|
|
3934
4084
|
const fraction = range === 0 ? 0 : (currentVal - minVal) / range;
|
|
3935
4085
|
const angleRange = this.endAngle() - this.startAngle();
|
|
3936
|
-
const
|
|
4086
|
+
const targetAngle = this.startAngle() + angleRange * fraction;
|
|
4087
|
+
const angle = this.animateState() ? targetAngle : this.startAngle();
|
|
3937
4088
|
// Needle points straight up at -90 deg rotation, so we offset by -90
|
|
3938
4089
|
const rotateAngle = angle - 270;
|
|
3939
4090
|
return `rotate(${rotateAngle})`;
|
|
@@ -3956,6 +4107,12 @@ class GaugeChartComponent {
|
|
|
3956
4107
|
// Default to the last threshold color if value exceeds all thresholds
|
|
3957
4108
|
return sorted[sorted.length - 1].color;
|
|
3958
4109
|
});
|
|
4110
|
+
onMouseMove(event) {
|
|
4111
|
+
const el = event.currentTarget;
|
|
4112
|
+
const rect = el.getBoundingClientRect();
|
|
4113
|
+
this.tooltipX.set(event.clientX - rect.left);
|
|
4114
|
+
this.tooltipY.set(event.clientY - rect.top);
|
|
4115
|
+
}
|
|
3959
4116
|
// Polar to Cartesian Math helpers
|
|
3960
4117
|
polarToCartesian(centerX, centerY, radius, angleInDegrees) {
|
|
3961
4118
|
const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
|
|
@@ -3976,13 +4133,34 @@ class GaugeChartComponent {
|
|
|
3976
4133
|
}
|
|
3977
4134
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GaugeChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3978
4135
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: GaugeChartComponent, isStandalone: true, selector: "ngx-gauge-chart", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: true, transformFunction: null }, min: { classPropertyName: "min", publicName: "min", isSignal: true, isRequired: false, transformFunction: null }, max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null }, showNeedle: { classPropertyName: "showNeedle", publicName: "showNeedle", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, thresholds: { classPropertyName: "thresholds", publicName: "thresholds", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
3979
|
-
<div
|
|
4136
|
+
<div
|
|
4137
|
+
class="ngx-gauge-wrapper"
|
|
4138
|
+
(mousemove)="onMouseMove($event)"
|
|
4139
|
+
(mouseenter)="hovered.set(true)"
|
|
4140
|
+
(mouseleave)="hovered.set(false)"
|
|
4141
|
+
>
|
|
3980
4142
|
<div class="ngx-gauge-container">
|
|
3981
4143
|
<!-- SVG Gauge dial -->
|
|
3982
4144
|
<svg
|
|
3983
4145
|
class="ngx-gauge-svg"
|
|
3984
4146
|
viewBox="0 0 200 200"
|
|
3985
4147
|
>
|
|
4148
|
+
<defs>
|
|
4149
|
+
<linearGradient id="gauge-progress-grad" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
4150
|
+
<stop offset="0%" [attr.stop-color]="gaugeColor()" stop-opacity="0.8" />
|
|
4151
|
+
<stop offset="100%" [attr.stop-color]="gaugeColor()" />
|
|
4152
|
+
</linearGradient>
|
|
4153
|
+
<radialGradient id="needle-pivot-grad" cx="40%" cy="40%" r="60%">
|
|
4154
|
+
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.6" />
|
|
4155
|
+
<stop offset="40%" [attr.stop-color]="gaugeColor()" />
|
|
4156
|
+
<stop offset="100%" stop-color="#0f172a" />
|
|
4157
|
+
</radialGradient>
|
|
4158
|
+
<linearGradient id="needle-grad" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
4159
|
+
<stop offset="0%" [attr.stop-color]="gaugeColor()" stop-opacity="0.6" />
|
|
4160
|
+
<stop offset="100%" [attr.stop-color]="gaugeColor()" />
|
|
4161
|
+
</linearGradient>
|
|
4162
|
+
</defs>
|
|
4163
|
+
|
|
3986
4164
|
<!-- Background track arc -->
|
|
3987
4165
|
<path
|
|
3988
4166
|
[attr.d]="backgroundArcPath()"
|
|
@@ -3994,11 +4172,13 @@ class GaugeChartComponent {
|
|
|
3994
4172
|
|
|
3995
4173
|
<!-- Colored progress arc -->
|
|
3996
4174
|
<path
|
|
3997
|
-
[attr.d]="
|
|
4175
|
+
[attr.d]="backgroundArcPath()"
|
|
3998
4176
|
fill="none"
|
|
3999
|
-
|
|
4177
|
+
stroke="url(#gauge-progress-grad)"
|
|
4000
4178
|
stroke-width="14"
|
|
4001
4179
|
stroke-linecap="round"
|
|
4180
|
+
[attr.stroke-dasharray]="arcLength() + ',' + arcLength()"
|
|
4181
|
+
[attr.stroke-dashoffset]="progressDashOffset()"
|
|
4002
4182
|
class="progress-arc"
|
|
4003
4183
|
/>
|
|
4004
4184
|
|
|
@@ -4008,16 +4188,16 @@ class GaugeChartComponent {
|
|
|
4008
4188
|
<!-- Needle path pointing straight up (0 deg is relative to -90 deg rotation) -->
|
|
4009
4189
|
<path
|
|
4010
4190
|
d="M 100 100 L 96 35 L 100 25 L 104 35 Z"
|
|
4011
|
-
|
|
4191
|
+
fill="url(#needle-grad)"
|
|
4012
4192
|
class="gauge-needle"
|
|
4013
4193
|
/>
|
|
4014
4194
|
<circle
|
|
4015
4195
|
cx="100"
|
|
4016
4196
|
cy="100"
|
|
4017
|
-
r="
|
|
4018
|
-
|
|
4019
|
-
stroke="
|
|
4020
|
-
stroke-width="
|
|
4197
|
+
r="9"
|
|
4198
|
+
fill="url(#needle-pivot-grad)"
|
|
4199
|
+
stroke="rgba(255, 255, 255, 0.2)"
|
|
4200
|
+
stroke-width="1"
|
|
4021
4201
|
/>
|
|
4022
4202
|
</g>
|
|
4023
4203
|
}
|
|
@@ -4031,19 +4211,65 @@ class GaugeChartComponent {
|
|
|
4031
4211
|
}
|
|
4032
4212
|
</div>
|
|
4033
4213
|
</div>
|
|
4214
|
+
|
|
4215
|
+
<!-- Glassmorphic Tooltip -->
|
|
4216
|
+
@if (hovered()) {
|
|
4217
|
+
<div
|
|
4218
|
+
class="chart-tooltip"
|
|
4219
|
+
[style.left.px]="tooltipX()"
|
|
4220
|
+
[style.top.px]="tooltipY()"
|
|
4221
|
+
>
|
|
4222
|
+
@if (label()) {
|
|
4223
|
+
<div class="tt-cat">{{ label() }}</div>
|
|
4224
|
+
} @else {
|
|
4225
|
+
<div class="tt-cat">Gauge Metric</div>
|
|
4226
|
+
}
|
|
4227
|
+
<div class="tt-row">
|
|
4228
|
+
<span class="tt-dot" [style.background]="gaugeColor()"></span>
|
|
4229
|
+
<span class="tt-name">Value</span>
|
|
4230
|
+
<span class="tt-val">{{ value().toLocaleString() }}</span>
|
|
4231
|
+
</div>
|
|
4232
|
+
<div class="tt-row">
|
|
4233
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
4234
|
+
<span class="tt-name">Range</span>
|
|
4235
|
+
<span class="tt-val">{{ min() }} - {{ max() }}</span>
|
|
4236
|
+
</div>
|
|
4237
|
+
</div>
|
|
4238
|
+
}
|
|
4034
4239
|
</div>
|
|
4035
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-gauge-wrapper{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-gauge-container{position:relative;width:100%;max-width:240px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-gauge-svg{width:100%;height:100%}.progress-arc{transition:stroke-dashoffset
|
|
4240
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-gauge-wrapper{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-gauge-container{position:relative;width:100%;max-width:240px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-gauge-svg{width:100%;height:100%}.progress-arc{transition:stroke-dashoffset 1s cubic-bezier(.16,1,.3,1),stroke .3s ease}.gauge-needle-group{transition:transform 1.2s cubic-bezier(.34,1.56,.64,1);transform-origin:100px 100px}.gauge-needle{filter:drop-shadow(0 3px 6px rgba(0,0,0,.18))}.gauge-center-badge{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;z-index:2}.gauge-center-badge.semi-mode{transform:translateY(18px)}.gauge-value{font-size:28px;font-weight:800;letter-spacing:-.8px;line-height:1;transition:color .3s ease;font-family:var(--ngx-heading-font-family, inherit)}.gauge-label{font-size:11px;text-transform:uppercase;font-weight:700;color:var(--text-secondary, #64748b);letter-spacing:.5px;margin-top:4px}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:140px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4036
4241
|
}
|
|
4037
4242
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: GaugeChartComponent, decorators: [{
|
|
4038
4243
|
type: Component,
|
|
4039
|
-
args: [{ selector: 'ngx-gauge-chart', standalone: true, imports: [CommonModule], template: `
|
|
4040
|
-
<div
|
|
4244
|
+
args: [{ selector: 'ngx-gauge-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4245
|
+
<div
|
|
4246
|
+
class="ngx-gauge-wrapper"
|
|
4247
|
+
(mousemove)="onMouseMove($event)"
|
|
4248
|
+
(mouseenter)="hovered.set(true)"
|
|
4249
|
+
(mouseleave)="hovered.set(false)"
|
|
4250
|
+
>
|
|
4041
4251
|
<div class="ngx-gauge-container">
|
|
4042
4252
|
<!-- SVG Gauge dial -->
|
|
4043
4253
|
<svg
|
|
4044
4254
|
class="ngx-gauge-svg"
|
|
4045
4255
|
viewBox="0 0 200 200"
|
|
4046
4256
|
>
|
|
4257
|
+
<defs>
|
|
4258
|
+
<linearGradient id="gauge-progress-grad" x1="0%" y1="100%" x2="100%" y2="0%">
|
|
4259
|
+
<stop offset="0%" [attr.stop-color]="gaugeColor()" stop-opacity="0.8" />
|
|
4260
|
+
<stop offset="100%" [attr.stop-color]="gaugeColor()" />
|
|
4261
|
+
</linearGradient>
|
|
4262
|
+
<radialGradient id="needle-pivot-grad" cx="40%" cy="40%" r="60%">
|
|
4263
|
+
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.6" />
|
|
4264
|
+
<stop offset="40%" [attr.stop-color]="gaugeColor()" />
|
|
4265
|
+
<stop offset="100%" stop-color="#0f172a" />
|
|
4266
|
+
</radialGradient>
|
|
4267
|
+
<linearGradient id="needle-grad" x1="0%" y1="100%" x2="0%" y2="0%">
|
|
4268
|
+
<stop offset="0%" [attr.stop-color]="gaugeColor()" stop-opacity="0.6" />
|
|
4269
|
+
<stop offset="100%" [attr.stop-color]="gaugeColor()" />
|
|
4270
|
+
</linearGradient>
|
|
4271
|
+
</defs>
|
|
4272
|
+
|
|
4047
4273
|
<!-- Background track arc -->
|
|
4048
4274
|
<path
|
|
4049
4275
|
[attr.d]="backgroundArcPath()"
|
|
@@ -4055,11 +4281,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4055
4281
|
|
|
4056
4282
|
<!-- Colored progress arc -->
|
|
4057
4283
|
<path
|
|
4058
|
-
[attr.d]="
|
|
4284
|
+
[attr.d]="backgroundArcPath()"
|
|
4059
4285
|
fill="none"
|
|
4060
|
-
|
|
4286
|
+
stroke="url(#gauge-progress-grad)"
|
|
4061
4287
|
stroke-width="14"
|
|
4062
4288
|
stroke-linecap="round"
|
|
4289
|
+
[attr.stroke-dasharray]="arcLength() + ',' + arcLength()"
|
|
4290
|
+
[attr.stroke-dashoffset]="progressDashOffset()"
|
|
4063
4291
|
class="progress-arc"
|
|
4064
4292
|
/>
|
|
4065
4293
|
|
|
@@ -4069,16 +4297,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4069
4297
|
<!-- Needle path pointing straight up (0 deg is relative to -90 deg rotation) -->
|
|
4070
4298
|
<path
|
|
4071
4299
|
d="M 100 100 L 96 35 L 100 25 L 104 35 Z"
|
|
4072
|
-
|
|
4300
|
+
fill="url(#needle-grad)"
|
|
4073
4301
|
class="gauge-needle"
|
|
4074
4302
|
/>
|
|
4075
4303
|
<circle
|
|
4076
4304
|
cx="100"
|
|
4077
4305
|
cy="100"
|
|
4078
|
-
r="
|
|
4079
|
-
|
|
4080
|
-
stroke="
|
|
4081
|
-
stroke-width="
|
|
4306
|
+
r="9"
|
|
4307
|
+
fill="url(#needle-pivot-grad)"
|
|
4308
|
+
stroke="rgba(255, 255, 255, 0.2)"
|
|
4309
|
+
stroke-width="1"
|
|
4082
4310
|
/>
|
|
4083
4311
|
</g>
|
|
4084
4312
|
}
|
|
@@ -4092,9 +4320,34 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4092
4320
|
}
|
|
4093
4321
|
</div>
|
|
4094
4322
|
</div>
|
|
4323
|
+
|
|
4324
|
+
<!-- Glassmorphic Tooltip -->
|
|
4325
|
+
@if (hovered()) {
|
|
4326
|
+
<div
|
|
4327
|
+
class="chart-tooltip"
|
|
4328
|
+
[style.left.px]="tooltipX()"
|
|
4329
|
+
[style.top.px]="tooltipY()"
|
|
4330
|
+
>
|
|
4331
|
+
@if (label()) {
|
|
4332
|
+
<div class="tt-cat">{{ label() }}</div>
|
|
4333
|
+
} @else {
|
|
4334
|
+
<div class="tt-cat">Gauge Metric</div>
|
|
4335
|
+
}
|
|
4336
|
+
<div class="tt-row">
|
|
4337
|
+
<span class="tt-dot" [style.background]="gaugeColor()"></span>
|
|
4338
|
+
<span class="tt-name">Value</span>
|
|
4339
|
+
<span class="tt-val">{{ value().toLocaleString() }}</span>
|
|
4340
|
+
</div>
|
|
4341
|
+
<div class="tt-row">
|
|
4342
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
4343
|
+
<span class="tt-name">Range</span>
|
|
4344
|
+
<span class="tt-val">{{ min() }} - {{ max() }}</span>
|
|
4345
|
+
</div>
|
|
4346
|
+
</div>
|
|
4347
|
+
}
|
|
4095
4348
|
</div>
|
|
4096
|
-
`, styles: [":host{display:block;width:100%;height:100%}.ngx-gauge-wrapper{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-gauge-container{position:relative;width:100%;max-width:240px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-gauge-svg{width:100%;height:100%}.progress-arc{transition:stroke-dashoffset
|
|
4097
|
-
}] });
|
|
4349
|
+
`, styles: [":host{display:block;width:100%;height:100%}.ngx-gauge-wrapper{width:100%;height:100%;display:flex;align-items:center;justify-content:center;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-gauge-container{position:relative;width:100%;max-width:240px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-gauge-svg{width:100%;height:100%}.progress-arc{transition:stroke-dashoffset 1s cubic-bezier(.16,1,.3,1),stroke .3s ease}.gauge-needle-group{transition:transform 1.2s cubic-bezier(.34,1.56,.64,1);transform-origin:100px 100px}.gauge-needle{filter:drop-shadow(0 3px 6px rgba(0,0,0,.18))}.gauge-center-badge{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;pointer-events:none;z-index:2}.gauge-center-badge.semi-mode{transform:translateY(18px)}.gauge-value{font-size:28px;font-weight:800;letter-spacing:-.8px;line-height:1;transition:color .3s ease;font-family:var(--ngx-heading-font-family, inherit)}.gauge-label{font-size:11px;text-transform:uppercase;font-weight:700;color:var(--text-secondary, #64748b);letter-spacing:.5px;margin-top:4px}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:140px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
4350
|
+
}], ctorParameters: () => [] });
|
|
4098
4351
|
|
|
4099
4352
|
class RadarChartComponent {
|
|
4100
4353
|
// Input binds
|
|
@@ -4111,7 +4364,8 @@ class RadarChartComponent {
|
|
|
4111
4364
|
category: '',
|
|
4112
4365
|
value: '',
|
|
4113
4366
|
x: 0,
|
|
4114
|
-
y: 0
|
|
4367
|
+
y: 0,
|
|
4368
|
+
color: ''
|
|
4115
4369
|
});
|
|
4116
4370
|
// Concentric circle rings count
|
|
4117
4371
|
gridRings = signal([0.2, 0.4, 0.6, 0.8, 1]);
|
|
@@ -4205,13 +4459,16 @@ class RadarChartComponent {
|
|
|
4205
4459
|
// Map coordinates relative to parent container
|
|
4206
4460
|
const x = (pt.x / 220) * svgRect.width + (svgRect.left - containerRect.left);
|
|
4207
4461
|
const y = (pt.y / 220) * svgRect.height + (svgRect.top - containerRect.top);
|
|
4462
|
+
const seriesIndex = this.seriesData().indexOf(series);
|
|
4463
|
+
const color = this.getSeriesColor(seriesIndex, 1);
|
|
4208
4464
|
this.tooltip.set({
|
|
4209
4465
|
show: true,
|
|
4210
4466
|
series: series.label,
|
|
4211
4467
|
category: this.categories()[index] ?? '',
|
|
4212
4468
|
value: pt.value.toLocaleString(),
|
|
4213
4469
|
x,
|
|
4214
|
-
y
|
|
4470
|
+
y,
|
|
4471
|
+
color
|
|
4215
4472
|
});
|
|
4216
4473
|
}
|
|
4217
4474
|
onPointLeave() {
|
|
@@ -4228,13 +4485,23 @@ class RadarChartComponent {
|
|
|
4228
4485
|
class="ngx-radar-svg"
|
|
4229
4486
|
viewBox="0 0 220 220"
|
|
4230
4487
|
>
|
|
4488
|
+
<defs>
|
|
4489
|
+
@for (series of seriesData(); track series.label; let sIdx = $index) {
|
|
4490
|
+
<linearGradient [id]="'radar-grad-' + sIdx" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4491
|
+
<stop offset="0%" [attr.stop-color]="getSeriesColor(sIdx, 1)" stop-opacity="0.35" />
|
|
4492
|
+
<stop offset="100%" [attr.stop-color]="getSeriesColor(sIdx, 1)" stop-opacity="0.05" />
|
|
4493
|
+
</linearGradient>
|
|
4494
|
+
}
|
|
4495
|
+
</defs>
|
|
4496
|
+
|
|
4231
4497
|
<!-- Concentric polygon grids (web rings) -->
|
|
4232
4498
|
@for (ring of gridRings(); track ring) {
|
|
4233
4499
|
<polygon
|
|
4234
4500
|
[attr.points]="getRingPoints(ring)"
|
|
4235
4501
|
fill="none"
|
|
4236
|
-
stroke="var(--border-light,
|
|
4237
|
-
stroke-width="
|
|
4502
|
+
stroke="var(--border-light, rgba(226, 232, 240, 0.6))"
|
|
4503
|
+
stroke-width="0.8"
|
|
4504
|
+
stroke-dasharray="2,2"
|
|
4238
4505
|
/>
|
|
4239
4506
|
}
|
|
4240
4507
|
|
|
@@ -4245,9 +4512,9 @@ class RadarChartComponent {
|
|
|
4245
4512
|
[attr.y1]="110"
|
|
4246
4513
|
[attr.x2]="axis.x"
|
|
4247
4514
|
[attr.y2]="axis.y"
|
|
4248
|
-
stroke="var(--border-color,
|
|
4249
|
-
stroke-width="
|
|
4250
|
-
stroke-dasharray="
|
|
4515
|
+
stroke="var(--border-color, rgba(226, 232, 240, 0.8))"
|
|
4516
|
+
stroke-width="0.8"
|
|
4517
|
+
stroke-dasharray="3,3"
|
|
4251
4518
|
/>
|
|
4252
4519
|
<!-- Category Label text positions -->
|
|
4253
4520
|
<text
|
|
@@ -4264,7 +4531,7 @@ class RadarChartComponent {
|
|
|
4264
4531
|
@for (series of seriesData(); track series.label; let sIdx = $index) {
|
|
4265
4532
|
<polygon
|
|
4266
4533
|
[attr.points]="getSeriesPoints(series)"
|
|
4267
|
-
[attr.fill]="
|
|
4534
|
+
[attr.fill]="'url(#radar-grad-' + sIdx + ')'"
|
|
4268
4535
|
[attr.stroke]="getSeriesColor(sIdx, 1)"
|
|
4269
4536
|
stroke-width="2.5"
|
|
4270
4537
|
class="radar-polygon"
|
|
@@ -4278,11 +4545,12 @@ class RadarChartComponent {
|
|
|
4278
4545
|
<circle
|
|
4279
4546
|
[attr.cx]="pt.x"
|
|
4280
4547
|
[attr.cy]="pt.y"
|
|
4281
|
-
[attr.r]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index ? 5 : 3.5"
|
|
4548
|
+
[attr.r]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index ? 5.5 : 3.5"
|
|
4282
4549
|
[attr.fill]="getSeriesColor(sIdx, 1)"
|
|
4283
4550
|
stroke="#ffffff"
|
|
4284
4551
|
stroke-width="1.5"
|
|
4285
4552
|
class="radar-dot"
|
|
4553
|
+
[class.hovered]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index"
|
|
4286
4554
|
(mouseenter)="onPointEnter(series, $index, pt, $event)"
|
|
4287
4555
|
(mouseleave)="onPointLeave()"
|
|
4288
4556
|
/>
|
|
@@ -4297,10 +4565,11 @@ class RadarChartComponent {
|
|
|
4297
4565
|
[style.left.px]="tooltip().x"
|
|
4298
4566
|
[style.top.px]="tooltip().y"
|
|
4299
4567
|
>
|
|
4300
|
-
<div class="
|
|
4301
|
-
<div class="
|
|
4302
|
-
<span
|
|
4303
|
-
<span>{{ tooltip().
|
|
4568
|
+
<div class="tt-cat">{{ tooltip().series }}</div>
|
|
4569
|
+
<div class="tt-row">
|
|
4570
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
4571
|
+
<span class="tt-name">{{ tooltip().category }}</span>
|
|
4572
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4304
4573
|
</div>
|
|
4305
4574
|
</div>
|
|
4306
4575
|
}
|
|
@@ -4321,11 +4590,11 @@ class RadarChartComponent {
|
|
|
4321
4590
|
}
|
|
4322
4591
|
</div>
|
|
4323
4592
|
</div>
|
|
4324
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-radar-wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-radar-container{position:relative;width:100%;max-width:280px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-radar-svg{width:100%;height:100%;overflow:visible}.radar-polygon{transition:
|
|
4593
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-radar-wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-radar-container{position:relative;width:100%;max-width:280px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-radar-svg{width:100%;height:100%;overflow:visible}@keyframes radarScaleIn{0%{transform:scale(.1);opacity:0}to{transform:scale(1);opacity:1}}.radar-polygon{transition:stroke-width .25s cubic-bezier(.16,1,.3,1),fill-opacity .25s;cursor:pointer;transform-origin:110px 110px;animation:radarScaleIn .8s cubic-bezier(.16,1,.3,1) both}.radar-polygon:hover,.radar-polygon.active{stroke-width:3.5px}.radar-dot{cursor:pointer;transition:r .2s cubic-bezier(.16,1,.3,1),stroke-width .2s;transform-origin:110px 110px;animation:radarScaleIn .8s cubic-bezier(.16,1,.3,1) both}.radar-dot.hovered{filter:drop-shadow(0 0 4px rgba(0,0,0,.25));stroke-width:2px}.axis-label{font-size:8px;font-weight:700;fill:var(--text-secondary, #64748b);letter-spacing:-.1px}.radar-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.radar-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}.legend-item{display:inline-flex;align-items:center;gap:6px;cursor:pointer;transition:opacity .2s}.legend-item.dimmed{opacity:.35}.legend-indicator{width:10px;height:10px;border-radius:3px}.legend-text{font-size:12px;font-weight:600;color:var(--text-primary, #0f172a)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4325
4594
|
}
|
|
4326
4595
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadarChartComponent, decorators: [{
|
|
4327
4596
|
type: Component,
|
|
4328
|
-
args: [{ selector: 'ngx-radar-chart', standalone: true, imports: [CommonModule], template: `
|
|
4597
|
+
args: [{ selector: 'ngx-radar-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4329
4598
|
<div class="ngx-radar-wrapper">
|
|
4330
4599
|
<!-- Radar Chart Visual Panel -->
|
|
4331
4600
|
<div class="ngx-radar-container">
|
|
@@ -4333,13 +4602,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4333
4602
|
class="ngx-radar-svg"
|
|
4334
4603
|
viewBox="0 0 220 220"
|
|
4335
4604
|
>
|
|
4605
|
+
<defs>
|
|
4606
|
+
@for (series of seriesData(); track series.label; let sIdx = $index) {
|
|
4607
|
+
<linearGradient [id]="'radar-grad-' + sIdx" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
4608
|
+
<stop offset="0%" [attr.stop-color]="getSeriesColor(sIdx, 1)" stop-opacity="0.35" />
|
|
4609
|
+
<stop offset="100%" [attr.stop-color]="getSeriesColor(sIdx, 1)" stop-opacity="0.05" />
|
|
4610
|
+
</linearGradient>
|
|
4611
|
+
}
|
|
4612
|
+
</defs>
|
|
4613
|
+
|
|
4336
4614
|
<!-- Concentric polygon grids (web rings) -->
|
|
4337
4615
|
@for (ring of gridRings(); track ring) {
|
|
4338
4616
|
<polygon
|
|
4339
4617
|
[attr.points]="getRingPoints(ring)"
|
|
4340
4618
|
fill="none"
|
|
4341
|
-
stroke="var(--border-light,
|
|
4342
|
-
stroke-width="
|
|
4619
|
+
stroke="var(--border-light, rgba(226, 232, 240, 0.6))"
|
|
4620
|
+
stroke-width="0.8"
|
|
4621
|
+
stroke-dasharray="2,2"
|
|
4343
4622
|
/>
|
|
4344
4623
|
}
|
|
4345
4624
|
|
|
@@ -4350,9 +4629,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4350
4629
|
[attr.y1]="110"
|
|
4351
4630
|
[attr.x2]="axis.x"
|
|
4352
4631
|
[attr.y2]="axis.y"
|
|
4353
|
-
stroke="var(--border-color,
|
|
4354
|
-
stroke-width="
|
|
4355
|
-
stroke-dasharray="
|
|
4632
|
+
stroke="var(--border-color, rgba(226, 232, 240, 0.8))"
|
|
4633
|
+
stroke-width="0.8"
|
|
4634
|
+
stroke-dasharray="3,3"
|
|
4356
4635
|
/>
|
|
4357
4636
|
<!-- Category Label text positions -->
|
|
4358
4637
|
<text
|
|
@@ -4369,7 +4648,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4369
4648
|
@for (series of seriesData(); track series.label; let sIdx = $index) {
|
|
4370
4649
|
<polygon
|
|
4371
4650
|
[attr.points]="getSeriesPoints(series)"
|
|
4372
|
-
[attr.fill]="
|
|
4651
|
+
[attr.fill]="'url(#radar-grad-' + sIdx + ')'"
|
|
4373
4652
|
[attr.stroke]="getSeriesColor(sIdx, 1)"
|
|
4374
4653
|
stroke-width="2.5"
|
|
4375
4654
|
class="radar-polygon"
|
|
@@ -4383,11 +4662,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4383
4662
|
<circle
|
|
4384
4663
|
[attr.cx]="pt.x"
|
|
4385
4664
|
[attr.cy]="pt.y"
|
|
4386
|
-
[attr.r]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index ? 5 : 3.5"
|
|
4665
|
+
[attr.r]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index ? 5.5 : 3.5"
|
|
4387
4666
|
[attr.fill]="getSeriesColor(sIdx, 1)"
|
|
4388
4667
|
stroke="#ffffff"
|
|
4389
4668
|
stroke-width="1.5"
|
|
4390
4669
|
class="radar-dot"
|
|
4670
|
+
[class.hovered]="hoveredPoint()?.seriesLabel === series.label && hoveredPoint()?.index === $index"
|
|
4391
4671
|
(mouseenter)="onPointEnter(series, $index, pt, $event)"
|
|
4392
4672
|
(mouseleave)="onPointLeave()"
|
|
4393
4673
|
/>
|
|
@@ -4402,10 +4682,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4402
4682
|
[style.left.px]="tooltip().x"
|
|
4403
4683
|
[style.top.px]="tooltip().y"
|
|
4404
4684
|
>
|
|
4405
|
-
<div class="
|
|
4406
|
-
<div class="
|
|
4407
|
-
<span
|
|
4408
|
-
<span>{{ tooltip().
|
|
4685
|
+
<div class="tt-cat">{{ tooltip().series }}</div>
|
|
4686
|
+
<div class="tt-row">
|
|
4687
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
4688
|
+
<span class="tt-name">{{ tooltip().category }}</span>
|
|
4689
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4409
4690
|
</div>
|
|
4410
4691
|
</div>
|
|
4411
4692
|
}
|
|
@@ -4426,7 +4707,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4426
4707
|
}
|
|
4427
4708
|
</div>
|
|
4428
4709
|
</div>
|
|
4429
|
-
`, styles: [":host{display:block;width:100%;height:100%}.ngx-radar-wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-radar-container{position:relative;width:100%;max-width:280px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-radar-svg{width:100%;height:100%;overflow:visible}.radar-polygon{transition:
|
|
4710
|
+
`, styles: [":host{display:block;width:100%;height:100%}.ngx-radar-wrapper{width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:16px;padding:24px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-radar-container{position:relative;width:100%;max-width:280px;aspect-ratio:1;display:flex;align-items:center;justify-content:center}.ngx-radar-svg{width:100%;height:100%;overflow:visible}@keyframes radarScaleIn{0%{transform:scale(.1);opacity:0}to{transform:scale(1);opacity:1}}.radar-polygon{transition:stroke-width .25s cubic-bezier(.16,1,.3,1),fill-opacity .25s;cursor:pointer;transform-origin:110px 110px;animation:radarScaleIn .8s cubic-bezier(.16,1,.3,1) both}.radar-polygon:hover,.radar-polygon.active{stroke-width:3.5px}.radar-dot{cursor:pointer;transition:r .2s cubic-bezier(.16,1,.3,1),stroke-width .2s;transform-origin:110px 110px;animation:radarScaleIn .8s cubic-bezier(.16,1,.3,1) both}.radar-dot.hovered{filter:drop-shadow(0 0 4px rgba(0,0,0,.25));stroke-width:2px}.axis-label{font-size:8px;font-weight:700;fill:var(--text-secondary, #64748b);letter-spacing:-.1px}.radar-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.radar-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:12px}.legend-item{display:inline-flex;align-items:center;gap:6px;cursor:pointer;transition:opacity .2s}.legend-item.dimmed{opacity:.35}.legend-indicator{width:10px;height:10px;border-radius:3px}.legend-text{font-size:12px;font-weight:600;color:var(--text-primary, #0f172a)}\n"] }]
|
|
4430
4711
|
}] });
|
|
4431
4712
|
|
|
4432
4713
|
class HeatmapChartComponent {
|
|
@@ -4444,7 +4725,8 @@ class HeatmapChartComponent {
|
|
|
4444
4725
|
title: '',
|
|
4445
4726
|
value: '',
|
|
4446
4727
|
x: 0,
|
|
4447
|
-
y: 0
|
|
4728
|
+
y: 0,
|
|
4729
|
+
rawVal: 0
|
|
4448
4730
|
});
|
|
4449
4731
|
cellWidth = computed(() => {
|
|
4450
4732
|
const cols = this.data()[0]?.length || 1;
|
|
@@ -4506,7 +4788,8 @@ class HeatmapChartComponent {
|
|
|
4506
4788
|
title,
|
|
4507
4789
|
value: val.toLocaleString(),
|
|
4508
4790
|
x,
|
|
4509
|
-
y
|
|
4791
|
+
y,
|
|
4792
|
+
rawVal: val
|
|
4510
4793
|
});
|
|
4511
4794
|
}
|
|
4512
4795
|
onCellLeave() {
|
|
@@ -4560,6 +4843,7 @@ class HeatmapChartComponent {
|
|
|
4560
4843
|
[attr.height]="cellHeight() - cellSpacing"
|
|
4561
4844
|
[attr.fill]="getCellColor(val)"
|
|
4562
4845
|
class="heatmap-cell"
|
|
4846
|
+
[style.animation-delay]="(rIdx * 0.03 + cIdx * 0.03) + 's'"
|
|
4563
4847
|
(mouseenter)="onCellEnter(rIdx, cIdx, val, $event)"
|
|
4564
4848
|
(mouseleave)="onCellLeave()"
|
|
4565
4849
|
(click)="onCellClick(rIdx, cIdx, val)"
|
|
@@ -4577,20 +4861,21 @@ class HeatmapChartComponent {
|
|
|
4577
4861
|
[style.left.px]="tooltip().x"
|
|
4578
4862
|
[style.top.px]="tooltip().y"
|
|
4579
4863
|
>
|
|
4580
|
-
<div class="
|
|
4581
|
-
<div class="
|
|
4582
|
-
<span
|
|
4583
|
-
<
|
|
4864
|
+
<div class="tt-cat">{{ tooltip().title }}</div>
|
|
4865
|
+
<div class="tt-row">
|
|
4866
|
+
<span class="tt-dot" [style.background]="getCellColor(tooltip().rawVal)"></span>
|
|
4867
|
+
<span class="tt-name">Value</span>
|
|
4868
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4584
4869
|
</div>
|
|
4585
4870
|
</div>
|
|
4586
4871
|
}
|
|
4587
4872
|
</div>
|
|
4588
4873
|
</div>
|
|
4589
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-heatmap-wrapper{width:100%;height:100%;padding:20px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-heatmap-container{position:relative;width:100%;height:100%}.ngx-heatmap-svg{width:100%;height:100%;overflow:visible}.axis-label{font-size:10px;font-weight:700;fill:var(--text-secondary, #64748b);font-family:inherit}.heatmap-cell{cursor:pointer;transition:fill .2s ease,stroke .15s ease,filter .15s ease;stroke:transparent;stroke-width:1px}.heatmap-cell:hover{filter:brightness(1.
|
|
4874
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-heatmap-wrapper{width:100%;height:100%;padding:20px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-heatmap-container{position:relative;width:100%;height:100%}.ngx-heatmap-svg{width:100%;height:100%;overflow:visible}.axis-label{font-size:10px;font-weight:700;fill:var(--text-secondary, #64748b);font-family:inherit}@keyframes cellFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.heatmap-cell{cursor:pointer;transition:fill .2s ease,stroke .15s ease,filter .15s ease;stroke:transparent;stroke-width:1px;transform-origin:center;animation:cellFadeIn .4s ease-out both}.heatmap-cell:hover{filter:brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,.18));stroke:var(--ngx-chart-hover-stroke, #0f172a);stroke-width:1.5px}.heatmap-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4590
4875
|
}
|
|
4591
4876
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: HeatmapChartComponent, decorators: [{
|
|
4592
4877
|
type: Component,
|
|
4593
|
-
args: [{ selector: 'ngx-heatmap-chart', standalone: true, imports: [CommonModule], template: `
|
|
4878
|
+
args: [{ selector: 'ngx-heatmap-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4594
4879
|
<div class="ngx-heatmap-wrapper">
|
|
4595
4880
|
<div class="ngx-heatmap-container">
|
|
4596
4881
|
<!-- SVG Grid rendering -->
|
|
@@ -4634,6 +4919,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4634
4919
|
[attr.height]="cellHeight() - cellSpacing"
|
|
4635
4920
|
[attr.fill]="getCellColor(val)"
|
|
4636
4921
|
class="heatmap-cell"
|
|
4922
|
+
[style.animation-delay]="(rIdx * 0.03 + cIdx * 0.03) + 's'"
|
|
4637
4923
|
(mouseenter)="onCellEnter(rIdx, cIdx, val, $event)"
|
|
4638
4924
|
(mouseleave)="onCellLeave()"
|
|
4639
4925
|
(click)="onCellClick(rIdx, cIdx, val)"
|
|
@@ -4651,16 +4937,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4651
4937
|
[style.left.px]="tooltip().x"
|
|
4652
4938
|
[style.top.px]="tooltip().y"
|
|
4653
4939
|
>
|
|
4654
|
-
<div class="
|
|
4655
|
-
<div class="
|
|
4656
|
-
<span
|
|
4657
|
-
<
|
|
4940
|
+
<div class="tt-cat">{{ tooltip().title }}</div>
|
|
4941
|
+
<div class="tt-row">
|
|
4942
|
+
<span class="tt-dot" [style.background]="getCellColor(tooltip().rawVal)"></span>
|
|
4943
|
+
<span class="tt-name">Value</span>
|
|
4944
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4658
4945
|
</div>
|
|
4659
4946
|
</div>
|
|
4660
4947
|
}
|
|
4661
4948
|
</div>
|
|
4662
4949
|
</div>
|
|
4663
|
-
`, styles: [":host{display:block;width:100%;height:100%}.ngx-heatmap-wrapper{width:100%;height:100%;padding:20px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-heatmap-container{position:relative;width:100%;height:100%}.ngx-heatmap-svg{width:100%;height:100%;overflow:visible}.axis-label{font-size:10px;font-weight:700;fill:var(--text-secondary, #64748b);font-family:inherit}.heatmap-cell{cursor:pointer;transition:fill .2s ease,stroke .15s ease,filter .15s ease;stroke:transparent;stroke-width:1px}.heatmap-cell:hover{filter:brightness(1.
|
|
4950
|
+
`, styles: [":host{display:block;width:100%;height:100%}.ngx-heatmap-wrapper{width:100%;height:100%;padding:20px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-heatmap-container{position:relative;width:100%;height:100%}.ngx-heatmap-svg{width:100%;height:100%;overflow:visible}.axis-label{font-size:10px;font-weight:700;fill:var(--text-secondary, #64748b);font-family:inherit}@keyframes cellFadeIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}.heatmap-cell{cursor:pointer;transition:fill .2s ease,stroke .15s ease,filter .15s ease;stroke:transparent;stroke-width:1px;transform-origin:center;animation:cellFadeIn .4s ease-out both}.heatmap-cell:hover{filter:brightness(1.1) drop-shadow(0 4px 8px rgba(0,0,0,.18));stroke:var(--ngx-chart-hover-stroke, #0f172a);stroke-width:1.5px}.heatmap-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
4664
4951
|
}] });
|
|
4665
4952
|
|
|
4666
4953
|
class TreemapChartComponent {
|
|
@@ -4672,7 +4959,8 @@ class TreemapChartComponent {
|
|
|
4672
4959
|
title: '',
|
|
4673
4960
|
value: '',
|
|
4674
4961
|
x: 0,
|
|
4675
|
-
y: 0
|
|
4962
|
+
y: 0,
|
|
4963
|
+
color: ''
|
|
4676
4964
|
});
|
|
4677
4965
|
layoutRects = computed(() => {
|
|
4678
4966
|
const rawData = this.data();
|
|
@@ -4749,7 +5037,8 @@ class TreemapChartComponent {
|
|
|
4749
5037
|
title: item.label,
|
|
4750
5038
|
value: item.value.toLocaleString(),
|
|
4751
5039
|
x,
|
|
4752
|
-
y
|
|
5040
|
+
y,
|
|
5041
|
+
color: item.displayColor
|
|
4753
5042
|
});
|
|
4754
5043
|
}
|
|
4755
5044
|
onItemLeave() {
|
|
@@ -4768,9 +5057,18 @@ class TreemapChartComponent {
|
|
|
4768
5057
|
viewBox="0 0 500 300"
|
|
4769
5058
|
preserveAspectRatio="xMidYMid meet"
|
|
4770
5059
|
>
|
|
5060
|
+
<defs>
|
|
5061
|
+
<linearGradient id="treemap-sheen" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
5062
|
+
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.18" />
|
|
5063
|
+
<stop offset="100%" stop-color="#ffffff" stop-opacity="0.0" />
|
|
5064
|
+
</linearGradient>
|
|
5065
|
+
</defs>
|
|
5066
|
+
|
|
4771
5067
|
@for (item of layoutRects(); track item.label; let idx = $index) {
|
|
4772
5068
|
<g
|
|
4773
5069
|
class="treemap-group"
|
|
5070
|
+
[style.transform-origin]="(item.x + item.w/2) + 'px ' + (item.y + item.h/2) + 'px'"
|
|
5071
|
+
[style.animation-delay]="idx * 0.03 + 's'"
|
|
4774
5072
|
(mouseenter)="onItemEnter(item, $event)"
|
|
4775
5073
|
(mouseleave)="onItemLeave()"
|
|
4776
5074
|
(click)="onItemClick(item)"
|
|
@@ -4786,6 +5084,18 @@ class TreemapChartComponent {
|
|
|
4786
5084
|
rx="4"
|
|
4787
5085
|
ry="4"
|
|
4788
5086
|
/>
|
|
5087
|
+
|
|
5088
|
+
<!-- Glass Sheen Overlay -->
|
|
5089
|
+
<rect
|
|
5090
|
+
[attr.x]="item.x"
|
|
5091
|
+
[attr.y]="item.y"
|
|
5092
|
+
[attr.width]="item.w"
|
|
5093
|
+
[attr.height]="item.h"
|
|
5094
|
+
fill="url(#treemap-sheen)"
|
|
5095
|
+
rx="4"
|
|
5096
|
+
ry="4"
|
|
5097
|
+
pointer-events="none"
|
|
5098
|
+
/>
|
|
4789
5099
|
|
|
4790
5100
|
<!-- Labels (Only show if rectangle is large enough) -->
|
|
4791
5101
|
@if (item.w > 50 && item.h > 30) {
|
|
@@ -4817,20 +5127,21 @@ class TreemapChartComponent {
|
|
|
4817
5127
|
[style.left.px]="tooltip().x"
|
|
4818
5128
|
[style.top.px]="tooltip().y"
|
|
4819
5129
|
>
|
|
4820
|
-
<div class="
|
|
4821
|
-
<div class="
|
|
4822
|
-
<span
|
|
4823
|
-
<
|
|
5130
|
+
<div class="tt-cat">{{ tooltip().title }}</div>
|
|
5131
|
+
<div class="tt-row">
|
|
5132
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
5133
|
+
<span class="tt-name">Value</span>
|
|
5134
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4824
5135
|
</div>
|
|
4825
5136
|
</div>
|
|
4826
5137
|
}
|
|
4827
5138
|
</div>
|
|
4828
5139
|
</div>
|
|
4829
|
-
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-treemap-wrapper{width:100%;height:100%;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-treemap-container{position:relative;width:100%;height:100%}.ngx-treemap-svg{width:100%;height:100%;display:block;overflow:visible}.treemap-group{cursor:pointer}.treemap-rect{stroke:var(--bg-secondary, #ffffff);stroke-width:1.5px;transition:fill .2s ease,stroke .
|
|
5140
|
+
`, isInline: true, styles: [":host{display:block;width:100%;height:100%}.ngx-treemap-wrapper{width:100%;height:100%;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-treemap-container{position:relative;width:100%;height:100%}.ngx-treemap-svg{width:100%;height:100%;display:block;overflow:visible}@keyframes treemapScaleIn{0%{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}.treemap-group{cursor:pointer;animation:treemapScaleIn .5s cubic-bezier(.16,1,.3,1) both;transition:transform .2s cubic-bezier(.16,1,.3,1)}.treemap-group:hover{transform:scale(1.025)}.treemap-rect{stroke:var(--bg-secondary, #ffffff);stroke-width:1.5px;transition:fill .2s ease,stroke .2s ease,filter .2s ease}.treemap-group:hover .treemap-rect{filter:brightness(1.06) drop-shadow(0 4px 12px rgba(0,0,0,.22));stroke:var(--ngx-chart-hover-stroke, #0f172a);stroke-width:2px}.treemap-label{font-size:11px;font-weight:750;fill:#fff;font-family:inherit;pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.3)}.treemap-value{font-size:9px;font-weight:600;fill:#fffffff2;font-family:inherit;pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.3)}.treemap-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
4830
5141
|
}
|
|
4831
5142
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: TreemapChartComponent, decorators: [{
|
|
4832
5143
|
type: Component,
|
|
4833
|
-
args: [{ selector: 'ngx-treemap-chart', standalone: true, imports: [CommonModule], template: `
|
|
5144
|
+
args: [{ selector: 'ngx-treemap-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
4834
5145
|
<div class="ngx-treemap-wrapper">
|
|
4835
5146
|
<div class="ngx-treemap-container">
|
|
4836
5147
|
<!-- SVG Canvas -->
|
|
@@ -4839,9 +5150,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4839
5150
|
viewBox="0 0 500 300"
|
|
4840
5151
|
preserveAspectRatio="xMidYMid meet"
|
|
4841
5152
|
>
|
|
5153
|
+
<defs>
|
|
5154
|
+
<linearGradient id="treemap-sheen" x1="0%" y1="0%" x2="0%" y2="100%">
|
|
5155
|
+
<stop offset="0%" stop-color="#ffffff" stop-opacity="0.18" />
|
|
5156
|
+
<stop offset="100%" stop-color="#ffffff" stop-opacity="0.0" />
|
|
5157
|
+
</linearGradient>
|
|
5158
|
+
</defs>
|
|
5159
|
+
|
|
4842
5160
|
@for (item of layoutRects(); track item.label; let idx = $index) {
|
|
4843
5161
|
<g
|
|
4844
5162
|
class="treemap-group"
|
|
5163
|
+
[style.transform-origin]="(item.x + item.w/2) + 'px ' + (item.y + item.h/2) + 'px'"
|
|
5164
|
+
[style.animation-delay]="idx * 0.03 + 's'"
|
|
4845
5165
|
(mouseenter)="onItemEnter(item, $event)"
|
|
4846
5166
|
(mouseleave)="onItemLeave()"
|
|
4847
5167
|
(click)="onItemClick(item)"
|
|
@@ -4857,6 +5177,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4857
5177
|
rx="4"
|
|
4858
5178
|
ry="4"
|
|
4859
5179
|
/>
|
|
5180
|
+
|
|
5181
|
+
<!-- Glass Sheen Overlay -->
|
|
5182
|
+
<rect
|
|
5183
|
+
[attr.x]="item.x"
|
|
5184
|
+
[attr.y]="item.y"
|
|
5185
|
+
[attr.width]="item.w"
|
|
5186
|
+
[attr.height]="item.h"
|
|
5187
|
+
fill="url(#treemap-sheen)"
|
|
5188
|
+
rx="4"
|
|
5189
|
+
ry="4"
|
|
5190
|
+
pointer-events="none"
|
|
5191
|
+
/>
|
|
4860
5192
|
|
|
4861
5193
|
<!-- Labels (Only show if rectangle is large enough) -->
|
|
4862
5194
|
@if (item.w > 50 && item.h > 30) {
|
|
@@ -4888,16 +5220,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
4888
5220
|
[style.left.px]="tooltip().x"
|
|
4889
5221
|
[style.top.px]="tooltip().y"
|
|
4890
5222
|
>
|
|
4891
|
-
<div class="
|
|
4892
|
-
<div class="
|
|
4893
|
-
<span
|
|
4894
|
-
<
|
|
5223
|
+
<div class="tt-cat">{{ tooltip().title }}</div>
|
|
5224
|
+
<div class="tt-row">
|
|
5225
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
5226
|
+
<span class="tt-name">Value</span>
|
|
5227
|
+
<span class="tt-val">{{ tooltip().value }}</span>
|
|
4895
5228
|
</div>
|
|
4896
5229
|
</div>
|
|
4897
5230
|
}
|
|
4898
5231
|
</div>
|
|
4899
5232
|
</div>
|
|
4900
|
-
`, styles: [":host{display:block;width:100%;height:100%}.ngx-treemap-wrapper{width:100%;height:100%;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05))}.ngx-treemap-container{position:relative;width:100%;height:100%}.ngx-treemap-svg{width:100%;height:100%;display:block;overflow:visible}.treemap-group{cursor:pointer}.treemap-rect{stroke:var(--bg-secondary, #ffffff);stroke-width:1.5px;transition:fill .2s ease,stroke .
|
|
5233
|
+
`, styles: [":host{display:block;width:100%;height:100%}.ngx-treemap-wrapper{width:100%;height:100%;padding:16px;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;box-shadow:var(--shadow-sm, 0 1px 2px rgba(0,0,0,.05));position:relative}.ngx-treemap-container{position:relative;width:100%;height:100%}.ngx-treemap-svg{width:100%;height:100%;display:block;overflow:visible}@keyframes treemapScaleIn{0%{opacity:0;transform:scale(.92)}to{opacity:1;transform:scale(1)}}.treemap-group{cursor:pointer;animation:treemapScaleIn .5s cubic-bezier(.16,1,.3,1) both;transition:transform .2s cubic-bezier(.16,1,.3,1)}.treemap-group:hover{transform:scale(1.025)}.treemap-rect{stroke:var(--bg-secondary, #ffffff);stroke-width:1.5px;transition:fill .2s ease,stroke .2s ease,filter .2s ease}.treemap-group:hover .treemap-rect{filter:brightness(1.06) drop-shadow(0 4px 12px rgba(0,0,0,.22));stroke:var(--ngx-chart-hover-stroke, #0f172a);stroke-width:2px}.treemap-label{font-size:11px;font-weight:750;fill:#fff;font-family:inherit;pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.3)}.treemap-value{font-size:9px;font-weight:600;fill:#fffffff2;font-family:inherit;pointer-events:none;text-shadow:0 1px 2px rgba(0,0,0,.3)}.treemap-tooltip{position:absolute;z-index:100;pointer-events:none;background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transform:translate(-50%,-115%);min-width:140px;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
4901
5234
|
}] });
|
|
4902
5235
|
|
|
4903
5236
|
class AreaChartComponent {
|
|
@@ -4913,10 +5246,12 @@ class AreaChartComponent {
|
|
|
4913
5246
|
showLegend = input(true);
|
|
4914
5247
|
colors = input(CHART_COLORS);
|
|
4915
5248
|
crosshair = signal(null);
|
|
5249
|
+
activeCategoryIndex = signal(null);
|
|
4916
5250
|
tooltip = signal(null);
|
|
4917
5251
|
containerWidth = signal(600);
|
|
4918
5252
|
innerW = computed(() => this.containerWidth() - this.PAD_LEFT - this.PAD_RIGHT);
|
|
4919
5253
|
innerH = computed(() => this.height() - this.PAD_TOP - this.PAD_BOTTOM);
|
|
5254
|
+
animateState = signal(false);
|
|
4920
5255
|
constructor() {
|
|
4921
5256
|
const hostEl = inject(ElementRef).nativeElement;
|
|
4922
5257
|
if (typeof ResizeObserver !== 'undefined') {
|
|
@@ -4932,6 +5267,7 @@ class AreaChartComponent {
|
|
|
4932
5267
|
resizeObserver.observe(hostEl);
|
|
4933
5268
|
inject(DestroyRef).onDestroy(() => resizeObserver.disconnect());
|
|
4934
5269
|
}
|
|
5270
|
+
setTimeout(() => this.animateState.set(true), 50);
|
|
4935
5271
|
}
|
|
4936
5272
|
allValues = computed(() => this.series().flatMap(s => s.data));
|
|
4937
5273
|
yMin = computed(() => Math.min(0, ...this.allValues()));
|
|
@@ -4966,6 +5302,7 @@ class AreaChartComponent {
|
|
|
4966
5302
|
const idx = Math.round(scale(mx, 0, this.innerW(), 0, cats.length - 1));
|
|
4967
5303
|
const ci = Math.max(0, Math.min(cats.length - 1, idx));
|
|
4968
5304
|
this.crosshair.set({ x: this.xPos(ci) });
|
|
5305
|
+
this.activeCategoryIndex.set(ci);
|
|
4969
5306
|
const rows = this.series().map((s, si) => ({
|
|
4970
5307
|
name: s.name,
|
|
4971
5308
|
value: s.data[ci] ?? 0,
|
|
@@ -4978,10 +5315,15 @@ class AreaChartComponent {
|
|
|
4978
5315
|
rows,
|
|
4979
5316
|
});
|
|
4980
5317
|
}
|
|
5318
|
+
onMouseLeave() {
|
|
5319
|
+
this.crosshair.set(null);
|
|
5320
|
+
this.activeCategoryIndex.set(null);
|
|
5321
|
+
this.tooltip.set(null);
|
|
5322
|
+
}
|
|
4981
5323
|
fmtNum = fmtNum;
|
|
4982
5324
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AreaChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
4983
5325
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: AreaChartComponent, isStandalone: true, selector: "ngx-area-chart", inputs: { series: { classPropertyName: "series", publicName: "series", isSignal: true, isRequired: false, transformFunction: null }, categories: { classPropertyName: "categories", publicName: "categories", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, showGrid: { classPropertyName: "showGrid", publicName: "showGrid", isSignal: true, isRequired: false, transformFunction: null }, showMarkers: { classPropertyName: "showMarkers", publicName: "showMarkers", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
4984
|
-
<div class="ngx-area-chart" (mousemove)="onMouseMove($event)" (mouseleave)="
|
|
5326
|
+
<div class="ngx-area-chart" (mousemove)="onMouseMove($event)" (mouseleave)="onMouseLeave()">
|
|
4985
5327
|
@if (showLegend()) {
|
|
4986
5328
|
<div class="chart-legend">
|
|
4987
5329
|
@for (s of series(); track s.name; let i = $index) {
|
|
@@ -5027,6 +5369,7 @@ class AreaChartComponent {
|
|
|
5027
5369
|
[attr.d]="areaPath(s)"
|
|
5028
5370
|
[attr.fill]="'url(#area-gradient-' + si + ')'"
|
|
5029
5371
|
stroke="none"
|
|
5372
|
+
class="area-path"
|
|
5030
5373
|
/>
|
|
5031
5374
|
|
|
5032
5375
|
<!-- Border Line -->
|
|
@@ -5037,18 +5380,20 @@ class AreaChartComponent {
|
|
|
5037
5380
|
stroke-width="3"
|
|
5038
5381
|
stroke-linejoin="round"
|
|
5039
5382
|
stroke-linecap="round"
|
|
5383
|
+
class="line-path"
|
|
5040
5384
|
/>
|
|
5041
5385
|
|
|
5042
5386
|
<!-- Hover Markers -->
|
|
5043
|
-
@if (showMarkers()) {
|
|
5387
|
+
@if (showMarkers() && animateState()) {
|
|
5044
5388
|
@for (v of s.data; track $index; let ci = $index) {
|
|
5045
5389
|
<circle
|
|
5046
5390
|
[attr.cx]="xPos(ci)"
|
|
5047
5391
|
[attr.cy]="yPos(v)"
|
|
5048
|
-
r="4"
|
|
5392
|
+
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
5049
5393
|
[attr.fill]="seriesColor(si, s)"
|
|
5050
|
-
stroke="#
|
|
5051
|
-
stroke-width="2"
|
|
5394
|
+
[attr.stroke]="activeCategoryIndex() === ci ? '#fff' : '#fff'"
|
|
5395
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 2.5 : 2"
|
|
5396
|
+
[attr.filter]="activeCategoryIndex() === ci ? 'drop-shadow(0 2px 4px rgba(0,0,0,0.25))' : null"
|
|
5052
5397
|
class="marker-dot"
|
|
5053
5398
|
/>
|
|
5054
5399
|
}
|
|
@@ -5082,12 +5427,12 @@ class AreaChartComponent {
|
|
|
5082
5427
|
</div>
|
|
5083
5428
|
}
|
|
5084
5429
|
</div>
|
|
5085
|
-
`, isInline: true, styles: [":host{display:block}.ngx-area-chart{position:relative;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:20px}.chart-legend{display:flex;gap:16px;padding:0 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-secondary, #64748b);font-weight:500}.legend-dot{width:12px;height:4px;border-radius:2px;display:inline-block}.chart-svg-wrap{position:relative;width:100%}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:10px;font-weight:600;fill:var(--text-secondary, #94a3b8)}.
|
|
5430
|
+
`, isInline: true, styles: [":host{display:block}.ngx-area-chart{position:relative;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:20px}.chart-legend{display:flex;gap:16px;padding:0 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-secondary, #64748b);font-weight:500}.legend-dot{width:12px;height:4px;border-radius:2px;display:inline-block}.chart-svg-wrap{position:relative;width:100%}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:10px;font-weight:600;fill:var(--text-secondary, #94a3b8)}@keyframes lineDraw{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:lineDraw 1.2s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFadeIn{0%{opacity:0}to{opacity:1}}.area-path{animation:areaFadeIn 1s cubic-bezier(.16,1,.3,1) .3s both}.marker-dot{animation:areaFadeIn .5s ease .8s both;transition:r .15s cubic-bezier(.16,1,.3,1),stroke-width .15s}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5086
5431
|
}
|
|
5087
5432
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: AreaChartComponent, decorators: [{
|
|
5088
5433
|
type: Component,
|
|
5089
5434
|
args: [{ selector: 'ngx-area-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
5090
|
-
<div class="ngx-area-chart" (mousemove)="onMouseMove($event)" (mouseleave)="
|
|
5435
|
+
<div class="ngx-area-chart" (mousemove)="onMouseMove($event)" (mouseleave)="onMouseLeave()">
|
|
5091
5436
|
@if (showLegend()) {
|
|
5092
5437
|
<div class="chart-legend">
|
|
5093
5438
|
@for (s of series(); track s.name; let i = $index) {
|
|
@@ -5133,6 +5478,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5133
5478
|
[attr.d]="areaPath(s)"
|
|
5134
5479
|
[attr.fill]="'url(#area-gradient-' + si + ')'"
|
|
5135
5480
|
stroke="none"
|
|
5481
|
+
class="area-path"
|
|
5136
5482
|
/>
|
|
5137
5483
|
|
|
5138
5484
|
<!-- Border Line -->
|
|
@@ -5143,18 +5489,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5143
5489
|
stroke-width="3"
|
|
5144
5490
|
stroke-linejoin="round"
|
|
5145
5491
|
stroke-linecap="round"
|
|
5492
|
+
class="line-path"
|
|
5146
5493
|
/>
|
|
5147
5494
|
|
|
5148
5495
|
<!-- Hover Markers -->
|
|
5149
|
-
@if (showMarkers()) {
|
|
5496
|
+
@if (showMarkers() && animateState()) {
|
|
5150
5497
|
@for (v of s.data; track $index; let ci = $index) {
|
|
5151
5498
|
<circle
|
|
5152
5499
|
[attr.cx]="xPos(ci)"
|
|
5153
5500
|
[attr.cy]="yPos(v)"
|
|
5154
|
-
r="4"
|
|
5501
|
+
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
5155
5502
|
[attr.fill]="seriesColor(si, s)"
|
|
5156
|
-
stroke="#
|
|
5157
|
-
stroke-width="2"
|
|
5503
|
+
[attr.stroke]="activeCategoryIndex() === ci ? '#fff' : '#fff'"
|
|
5504
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 2.5 : 2"
|
|
5505
|
+
[attr.filter]="activeCategoryIndex() === ci ? 'drop-shadow(0 2px 4px rgba(0,0,0,0.25))' : null"
|
|
5158
5506
|
class="marker-dot"
|
|
5159
5507
|
/>
|
|
5160
5508
|
}
|
|
@@ -5188,7 +5536,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5188
5536
|
</div>
|
|
5189
5537
|
}
|
|
5190
5538
|
</div>
|
|
5191
|
-
`, styles: [":host{display:block}.ngx-area-chart{position:relative;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:20px}.chart-legend{display:flex;gap:16px;padding:0 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-secondary, #64748b);font-weight:500}.legend-dot{width:12px;height:4px;border-radius:2px;display:inline-block}.chart-svg-wrap{position:relative;width:100%}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:10px;font-weight:600;fill:var(--text-secondary, #94a3b8)}.
|
|
5539
|
+
`, styles: [":host{display:block}.ngx-area-chart{position:relative;background:var(--bg-secondary, #ffffff);border:1px solid var(--border-color, #e2e8f0);border-radius:12px;padding:20px}.chart-legend{display:flex;gap:16px;padding:0 0 12px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--text-secondary, #64748b);font-weight:500}.legend-dot{width:12px;height:4px;border-radius:2px;display:inline-block}.chart-svg-wrap{position:relative;width:100%}.chart-svg{display:block;overflow:visible;cursor:crosshair}.axis-label{font-size:10px;font-weight:600;fill:var(--text-secondary, #94a3b8)}@keyframes lineDraw{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:lineDraw 1.2s cubic-bezier(.16,1,.3,1) forwards}@keyframes areaFadeIn{0%{opacity:0}to{opacity:1}}.area-path{animation:areaFadeIn 1s cubic-bezier(.16,1,.3,1) .3s both}.marker-dot{animation:areaFadeIn .5s ease .8s both;transition:r .15s cubic-bezier(.16,1,.3,1),stroke-width .15s}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tt-cat{font-weight:700;margin-bottom:8px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:5px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
5192
5540
|
}], ctorParameters: () => [] });
|
|
5193
5541
|
|
|
5194
5542
|
class FunnelChartComponent {
|
|
@@ -5213,16 +5561,12 @@ class FunnelChartComponent {
|
|
|
5213
5561
|
const maxFunnelW = 320;
|
|
5214
5562
|
if (this.mode() === 'pyramid') {
|
|
5215
5563
|
// Pyramid Mode: Stacks vertically to form a triangle pointing up.
|
|
5216
|
-
// Slices stack: top is narrow (apex), bottom is wide (base).
|
|
5217
|
-
// Each slice height represents its proportion of the total value.
|
|
5218
5564
|
const totalVal = this.totalValue();
|
|
5219
5565
|
let currentY = 0;
|
|
5220
5566
|
return items.map((item, idx) => {
|
|
5221
5567
|
const h = (item.value / totalVal) * svgH;
|
|
5222
5568
|
const yTop = currentY;
|
|
5223
5569
|
const yBot = currentY + h;
|
|
5224
|
-
// Since the outer shape is a triangle from (200, 0) to (200 - maxW/2, svgH) and (200 + maxW/2, svgH):
|
|
5225
|
-
// Width at any y is: w(y) = (y / svgH) * maxFunnelW
|
|
5226
5570
|
const wTop = (yTop / svgH) * maxFunnelW;
|
|
5227
5571
|
const wBot = (yBot / svgH) * maxFunnelW;
|
|
5228
5572
|
const xTopLeft = (svgW - wTop) / 2;
|
|
@@ -5270,7 +5614,6 @@ class FunnelChartComponent {
|
|
|
5270
5614
|
});
|
|
5271
5615
|
onMouseMove(event, index) {
|
|
5272
5616
|
const el = event.currentTarget;
|
|
5273
|
-
const rect = el.getBoundingClientRect();
|
|
5274
5617
|
const parentRect = el.parentElement?.parentElement?.getBoundingClientRect();
|
|
5275
5618
|
if (parentRect) {
|
|
5276
5619
|
this.tooltipX.set(event.clientX - parentRect.left);
|
|
@@ -5285,12 +5628,22 @@ class FunnelChartComponent {
|
|
|
5285
5628
|
<!-- SVG Visual Funnel / Pyramid -->
|
|
5286
5629
|
<div class="funnel-graphic" (mouseleave)="hoveredIndex.set(null)">
|
|
5287
5630
|
<svg [attr.width]="'100%'" [attr.height]="height()" viewBox="0 0 400 300" preserveAspectRatio="xMidYMid meet" class="funnel-svg">
|
|
5631
|
+
<defs>
|
|
5632
|
+
@for (stage of funnelStages(); track stage.name; let i = $index) {
|
|
5633
|
+
<linearGradient [id]="'funnel-grad-' + i" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5634
|
+
<stop offset="0%" [attr.stop-color]="stage.color" />
|
|
5635
|
+
<stop offset="100%" [attr.stop-color]="stage.color" stop-opacity="0.65" />
|
|
5636
|
+
</linearGradient>
|
|
5637
|
+
}
|
|
5638
|
+
</defs>
|
|
5288
5639
|
<g>
|
|
5289
5640
|
@for (stage of funnelStages(); track stage.name; let i = $index) {
|
|
5290
5641
|
<polygon
|
|
5291
5642
|
[attr.points]="stage.points"
|
|
5292
|
-
[attr.fill]="
|
|
5643
|
+
[attr.fill]="'url(#funnel-grad-' + i + ')'"
|
|
5293
5644
|
[class.active]="hoveredIndex() === i"
|
|
5645
|
+
[style.transform-origin]="'200px ' + stage.yCenter + 'px'"
|
|
5646
|
+
[style.animation-delay]="i * 0.06 + 's'"
|
|
5294
5647
|
(mouseenter)="hoveredIndex.set(i)"
|
|
5295
5648
|
(mousemove)="onMouseMove($event, i)"
|
|
5296
5649
|
class="funnel-polygon"
|
|
@@ -5303,15 +5656,18 @@ class FunnelChartComponent {
|
|
|
5303
5656
|
@if (hoveredIndex() !== null) {
|
|
5304
5657
|
@if (funnelStages()[hoveredIndex()!]; as stage) {
|
|
5305
5658
|
<div class="chart-tooltip" [style.left.px]="tooltipX()" [style.top.px]="tooltipY()">
|
|
5306
|
-
<div class="tt-
|
|
5659
|
+
<div class="tt-cat">{{ stage.name }}</div>
|
|
5307
5660
|
<div class="tt-row">
|
|
5308
|
-
|
|
5661
|
+
<span class="tt-dot" [style.background]="stage.color"></span>
|
|
5662
|
+
<span class="tt-name">Value</span>
|
|
5663
|
+
<span class="tt-val">{{ fmtNum(stage.value) }}</span>
|
|
5309
5664
|
</div>
|
|
5310
5665
|
<div class="tt-row">
|
|
5311
|
-
|
|
5312
|
-
<
|
|
5666
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
5667
|
+
<span class="tt-name">{{ mode() === 'funnel' ? 'Conversion' : 'Share' }}</span>
|
|
5668
|
+
<span class="tt-val">
|
|
5313
5669
|
{{ (mode() === 'funnel' ? (stage.value / funnelStages()[0].value) : (stage.value / totalValue())) | percent:'1.0-1' }}
|
|
5314
|
-
</
|
|
5670
|
+
</span>
|
|
5315
5671
|
</div>
|
|
5316
5672
|
</div>
|
|
5317
5673
|
}
|
|
@@ -5342,7 +5698,7 @@ class FunnelChartComponent {
|
|
|
5342
5698
|
</div>
|
|
5343
5699
|
</div>
|
|
5344
5700
|
</div>
|
|
5345
|
-
`, isInline: true, styles: [":host{display:block}.ngx-funnel-chart{background:var(--ngx-chart-bg, #ffffff);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:
|
|
5701
|
+
`, isInline: true, styles: [":host{display:block}.ngx-funnel-chart{background:var(--ngx-chart-bg, #ffffff);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:16px;padding:20px;position:relative}.funnel-layout{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;align-items:center}@media (max-width: 600px){.funnel-layout{grid-template-columns:1fr}}.funnel-graphic{position:relative;width:100%}.funnel-svg{display:block;overflow:visible}@keyframes funnelBuildIn{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.funnel-polygon{cursor:pointer;opacity:.88;transition:opacity .25s,transform .25s cubic-bezier(.16,1,.3,1),filter .25s;animation:funnelBuildIn .7s cubic-bezier(.16,1,.3,1) both}.funnel-polygon:hover,.funnel-polygon.active{opacity:1;transform:scale(1.03);filter:drop-shadow(0 8px 16px rgba(0,0,0,.18)) brightness(1.03)}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.funnel-legend{display:flex;flex-direction:column;gap:8px}.legend-item{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:8px;border:1px solid transparent;transition:all .2s;cursor:pointer}.legend-item:hover,.legend-item.active{background:var(--ngx-chart-grid, #f8fafc);border-color:var(--ngx-chart-grid, #e2e8f0)}.legend-color-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-content{flex:1;display:flex;justify-content:space-between;align-items:center;gap:16px}.legend-title{font-size:13px;font-weight:600;color:var(--ngx-chart-text, #0f172a)}.legend-metrics{display:flex;align-items:center;gap:10px}.metric-value{font-size:13px;font-weight:700;color:var(--ngx-chart-text, #0f172a)}.metric-pct{font-size:11px;color:var(--ngx-chart-axis-text, #64748b);background:var(--ngx-chart-grid, #f1f5f9);padding:2px 6px;border-radius:4px;font-weight:600}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1.PercentPipe, name: "percent" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5346
5702
|
}
|
|
5347
5703
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: FunnelChartComponent, decorators: [{
|
|
5348
5704
|
type: Component,
|
|
@@ -5352,12 +5708,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5352
5708
|
<!-- SVG Visual Funnel / Pyramid -->
|
|
5353
5709
|
<div class="funnel-graphic" (mouseleave)="hoveredIndex.set(null)">
|
|
5354
5710
|
<svg [attr.width]="'100%'" [attr.height]="height()" viewBox="0 0 400 300" preserveAspectRatio="xMidYMid meet" class="funnel-svg">
|
|
5711
|
+
<defs>
|
|
5712
|
+
@for (stage of funnelStages(); track stage.name; let i = $index) {
|
|
5713
|
+
<linearGradient [id]="'funnel-grad-' + i" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
5714
|
+
<stop offset="0%" [attr.stop-color]="stage.color" />
|
|
5715
|
+
<stop offset="100%" [attr.stop-color]="stage.color" stop-opacity="0.65" />
|
|
5716
|
+
</linearGradient>
|
|
5717
|
+
}
|
|
5718
|
+
</defs>
|
|
5355
5719
|
<g>
|
|
5356
5720
|
@for (stage of funnelStages(); track stage.name; let i = $index) {
|
|
5357
5721
|
<polygon
|
|
5358
5722
|
[attr.points]="stage.points"
|
|
5359
|
-
[attr.fill]="
|
|
5723
|
+
[attr.fill]="'url(#funnel-grad-' + i + ')'"
|
|
5360
5724
|
[class.active]="hoveredIndex() === i"
|
|
5725
|
+
[style.transform-origin]="'200px ' + stage.yCenter + 'px'"
|
|
5726
|
+
[style.animation-delay]="i * 0.06 + 's'"
|
|
5361
5727
|
(mouseenter)="hoveredIndex.set(i)"
|
|
5362
5728
|
(mousemove)="onMouseMove($event, i)"
|
|
5363
5729
|
class="funnel-polygon"
|
|
@@ -5370,15 +5736,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5370
5736
|
@if (hoveredIndex() !== null) {
|
|
5371
5737
|
@if (funnelStages()[hoveredIndex()!]; as stage) {
|
|
5372
5738
|
<div class="chart-tooltip" [style.left.px]="tooltipX()" [style.top.px]="tooltipY()">
|
|
5373
|
-
<div class="tt-
|
|
5739
|
+
<div class="tt-cat">{{ stage.name }}</div>
|
|
5374
5740
|
<div class="tt-row">
|
|
5375
|
-
|
|
5741
|
+
<span class="tt-dot" [style.background]="stage.color"></span>
|
|
5742
|
+
<span class="tt-name">Value</span>
|
|
5743
|
+
<span class="tt-val">{{ fmtNum(stage.value) }}</span>
|
|
5376
5744
|
</div>
|
|
5377
5745
|
<div class="tt-row">
|
|
5378
|
-
|
|
5379
|
-
<
|
|
5746
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
5747
|
+
<span class="tt-name">{{ mode() === 'funnel' ? 'Conversion' : 'Share' }}</span>
|
|
5748
|
+
<span class="tt-val">
|
|
5380
5749
|
{{ (mode() === 'funnel' ? (stage.value / funnelStages()[0].value) : (stage.value / totalValue())) | percent:'1.0-1' }}
|
|
5381
|
-
</
|
|
5750
|
+
</span>
|
|
5382
5751
|
</div>
|
|
5383
5752
|
</div>
|
|
5384
5753
|
}
|
|
@@ -5409,7 +5778,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5409
5778
|
</div>
|
|
5410
5779
|
</div>
|
|
5411
5780
|
</div>
|
|
5412
|
-
`, styles: [":host{display:block}.ngx-funnel-chart{background:var(--ngx-chart-bg, #ffffff);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:
|
|
5781
|
+
`, styles: [":host{display:block}.ngx-funnel-chart{background:var(--ngx-chart-bg, #ffffff);border:1px solid var(--ngx-chart-grid, #ebedf0);border-radius:16px;padding:20px;position:relative}.funnel-layout{display:grid;grid-template-columns:1.2fr 1fr;gap:24px;align-items:center}@media (max-width: 600px){.funnel-layout{grid-template-columns:1fr}}.funnel-graphic{position:relative;width:100%}.funnel-svg{display:block;overflow:visible}@keyframes funnelBuildIn{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.funnel-polygon{cursor:pointer;opacity:.88;transition:opacity .25s,transform .25s cubic-bezier(.16,1,.3,1),filter .25s;animation:funnelBuildIn .7s cubic-bezier(.16,1,.3,1) both}.funnel-polygon:hover,.funnel-polygon.active{opacity:1;transform:scale(1.03);filter:drop-shadow(0 8px 16px rgba(0,0,0,.18)) brightness(1.03)}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}.funnel-legend{display:flex;flex-direction:column;gap:8px}.legend-item{display:flex;align-items:center;gap:12px;padding:10px 14px;border-radius:8px;border:1px solid transparent;transition:all .2s;cursor:pointer}.legend-item:hover,.legend-item.active{background:var(--ngx-chart-grid, #f8fafc);border-color:var(--ngx-chart-grid, #e2e8f0)}.legend-color-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-content{flex:1;display:flex;justify-content:space-between;align-items:center;gap:16px}.legend-title{font-size:13px;font-weight:600;color:var(--ngx-chart-text, #0f172a)}.legend-metrics{display:flex;align-items:center;gap:10px}.metric-value{font-size:13px;font-weight:700;color:var(--ngx-chart-text, #0f172a)}.metric-pct{font-size:11px;color:var(--ngx-chart-axis-text, #64748b);background:var(--ngx-chart-grid, #f1f5f9);padding:2px 6px;border-radius:4px;font-weight:600}\n"] }]
|
|
5413
5782
|
}] });
|
|
5414
5783
|
|
|
5415
5784
|
class ComboChartComponent {
|
|
@@ -5429,7 +5798,11 @@ class ComboChartComponent {
|
|
|
5429
5798
|
lineYTitle = input('Percentage');
|
|
5430
5799
|
activeCategoryIndex = signal(null);
|
|
5431
5800
|
tooltip = signal(null);
|
|
5801
|
+
animateState = signal(false);
|
|
5432
5802
|
container = viewChild('container');
|
|
5803
|
+
constructor() {
|
|
5804
|
+
setTimeout(() => this.animateState.set(true), 50);
|
|
5805
|
+
}
|
|
5433
5806
|
// Dimension Calculations
|
|
5434
5807
|
innerW = computed(() => {
|
|
5435
5808
|
const el = this.container()?.nativeElement;
|
|
@@ -5445,8 +5818,16 @@ class ComboChartComponent {
|
|
|
5445
5818
|
leftYPos(v) {
|
|
5446
5819
|
return scale(v, this.leftMin(), this.leftMax(), this.innerH(), 0);
|
|
5447
5820
|
}
|
|
5448
|
-
barY(v) {
|
|
5449
|
-
|
|
5821
|
+
barY(v) {
|
|
5822
|
+
if (!this.animateState())
|
|
5823
|
+
return this.leftYPos(0);
|
|
5824
|
+
return Math.min(this.leftYPos(0), this.leftYPos(v));
|
|
5825
|
+
}
|
|
5826
|
+
barH(v) {
|
|
5827
|
+
if (!this.animateState())
|
|
5828
|
+
return 0;
|
|
5829
|
+
return Math.abs(this.leftYPos(0) - this.leftYPos(v));
|
|
5830
|
+
}
|
|
5450
5831
|
// Right Y-Axis Calculations (Line values)
|
|
5451
5832
|
rightValues = computed(() => this.lineSeries().flatMap(s => s.data.filter(v => v !== null)));
|
|
5452
5833
|
rightMin = computed(() => Math.min(0, ...this.rightValues()));
|
|
@@ -5568,6 +5949,15 @@ class ComboChartComponent {
|
|
|
5568
5949
|
class="chart-svg"
|
|
5569
5950
|
(mouseleave)="onMouseLeave()"
|
|
5570
5951
|
>
|
|
5952
|
+
<defs>
|
|
5953
|
+
@for (s of barSeries(); track s.name; let si = $index) {
|
|
5954
|
+
<linearGradient [id]="'combo-bar-grad-' + si" x1="0" y1="0" x2="0" y2="1">
|
|
5955
|
+
<stop offset="0%" [attr.stop-color]="s.color || barSeriesColor(si)" stop-opacity="1"/>
|
|
5956
|
+
<stop offset="100%" [attr.stop-color]="s.color || barSeriesColor(si)" stop-opacity="0.75"/>
|
|
5957
|
+
</linearGradient>
|
|
5958
|
+
}
|
|
5959
|
+
</defs>
|
|
5960
|
+
|
|
5571
5961
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
5572
5962
|
<!-- Grid Lines -->
|
|
5573
5963
|
@if (showGrid()) {
|
|
@@ -5643,8 +6033,8 @@ class ComboChartComponent {
|
|
|
5643
6033
|
[attr.y]="barY(v)"
|
|
5644
6034
|
[attr.width]="singleBarWidth()"
|
|
5645
6035
|
[attr.height]="barH(v)"
|
|
5646
|
-
[attr.fill]="s.color
|
|
5647
|
-
[attr.rx]="
|
|
6036
|
+
[attr.fill]="s.color ? s.color : 'url(#combo-bar-grad-' + si + ')'"
|
|
6037
|
+
[attr.rx]="4"
|
|
5648
6038
|
class="bar-rect"
|
|
5649
6039
|
/>
|
|
5650
6040
|
}
|
|
@@ -5668,11 +6058,12 @@ class ComboChartComponent {
|
|
|
5668
6058
|
<circle
|
|
5669
6059
|
[attr.cx]="catMidX(ci)"
|
|
5670
6060
|
[attr.cy]="rightYPos(v)"
|
|
5671
|
-
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
6061
|
+
[attr.r]="activeCategoryIndex() === ci ? 6.5 : 4"
|
|
5672
6062
|
[attr.fill]="'#ffffff'"
|
|
5673
6063
|
[attr.stroke]="s.color || lineSeriesColor(si)"
|
|
5674
|
-
stroke-width="2.5"
|
|
6064
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 3 : 2.5"
|
|
5675
6065
|
class="line-marker"
|
|
6066
|
+
[style.transform-origin]="catMidX(ci) + 'px ' + rightYPos(v) + 'px'"
|
|
5676
6067
|
/>
|
|
5677
6068
|
}
|
|
5678
6069
|
}
|
|
@@ -5701,13 +6092,13 @@ class ComboChartComponent {
|
|
|
5701
6092
|
<!-- Dynamic Combined Tooltip -->
|
|
5702
6093
|
@if (tooltip(); as t) {
|
|
5703
6094
|
<div class="chart-tooltip" [style.left.px]="t.x" [style.top.px]="t.y">
|
|
5704
|
-
<div class="
|
|
5705
|
-
<div class="
|
|
6095
|
+
<div class="tt-cat">{{ t.category }}</div>
|
|
6096
|
+
<div class="tt-body">
|
|
5706
6097
|
@for (item of t.items; track item.name) {
|
|
5707
|
-
<div class="
|
|
5708
|
-
<span class="
|
|
5709
|
-
<span class="
|
|
5710
|
-
<span class="
|
|
6098
|
+
<div class="tt-row">
|
|
6099
|
+
<span class="tt-dot" [style.background]="item.color" [class.line-dot]="item.type === 'line'"></span>
|
|
6100
|
+
<span class="tt-name">{{ item.name }}</span>
|
|
6101
|
+
<span class="tt-val">{{ fmtNum(item.value) }}{{ item.suffix || '' }}</span>
|
|
5711
6102
|
</div>
|
|
5712
6103
|
}
|
|
5713
6104
|
</div>
|
|
@@ -5715,7 +6106,7 @@ class ComboChartComponent {
|
|
|
5715
6106
|
}
|
|
5716
6107
|
</div>
|
|
5717
6108
|
</div>
|
|
5718
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-combo-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-combo-chart.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.legend-dot.bar{border-radius:2px}.legend-line{width:14px;border-bottom:2px solid;display:inline-block}.legend-dot.marker{margin-left:-12px;width:6px;height:6px;border:1.5px solid #ffffff}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.column-highlight{fill:#3b82f60a;pointer-events:none}.dark .column-highlight{fill:#ffffff08}.bar-rect{transition:fill-opacity .
|
|
6109
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-combo-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-combo-chart.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.legend-dot.bar{border-radius:2px}.legend-line{width:14px;border-bottom:2px solid;display:inline-block}.legend-dot.marker{margin-left:-12px;width:6px;height:6px;border:1.5px solid #ffffff}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.column-highlight{fill:#3b82f60a;pointer-events:none;rx:6;ry:6;animation:fadeIn .12s ease-out}.dark .column-highlight{fill:#ffffff08}.bar-rect{transition:y .5s cubic-bezier(.16,1,.3,1),height .5s cubic-bezier(.16,1,.3,1),fill-opacity .15s,stroke-width .15s;stroke:#fff;stroke-width:.5;cursor:pointer}.bar-rect:hover{fill-opacity:.9;stroke-width:1.5;filter:drop-shadow(0 4px 6px rgba(0,0,0,.08))}@keyframes drawLine{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:drawLine 1.2s cubic-bezier(.16,1,.3,1) forwards;transition:stroke .2s}@keyframes markerFade{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.line-marker{cursor:pointer;transition:r .2s cubic-bezier(.16,1,.3,1),stroke-width .2s;animation:markerFade .5s cubic-bezier(.16,1,.3,1) .6s both}.hitbox{cursor:crosshair}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-body{display:flex;flex-direction:column;gap:4px}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-dot.line-dot{border:1.5px solid #ffffff;box-sizing:border-box;width:9px;height:9px}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
5719
6110
|
}
|
|
5720
6111
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ComboChartComponent, decorators: [{
|
|
5721
6112
|
type: Component,
|
|
@@ -5747,6 +6138,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5747
6138
|
class="chart-svg"
|
|
5748
6139
|
(mouseleave)="onMouseLeave()"
|
|
5749
6140
|
>
|
|
6141
|
+
<defs>
|
|
6142
|
+
@for (s of barSeries(); track s.name; let si = $index) {
|
|
6143
|
+
<linearGradient [id]="'combo-bar-grad-' + si" x1="0" y1="0" x2="0" y2="1">
|
|
6144
|
+
<stop offset="0%" [attr.stop-color]="s.color || barSeriesColor(si)" stop-opacity="1"/>
|
|
6145
|
+
<stop offset="100%" [attr.stop-color]="s.color || barSeriesColor(si)" stop-opacity="0.75"/>
|
|
6146
|
+
</linearGradient>
|
|
6147
|
+
}
|
|
6148
|
+
</defs>
|
|
6149
|
+
|
|
5750
6150
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
5751
6151
|
<!-- Grid Lines -->
|
|
5752
6152
|
@if (showGrid()) {
|
|
@@ -5822,8 +6222,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5822
6222
|
[attr.y]="barY(v)"
|
|
5823
6223
|
[attr.width]="singleBarWidth()"
|
|
5824
6224
|
[attr.height]="barH(v)"
|
|
5825
|
-
[attr.fill]="s.color
|
|
5826
|
-
[attr.rx]="
|
|
6225
|
+
[attr.fill]="s.color ? s.color : 'url(#combo-bar-grad-' + si + ')'"
|
|
6226
|
+
[attr.rx]="4"
|
|
5827
6227
|
class="bar-rect"
|
|
5828
6228
|
/>
|
|
5829
6229
|
}
|
|
@@ -5847,11 +6247,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5847
6247
|
<circle
|
|
5848
6248
|
[attr.cx]="catMidX(ci)"
|
|
5849
6249
|
[attr.cy]="rightYPos(v)"
|
|
5850
|
-
[attr.r]="activeCategoryIndex() === ci ? 6 : 4"
|
|
6250
|
+
[attr.r]="activeCategoryIndex() === ci ? 6.5 : 4"
|
|
5851
6251
|
[attr.fill]="'#ffffff'"
|
|
5852
6252
|
[attr.stroke]="s.color || lineSeriesColor(si)"
|
|
5853
|
-
stroke-width="2.5"
|
|
6253
|
+
[attr.stroke-width]="activeCategoryIndex() === ci ? 3 : 2.5"
|
|
5854
6254
|
class="line-marker"
|
|
6255
|
+
[style.transform-origin]="catMidX(ci) + 'px ' + rightYPos(v) + 'px'"
|
|
5855
6256
|
/>
|
|
5856
6257
|
}
|
|
5857
6258
|
}
|
|
@@ -5880,13 +6281,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5880
6281
|
<!-- Dynamic Combined Tooltip -->
|
|
5881
6282
|
@if (tooltip(); as t) {
|
|
5882
6283
|
<div class="chart-tooltip" [style.left.px]="t.x" [style.top.px]="t.y">
|
|
5883
|
-
<div class="
|
|
5884
|
-
<div class="
|
|
6284
|
+
<div class="tt-cat">{{ t.category }}</div>
|
|
6285
|
+
<div class="tt-body">
|
|
5885
6286
|
@for (item of t.items; track item.name) {
|
|
5886
|
-
<div class="
|
|
5887
|
-
<span class="
|
|
5888
|
-
<span class="
|
|
5889
|
-
<span class="
|
|
6287
|
+
<div class="tt-row">
|
|
6288
|
+
<span class="tt-dot" [style.background]="item.color" [class.line-dot]="item.type === 'line'"></span>
|
|
6289
|
+
<span class="tt-name">{{ item.name }}</span>
|
|
6290
|
+
<span class="tt-val">{{ fmtNum(item.value) }}{{ item.suffix || '' }}</span>
|
|
5890
6291
|
</div>
|
|
5891
6292
|
}
|
|
5892
6293
|
</div>
|
|
@@ -5894,8 +6295,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
5894
6295
|
}
|
|
5895
6296
|
</div>
|
|
5896
6297
|
</div>
|
|
5897
|
-
`, styles: [":host{display:block;width:100%}.ngx-combo-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-combo-chart.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.legend-dot.bar{border-radius:2px}.legend-line{width:14px;border-bottom:2px solid;display:inline-block}.legend-dot.marker{margin-left:-12px;width:6px;height:6px;border:1.5px solid #ffffff}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.column-highlight{fill:#3b82f60a;pointer-events:none}.dark .column-highlight{fill:#ffffff08}.bar-rect{transition:fill-opacity .
|
|
5898
|
-
}] });
|
|
6298
|
+
`, styles: [":host{display:block;width:100%}.ngx-combo-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-combo-chart.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.legend-dot.bar{border-radius:2px}.legend-line{width:14px;border-bottom:2px solid;display:inline-block}.legend-dot.marker{margin-left:-12px;width:6px;height:6px;border:1.5px solid #ffffff}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.column-highlight{fill:#3b82f60a;pointer-events:none;rx:6;ry:6;animation:fadeIn .12s ease-out}.dark .column-highlight{fill:#ffffff08}.bar-rect{transition:y .5s cubic-bezier(.16,1,.3,1),height .5s cubic-bezier(.16,1,.3,1),fill-opacity .15s,stroke-width .15s;stroke:#fff;stroke-width:.5;cursor:pointer}.bar-rect:hover{fill-opacity:.9;stroke-width:1.5;filter:drop-shadow(0 4px 6px rgba(0,0,0,.08))}@keyframes drawLine{0%{stroke-dashoffset:1200}to{stroke-dashoffset:0}}.line-path{stroke-dasharray:1200;stroke-dashoffset:1200;animation:drawLine 1.2s cubic-bezier(.16,1,.3,1) forwards;transition:stroke .2s}@keyframes markerFade{0%{opacity:0;transform:scale(0)}to{opacity:1;transform:scale(1)}}.line-marker{cursor:pointer;transition:r .2s cubic-bezier(.16,1,.3,1),stroke-width .2s;animation:markerFade .5s cubic-bezier(.16,1,.3,1) .6s both}.hitbox{cursor:crosshair}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-body{display:flex;flex-direction:column;gap:4px}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-dot.line-dot{border:1.5px solid #ffffff;box-sizing:border-box;width:9px;height:9px}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
6299
|
+
}], ctorParameters: () => [] });
|
|
5899
6300
|
|
|
5900
6301
|
class ScatterPlotComponent {
|
|
5901
6302
|
PAD_LEFT = 52;
|
|
@@ -6070,18 +6471,47 @@ class ScatterPlotComponent {
|
|
|
6070
6471
|
text-anchor="middle"
|
|
6071
6472
|
>{{ xTitle() }}</text>
|
|
6072
6473
|
|
|
6474
|
+
<!-- Active Crosshair -->
|
|
6475
|
+
@if (hoveredPointIndex() !== null) {
|
|
6476
|
+
@if (scaledPoints()[hoveredPointIndex()!]; as pt) {
|
|
6477
|
+
<line
|
|
6478
|
+
[attr.x1]="0"
|
|
6479
|
+
[attr.x2]="innerW()"
|
|
6480
|
+
[attr.y1]="pt.cy"
|
|
6481
|
+
[attr.y2]="pt.cy"
|
|
6482
|
+
stroke="rgba(79, 70, 229, 0.35)"
|
|
6483
|
+
stroke-width="1.2"
|
|
6484
|
+
stroke-dasharray="3,3"
|
|
6485
|
+
class="crosshair-line"
|
|
6486
|
+
/>
|
|
6487
|
+
<line
|
|
6488
|
+
[attr.x1]="pt.cx"
|
|
6489
|
+
[attr.x2]="pt.cx"
|
|
6490
|
+
[attr.y1]="0"
|
|
6491
|
+
[attr.y2]="innerH()"
|
|
6492
|
+
stroke="rgba(79, 70, 229, 0.35)"
|
|
6493
|
+
stroke-width="1.2"
|
|
6494
|
+
stroke-dasharray="3,3"
|
|
6495
|
+
class="crosshair-line"
|
|
6496
|
+
/>
|
|
6497
|
+
}
|
|
6498
|
+
}
|
|
6499
|
+
|
|
6073
6500
|
<!-- Render Data Points -->
|
|
6074
6501
|
@for (pt of scaledPoints(); track $index; let i = $index) {
|
|
6075
6502
|
<circle
|
|
6076
6503
|
[attr.cx]="pt.cx"
|
|
6077
6504
|
[attr.cy]="pt.cy"
|
|
6078
|
-
[attr.r]="pt.r"
|
|
6505
|
+
[attr.r]="hoveredPointIndex() === i ? pt.r + 3.5 : pt.r"
|
|
6079
6506
|
[attr.fill]="pt.color"
|
|
6080
6507
|
[attr.stroke]="'#ffffff'"
|
|
6081
6508
|
stroke-width="1.5"
|
|
6082
6509
|
class="scatter-point"
|
|
6083
6510
|
[class.hovered]="hoveredPointIndex() === i"
|
|
6511
|
+
[style.transform-origin]="pt.cx + 'px ' + pt.cy + 'px'"
|
|
6512
|
+
[style.animation-delay]="(i * 0.015) + 's'"
|
|
6084
6513
|
(mouseenter)="onPointHover($event, pt.raw, i)"
|
|
6514
|
+
(mousemove)="onPointHover($event, pt.raw, i)"
|
|
6085
6515
|
/>
|
|
6086
6516
|
}
|
|
6087
6517
|
|
|
@@ -6095,20 +6525,30 @@ class ScatterPlotComponent {
|
|
|
6095
6525
|
@if (tooltip(); as t) {
|
|
6096
6526
|
<div class="chart-tooltip" [style.left.px]="t.x" [style.top.px]="t.y">
|
|
6097
6527
|
@if (t.label) {
|
|
6098
|
-
<div class="
|
|
6528
|
+
<div class="tt-cat">{{ t.label }}</div>
|
|
6529
|
+
} @else {
|
|
6530
|
+
<div class="tt-cat">Point Data</div>
|
|
6099
6531
|
}
|
|
6100
|
-
<div class="
|
|
6101
|
-
|
|
6102
|
-
|
|
6103
|
-
}
|
|
6104
|
-
|
|
6105
|
-
|
|
6532
|
+
<div class="tt-row">
|
|
6533
|
+
<span class="tt-dot" [style.background]="t.color"></span>
|
|
6534
|
+
<span class="tt-name">Group</span>
|
|
6535
|
+
<span class="tt-val">{{ t.group || 'Default' }}</span>
|
|
6536
|
+
</div>
|
|
6537
|
+
<div class="tt-row">
|
|
6538
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
6539
|
+
<span class="tt-name">{{ xTitle() }}</span>
|
|
6540
|
+
<span class="tt-val">{{ fmtNum(ptX(t)) }}</span>
|
|
6541
|
+
</div>
|
|
6542
|
+
<div class="tt-row">
|
|
6543
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
6544
|
+
<span class="tt-name">{{ yTitle() }}</span>
|
|
6545
|
+
<span class="tt-val">{{ fmtNum(ptY(t)) }}</span>
|
|
6106
6546
|
</div>
|
|
6107
6547
|
</div>
|
|
6108
6548
|
}
|
|
6109
6549
|
</div>
|
|
6110
6550
|
</div>
|
|
6111
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-scatter-plot{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-scatter-plot.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.scatter-point{cursor:pointer;transition:r .
|
|
6551
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-scatter-plot{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-scatter-plot.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}@keyframes scatterPointPop{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:.85}}.scatter-point{cursor:pointer;transition:r .25s cubic-bezier(.16,1,.3,1),opacity .25s,filter .25s,stroke-width .2s;animation:scatterPointPop .5s cubic-bezier(.16,1,.3,1) both}.scatter-point.hovered{opacity:.95;filter:drop-shadow(0 0 6px var(--ngx-chart-hover-stroke, #4f46e5));stroke:#fff;stroke-width:2px}.crosshair-line{pointer-events:none;animation:fadeIn .15s ease-out forwards}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6112
6552
|
}
|
|
6113
6553
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: ScatterPlotComponent, decorators: [{
|
|
6114
6554
|
type: Component,
|
|
@@ -6191,18 +6631,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6191
6631
|
text-anchor="middle"
|
|
6192
6632
|
>{{ xTitle() }}</text>
|
|
6193
6633
|
|
|
6634
|
+
<!-- Active Crosshair -->
|
|
6635
|
+
@if (hoveredPointIndex() !== null) {
|
|
6636
|
+
@if (scaledPoints()[hoveredPointIndex()!]; as pt) {
|
|
6637
|
+
<line
|
|
6638
|
+
[attr.x1]="0"
|
|
6639
|
+
[attr.x2]="innerW()"
|
|
6640
|
+
[attr.y1]="pt.cy"
|
|
6641
|
+
[attr.y2]="pt.cy"
|
|
6642
|
+
stroke="rgba(79, 70, 229, 0.35)"
|
|
6643
|
+
stroke-width="1.2"
|
|
6644
|
+
stroke-dasharray="3,3"
|
|
6645
|
+
class="crosshair-line"
|
|
6646
|
+
/>
|
|
6647
|
+
<line
|
|
6648
|
+
[attr.x1]="pt.cx"
|
|
6649
|
+
[attr.x2]="pt.cx"
|
|
6650
|
+
[attr.y1]="0"
|
|
6651
|
+
[attr.y2]="innerH()"
|
|
6652
|
+
stroke="rgba(79, 70, 229, 0.35)"
|
|
6653
|
+
stroke-width="1.2"
|
|
6654
|
+
stroke-dasharray="3,3"
|
|
6655
|
+
class="crosshair-line"
|
|
6656
|
+
/>
|
|
6657
|
+
}
|
|
6658
|
+
}
|
|
6659
|
+
|
|
6194
6660
|
<!-- Render Data Points -->
|
|
6195
6661
|
@for (pt of scaledPoints(); track $index; let i = $index) {
|
|
6196
6662
|
<circle
|
|
6197
6663
|
[attr.cx]="pt.cx"
|
|
6198
6664
|
[attr.cy]="pt.cy"
|
|
6199
|
-
[attr.r]="pt.r"
|
|
6665
|
+
[attr.r]="hoveredPointIndex() === i ? pt.r + 3.5 : pt.r"
|
|
6200
6666
|
[attr.fill]="pt.color"
|
|
6201
6667
|
[attr.stroke]="'#ffffff'"
|
|
6202
6668
|
stroke-width="1.5"
|
|
6203
6669
|
class="scatter-point"
|
|
6204
6670
|
[class.hovered]="hoveredPointIndex() === i"
|
|
6671
|
+
[style.transform-origin]="pt.cx + 'px ' + pt.cy + 'px'"
|
|
6672
|
+
[style.animation-delay]="(i * 0.015) + 's'"
|
|
6205
6673
|
(mouseenter)="onPointHover($event, pt.raw, i)"
|
|
6674
|
+
(mousemove)="onPointHover($event, pt.raw, i)"
|
|
6206
6675
|
/>
|
|
6207
6676
|
}
|
|
6208
6677
|
|
|
@@ -6216,20 +6685,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6216
6685
|
@if (tooltip(); as t) {
|
|
6217
6686
|
<div class="chart-tooltip" [style.left.px]="t.x" [style.top.px]="t.y">
|
|
6218
6687
|
@if (t.label) {
|
|
6219
|
-
<div class="
|
|
6688
|
+
<div class="tt-cat">{{ t.label }}</div>
|
|
6689
|
+
} @else {
|
|
6690
|
+
<div class="tt-cat">Point Data</div>
|
|
6220
6691
|
}
|
|
6221
|
-
<div class="
|
|
6222
|
-
|
|
6223
|
-
|
|
6224
|
-
}
|
|
6225
|
-
|
|
6226
|
-
|
|
6692
|
+
<div class="tt-row">
|
|
6693
|
+
<span class="tt-dot" [style.background]="t.color"></span>
|
|
6694
|
+
<span class="tt-name">Group</span>
|
|
6695
|
+
<span class="tt-val">{{ t.group || 'Default' }}</span>
|
|
6696
|
+
</div>
|
|
6697
|
+
<div class="tt-row">
|
|
6698
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
6699
|
+
<span class="tt-name">{{ xTitle() }}</span>
|
|
6700
|
+
<span class="tt-val">{{ fmtNum(ptX(t)) }}</span>
|
|
6701
|
+
</div>
|
|
6702
|
+
<div class="tt-row">
|
|
6703
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
6704
|
+
<span class="tt-name">{{ yTitle() }}</span>
|
|
6705
|
+
<span class="tt-val">{{ fmtNum(ptY(t)) }}</span>
|
|
6227
6706
|
</div>
|
|
6228
6707
|
</div>
|
|
6229
6708
|
}
|
|
6230
6709
|
</div>
|
|
6231
6710
|
</div>
|
|
6232
|
-
`, styles: [":host{display:block;width:100%}.ngx-scatter-plot{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-scatter-plot.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}.scatter-point{cursor:pointer;transition:r .
|
|
6711
|
+
`, styles: [":host{display:block;width:100%}.ngx-scatter-plot{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);transition:background-color .3s}.ngx-scatter-plot.dark{background:#1e203073;border:1px solid rgba(255,255,255,.05);--ngx-chart-bg: transparent;--ngx-chart-grid: rgba(255, 255, 255, .06);--ngx-chart-axis: rgba(255, 255, 255, .12)}.chart-legend{display:flex;gap:16px;margin-bottom:16px;flex-wrap:wrap}.legend-item{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:500;color:#64748b}.dark .legend-item{color:#94a3b8}.legend-dot{width:10px;height:10px;border-radius:50%;display:inline-block}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.dark .axis-label{fill:#94a3b8}.axis-title{font-size:11px;font-weight:600;fill:#475569;letter-spacing:.5px}.dark .axis-title{fill:#cbd5e1}@keyframes scatterPointPop{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:.85}}.scatter-point{cursor:pointer;transition:r .25s cubic-bezier(.16,1,.3,1),opacity .25s,filter .25s,stroke-width .2s;animation:scatterPointPop .5s cubic-bezier(.16,1,.3,1) both}.scatter-point.hovered{opacity:.95;filter:drop-shadow(0 0 6px var(--ngx-chart-hover-stroke, #4f46e5));stroke:#fff;stroke-width:2px}.crosshair-line{pointer-events:none;animation:fadeIn .15s ease-out forwards}@keyframes fadeIn{0%{opacity:0}to{opacity:1}}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
6233
6712
|
}] });
|
|
6234
6713
|
|
|
6235
6714
|
class WaterfallChartComponent {
|
|
@@ -6319,8 +6798,10 @@ class WaterfallChartComponent {
|
|
|
6319
6798
|
const yEnd = this.yPos(item.end);
|
|
6320
6799
|
const y = Math.min(yStart, yEnd);
|
|
6321
6800
|
const rectH = Math.max(2, Math.abs(yStart - yEnd));
|
|
6801
|
+
let fill = 'url(#waterfall-tot)';
|
|
6322
6802
|
let color = this.totalColor();
|
|
6323
6803
|
if (!item.isTotal) {
|
|
6804
|
+
fill = item.value >= 0 ? 'url(#waterfall-pos)' : 'url(#waterfall-neg)';
|
|
6324
6805
|
color = item.value >= 0 ? this.positiveColor() : this.negativeColor();
|
|
6325
6806
|
}
|
|
6326
6807
|
// Connect line is drawn from the end value of this item
|
|
@@ -6331,6 +6812,7 @@ class WaterfallChartComponent {
|
|
|
6331
6812
|
rectH,
|
|
6332
6813
|
width,
|
|
6333
6814
|
color,
|
|
6815
|
+
fill,
|
|
6334
6816
|
connectY,
|
|
6335
6817
|
label: item.label,
|
|
6336
6818
|
value: item.value,
|
|
@@ -6366,6 +6848,20 @@ class WaterfallChartComponent {
|
|
|
6366
6848
|
[attr.height]="height()"
|
|
6367
6849
|
class="chart-svg"
|
|
6368
6850
|
>
|
|
6851
|
+
<defs>
|
|
6852
|
+
<linearGradient id="waterfall-pos" x1="0" y1="0" x2="0" y2="1">
|
|
6853
|
+
<stop offset="0%" [attr.stop-color]="positiveColor()" stop-opacity="1"/>
|
|
6854
|
+
<stop offset="100%" [attr.stop-color]="positiveColor()" stop-opacity="0.75"/>
|
|
6855
|
+
</linearGradient>
|
|
6856
|
+
<linearGradient id="waterfall-neg" x1="0" y1="0" x2="0" y2="1">
|
|
6857
|
+
<stop offset="0%" [attr.stop-color]="negativeColor()" stop-opacity="1"/>
|
|
6858
|
+
<stop offset="100%" [attr.stop-color]="negativeColor()" stop-opacity="0.75"/>
|
|
6859
|
+
</linearGradient>
|
|
6860
|
+
<linearGradient id="waterfall-tot" x1="0" y1="0" x2="0" y2="1">
|
|
6861
|
+
<stop offset="0%" [attr.stop-color]="totalColor()" stop-opacity="1"/>
|
|
6862
|
+
<stop offset="100%" [attr.stop-color]="totalColor()" stop-opacity="0.75"/>
|
|
6863
|
+
</linearGradient>
|
|
6864
|
+
</defs>
|
|
6369
6865
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
6370
6866
|
<!-- Grid Lines (Horizontal) -->
|
|
6371
6867
|
@if (showGrid()) {
|
|
@@ -6423,8 +6919,8 @@ class WaterfallChartComponent {
|
|
|
6423
6919
|
[attr.y]="bar.y"
|
|
6424
6920
|
[attr.width]="bar.width"
|
|
6425
6921
|
[attr.height]="bar.rectH"
|
|
6426
|
-
[attr.fill]="bar.
|
|
6427
|
-
[attr.rx]="
|
|
6922
|
+
[attr.fill]="bar.fill"
|
|
6923
|
+
[attr.rx]="4"
|
|
6428
6924
|
class="waterfall-bar"
|
|
6429
6925
|
[class.hovered]="hoveredIndex() === i"
|
|
6430
6926
|
(mouseenter)="onBarHover($event, bar, i)"
|
|
@@ -6459,7 +6955,7 @@ class WaterfallChartComponent {
|
|
|
6459
6955
|
}
|
|
6460
6956
|
</div>
|
|
6461
6957
|
</div>
|
|
6462
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-waterfall-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.waterfall-bar{cursor:pointer;transition:opacity .2s,filter .2s}.waterfall-bar.hovered{opacity:.
|
|
6958
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-waterfall-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.waterfall-bar{cursor:pointer;transition:opacity .2s,filter .2s,stroke-width .2s;stroke:#fff;stroke-width:.5}.waterfall-bar.hovered{opacity:.95;stroke-width:1.5;filter:brightness(1.04) drop-shadow(0 4px 8px rgba(0,0,0,.12))}.bar-value-label{font-size:9px;fill:#fff;font-weight:600;pointer-events:none}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tooltip-header{font-weight:700;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;margin-bottom:8px;color:#38bdf8;font-size:12.5px}.tooltip-body{display:flex;flex-direction:column;gap:5px}.tooltip-val{color:#f8fafccc}.tooltip-val strong{color:#f8fafc;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6463
6959
|
}
|
|
6464
6960
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: WaterfallChartComponent, decorators: [{
|
|
6465
6961
|
type: Component,
|
|
@@ -6471,6 +6967,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6471
6967
|
[attr.height]="height()"
|
|
6472
6968
|
class="chart-svg"
|
|
6473
6969
|
>
|
|
6970
|
+
<defs>
|
|
6971
|
+
<linearGradient id="waterfall-pos" x1="0" y1="0" x2="0" y2="1">
|
|
6972
|
+
<stop offset="0%" [attr.stop-color]="positiveColor()" stop-opacity="1"/>
|
|
6973
|
+
<stop offset="100%" [attr.stop-color]="positiveColor()" stop-opacity="0.75"/>
|
|
6974
|
+
</linearGradient>
|
|
6975
|
+
<linearGradient id="waterfall-neg" x1="0" y1="0" x2="0" y2="1">
|
|
6976
|
+
<stop offset="0%" [attr.stop-color]="negativeColor()" stop-opacity="1"/>
|
|
6977
|
+
<stop offset="100%" [attr.stop-color]="negativeColor()" stop-opacity="0.75"/>
|
|
6978
|
+
</linearGradient>
|
|
6979
|
+
<linearGradient id="waterfall-tot" x1="0" y1="0" x2="0" y2="1">
|
|
6980
|
+
<stop offset="0%" [attr.stop-color]="totalColor()" stop-opacity="1"/>
|
|
6981
|
+
<stop offset="100%" [attr.stop-color]="totalColor()" stop-opacity="0.75"/>
|
|
6982
|
+
</linearGradient>
|
|
6983
|
+
</defs>
|
|
6474
6984
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
6475
6985
|
<!-- Grid Lines (Horizontal) -->
|
|
6476
6986
|
@if (showGrid()) {
|
|
@@ -6528,8 +7038,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6528
7038
|
[attr.y]="bar.y"
|
|
6529
7039
|
[attr.width]="bar.width"
|
|
6530
7040
|
[attr.height]="bar.rectH"
|
|
6531
|
-
[attr.fill]="bar.
|
|
6532
|
-
[attr.rx]="
|
|
7041
|
+
[attr.fill]="bar.fill"
|
|
7042
|
+
[attr.rx]="4"
|
|
6533
7043
|
class="waterfall-bar"
|
|
6534
7044
|
[class.hovered]="hoveredIndex() === i"
|
|
6535
7045
|
(mouseenter)="onBarHover($event, bar, i)"
|
|
@@ -6564,7 +7074,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6564
7074
|
}
|
|
6565
7075
|
</div>
|
|
6566
7076
|
</div>
|
|
6567
|
-
`, styles: [":host{display:block;width:100%}.ngx-waterfall-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.waterfall-bar{cursor:pointer;transition:opacity .2s,filter .2s}.waterfall-bar.hovered{opacity:.
|
|
7077
|
+
`, styles: [":host{display:block;width:100%}.ngx-waterfall-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.waterfall-bar{cursor:pointer;transition:opacity .2s,filter .2s,stroke-width .2s;stroke:#fff;stroke-width:.5}.waterfall-bar.hovered{opacity:.95;stroke-width:1.5;filter:brightness(1.04) drop-shadow(0 4px 8px rgba(0,0,0,.12))}.bar-value-label{font-size:9px;fill:#fff;font-weight:600;pointer-events:none}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-8px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:150px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .12s cubic-bezier(.16,1,.3,1),top .12s cubic-bezier(.16,1,.3,1);font-family:inherit}.tooltip-header{font-weight:700;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:6px;margin-bottom:8px;color:#38bdf8;font-size:12.5px}.tooltip-body{display:flex;flex-direction:column;gap:5px}.tooltip-val{color:#f8fafccc}.tooltip-val strong{color:#f8fafc;font-family:monospace}\n"] }]
|
|
6568
7078
|
}] });
|
|
6569
7079
|
|
|
6570
7080
|
class BoxPlotChartComponent {
|
|
@@ -6692,7 +7202,7 @@ class BoxPlotChartComponent {
|
|
|
6692
7202
|
this.tooltip.set({
|
|
6693
7203
|
x: tooltipX,
|
|
6694
7204
|
y: tooltipY,
|
|
6695
|
-
label: `${label}
|
|
7205
|
+
label: `${label} outlier`,
|
|
6696
7206
|
min: 0,
|
|
6697
7207
|
q1: 0,
|
|
6698
7208
|
median: 0,
|
|
@@ -6712,6 +7222,13 @@ class BoxPlotChartComponent {
|
|
|
6712
7222
|
[attr.height]="height()"
|
|
6713
7223
|
class="chart-svg"
|
|
6714
7224
|
>
|
|
7225
|
+
<defs>
|
|
7226
|
+
<linearGradient id="boxplot-grad" x1="0" y1="0" x2="0" y2="1">
|
|
7227
|
+
<stop offset="0%" [attr.stop-color]="color()" stop-opacity="0.32" />
|
|
7228
|
+
<stop offset="100%" [attr.stop-color]="color()" stop-opacity="0.08" />
|
|
7229
|
+
</linearGradient>
|
|
7230
|
+
</defs>
|
|
7231
|
+
|
|
6715
7232
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
6716
7233
|
<!-- Grid Lines (Horizontal) -->
|
|
6717
7234
|
@if (showGrid()) {
|
|
@@ -6757,6 +7274,7 @@ class BoxPlotChartComponent {
|
|
|
6757
7274
|
[attr.y2]="box.yMax"
|
|
6758
7275
|
[attr.stroke]="color()"
|
|
6759
7276
|
stroke-width="1.5"
|
|
7277
|
+
class="whisker-line"
|
|
6760
7278
|
/>
|
|
6761
7279
|
|
|
6762
7280
|
<!-- Whisker Caps (Horizontal Lines) -->
|
|
@@ -6767,6 +7285,7 @@ class BoxPlotChartComponent {
|
|
|
6767
7285
|
[attr.y2]="box.yMin"
|
|
6768
7286
|
[attr.stroke]="color()"
|
|
6769
7287
|
stroke-width="1.5"
|
|
7288
|
+
class="whisker-line"
|
|
6770
7289
|
/>
|
|
6771
7290
|
<line
|
|
6772
7291
|
[attr.x1]="box.centerX - capWidth() / 2"
|
|
@@ -6775,6 +7294,7 @@ class BoxPlotChartComponent {
|
|
|
6775
7294
|
[attr.y2]="box.yMax"
|
|
6776
7295
|
[attr.stroke]="color()"
|
|
6777
7296
|
stroke-width="1.5"
|
|
7297
|
+
class="whisker-line"
|
|
6778
7298
|
/>
|
|
6779
7299
|
|
|
6780
7300
|
<!-- Interquartile Box -->
|
|
@@ -6783,13 +7303,16 @@ class BoxPlotChartComponent {
|
|
|
6783
7303
|
[attr.y]="box.yQ3"
|
|
6784
7304
|
[attr.width]="box.width"
|
|
6785
7305
|
[attr.height]="box.boxHeight"
|
|
6786
|
-
|
|
7306
|
+
fill="url(#boxplot-grad)"
|
|
6787
7307
|
[attr.stroke]="color()"
|
|
6788
7308
|
stroke-width="2"
|
|
6789
|
-
[attr.rx]="
|
|
7309
|
+
[attr.rx]="4"
|
|
6790
7310
|
class="boxplot-rect"
|
|
6791
7311
|
[class.hovered]="hoveredIndex() === i"
|
|
7312
|
+
[style.transform-origin]="box.centerX + 'px ' + box.yMedian + 'px'"
|
|
7313
|
+
[style.animation-delay]="i * 0.05 + 's'"
|
|
6792
7314
|
(mouseenter)="onBoxHover($event, box.raw, i)"
|
|
7315
|
+
(mousemove)="onBoxHover($event, box.raw, i)"
|
|
6793
7316
|
/>
|
|
6794
7317
|
|
|
6795
7318
|
<!-- Median line -->
|
|
@@ -6800,6 +7323,7 @@ class BoxPlotChartComponent {
|
|
|
6800
7323
|
[attr.y2]="box.yMedian"
|
|
6801
7324
|
[attr.stroke]="color()"
|
|
6802
7325
|
stroke-width="2.5"
|
|
7326
|
+
class="median-line"
|
|
6803
7327
|
/>
|
|
6804
7328
|
|
|
6805
7329
|
<!-- Outliers (plotted as circles) -->
|
|
@@ -6810,9 +7334,11 @@ class BoxPlotChartComponent {
|
|
|
6810
7334
|
[attr.r]="3.5"
|
|
6811
7335
|
[attr.fill]="outlierColor()"
|
|
6812
7336
|
[attr.stroke]="'#ffffff'"
|
|
6813
|
-
stroke-width="1"
|
|
7337
|
+
stroke-width="1.2"
|
|
6814
7338
|
class="outlier-dot"
|
|
7339
|
+
[style.transform-origin]="box.centerX + 'px ' + outlier.y + 'px'"
|
|
6815
7340
|
(mouseenter)="onOutlierHover($event, box.raw.label, outlier.value)"
|
|
7341
|
+
(mousemove)="onOutlierHover($event, box.raw.label, outlier.value)"
|
|
6816
7342
|
/>
|
|
6817
7343
|
}
|
|
6818
7344
|
}
|
|
@@ -6829,20 +7355,38 @@ class BoxPlotChartComponent {
|
|
|
6829
7355
|
<div class="tooltip-header">{{ t.label }}</div>
|
|
6830
7356
|
<div class="tooltip-body">
|
|
6831
7357
|
@if (t.isOutlier) {
|
|
6832
|
-
<div class="tooltip-val">
|
|
7358
|
+
<div class="tooltip-val">
|
|
7359
|
+
<span>Outlier:</span>
|
|
7360
|
+
<strong>{{ fmtNum(t.outlierVal!) }}</strong>
|
|
7361
|
+
</div>
|
|
6833
7362
|
} @else {
|
|
6834
|
-
<div class="tooltip-val">
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
<div class="tooltip-val">
|
|
7363
|
+
<div class="tooltip-val">
|
|
7364
|
+
<span>Maximum:</span>
|
|
7365
|
+
<strong>{{ fmtNum(t.max) }}</strong>
|
|
7366
|
+
</div>
|
|
7367
|
+
<div class="tooltip-val">
|
|
7368
|
+
<span>Third Quartile (Q3):</span>
|
|
7369
|
+
<strong>{{ fmtNum(t.q3) }}</strong>
|
|
7370
|
+
</div>
|
|
7371
|
+
<div class="tooltip-val" style="color: #38bdf8;">
|
|
7372
|
+
<span>Median:</span>
|
|
7373
|
+
<strong>{{ fmtNum(t.median) }}</strong>
|
|
7374
|
+
</div>
|
|
7375
|
+
<div class="tooltip-val">
|
|
7376
|
+
<span>First Quartile (Q1):</span>
|
|
7377
|
+
<strong>{{ fmtNum(t.q1) }}</strong>
|
|
7378
|
+
</div>
|
|
7379
|
+
<div class="tooltip-val">
|
|
7380
|
+
<span>Minimum:</span>
|
|
7381
|
+
<strong>{{ fmtNum(t.min) }}</strong>
|
|
7382
|
+
</div>
|
|
6839
7383
|
}
|
|
6840
7384
|
</div>
|
|
6841
7385
|
</div>
|
|
6842
7386
|
}
|
|
6843
7387
|
</div>
|
|
6844
7388
|
</div>
|
|
6845
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-box-plot-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.boxplot-rect{cursor:pointer;transition:opacity .2s,fill .2s,filter .2s}.boxplot-rect.hovered{
|
|
7389
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-box-plot-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}@keyframes boxPlotGrow{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.boxplot-rect{cursor:pointer;transition:opacity .2s,fill .2s,stroke-width .2s,filter .2s;animation:boxPlotGrow .6s cubic-bezier(.16,1,.3,1) both}.boxplot-rect:hover,.boxplot-rect.hovered{filter:brightness(1.05) drop-shadow(0 4px 8px rgba(0,0,0,.15));stroke-width:2.5px}@keyframes whiskerFade{0%{opacity:0}to{opacity:1}}.whisker-line,.median-line{animation:whiskerFade .6s ease-out .2s both}@keyframes outlierPop{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.outlier-dot{cursor:crosshair;transition:r .2s cubic-bezier(.16,1,.3,1),fill .2s;animation:outlierPop .4s cubic-bezier(.16,1,.3,1) .5s both}.outlier-dot:hover{r:5.5px;fill:#ef4444}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tooltip-header{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tooltip-body{display:flex;flex-direction:column;gap:4px}.tooltip-val{display:flex;justify-content:space-between;gap:16px;color:#f8fafcd9}.tooltip-val strong{color:#f8fafc;font-family:monospace;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
6846
7390
|
}
|
|
6847
7391
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: BoxPlotChartComponent, decorators: [{
|
|
6848
7392
|
type: Component,
|
|
@@ -6854,6 +7398,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6854
7398
|
[attr.height]="height()"
|
|
6855
7399
|
class="chart-svg"
|
|
6856
7400
|
>
|
|
7401
|
+
<defs>
|
|
7402
|
+
<linearGradient id="boxplot-grad" x1="0" y1="0" x2="0" y2="1">
|
|
7403
|
+
<stop offset="0%" [attr.stop-color]="color()" stop-opacity="0.32" />
|
|
7404
|
+
<stop offset="100%" [attr.stop-color]="color()" stop-opacity="0.08" />
|
|
7405
|
+
</linearGradient>
|
|
7406
|
+
</defs>
|
|
7407
|
+
|
|
6857
7408
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
6858
7409
|
<!-- Grid Lines (Horizontal) -->
|
|
6859
7410
|
@if (showGrid()) {
|
|
@@ -6899,6 +7450,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6899
7450
|
[attr.y2]="box.yMax"
|
|
6900
7451
|
[attr.stroke]="color()"
|
|
6901
7452
|
stroke-width="1.5"
|
|
7453
|
+
class="whisker-line"
|
|
6902
7454
|
/>
|
|
6903
7455
|
|
|
6904
7456
|
<!-- Whisker Caps (Horizontal Lines) -->
|
|
@@ -6909,6 +7461,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6909
7461
|
[attr.y2]="box.yMin"
|
|
6910
7462
|
[attr.stroke]="color()"
|
|
6911
7463
|
stroke-width="1.5"
|
|
7464
|
+
class="whisker-line"
|
|
6912
7465
|
/>
|
|
6913
7466
|
<line
|
|
6914
7467
|
[attr.x1]="box.centerX - capWidth() / 2"
|
|
@@ -6917,6 +7470,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6917
7470
|
[attr.y2]="box.yMax"
|
|
6918
7471
|
[attr.stroke]="color()"
|
|
6919
7472
|
stroke-width="1.5"
|
|
7473
|
+
class="whisker-line"
|
|
6920
7474
|
/>
|
|
6921
7475
|
|
|
6922
7476
|
<!-- Interquartile Box -->
|
|
@@ -6925,13 +7479,16 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6925
7479
|
[attr.y]="box.yQ3"
|
|
6926
7480
|
[attr.width]="box.width"
|
|
6927
7481
|
[attr.height]="box.boxHeight"
|
|
6928
|
-
|
|
7482
|
+
fill="url(#boxplot-grad)"
|
|
6929
7483
|
[attr.stroke]="color()"
|
|
6930
7484
|
stroke-width="2"
|
|
6931
|
-
[attr.rx]="
|
|
7485
|
+
[attr.rx]="4"
|
|
6932
7486
|
class="boxplot-rect"
|
|
6933
7487
|
[class.hovered]="hoveredIndex() === i"
|
|
7488
|
+
[style.transform-origin]="box.centerX + 'px ' + box.yMedian + 'px'"
|
|
7489
|
+
[style.animation-delay]="i * 0.05 + 's'"
|
|
6934
7490
|
(mouseenter)="onBoxHover($event, box.raw, i)"
|
|
7491
|
+
(mousemove)="onBoxHover($event, box.raw, i)"
|
|
6935
7492
|
/>
|
|
6936
7493
|
|
|
6937
7494
|
<!-- Median line -->
|
|
@@ -6942,6 +7499,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6942
7499
|
[attr.y2]="box.yMedian"
|
|
6943
7500
|
[attr.stroke]="color()"
|
|
6944
7501
|
stroke-width="2.5"
|
|
7502
|
+
class="median-line"
|
|
6945
7503
|
/>
|
|
6946
7504
|
|
|
6947
7505
|
<!-- Outliers (plotted as circles) -->
|
|
@@ -6952,9 +7510,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6952
7510
|
[attr.r]="3.5"
|
|
6953
7511
|
[attr.fill]="outlierColor()"
|
|
6954
7512
|
[attr.stroke]="'#ffffff'"
|
|
6955
|
-
stroke-width="1"
|
|
7513
|
+
stroke-width="1.2"
|
|
6956
7514
|
class="outlier-dot"
|
|
7515
|
+
[style.transform-origin]="box.centerX + 'px ' + outlier.y + 'px'"
|
|
6957
7516
|
(mouseenter)="onOutlierHover($event, box.raw.label, outlier.value)"
|
|
7517
|
+
(mousemove)="onOutlierHover($event, box.raw.label, outlier.value)"
|
|
6958
7518
|
/>
|
|
6959
7519
|
}
|
|
6960
7520
|
}
|
|
@@ -6971,20 +7531,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
6971
7531
|
<div class="tooltip-header">{{ t.label }}</div>
|
|
6972
7532
|
<div class="tooltip-body">
|
|
6973
7533
|
@if (t.isOutlier) {
|
|
6974
|
-
<div class="tooltip-val">
|
|
7534
|
+
<div class="tooltip-val">
|
|
7535
|
+
<span>Outlier:</span>
|
|
7536
|
+
<strong>{{ fmtNum(t.outlierVal!) }}</strong>
|
|
7537
|
+
</div>
|
|
6975
7538
|
} @else {
|
|
6976
|
-
<div class="tooltip-val">
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
<div class="tooltip-val">
|
|
7539
|
+
<div class="tooltip-val">
|
|
7540
|
+
<span>Maximum:</span>
|
|
7541
|
+
<strong>{{ fmtNum(t.max) }}</strong>
|
|
7542
|
+
</div>
|
|
7543
|
+
<div class="tooltip-val">
|
|
7544
|
+
<span>Third Quartile (Q3):</span>
|
|
7545
|
+
<strong>{{ fmtNum(t.q3) }}</strong>
|
|
7546
|
+
</div>
|
|
7547
|
+
<div class="tooltip-val" style="color: #38bdf8;">
|
|
7548
|
+
<span>Median:</span>
|
|
7549
|
+
<strong>{{ fmtNum(t.median) }}</strong>
|
|
7550
|
+
</div>
|
|
7551
|
+
<div class="tooltip-val">
|
|
7552
|
+
<span>First Quartile (Q1):</span>
|
|
7553
|
+
<strong>{{ fmtNum(t.q1) }}</strong>
|
|
7554
|
+
</div>
|
|
7555
|
+
<div class="tooltip-val">
|
|
7556
|
+
<span>Minimum:</span>
|
|
7557
|
+
<strong>{{ fmtNum(t.min) }}</strong>
|
|
7558
|
+
</div>
|
|
6981
7559
|
}
|
|
6982
7560
|
</div>
|
|
6983
7561
|
</div>
|
|
6984
7562
|
}
|
|
6985
7563
|
</div>
|
|
6986
7564
|
</div>
|
|
6987
|
-
`, styles: [":host{display:block;width:100%}.ngx-box-plot-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.boxplot-rect{cursor:pointer;transition:opacity .2s,fill .2s,filter .2s}.boxplot-rect.hovered{
|
|
7565
|
+
`, styles: [":host{display:block;width:100%}.ngx-box-plot-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}@keyframes boxPlotGrow{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.boxplot-rect{cursor:pointer;transition:opacity .2s,fill .2s,stroke-width .2s,filter .2s;animation:boxPlotGrow .6s cubic-bezier(.16,1,.3,1) both}.boxplot-rect:hover,.boxplot-rect.hovered{filter:brightness(1.05) drop-shadow(0 4px 8px rgba(0,0,0,.15));stroke-width:2.5px}@keyframes whiskerFade{0%{opacity:0}to{opacity:1}}.whisker-line,.median-line{animation:whiskerFade .6s ease-out .2s both}@keyframes outlierPop{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}.outlier-dot{cursor:crosshair;transition:r .2s cubic-bezier(.16,1,.3,1),fill .2s;animation:outlierPop .4s cubic-bezier(.16,1,.3,1) .5s both}.outlier-dot:hover{r:5.5px;fill:#ef4444}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tooltip-header{font-weight:700;margin-bottom:6px;font-size:12px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tooltip-body{display:flex;flex-direction:column;gap:4px}.tooltip-val{display:flex;justify-content:space-between;gap:16px;color:#f8fafcd9}.tooltip-val strong{color:#f8fafc;font-family:monospace;font-weight:700}\n"] }]
|
|
6988
7566
|
}] });
|
|
6989
7567
|
|
|
6990
7568
|
class RadialBarChartComponent {
|
|
@@ -6997,8 +7575,14 @@ class RadialBarChartComponent {
|
|
|
6997
7575
|
colors = input(CHART_COLORS);
|
|
6998
7576
|
hoveredIndex = signal(null);
|
|
6999
7577
|
tooltip = signal(null);
|
|
7578
|
+
tooltipX = signal(0);
|
|
7579
|
+
tooltipY = signal(0);
|
|
7580
|
+
animateState = signal(false);
|
|
7000
7581
|
size = computed(() => this.height());
|
|
7001
7582
|
center = computed(() => this.size() / 2);
|
|
7583
|
+
constructor() {
|
|
7584
|
+
setTimeout(() => this.animateState.set(true), 50);
|
|
7585
|
+
}
|
|
7002
7586
|
// Ring properties
|
|
7003
7587
|
computedRings = computed(() => {
|
|
7004
7588
|
const raw = this.data();
|
|
@@ -7024,6 +7608,7 @@ class RadialBarChartComponent {
|
|
|
7024
7608
|
pct,
|
|
7025
7609
|
color,
|
|
7026
7610
|
dashArray,
|
|
7611
|
+
circumference: C,
|
|
7027
7612
|
label: item.label,
|
|
7028
7613
|
value: item.value,
|
|
7029
7614
|
max: item.max,
|
|
@@ -7039,13 +7624,30 @@ class RadialBarChartComponent {
|
|
|
7039
7624
|
const sum = raw.reduce((acc, curr) => acc + (curr.value / curr.max), 0);
|
|
7040
7625
|
return Math.round((sum / raw.length) * 100);
|
|
7041
7626
|
});
|
|
7042
|
-
onRingHover(
|
|
7627
|
+
onRingHover(item, index) {
|
|
7043
7628
|
this.hoveredIndex.set(index);
|
|
7629
|
+
const ring = this.computedRings()[index];
|
|
7630
|
+
if (ring) {
|
|
7631
|
+
this.tooltip.set(ring);
|
|
7632
|
+
}
|
|
7633
|
+
}
|
|
7634
|
+
onRingMouseMove(event) {
|
|
7635
|
+
const el = event.currentTarget;
|
|
7636
|
+
const container = el.closest('.ngx-radial-bar-chart');
|
|
7637
|
+
if (container) {
|
|
7638
|
+
const rect = container.getBoundingClientRect();
|
|
7639
|
+
this.tooltipX.set(event.clientX - rect.left);
|
|
7640
|
+
this.tooltipY.set(event.clientY - rect.top);
|
|
7641
|
+
}
|
|
7642
|
+
}
|
|
7643
|
+
onMouseLeave() {
|
|
7644
|
+
this.hoveredIndex.set(null);
|
|
7645
|
+
this.tooltip.set(null);
|
|
7044
7646
|
}
|
|
7045
7647
|
fmtNum = fmtNum;
|
|
7046
7648
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadialBarChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
7047
7649
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.20", type: RadialBarChartComponent, isStandalone: true, selector: "ngx-radial-bar-chart", inputs: { data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, showLegend: { classPropertyName: "showLegend", publicName: "showLegend", isSignal: true, isRequired: false, transformFunction: null }, strokeWidth: { classPropertyName: "strokeWidth", publicName: "strokeWidth", isSignal: true, isRequired: false, transformFunction: null }, ringGap: { classPropertyName: "ringGap", publicName: "ringGap", isSignal: true, isRequired: false, transformFunction: null }, colors: { classPropertyName: "colors", publicName: "colors", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
7048
|
-
<div class="ngx-radial-bar-chart" (mouseleave)="
|
|
7650
|
+
<div class="ngx-radial-bar-chart" (mouseleave)="onMouseLeave()">
|
|
7049
7651
|
<div class="chart-layout">
|
|
7050
7652
|
<!-- SVG Concentric Circles -->
|
|
7051
7653
|
<div class="radial-visual">
|
|
@@ -7055,6 +7657,14 @@ class RadialBarChartComponent {
|
|
|
7055
7657
|
[attr.viewBox]="'0 0 ' + size() + ' ' + size()"
|
|
7056
7658
|
class="radial-svg"
|
|
7057
7659
|
>
|
|
7660
|
+
<defs>
|
|
7661
|
+
@for (ring of computedRings(); track $index; let i = $index) {
|
|
7662
|
+
<linearGradient [id]="'radial-grad-' + i" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
7663
|
+
<stop offset="0%" [attr.stop-color]="ring.color" />
|
|
7664
|
+
<stop offset="100%" [attr.stop-color]="ring.color" stop-opacity="0.6" />
|
|
7665
|
+
</linearGradient>
|
|
7666
|
+
}
|
|
7667
|
+
</defs>
|
|
7058
7668
|
<!-- Rotate group by -90deg so rings start at 12 o'clock -->
|
|
7059
7669
|
<g [attr.transform]="'translate(' + center() + ',' + center() + ') rotate(-90)'">
|
|
7060
7670
|
@for (ring of computedRings(); track $index; let i = $index) {
|
|
@@ -7065,7 +7675,7 @@ class RadialBarChartComponent {
|
|
|
7065
7675
|
[attr.r]="ring.r"
|
|
7066
7676
|
fill="none"
|
|
7067
7677
|
[attr.stroke]="ring.color"
|
|
7068
|
-
stroke-opacity="0.
|
|
7678
|
+
stroke-opacity="0.08"
|
|
7069
7679
|
[attr.stroke-width]="strokeWidth()"
|
|
7070
7680
|
/>
|
|
7071
7681
|
|
|
@@ -7075,14 +7685,15 @@ class RadialBarChartComponent {
|
|
|
7075
7685
|
cy="0"
|
|
7076
7686
|
[attr.r]="ring.r"
|
|
7077
7687
|
fill="none"
|
|
7078
|
-
[attr.stroke]="
|
|
7079
|
-
[attr.stroke-width]="strokeWidth()"
|
|
7688
|
+
[attr.stroke]="'url(#radial-grad-' + i + ')'"
|
|
7689
|
+
[attr.stroke-width]="hoveredIndex() === i ? strokeWidth() + 3 : strokeWidth()"
|
|
7080
7690
|
[attr.stroke-dasharray]="ring.dashArray"
|
|
7081
|
-
[attr.stroke-dashoffset]="0"
|
|
7691
|
+
[attr.stroke-dashoffset]="animateState() ? 0 : ring.circumference"
|
|
7082
7692
|
stroke-linecap="round"
|
|
7083
7693
|
class="progress-ring"
|
|
7084
7694
|
[class.hovered]="hoveredIndex() === i"
|
|
7085
|
-
(mouseenter)="onRingHover(
|
|
7695
|
+
(mouseenter)="onRingHover(ring.raw, i)"
|
|
7696
|
+
(mousemove)="onRingMouseMove($event)"
|
|
7086
7697
|
/>
|
|
7087
7698
|
}
|
|
7088
7699
|
</g>
|
|
@@ -7130,13 +7741,34 @@ class RadialBarChartComponent {
|
|
|
7130
7741
|
</div>
|
|
7131
7742
|
}
|
|
7132
7743
|
</div>
|
|
7744
|
+
|
|
7745
|
+
<!-- Glassmorphic Tooltip -->
|
|
7746
|
+
@if (tooltip() && hoveredIndex() !== null) {
|
|
7747
|
+
<div
|
|
7748
|
+
class="chart-tooltip"
|
|
7749
|
+
[style.left.px]="tooltipX()"
|
|
7750
|
+
[style.top.px]="tooltipY()"
|
|
7751
|
+
>
|
|
7752
|
+
<div class="tt-cat">{{ tooltip().label }}</div>
|
|
7753
|
+
<div class="tt-row">
|
|
7754
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
7755
|
+
<span class="tt-name">Progress</span>
|
|
7756
|
+
<span class="tt-val">{{ tooltip().pct }}%</span>
|
|
7757
|
+
</div>
|
|
7758
|
+
<div class="tt-row">
|
|
7759
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
7760
|
+
<span class="tt-name">Value</span>
|
|
7761
|
+
<span class="tt-val">{{ fmtNum(tooltip().value) }} / {{ fmtNum(tooltip().max) }}</span>
|
|
7762
|
+
</div>
|
|
7763
|
+
</div>
|
|
7764
|
+
}
|
|
7133
7765
|
</div>
|
|
7134
|
-
`, isInline: true, styles: [":host{display:block}.ngx-radial-bar-chart{background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-layout{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.radial-visual{position:relative;display:flex;align-items:center;justify-content:center}.radial-svg{display:block}.progress-ring{cursor:pointer;transition:stroke-width .2s,filter .
|
|
7766
|
+
`, isInline: true, styles: [":host{display:block}.ngx-radial-bar-chart{background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);position:relative}.chart-layout{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.radial-visual{position:relative;display:flex;align-items:center;justify-content:center}.radial-svg{display:block}.progress-ring{cursor:pointer;transition:stroke-width .3s cubic-bezier(.16,1,.3,1),stroke-dashoffset 1.2s cubic-bezier(.16,1,.3,1),filter .3s ease,opacity .2s}.progress-ring.hovered{filter:drop-shadow(0 0 6px rgba(0,0,0,.15))}.center-content{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;text-align:center}.center-label{font-size:11px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.5px}.center-value{font-size:24px;font-weight:800;color:#1e293b;line-height:1.1;margin:2px 0}.center-sublabel{font-size:10px;color:#94a3b8}.radial-legend{display:flex;flex-direction:column;gap:6px;min-width:150px}.legend-item{display:flex;align-items:center;gap:10px;padding:6px 12px;border-radius:8px;border:1px solid transparent;transition:all .2s;cursor:pointer}.legend-item:hover,.legend-item.active{background:var(--ngx-chart-grid, #f8fafc);border-color:var(--ngx-chart-grid, #e2e8f0)}.legend-color-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-content{flex:1;display:flex;justify-content:space-between;align-items:center;gap:12px}.legend-title{font-size:12px;font-weight:600;color:#475569}.metric-value{font-size:12px;font-weight:700;color:#1e293b}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:160px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7135
7767
|
}
|
|
7136
7768
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: RadialBarChartComponent, decorators: [{
|
|
7137
7769
|
type: Component,
|
|
7138
7770
|
args: [{ selector: 'ngx-radial-bar-chart', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: `
|
|
7139
|
-
<div class="ngx-radial-bar-chart" (mouseleave)="
|
|
7771
|
+
<div class="ngx-radial-bar-chart" (mouseleave)="onMouseLeave()">
|
|
7140
7772
|
<div class="chart-layout">
|
|
7141
7773
|
<!-- SVG Concentric Circles -->
|
|
7142
7774
|
<div class="radial-visual">
|
|
@@ -7146,6 +7778,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7146
7778
|
[attr.viewBox]="'0 0 ' + size() + ' ' + size()"
|
|
7147
7779
|
class="radial-svg"
|
|
7148
7780
|
>
|
|
7781
|
+
<defs>
|
|
7782
|
+
@for (ring of computedRings(); track $index; let i = $index) {
|
|
7783
|
+
<linearGradient [id]="'radial-grad-' + i" x1="0%" y1="0%" x2="100%" y2="100%">
|
|
7784
|
+
<stop offset="0%" [attr.stop-color]="ring.color" />
|
|
7785
|
+
<stop offset="100%" [attr.stop-color]="ring.color" stop-opacity="0.6" />
|
|
7786
|
+
</linearGradient>
|
|
7787
|
+
}
|
|
7788
|
+
</defs>
|
|
7149
7789
|
<!-- Rotate group by -90deg so rings start at 12 o'clock -->
|
|
7150
7790
|
<g [attr.transform]="'translate(' + center() + ',' + center() + ') rotate(-90)'">
|
|
7151
7791
|
@for (ring of computedRings(); track $index; let i = $index) {
|
|
@@ -7156,7 +7796,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7156
7796
|
[attr.r]="ring.r"
|
|
7157
7797
|
fill="none"
|
|
7158
7798
|
[attr.stroke]="ring.color"
|
|
7159
|
-
stroke-opacity="0.
|
|
7799
|
+
stroke-opacity="0.08"
|
|
7160
7800
|
[attr.stroke-width]="strokeWidth()"
|
|
7161
7801
|
/>
|
|
7162
7802
|
|
|
@@ -7166,14 +7806,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7166
7806
|
cy="0"
|
|
7167
7807
|
[attr.r]="ring.r"
|
|
7168
7808
|
fill="none"
|
|
7169
|
-
[attr.stroke]="
|
|
7170
|
-
[attr.stroke-width]="strokeWidth()"
|
|
7809
|
+
[attr.stroke]="'url(#radial-grad-' + i + ')'"
|
|
7810
|
+
[attr.stroke-width]="hoveredIndex() === i ? strokeWidth() + 3 : strokeWidth()"
|
|
7171
7811
|
[attr.stroke-dasharray]="ring.dashArray"
|
|
7172
|
-
[attr.stroke-dashoffset]="0"
|
|
7812
|
+
[attr.stroke-dashoffset]="animateState() ? 0 : ring.circumference"
|
|
7173
7813
|
stroke-linecap="round"
|
|
7174
7814
|
class="progress-ring"
|
|
7175
7815
|
[class.hovered]="hoveredIndex() === i"
|
|
7176
|
-
(mouseenter)="onRingHover(
|
|
7816
|
+
(mouseenter)="onRingHover(ring.raw, i)"
|
|
7817
|
+
(mousemove)="onRingMouseMove($event)"
|
|
7177
7818
|
/>
|
|
7178
7819
|
}
|
|
7179
7820
|
</g>
|
|
@@ -7221,9 +7862,30 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7221
7862
|
</div>
|
|
7222
7863
|
}
|
|
7223
7864
|
</div>
|
|
7865
|
+
|
|
7866
|
+
<!-- Glassmorphic Tooltip -->
|
|
7867
|
+
@if (tooltip() && hoveredIndex() !== null) {
|
|
7868
|
+
<div
|
|
7869
|
+
class="chart-tooltip"
|
|
7870
|
+
[style.left.px]="tooltipX()"
|
|
7871
|
+
[style.top.px]="tooltipY()"
|
|
7872
|
+
>
|
|
7873
|
+
<div class="tt-cat">{{ tooltip().label }}</div>
|
|
7874
|
+
<div class="tt-row">
|
|
7875
|
+
<span class="tt-dot" [style.background]="tooltip().color"></span>
|
|
7876
|
+
<span class="tt-name">Progress</span>
|
|
7877
|
+
<span class="tt-val">{{ tooltip().pct }}%</span>
|
|
7878
|
+
</div>
|
|
7879
|
+
<div class="tt-row">
|
|
7880
|
+
<span class="tt-dot" style="background: transparent;"></span>
|
|
7881
|
+
<span class="tt-name">Value</span>
|
|
7882
|
+
<span class="tt-val">{{ fmtNum(tooltip().value) }} / {{ fmtNum(tooltip().max) }}</span>
|
|
7883
|
+
</div>
|
|
7884
|
+
</div>
|
|
7885
|
+
}
|
|
7224
7886
|
</div>
|
|
7225
|
-
`, styles: [":host{display:block}.ngx-radial-bar-chart{background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-layout{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.radial-visual{position:relative;display:flex;align-items:center;justify-content:center}.radial-svg{display:block}.progress-ring{cursor:pointer;transition:stroke-width .2s,filter .
|
|
7226
|
-
}] });
|
|
7887
|
+
`, styles: [":host{display:block}.ngx-radial-bar-chart{background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif);position:relative}.chart-layout{display:flex;align-items:center;justify-content:center;gap:24px;flex-wrap:wrap}.radial-visual{position:relative;display:flex;align-items:center;justify-content:center}.radial-svg{display:block}.progress-ring{cursor:pointer;transition:stroke-width .3s cubic-bezier(.16,1,.3,1),stroke-dashoffset 1.2s cubic-bezier(.16,1,.3,1),filter .3s ease,opacity .2s}.progress-ring.hovered{filter:drop-shadow(0 0 6px rgba(0,0,0,.15))}.center-content{position:absolute;display:flex;flex-direction:column;align-items:center;justify-content:center;pointer-events:none;text-align:center}.center-label{font-size:11px;font-weight:600;color:#64748b;text-transform:uppercase;letter-spacing:.5px}.center-value{font-size:24px;font-weight:800;color:#1e293b;line-height:1.1;margin:2px 0}.center-sublabel{font-size:10px;color:#94a3b8}.radial-legend{display:flex;flex-direction:column;gap:6px;min-width:150px}.legend-item{display:flex;align-items:center;gap:10px;padding:6px 12px;border-radius:8px;border:1px solid transparent;transition:all .2s;cursor:pointer}.legend-item:hover,.legend-item.active{background:var(--ngx-chart-grid, #f8fafc);border-color:var(--ngx-chart-grid, #e2e8f0)}.legend-color-dot{width:10px;height:10px;border-radius:50%;flex-shrink:0}.legend-content{flex:1;display:flex;justify-content:space-between;align-items:center;gap:12px}.legend-title{font-size:12px;font-weight:600;color:#475569}.metric-value{font-size:12px;font-weight:700;color:#1e293b}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:12px;min-width:160px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);z-index:100;transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tt-cat{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tt-row{display:flex;align-items:center;gap:8px;margin-top:4px}.tt-dot{width:8px;height:8px;border-radius:50%;flex-shrink:0}.tt-name{color:#f8fafccc;flex:1}.tt-val{font-weight:700;font-family:monospace}\n"] }]
|
|
7888
|
+
}], ctorParameters: () => [] });
|
|
7227
7889
|
|
|
7228
7890
|
class CandlestickChartComponent {
|
|
7229
7891
|
PAD_LEFT = 52;
|
|
@@ -7298,9 +7960,12 @@ class CandlestickChartComponent {
|
|
|
7298
7960
|
width,
|
|
7299
7961
|
yHigh,
|
|
7300
7962
|
yLow,
|
|
7963
|
+
yOpen,
|
|
7964
|
+
yClose,
|
|
7301
7965
|
y,
|
|
7302
7966
|
rectH,
|
|
7303
7967
|
color,
|
|
7968
|
+
isBullish,
|
|
7304
7969
|
raw: item
|
|
7305
7970
|
};
|
|
7306
7971
|
});
|
|
@@ -7344,6 +8009,17 @@ class CandlestickChartComponent {
|
|
|
7344
8009
|
[attr.height]="height()"
|
|
7345
8010
|
class="chart-svg"
|
|
7346
8011
|
>
|
|
8012
|
+
<defs>
|
|
8013
|
+
<linearGradient id="candle-bullish-grad" x1="0" y1="0" x2="0" y2="1">
|
|
8014
|
+
<stop offset="0%" [attr.stop-color]="bullishColor()" />
|
|
8015
|
+
<stop offset="100%" [attr.stop-color]="bullishColor()" stop-opacity="0.8" />
|
|
8016
|
+
</linearGradient>
|
|
8017
|
+
<linearGradient id="candle-bearish-grad" x1="0" y1="0" x2="0" y2="1">
|
|
8018
|
+
<stop offset="0%" [attr.stop-color]="bearishColor()" />
|
|
8019
|
+
<stop offset="100%" [attr.stop-color]="bearishColor()" stop-opacity="0.8" />
|
|
8020
|
+
</linearGradient>
|
|
8021
|
+
</defs>
|
|
8022
|
+
|
|
7347
8023
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
7348
8024
|
<!-- Grid Lines (Horizontal) -->
|
|
7349
8025
|
@if (showGrid()) {
|
|
@@ -7379,6 +8055,32 @@ class CandlestickChartComponent {
|
|
|
7379
8055
|
>{{ formatDate(item.date) }}</text>
|
|
7380
8056
|
}
|
|
7381
8057
|
|
|
8058
|
+
<!-- Active Crosshair -->
|
|
8059
|
+
@if (hoveredIndex() !== null) {
|
|
8060
|
+
@if (computedCandles()[hoveredIndex()!]; as candle) {
|
|
8061
|
+
<line
|
|
8062
|
+
[attr.x1]="0"
|
|
8063
|
+
[attr.x2]="innerW()"
|
|
8064
|
+
[attr.y1]="candle.yClose"
|
|
8065
|
+
[attr.y2]="candle.yClose"
|
|
8066
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
8067
|
+
stroke-width="1.2"
|
|
8068
|
+
stroke-dasharray="3,3"
|
|
8069
|
+
class="crosshair-line"
|
|
8070
|
+
/>
|
|
8071
|
+
<line
|
|
8072
|
+
[attr.x1]="candle.centerX"
|
|
8073
|
+
[attr.x2]="candle.centerX"
|
|
8074
|
+
[attr.y1]="0"
|
|
8075
|
+
[attr.y2]="innerH()"
|
|
8076
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
8077
|
+
stroke-width="1.2"
|
|
8078
|
+
stroke-dasharray="3,3"
|
|
8079
|
+
class="crosshair-line"
|
|
8080
|
+
/>
|
|
8081
|
+
}
|
|
8082
|
+
}
|
|
8083
|
+
|
|
7382
8084
|
<!-- Candles -->
|
|
7383
8085
|
@for (candle of computedCandles(); track $index; let i = $index) {
|
|
7384
8086
|
<!-- Whisker/Wick Line (High to Low) -->
|
|
@@ -7389,6 +8091,7 @@ class CandlestickChartComponent {
|
|
|
7389
8091
|
[attr.y2]="candle.yLow"
|
|
7390
8092
|
[attr.stroke]="candle.color"
|
|
7391
8093
|
stroke-width="1.5"
|
|
8094
|
+
class="candle-wick"
|
|
7392
8095
|
/>
|
|
7393
8096
|
|
|
7394
8097
|
<!-- Candle Body Rect (Open to Close) -->
|
|
@@ -7397,12 +8100,15 @@ class CandlestickChartComponent {
|
|
|
7397
8100
|
[attr.y]="candle.y"
|
|
7398
8101
|
[attr.width]="candle.width"
|
|
7399
8102
|
[attr.height]="candle.rectH"
|
|
7400
|
-
[attr.fill]="candle.
|
|
8103
|
+
[attr.fill]="candle.isBullish ? 'url(#candle-bullish-grad)' : 'url(#candle-bearish-grad)'"
|
|
7401
8104
|
[attr.stroke]="candle.color"
|
|
7402
8105
|
stroke-width="1"
|
|
7403
8106
|
class="candle-rect"
|
|
7404
8107
|
[class.hovered]="hoveredIndex() === i"
|
|
8108
|
+
[style.transform-origin]="candle.centerX + 'px ' + candle.yOpen + 'px'"
|
|
8109
|
+
[style.animation-delay]="i * 0.03 + 's'"
|
|
7405
8110
|
(mouseenter)="onCandleHover($event, candle.raw, i)"
|
|
8111
|
+
(mousemove)="onCandleHover($event, candle.raw, i)"
|
|
7406
8112
|
/>
|
|
7407
8113
|
}
|
|
7408
8114
|
|
|
@@ -7420,16 +8126,28 @@ class CandlestickChartComponent {
|
|
|
7420
8126
|
<div class="tooltip-direction" [style.color]="t.direction === 'Bullish' ? '#10b981' : '#ef4444'">
|
|
7421
8127
|
<strong>{{ t.direction }}</strong> ({{ t.changePct }})
|
|
7422
8128
|
</div>
|
|
7423
|
-
<div class="tooltip-val">
|
|
7424
|
-
|
|
7425
|
-
|
|
7426
|
-
|
|
8129
|
+
<div class="tooltip-val">
|
|
8130
|
+
<span>High:</span>
|
|
8131
|
+
<strong>{{ fmtNum(t.high) }}</strong>
|
|
8132
|
+
</div>
|
|
8133
|
+
<div class="tooltip-val">
|
|
8134
|
+
<span>Open:</span>
|
|
8135
|
+
<strong>{{ fmtNum(t.open) }}</strong>
|
|
8136
|
+
</div>
|
|
8137
|
+
<div class="tooltip-val" style="color: #38bdf8;">
|
|
8138
|
+
<span>Close:</span>
|
|
8139
|
+
<strong>{{ fmtNum(t.close) }}</strong>
|
|
8140
|
+
</div>
|
|
8141
|
+
<div class="tooltip-val">
|
|
8142
|
+
<span>Low:</span>
|
|
8143
|
+
<strong>{{ fmtNum(t.low) }}</strong>
|
|
8144
|
+
</div>
|
|
7427
8145
|
</div>
|
|
7428
8146
|
</div>
|
|
7429
8147
|
}
|
|
7430
8148
|
</div>
|
|
7431
8149
|
</div>
|
|
7432
|
-
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-candlestick-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.candle-rect{cursor:pointer;transition:fill .15s,opacity .15s,filter .15s}.candle-rect.hovered{
|
|
8150
|
+
`, isInline: true, styles: [":host{display:block;width:100%}.ngx-candlestick-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}@keyframes candleGrow{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.candle-rect{cursor:pointer;transition:fill .15s,opacity .15s,stroke-width .15s,filter .15s;animation:candleGrow .6s cubic-bezier(.16,1,.3,1) both}.candle-rect.hovered{filter:brightness(1.05) drop-shadow(0 4px 10px rgba(0,0,0,.18));stroke-width:1.5px}@keyframes wickFade{0%{opacity:0}to{opacity:1}}.candle-wick{animation:wickFade .6s ease-out .2s both}.crosshair-line{pointer-events:none}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tooltip-header{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tooltip-direction{font-size:10px;font-weight:700;margin-bottom:6px;text-transform:uppercase;letter-spacing:.3px}.tooltip-body{display:flex;flex-direction:column;gap:4px}.tooltip-val{display:flex;justify-content:space-between;gap:16px;color:#f8fafcd9}.tooltip-val strong{color:#f8fafc;font-family:monospace;font-weight:700}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7433
8151
|
}
|
|
7434
8152
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImport: i0, type: CandlestickChartComponent, decorators: [{
|
|
7435
8153
|
type: Component,
|
|
@@ -7441,6 +8159,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7441
8159
|
[attr.height]="height()"
|
|
7442
8160
|
class="chart-svg"
|
|
7443
8161
|
>
|
|
8162
|
+
<defs>
|
|
8163
|
+
<linearGradient id="candle-bullish-grad" x1="0" y1="0" x2="0" y2="1">
|
|
8164
|
+
<stop offset="0%" [attr.stop-color]="bullishColor()" />
|
|
8165
|
+
<stop offset="100%" [attr.stop-color]="bullishColor()" stop-opacity="0.8" />
|
|
8166
|
+
</linearGradient>
|
|
8167
|
+
<linearGradient id="candle-bearish-grad" x1="0" y1="0" x2="0" y2="1">
|
|
8168
|
+
<stop offset="0%" [attr.stop-color]="bearishColor()" />
|
|
8169
|
+
<stop offset="100%" [attr.stop-color]="bearishColor()" stop-opacity="0.8" />
|
|
8170
|
+
</linearGradient>
|
|
8171
|
+
</defs>
|
|
8172
|
+
|
|
7444
8173
|
<g [attr.transform]="'translate(' + PAD_LEFT + ',' + PAD_TOP + ')'">
|
|
7445
8174
|
<!-- Grid Lines (Horizontal) -->
|
|
7446
8175
|
@if (showGrid()) {
|
|
@@ -7476,6 +8205,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7476
8205
|
>{{ formatDate(item.date) }}</text>
|
|
7477
8206
|
}
|
|
7478
8207
|
|
|
8208
|
+
<!-- Active Crosshair -->
|
|
8209
|
+
@if (hoveredIndex() !== null) {
|
|
8210
|
+
@if (computedCandles()[hoveredIndex()!]; as candle) {
|
|
8211
|
+
<line
|
|
8212
|
+
[attr.x1]="0"
|
|
8213
|
+
[attr.x2]="innerW()"
|
|
8214
|
+
[attr.y1]="candle.yClose"
|
|
8215
|
+
[attr.y2]="candle.yClose"
|
|
8216
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
8217
|
+
stroke-width="1.2"
|
|
8218
|
+
stroke-dasharray="3,3"
|
|
8219
|
+
class="crosshair-line"
|
|
8220
|
+
/>
|
|
8221
|
+
<line
|
|
8222
|
+
[attr.x1]="candle.centerX"
|
|
8223
|
+
[attr.x2]="candle.centerX"
|
|
8224
|
+
[attr.y1]="0"
|
|
8225
|
+
[attr.y2]="innerH()"
|
|
8226
|
+
stroke="rgba(100, 116, 139, 0.25)"
|
|
8227
|
+
stroke-width="1.2"
|
|
8228
|
+
stroke-dasharray="3,3"
|
|
8229
|
+
class="crosshair-line"
|
|
8230
|
+
/>
|
|
8231
|
+
}
|
|
8232
|
+
}
|
|
8233
|
+
|
|
7479
8234
|
<!-- Candles -->
|
|
7480
8235
|
@for (candle of computedCandles(); track $index; let i = $index) {
|
|
7481
8236
|
<!-- Whisker/Wick Line (High to Low) -->
|
|
@@ -7486,6 +8241,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7486
8241
|
[attr.y2]="candle.yLow"
|
|
7487
8242
|
[attr.stroke]="candle.color"
|
|
7488
8243
|
stroke-width="1.5"
|
|
8244
|
+
class="candle-wick"
|
|
7489
8245
|
/>
|
|
7490
8246
|
|
|
7491
8247
|
<!-- Candle Body Rect (Open to Close) -->
|
|
@@ -7494,12 +8250,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7494
8250
|
[attr.y]="candle.y"
|
|
7495
8251
|
[attr.width]="candle.width"
|
|
7496
8252
|
[attr.height]="candle.rectH"
|
|
7497
|
-
[attr.fill]="candle.
|
|
8253
|
+
[attr.fill]="candle.isBullish ? 'url(#candle-bullish-grad)' : 'url(#candle-bearish-grad)'"
|
|
7498
8254
|
[attr.stroke]="candle.color"
|
|
7499
8255
|
stroke-width="1"
|
|
7500
8256
|
class="candle-rect"
|
|
7501
8257
|
[class.hovered]="hoveredIndex() === i"
|
|
8258
|
+
[style.transform-origin]="candle.centerX + 'px ' + candle.yOpen + 'px'"
|
|
8259
|
+
[style.animation-delay]="i * 0.03 + 's'"
|
|
7502
8260
|
(mouseenter)="onCandleHover($event, candle.raw, i)"
|
|
8261
|
+
(mousemove)="onCandleHover($event, candle.raw, i)"
|
|
7503
8262
|
/>
|
|
7504
8263
|
}
|
|
7505
8264
|
|
|
@@ -7517,16 +8276,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.20", ngImpo
|
|
|
7517
8276
|
<div class="tooltip-direction" [style.color]="t.direction === 'Bullish' ? '#10b981' : '#ef4444'">
|
|
7518
8277
|
<strong>{{ t.direction }}</strong> ({{ t.changePct }})
|
|
7519
8278
|
</div>
|
|
7520
|
-
<div class="tooltip-val">
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
8279
|
+
<div class="tooltip-val">
|
|
8280
|
+
<span>High:</span>
|
|
8281
|
+
<strong>{{ fmtNum(t.high) }}</strong>
|
|
8282
|
+
</div>
|
|
8283
|
+
<div class="tooltip-val">
|
|
8284
|
+
<span>Open:</span>
|
|
8285
|
+
<strong>{{ fmtNum(t.open) }}</strong>
|
|
8286
|
+
</div>
|
|
8287
|
+
<div class="tooltip-val" style="color: #38bdf8;">
|
|
8288
|
+
<span>Close:</span>
|
|
8289
|
+
<strong>{{ fmtNum(t.close) }}</strong>
|
|
8290
|
+
</div>
|
|
8291
|
+
<div class="tooltip-val">
|
|
8292
|
+
<span>Low:</span>
|
|
8293
|
+
<strong>{{ fmtNum(t.low) }}</strong>
|
|
8294
|
+
</div>
|
|
7524
8295
|
</div>
|
|
7525
8296
|
</div>
|
|
7526
8297
|
}
|
|
7527
8298
|
</div>
|
|
7528
8299
|
</div>
|
|
7529
|
-
`, styles: [":host{display:block;width:100%}.ngx-candlestick-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}.candle-rect{cursor:pointer;transition:fill .15s,opacity .15s,filter .15s}.candle-rect.hovered{
|
|
8300
|
+
`, styles: [":host{display:block;width:100%}.ngx-candlestick-chart{position:relative;background:var(--ngx-chart-bg, #ffffff);border-radius:16px;padding:16px;box-sizing:border-box;font-family:var(--ngx-font-family, system-ui, sans-serif)}.chart-svg-container{position:relative;width:100%}.chart-svg{display:block;overflow:visible}.axis-label{font-size:10px;fill:#64748b;font-weight:500}@keyframes candleGrow{0%{transform:scaleY(0);opacity:0}to{transform:scaleY(1);opacity:1}}.candle-rect{cursor:pointer;transition:fill .15s,opacity .15s,stroke-width .15s,filter .15s;animation:candleGrow .6s cubic-bezier(.16,1,.3,1) both}.candle-rect.hovered{filter:brightness(1.05) drop-shadow(0 4px 10px rgba(0,0,0,.18));stroke-width:1.5px}@keyframes wickFade{0%{opacity:0}to{opacity:1}}.candle-wick{animation:wickFade .6s ease-out .2s both}.crosshair-line{pointer-events:none}.chart-tooltip{position:absolute;pointer-events:none;transform:translate(-50%,-100%) translateY(-10px);background:var(--ngx-chart-tooltip-bg, rgba(15, 23, 42, .92));backdrop-filter:blur(12px);-webkit-backdrop-filter:blur(12px);color:var(--ngx-chart-tooltip-color, #f8fafc);padding:10px 14px;border-radius:10px;font-size:11px;z-index:100;min-width:155px;box-shadow:0 10px 25px -5px #0000004d,0 8px 10px -6px #0000004d;border:1px solid rgba(255,255,255,.1);transition:left .1s cubic-bezier(.16,1,.3,1),top .1s cubic-bezier(.16,1,.3,1)}.tooltip-header{font-weight:700;margin-bottom:6px;font-size:12.5px;border-bottom:1px solid rgba(255,255,255,.15);padding-bottom:4px;color:#38bdf8}.tooltip-direction{font-size:10px;font-weight:700;margin-bottom:6px;text-transform:uppercase;letter-spacing:.3px}.tooltip-body{display:flex;flex-direction:column;gap:4px}.tooltip-val{display:flex;justify-content:space-between;gap:16px;color:#f8fafcd9}.tooltip-val strong{color:#f8fafc;font-family:monospace;font-weight:700}\n"] }]
|
|
7530
8301
|
}] });
|
|
7531
8302
|
|
|
7532
8303
|
/*
|