@umituz/web-dashboard 7.4.2 → 7.4.3
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/web-dashboard",
|
|
3
|
-
"version": "7.4.
|
|
3
|
+
"version": "7.4.3",
|
|
4
4
|
"description": "Installable app skeleton for the fleet — layouts, analytics (dependency-free SVG charts), calendar, onboarding flow permissions/module registry; udb-* stylesheet on design-system tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./src/index.ts",
|
|
@@ -403,6 +403,7 @@ export function LineChart({
|
|
|
403
403
|
points,
|
|
404
404
|
labels,
|
|
405
405
|
series,
|
|
406
|
+
band,
|
|
406
407
|
height = 220,
|
|
407
408
|
formatLeft,
|
|
408
409
|
formatRight,
|
|
@@ -413,6 +414,7 @@ export function LineChart({
|
|
|
413
414
|
points?: readonly LineChartPoint[];
|
|
414
415
|
labels?: readonly string[];
|
|
415
416
|
series: LineSeries[];
|
|
417
|
+
band?: { from: number; to: number };
|
|
416
418
|
height?: number;
|
|
417
419
|
formatLeft?: (v: number) => string;
|
|
418
420
|
formatRight?: (v: number) => string;
|
|
@@ -437,14 +439,14 @@ export function LineChart({
|
|
|
437
439
|
const toneOf = (s: LineSeries, i: number) => s.tone ?? s.color ?? PALETTE[i % PALETTE.length]!;
|
|
438
440
|
|
|
439
441
|
const leftMax = useMemo(
|
|
440
|
-
() => niceMax(Math.max(1, ...series.filter((s) => s.axis !== 'right').flatMap((s) => vals(s)))),
|
|
441
|
-
[series],
|
|
442
|
+
() => niceMax(Math.max(1, ...series.filter((s) => s.axis !== 'right').flatMap((s) => vals(s)), ...(band ? [band.from, band.to] : []))),
|
|
443
|
+
[series, band],
|
|
442
444
|
);
|
|
443
445
|
const rightMax = useMemo(
|
|
444
446
|
() => niceMax(Math.max(1, ...series.filter((s) => s.axis === 'right').flatMap((s) => vals(s)))),
|
|
445
447
|
[series],
|
|
446
448
|
);
|
|
447
|
-
const leftTicks = useMemo(() => gridTicks(Math.max(...series.filter((s) => s.axis !== 'right').flatMap((s) => vals(s)), 1)), [series]);
|
|
449
|
+
const leftTicks = useMemo(() => gridTicks(Math.max(...series.filter((s) => s.axis !== 'right').flatMap((s) => vals(s)), ...(band ? [band.from, band.to] : []), 1)), [series, band]);
|
|
448
450
|
|
|
449
451
|
const xAt = (i: number) => padLeft + (n <= 1 ? innerW / 2 : (i / (n - 1)) * innerW);
|
|
450
452
|
const yLeft = (v: number) => padTop + innerH - (v / leftMax) * innerH;
|
|
@@ -477,6 +479,16 @@ export function LineChart({
|
|
|
477
479
|
</g>
|
|
478
480
|
|
|
479
481
|
))}
|
|
482
|
+
{band && (
|
|
483
|
+
<rect
|
|
484
|
+
x={padLeft}
|
|
485
|
+
y={yLeft(band.to)}
|
|
486
|
+
width={innerW}
|
|
487
|
+
height={Math.max(0, yLeft(band.from) - yLeft(band.to))}
|
|
488
|
+
rx={2}
|
|
489
|
+
className="udb-linechart__band"
|
|
490
|
+
/>
|
|
491
|
+
)}
|
|
480
492
|
{series.some((s) => s.axis === 'right') && (
|
|
481
493
|
<g>
|
|
482
494
|
{leftTicks.map((v, i) => (
|
package/src/styles/chrome.css
CHANGED
|
@@ -1728,6 +1728,10 @@
|
|
|
1728
1728
|
stroke: var(--color-border);
|
|
1729
1729
|
stroke-width: 1;
|
|
1730
1730
|
}
|
|
1731
|
+
.udb-linechart__band {
|
|
1732
|
+
fill: var(--color-primary);
|
|
1733
|
+
opacity: 0.08;
|
|
1734
|
+
}
|
|
1731
1735
|
.udb-linechart__crosshair {
|
|
1732
1736
|
stroke: var(--udb-border-strong);
|
|
1733
1737
|
stroke-width: 1;
|