@primeui/chart-core 0.0.1-alpha.1
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/LICENSE +23 -0
- package/README.md +1 -0
- package/dist/animations/index.d.mts +136 -0
- package/dist/animations/index.mjs +18 -0
- package/dist/annotation.utils-Bm0lOO1o.d.mts +290 -0
- package/dist/borderRadius.utils-Cz73LLR_.d.mts +54 -0
- package/dist/canvas-D4vigq47.d.mts +34 -0
- package/dist/canvas.utils-D2WHi2gL.d.mts +167 -0
- package/dist/cartesian/index.d.mts +94 -0
- package/dist/cartesian/index.mjs +93 -0
- package/dist/chunk-22ST6YPP.mjs +304 -0
- package/dist/chunk-2QK2KOBN.mjs +10 -0
- package/dist/chunk-2QRS4YQ5.mjs +18 -0
- package/dist/chunk-3FFJEX4A.mjs +261 -0
- package/dist/chunk-3IYSJ2U7.mjs +567 -0
- package/dist/chunk-3OZLP4I4.mjs +190 -0
- package/dist/chunk-3WEMHXZI.mjs +198 -0
- package/dist/chunk-3Z62EUJN.mjs +138 -0
- package/dist/chunk-4C6EVJ54.mjs +362 -0
- package/dist/chunk-53HW45JB.mjs +102 -0
- package/dist/chunk-55Y3WI6S.mjs +186 -0
- package/dist/chunk-5JCI2DEB.mjs +97 -0
- package/dist/chunk-66T4MRC5.mjs +113 -0
- package/dist/chunk-6HSEJLSR.mjs +376 -0
- package/dist/chunk-6STOLMCA.mjs +187 -0
- package/dist/chunk-7CMVDIOU.mjs +54 -0
- package/dist/chunk-7QQ6ETB4.mjs +228 -0
- package/dist/chunk-A6ZQZFL2.mjs +272 -0
- package/dist/chunk-ADKLH73T.mjs +1 -0
- package/dist/chunk-AGU3NG6D.mjs +22 -0
- package/dist/chunk-AHYIS6EB.mjs +230 -0
- package/dist/chunk-AP3UYWYT.mjs +4 -0
- package/dist/chunk-ARB5T6MP.mjs +326 -0
- package/dist/chunk-ARRGOEFX.mjs +585 -0
- package/dist/chunk-AUF4CHDP.mjs +422 -0
- package/dist/chunk-B4FTADAZ.mjs +561 -0
- package/dist/chunk-BABQKA6K.mjs +339 -0
- package/dist/chunk-BETFQBM2.mjs +197 -0
- package/dist/chunk-BKP26M4K.mjs +413 -0
- package/dist/chunk-BZN2QHGP.mjs +200 -0
- package/dist/chunk-C36VWQ7A.mjs +86 -0
- package/dist/chunk-CHW4RKY3.mjs +16 -0
- package/dist/chunk-CINXJIRR.mjs +120 -0
- package/dist/chunk-DN6AXQYZ.mjs +667 -0
- package/dist/chunk-DP2IZNN3.mjs +92 -0
- package/dist/chunk-DTWTCFRG.mjs +119 -0
- package/dist/chunk-EAMUNLRU.mjs +172 -0
- package/dist/chunk-EDAKJLNA.mjs +17 -0
- package/dist/chunk-ERVQB2VZ.mjs +59 -0
- package/dist/chunk-FFMT6OCO.mjs +92 -0
- package/dist/chunk-FHTC2YDB.mjs +102 -0
- package/dist/chunk-FRST55HY.mjs +16 -0
- package/dist/chunk-HDFGCN2F.mjs +132 -0
- package/dist/chunk-IEGLX7VL.mjs +42 -0
- package/dist/chunk-ILUWFYGY.mjs +220 -0
- package/dist/chunk-IXOWSEHO.mjs +114 -0
- package/dist/chunk-J4RI2C2G.mjs +172 -0
- package/dist/chunk-J65DBT4R.mjs +13 -0
- package/dist/chunk-JGOVWSKH.mjs +179 -0
- package/dist/chunk-JO7VACY2.mjs +25 -0
- package/dist/chunk-JWFBOPM6.mjs +122 -0
- package/dist/chunk-KNDZP446.mjs +895 -0
- package/dist/chunk-KP2TWD4Z.mjs +90 -0
- package/dist/chunk-KQIFO5I3.mjs +225 -0
- package/dist/chunk-KVDEROP6.mjs +59 -0
- package/dist/chunk-LKC7MZKK.mjs +87 -0
- package/dist/chunk-LVMDQ4OJ.mjs +305 -0
- package/dist/chunk-M7B3JF43.mjs +90 -0
- package/dist/chunk-MTGMXRNF.mjs +136 -0
- package/dist/chunk-N3TIT3OH.mjs +1040 -0
- package/dist/chunk-NHRK5KU2.mjs +890 -0
- package/dist/chunk-NKUYIWAP.mjs +243 -0
- package/dist/chunk-NPDZLYIF.mjs +238 -0
- package/dist/chunk-O2X6FF45.mjs +499 -0
- package/dist/chunk-OGJ6IIBW.mjs +176 -0
- package/dist/chunk-OHGCZZPZ.mjs +403 -0
- package/dist/chunk-OWW3K55O.mjs +351 -0
- package/dist/chunk-OXTFAWSK.mjs +60 -0
- package/dist/chunk-PLSDU3C2.mjs +890 -0
- package/dist/chunk-PRDVPOZX.mjs +223 -0
- package/dist/chunk-Q6PPVIHU.mjs +21 -0
- package/dist/chunk-QQBXUDM4.mjs +885 -0
- package/dist/chunk-QS76E3TD.mjs +111 -0
- package/dist/chunk-QWQ6HY4I.mjs +209 -0
- package/dist/chunk-R6Y3R7EW.mjs +135 -0
- package/dist/chunk-RBLZRT5K.mjs +190 -0
- package/dist/chunk-RO4N6YFS.mjs +167 -0
- package/dist/chunk-RQ3CKQOX.mjs +984 -0
- package/dist/chunk-SALTGZFR.mjs +208 -0
- package/dist/chunk-SANZPAJ4.mjs +14 -0
- package/dist/chunk-SDBPQ5CF.mjs +624 -0
- package/dist/chunk-SSLTFJ3U.mjs +364 -0
- package/dist/chunk-SXHVDJGF.mjs +77 -0
- package/dist/chunk-TA4MVAEX.mjs +243 -0
- package/dist/chunk-TAHCOZHF.mjs +1772 -0
- package/dist/chunk-TQ6S34QZ.mjs +152 -0
- package/dist/chunk-UPRXABX5.mjs +90 -0
- package/dist/chunk-VGLSBZDN.mjs +71 -0
- package/dist/chunk-VN7CKCSE.mjs +364 -0
- package/dist/chunk-VVI3OBPJ.mjs +524 -0
- package/dist/chunk-VWF57TS3.mjs +62 -0
- package/dist/chunk-WA3OVISZ.mjs +179 -0
- package/dist/chunk-WCG35U6M.mjs +964 -0
- package/dist/chunk-WFTX4AQJ.mjs +194 -0
- package/dist/chunk-WFVOQ2QZ.mjs +18 -0
- package/dist/chunk-WH3C3Y7P.mjs +149 -0
- package/dist/chunk-WPFUV7K3.mjs +488 -0
- package/dist/chunk-WRULPWHD.mjs +492 -0
- package/dist/chunk-WS64BZXT.mjs +1 -0
- package/dist/chunk-WY4AURRE.mjs +2419 -0
- package/dist/chunk-WYLILAOO.mjs +167 -0
- package/dist/chunk-X4D7FKUS.mjs +62 -0
- package/dist/chunk-X7T34OLW.mjs +139 -0
- package/dist/chunk-XIHBK5D3.mjs +68 -0
- package/dist/chunk-XQQCGFYB.mjs +50 -0
- package/dist/chunk-XTVE4P3L.mjs +214 -0
- package/dist/chunk-XUAASRXW.mjs +579 -0
- package/dist/chunk-Y3L3D4GQ.mjs +685 -0
- package/dist/chunk-YBJ56XJS.mjs +132 -0
- package/dist/chunk-ZQFK6CAE.mjs +1 -0
- package/dist/chunk-ZT2Z7ERM.mjs +874 -0
- package/dist/chunk-ZTL2FQEW.mjs +714 -0
- package/dist/circular/arc/index.d.mts +8 -0
- package/dist/circular/arc/index.mjs +3 -0
- package/dist/circular/index.d.mts +44 -0
- package/dist/circular/index.mjs +13 -0
- package/dist/collect.utils-DiKB4ciO.d.mts +12 -0
- package/dist/computeChartState-BTVIqwyO.d.mts +304 -0
- package/dist/controller-BJE1AZ3q.d.mts +82 -0
- package/dist/controller-BoNigQJr.d.mts +63 -0
- package/dist/controllers/index.d.mts +16 -0
- package/dist/controllers/index.mjs +110 -0
- package/dist/datalabel.utils-CkjGeB8S.d.mts +122 -0
- package/dist/decimation.utils-CcvJVhI4.d.mts +244 -0
- package/dist/geometry-DUUQJXVM.d.mts +60 -0
- package/dist/index-DseIZa1j.d.mts +167 -0
- package/dist/index.d.mts +88 -0
- package/dist/index.mjs +110 -0
- package/dist/orchestrator/index.d.mts +264 -0
- package/dist/orchestrator/index.mjs +33 -0
- package/dist/plugins/index.d.mts +18 -0
- package/dist/plugins/index.mjs +1 -0
- package/dist/property-animations-D433wXzz.d.mts +580 -0
- package/dist/property-store-NORUWFND.d.mts +17 -0
- package/dist/radial/index.d.mts +14 -0
- package/dist/radial/index.mjs +37 -0
- package/dist/renderers/axis/index.d.mts +39 -0
- package/dist/renderers/axis/index.mjs +8 -0
- package/dist/renderers/circular/index.d.mts +13 -0
- package/dist/renderers/circular/index.mjs +13 -0
- package/dist/renderers/index.d.mts +83 -0
- package/dist/renderers/index.mjs +75 -0
- package/dist/renderers/navigator/index.d.mts +103 -0
- package/dist/renderers/navigator/index.mjs +8 -0
- package/dist/resize.utils-D_2qm6rv.d.mts +142 -0
- package/dist/ring.utils-DXvrxMkU.d.mts +138 -0
- package/dist/scale-KFv30jqZ.d.mts +307 -0
- package/dist/scales-Drf8AIhL.d.mts +75 -0
- package/dist/series/bar/canvas/index.d.mts +8 -0
- package/dist/series/bar/canvas/index.mjs +10 -0
- package/dist/series/bar/controller/index.d.mts +105 -0
- package/dist/series/bar/controller/index.mjs +44 -0
- package/dist/series/bar/controller-canvas/index.d.mts +7 -0
- package/dist/series/bar/controller-canvas/index.mjs +49 -0
- package/dist/series/bar/controller-svg/index.d.mts +7 -0
- package/dist/series/bar/controller-svg/index.mjs +49 -0
- package/dist/series/bar/index.d.mts +60 -0
- package/dist/series/bar/index.mjs +13 -0
- package/dist/series/bar/svg/index.d.mts +8 -0
- package/dist/series/bar/svg/index.mjs +11 -0
- package/dist/series/candlestick/canvas/index.d.mts +8 -0
- package/dist/series/candlestick/canvas/index.mjs +8 -0
- package/dist/series/candlestick/controller/index.d.mts +123 -0
- package/dist/series/candlestick/controller/index.mjs +40 -0
- package/dist/series/candlestick/controller-canvas/index.d.mts +7 -0
- package/dist/series/candlestick/controller-canvas/index.mjs +45 -0
- package/dist/series/candlestick/controller-svg/index.d.mts +7 -0
- package/dist/series/candlestick/controller-svg/index.mjs +45 -0
- package/dist/series/candlestick/index.d.mts +11 -0
- package/dist/series/candlestick/index.mjs +10 -0
- package/dist/series/candlestick/svg/index.d.mts +8 -0
- package/dist/series/candlestick/svg/index.mjs +8 -0
- package/dist/series/heatmap/canvas/index.d.mts +16 -0
- package/dist/series/heatmap/canvas/index.mjs +9 -0
- package/dist/series/heatmap/controller/index.d.mts +110 -0
- package/dist/series/heatmap/controller/index.mjs +23 -0
- package/dist/series/heatmap/controller-canvas/index.d.mts +7 -0
- package/dist/series/heatmap/controller-canvas/index.mjs +28 -0
- package/dist/series/heatmap/controller-svg/index.d.mts +7 -0
- package/dist/series/heatmap/controller-svg/index.mjs +28 -0
- package/dist/series/heatmap/index.d.mts +34 -0
- package/dist/series/heatmap/index.mjs +13 -0
- package/dist/series/heatmap/svg/index.d.mts +15 -0
- package/dist/series/heatmap/svg/index.mjs +10 -0
- package/dist/series/line/canvas/index.d.mts +6 -0
- package/dist/series/line/canvas/index.mjs +9 -0
- package/dist/series/line/controller/index.d.mts +111 -0
- package/dist/series/line/controller/index.mjs +47 -0
- package/dist/series/line/controller-canvas/index.d.mts +7 -0
- package/dist/series/line/controller-canvas/index.mjs +54 -0
- package/dist/series/line/controller-svg/index.d.mts +7 -0
- package/dist/series/line/controller-svg/index.mjs +54 -0
- package/dist/series/line/index.d.mts +49 -0
- package/dist/series/line/index.mjs +13 -0
- package/dist/series/line/svg/index.d.mts +6 -0
- package/dist/series/line/svg/index.mjs +9 -0
- package/dist/series/pie/canvas/index.d.mts +8 -0
- package/dist/series/pie/canvas/index.mjs +10 -0
- package/dist/series/pie/controller/index.d.mts +174 -0
- package/dist/series/pie/controller/index.mjs +110 -0
- package/dist/series/pie/controller-canvas/index.d.mts +8 -0
- package/dist/series/pie/controller-canvas/index.mjs +119 -0
- package/dist/series/pie/controller-svg/index.d.mts +8 -0
- package/dist/series/pie/controller-svg/index.mjs +118 -0
- package/dist/series/pie/index.d.mts +59 -0
- package/dist/series/pie/index.mjs +15 -0
- package/dist/series/pie/svg/index.d.mts +6 -0
- package/dist/series/pie/svg/index.mjs +11 -0
- package/dist/series/polar/canvas/index.d.mts +6 -0
- package/dist/series/polar/canvas/index.mjs +7 -0
- package/dist/series/polar/controller/index.d.mts +102 -0
- package/dist/series/polar/controller/index.mjs +46 -0
- package/dist/series/polar/controller-canvas/index.d.mts +8 -0
- package/dist/series/polar/controller-canvas/index.mjs +52 -0
- package/dist/series/polar/controller-svg/index.d.mts +8 -0
- package/dist/series/polar/controller-svg/index.mjs +52 -0
- package/dist/series/polar/index.d.mts +25 -0
- package/dist/series/polar/index.mjs +16 -0
- package/dist/series/polar/svg/index.d.mts +10 -0
- package/dist/series/polar/svg/index.mjs +8 -0
- package/dist/series/radar/canvas/index.d.mts +6 -0
- package/dist/series/radar/canvas/index.mjs +8 -0
- package/dist/series/radar/controller/index.d.mts +121 -0
- package/dist/series/radar/controller/index.mjs +43 -0
- package/dist/series/radar/controller-canvas/index.d.mts +8 -0
- package/dist/series/radar/controller-canvas/index.mjs +51 -0
- package/dist/series/radar/controller-svg/index.d.mts +8 -0
- package/dist/series/radar/controller-svg/index.mjs +51 -0
- package/dist/series/radar/index.d.mts +40 -0
- package/dist/series/radar/index.mjs +13 -0
- package/dist/series/radar/svg/index.d.mts +12 -0
- package/dist/series/radar/svg/index.mjs +9 -0
- package/dist/series/scatter/canvas/index.d.mts +8 -0
- package/dist/series/scatter/canvas/index.mjs +11 -0
- package/dist/series/scatter/controller/index.d.mts +124 -0
- package/dist/series/scatter/controller/index.mjs +44 -0
- package/dist/series/scatter/controller-canvas/index.d.mts +7 -0
- package/dist/series/scatter/controller-canvas/index.mjs +51 -0
- package/dist/series/scatter/controller-svg/index.d.mts +7 -0
- package/dist/series/scatter/controller-svg/index.mjs +51 -0
- package/dist/series/scatter/index.d.mts +25 -0
- package/dist/series/scatter/index.mjs +14 -0
- package/dist/series/scatter/svg/index.d.mts +8 -0
- package/dist/series/scatter/svg/index.mjs +12 -0
- package/dist/series/treemap/canvas/index.d.mts +50 -0
- package/dist/series/treemap/canvas/index.mjs +10 -0
- package/dist/series/treemap/controller/index.d.mts +130 -0
- package/dist/series/treemap/controller/index.mjs +20 -0
- package/dist/series/treemap/controller-canvas/index.d.mts +7 -0
- package/dist/series/treemap/controller-canvas/index.mjs +25 -0
- package/dist/series/treemap/controller-svg/index.d.mts +7 -0
- package/dist/series/treemap/controller-svg/index.mjs +25 -0
- package/dist/series/treemap/index.d.mts +15 -0
- package/dist/series/treemap/index.mjs +12 -0
- package/dist/series/treemap/svg/index.d.mts +15 -0
- package/dist/series/treemap/svg/index.mjs +9 -0
- package/dist/slices-DtewiwJx.d.mts +72 -0
- package/dist/spatialIndex.utils-B_GJkotZ.d.mts +5 -0
- package/dist/squarify.utils-B9CQBpa1.d.mts +50 -0
- package/dist/stacking-CChuAcLN.d.mts +319 -0
- package/dist/streaming.utils-DH-g1gNP.d.mts +49 -0
- package/dist/sync/index.d.mts +130 -0
- package/dist/sync/index.mjs +5 -0
- package/dist/tooltip.renderer-D5wpSlBa.d.mts +210 -0
- package/dist/utils/color/index.d.mts +58 -0
- package/dist/utils/color/index.mjs +4 -0
- package/dist/utils/data/index.d.mts +180 -0
- package/dist/utils/data/index.mjs +7 -0
- package/dist/utils/export/index.d.mts +14 -0
- package/dist/utils/export/index.mjs +6 -0
- package/dist/utils/index.d.mts +49 -0
- package/dist/utils/index.mjs +29 -0
- package/dist/utils/interaction/index.d.mts +255 -0
- package/dist/utils/interaction/index.mjs +9 -0
- package/dist/utils/layout/index.d.mts +3 -0
- package/dist/utils/layout/index.mjs +10 -0
- package/dist/utils/math/index.d.mts +162 -0
- package/dist/utils/math/index.mjs +1 -0
- package/dist/utils/render/index.d.mts +19 -0
- package/dist/utils/render/index.mjs +3 -0
- package/dist/utils/specialized/index.d.mts +37 -0
- package/dist/utils/specialized/index.mjs +66 -0
- package/dist/utils/text/index.d.mts +39 -0
- package/dist/utils/text/index.mjs +8 -0
- package/dist/utils/theme/index.d.mts +295 -0
- package/dist/utils/theme/index.mjs +5 -0
- package/dist/utils/zoom/index.d.mts +90 -0
- package/dist/utils/zoom/index.mjs +3 -0
- package/package.json +56 -0
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { makeItemContext, resolveAccessor, getColor, asGradient, getColorValue } from './chunk-O2X6FF45.mjs';
|
|
2
|
+
|
|
3
|
+
// src/orchestrator/syncHandlers.ts
|
|
4
|
+
function handleSyncedHighlightCartesian(event, delegate, hasCrosshair, isSharedMode, datasets) {
|
|
5
|
+
if (event.normalized === null) {
|
|
6
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
7
|
+
}
|
|
8
|
+
const plotArea = delegate?.getPlotArea();
|
|
9
|
+
if (!plotArea) {
|
|
10
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
11
|
+
}
|
|
12
|
+
let px = plotArea.x + event.normalized * plotArea.width;
|
|
13
|
+
let py = plotArea.y + plotArea.height / 2;
|
|
14
|
+
if (event.categoryIndex != null && event.sourceType !== "cartesian" && datasets) {
|
|
15
|
+
for (const dsId of datasets.keys()) {
|
|
16
|
+
const pt = delegate?.getPointPosition(dsId, event.categoryIndex) ?? null;
|
|
17
|
+
if (pt) {
|
|
18
|
+
px = pt.x + pt.width / 2;
|
|
19
|
+
py = pt.y + pt.height / 2;
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
const result = delegate?.findAllNearest(px, py) ?? null;
|
|
25
|
+
if (!result?.primary) {
|
|
26
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
27
|
+
}
|
|
28
|
+
const hit = result.primary;
|
|
29
|
+
const cartHit = "snapX" in hit ? hit : null;
|
|
30
|
+
const axisIdx = isSharedMode ? hit.index : null;
|
|
31
|
+
const axisX = isSharedMode ? cartHit?.snapX ?? null : null;
|
|
32
|
+
const crosshair = hasCrosshair;
|
|
33
|
+
const syncCursorX = crosshair && cartHit ? cartHit.snapX : px;
|
|
34
|
+
const syncCursorY = crosshair && cartHit ? cartHit.snapY : py;
|
|
35
|
+
const tooltip = {
|
|
36
|
+
visible: true,
|
|
37
|
+
x: (cartHit?.snapX ?? px) + 10,
|
|
38
|
+
y: (cartHit?.snapY ?? py) + 10,
|
|
39
|
+
label: hit.label,
|
|
40
|
+
value: hit.value,
|
|
41
|
+
color: hit.color,
|
|
42
|
+
datasetId: hit.datasetId,
|
|
43
|
+
index: hit.index,
|
|
44
|
+
snapX: crosshair && cartHit ? cartHit.snapX : void 0,
|
|
45
|
+
snapY: crosshair && cartHit ? cartHit.snapY : void 0,
|
|
46
|
+
cursorX: crosshair ? syncCursorX : void 0,
|
|
47
|
+
cursorY: crosshair ? syncCursorY : void 0,
|
|
48
|
+
formattedValue: cartHit?.formattedValue,
|
|
49
|
+
// A synced chart has no real cursor — the broadcast only carries the X position
|
|
50
|
+
// (py defaults to the plot middle), so a pixel-inverted cursor value would be
|
|
51
|
+
// meaningless. Show the snapped data value at the synced category instead.
|
|
52
|
+
cursorFormattedValue: cartHit?.formattedValue,
|
|
53
|
+
ohlc: cartHit?.ohlc,
|
|
54
|
+
allSeriesHits: result.allSeries
|
|
55
|
+
};
|
|
56
|
+
return { tooltip, hoverDatasetId: hit.datasetId, hoverIndex: hit.index, axisIdx, axisX };
|
|
57
|
+
}
|
|
58
|
+
function handleSyncedHighlightRadial(event, datasets, delegate, width, height) {
|
|
59
|
+
if (event.normalized === null || event.categoryIndex == null) {
|
|
60
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
61
|
+
}
|
|
62
|
+
const catIdx = event.categoryIndex;
|
|
63
|
+
for (const [dsId, ds] of datasets) {
|
|
64
|
+
if (ds.type !== "pie" && ds.type !== "donut" && ds.type !== "radar" && ds.type !== "polar") continue;
|
|
65
|
+
const props = ds.props;
|
|
66
|
+
const data = props.data;
|
|
67
|
+
if (!data || catIdx >= data.length) continue;
|
|
68
|
+
const item = data[catIdx];
|
|
69
|
+
const itemCtx = makeItemContext(item, catIdx);
|
|
70
|
+
const label = props.categoryField ? String(resolveAccessor(props.categoryField, itemCtx)) : "";
|
|
71
|
+
const value = props.valueField ? resolveAccessor(props.valueField, itemCtx) : 0;
|
|
72
|
+
let color = "";
|
|
73
|
+
if (props.color != null) {
|
|
74
|
+
const resolved = resolveAccessor(props.color, itemCtx);
|
|
75
|
+
color = typeof resolved === "string" ? resolved : "";
|
|
76
|
+
}
|
|
77
|
+
const ptPos = delegate?.getPointPosition(dsId, catIdx);
|
|
78
|
+
const tooltipX = ptPos ? ptPos.x + ptPos.width / 2 + 10 : width / 2 + 10;
|
|
79
|
+
const tooltipY = ptPos ? ptPos.y + ptPos.height / 2 + 10 : height / 2 + 10;
|
|
80
|
+
const tooltip = {
|
|
81
|
+
visible: true,
|
|
82
|
+
x: tooltipX,
|
|
83
|
+
y: tooltipY,
|
|
84
|
+
label,
|
|
85
|
+
value,
|
|
86
|
+
color,
|
|
87
|
+
datasetId: dsId,
|
|
88
|
+
index: catIdx
|
|
89
|
+
};
|
|
90
|
+
return { tooltip, hoverDatasetId: dsId, hoverIndex: catIdx };
|
|
91
|
+
}
|
|
92
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
93
|
+
}
|
|
94
|
+
function handleSyncedHighlightRect(event, datasets, width, height) {
|
|
95
|
+
if (event.normalized === null || event.categoryIndex == null) {
|
|
96
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
97
|
+
}
|
|
98
|
+
const catIdx = event.categoryIndex;
|
|
99
|
+
for (const [dsId, ds] of datasets) {
|
|
100
|
+
if (ds.type !== "treemap" && ds.type !== "heatmap") continue;
|
|
101
|
+
const dProps = ds.props;
|
|
102
|
+
const data = dProps["data"];
|
|
103
|
+
if (!data || catIdx >= data.length) continue;
|
|
104
|
+
const item = data[catIdx];
|
|
105
|
+
const itemCtx = makeItemContext(item, catIdx);
|
|
106
|
+
const categoryField = dProps["categoryField"];
|
|
107
|
+
const valueField = dProps["valueField"];
|
|
108
|
+
const label = categoryField ? String(resolveAccessor(categoryField, itemCtx)) : "";
|
|
109
|
+
const value = valueField ? resolveAccessor(valueField, itemCtx) : 0;
|
|
110
|
+
return {
|
|
111
|
+
tooltip: {
|
|
112
|
+
visible: true,
|
|
113
|
+
x: width / 2 + 10,
|
|
114
|
+
y: height / 2 + 10,
|
|
115
|
+
label,
|
|
116
|
+
value,
|
|
117
|
+
color: "",
|
|
118
|
+
datasetId: dsId,
|
|
119
|
+
index: catIdx
|
|
120
|
+
},
|
|
121
|
+
hoverDatasetId: dsId,
|
|
122
|
+
hoverIndex: catIdx
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
return { tooltip: null, hoverDatasetId: null, hoverIndex: null };
|
|
126
|
+
}
|
|
127
|
+
function buildDatasetRegistrations(chartId, datasets, theme) {
|
|
128
|
+
const infos = [];
|
|
129
|
+
for (const [datasetId, dataset] of datasets) {
|
|
130
|
+
const props = dataset.props;
|
|
131
|
+
const firstItem = props.data?.[0];
|
|
132
|
+
const color = getColor(props, dataset.order, firstItem, theme);
|
|
133
|
+
infos.push({
|
|
134
|
+
chartId,
|
|
135
|
+
datasetId,
|
|
136
|
+
label: props.name ?? datasetId,
|
|
137
|
+
color,
|
|
138
|
+
colorGradient: asGradient(getColorValue(props, dataset.order, firstItem, theme)),
|
|
139
|
+
type: dataset.type,
|
|
140
|
+
order: dataset.order
|
|
141
|
+
});
|
|
142
|
+
const data = props.data;
|
|
143
|
+
const labelAccessor = props.label;
|
|
144
|
+
if (data && labelAccessor) {
|
|
145
|
+
const valueAccessor = props.valueField;
|
|
146
|
+
data.forEach((item, i) => {
|
|
147
|
+
const itemLabel = String(resolveAccessor(labelAccessor, makeItemContext(item, i)));
|
|
148
|
+
const itemValue = valueAccessor ? resolveAccessor(valueAccessor, makeItemContext(item, i)) ?? null : null;
|
|
149
|
+
const itemExtras = { value: itemValue, category: itemLabel, seriesIndex: dataset.order, seriesId: datasetId };
|
|
150
|
+
const itemColor = getColor(props, i, item, theme, itemExtras);
|
|
151
|
+
infos.push({
|
|
152
|
+
chartId,
|
|
153
|
+
datasetId,
|
|
154
|
+
itemIndex: i,
|
|
155
|
+
label: itemLabel,
|
|
156
|
+
color: itemColor,
|
|
157
|
+
colorGradient: asGradient(getColorValue(props, i, item, theme, itemExtras)),
|
|
158
|
+
type: dataset.type,
|
|
159
|
+
order: dataset.order * 1e4 + i
|
|
160
|
+
});
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
return infos;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export { buildDatasetRegistrations, handleSyncedHighlightCartesian, handleSyncedHighlightRadial, handleSyncedHighlightRect };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { DEFAULT_FALLBACK_COLOR } from './chunk-NKUYIWAP.mjs';
|
|
2
|
+
import { getPrimaryColor } from './chunk-O2X6FF45.mjs';
|
|
3
|
+
|
|
4
|
+
// src/cartesian/marker-overlay.utils.ts
|
|
5
|
+
function literalSeriesColor(c) {
|
|
6
|
+
if (c == null) return void 0;
|
|
7
|
+
if (typeof c === "string") return c;
|
|
8
|
+
if (typeof c === "object" && !Array.isArray(c) && typeof c !== "function") return c;
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
function collectLineMarkerOverlays(layouts, renderPropsMap, snapshot) {
|
|
12
|
+
const entries = [];
|
|
13
|
+
for (const [dsId, layout] of layouts) {
|
|
14
|
+
const props = renderPropsMap.get(dsId);
|
|
15
|
+
if (!props?.renderMarker) continue;
|
|
16
|
+
const points = snapshot ? layout.visiblePoints.map((p) => ({ ...p })) : layout.visiblePoints.map((pt) => ({
|
|
17
|
+
x: pt.x,
|
|
18
|
+
y: pt.y,
|
|
19
|
+
dataIndex: pt.dataIndex,
|
|
20
|
+
value: pt.value,
|
|
21
|
+
category: pt.category
|
|
22
|
+
}));
|
|
23
|
+
const color = typeof layout.lineColor === "string" ? layout.lineColor : typeof props.color === "string" ? props.color : DEFAULT_FALLBACK_COLOR;
|
|
24
|
+
entries.push({
|
|
25
|
+
dsId,
|
|
26
|
+
renderMarker: props.renderMarker,
|
|
27
|
+
visiblePoints: points,
|
|
28
|
+
data: props.data,
|
|
29
|
+
color,
|
|
30
|
+
markerSize: typeof props.markerSize === "number" ? props.markerSize : 4,
|
|
31
|
+
effects: props.effects ? { dimOpacity: props.effects.dimOpacity, hoverPointRadius: props.effects.hoverPointRadius } : void 0,
|
|
32
|
+
pointBackgroundColor: props.pointBackgroundColor
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return entries;
|
|
36
|
+
}
|
|
37
|
+
function collectScatterMarkerOverlays(layouts, renderPropsMap) {
|
|
38
|
+
const entries = [];
|
|
39
|
+
for (const [dsId, scatterLayout] of layouts) {
|
|
40
|
+
const props = renderPropsMap.get(dsId);
|
|
41
|
+
if (!props?.renderMarker) continue;
|
|
42
|
+
entries.push({
|
|
43
|
+
dsId,
|
|
44
|
+
renderMarker: props.renderMarker,
|
|
45
|
+
visiblePoints: scatterLayout.points.filter((pt) => pt.visible).map((pt) => ({
|
|
46
|
+
x: pt.px,
|
|
47
|
+
y: pt.py,
|
|
48
|
+
dataIndex: pt.dataIndex,
|
|
49
|
+
value: pt.yValue,
|
|
50
|
+
category: String(pt.xValue)
|
|
51
|
+
})),
|
|
52
|
+
data: props.data,
|
|
53
|
+
color: getPrimaryColor(literalSeriesColor(props.color) ?? DEFAULT_FALLBACK_COLOR),
|
|
54
|
+
markerSize: typeof props.markerSize === "number" ? props.markerSize : 4,
|
|
55
|
+
effects: { dimOpacity: props.effects?.dimOpacity },
|
|
56
|
+
pointBackgroundColor: props.pointBackgroundColor
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
return entries;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export { collectLineMarkerOverlays, collectScatterMarkerOverlays };
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { computeBarRenderStates, traceRoundedRect, tracePartialBorder } from './chunk-AUF4CHDP.mjs';
|
|
2
|
+
import { isGradientColor, createCanvasGradientFromColor } from './chunk-O2X6FF45.mjs';
|
|
3
|
+
import { readCssNumber, withCanvasState } from './chunk-SSLTFJ3U.mjs';
|
|
4
|
+
|
|
5
|
+
// src/series/bar/canvas/index.ts
|
|
6
|
+
function createCanvasPathBuilder(ctx) {
|
|
7
|
+
return {
|
|
8
|
+
moveTo(x, y) {
|
|
9
|
+
ctx.moveTo(x, y);
|
|
10
|
+
},
|
|
11
|
+
lineTo(x, y) {
|
|
12
|
+
ctx.lineTo(x, y);
|
|
13
|
+
},
|
|
14
|
+
arcTo(cx, cy, toX, toY, r) {
|
|
15
|
+
if (r > 0) ctx.arcTo(cx, cy, toX, toY, r);
|
|
16
|
+
},
|
|
17
|
+
closePath() {
|
|
18
|
+
ctx.closePath();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function drawRoundedRectCanvas(ctx, x, y, w, h, radius) {
|
|
23
|
+
ctx.beginPath();
|
|
24
|
+
traceRoundedRect(createCanvasPathBuilder(ctx), x, y, w, h, radius);
|
|
25
|
+
}
|
|
26
|
+
function drawPartialBorderCanvas(ctx, x, y, w, h, skipped, radius) {
|
|
27
|
+
ctx.beginPath();
|
|
28
|
+
tracePartialBorder(createCanvasPathBuilder(ctx), x, y, w, h, skipped, radius);
|
|
29
|
+
}
|
|
30
|
+
function renderBarCanvas(props, layout, ctx, context) {
|
|
31
|
+
const { bars: barStates, borderJoinStyle, borderAlign } = computeBarRenderStates(props, layout, context.theme);
|
|
32
|
+
const shapeFn = props.renderShape;
|
|
33
|
+
const canvasGradientCache = /* @__PURE__ */ new Map();
|
|
34
|
+
const cssBarStrokeWidth = readCssNumber(ctx.canvas, "--p-chart-bar-stroke-width", 0);
|
|
35
|
+
withCanvasState(ctx, () => {
|
|
36
|
+
for (const state of barStates) {
|
|
37
|
+
const { bar, effectColor, effectBorderColor, effectBorderWidth, effectBorderDash, effectBorderDashOffset, opacity, drawX, drawY, drawWidth, drawHeight, clampedRadius, hasRadius, skippedEdges } = state;
|
|
38
|
+
const { dataIndex } = bar;
|
|
39
|
+
const width = drawWidth;
|
|
40
|
+
const height = drawHeight;
|
|
41
|
+
let path2d;
|
|
42
|
+
if (shapeFn) {
|
|
43
|
+
const shapeInfo = {
|
|
44
|
+
x: drawX,
|
|
45
|
+
y: drawY,
|
|
46
|
+
width,
|
|
47
|
+
height,
|
|
48
|
+
value: bar.value,
|
|
49
|
+
category: bar.category,
|
|
50
|
+
dataIndex,
|
|
51
|
+
isNegative: bar.isNegative
|
|
52
|
+
};
|
|
53
|
+
path2d = new Path2D(shapeFn(shapeInfo));
|
|
54
|
+
}
|
|
55
|
+
if (isGradientColor(effectColor)) {
|
|
56
|
+
const cx = drawX + width / 2;
|
|
57
|
+
const cy = drawY + height / 2;
|
|
58
|
+
const radius = Math.max(width, height);
|
|
59
|
+
const gradKey = `${drawX}_${drawY}_${width}_${height}_${effectColor.radialGradient ? "r" : "l"}_${effectColor.stops.length}`;
|
|
60
|
+
let grad = canvasGradientCache.get(gradKey);
|
|
61
|
+
if (!grad) {
|
|
62
|
+
grad = createCanvasGradientFromColor(ctx, effectColor, { x: cx, y: cy }, radius, { x: drawX, y: drawY, width, height });
|
|
63
|
+
canvasGradientCache.set(gradKey, grad);
|
|
64
|
+
}
|
|
65
|
+
ctx.fillStyle = grad;
|
|
66
|
+
} else {
|
|
67
|
+
ctx.fillStyle = effectColor;
|
|
68
|
+
}
|
|
69
|
+
ctx.globalAlpha = opacity;
|
|
70
|
+
if (path2d) {
|
|
71
|
+
ctx.fill(path2d);
|
|
72
|
+
} else if (hasRadius) {
|
|
73
|
+
drawRoundedRectCanvas(ctx, drawX, drawY, width, height, clampedRadius);
|
|
74
|
+
ctx.fill();
|
|
75
|
+
} else {
|
|
76
|
+
ctx.fillRect(drawX, drawY, width, height);
|
|
77
|
+
}
|
|
78
|
+
const cssDrivenStroke = effectBorderWidth === 0 && cssBarStrokeWidth > 0;
|
|
79
|
+
const drawStrokeWidth = cssDrivenStroke ? cssBarStrokeWidth : effectBorderWidth;
|
|
80
|
+
const drawStrokeColor = cssDrivenStroke ? effectColor : effectBorderColor;
|
|
81
|
+
if (drawStrokeWidth > 0 && drawStrokeColor !== "transparent") {
|
|
82
|
+
ctx.strokeStyle = typeof drawStrokeColor === "string" ? drawStrokeColor : context.theme.borderColor;
|
|
83
|
+
ctx.lineJoin = borderJoinStyle;
|
|
84
|
+
if (effectBorderDash && effectBorderDash.length > 0) {
|
|
85
|
+
ctx.setLineDash(effectBorderDash);
|
|
86
|
+
ctx.lineDashOffset = effectBorderDashOffset;
|
|
87
|
+
} else {
|
|
88
|
+
ctx.setLineDash([]);
|
|
89
|
+
}
|
|
90
|
+
const usePartialBorder = skippedEdges.size > 0 && !path2d;
|
|
91
|
+
if (borderAlign === "inner") {
|
|
92
|
+
ctx.save();
|
|
93
|
+
if (path2d) {
|
|
94
|
+
ctx.clip(path2d);
|
|
95
|
+
} else if (hasRadius) {
|
|
96
|
+
drawRoundedRectCanvas(ctx, drawX, drawY, width, height, clampedRadius);
|
|
97
|
+
ctx.clip();
|
|
98
|
+
} else {
|
|
99
|
+
ctx.beginPath();
|
|
100
|
+
ctx.rect(drawX, drawY, width, height);
|
|
101
|
+
ctx.clip();
|
|
102
|
+
}
|
|
103
|
+
ctx.lineWidth = drawStrokeWidth * 2;
|
|
104
|
+
ctx.lineCap = usePartialBorder ? effectBorderDash && effectBorderDash.length > 0 ? "butt" : "square" : "butt";
|
|
105
|
+
if (usePartialBorder) {
|
|
106
|
+
drawPartialBorderCanvas(ctx, drawX, drawY, width, height, skippedEdges, clampedRadius);
|
|
107
|
+
ctx.stroke();
|
|
108
|
+
} else if (path2d) {
|
|
109
|
+
ctx.stroke(path2d);
|
|
110
|
+
} else if (hasRadius) {
|
|
111
|
+
drawRoundedRectCanvas(ctx, drawX, drawY, width, height, clampedRadius);
|
|
112
|
+
ctx.stroke();
|
|
113
|
+
} else {
|
|
114
|
+
ctx.beginPath();
|
|
115
|
+
ctx.rect(drawX, drawY, width, height);
|
|
116
|
+
ctx.stroke();
|
|
117
|
+
}
|
|
118
|
+
ctx.restore();
|
|
119
|
+
} else {
|
|
120
|
+
ctx.lineWidth = drawStrokeWidth;
|
|
121
|
+
ctx.lineCap = usePartialBorder ? effectBorderDash && effectBorderDash.length > 0 ? "butt" : "square" : "butt";
|
|
122
|
+
if (usePartialBorder) {
|
|
123
|
+
drawPartialBorderCanvas(ctx, drawX, drawY, width, height, skippedEdges, clampedRadius);
|
|
124
|
+
ctx.stroke();
|
|
125
|
+
} else if (path2d) {
|
|
126
|
+
ctx.stroke(path2d);
|
|
127
|
+
} else if (hasRadius) {
|
|
128
|
+
drawRoundedRectCanvas(ctx, drawX, drawY, width, height, clampedRadius);
|
|
129
|
+
ctx.stroke();
|
|
130
|
+
} else {
|
|
131
|
+
ctx.strokeRect(drawX, drawY, width, height);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export { renderBarCanvas };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { renderTreemapCanvas } from './chunk-55Y3WI6S.mjs';
|
|
2
|
+
import { renderTreemapSvg } from './chunk-RO4N6YFS.mjs';
|
|
3
|
+
import { calculateTreemapLayout } from './chunk-VVI3OBPJ.mjs';
|
|
4
|
+
import { CHAR_WIDTH_RATIO } from './chunk-XTVE4P3L.mjs';
|
|
5
|
+
|
|
6
|
+
// src/series/treemap/geometry.ts
|
|
7
|
+
function hitTestTreemap(_x, _y, _props, layout) {
|
|
8
|
+
for (const cell of layout.cells) {
|
|
9
|
+
if (_x >= cell.x && _x <= cell.x + cell.width && _y >= cell.y && _y <= cell.y + cell.height) {
|
|
10
|
+
return cell.index;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// src/series/treemap/shared.ts
|
|
17
|
+
var LABEL_TIERS = [
|
|
18
|
+
{ minArea: 25e3, minWidth: 100, minHeight: 60, fontSize: 16, secondaryFontSize: 12, showSecondary: true },
|
|
19
|
+
{ minArea: 1e4, minWidth: 70, minHeight: 45, fontSize: 14, secondaryFontSize: 10, showSecondary: true },
|
|
20
|
+
{ minArea: 4e3, minWidth: 50, minHeight: 35, fontSize: 12, secondaryFontSize: 9, showSecondary: true },
|
|
21
|
+
{ minArea: 1500, minWidth: 38, minHeight: 26, fontSize: 10, secondaryFontSize: 8, showSecondary: true },
|
|
22
|
+
{ minArea: 600, minWidth: 28, minHeight: 20, fontSize: 9, secondaryFontSize: 0, showSecondary: false },
|
|
23
|
+
{ minArea: 250, minWidth: 22, minHeight: 14, fontSize: 8, secondaryFontSize: 0, showSecondary: false }
|
|
24
|
+
];
|
|
25
|
+
function getCellLabelInfo(cell, labelMinSize) {
|
|
26
|
+
const area = cell.width * cell.height;
|
|
27
|
+
const none = { fontSize: 0, secondaryFontSize: 0, showPrimary: false, showSecondary: false, cx: 0, cy: 0, primaryY: 0, secondaryY: 0 };
|
|
28
|
+
const minSize = labelMinSize ?? 30;
|
|
29
|
+
if (cell.width < minSize || cell.height < minSize) return none;
|
|
30
|
+
for (const tier of LABEL_TIERS) {
|
|
31
|
+
if (area >= tier.minArea && cell.width >= tier.minWidth && cell.height >= tier.minHeight) {
|
|
32
|
+
const primaryTextWidth = cell.label.length * CHAR_WIDTH_RATIO * tier.fontSize;
|
|
33
|
+
if (primaryTextWidth > cell.width - 8) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
let showSec = tier.showSecondary && !!cell.secondaryLabel;
|
|
37
|
+
if (showSec) {
|
|
38
|
+
const secTextWidth = (cell.secondaryLabel?.length ?? 0) * CHAR_WIDTH_RATIO * tier.secondaryFontSize;
|
|
39
|
+
if (secTextWidth > cell.width - 8) {
|
|
40
|
+
showSec = false;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
const cx = cell.x + cell.width / 2;
|
|
44
|
+
const cy = cell.y + cell.height / 2;
|
|
45
|
+
return {
|
|
46
|
+
fontSize: tier.fontSize,
|
|
47
|
+
secondaryFontSize: tier.secondaryFontSize,
|
|
48
|
+
showPrimary: true,
|
|
49
|
+
showSecondary: showSec,
|
|
50
|
+
cx,
|
|
51
|
+
cy,
|
|
52
|
+
primaryY: showSec ? cy - tier.fontSize * 0.4 : cy,
|
|
53
|
+
secondaryY: cy + tier.fontSize * 0.6
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return none;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// src/series/treemap/index.ts
|
|
61
|
+
var treemapRenderer = {
|
|
62
|
+
calculateLayout: calculateTreemapLayout,
|
|
63
|
+
renderSvg: (props, layout, context) => renderTreemapSvg(props, layout, context),
|
|
64
|
+
renderCanvas: (props, layout, ctx, context) => renderTreemapCanvas(props, layout, ctx, context),
|
|
65
|
+
hitTest: hitTestTreemap
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { getCellLabelInfo, hitTestTreemap, treemapRenderer };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { lerpValues } from './chunk-WH3C3Y7P.mjs';
|
|
2
|
+
|
|
3
|
+
// src/animations/line.ts
|
|
4
|
+
function detectLineUpdateKind(startVals, targetVals) {
|
|
5
|
+
if (!startVals || startVals.length === 0) return "update";
|
|
6
|
+
if (targetVals.length === startVals.length + 1) {
|
|
7
|
+
let allMatch = true;
|
|
8
|
+
for (let i = 0; i < startVals.length; i++) {
|
|
9
|
+
if (startVals[i] !== targetVals[i]) {
|
|
10
|
+
allMatch = false;
|
|
11
|
+
break;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
if (allMatch) return "append";
|
|
15
|
+
}
|
|
16
|
+
if (targetVals.length === startVals.length && startVals.length >= 2) {
|
|
17
|
+
let isShift = true;
|
|
18
|
+
for (let i = 0; i < targetVals.length - 1; i++) {
|
|
19
|
+
if (targetVals[i] !== startVals[i + 1]) {
|
|
20
|
+
isShift = false;
|
|
21
|
+
break;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
if (isShift) return "scroll";
|
|
25
|
+
}
|
|
26
|
+
return "update";
|
|
27
|
+
}
|
|
28
|
+
function buildLineFingerprint(layouts) {
|
|
29
|
+
const parts = [];
|
|
30
|
+
for (const [dsId, layout] of layouts) {
|
|
31
|
+
const vals = layout.visiblePoints.map((p) => p.value ?? "null").join(",");
|
|
32
|
+
parts.push(`${dsId}:${vals}`);
|
|
33
|
+
}
|
|
34
|
+
return parts.join("|");
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// src/utils/specialized/streaming.utils.ts
|
|
38
|
+
function detectStreamingUpdateKind(prev, next) {
|
|
39
|
+
return detectLineUpdateKind(prev, next);
|
|
40
|
+
}
|
|
41
|
+
function streamingPointsInterpolator(from, to, t) {
|
|
42
|
+
const f = from;
|
|
43
|
+
const tt = to;
|
|
44
|
+
if (tt.streamingHint === "append" || tt.streamingHint === "scroll") {
|
|
45
|
+
return { values: tt.values, streamingHint: tt.streamingHint };
|
|
46
|
+
}
|
|
47
|
+
return { values: lerpValues(f.values, tt.values, t), streamingHint: tt.streamingHint };
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { buildLineFingerprint, detectLineUpdateKind, detectStreamingUpdateKind, streamingPointsInterpolator };
|