@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,130 @@
|
|
|
1
|
+
import { SyncBusLike, AxisWidths, AxisWidthsCallback, SyncDatasetInfo, ResolvedSyncConfig, SyncExtremesCallback, SyncHighlightCallback, SyncVisibilityCallback, SyncExtremesEvent, SyncHighlightEvent, SyncVisibilityEvent, SyncConfig } from '@primeui/chart-types/sync';
|
|
2
|
+
export { AxisWidths } from '@primeui/chart-types/sync';
|
|
3
|
+
import { ZoomState } from '@primeui/chart-types/zoom';
|
|
4
|
+
import { DatasetRegistration } from '@primeui/chart-types/context';
|
|
5
|
+
import { ChartTheme } from '@primeui/chart-types/theme';
|
|
6
|
+
import { SyncedHighlightResult, RendererDelegate } from '@primeui/chart-types/orchestrator';
|
|
7
|
+
|
|
8
|
+
/** Resolve user-facing SyncConfig into normalized form */
|
|
9
|
+
declare function resolveSyncConfig(sync: boolean | SyncConfig | undefined): ResolvedSyncConfig;
|
|
10
|
+
/**
|
|
11
|
+
* SyncBus — coordination bus for multi-chart synchronization.
|
|
12
|
+
*
|
|
13
|
+
* Each Chart.Svg / Chart.Canvas registers with a unique chartId and
|
|
14
|
+
* its resolved sync config. Separate subscribe() calls add listeners
|
|
15
|
+
* that stack independently — no overwriting.
|
|
16
|
+
*
|
|
17
|
+
* When a chart broadcasts an event, the bus forwards it to all other
|
|
18
|
+
* registered charts that have matching sync config and listeners.
|
|
19
|
+
*/
|
|
20
|
+
declare class SyncBus implements SyncBusLike {
|
|
21
|
+
private charts;
|
|
22
|
+
private axisWidthsMap;
|
|
23
|
+
private _maxAxisWidths;
|
|
24
|
+
private axisWidthsListeners;
|
|
25
|
+
/** Publish this chart's natural (un-padded) Y-axis left/right widths. No-op if unchanged. */
|
|
26
|
+
publishAxisWidths(chartId: string, widths: AxisWidths): void;
|
|
27
|
+
/** Get the current max axis widths across all registered charts. */
|
|
28
|
+
getMaxAxisWidths(): AxisWidths;
|
|
29
|
+
/** Subscribe to max axis width changes. Returns an unsubscribe function. */
|
|
30
|
+
subscribeAxisWidths(callback: AxisWidthsCallback): () => void;
|
|
31
|
+
private recomputeMaxAxisWidths;
|
|
32
|
+
private datasetRegistry;
|
|
33
|
+
private datasetListeners;
|
|
34
|
+
/** Register datasets from a chart (for shared legend). Replaces previous entry for this chartId. */
|
|
35
|
+
registerDatasets(chartId: string, datasets: SyncDatasetInfo[]): void;
|
|
36
|
+
/** Unregister datasets when a chart unmounts */
|
|
37
|
+
unregisterDatasets(chartId: string): void;
|
|
38
|
+
/** Get all registered datasets across all charts */
|
|
39
|
+
getAllDatasets(): Map<string, SyncDatasetInfo[]>;
|
|
40
|
+
/** Subscribe to dataset registry changes. Returns unsubscribe function. */
|
|
41
|
+
subscribeDatasets(callback: () => void): () => void;
|
|
42
|
+
private notifyDatasetListeners;
|
|
43
|
+
/** Register a chart instance with its sync config (no callbacks) */
|
|
44
|
+
register(chartId: string, config: ResolvedSyncConfig): void;
|
|
45
|
+
/** Subscribe to a sync event type. Returns an unsubscribe function. */
|
|
46
|
+
subscribe(chartId: string, type: 'extremes', callback: SyncExtremesCallback): () => void;
|
|
47
|
+
subscribe(chartId: string, type: 'highlight', callback: SyncHighlightCallback): () => void;
|
|
48
|
+
subscribe(chartId: string, type: 'visibility', callback: SyncVisibilityCallback): () => void;
|
|
49
|
+
/** Update a chart's sync config (e.g. when sync prop changes) */
|
|
50
|
+
updateConfig(chartId: string, config: ResolvedSyncConfig): void;
|
|
51
|
+
/** Unregister a chart instance and all its subscriptions */
|
|
52
|
+
unregister(chartId: string): void;
|
|
53
|
+
/** Broadcast an extremes (zoom/pan) event from a source chart */
|
|
54
|
+
broadcastExtremes(event: SyncExtremesEvent): void;
|
|
55
|
+
/** Broadcast a highlight (cursor) event from a source chart */
|
|
56
|
+
broadcastHighlight(event: SyncHighlightEvent): void;
|
|
57
|
+
/** Broadcast a visibility (series toggle) event from a source chart */
|
|
58
|
+
broadcastVisibility(event: SyncVisibilityEvent): void;
|
|
59
|
+
/** Get number of registered charts */
|
|
60
|
+
get size(): number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Callbacks the framework provides — called by the coordinator when incoming sync events arrive. */
|
|
64
|
+
interface SyncCoordinatorHandlers {
|
|
65
|
+
applyZoom: (state: ZoomState) => void;
|
|
66
|
+
applyVisibility: (seriesId: string, visible: boolean) => void;
|
|
67
|
+
applyItemToggle: (seriesId: string, itemLabel: string) => void;
|
|
68
|
+
applyHighlight: (result: SyncedHighlightResult) => void;
|
|
69
|
+
}
|
|
70
|
+
/** Lazy getters the coordinator calls at event time to read current framework state. */
|
|
71
|
+
interface SyncCoordinatorRefs {
|
|
72
|
+
getZoomState: () => ZoomState;
|
|
73
|
+
getRendererDelegate: () => RendererDelegate | null;
|
|
74
|
+
getIsCartesian: () => boolean;
|
|
75
|
+
getIsRect: () => boolean;
|
|
76
|
+
getHasCrosshair: () => boolean;
|
|
77
|
+
getIsSharedMode: () => boolean;
|
|
78
|
+
getDatasets: () => Map<string, DatasetRegistration>;
|
|
79
|
+
getDimensions: () => {
|
|
80
|
+
width: number;
|
|
81
|
+
height: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
type SyncCoordinatorStartOptions = SyncCoordinatorHandlers & SyncCoordinatorRefs;
|
|
85
|
+
/**
|
|
86
|
+
* Framework-agnostic orchestrator for multi-chart sync.
|
|
87
|
+
*
|
|
88
|
+
* Owns the `isSyncing` guard, `prevVisibility` diff map, `prevZoomState`
|
|
89
|
+
* tracking, and all SyncBus subscription setup.
|
|
90
|
+
*/
|
|
91
|
+
declare class ChartSyncCoordinator {
|
|
92
|
+
private _isSyncing;
|
|
93
|
+
private prevVisibility;
|
|
94
|
+
private prevZoomState;
|
|
95
|
+
/**
|
|
96
|
+
* The last zoom value applied from an incoming sync event. Used by onZoomChange
|
|
97
|
+
* to suppress the echo even when the wrapper's apply effect fires asynchronously
|
|
98
|
+
* (after the `_isSyncing` microtask reset). Cleared once matched.
|
|
99
|
+
*/
|
|
100
|
+
private _lastSyncedZoom;
|
|
101
|
+
private readonly syncInfo;
|
|
102
|
+
constructor(syncInfo: {
|
|
103
|
+
bus: SyncBus;
|
|
104
|
+
chartId: string;
|
|
105
|
+
config: ResolvedSyncConfig;
|
|
106
|
+
});
|
|
107
|
+
get isSyncing(): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Wire up all incoming sync subscriptions.
|
|
110
|
+
* Call once after constructing the coordinator; store the returned
|
|
111
|
+
* cleanup function and invoke it on component unmount.
|
|
112
|
+
*/
|
|
113
|
+
start(options: SyncCoordinatorStartOptions): () => void;
|
|
114
|
+
/** Re-register datasets with the shared legend bus. Call whenever datasets or theme change. */
|
|
115
|
+
updateDatasets(datasets: Map<string, DatasetRegistration>, theme: Required<ChartTheme>): void;
|
|
116
|
+
/**
|
|
117
|
+
* Broadcast zoom state changes to other charts.
|
|
118
|
+
* Always call this when zoom state changes — the guard is handled internally.
|
|
119
|
+
*/
|
|
120
|
+
onZoomChange(current: ZoomState): void;
|
|
121
|
+
/**
|
|
122
|
+
* Diff visibility state and broadcast changes to other charts.
|
|
123
|
+
* Always call this on visibility change — guard and diffing are handled internally.
|
|
124
|
+
* prevVisibility is always updated regardless of isSyncing to prevent stale state
|
|
125
|
+
* on the next outgoing broadcast.
|
|
126
|
+
*/
|
|
127
|
+
onVisibilityChange(visibility: Map<string, boolean>): void;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export { ChartSyncCoordinator, SyncBus, type SyncCoordinatorHandlers, type SyncCoordinatorRefs, type SyncCoordinatorStartOptions, resolveSyncConfig };
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { CartesianFrameParams, CartesianOverlayParams, ResolvedLabel, FrameDataLabelConfig, RenderLabelsOptions, RadarDatasetEntry, BoxArea, GlobalFont, RadarRenderData, PolarDatasetEntry, FieldAccessor, RadialHoverState, ChartTheme, StandardEffectConfig, RadarSeriesProps, PointDescriptionContext, SvgNode, StandardHitTestResult, RadialLayoutBase, XAxisProps, YAxisProps, RadialGridLayout, RadialGridConfig, TooltipData, TooltipValueFormatter, TooltipContent } from '@primeui/chart-types';
|
|
2
|
+
|
|
3
|
+
declare function renderResolvedLabels(labels: ResolvedLabel[], config: FrameDataLabelConfig, options: RenderLabelsOptions): void;
|
|
4
|
+
/**
|
|
5
|
+
* Renders cartesian chrome: grid → background fills → reference lines/bands → axes → brackets.
|
|
6
|
+
* Bar/line/scatter/candlestick/heatmap rendering is handled by their independent hooks.
|
|
7
|
+
* Used by the animation callback, static render path, and hover repaint.
|
|
8
|
+
*
|
|
9
|
+
* SVG path: accumulates SvgNode children into two virtual roots (gridRoot, mainRoot),
|
|
10
|
+
* then replaces each group's DOM content atomically via replaceGroupContent.
|
|
11
|
+
* The repeated `group.appendChild(materializeSvgGroup(x))` pattern is unified
|
|
12
|
+
* into `addNode(root, x)` throughout — one materialization per group at the end.
|
|
13
|
+
* Canvas path: imperative ctx draw calls, unchanged.
|
|
14
|
+
*/
|
|
15
|
+
declare function renderCartesianFrame(params: CartesianFrameParams): void;
|
|
16
|
+
/**
|
|
17
|
+
* Draw all custom render callbacks for cartesian charts on the overlay canvas.
|
|
18
|
+
* Handles: render/renderTick (axes), line renderMarker (custom markers).
|
|
19
|
+
* Uses the generic renderCanvasOverlay for clear/clip/animate infrastructure.
|
|
20
|
+
*/
|
|
21
|
+
declare function renderCartesianOverlay(params: CartesianOverlayParams): void;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Calculate the complete radar chart layout from multiple datasets.
|
|
25
|
+
*
|
|
26
|
+
* **Angle math:**
|
|
27
|
+
* - Each category gets an equal slice: angleStep = 360 / categoryCount
|
|
28
|
+
* - First spoke starts at -90° (12 o'clock), going clockwise
|
|
29
|
+
* - Category i is at angle: -90 + i * angleStep
|
|
30
|
+
*
|
|
31
|
+
* **Radial value mapping:**
|
|
32
|
+
* - Domain [0, niceMax] computed via calculateNiceDomain
|
|
33
|
+
* - Value maps to radius: r = ((value - min) / (max - min)) * maxRadius
|
|
34
|
+
* - value=0 → center, value=max → perimeter
|
|
35
|
+
*
|
|
36
|
+
* **Polar → Cartesian:**
|
|
37
|
+
* - x = center.x + cos(angleRad) * r
|
|
38
|
+
* - y = center.y + sin(angleRad) * r
|
|
39
|
+
*/
|
|
40
|
+
declare function calculateRadarLayout(datasets: RadarDatasetEntry[], chartArea: BoxArea, globalFont?: GlobalFont, sharedCategories?: string[], sharedDomain?: [number, number], perAxisDomains?: Map<string, [number, number]>, referenceBoundaryValues?: number[], perSpokeDomains?: Map<number, [number, number]>, tickCount?: number): Omit<RadarRenderData, 'datasetIndex'>;
|
|
41
|
+
/**
|
|
42
|
+
* Extract merged category list from all datasets (preserving first dataset's order).
|
|
43
|
+
* Exported for reuse by polar renderer.
|
|
44
|
+
*/
|
|
45
|
+
declare function extractCategories(datasets: {
|
|
46
|
+
props: {
|
|
47
|
+
data?: unknown[];
|
|
48
|
+
categoryField?: FieldAccessor<unknown, string>;
|
|
49
|
+
};
|
|
50
|
+
}[]): string[];
|
|
51
|
+
/**
|
|
52
|
+
* Resolve numeric values from a dataset's props.
|
|
53
|
+
* Exported for reuse by polar renderer.
|
|
54
|
+
*/
|
|
55
|
+
declare function resolveValues(props: {
|
|
56
|
+
data?: unknown[];
|
|
57
|
+
valueField?: FieldAccessor<unknown, number>;
|
|
58
|
+
}): number[];
|
|
59
|
+
/**
|
|
60
|
+
* Compute a shared category list and value domain from a mix of radar and polar datasets.
|
|
61
|
+
* Used when both types coexist in one chart so they share the same radial grid.
|
|
62
|
+
*/
|
|
63
|
+
declare function computeRadialComboContext(radarDatasets: RadarDatasetEntry[], polarDatasets: PolarDatasetEntry[]): {
|
|
64
|
+
categories: string[];
|
|
65
|
+
domain: [number, number];
|
|
66
|
+
};
|
|
67
|
+
/**
|
|
68
|
+
* Determine text-anchor for a category label based on its spoke angle.
|
|
69
|
+
* Right hemisphere → 'start', left hemisphere → 'end', top/bottom → 'middle'
|
|
70
|
+
*/
|
|
71
|
+
declare function getCategoryLabelAnchor(angleDeg: number): string;
|
|
72
|
+
/**
|
|
73
|
+
* Calculate per-side label margins based on actual category text.
|
|
74
|
+
*
|
|
75
|
+
* For each label we compute how far it extends beyond the grid perimeter
|
|
76
|
+
* in each cardinal direction, accounting for measured text dimensions,
|
|
77
|
+
* text-anchor assignment, and the text-derived labelPadding gap.
|
|
78
|
+
*/
|
|
79
|
+
/**
|
|
80
|
+
* Calculate per-side label margins based on actual category text at each spoke.
|
|
81
|
+
* Exported for reuse by polar renderer.
|
|
82
|
+
*/
|
|
83
|
+
declare function calculateLabelMargins(categories: string[], angleStep: number, labelPadding: number, fontSize?: number): {
|
|
84
|
+
top: number;
|
|
85
|
+
right: number;
|
|
86
|
+
bottom: number;
|
|
87
|
+
left: number;
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Render a single radar series as SVG (polygon fill + stroke + markers)
|
|
92
|
+
*/
|
|
93
|
+
declare function renderRadarSeriesSvg(layout: RadarRenderData, seriesIndex: number, hoverState: RadialHoverState, theme: Required<ChartTheme>, effectConfig?: StandardEffectConfig, seriesProps?: RadarSeriesProps, a11y?: {
|
|
94
|
+
enabled: boolean;
|
|
95
|
+
pointDescriptionThreshold: number;
|
|
96
|
+
pointDescriptionFormatter?: (ctx: PointDescriptionContext) => string;
|
|
97
|
+
}, context?: {
|
|
98
|
+
chartId: string;
|
|
99
|
+
}): SvgNode;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Render a single radar series to canvas
|
|
103
|
+
*/
|
|
104
|
+
declare function renderRadarSeriesCanvas(ctx: CanvasRenderingContext2D, layout: RadarRenderData, seriesIndex: number, hoverState: RadialHoverState, effectConfig: StandardEffectConfig | undefined, seriesProps: RadarSeriesProps | undefined, theme: Required<ChartTheme>): void;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Find the nearest radar point to the given coordinates.
|
|
108
|
+
* Returns the dataset ID and point index, or null if no point is within hit radius.
|
|
109
|
+
*/
|
|
110
|
+
declare function hitTestRadar(x: number, y: number, layout: RadarRenderData, theme: Required<ChartTheme>): StandardHitTestResult | null;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Resolves XAxis/YAxis props into a fully-defaulted RadialGridLayout.
|
|
114
|
+
*
|
|
115
|
+
* - Returns `xAxis: null` when `xAxisProps` is undefined (ChartXAxis not declared)
|
|
116
|
+
* → renderer skips spoke labels and outer ring.
|
|
117
|
+
* - Returns `yAxis: null` when `yAxisProps` is undefined and no per-spoke yAxes declared
|
|
118
|
+
* → renderer skips concentric rings and tick labels.
|
|
119
|
+
*
|
|
120
|
+
* Mode selection:
|
|
121
|
+
* - Shared (`yAxis.mode === 'shared'`): single value scale across all spokes.
|
|
122
|
+
* Active when `base.perSpokeDomains` is null/undefined.
|
|
123
|
+
* - Per-spoke (`yAxis.mode === 'perSpoke'`): each spoke has its own scale.
|
|
124
|
+
* Active when `base.perSpokeDomains` is set (controller detected at least one
|
|
125
|
+
* ChartYAxis with a `category` binding).
|
|
126
|
+
*
|
|
127
|
+
* Tick-hop (shared mode only): when the outermost tick sits at or below the data max,
|
|
128
|
+
* extends the domain by one tick step so the perimeter doesn't visually touch the data.
|
|
129
|
+
* - If `yAxisProps.tickCount` is set → re-runs generateNiceTicks(min, extended, count, exact=true)
|
|
130
|
+
* - Otherwise → appends one tick at lastTick + tickStep
|
|
131
|
+
*
|
|
132
|
+
* Per-spoke mode: each spoke's tick set is generated independently from its own domain.
|
|
133
|
+
* Per-spoke styling falls back to the default `yAxisProps`; declared category-bound
|
|
134
|
+
* yAxes override font/color/tickFormat for that spoke specifically.
|
|
135
|
+
*/
|
|
136
|
+
/**
|
|
137
|
+
* Resolve the settled shared-mode radial tick set (values + radii + tick-aligned domain).
|
|
138
|
+
*
|
|
139
|
+
* Single source of truth shared by buildRadialGridLayout (settled render) and the radial
|
|
140
|
+
* controllers (which slide this exact set during a transition). Keeping it in one place
|
|
141
|
+
* guarantees the animation lands precisely on the settled grid — no end-of-zoom pop.
|
|
142
|
+
*
|
|
143
|
+
* - `tickCount` set (>=2) → exactly that many nice ticks pinned to the raw data max.
|
|
144
|
+
* - otherwise → tick-hop: extend by one step when the outer tick sits at/below the data max.
|
|
145
|
+
*/
|
|
146
|
+
declare function resolveSharedRadialGrid(grid: RadialGridConfig, domain: [number, number], rawDataMax: number | undefined, radius: number, tickCount?: number): {
|
|
147
|
+
levelValues: number[];
|
|
148
|
+
levelRadii: number[];
|
|
149
|
+
domain: [number, number];
|
|
150
|
+
};
|
|
151
|
+
declare function buildRadialGridLayout(base: RadialLayoutBase, xAxisProps: XAxisProps | undefined, yAxisProps: YAxisProps | undefined, yAxesByCategory?: Map<string, YAxisProps>, chartType?: 'radar' | 'polar'): RadialGridLayout;
|
|
152
|
+
|
|
153
|
+
declare function renderRadialGridSvg(layout: RadialGridLayout, theme: Required<ChartTheme>, axisIndex?: number): SvgNode;
|
|
154
|
+
|
|
155
|
+
declare function renderRadialGridCanvas(ctx: CanvasRenderingContext2D, layout: RadialGridLayout, theme: Required<ChartTheme>, axisIndex?: number): void;
|
|
156
|
+
/**
|
|
157
|
+
* Full canvas redraw pipeline for the radial renderer.
|
|
158
|
+
*
|
|
159
|
+
* Framework layers call this whenever any composable/hook needs a canvas
|
|
160
|
+
* repaint (data change, hover, animation frame).
|
|
161
|
+
*/
|
|
162
|
+
declare function redrawRadialCanvas(ctx: CanvasRenderingContext2D, canvas: HTMLCanvasElement, gridLayout: RadialGridLayout | null, renderPolarContent: ((ctx: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void) | null, renderRadarContent: ((ctx: CanvasRenderingContext2D, canvas: HTMLCanvasElement) => void) | null, theme: Required<ChartTheme>): void;
|
|
163
|
+
|
|
164
|
+
interface BuildTooltipOptions {
|
|
165
|
+
locale?: string;
|
|
166
|
+
valueFormatter?: TooltipValueFormatter;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Build a structured tooltip content descriptor from tooltip state.
|
|
170
|
+
* Framework renderers use this to render the appropriate layout
|
|
171
|
+
* without duplicating branching logic.
|
|
172
|
+
*/
|
|
173
|
+
declare function buildTooltipContent(data: TooltipData, isSharedMode: boolean, opts?: BuildTooltipOptions): TooltipContent;
|
|
174
|
+
type TooltipPosition = 'cursor' | 'top' | 'bottom' | 'left' | 'right';
|
|
175
|
+
interface TooltipPositionInput {
|
|
176
|
+
position: TooltipPosition;
|
|
177
|
+
/** Cursor point the core reports (already includes the +10 hit-test nudge). */
|
|
178
|
+
cursorX: number;
|
|
179
|
+
cursorY: number;
|
|
180
|
+
offsetX: number;
|
|
181
|
+
offsetY: number;
|
|
182
|
+
/** Measured rendered tooltip size; 0 when not yet measured (clamping is skipped). */
|
|
183
|
+
tooltipWidth: number;
|
|
184
|
+
tooltipHeight: number;
|
|
185
|
+
containerWidth: number;
|
|
186
|
+
containerHeight: number;
|
|
187
|
+
isSharedMode: boolean;
|
|
188
|
+
rtl: boolean;
|
|
189
|
+
}
|
|
190
|
+
/** Positioning fields to spread onto the tooltip element's style (over `TOOLTIP_BASE_STYLE`). */
|
|
191
|
+
interface TooltipPositionStyle {
|
|
192
|
+
left?: string;
|
|
193
|
+
top?: string;
|
|
194
|
+
right?: string;
|
|
195
|
+
bottom?: string;
|
|
196
|
+
transform?: string;
|
|
197
|
+
transition?: string;
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Compute the tooltip element's positioning style — framework-agnostic.
|
|
201
|
+
*
|
|
202
|
+
* Handles the five `position` modes plus smart boundary clamping for the default
|
|
203
|
+
* `cursor` mode (flips the tooltip to the other side of the cursor when it would
|
|
204
|
+
* overflow the chart, falling back to a no-clamp follow when dimensions are
|
|
205
|
+
* unknown). Returns only the position-specific fields; callers spread them over
|
|
206
|
+
* `TOOLTIP_BASE_STYLE` (+ appearance).
|
|
207
|
+
*/
|
|
208
|
+
declare function computeTooltipPosition(input: TooltipPositionInput): TooltipPositionStyle;
|
|
209
|
+
|
|
210
|
+
export { type TooltipPosition as T, buildTooltipContent as a, buildRadialGridLayout as b, calculateRadarLayout as c, computeRadialComboContext as d, computeTooltipPosition as e, renderCartesianFrame as f, renderCartesianOverlay as g, hitTestRadar as h, renderRadarSeriesCanvas as i, renderRadarSeriesSvg as j, renderRadialGridCanvas as k, renderRadialGridSvg as l, renderResolvedLabels as m, resolveSharedRadialGrid as n, type TooltipPositionInput as o, type TooltipPositionStyle as p, calculateLabelMargins as q, redrawRadialCanvas as r, extractCategories as s, getCategoryLabelAnchor as t, resolveValues as u };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export { C as ColorParser, D as DEFAULT_HEAT_COLORS, R as RGBA, a as adjustBrightness, b as asGradient, y as brightenGradientStops, c as buildAutoColorScale, d as createCanvasGradientFromColor, e as createSvgGradientFromColor, g as getColor, f as getColorValue, h as getPrimaryColor, i as gradientToCssBackground, m as hexToRgbString, n as hexToRgba, j as interpolateColor, o as isGradientColor, l as lerpColor, q as normalizeGradient, t as parseColorToRGB, p as parseColorToRGBA, u as parseHexColor, v as remapStopsForDonut, w as resolveColorScaleRange, r as resolveSwatchColor, k as resolveSwatchGradientStops, x as sampleGradientAt, s as setColorParser } from '../../scale-KFv30jqZ.mjs';
|
|
2
|
+
import { ColorValue } from '@primeui/chart-types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Calculate relative luminance from RGB values.
|
|
6
|
+
* Uses ITU-R BT.709 formula (W3C WCAG standard) for perceived brightness.
|
|
7
|
+
*
|
|
8
|
+
* @param r - Red component (0-255)
|
|
9
|
+
* @param g - Green component (0-255)
|
|
10
|
+
* @param b - Blue component (0-255)
|
|
11
|
+
* @returns Luminance value 0-1 (0 = black, 1 = white)
|
|
12
|
+
*/
|
|
13
|
+
declare function calculateLuminanceFromRGB(r: number, g: number, b: number): number;
|
|
14
|
+
/**
|
|
15
|
+
* Perceived brightness via the YIQ / Rec. 601 luma formula (0–1).
|
|
16
|
+
*
|
|
17
|
+
* This is the single source for TEXT-CONTRAST decisions (which label color is legible on a
|
|
18
|
+
* background) — deliberately kept distinct from `calculateLuminanceFromRGB` (BT.709 relative
|
|
19
|
+
* luminance). All contrast helpers (`getContrastColor`, `isColorDark`) route through this so
|
|
20
|
+
* the "is this background dark?" decision is consistent everywhere.
|
|
21
|
+
*
|
|
22
|
+
* @returns Perceived brightness 0-1 (0 = black, 1 = white)
|
|
23
|
+
*/
|
|
24
|
+
declare function perceivedLuminanceFromRGB(r: number, g: number, b: number): number;
|
|
25
|
+
/**
|
|
26
|
+
* Calculate relative luminance of a color.
|
|
27
|
+
* Uses ITU-R BT.709 formula for perceived brightness.
|
|
28
|
+
*
|
|
29
|
+
* @param color - CSS color string
|
|
30
|
+
* @returns Luminance value 0-1 (0 = black, 1 = white), or 0.5 if parsing fails
|
|
31
|
+
*/
|
|
32
|
+
declare function getColorLuminance(color: string): number;
|
|
33
|
+
/**
|
|
34
|
+
* Calculate weighted average luminance of gradient stops.
|
|
35
|
+
*
|
|
36
|
+
* @param stops - Array of gradient stops with offset and color
|
|
37
|
+
* @returns Average luminance 0-1
|
|
38
|
+
*/
|
|
39
|
+
declare function getGradientLuminance(stops: Array<{
|
|
40
|
+
offset: number;
|
|
41
|
+
color: string;
|
|
42
|
+
}>): number;
|
|
43
|
+
/**
|
|
44
|
+
* Get a contrasting text color for a given background color.
|
|
45
|
+
* Returns white for dark backgrounds, dark gray for light backgrounds.
|
|
46
|
+
*
|
|
47
|
+
* @param bgColor - Background ColorValue (string or gradient)
|
|
48
|
+
* @param threshold - Luminance threshold (default 0.5)
|
|
49
|
+
* @returns Contrasting text color string
|
|
50
|
+
*/
|
|
51
|
+
declare function getContrastingTextColor(bgColor: ColorValue, threshold?: number): string;
|
|
52
|
+
/**
|
|
53
|
+
* Returns a readable text color ('#FFFFFF' or '#374151') based on background luminance.
|
|
54
|
+
* Uses WCAG relative luminance formula.
|
|
55
|
+
*/
|
|
56
|
+
declare function getContrastColor(bgColor: string): string;
|
|
57
|
+
|
|
58
|
+
export { calculateLuminanceFromRGB, getColorLuminance, getContrastColor, getContrastingTextColor, getGradientLuminance, perceivedLuminanceFromRGB };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { DEFAULT_HEAT_COLORS, buildAutoColorScale, calculateLuminanceFromRGB, getColorLuminance, getContrastColor, getContrastingTextColor, getGradientLuminance, interpolateColor, lerpColor, perceivedLuminanceFromRGB, resolveColorScaleRange } from '../../chunk-QS76E3TD.mjs';
|
|
2
|
+
export { asGradient, createCanvasGradientFromColor, createSvgGradientFromColor, getColor, getColorValue, getPrimaryColor, gradientToCssBackground, isGradientColor, normalizeGradient, remapStopsForDonut, resolveSwatchColor, resolveSwatchGradientStops, sampleGradientAt } from '../../chunk-O2X6FF45.mjs';
|
|
3
|
+
export { adjustBrightness, brightenGradientStops, hexToRgbString, hexToRgba, parseColorToRGB, parseColorToRGBA, parseHexColor, setColorParser } from '../../chunk-SSLTFJ3U.mjs';
|
|
4
|
+
import '../../chunk-RQ3CKQOX.mjs';
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { TimeUnit, TimeInterval, TimeTickConfig, DateTimeFormatConfig, AggregationMethod, CartesianDomainParams, DomainSeries, DomainContribution, VisibleValuesSeries, ScatterDatasetInfo, AxisConfig } from '@primeui/chart-types';
|
|
2
|
+
export { c as collectItems } from '../../collect.utils-DiKB4ciO.mjs';
|
|
3
|
+
|
|
4
|
+
/** Millisecond values for each time unit */
|
|
5
|
+
declare const MS: {
|
|
6
|
+
readonly millisecond: 1;
|
|
7
|
+
readonly second: 1000;
|
|
8
|
+
readonly minute: 60000;
|
|
9
|
+
readonly hour: 3600000;
|
|
10
|
+
readonly day: 86400000;
|
|
11
|
+
readonly week: 604800000;
|
|
12
|
+
readonly month: 2592000000;
|
|
13
|
+
readonly quarter: 7776000000;
|
|
14
|
+
readonly year: 31536000000;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Ordered list of candidate tick intervals (Highcharts-style).
|
|
18
|
+
* selectTickInterval() picks the finest interval where tick count
|
|
19
|
+
* stays ≤ pixelWidth / minSpacing.
|
|
20
|
+
*/
|
|
21
|
+
declare const TICK_INTERVALS: TimeInterval[];
|
|
22
|
+
/**
|
|
23
|
+
* Default Intl.DateTimeFormatOptions per unit (Highcharts dateTimeLabelFormats style).
|
|
24
|
+
*/
|
|
25
|
+
declare const DEFAULT_FORMATS: Record<TimeUnit, Intl.DateTimeFormatOptions>;
|
|
26
|
+
/**
|
|
27
|
+
* Convert any date-like value to millisecond timestamp.
|
|
28
|
+
* Supports: Date objects, ISO strings, numeric timestamps.
|
|
29
|
+
* Returns NaN for invalid input.
|
|
30
|
+
*/
|
|
31
|
+
declare function toTimestamp(value: unknown): number;
|
|
32
|
+
/** Approximate ms span for a given interval (for counting ticks) */
|
|
33
|
+
declare function intervalSpanMs(interval: TimeInterval): number;
|
|
34
|
+
/**
|
|
35
|
+
* Pick the finest interval where tick count ≤ pixelWidth / minSpacing.
|
|
36
|
+
*/
|
|
37
|
+
declare function selectTickInterval(domainSpanMs: number, pixelWidth: number, config?: TimeTickConfig): TimeInterval;
|
|
38
|
+
/**
|
|
39
|
+
* Floor a timestamp to the nearest boundary for a given unit and multiple.
|
|
40
|
+
* Uses UTC internally for consistent results.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* floorToUnit(Date.parse('2024-01-15T14:30:00Z'), 'hour', 1)
|
|
44
|
+
* // → 2024-01-15T14:00:00Z
|
|
45
|
+
*
|
|
46
|
+
* floorToUnit(Date.parse('2024-03-15'), 'month', 1)
|
|
47
|
+
* // → 2024-03-01T00:00:00Z
|
|
48
|
+
*/
|
|
49
|
+
declare function floorToUnit(timestamp: number, unit: TimeUnit, multiple: number): number;
|
|
50
|
+
/**
|
|
51
|
+
* Advance a timestamp by N units, handling variable-length months/years.
|
|
52
|
+
*/
|
|
53
|
+
declare function advanceByUnit(timestamp: number, unit: TimeUnit, count: number): number;
|
|
54
|
+
|
|
55
|
+
declare function generateTimeTicks(min: number, max: number, pixelWidth: number, config?: TimeTickConfig): {
|
|
56
|
+
ticks: number[];
|
|
57
|
+
interval: TimeInterval;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Format a timestamp for a given time unit.
|
|
61
|
+
* Uses Intl.DateTimeFormat with caching for performance.
|
|
62
|
+
*/
|
|
63
|
+
declare function formatTimeTick(timestamp: number, unit: TimeUnit, timezone?: string, overrides?: DateTimeFormatConfig, locale?: string): string;
|
|
64
|
+
/**
|
|
65
|
+
* Detect which time unit ticks correspond to based on average interval.
|
|
66
|
+
*/
|
|
67
|
+
declare function detectTickUnit(ticks: number[]): TimeUnit;
|
|
68
|
+
/**
|
|
69
|
+
* Check if a timestamp is at a period boundary of a higher-level unit.
|
|
70
|
+
* Returns the parent unit if at boundary, null otherwise.
|
|
71
|
+
*
|
|
72
|
+
* Used for richer labels at boundaries:
|
|
73
|
+
* - Ticks are hours, midnight → show date ("Jan 15")
|
|
74
|
+
* - Ticks are days, Jan 1 → show year ("2024")
|
|
75
|
+
* - Ticks are months, Jan → show year ("2024")
|
|
76
|
+
*/
|
|
77
|
+
declare function isPeriodBoundary(timestamp: number, tickUnit: TimeUnit): TimeUnit | null;
|
|
78
|
+
|
|
79
|
+
declare function buildOrdinalTimeMapping(timestamps: number[]): {
|
|
80
|
+
/** Sorted unique timestamps */
|
|
81
|
+
sortedTimestamps: number[];
|
|
82
|
+
/** Get the ordinal index for a timestamp (binary search) */
|
|
83
|
+
indexOf: (timestamp: number) => number;
|
|
84
|
+
/** Get the timestamp at an ordinal index */
|
|
85
|
+
timestampAt: (index: number) => number;
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Auto-select bucket size to reduce point count below threshold.
|
|
89
|
+
*/
|
|
90
|
+
declare function selectGroupingInterval(domainSpanMs: number, dataLength: number, targetPoints: number): TimeInterval;
|
|
91
|
+
/**
|
|
92
|
+
* Group data points by time interval and apply aggregation.
|
|
93
|
+
*
|
|
94
|
+
* @param data - Raw data array
|
|
95
|
+
* @param categoryAccessor - Field name for timestamp (e.g., "date")
|
|
96
|
+
* @param valueAccessor - Field name for numeric value (e.g., "close")
|
|
97
|
+
* @param interval - Grouping interval
|
|
98
|
+
* @param method - Aggregation method
|
|
99
|
+
* @returns New data array with aggregated values
|
|
100
|
+
*/
|
|
101
|
+
declare function groupTimeData<T extends Record<string, unknown>>(data: T[], categoryAccessor: string, valueAccessor: string, interval: TimeInterval, method: AggregationMethod): T[];
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Merge multiple domain contributions into unified domain maps.
|
|
105
|
+
* Per axis: expand to encompass all contributions, then re-nice.
|
|
106
|
+
*
|
|
107
|
+
* @param baseDomains - Existing value domains (e.g., from bar pipeline). Mutated in place.
|
|
108
|
+
* @param contributions - Domain contributions from line, scatter, candlestick, etc.
|
|
109
|
+
* @returns The merged scatter X domains (new map).
|
|
110
|
+
*/
|
|
111
|
+
declare function mergeDomainContributions(baseDomains: Map<string, [number, number]>, contributions: DomainContribution[]): Map<string, [number, number]>;
|
|
112
|
+
/**
|
|
113
|
+
* Compute the unified value domain for a cartesian chart.
|
|
114
|
+
* Considers all stacking modes, hidden datasets, and expands
|
|
115
|
+
* domain to encompass generated tick values for grid alignment.
|
|
116
|
+
*/
|
|
117
|
+
declare function computeCartesianDomain(params: CartesianDomainParams): [number, number];
|
|
118
|
+
/**
|
|
119
|
+
* Merge values into an existing domain map for a given axis.
|
|
120
|
+
* If the axis already has a domain, expand it. Otherwise create a new one.
|
|
121
|
+
*/
|
|
122
|
+
declare function expandDomainWithValues(valueDomains: Map<string, [number, number]>, axisId: string, values: number[], includeZero: boolean): void;
|
|
123
|
+
/**
|
|
124
|
+
* Resolve whether a dataset's target axis should include zero in its domain.
|
|
125
|
+
* Logic: explicit startFromZero > hasBarsOnAxis (bars anchor to zero) > false (lines/areas fit to data range).
|
|
126
|
+
*/
|
|
127
|
+
declare function resolveIncludeZero(targetAxisId: string, valueAxes: Map<string, AxisConfig>, barAxisIds: Set<string>): boolean;
|
|
128
|
+
/**
|
|
129
|
+
* Compute a domain contribution from pre-resolved series data.
|
|
130
|
+
* Generic — works for any chart type. Callers resolve their own values
|
|
131
|
+
* (handling stacking, accessors, etc.) into DomainSeries arrays.
|
|
132
|
+
*
|
|
133
|
+
* @param valueSeries - Value axis series (Y for vertical, X for horizontal)
|
|
134
|
+
* @param categorySeries - Category-side linear series (scatter X). Optional.
|
|
135
|
+
*/
|
|
136
|
+
declare function computeDomainContribution(valueSeries: DomainSeries[], categorySeries?: DomainSeries[]): DomainContribution;
|
|
137
|
+
/**
|
|
138
|
+
* Compute visible Y values within a zoom window for adaptive Y-axis.
|
|
139
|
+
* Generic — works for any chart type. Callers resolve their own X/Y arrays
|
|
140
|
+
* into VisibleValuesSeries.
|
|
141
|
+
*
|
|
142
|
+
* @returns Map of axis ID → visible Y values within [xMin, xMax]
|
|
143
|
+
*/
|
|
144
|
+
declare function computeVisibleValues(series: VisibleValuesSeries[], xMin: number, xMax: number): Map<string, number[]>;
|
|
145
|
+
/**
|
|
146
|
+
* Expand scatter X and Y domains with bubble padding so outermost markers
|
|
147
|
+
* don't clip outside the chart area. Converts marker pixel radius to data-space padding.
|
|
148
|
+
*/
|
|
149
|
+
declare function expandScatterBubblePadding(params: {
|
|
150
|
+
scatterDatasets: ScatterDatasetInfo[];
|
|
151
|
+
valueDomains: Map<string, [number, number]>;
|
|
152
|
+
scatterXDomains: Map<string, [number, number]>;
|
|
153
|
+
firstValueAxisId: string;
|
|
154
|
+
firstCategoryAxisId: string;
|
|
155
|
+
chartArea: {
|
|
156
|
+
width: number;
|
|
157
|
+
height: number;
|
|
158
|
+
};
|
|
159
|
+
isLogValueAxis?: (axisId: string) => boolean;
|
|
160
|
+
isLogCategoryAxis?: (axisId: string) => boolean;
|
|
161
|
+
}): void;
|
|
162
|
+
/**
|
|
163
|
+
* Expand value domains so outside data labels don't clip at the chart edge.
|
|
164
|
+
* Skipped when a custom render function is set (unknown size), on log axes,
|
|
165
|
+
* and for percent-stacked axes (domain is fixed [0, 100]).
|
|
166
|
+
*/
|
|
167
|
+
declare function expandDataLabelPadding(params: {
|
|
168
|
+
valueDomains: Map<string, [number, number]>;
|
|
169
|
+
dataLabelFontSize: number;
|
|
170
|
+
orientation: 'vertical' | 'horizontal';
|
|
171
|
+
chartArea: {
|
|
172
|
+
width: number;
|
|
173
|
+
height: number;
|
|
174
|
+
};
|
|
175
|
+
axisIds: Iterable<string>;
|
|
176
|
+
isLogAxis?: (axisId: string) => boolean;
|
|
177
|
+
isPercentStackedAxis?: (axisId: string) => boolean;
|
|
178
|
+
}): void;
|
|
179
|
+
|
|
180
|
+
export { DEFAULT_FORMATS, MS, TICK_INTERVALS, advanceByUnit, buildOrdinalTimeMapping, computeCartesianDomain, computeDomainContribution, computeVisibleValues, detectTickUnit, expandDataLabelPadding, expandDomainWithValues, expandScatterBubblePadding, floorToUnit, formatTimeTick, generateTimeTicks, groupTimeData, intervalSpanMs, isPeriodBoundary, mergeDomainContributions, resolveIncludeZero, selectGroupingInterval, selectTickInterval, toTimestamp };
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { buildOrdinalTimeMapping, computeCartesianDomain, computeDomainContribution, computeVisibleValues, expandDataLabelPadding, expandDomainWithValues, expandScatterBubblePadding, groupTimeData, mergeDomainContributions, resolveIncludeZero, selectGroupingInterval } from '../../chunk-22ST6YPP.mjs';
|
|
2
|
+
export { collectItems } from '../../chunk-FFMT6OCO.mjs';
|
|
3
|
+
import '../../chunk-NKUYIWAP.mjs';
|
|
4
|
+
import '../../chunk-QS76E3TD.mjs';
|
|
5
|
+
import '../../chunk-O2X6FF45.mjs';
|
|
6
|
+
import '../../chunk-SSLTFJ3U.mjs';
|
|
7
|
+
export { DEFAULT_FORMATS, MS, TICK_INTERVALS, advanceByUnit, detectTickUnit, floorToUnit, formatTimeTick, generateTimeTicks, intervalSpanMs, isPeriodBoundary, selectTickInterval, toTimestamp } from '../../chunk-RQ3CKQOX.mjs';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ChartExportMethods } from '@primeui/chart-types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Create chart export functions for a container
|
|
5
|
+
*
|
|
6
|
+
* @param container - Container element holding the chart
|
|
7
|
+
* @param width - Chart width
|
|
8
|
+
* @param height - Chart height
|
|
9
|
+
* @param renderer - Current renderer type ('svg' or 'canvas')
|
|
10
|
+
* @returns Export methods (toImage, toDataURL, toBlob)
|
|
11
|
+
*/
|
|
12
|
+
declare function createChartExporter(container: HTMLElement, width: number, height: number, renderer: 'svg' | 'canvas'): ChartExportMethods;
|
|
13
|
+
|
|
14
|
+
export { createChartExporter };
|