@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,488 @@
|
|
|
1
|
+
import { candlestickHitTest, candlestickFindAllNearest } from './chunk-M7B3JF43.mjs';
|
|
2
|
+
import { buildCandlestickFingerprint } from './chunk-JO7VACY2.mjs';
|
|
3
|
+
import { calculateCandlestickLayout } from './chunk-3OZLP4I4.mjs';
|
|
4
|
+
import { registerDatasetLayers, triggerCompositorRepaint } from './chunk-Q6PPVIHU.mjs';
|
|
5
|
+
import { AnimatedScene, resolveAnimatedProps, CANDLESTICK_ANIMATABLE_PROPS } from './chunk-VN7CKCSE.mjs';
|
|
6
|
+
import { reconcileSvgChildren } from './chunk-KP2TWD4Z.mjs';
|
|
7
|
+
import { parseAnimationConfig } from './chunk-3WEMHXZI.mjs';
|
|
8
|
+
import { raf, cancelRaf } from './chunk-EDAKJLNA.mjs';
|
|
9
|
+
import { buildAccessibilityRenderContext, generateSeriesDescription } from './chunk-OGJ6IIBW.mjs';
|
|
10
|
+
import { collectItems } from './chunk-FFMT6OCO.mjs';
|
|
11
|
+
import { materializeSvgNode, setAttr } from './chunk-SSLTFJ3U.mjs';
|
|
12
|
+
|
|
13
|
+
// src/series/candlestick/controller/index.ts
|
|
14
|
+
function buildCandlestickSvgChildren(params) {
|
|
15
|
+
const { paint, frameLayouts, frameRenderProps, context, hover } = params;
|
|
16
|
+
const children = [];
|
|
17
|
+
for (const [dsId, csLayout] of frameLayouts) {
|
|
18
|
+
const props = frameRenderProps.get(dsId);
|
|
19
|
+
if (!props) continue;
|
|
20
|
+
const propsWithHover = {
|
|
21
|
+
...props,
|
|
22
|
+
hoveredIndex: hover.datasetId === dsId ? hover.index : null
|
|
23
|
+
};
|
|
24
|
+
const node = paint.renderSvg(propsWithHover, csLayout, context);
|
|
25
|
+
setAttr(node, "data-dataset", dsId);
|
|
26
|
+
if (context.accessibility?.enabled && context.accessibility.landmarkVerbosity === "all") {
|
|
27
|
+
setAttr(node, "role", "region");
|
|
28
|
+
setAttr(node, "aria-label", generateSeriesDescription(props.name ?? dsId, "candlestick", csLayout.visibleCandles.length));
|
|
29
|
+
}
|
|
30
|
+
children.push(node);
|
|
31
|
+
}
|
|
32
|
+
return children;
|
|
33
|
+
}
|
|
34
|
+
var CANDLE_REGISTRY = {
|
|
35
|
+
number: ["x", "bodyWidth", "wickTop", "wickBottom", "bodyTop", "bodyBottom", "openY", "closeY"],
|
|
36
|
+
color: []
|
|
37
|
+
};
|
|
38
|
+
var CandlestickRendererController = class {
|
|
39
|
+
constructor(paint) {
|
|
40
|
+
this.layoutCache = /* @__PURE__ */ new Map();
|
|
41
|
+
this.renderPropsCache = /* @__PURE__ */ new Map();
|
|
42
|
+
this.candlestickDatasets = [];
|
|
43
|
+
this.lastInput = null;
|
|
44
|
+
// Animation lifecycle — local raf clock + fingerprint for phase detection.
|
|
45
|
+
this._animRafId = null;
|
|
46
|
+
// Single source of truth for the current hover. Written ONLY by applyHover, read by the
|
|
47
|
+
// update() bake, renderFrame (scene loop) and the canvas re-bake. Must NOT live on `input`:
|
|
48
|
+
// the scene-loop tick captures a stale `input` while update() swaps `this.lastInput`, so an
|
|
49
|
+
// input-coupled hover lags by a hover (the "hover twice to show" bug). Mirrors radar/polar.
|
|
50
|
+
this._hover = { datasetId: null, index: null };
|
|
51
|
+
this._lastFingerprint = "";
|
|
52
|
+
this._lastRenderedLayout = null;
|
|
53
|
+
// Render-time caches — include visible + exiting entries. Populated by
|
|
54
|
+
// _renderSceneFrame each tick so exiting candles' fade-out still paints.
|
|
55
|
+
// cellLayouts/renderPropsMap from update() are visible-only (mirrors Scatter's
|
|
56
|
+
// 4-cache split): hit-test reads from _lastRenderedLayout (which mirrors
|
|
57
|
+
// renderLayouts), while these two stash the latest renderable state per
|
|
58
|
+
// dataset for the fallback chain.
|
|
59
|
+
this._renderLayouts = /* @__PURE__ */ new Map();
|
|
60
|
+
this._activeRenderPropsCache = /* @__PURE__ */ new Map();
|
|
61
|
+
// Per-dataset property-animation overrides resolved from AnimatedPropertyStore.
|
|
62
|
+
// Set by `applyPropertyAnimations()` each property-animation tick and merged
|
|
63
|
+
// into render props uniformly across all candles of the dataset at every
|
|
64
|
+
// cache-write site (_renderSceneFrame). Cleared by `destroy()`.
|
|
65
|
+
//
|
|
66
|
+
// Step 10 keeps this per-dataset only. Per-candle granularity is Step 14;
|
|
67
|
+
// the scene elements are already keyed per-candle from the Step 3 migration,
|
|
68
|
+
// but the override map is intentionally coarse for this phase.
|
|
69
|
+
this._propertyOverrides = /* @__PURE__ */ new Map();
|
|
70
|
+
// DOM targets
|
|
71
|
+
this.svgGroup = null;
|
|
72
|
+
this.canvasEl = null;
|
|
73
|
+
this.onFrame = null;
|
|
74
|
+
this._paint = paint;
|
|
75
|
+
this._scene = new AnimatedScene({
|
|
76
|
+
// ENTER: candle collapses to a zero-height segment at baselineY.
|
|
77
|
+
// baselineY is stored on the target state so we can read it here.
|
|
78
|
+
emptyState: (target) => ({
|
|
79
|
+
...target,
|
|
80
|
+
wickTop: target.baselineY,
|
|
81
|
+
wickBottom: target.baselineY,
|
|
82
|
+
bodyTop: target.baselineY,
|
|
83
|
+
bodyBottom: target.baselineY,
|
|
84
|
+
openY: target.baselineY,
|
|
85
|
+
closeY: target.baselineY
|
|
86
|
+
}),
|
|
87
|
+
// EXIT: same shape — candle shrinks back to baseline at its current x.
|
|
88
|
+
exitEmptyState: (target) => ({
|
|
89
|
+
...target,
|
|
90
|
+
wickTop: target.baselineY,
|
|
91
|
+
wickBottom: target.baselineY,
|
|
92
|
+
bodyTop: target.baselineY,
|
|
93
|
+
bodyBottom: target.baselineY,
|
|
94
|
+
openY: target.baselineY,
|
|
95
|
+
closeY: target.baselineY
|
|
96
|
+
}),
|
|
97
|
+
registry: CANDLE_REGISTRY
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
// ================================================================
|
|
101
|
+
// PUBLIC API
|
|
102
|
+
// ================================================================
|
|
103
|
+
update(input) {
|
|
104
|
+
this.lastInput = input;
|
|
105
|
+
this.svgGroup = input.svgGroup ?? null;
|
|
106
|
+
this.canvasEl = input.canvasEl ?? null;
|
|
107
|
+
const { datasets, datasetVisibility, chartArea, chartId, width, height, categoryScale, valueScales, firstValueAxisId, hoverConfig, compositor } = input;
|
|
108
|
+
const sortedDatasets = Array.from(datasets.entries()).sort(([, a], [, b]) => a.order - b.order);
|
|
109
|
+
this.candlestickDatasets = collectItems(sortedDatasets, datasetVisibility).candlestick;
|
|
110
|
+
if ((this.candlestickDatasets.length === 0 || !categoryScale || !valueScales || valueScales.size === 0) && this._scene.getElements().length === 0) {
|
|
111
|
+
this.layoutCache.clear();
|
|
112
|
+
this.renderPropsCache.clear();
|
|
113
|
+
this._renderLayouts.clear();
|
|
114
|
+
this._activeRenderPropsCache.clear();
|
|
115
|
+
this._propertyOverrides.clear();
|
|
116
|
+
this.candlestickDatasets = [];
|
|
117
|
+
this._cancelRaf();
|
|
118
|
+
this._scene.reset();
|
|
119
|
+
this._lastFingerprint = "";
|
|
120
|
+
this._lastRenderedLayout = null;
|
|
121
|
+
if (input.renderer === "svg" && this.svgGroup) {
|
|
122
|
+
while (this.svgGroup.firstChild) this.svgGroup.removeChild(this.svgGroup.firstChild);
|
|
123
|
+
}
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const visibleDatasets = this.candlestickDatasets.filter((d) => d.visible);
|
|
127
|
+
const layouts = /* @__PURE__ */ new Map();
|
|
128
|
+
const renderPropsMap = /* @__PURE__ */ new Map();
|
|
129
|
+
const hasScales = !!categoryScale && !!valueScales && valueScales.size > 0;
|
|
130
|
+
if (hasScales) {
|
|
131
|
+
const sharedValueScale = valueScales.values().next().value;
|
|
132
|
+
for (const cd of visibleDatasets) {
|
|
133
|
+
const targetAxisId = cd.props.yAxisId ?? firstValueAxisId;
|
|
134
|
+
const targetValueScale = valueScales.get(targetAxisId) ?? sharedValueScale;
|
|
135
|
+
layouts.set(cd.id, {
|
|
136
|
+
...calculateCandlestickLayout(
|
|
137
|
+
cd.props,
|
|
138
|
+
chartArea,
|
|
139
|
+
{
|
|
140
|
+
categoryScale,
|
|
141
|
+
valueScale: targetValueScale
|
|
142
|
+
},
|
|
143
|
+
input.theme
|
|
144
|
+
),
|
|
145
|
+
datasetIndex: 0
|
|
146
|
+
});
|
|
147
|
+
const overrides = this._propertyOverrides.get(cd.id);
|
|
148
|
+
renderPropsMap.set(cd.id, {
|
|
149
|
+
...cd.props,
|
|
150
|
+
...overrides ?? {},
|
|
151
|
+
hoveredIndex: this._hover.datasetId === cd.id ? this._hover.index : null,
|
|
152
|
+
effects: hoverConfig ? { dimOpacity: hoverConfig.dimOpacity, hoverBrightness: hoverConfig.brightness } : void 0
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
this.layoutCache = layouts;
|
|
157
|
+
this.renderPropsCache = renderPropsMap;
|
|
158
|
+
const context = { chartId, width, height, renderer: input.renderer, chartArea, theme: input.theme, accessibility: buildAccessibilityRenderContext(input.features) };
|
|
159
|
+
if (input.renderer === "canvas" && compositor) {
|
|
160
|
+
registerDatasetLayers(
|
|
161
|
+
compositor,
|
|
162
|
+
"candlestick",
|
|
163
|
+
layouts.keys(),
|
|
164
|
+
(dsId) => datasets.get(dsId)?.order ?? 0,
|
|
165
|
+
(dsId) => (ctx) => {
|
|
166
|
+
const csLayout = this._lastRenderedLayout?.get(dsId) ?? this.layoutCache.get(dsId);
|
|
167
|
+
const csProps = this.renderPropsCache.get(dsId);
|
|
168
|
+
if (!csLayout || !csProps) return;
|
|
169
|
+
this._paint.renderCanvas(csProps, csLayout, ctx, context);
|
|
170
|
+
}
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
const baselineY = chartArea.y + chartArea.height;
|
|
174
|
+
const animConfig = input.features.get("animation")?.props;
|
|
175
|
+
const { enabled, duration, easing } = parseAnimationConfig(animConfig);
|
|
176
|
+
const limit = animConfig?.limit ?? 5e3;
|
|
177
|
+
const fingerprint = buildCandlestickFingerprint(layouts);
|
|
178
|
+
const phase = this._lastFingerprint === "" ? "entrance" : fingerprint !== this._lastFingerprint ? "update" : "static";
|
|
179
|
+
let totalCandles = 0;
|
|
180
|
+
for (const l of layouts.values()) totalCandles += l.candles.length;
|
|
181
|
+
const shouldAnimate = enabled && duration > 0 && totalCandles <= limit && phase !== "static";
|
|
182
|
+
const sceneTargets = this._buildSceneTargets(layouts, baselineY);
|
|
183
|
+
const currentElements = this._scene.getElements();
|
|
184
|
+
let hasExits = false;
|
|
185
|
+
for (const el of currentElements) {
|
|
186
|
+
if (!sceneTargets.has(el.id)) {
|
|
187
|
+
hasExits = true;
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const currentIds = new Set(currentElements.map((el) => el.id));
|
|
192
|
+
let hasEnters = false;
|
|
193
|
+
for (const id of sceneTargets.keys()) {
|
|
194
|
+
if (!currentIds.has(id)) {
|
|
195
|
+
hasEnters = true;
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
const isMidAnimInterrupt = phase === "update" && this._animRafId !== null;
|
|
200
|
+
const shouldSnapUpdates = phase === "update" && !isMidAnimInterrupt && !hasExits && !hasEnters;
|
|
201
|
+
const numbersDuration = shouldSnapUpdates ? 0 : shouldAnimate ? duration : 0;
|
|
202
|
+
const opts = {
|
|
203
|
+
numbers: { duration: numbersDuration, easing },
|
|
204
|
+
colors: { duration: numbersDuration, easing }
|
|
205
|
+
};
|
|
206
|
+
if (phase === "static" && this._animRafId !== null) {
|
|
207
|
+
this._commit(fingerprint);
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
this._cancelRaf();
|
|
211
|
+
this._scene.diff(sceneTargets, opts);
|
|
212
|
+
if (shouldAnimate && !shouldSnapUpdates) {
|
|
213
|
+
this._renderSceneFrame(layouts, renderPropsMap, context, input);
|
|
214
|
+
const tick = (now) => {
|
|
215
|
+
this._animRafId = null;
|
|
216
|
+
const { allIdle } = this._scene.tick(now);
|
|
217
|
+
this._renderSceneFrame(layouts, renderPropsMap, context, input);
|
|
218
|
+
if (!allIdle) {
|
|
219
|
+
this._animRafId = raf(tick);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
this._animRafId = raf(tick);
|
|
223
|
+
} else {
|
|
224
|
+
this._scene.tick(performance.now());
|
|
225
|
+
this._renderSceneFrame(layouts, renderPropsMap, context, input);
|
|
226
|
+
}
|
|
227
|
+
this._commit(fingerprint);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* Build the per-candle scene-target map from the computed cell layouts.
|
|
231
|
+
* Element id format: `${datasetId}::${dataIndex}`. Preserves the hotfix's
|
|
232
|
+
* index-based identity for matching candles across data updates.
|
|
233
|
+
*
|
|
234
|
+
* `baselineY` is included on every target so the scene's `emptyState`
|
|
235
|
+
* callback can read it (the callback receives only `target: T`, no
|
|
236
|
+
* external context).
|
|
237
|
+
*/
|
|
238
|
+
_buildSceneTargets(cellLayouts, baselineY) {
|
|
239
|
+
const targets = /* @__PURE__ */ new Map();
|
|
240
|
+
for (const [datasetId, layout] of cellLayouts) {
|
|
241
|
+
for (const candle of layout.candles) {
|
|
242
|
+
const id = `${datasetId}::${candle.dataIndex}`;
|
|
243
|
+
targets.set(id, {
|
|
244
|
+
x: candle.x,
|
|
245
|
+
bodyWidth: candle.bodyWidth,
|
|
246
|
+
wickTop: candle.wickTop,
|
|
247
|
+
wickBottom: candle.wickBottom,
|
|
248
|
+
bodyTop: candle.bodyTop,
|
|
249
|
+
bodyBottom: candle.bodyBottom,
|
|
250
|
+
openY: candle.openY,
|
|
251
|
+
closeY: candle.closeY,
|
|
252
|
+
baselineY,
|
|
253
|
+
bodyFill: candle.bodyFill,
|
|
254
|
+
bodyStroke: candle.bodyStroke,
|
|
255
|
+
wickColor: candle.wickColor,
|
|
256
|
+
wickStrokeWidth: candle.wickStrokeWidth,
|
|
257
|
+
useClass: candle.useClass,
|
|
258
|
+
direction: candle.direction,
|
|
259
|
+
proDirection: candle.proDirection,
|
|
260
|
+
borderDash: candle.borderDash,
|
|
261
|
+
borderDashOffset: candle.borderDashOffset,
|
|
262
|
+
visible: candle.visible,
|
|
263
|
+
dataIndex: candle.dataIndex,
|
|
264
|
+
datasetId,
|
|
265
|
+
label: candle.label,
|
|
266
|
+
open: candle.open,
|
|
267
|
+
high: candle.high,
|
|
268
|
+
low: candle.low,
|
|
269
|
+
close: candle.close
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return targets;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Walk the scene and rebuild per-dataset CandlestickRenderData reflecting
|
|
277
|
+
* the current visual state. Used by the raf tick loop AND for one-shot
|
|
278
|
+
* static renders. Stores the result in `_lastRenderedLayout` so hitTest
|
|
279
|
+
* and the canvas compositor paint closure continue to read live state.
|
|
280
|
+
*
|
|
281
|
+
* The interrupt-safety contract previously provided by snapshotting
|
|
282
|
+
* `_lastRenderedLayout` as the next tween's start is now structural via
|
|
283
|
+
* AnimatedElement.setTarget capturing `current[field]` automatically per
|
|
284
|
+
* candle. `_lastRenderedLayout` here is a READ-only projection of the
|
|
285
|
+
* scene used by hit-test and compositor callbacks.
|
|
286
|
+
*/
|
|
287
|
+
_renderSceneFrame(cellLayouts, renderPropsMap, context, input) {
|
|
288
|
+
const candlesByDataset = /* @__PURE__ */ new Map();
|
|
289
|
+
for (const el of this._scene.getElements()) {
|
|
290
|
+
const s = el.current;
|
|
291
|
+
const candle = {
|
|
292
|
+
x: s.x,
|
|
293
|
+
bodyWidth: s.bodyWidth,
|
|
294
|
+
wickTop: s.wickTop,
|
|
295
|
+
wickBottom: s.wickBottom,
|
|
296
|
+
bodyTop: s.bodyTop,
|
|
297
|
+
bodyBottom: s.bodyBottom,
|
|
298
|
+
openY: s.openY,
|
|
299
|
+
closeY: s.closeY,
|
|
300
|
+
bodyFill: s.bodyFill,
|
|
301
|
+
bodyStroke: s.bodyStroke,
|
|
302
|
+
wickColor: s.wickColor,
|
|
303
|
+
wickStrokeWidth: s.wickStrokeWidth,
|
|
304
|
+
useClass: s.useClass,
|
|
305
|
+
direction: s.direction,
|
|
306
|
+
proDirection: s.proDirection,
|
|
307
|
+
borderDash: s.borderDash,
|
|
308
|
+
borderDashOffset: s.borderDashOffset,
|
|
309
|
+
visible: s.visible,
|
|
310
|
+
dataIndex: s.dataIndex,
|
|
311
|
+
label: s.label,
|
|
312
|
+
open: s.open,
|
|
313
|
+
high: s.high,
|
|
314
|
+
low: s.low,
|
|
315
|
+
close: s.close
|
|
316
|
+
};
|
|
317
|
+
let arr = candlesByDataset.get(s.datasetId);
|
|
318
|
+
if (!arr) {
|
|
319
|
+
arr = [];
|
|
320
|
+
candlesByDataset.set(s.datasetId, arr);
|
|
321
|
+
}
|
|
322
|
+
arr.push(candle);
|
|
323
|
+
}
|
|
324
|
+
const frameLayouts = /* @__PURE__ */ new Map();
|
|
325
|
+
const frameRenderProps = /* @__PURE__ */ new Map();
|
|
326
|
+
const datasetIds = /* @__PURE__ */ new Set([...cellLayouts.keys(), ...candlesByDataset.keys()]);
|
|
327
|
+
for (const datasetId of datasetIds) {
|
|
328
|
+
const targetLayout = cellLayouts.get(datasetId) ?? this._renderLayouts.get(datasetId);
|
|
329
|
+
if (!targetLayout) continue;
|
|
330
|
+
const baseRenderProps = renderPropsMap.get(datasetId) ?? this._activeRenderPropsCache.get(datasetId);
|
|
331
|
+
if (!baseRenderProps) continue;
|
|
332
|
+
const overrides = this._propertyOverrides.get(datasetId);
|
|
333
|
+
const renderProps = overrides ? { ...baseRenderProps, ...overrides } : baseRenderProps;
|
|
334
|
+
const liveCandles = candlesByDataset.get(datasetId) ?? [];
|
|
335
|
+
liveCandles.sort((a, b) => a.dataIndex - b.dataIndex);
|
|
336
|
+
frameLayouts.set(datasetId, {
|
|
337
|
+
...targetLayout,
|
|
338
|
+
candles: liveCandles,
|
|
339
|
+
visibleCandles: liveCandles.filter((c) => c.visible)
|
|
340
|
+
});
|
|
341
|
+
frameRenderProps.set(datasetId, renderProps);
|
|
342
|
+
}
|
|
343
|
+
this._renderLayouts = frameLayouts;
|
|
344
|
+
this._activeRenderPropsCache = frameRenderProps;
|
|
345
|
+
this._lastRenderedLayout = frameLayouts;
|
|
346
|
+
this.renderFrame(frameLayouts, frameRenderProps, context, input);
|
|
347
|
+
}
|
|
348
|
+
_cancelRaf() {
|
|
349
|
+
if (this._animRafId !== null) {
|
|
350
|
+
cancelRaf(this._animRafId);
|
|
351
|
+
this._animRafId = null;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
_commit(fingerprint) {
|
|
355
|
+
this._lastFingerprint = fingerprint;
|
|
356
|
+
}
|
|
357
|
+
renderFrame(frameLayouts, renderPropsMap, context, input) {
|
|
358
|
+
if (input.renderer === "svg" && this.svgGroup) {
|
|
359
|
+
const group = this.svgGroup;
|
|
360
|
+
const children = buildCandlestickSvgChildren({ paint: this._paint, frameLayouts, frameRenderProps: renderPropsMap, context, hover: this._hover });
|
|
361
|
+
group.replaceChildren(...children.map(materializeSvgNode));
|
|
362
|
+
}
|
|
363
|
+
if (triggerCompositorRepaint(input.renderer, this.canvasEl, input.compositor)) ; else if (input.renderer === "canvas") {
|
|
364
|
+
const ctx = this.canvasEl?.getContext("2d");
|
|
365
|
+
if (ctx) {
|
|
366
|
+
for (const [dsId, csLayout] of frameLayouts) {
|
|
367
|
+
const csProps = renderPropsMap.get(dsId);
|
|
368
|
+
if (!csProps) continue;
|
|
369
|
+
this._paint.renderCanvas(csProps, csLayout, ctx, context);
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
applyHover(hover) {
|
|
375
|
+
if (this.layoutCache.size === 0 || !this.lastInput) return;
|
|
376
|
+
const input = this.lastInput;
|
|
377
|
+
this._hover = hover;
|
|
378
|
+
if (this._animRafId !== null) return;
|
|
379
|
+
if (input.renderer === "svg" && this.svgGroup) {
|
|
380
|
+
const context = {
|
|
381
|
+
chartId: input.chartId,
|
|
382
|
+
width: input.width,
|
|
383
|
+
height: input.height,
|
|
384
|
+
renderer: input.renderer,
|
|
385
|
+
chartArea: input.chartArea,
|
|
386
|
+
theme: input.theme,
|
|
387
|
+
accessibility: buildAccessibilityRenderContext(input.features)
|
|
388
|
+
};
|
|
389
|
+
const children = buildCandlestickSvgChildren({
|
|
390
|
+
paint: this._paint,
|
|
391
|
+
frameLayouts: this._renderLayouts,
|
|
392
|
+
frameRenderProps: this._activeRenderPropsCache,
|
|
393
|
+
context,
|
|
394
|
+
hover
|
|
395
|
+
});
|
|
396
|
+
reconcileSvgChildren(this.svgGroup, children);
|
|
397
|
+
return;
|
|
398
|
+
}
|
|
399
|
+
if (input.renderer === "canvas" && input.compositor) {
|
|
400
|
+
for (const [dsId, props] of this.renderPropsCache) {
|
|
401
|
+
this.renderPropsCache.set(dsId, { ...props, hoveredIndex: hover.datasetId === dsId ? hover.index : null });
|
|
402
|
+
}
|
|
403
|
+
triggerCompositorRepaint(input.renderer, this.canvasEl, input.compositor);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* Apply animated property values without triggering a full layout cycle.
|
|
408
|
+
* Called from the property-animation framework wrapper each animation tick.
|
|
409
|
+
*
|
|
410
|
+
* Per-dataset: writes overrides into `_propertyOverrides` (or deletes the
|
|
411
|
+
* entry when the store has no live values for it), then patches downstream
|
|
412
|
+
* caches and triggers a repaint. The overrides apply uniformly to all
|
|
413
|
+
* candles of the dataset — per-candle granularity is Step 14.
|
|
414
|
+
*
|
|
415
|
+
* SVG: candlestick renders candles imperatively each frame from
|
|
416
|
+
* `_activeRenderPropsCache`, so a `renderFrameCycle()` call replays the
|
|
417
|
+
* merged props onto the DOM. Canvas: refreshes the cache then triggers
|
|
418
|
+
* compositor repaint so the layer paint callback reads the merged props.
|
|
419
|
+
*/
|
|
420
|
+
applyPropertyAnimations(store) {
|
|
421
|
+
const input = this.lastInput;
|
|
422
|
+
if (!input) return;
|
|
423
|
+
let appliedAny = false;
|
|
424
|
+
for (const [dsId, baseProps] of this.renderPropsCache) {
|
|
425
|
+
const overrides = resolveAnimatedProps(store, "candlestick", dsId, CANDLESTICK_ANIMATABLE_PROPS);
|
|
426
|
+
if (Object.keys(overrides).length === 0) {
|
|
427
|
+
if (this._propertyOverrides.delete(dsId)) appliedAny = true;
|
|
428
|
+
continue;
|
|
429
|
+
}
|
|
430
|
+
appliedAny = true;
|
|
431
|
+
this._propertyOverrides.set(dsId, overrides);
|
|
432
|
+
this.renderPropsCache.set(dsId, { ...baseProps, ...overrides });
|
|
433
|
+
const activeBase = this._activeRenderPropsCache.get(dsId);
|
|
434
|
+
if (activeBase) {
|
|
435
|
+
this._activeRenderPropsCache.set(dsId, { ...activeBase, ...overrides });
|
|
436
|
+
}
|
|
437
|
+
}
|
|
438
|
+
if (!appliedAny) return;
|
|
439
|
+
if (triggerCompositorRepaint(input.renderer, this.canvasEl, input.compositor)) return;
|
|
440
|
+
if (input.renderer === "svg") {
|
|
441
|
+
this.renderFrameCycle();
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Full re-render of the current scene state.
|
|
446
|
+
*
|
|
447
|
+
* Used by the property-animation framework wrapper: when a property
|
|
448
|
+
* animation completes and its override is released from the store,
|
|
449
|
+
* `_renderSceneFrame()` rebuilds `_activeRenderPropsCache` from the now-empty
|
|
450
|
+
* overrides map, then projects the cleaned props to DOM / canvas so SVG
|
|
451
|
+
* attributes snap back to base values.
|
|
452
|
+
*/
|
|
453
|
+
renderFrameCycle() {
|
|
454
|
+
const input = this.lastInput;
|
|
455
|
+
if (!input) return;
|
|
456
|
+
const context = { chartId: input.chartId, width: input.width, height: input.height, renderer: input.renderer, chartArea: input.chartArea, theme: input.theme, accessibility: buildAccessibilityRenderContext(input.features) };
|
|
457
|
+
this._renderSceneFrame(this.layoutCache, this.renderPropsCache, context, input);
|
|
458
|
+
}
|
|
459
|
+
hitTest(x, y) {
|
|
460
|
+
const layouts = this._lastRenderedLayout ?? this.layoutCache;
|
|
461
|
+
return candlestickHitTest(x, y, { layouts, renderPropsCache: this.renderPropsCache, layoutData: this.lastInput?.layoutData ?? null });
|
|
462
|
+
}
|
|
463
|
+
findAllNearest(x, y) {
|
|
464
|
+
const layouts = this._lastRenderedLayout ?? this.layoutCache;
|
|
465
|
+
return candlestickFindAllNearest(x, y, { layouts, renderPropsCache: this.renderPropsCache, layoutData: this.lastInput?.layoutData ?? null });
|
|
466
|
+
}
|
|
467
|
+
getSvgOutput() {
|
|
468
|
+
return null;
|
|
469
|
+
}
|
|
470
|
+
get hasData() {
|
|
471
|
+
return this.candlestickDatasets.length > 0;
|
|
472
|
+
}
|
|
473
|
+
get layouts() {
|
|
474
|
+
return this.layoutCache;
|
|
475
|
+
}
|
|
476
|
+
destroy() {
|
|
477
|
+
this._cancelRaf();
|
|
478
|
+
this._scene.reset();
|
|
479
|
+
this._lastFingerprint = "";
|
|
480
|
+
this._lastRenderedLayout = null;
|
|
481
|
+
this._renderLayouts.clear();
|
|
482
|
+
this._activeRenderPropsCache.clear();
|
|
483
|
+
this._propertyOverrides.clear();
|
|
484
|
+
this.lastInput?.compositor?.removeLayersByPrefix("candlestick:");
|
|
485
|
+
}
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
export { CandlestickRendererController };
|