@primeui/vue-chart 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.
Files changed (277) hide show
  1. package/LICENSE +23 -0
  2. package/README.md +1 -0
  3. package/dist/Chart.parts.d.ts +39 -0
  4. package/dist/Chart.vue.d.ts +27 -0
  5. package/dist/ChartCanvas.mjs +14 -0
  6. package/dist/ChartCanvas.render.spec.d.ts +1 -0
  7. package/dist/ChartCanvas.vue.d.ts +23 -0
  8. package/dist/ChartStacked.spec.d.ts +1 -0
  9. package/dist/ChartSvg.axes.spec.d.ts +1 -0
  10. package/dist/ChartSvg.context.spec.d.ts +1 -0
  11. package/dist/ChartSvg.customizations.spec.d.ts +1 -0
  12. package/dist/ChartSvg.features.spec.d.ts +1 -0
  13. package/dist/ChartSvg.legend.spec.d.ts +1 -0
  14. package/dist/ChartSvg.mjs +14 -0
  15. package/dist/ChartSvg.registration.spec.d.ts +1 -0
  16. package/dist/ChartSvg.render.spec.d.ts +1 -0
  17. package/dist/ChartSvg.vue.d.ts +23 -0
  18. package/dist/_test/fixtures.d.ts +34 -0
  19. package/dist/bundle-discipline.spec.d.ts +1 -0
  20. package/dist/chunk-2D3PWFR2.mjs +214 -0
  21. package/dist/chunk-32XIRBZ7.mjs +87 -0
  22. package/dist/chunk-372K2BMN.mjs +1476 -0
  23. package/dist/chunk-42J32DPD.mjs +70 -0
  24. package/dist/chunk-44BAFHPK.mjs +51 -0
  25. package/dist/chunk-4CRHCZV3.mjs +142 -0
  26. package/dist/chunk-4NJ2PSHV.mjs +230 -0
  27. package/dist/chunk-4THCGGER.mjs +53 -0
  28. package/dist/chunk-4UVPCLJ7.mjs +70 -0
  29. package/dist/chunk-54DLUFIA.mjs +96 -0
  30. package/dist/chunk-56NMBNNX.mjs +52 -0
  31. package/dist/chunk-5DWO3G33.mjs +276 -0
  32. package/dist/chunk-5FTUGKPC.mjs +167 -0
  33. package/dist/chunk-5SRBQVU5.mjs +6 -0
  34. package/dist/chunk-62NGBLQ7.mjs +28 -0
  35. package/dist/chunk-644ROAHU.mjs +362 -0
  36. package/dist/chunk-6S4JMPKC.mjs +55 -0
  37. package/dist/chunk-72KINEJ6.mjs +52 -0
  38. package/dist/chunk-7P6ASYW6.mjs +7 -0
  39. package/dist/chunk-AAX7FOW3.mjs +210 -0
  40. package/dist/chunk-AUI5R4DA.mjs +84 -0
  41. package/dist/chunk-CDXF6ZTL.mjs +50 -0
  42. package/dist/chunk-CQHNYT2V.mjs +1692 -0
  43. package/dist/chunk-DLUFOM5K.mjs +218 -0
  44. package/dist/chunk-DOOXGOOB.mjs +123 -0
  45. package/dist/chunk-DYVFVVTO.mjs +97 -0
  46. package/dist/chunk-E2U4W5FW.mjs +288 -0
  47. package/dist/chunk-E4ROAOPT.mjs +291 -0
  48. package/dist/chunk-FFBK7Q3W.mjs +91 -0
  49. package/dist/chunk-FQTWLAVA.mjs +23 -0
  50. package/dist/chunk-FZ3PZ66C.mjs +12 -0
  51. package/dist/chunk-GA4VV5V4.mjs +21 -0
  52. package/dist/chunk-GFC24374.mjs +244 -0
  53. package/dist/chunk-GX2MK6VT.mjs +255 -0
  54. package/dist/chunk-HANSF33Z.mjs +169 -0
  55. package/dist/chunk-HTZVV6VV.mjs +550 -0
  56. package/dist/chunk-J2P5JBHC.mjs +26 -0
  57. package/dist/chunk-J43KLCZF.mjs +10 -0
  58. package/dist/chunk-JKK3D33U.mjs +64 -0
  59. package/dist/chunk-K326BBF7.mjs +276 -0
  60. package/dist/chunk-KOWFD2AE.mjs +72 -0
  61. package/dist/chunk-LD57I4SY.mjs +5 -0
  62. package/dist/chunk-MDA22SIZ.mjs +29 -0
  63. package/dist/chunk-NLXOJSKK.mjs +727 -0
  64. package/dist/chunk-O6L3PNFC.mjs +49 -0
  65. package/dist/chunk-PJVOZSPF.mjs +55 -0
  66. package/dist/chunk-PQV55JYI.mjs +38 -0
  67. package/dist/chunk-PSSXPTLQ.mjs +210 -0
  68. package/dist/chunk-RQURY2H3.mjs +40 -0
  69. package/dist/chunk-RRHYGSK6.mjs +29 -0
  70. package/dist/chunk-RSAZ7V5Z.mjs +42 -0
  71. package/dist/chunk-RSTIA3KM.mjs +41 -0
  72. package/dist/chunk-TEOO4OLV.mjs +6 -0
  73. package/dist/chunk-TIV2FI4S.mjs +53 -0
  74. package/dist/chunk-UO27BCRL.mjs +86 -0
  75. package/dist/chunk-VWABO23U.mjs +143 -0
  76. package/dist/chunk-W5M3BR6N.mjs +26 -0
  77. package/dist/chunk-WA735Y26.mjs +101 -0
  78. package/dist/chunk-WKSQR6L5.mjs +247 -0
  79. package/dist/chunk-WYV2MHP6.mjs +34 -0
  80. package/dist/chunk-XBDNMPF7.mjs +87 -0
  81. package/dist/chunk-YGHWUR7K.mjs +45 -0
  82. package/dist/chunk-YRKAI2R2.mjs +151 -0
  83. package/dist/chunk-ZHFL3RYO.mjs +228 -0
  84. package/dist/chunk-ZNINPVG7.mjs +30 -0
  85. package/dist/chunk-ZRCOVQQM.mjs +47 -0
  86. package/dist/components/charts/ChartBar.mjs +13 -0
  87. package/dist/components/charts/ChartBar.vue.d.ts +11 -0
  88. package/dist/components/charts/ChartCandlestick.mjs +11 -0
  89. package/dist/components/charts/ChartCandlestick.vue.d.ts +11 -0
  90. package/dist/components/charts/ChartHeatmap.mjs +11 -0
  91. package/dist/components/charts/ChartHeatmap.vue.d.ts +11 -0
  92. package/dist/components/charts/ChartLine.mjs +11 -0
  93. package/dist/components/charts/ChartLine.vue.d.ts +11 -0
  94. package/dist/components/charts/ChartPie.mjs +11 -0
  95. package/dist/components/charts/ChartPie.vue.d.ts +15 -0
  96. package/dist/components/charts/ChartPolar.mjs +11 -0
  97. package/dist/components/charts/ChartPolar.vue.d.ts +11 -0
  98. package/dist/components/charts/ChartRadar.mjs +11 -0
  99. package/dist/components/charts/ChartRadar.vue.d.ts +11 -0
  100. package/dist/components/charts/ChartScatter.mjs +11 -0
  101. package/dist/components/charts/ChartScatter.vue.d.ts +11 -0
  102. package/dist/components/charts/ChartTreemap.mjs +10 -0
  103. package/dist/components/charts/ChartTreemap.vue.d.ts +15 -0
  104. package/dist/components/charts/index.d.ts +2 -0
  105. package/dist/components/containers/ChartDecimation.mjs +6 -0
  106. package/dist/components/containers/ChartDecimation.vue.d.ts +29 -0
  107. package/dist/components/containers/ChartGroup.mjs +4 -0
  108. package/dist/components/containers/ChartGroup.vue.d.ts +13 -0
  109. package/dist/components/containers/ChartOverlap.mjs +5 -0
  110. package/dist/components/containers/ChartOverlap.vue.d.ts +13 -0
  111. package/dist/components/containers/ChartRange.mjs +6 -0
  112. package/dist/components/containers/ChartRange.vue.d.ts +13 -0
  113. package/dist/components/containers/ChartStacked.mjs +6 -0
  114. package/dist/components/containers/ChartStacked.vue.d.ts +21 -0
  115. package/dist/components/containers/ChartWaterfall.mjs +5 -0
  116. package/dist/components/containers/ChartWaterfall.vue.d.ts +17 -0
  117. package/dist/components/containers/keys.d.ts +5 -0
  118. package/dist/components/customizations/ChartAccessibility.mjs +9 -0
  119. package/dist/components/customizations/ChartAccessibility.vue.d.ts +28 -0
  120. package/dist/components/customizations/ChartAnnotation.mjs +5 -0
  121. package/dist/components/customizations/ChartAnnotation.vue.d.ts +8 -0
  122. package/dist/components/customizations/ChartAxisCategory.mjs +3 -0
  123. package/dist/components/customizations/ChartAxisCategory.vue.d.ts +4 -0
  124. package/dist/components/customizations/ChartAxisGroup.mjs +3 -0
  125. package/dist/components/customizations/ChartAxisGroup.vue.d.ts +14 -0
  126. package/dist/components/customizations/ChartBreadcrumb.mjs +6 -0
  127. package/dist/components/customizations/ChartBreadcrumb.vue.d.ts +15 -0
  128. package/dist/components/customizations/ChartCaption.mjs +9 -0
  129. package/dist/components/customizations/ChartCaption.vue.d.ts +4 -0
  130. package/dist/components/customizations/ChartColorLegend.mjs +9 -0
  131. package/dist/components/customizations/ChartColorLegend.vue.d.ts +47 -0
  132. package/dist/components/customizations/ChartDataLabels.mjs +9 -0
  133. package/dist/components/customizations/ChartDataLabels.vue.d.ts +53 -0
  134. package/dist/components/customizations/ChartExportMenu.mjs +9 -0
  135. package/dist/components/customizations/ChartExportMenu.vue.d.ts +29 -0
  136. package/dist/components/customizations/ChartHover.mjs +9 -0
  137. package/dist/components/customizations/ChartHover.vue.d.ts +4 -0
  138. package/dist/components/customizations/ChartLegend.mjs +9 -0
  139. package/dist/components/customizations/ChartLegend.vue.d.ts +7 -0
  140. package/dist/components/customizations/ChartNavigator.mjs +10 -0
  141. package/dist/components/customizations/ChartNavigator.vue.d.ts +4 -0
  142. package/dist/components/customizations/ChartReferenceBand.mjs +5 -0
  143. package/dist/components/customizations/ChartReferenceBand.vue.d.ts +4 -0
  144. package/dist/components/customizations/ChartReferenceLine.mjs +5 -0
  145. package/dist/components/customizations/ChartReferenceLine.vue.d.ts +4 -0
  146. package/dist/components/customizations/ChartResponsive.mjs +9 -0
  147. package/dist/components/customizations/ChartResponsive.vue.d.ts +12 -0
  148. package/dist/components/customizations/ChartTitle.mjs +9 -0
  149. package/dist/components/customizations/ChartTitle.vue.d.ts +4 -0
  150. package/dist/components/customizations/ChartTooltip.mjs +9 -0
  151. package/dist/components/customizations/ChartTooltip.vue.d.ts +6 -0
  152. package/dist/components/customizations/ChartXAxis.mjs +10 -0
  153. package/dist/components/customizations/ChartXAxis.vue.d.ts +24 -0
  154. package/dist/components/customizations/ChartYAxis.mjs +10 -0
  155. package/dist/components/customizations/ChartYAxis.vue.d.ts +23 -0
  156. package/dist/components/customizations/ChartZoom.mjs +9 -0
  157. package/dist/components/customizations/ChartZoom.vue.d.ts +4 -0
  158. package/dist/components/customizations/axisGroupKeys.d.ts +8 -0
  159. package/dist/components/customizations/index.d.ts +20 -0
  160. package/dist/components/items/ChartItem.mjs +3 -0
  161. package/dist/components/items/ChartItem.vue.d.ts +4 -0
  162. package/dist/components/items/ChartTreemapGroup.mjs +5 -0
  163. package/dist/components/items/ChartTreemapGroup.vue.d.ts +11 -0
  164. package/dist/components/items/index.d.ts +1 -0
  165. package/dist/components/renderers/CartesianRenderer.mjs +9 -0
  166. package/dist/components/renderers/CartesianRenderer.vue.d.ts +66 -0
  167. package/dist/components/renderers/ColorLegendRenderer.mjs +2 -0
  168. package/dist/components/renderers/ColorLegendRenderer.vue.d.ts +15 -0
  169. package/dist/components/renderers/LegendRenderer.mjs +3 -0
  170. package/dist/components/renderers/LegendRenderer.vue.d.ts +20 -0
  171. package/dist/components/renderers/NavigatorRenderer.mjs +5 -0
  172. package/dist/components/renderers/NavigatorRenderer.vue.d.ts +16 -0
  173. package/dist/components/renderers/RadialRenderer.mjs +9 -0
  174. package/dist/components/renderers/RadialRenderer.vue.d.ts +39 -0
  175. package/dist/components/renderers/RectRenderer.mjs +9 -0
  176. package/dist/components/renderers/RectRenderer.vue.d.ts +32 -0
  177. package/dist/components/renderers/TooltipRenderer.mjs +4 -0
  178. package/dist/components/renderers/TooltipRenderer.vue.d.ts +11 -0
  179. package/dist/components/renderers/layers/BarLayerCanvas.mjs +10 -0
  180. package/dist/components/renderers/layers/BarLayerCanvas.vue.d.ts +3 -0
  181. package/dist/components/renderers/layers/BarLayerSvg.mjs +10 -0
  182. package/dist/components/renderers/layers/BarLayerSvg.vue.d.ts +3 -0
  183. package/dist/components/renderers/layers/CandlestickLayer.mjs +9 -0
  184. package/dist/components/renderers/layers/CandlestickLayer.vue.d.ts +3 -0
  185. package/dist/components/renderers/layers/HeatmapLayer.mjs +9 -0
  186. package/dist/components/renderers/layers/HeatmapLayer.vue.d.ts +3 -0
  187. package/dist/components/renderers/layers/LineLayer.mjs +9 -0
  188. package/dist/components/renderers/layers/LineLayer.vue.d.ts +3 -0
  189. package/dist/components/renderers/layers/PieLayer.mjs +9 -0
  190. package/dist/components/renderers/layers/PieLayer.vue.d.ts +12 -0
  191. package/dist/components/renderers/layers/PolarLayer.mjs +9 -0
  192. package/dist/components/renderers/layers/PolarLayer.vue.d.ts +16 -0
  193. package/dist/components/renderers/layers/RadarLayer.mjs +9 -0
  194. package/dist/components/renderers/layers/RadarLayer.vue.d.ts +16 -0
  195. package/dist/components/renderers/layers/ScatterLayer.mjs +9 -0
  196. package/dist/components/renderers/layers/ScatterLayer.vue.d.ts +3 -0
  197. package/dist/composables/index.d.ts +35 -0
  198. package/dist/composables/useAnimationProps.d.ts +21 -0
  199. package/dist/composables/useAxisComponentBase.d.ts +11 -0
  200. package/dist/composables/useAxisRegistration.d.ts +7 -0
  201. package/dist/composables/useAxisTransition.d.ts +6 -0
  202. package/dist/composables/useBarLayer.d.ts +9 -0
  203. package/dist/composables/useBarRenderer.canvas.d.ts +2 -0
  204. package/dist/composables/useBarRenderer.svg.d.ts +2 -0
  205. package/dist/composables/useBarRendererBase.d.ts +3 -0
  206. package/dist/composables/useCandlestickRenderer.d.ts +2 -0
  207. package/dist/composables/useCartesianAnimation.d.ts +2 -0
  208. package/dist/composables/useCartesianFrame.d.ts +72 -0
  209. package/dist/composables/useCartesianLayout.d.ts +3 -0
  210. package/dist/composables/useChartContext.d.ts +40 -0
  211. package/dist/composables/useChartLayers.d.ts +31 -0
  212. package/dist/composables/useChartRefreshHook.d.ts +1 -0
  213. package/dist/composables/useChartSync.d.ts +2 -0
  214. package/dist/composables/useChartSyncCoordinator.d.ts +23 -0
  215. package/dist/composables/useControllerLifecycle.d.ts +18 -0
  216. package/dist/composables/useCustomizationRegistration.d.ts +18 -0
  217. package/dist/composables/useDatasetAnimationContext.d.ts +14 -0
  218. package/dist/composables/useDatasetRegistration.d.ts +6 -0
  219. package/dist/composables/useDrilldownState.d.ts +3 -0
  220. package/dist/composables/useFamilyRenderers.d.ts +10 -0
  221. package/dist/composables/useFamilyRenderers.spec.d.ts +1 -0
  222. package/dist/composables/useHeatmapRenderer.d.ts +2 -0
  223. package/dist/composables/useItemCollector.d.ts +2 -0
  224. package/dist/composables/useKeyboardController.d.ts +8 -0
  225. package/dist/composables/useKeyboardNavigation.d.ts +2 -0
  226. package/dist/composables/useLineRenderer.d.ts +2 -0
  227. package/dist/composables/useNavigatorRenderer.d.ts +7 -0
  228. package/dist/composables/usePieRenderer.d.ts +2 -0
  229. package/dist/composables/usePolarRenderer.d.ts +2 -0
  230. package/dist/composables/usePropertyAnimations.d.ts +4 -0
  231. package/dist/composables/useRadarRenderer.d.ts +2 -0
  232. package/dist/composables/useRadialFrame.d.ts +39 -0
  233. package/dist/composables/useResponsiveConfig.d.ts +8 -0
  234. package/dist/composables/useResponsiveDimensions.d.ts +2 -0
  235. package/dist/composables/useScatterRenderer.d.ts +2 -0
  236. package/dist/composables/useTreemapRenderer.d.ts +2 -0
  237. package/dist/composables/useZoomController.d.ts +9 -0
  238. package/dist/composables/useZoomPan.d.ts +2 -0
  239. package/dist/context/ChartContext.d.ts +21 -0
  240. package/dist/context/index.d.ts +4 -0
  241. package/dist/context/keys.d.ts +52 -0
  242. package/dist/context/syncKeys.d.ts +5 -0
  243. package/dist/index.d.ts +44 -0
  244. package/dist/index.mjs +67 -0
  245. package/dist/namespace.d.ts +1 -0
  246. package/dist/namespace.mjs +112 -0
  247. package/dist/release-date.d.ts +11 -0
  248. package/dist/types/animation.types.d.ts +38 -0
  249. package/dist/types/axes.types.d.ts +27 -0
  250. package/dist/types/axisComponentBase.types.d.ts +5 -0
  251. package/dist/types/axisGroup.types.d.ts +1 -0
  252. package/dist/types/bar.types.d.ts +42 -0
  253. package/dist/types/breadcrumb.types.d.ts +12 -0
  254. package/dist/types/candlestick.types.d.ts +41 -0
  255. package/dist/types/canvas.types.d.ts +5 -0
  256. package/dist/types/caption.types.d.ts +8 -0
  257. package/dist/types/cartesian.types.d.ts +22 -0
  258. package/dist/types/chart.types.d.ts +51 -0
  259. package/dist/types/heatmap.types.d.ts +58 -0
  260. package/dist/types/index.d.ts +27 -0
  261. package/dist/types/item.types.d.ts +25 -0
  262. package/dist/types/keyboard.types.d.ts +24 -0
  263. package/dist/types/layout.types.d.ts +35 -0
  264. package/dist/types/legend.types.d.ts +13 -0
  265. package/dist/types/line.types.d.ts +64 -0
  266. package/dist/types/pie.types.d.ts +49 -0
  267. package/dist/types/polar.types.d.ts +63 -0
  268. package/dist/types/radar.types.d.ts +56 -0
  269. package/dist/types/responsiveDimensions.types.d.ts +16 -0
  270. package/dist/types/scatter.types.d.ts +50 -0
  271. package/dist/types/svg.types.d.ts +44 -0
  272. package/dist/types/tooltip.types.d.ts +6 -0
  273. package/dist/types/treemap.types.d.ts +50 -0
  274. package/dist/types/zoom.types.d.ts +45 -0
  275. package/dist/utils/index.d.ts +3 -0
  276. package/dist/utils/styles.d.ts +10 -0
  277. package/package.json +63 -0
@@ -0,0 +1,1476 @@
1
+ import { LegendRenderer_default } from './chunk-5FTUGKPC.mjs';
2
+ import { ColorLegendRenderer_default } from './chunk-E4ROAOPT.mjs';
3
+ import { TooltipRenderer_default } from './chunk-GX2MK6VT.mjs';
4
+ import { useResponsiveDimensions, useAnimationProps, useDrilldownState, useResponsiveConfig, provideFamilyRenderers, provideChartLayers, useZoomPan, useKeyboardNavigation, useChartSync, useChartContext, useChartSyncCoordinator } from './chunk-CQHNYT2V.mjs';
5
+ import { NavigatorRenderer_default } from './chunk-NLXOJSKK.mjs';
6
+ import { provideChartContext } from './chunk-HANSF33Z.mjs';
7
+ import { CHART_SYNC_INFO_KEY } from './chunk-LD57I4SY.mjs';
8
+ import { TOOLTIP_CONTEXT_KEY } from './chunk-FZ3PZ66C.mjs';
9
+ import { defineComponent, computed, ref, onMounted, watch, onBeforeUnmount, toRef, shallowRef, provide, nextTick, openBlock, createElementBlock, normalizeStyle, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, renderSlot, unref, createBlock, resolveDynamicComponent, withCtx, createTextVNode, Fragment, renderList, withModifiers } from 'vue';
10
+ import { resolveTheme, ChartStateController, buildChartDataTable, themeToCssVars, configureCanvasHiDPI, computeCrosshairLayout, buildAnnotationContext, DEFAULT_FONT_FAMILY, renderAnnotationsCanvas, resolveDirFromElement, observeDocumentDir } from '@primeui/chart-core';
11
+ import { verifyLicense } from '@primeui/license-manager';
12
+
13
+ // src/release-date.ts
14
+ var RELEASE_DATE = "2026-06-20";
15
+
16
+ // src/Chart.vue
17
+ var _hoisted_1 = {
18
+ key: 0,
19
+ role: "alert",
20
+ class: "p-chart-license-banner",
21
+ style: {
22
+ "position": "absolute",
23
+ "top": "8px",
24
+ "left": "8px",
25
+ "right": "8px",
26
+ "z-index": "10",
27
+ "pointer-events": "none",
28
+ "display": "flex",
29
+ "align-items": "center",
30
+ "gap": "8px",
31
+ "padding": "10px 14px",
32
+ "background": "#fef2f2",
33
+ "border": "1px solid #fecaca",
34
+ "color": "#991b1b",
35
+ "border-radius": "6px",
36
+ "font-size": "13px"
37
+ }
38
+ };
39
+ var _hoisted_2 = [
40
+ "role",
41
+ "aria-label",
42
+ "aria-roledescription",
43
+ "tabindex"
44
+ ];
45
+ var _hoisted_3 = {
46
+ key: 0,
47
+ class: "chart-sr-only",
48
+ style: {
49
+ position: "absolute",
50
+ width: "1px",
51
+ height: "1px",
52
+ padding: 0,
53
+ margin: "-1px",
54
+ overflow: "hidden",
55
+ clip: "rect(0, 0, 0, 0)",
56
+ whiteSpace: "nowrap",
57
+ border: 0
58
+ }
59
+ };
60
+ var _hoisted_4 = { key: 0 };
61
+ var _hoisted_5 = { key: 1 };
62
+ var _hoisted_6 = { key: 0 };
63
+ var _hoisted_7 = ["colspan"];
64
+ var _hoisted_8 = [
65
+ "width",
66
+ "height",
67
+ "role",
68
+ "aria-label"
69
+ ];
70
+ var _hoisted_9 = { key: 5 };
71
+ var _hoisted_10 = ["id"];
72
+ var _hoisted_11 = [
73
+ "x",
74
+ "y",
75
+ "width",
76
+ "height"
77
+ ];
78
+ var _hoisted_12 = ["fill", "clip-path"];
79
+ var _hoisted_13 = {
80
+ key: 4,
81
+ style: { "position": "relative" }
82
+ };
83
+ var _hoisted_14 = [
84
+ "aria-label",
85
+ "width",
86
+ "height"
87
+ ];
88
+ var _hoisted_15 = ["width", "height"];
89
+ var _hoisted_16 = ["width", "height"];
90
+ var _hoisted_17 = ["width", "height"];
91
+ var _hoisted_18 = ["width", "height"];
92
+ var _hoisted_19 = [
93
+ "x1",
94
+ "y1",
95
+ "x2",
96
+ "y2",
97
+ "stroke",
98
+ "stroke-width",
99
+ "stroke-dasharray"
100
+ ];
101
+ var _hoisted_20 = [
102
+ "x1",
103
+ "y1",
104
+ "x2",
105
+ "y2",
106
+ "stroke",
107
+ "stroke-width",
108
+ "stroke-dasharray"
109
+ ];
110
+ var _hoisted_21 = { key: 2 };
111
+ var _hoisted_22 = [
112
+ "x",
113
+ "y",
114
+ "width",
115
+ "height",
116
+ "rx"
117
+ ];
118
+ var _hoisted_23 = [
119
+ "x",
120
+ "y",
121
+ "font-size"
122
+ ];
123
+ var _hoisted_24 = { key: 3 };
124
+ var _hoisted_25 = [
125
+ "x",
126
+ "y",
127
+ "width",
128
+ "height",
129
+ "rx"
130
+ ];
131
+ var _hoisted_26 = [
132
+ "x",
133
+ "y",
134
+ "font-size"
135
+ ];
136
+ var _hoisted_27 = { key: 4 };
137
+ var _hoisted_28 = [
138
+ "x",
139
+ "y",
140
+ "width",
141
+ "height",
142
+ "rx",
143
+ "fill"
144
+ ];
145
+ var _hoisted_29 = [
146
+ "x",
147
+ "y",
148
+ "font-size"
149
+ ];
150
+ var _hoisted_30 = [
151
+ "x",
152
+ "y",
153
+ "width",
154
+ "height",
155
+ "rx",
156
+ "fill"
157
+ ];
158
+ var _hoisted_31 = [
159
+ "x",
160
+ "y",
161
+ "font-size"
162
+ ];
163
+ var _hoisted_32 = ["width", "height"];
164
+ var _hoisted_33 = [
165
+ "x",
166
+ "y",
167
+ "width",
168
+ "height"
169
+ ];
170
+ var _hoisted_34 = {
171
+ key: 0,
172
+ style: {
173
+ margin: "0 2px",
174
+ opacity: 0.5
175
+ }
176
+ };
177
+ var _hoisted_35 = ["onClick"];
178
+ var _hoisted_36 = ["width", "height"];
179
+ var _hoisted_37 = [
180
+ "x",
181
+ "y",
182
+ "width",
183
+ "height",
184
+ "rx",
185
+ "stroke",
186
+ "stroke-width",
187
+ "stroke-dasharray"
188
+ ];
189
+ var _hoisted_38 = {
190
+ key: 17,
191
+ "aria-live": "polite",
192
+ "aria-atomic": "true",
193
+ style: {
194
+ position: "absolute",
195
+ width: "1px",
196
+ height: "1px",
197
+ overflow: "hidden",
198
+ clip: "rect(0, 0, 0, 0)",
199
+ whiteSpace: "nowrap",
200
+ border: 0
201
+ }
202
+ };
203
+ var _idCounter = 0;
204
+ var _sfc_main = /* @__PURE__ */ defineComponent({
205
+ __name: "Chart",
206
+ props: {
207
+ devicePixelRatio: {},
208
+ width: {},
209
+ height: {},
210
+ class: {},
211
+ style: {},
212
+ theme: {},
213
+ plugins: {},
214
+ responsive: {
215
+ type: Boolean,
216
+ default: true
217
+ },
218
+ aspectRatio: {},
219
+ debounceDelay: {},
220
+ sync: { type: [Boolean, Object] },
221
+ dir: { default: "auto" },
222
+ fontFamily: {},
223
+ fontSize: {},
224
+ locale: {},
225
+ animation: { type: [Object, Boolean] },
226
+ animations: {},
227
+ transitions: {},
228
+ renderer: {}
229
+ },
230
+ emits: ["resize"],
231
+ setup(__props, { expose: __expose, emit: __emit }) {
232
+ const VNodeRenderer = defineComponent({
233
+ props: { node: {
234
+ type: Object,
235
+ required: true
236
+ } },
237
+ render() {
238
+ return this.node;
239
+ }
240
+ });
241
+ const props = __props;
242
+ const emit = __emit;
243
+ const hasExplicitDimensions = computed(() => props.width !== void 0 && props.height !== void 0);
244
+ const isFixed = computed(() => props.responsive === false && hasExplicitDimensions.value);
245
+ const { containerRef: sizeContainerRef, width, height } = useResponsiveDimensions({
246
+ width: computed(() => props.width),
247
+ height: computed(() => props.height),
248
+ responsive: computed(() => !isFixed.value),
249
+ debounceWithRAF: true,
250
+ debounceDelay: computed(() => props.debounceDelay),
251
+ aspectRatio: computed(() => props.aspectRatio),
252
+ maxDimensions: computed(() => hasExplicitDimensions.value && !isFixed.value),
253
+ onResize: (w, h) => emit("resize", w, h)
254
+ });
255
+ const autoDir = ref("ltr");
256
+ let stopDirObserver = null;
257
+ const detectDir = () => {
258
+ autoDir.value = resolveDirFromElement(sizeContainerRef.value);
259
+ };
260
+ const startObservingDir = () => {
261
+ if (stopDirObserver) return;
262
+ stopDirObserver = observeDocumentDir(detectDir);
263
+ };
264
+ const stopObservingDir = () => {
265
+ stopDirObserver?.();
266
+ stopDirObserver = null;
267
+ };
268
+ onMounted(() => {
269
+ if (props.dir === "auto") {
270
+ detectDir();
271
+ startObservingDir();
272
+ }
273
+ });
274
+ watch(() => props.dir, (newDir) => {
275
+ if (newDir === "auto") {
276
+ detectDir();
277
+ startObservingDir();
278
+ } else {
279
+ stopObservingDir();
280
+ }
281
+ });
282
+ onBeforeUnmount(() => {
283
+ stopObservingDir();
284
+ });
285
+ const resolvedDir = computed(() => props.dir === "auto" ? autoDir.value : props.dir ?? "ltr");
286
+ const chartId = `chart-${++_idCounter}`;
287
+ const licenseResult = ref(null);
288
+ const licenseValid = computed(() => !!licenseResult.value?.valid);
289
+ const licenseMessage = computed(() => licenseResult.value?.message ?? null);
290
+ async function runLicenseCheck() {
291
+ const result = await verifyLicense("charts", { releaseDate: RELEASE_DATE });
292
+ licenseResult.value = result;
293
+ if (!result.valid) {
294
+ console.warn(`[PrimeUI Chart] ${result.message}`);
295
+ }
296
+ }
297
+ onMounted(() => {
298
+ runLicenseCheck();
299
+ });
300
+ const resolvedTheme = computed(() => resolveTheme(props.theme));
301
+ const { coreChart, emitHandlerRef, methods, state, hover: hoverCtx, rendererHint, redraw } = provideChartContext({
302
+ chartId,
303
+ renderer: props.renderer,
304
+ width,
305
+ height,
306
+ devicePixelRatio: props.devicePixelRatio,
307
+ dir: resolvedDir,
308
+ fontFamily: props.fontFamily,
309
+ fontSize: props.fontSize,
310
+ locale: toRef(props, "locale"),
311
+ theme: resolvedTheme
312
+ });
313
+ useAnimationProps(() => ({
314
+ animation: props.animation,
315
+ animations: props.animations,
316
+ transitions: props.transitions
317
+ }), methods);
318
+ const containerRef = ref(null);
319
+ const mainCanvasRef = ref(null);
320
+ const overlayCanvasRef = ref(null);
321
+ const annotationCanvasRef = ref(null);
322
+ const setSizeContainerRef = (el) => {
323
+ sizeContainerRef.value = el;
324
+ };
325
+ const setMainCanvasRef = (el) => {
326
+ mainCanvasRef.value = el;
327
+ };
328
+ const setOverlayCanvasRef = (el) => {
329
+ overlayCanvasRef.value = el;
330
+ };
331
+ const setAnnotationCanvasRef = (el) => {
332
+ annotationCanvasRef.value = el;
333
+ };
334
+ const captionEl = ref(null);
335
+ const measuredCaptionHeight = ref(0);
336
+ const drilldownState = useDrilldownState(computed(() => state.value.datasets));
337
+ const responsiveFeature = computed(() => state.value.features.get("responsive")?.props);
338
+ const { defaults: adaptive, ruleOverrides } = useResponsiveConfig(width, height, responsiveFeature, { size: props.fontSize });
339
+ const chartStateController = new ChartStateController();
340
+ onBeforeUnmount(() => chartStateController.destroy());
341
+ const coreState = computed(() => chartStateController.compute({
342
+ width: width.value,
343
+ height: height.value,
344
+ features: state.value.features,
345
+ datasets: state.value.datasets,
346
+ datasetVisibility: state.value.datasetVisibility,
347
+ hiddenItems: state.value.hiddenItems,
348
+ axes: state.value.axes,
349
+ rendererHint: rendererHint.value,
350
+ drilldownIsActive: drilldownState.isActive.value,
351
+ measuredCaptionHeight: measuredCaptionHeight.value,
352
+ theme: methods.theme,
353
+ adaptive: adaptive.value,
354
+ ruleOverrides: ruleOverrides.value,
355
+ globalFontFamily: props.fontFamily
356
+ }));
357
+ const isCartesian = computed(() => coreState.value.isCartesian);
358
+ const isRect = computed(() => coreState.value.isRect);
359
+ const hasCrosshair = computed(() => coreState.value.hasCrosshair);
360
+ const isSharedMode = computed(() => coreState.value.isSharedMode);
361
+ const tooltipConfig = computed(() => coreState.value.tooltipConfig);
362
+ const hoverConfig = computed(() => coreState.value.hoverConfig);
363
+ const legendConfig = computed(() => coreState.value.legendConfig);
364
+ const zoomConfig = computed(() => coreState.value.zoomConfig);
365
+ const keyboardNavEnabled = computed(() => coreState.value.keyboardNavEnabled);
366
+ const keyboardNavConfig = computed(() => coreState.value.keyboardNavConfig);
367
+ const a11yEnabled = computed(() => coreState.value.a11yEnabled);
368
+ const dataTable = computed(() => a11yEnabled.value ? buildChartDataTable(state.value.datasets) : null);
369
+ const a11yHeadingLevel = computed(() => coreState.value.a11yHeadingLevel);
370
+ const chartDescription = computed(() => coreState.value.chartDescription);
371
+ const chartTypeDescription = computed(() => coreState.value.chartTypeDescription);
372
+ const containerStyle = computed(() => coreState.value.containerStyle);
373
+ const titleConfig = computed(() => coreState.value.titleConfig);
374
+ const captionConfig = computed(() => coreState.value.captionConfig);
375
+ const titleStyle = computed(() => coreState.value.titleStyle);
376
+ const captionStyle = computed(() => coreState.value.captionStyle);
377
+ const chartArea = computed(() => coreState.value.chartArea);
378
+ const navigatorArea = computed(() => coreState.value.navigatorArea);
379
+ const navigatorConfig = computed(() => coreState.value.navigatorConfig);
380
+ const xAxisTickFormat = computed(() => coreState.value.xAxisTickFormat);
381
+ const legendArea = computed(() => coreState.value.legendArea);
382
+ const legendItems = computed(() => coreState.value.legendItems);
383
+ const effectiveLegendPosition = computed(() => coreState.value.effectiveLegendPosition);
384
+ const colorLegendConfig = computed(() => coreState.value.colorLegendConfig);
385
+ const colorLegendArea = computed(() => coreState.value.colorLegendArea);
386
+ const crosshairConfig = computed(() => coreState.value.crosshairConfig);
387
+ const resetButtonConfig = computed(() => coreState.value.resetButtonConfig);
388
+ const resetZoomTop = computed(() => coreState.value.resetZoomTop);
389
+ const breadcrumbConfig = computed(() => coreState.value.breadcrumbConfig);
390
+ const outerContainerStyle = computed(() => {
391
+ const themeVars = themeToCssVars(props.theme);
392
+ if (isFixed.value) {
393
+ return {
394
+ ...themeVars,
395
+ position: "relative",
396
+ ...props.style,
397
+ width: typeof props.width === "number" ? `${props.width}px` : void 0,
398
+ height: typeof props.height === "number" ? `${props.height}px` : void 0
399
+ };
400
+ }
401
+ return {
402
+ ...themeVars,
403
+ ...props.style,
404
+ width: "100%",
405
+ height: "100%",
406
+ position: "relative",
407
+ ...typeof props.width === "number" ? { maxWidth: `${props.width}px` } : {},
408
+ ...typeof props.height === "number" ? { maxHeight: `${props.height}px` } : {}
409
+ };
410
+ });
411
+ const familyRenderers = provideFamilyRenderers();
412
+ provideChartLayers();
413
+ const cartesianRef = ref(null);
414
+ const radialRef = ref(null);
415
+ const rectRef = ref(null);
416
+ const rendererDelegate = computed(() => {
417
+ const active = coreState.value.isCartesian ? cartesianRef.value : coreState.value.isRect ? rectRef.value : radialRef.value;
418
+ if (!active) return null;
419
+ return active;
420
+ });
421
+ function wrappedDrillToLevel(index) {
422
+ rectRef.value?.prepareDrillOut();
423
+ drilldownState.drillToLevel(index);
424
+ }
425
+ const breadcrumbItems = computed(() => {
426
+ const path = drilldownState.path.value;
427
+ const renderFn = coreState.value.breadcrumbConfig?.renderItem;
428
+ return path.map((crumb, i) => {
429
+ const isActive = i === path.length - 1;
430
+ const ctx = {
431
+ label: crumb.label,
432
+ index: i,
433
+ isActive,
434
+ onClick: () => {
435
+ if (!isActive) wrappedDrillToLevel(i);
436
+ }
437
+ };
438
+ return {
439
+ crumb,
440
+ i,
441
+ isActive,
442
+ vnode: renderFn ? renderFn(ctx) ?? null : null
443
+ };
444
+ });
445
+ });
446
+ const autoColorScale = shallowRef(null);
447
+ watch([
448
+ () => state.value.datasets,
449
+ () => state.value.datasetVisibility,
450
+ () => coreState.value.chartArea,
451
+ rendererDelegate
452
+ ], () => {
453
+ const info = rendererDelegate.value?.getColorScaleInfo?.() ?? null;
454
+ const prev = autoColorScale.value;
455
+ if (prev === null && info === null) return;
456
+ if (prev && info && prev.min === info.min && prev.max === info.max && prev.colorScale.length === info.colorScale.length && prev.colorRange.length === info.colorRange.length && prev.colorScale.every((v, i) => v === info.colorScale[i]) && prev.colorRange.every((v, i) => v === info.colorRange[i])) {
457
+ return;
458
+ }
459
+ autoColorScale.value = info;
460
+ }, {
461
+ immediate: true,
462
+ flush: "post"
463
+ });
464
+ const hoveredColorValue = computed(() => {
465
+ if (!coreState.value.colorLegendConfig) return null;
466
+ if (!tooltip.value?.visible || tooltip.value.value == null) return null;
467
+ return typeof tooltip.value.value === "number" ? tooltip.value.value : null;
468
+ });
469
+ const { zoomState, resetZoom, updateZoom, getZoomState, isZoomed: chartIsZoomed, isDragging: zoomIsDragging, selectionRect } = useZoomPan({
470
+ zoomConfig,
471
+ containerRef,
472
+ getPlotArea: () => cartesianRef.value?.getPlotArea() ?? null,
473
+ getScales: () => cartesianRef.value?.getScales() ?? null,
474
+ getOriginalDomains: () => cartesianRef.value?.getOriginalDomains() ?? {},
475
+ isCartesian: computed(() => rendererHint.value === "cartesian")
476
+ });
477
+ watch(zoomConfig, (cfg) => {
478
+ const externalRef = cfg?.zoomRef;
479
+ if (!externalRef) return;
480
+ externalRef.current = {
481
+ setZoomState: updateZoom,
482
+ resetZoom,
483
+ getZoomState
484
+ };
485
+ }, { immediate: true });
486
+ const keyboardNav = useKeyboardNavigation({
487
+ enabled: keyboardNavEnabled,
488
+ config: keyboardNavConfig,
489
+ datasets: computed(() => state.value.datasets),
490
+ datasetVisibility: computed(() => state.value.datasetVisibility),
491
+ setHover: methods.setHover,
492
+ rendererDelegate,
493
+ // Late-bound: coreMouseMove/coreMouseLeave are defined below (useChartContext).
494
+ // These closures only run on keydown, well after setup, so referencing them is safe.
495
+ emitFocusMove: (x, y) => coreMouseMove(x, y),
496
+ emitFocusLeave: () => coreMouseLeave()
497
+ });
498
+ const { syncInfo } = useChartSync({
499
+ chartId,
500
+ sync: () => props.sync
501
+ });
502
+ if (syncInfo) {
503
+ provide(CHART_SYNC_INFO_KEY, syncInfo);
504
+ }
505
+ const { tooltip, onMouseMove: coreMouseMove, onMouseLeave: coreMouseLeave, onClick: coreClick, onLegendClick: coreLegendClick, onLegendHover: coreLegendHover, onSyncedResult } = useChartContext({
506
+ coreCtx: {
507
+ coreChart,
508
+ emitHandlerRef,
509
+ setHover: methods.setHover
510
+ },
511
+ width,
512
+ height,
513
+ dir: resolvedDir,
514
+ theme: computed(() => methods.theme),
515
+ rendererDelegate,
516
+ drilldownEnabled: drilldownState.enabled,
517
+ onClickCb: computed(() => hoverConfig.value?.onClick),
518
+ onLegendClickCb: computed(() => legendConfig.value?.onClick),
519
+ syncInfo: syncInfo ?? null,
520
+ containerRef
521
+ });
522
+ provide(TOOLTIP_CONTEXT_KEY, tooltip);
523
+ useChartSyncCoordinator({
524
+ syncInfo: syncInfo ?? null,
525
+ datasets: computed(() => state.value.datasets),
526
+ datasetVisibility: computed(() => state.value.datasetVisibility),
527
+ theme: computed(() => methods.theme),
528
+ zoomState,
529
+ hasCrosshair,
530
+ isSharedMode,
531
+ isCartesian,
532
+ isRect,
533
+ width,
534
+ height,
535
+ getZoomState,
536
+ rendererDelegate,
537
+ updateZoom,
538
+ setDatasetVisibility: methods.setDatasetVisibility,
539
+ toggleItemVisibility: (seriesId, itemLabel) => methods.toggleItemVisibility(seriesId, itemLabel),
540
+ onSyncedResult
541
+ });
542
+ {
543
+ let captionRO = null;
544
+ watch(captionEl, (el) => {
545
+ captionRO?.disconnect();
546
+ captionRO = null;
547
+ if (!el) return;
548
+ captionRO = new ResizeObserver((entries) => {
549
+ const raw = entries[0]?.borderBoxSize?.[0]?.blockSize ?? entries[0]?.contentRect?.height ?? 0;
550
+ const h = Math.round(raw);
551
+ if (h > 0 && h !== measuredCaptionHeight.value) {
552
+ measuredCaptionHeight.value = h;
553
+ }
554
+ });
555
+ captionRO.observe(el);
556
+ const initialH = el.offsetHeight;
557
+ if (initialH > 0) measuredCaptionHeight.value = initialH;
558
+ });
559
+ onBeforeUnmount(() => {
560
+ captionRO?.disconnect();
561
+ });
562
+ }
563
+ watch([
564
+ () => props.renderer,
565
+ () => width.value,
566
+ () => height.value,
567
+ () => props.devicePixelRatio,
568
+ mainCanvasRef,
569
+ overlayCanvasRef
570
+ ], () => {
571
+ if (props.renderer !== "canvas" || !mainCanvasRef.value) return;
572
+ configureCanvasHiDPI(mainCanvasRef.value, width.value, height.value, props.devicePixelRatio);
573
+ if (overlayCanvasRef.value) {
574
+ configureCanvasHiDPI(overlayCanvasRef.value, width.value, height.value, props.devicePixelRatio);
575
+ }
576
+ }, { flush: "post" });
577
+ let _pendingMouseEvent = null;
578
+ let _mouseMoveRafId = 0;
579
+ function handleMouseMove(e) {
580
+ if (zoomIsDragging.value) return;
581
+ _pendingMouseEvent = e;
582
+ if (_mouseMoveRafId) return;
583
+ _mouseMoveRafId = requestAnimationFrame(() => {
584
+ _mouseMoveRafId = 0;
585
+ const evt = _pendingMouseEvent;
586
+ if (!evt) return;
587
+ _pendingMouseEvent = null;
588
+ processMouseMove(evt);
589
+ });
590
+ }
591
+ function processMouseMove(e) {
592
+ if (zoomIsDragging.value) return;
593
+ const rect = containerRef.value?.getBoundingClientRect();
594
+ if (!rect) return;
595
+ coreMouseMove(e.clientX - rect.left, e.clientY - rect.top);
596
+ }
597
+ function handleMouseMoveWithKeyboard(e) {
598
+ keyboardNav.onMouseMove();
599
+ handleMouseMove(e);
600
+ }
601
+ onBeforeUnmount(() => {
602
+ if (_mouseMoveRafId) cancelAnimationFrame(_mouseMoveRafId);
603
+ });
604
+ function handleKeyDown(e) {
605
+ if (keyboardNavEnabled.value) {
606
+ keyboardNav.onKeyDown(e);
607
+ }
608
+ }
609
+ function handleMouseDown() {
610
+ if (keyboardNavEnabled.value && containerRef.value) {
611
+ keyboardNav.notifyPointerDown();
612
+ containerRef.value.focus({ preventScroll: true });
613
+ }
614
+ }
615
+ function handleMouseLeave() {
616
+ coreMouseLeave();
617
+ }
618
+ function handleClick(e) {
619
+ if (!hoverConfig.value && !isRect.value && !drilldownState.enabled.value) return;
620
+ const rect = containerRef.value?.getBoundingClientRect();
621
+ if (!rect) return;
622
+ coreClick(e.clientX - rect.left, e.clientY - rect.top);
623
+ }
624
+ function handleLegendClick(item) {
625
+ coreLegendClick(item);
626
+ }
627
+ function handleLegendHover(item) {
628
+ coreLegendHover(item);
629
+ }
630
+ const crosshairData = computed(() => {
631
+ if (!crosshairConfig.value?.enabled || !tooltip.value?.visible || tooltip.value.cursorX == null || tooltip.value.cursorY == null) return null;
632
+ const plotArea = cartesianRef.value?.getPlotArea() ?? null;
633
+ const ctx = cartesianRef.value?.getCrosshairContext() ?? null;
634
+ if (!plotArea || !ctx) return null;
635
+ const clampedX = Math.max(plotArea.x, Math.min(tooltip.value.cursorX, plotArea.x + plotArea.width));
636
+ const clampedY = Math.max(plotArea.y, Math.min(tooltip.value.cursorY, plotArea.y + plotArea.height));
637
+ return computeCrosshairLayout({
638
+ plotArea,
639
+ ctx,
640
+ lineColor: crosshairConfig.value.color ?? methods.theme.crosshairColor,
641
+ dashArray: crosshairConfig.value.dashArray,
642
+ lineStrokeWidth: crosshairConfig.value.width,
643
+ showX: crosshairConfig.value.showX,
644
+ showY: crosshairConfig.value.showY,
645
+ badgeBg: methods.theme.tooltipBackground,
646
+ badgeTextColor: methods.theme.tooltipColor,
647
+ cursorX: tooltip.value.cursorX,
648
+ cursorY: tooltip.value.cursorY,
649
+ snapX: tooltip.value.snapX ?? clampedX,
650
+ snapY: tooltip.value.snapY ?? clampedY,
651
+ categoryText: tooltip.value.label ?? "",
652
+ cursorValueText: tooltip.value.cursorFormattedValue ?? "",
653
+ barValueText: tooltip.value.formattedValue ?? String(tooltip.value.value),
654
+ barColor: tooltip.value.color,
655
+ allSeriesHits: isSharedMode.value ? tooltip.value.allSeriesHits : void 0
656
+ });
657
+ });
658
+ const annotations = computed(() => state.value.annotations);
659
+ const annotationContext = computed(() => {
660
+ if (!annotations.value?.size || !chartArea.value) return null;
661
+ const outerArea = chartArea.value;
662
+ let xScale = null;
663
+ let yScale = null;
664
+ let getScale = null;
665
+ let plotArea = null;
666
+ if (isCartesian.value && cartesianRef.value) {
667
+ const scales = cartesianRef.value.getScales?.();
668
+ if (scales) {
669
+ xScale = scales.x ?? null;
670
+ yScale = scales.y ?? null;
671
+ }
672
+ if (!xScale && !yScale) {
673
+ const hmScales = cartesianRef.value.getHeatmapScales?.();
674
+ if (hmScales) {
675
+ xScale = hmScales.xScale;
676
+ yScale = hmScales.yScale;
677
+ }
678
+ }
679
+ const ref2 = cartesianRef.value;
680
+ getScale = (axisId) => ref2.getScaleById(axisId);
681
+ plotArea = ref2.getPlotArea?.() ?? null;
682
+ }
683
+ const ca = plotArea ?? outerArea;
684
+ const center = radialRef.value?.getCenter?.() ?? {
685
+ x: ca.x + ca.width / 2,
686
+ y: ca.y + ca.height / 2
687
+ };
688
+ const hover = hoverCtx.value.hover;
689
+ return buildAnnotationContext({
690
+ width: width.value,
691
+ height: height.value,
692
+ chartArea: ca,
693
+ center,
694
+ xScale,
695
+ yScale,
696
+ getScale,
697
+ fontFamily: props.fontFamily ?? DEFAULT_FONT_FAMILY,
698
+ hiddenItems: state.value.hiddenItems,
699
+ datasetVisibility: state.value.datasetVisibility,
700
+ hoveredItem: hover.datasetId !== null && hover.index !== null ? {
701
+ datasetId: hover.datasetId,
702
+ index: hover.index
703
+ } : null,
704
+ theme: methods.theme
705
+ });
706
+ });
707
+ const annotationClipRect = computed(() => {
708
+ const plot = chartIsZoomed.value ? annotationContext.value?.chartArea : null;
709
+ return plot ?? {
710
+ x: 0,
711
+ y: 0,
712
+ width: width.value,
713
+ height: height.value
714
+ };
715
+ });
716
+ const annotationElements = computed(() => {
717
+ if (props.renderer !== "svg") return null;
718
+ const ctx = annotationContext.value;
719
+ if (!ctx || !annotations.value?.size) return null;
720
+ const elements = [];
721
+ annotations.value.forEach((renderFn) => {
722
+ const result = renderFn(ctx);
723
+ if (result != null) elements.push(result);
724
+ });
725
+ return elements.length > 0 ? elements : null;
726
+ });
727
+ watch([annotationContext, annotations], () => {
728
+ if (props.renderer !== "canvas" || !annotationCanvasRef.value) return;
729
+ const ctx = annotationContext.value;
730
+ const annots = annotations.value;
731
+ configureCanvasHiDPI(annotationCanvasRef.value, width.value, height.value, props.devicePixelRatio);
732
+ const canvasCtx = annotationCanvasRef.value.getContext("2d");
733
+ if (!canvasCtx) return;
734
+ canvasCtx.clearRect(0, 0, annotationCanvasRef.value.width, annotationCanvasRef.value.height);
735
+ if (ctx && annots?.size) {
736
+ const clip = annotationClipRect.value;
737
+ canvasCtx.save();
738
+ canvasCtx.beginPath();
739
+ canvasCtx.rect(clip.x, clip.y, clip.width, clip.height);
740
+ canvasCtx.clip();
741
+ renderAnnotationsCanvas(canvasCtx, annots, ctx);
742
+ canvasCtx.restore();
743
+ }
744
+ }, { flush: "post" });
745
+ const frameCallbacks = /* @__PURE__ */ new Set();
746
+ const hoverCallbacks = /* @__PURE__ */ new Set();
747
+ const overlayRenders = /* @__PURE__ */ new Set();
748
+ const pluginTeardowns = [];
749
+ const pluginApis = shallowRef({});
750
+ const pluginOverlayGroupRef = ref(null);
751
+ const pluginOverlayCanvasRef = ref(null);
752
+ const setPluginOverlayGroupRef = (el) => {
753
+ pluginOverlayGroupRef.value = el;
754
+ };
755
+ const setPluginOverlayCanvasRef = (el) => {
756
+ pluginOverlayCanvasRef.value = el;
757
+ };
758
+ const hasPlugins = computed(() => Array.isArray(props.plugins) && props.plugins.length > 0);
759
+ function getPluginArea() {
760
+ if (isCartesian.value) {
761
+ const plot = cartesianRef.value?.getPlotArea?.();
762
+ if (plot) return plot;
763
+ }
764
+ return chartArea.value ?? null;
765
+ }
766
+ function buildPluginState() {
767
+ const s = state.value;
768
+ return {
769
+ datasets: s.datasets,
770
+ datasetVisibility: s.datasetVisibility,
771
+ hiddenItems: s.hiddenItems,
772
+ axes: s.axes,
773
+ features: s.features,
774
+ annotations: s.annotations,
775
+ orderCounter: 0
776
+ };
777
+ }
778
+ function buildPluginContext(options) {
779
+ return {
780
+ getState: () => buildPluginState(),
781
+ getDatasets: () => state.value.datasets,
782
+ getHover: () => {
783
+ const h = hoverCtx.value.hover;
784
+ return h.datasetId === null && h.index === null ? null : h;
785
+ },
786
+ onFrame: (cb) => {
787
+ frameCallbacks.add(cb);
788
+ return () => frameCallbacks.delete(cb);
789
+ },
790
+ onHover: (cb) => {
791
+ hoverCallbacks.add(cb);
792
+ return () => hoverCallbacks.delete(cb);
793
+ },
794
+ registerOverlay: (render) => {
795
+ overlayRenders.add(render);
796
+ paintPluginOverlays();
797
+ return () => {
798
+ overlayRenders.delete(render);
799
+ paintPluginOverlays();
800
+ };
801
+ },
802
+ getContainer: () => containerRef.value,
803
+ options,
804
+ onUnmounted: (fn) => {
805
+ pluginTeardowns.push(fn);
806
+ }
807
+ };
808
+ }
809
+ function paintPluginOverlays() {
810
+ if (overlayRenders.size === 0) return;
811
+ const area = getPluginArea();
812
+ if (!area) return;
813
+ const dpr = props.devicePixelRatio ?? (typeof window !== "undefined" ? window.devicePixelRatio || 1 : 1);
814
+ if (props.renderer === "svg") {
815
+ const g = pluginOverlayGroupRef.value;
816
+ if (!g) return;
817
+ while (g.firstChild) g.removeChild(g.firstChild);
818
+ for (const render of overlayRenders) {
819
+ try {
820
+ render({
821
+ ctx: null,
822
+ svg: g,
823
+ area,
824
+ dpr
825
+ });
826
+ } catch {
827
+ }
828
+ }
829
+ } else {
830
+ const canvas = pluginOverlayCanvasRef.value;
831
+ if (!canvas) return;
832
+ configureCanvasHiDPI(canvas, width.value, height.value, props.devicePixelRatio);
833
+ const c = canvas.getContext("2d");
834
+ if (!c) return;
835
+ c.clearRect(0, 0, canvas.width, canvas.height);
836
+ for (const render of overlayRenders) {
837
+ try {
838
+ c.save();
839
+ render({
840
+ ctx: c,
841
+ svg: null,
842
+ area,
843
+ dpr
844
+ });
845
+ c.restore();
846
+ } catch {
847
+ c.restore();
848
+ }
849
+ }
850
+ }
851
+ }
852
+ function runPluginFrame() {
853
+ for (const cb of frameCallbacks) {
854
+ try {
855
+ cb();
856
+ } catch {
857
+ }
858
+ }
859
+ paintPluginOverlays();
860
+ }
861
+ if (hasPlugins.value) {
862
+ watch([
863
+ coreState,
864
+ () => state.value.datasets,
865
+ () => state.value.datasetVisibility,
866
+ rendererDelegate,
867
+ width,
868
+ height
869
+ ], () => runPluginFrame(), { flush: "post" });
870
+ watch(() => hoverCtx.value.hover, (h) => {
871
+ const hover = h.datasetId === null && h.index === null ? null : h;
872
+ for (const cb of hoverCallbacks) {
873
+ try {
874
+ cb(hover);
875
+ } catch {
876
+ }
877
+ }
878
+ });
879
+ onMounted(() => {
880
+ const entries = props.plugins ?? [];
881
+ const installed = {};
882
+ for (const entry of entries) {
883
+ if (!entry) continue;
884
+ const plugin = Array.isArray(entry) ? entry[0] : entry;
885
+ const options = Array.isArray(entry) ? entry[1] : void 0;
886
+ if (!plugin || typeof plugin.install !== "function") continue;
887
+ try {
888
+ const ctx = buildPluginContext(options);
889
+ const expose = plugin.install(ctx);
890
+ if (plugin.name) {
891
+ installed[plugin.name] = expose ?? {};
892
+ }
893
+ } catch {
894
+ }
895
+ }
896
+ pluginApis.value = installed;
897
+ nextTick(() => runPluginFrame());
898
+ });
899
+ onBeforeUnmount(() => {
900
+ for (const fn of pluginTeardowns.splice(0)) {
901
+ try {
902
+ fn();
903
+ } catch {
904
+ }
905
+ }
906
+ frameCallbacks.clear();
907
+ hoverCallbacks.clear();
908
+ overlayRenders.clear();
909
+ });
910
+ }
911
+ __expose({
912
+ redraw,
913
+ $plugins: pluginApis
914
+ });
915
+ return (_ctx, _cache) => {
916
+ return openBlock(), createElementBlock("div", {
917
+ ref: setSizeContainerRef,
918
+ class: normalizeClass(props.class),
919
+ style: normalizeStyle(outerContainerStyle.value)
920
+ }, [
921
+ licenseResult.value && !licenseValid.value ? (openBlock(), createElementBlock("div", _hoisted_1, [_cache[4] || (_cache[4] = createElementVNode("span", { style: { "font-weight": "600" } }, "PrimeUI Chart", -1)), createElementVNode("span", null, toDisplayString(licenseMessage.value), 1)])) : createCommentVNode("", true),
922
+ renderSlot(_ctx.$slots, "default", { plugins: pluginApis.value }),
923
+ createElementVNode("div", {
924
+ ref_key: "containerRef",
925
+ ref: containerRef,
926
+ "data-chart-container": chartId,
927
+ role: a11yEnabled.value ? "figure" : void 0,
928
+ "aria-label": a11yEnabled.value ? chartDescription.value : void 0,
929
+ "aria-roledescription": a11yEnabled.value ? "chart" : void 0,
930
+ tabindex: keyboardNavEnabled.value ? 0 : void 0,
931
+ style: normalizeStyle(containerStyle.value),
932
+ onMousedown: handleMouseDown,
933
+ onMousemove: handleMouseMoveWithKeyboard,
934
+ onMouseleave: handleMouseLeave,
935
+ onClick: handleClick,
936
+ onKeydown: handleKeyDown,
937
+ onFocus: _cache[2] || (_cache[2] = (...args) => unref(keyboardNav).onFocus && unref(keyboardNav).onFocus(...args)),
938
+ onBlur: _cache[3] || (_cache[3] = (...args) => unref(keyboardNav).onBlur && unref(keyboardNav).onBlur(...args))
939
+ }, [
940
+ a11yEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
941
+ (openBlock(), createBlock(resolveDynamicComponent(a11yHeadingLevel.value), null, {
942
+ default: withCtx(() => [createTextVNode(toDisplayString(titleConfig.value?.text ?? "Chart"), 1)]),
943
+ _: 1
944
+ })),
945
+ captionConfig.value?.text ? (openBlock(), createElementBlock("p", _hoisted_4, toDisplayString(captionConfig.value.text), 1)) : createCommentVNode("", true),
946
+ createElementVNode("p", null, toDisplayString(chartTypeDescription.value), 1),
947
+ dataTable.value ? (openBlock(), createElementBlock("table", _hoisted_5, [
948
+ createElementVNode("caption", null, toDisplayString(dataTable.value.caption), 1),
949
+ createElementVNode("thead", null, [createElementVNode("tr", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(dataTable.value.columns, (col, ci) => {
950
+ return openBlock(), createElementBlock("th", {
951
+ key: ci,
952
+ scope: "col"
953
+ }, toDisplayString(col), 1);
954
+ }), 128))])]),
955
+ createElementVNode("tbody", null, [(openBlock(true), createElementBlock(Fragment, null, renderList(dataTable.value.rows, (row, ri) => {
956
+ return openBlock(), createElementBlock("tr", { key: ri }, [(openBlock(true), createElementBlock(Fragment, null, renderList(row, (cell, ci) => {
957
+ return openBlock(), createElementBlock("td", { key: ci }, toDisplayString(cell), 1);
958
+ }), 128))]);
959
+ }), 128))]),
960
+ dataTable.value.truncatedRowCount > 0 ? (openBlock(), createElementBlock("tfoot", _hoisted_6, [createElementVNode("tr", null, [createElementVNode("td", { colspan: dataTable.value.columns.length }, toDisplayString(dataTable.value.truncatedRowCount) + " more rows not shown.", 9, _hoisted_7)])])) : createCommentVNode("", true)
961
+ ])) : createCommentVNode("", true)
962
+ ])) : createCommentVNode("", true),
963
+ titleConfig.value?.text && titleStyle.value ? (openBlock(), createElementBlock("div", {
964
+ key: 1,
965
+ style: normalizeStyle(titleStyle.value),
966
+ class: "chart-title p-chart-title"
967
+ }, toDisplayString(titleConfig.value.text), 5)) : createCommentVNode("", true),
968
+ captionConfig.value?.text && captionStyle.value ? (openBlock(), createElementBlock("div", {
969
+ key: 2,
970
+ ref_key: "captionEl",
971
+ ref: captionEl,
972
+ style: normalizeStyle(captionStyle.value),
973
+ class: "chart-caption p-chart-caption"
974
+ }, toDisplayString(captionConfig.value.text), 5)) : createCommentVNode("", true),
975
+ __props.renderer === "svg" && chartArea.value ? (openBlock(), createElementBlock("svg", {
976
+ key: 3,
977
+ width: unref(width),
978
+ height: unref(height),
979
+ role: a11yEnabled.value ? "img" : void 0,
980
+ "aria-label": a11yEnabled.value ? chartDescription.value : void 0,
981
+ style: normalizeStyle({
982
+ display: "block",
983
+ overflow: "hidden",
984
+ direction: "ltr",
985
+ fontFamily: props.fontFamily ?? unref(DEFAULT_FONT_FAMILY)
986
+ })
987
+ }, [
988
+ isCartesian.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).cartesian), {
989
+ key: 0,
990
+ ref_key: "cartesianRef",
991
+ ref: cartesianRef,
992
+ "chart-area": chartArea.value,
993
+ width: unref(width),
994
+ height: unref(height),
995
+ "canvas-el": mainCanvasRef.value,
996
+ "zoom-state": unref(zoomState),
997
+ "adaptive-data-label-font-size": unref(adaptive).dataLabelFontSize,
998
+ "adaptive-data-label-rotation": unref(adaptive).dataLabelRotation,
999
+ "rule-overrides": unref(ruleOverrides)
1000
+ }, null, 8, [
1001
+ "chart-area",
1002
+ "width",
1003
+ "height",
1004
+ "canvas-el",
1005
+ "zoom-state",
1006
+ "adaptive-data-label-font-size",
1007
+ "adaptive-data-label-rotation",
1008
+ "rule-overrides"
1009
+ ])) : isRect.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).rect), {
1010
+ key: 1,
1011
+ ref_key: "rectRef",
1012
+ ref: rectRef,
1013
+ "chart-area": chartArea.value,
1014
+ width: unref(width),
1015
+ height: unref(height),
1016
+ "canvas-el": mainCanvasRef.value,
1017
+ "drilldown-state": unref(drilldownState)
1018
+ }, null, 8, [
1019
+ "chart-area",
1020
+ "width",
1021
+ "height",
1022
+ "canvas-el",
1023
+ "drilldown-state"
1024
+ ])) : chartArea.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).radial), {
1025
+ key: 2,
1026
+ ref_key: "radialRef",
1027
+ ref: radialRef,
1028
+ "chart-area": chartArea.value,
1029
+ width: unref(width),
1030
+ height: unref(height),
1031
+ "canvas-el": mainCanvasRef.value,
1032
+ "container-el": containerRef.value,
1033
+ "adaptive-data-label-font-size": unref(adaptive).dataLabelFontSize
1034
+ }, null, 8, [
1035
+ "chart-area",
1036
+ "width",
1037
+ "height",
1038
+ "canvas-el",
1039
+ "container-el",
1040
+ "adaptive-data-label-font-size"
1041
+ ])) : createCommentVNode("", true),
1042
+ navigatorArea.value && navigatorConfig.value ? (openBlock(), createBlock(NavigatorRenderer_default, {
1043
+ key: 3,
1044
+ area: navigatorArea.value,
1045
+ config: navigatorConfig.value,
1046
+ datasets: unref(state).datasets,
1047
+ "zoom-state": unref(zoomState),
1048
+ "update-zoom": unref(updateZoom),
1049
+ "chart-id": chartId,
1050
+ "is-time-axis": cartesianRef.value?.isTimeAxis,
1051
+ "tick-format": xAxisTickFormat.value
1052
+ }, null, 8, [
1053
+ "area",
1054
+ "config",
1055
+ "datasets",
1056
+ "zoom-state",
1057
+ "update-zoom",
1058
+ "is-time-axis",
1059
+ "tick-format"
1060
+ ])) : createCommentVNode("", true),
1061
+ hasPlugins.value ? (openBlock(), createElementBlock("g", {
1062
+ key: 4,
1063
+ ref: setPluginOverlayGroupRef,
1064
+ class: "p-chart-plugin-overlay"
1065
+ })) : createCommentVNode("", true),
1066
+ annotationElements.value ? (openBlock(), createElementBlock("defs", _hoisted_9, [createElementVNode("clipPath", { id: `${chartId}-annotation-clip` }, [createElementVNode("rect", {
1067
+ x: annotationClipRect.value.x,
1068
+ y: annotationClipRect.value.y,
1069
+ width: annotationClipRect.value.width,
1070
+ height: annotationClipRect.value.height
1071
+ }, null, 8, _hoisted_11)], 8, _hoisted_10)])) : createCommentVNode("", true),
1072
+ annotationElements.value ? (openBlock(), createElementBlock("g", {
1073
+ key: 6,
1074
+ class: "p-chart-annotations",
1075
+ fill: annotationContext.value?.textColor,
1076
+ "clip-path": `url(#${chartId}-annotation-clip)`
1077
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(annotationElements.value, (el, i) => {
1078
+ return openBlock(), createBlock(resolveDynamicComponent(() => el), { key: i });
1079
+ }), 128))], 8, _hoisted_12)) : createCommentVNode("", true)
1080
+ ], 12, _hoisted_8)) : createCommentVNode("", true),
1081
+ __props.renderer === "canvas" && chartArea.value ? (openBlock(), createElementBlock("div", _hoisted_13, [
1082
+ createElementVNode("canvas", {
1083
+ ref: setMainCanvasRef,
1084
+ role: "img",
1085
+ "aria-label": a11yEnabled.value ? chartDescription.value : void 0,
1086
+ width: unref(width),
1087
+ height: unref(height),
1088
+ style: normalizeStyle({
1089
+ display: "block",
1090
+ direction: "ltr",
1091
+ fontFamily: props.fontFamily ?? unref(DEFAULT_FONT_FAMILY)
1092
+ })
1093
+ }, null, 12, _hoisted_14),
1094
+ createElementVNode("canvas", {
1095
+ ref: setOverlayCanvasRef,
1096
+ "aria-hidden": "true",
1097
+ width: unref(width),
1098
+ height: unref(height),
1099
+ style: {
1100
+ position: "absolute",
1101
+ top: "0px",
1102
+ left: "0px",
1103
+ pointerEvents: "none",
1104
+ direction: "ltr"
1105
+ }
1106
+ }, null, 8, _hoisted_15),
1107
+ createElementVNode("canvas", {
1108
+ ref: setAnnotationCanvasRef,
1109
+ "aria-hidden": "true",
1110
+ width: unref(width),
1111
+ height: unref(height),
1112
+ style: {
1113
+ position: "absolute",
1114
+ top: "0px",
1115
+ left: "0px",
1116
+ pointerEvents: "none",
1117
+ direction: "ltr"
1118
+ }
1119
+ }, null, 8, _hoisted_16),
1120
+ hasPlugins.value ? (openBlock(), createElementBlock("canvas", {
1121
+ key: 0,
1122
+ ref: setPluginOverlayCanvasRef,
1123
+ "aria-hidden": "true",
1124
+ width: unref(width),
1125
+ height: unref(height),
1126
+ style: {
1127
+ position: "absolute",
1128
+ top: "0px",
1129
+ left: "0px",
1130
+ pointerEvents: "none",
1131
+ direction: "ltr"
1132
+ }
1133
+ }, null, 8, _hoisted_17)) : createCommentVNode("", true)
1134
+ ])) : createCommentVNode("", true),
1135
+ isCartesian.value && __props.renderer === "canvas" && chartArea.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).cartesian), {
1136
+ key: 5,
1137
+ ref_key: "cartesianRef",
1138
+ ref: cartesianRef,
1139
+ "chart-area": chartArea.value,
1140
+ width: unref(width),
1141
+ height: unref(height),
1142
+ "canvas-el": mainCanvasRef.value,
1143
+ "overlay-canvas-el": overlayCanvasRef.value,
1144
+ "zoom-state": unref(zoomState),
1145
+ "adaptive-data-label-font-size": unref(adaptive).dataLabelFontSize,
1146
+ "adaptive-data-label-rotation": unref(adaptive).dataLabelRotation,
1147
+ "rule-overrides": unref(ruleOverrides)
1148
+ }, null, 8, [
1149
+ "chart-area",
1150
+ "width",
1151
+ "height",
1152
+ "canvas-el",
1153
+ "overlay-canvas-el",
1154
+ "zoom-state",
1155
+ "adaptive-data-label-font-size",
1156
+ "adaptive-data-label-rotation",
1157
+ "rule-overrides"
1158
+ ])) : isRect.value && __props.renderer === "canvas" && chartArea.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).rect), {
1159
+ key: 6,
1160
+ ref_key: "rectRef",
1161
+ ref: rectRef,
1162
+ "chart-area": chartArea.value,
1163
+ width: unref(width),
1164
+ height: unref(height),
1165
+ "canvas-el": mainCanvasRef.value,
1166
+ "drilldown-state": unref(drilldownState)
1167
+ }, null, 8, [
1168
+ "chart-area",
1169
+ "width",
1170
+ "height",
1171
+ "canvas-el",
1172
+ "drilldown-state"
1173
+ ])) : __props.renderer === "canvas" && chartArea.value ? (openBlock(), createBlock(resolveDynamicComponent(unref(familyRenderers).radial), {
1174
+ key: 7,
1175
+ ref_key: "radialRef",
1176
+ ref: radialRef,
1177
+ "chart-area": chartArea.value,
1178
+ width: unref(width),
1179
+ height: unref(height),
1180
+ "canvas-el": mainCanvasRef.value,
1181
+ "container-el": containerRef.value,
1182
+ "adaptive-data-label-font-size": unref(adaptive).dataLabelFontSize
1183
+ }, null, 8, [
1184
+ "chart-area",
1185
+ "width",
1186
+ "height",
1187
+ "canvas-el",
1188
+ "container-el",
1189
+ "adaptive-data-label-font-size"
1190
+ ])) : createCommentVNode("", true),
1191
+ __props.renderer === "canvas" && navigatorArea.value && navigatorConfig.value ? (openBlock(), createBlock(NavigatorRenderer_default, {
1192
+ key: 8,
1193
+ area: navigatorArea.value,
1194
+ config: navigatorConfig.value,
1195
+ datasets: unref(state).datasets,
1196
+ "zoom-state": unref(zoomState),
1197
+ "update-zoom": unref(updateZoom),
1198
+ "chart-id": chartId,
1199
+ "is-time-axis": cartesianRef.value?.isTimeAxis,
1200
+ "tick-format": xAxisTickFormat.value,
1201
+ renderer: "canvas"
1202
+ }, null, 8, [
1203
+ "area",
1204
+ "config",
1205
+ "datasets",
1206
+ "zoom-state",
1207
+ "update-zoom",
1208
+ "is-time-axis",
1209
+ "tick-format"
1210
+ ])) : createCommentVNode("", true),
1211
+ legendConfig.value && unref(ruleOverrides).legend?.enabled !== false ? (openBlock(), createBlock(LegendRenderer_default, {
1212
+ key: 9,
1213
+ "legend-config": legendConfig.value,
1214
+ "legend-area": legendArea.value,
1215
+ "legend-items": legendItems.value,
1216
+ "on-legend-click": handleLegendClick,
1217
+ "on-legend-hover": handleLegendHover,
1218
+ "adaptive-font-size": unref(adaptive).legendItemFontSize,
1219
+ "effective-position": effectiveLegendPosition.value,
1220
+ "global-font-family": props.fontFamily,
1221
+ dir: resolvedDir.value
1222
+ }, null, 8, [
1223
+ "legend-config",
1224
+ "legend-area",
1225
+ "legend-items",
1226
+ "adaptive-font-size",
1227
+ "effective-position",
1228
+ "global-font-family",
1229
+ "dir"
1230
+ ])) : createCommentVNode("", true),
1231
+ colorLegendConfig.value && colorLegendArea.value ? (openBlock(), createBlock(ColorLegendRenderer_default, {
1232
+ key: 10,
1233
+ config: colorLegendConfig.value,
1234
+ area: colorLegendArea.value,
1235
+ "auto-color-scale": autoColorScale.value,
1236
+ "hovered-value": hoveredColorValue.value
1237
+ }, null, 8, [
1238
+ "config",
1239
+ "area",
1240
+ "auto-color-scale",
1241
+ "hovered-value"
1242
+ ])) : createCommentVNode("", true),
1243
+ crosshairData.value && !unref(zoomIsDragging) ? (openBlock(), createElementBlock("svg", {
1244
+ key: 11,
1245
+ width: unref(width),
1246
+ height: unref(height),
1247
+ "aria-hidden": "true",
1248
+ style: {
1249
+ position: "absolute",
1250
+ top: 0,
1251
+ left: 0,
1252
+ pointerEvents: "none",
1253
+ overflow: "visible",
1254
+ direction: "ltr"
1255
+ },
1256
+ class: "chart-crosshair"
1257
+ }, [
1258
+ crosshairData.value.showX ? (openBlock(), createElementBlock("line", {
1259
+ key: 0,
1260
+ x1: crosshairData.value.cursorX,
1261
+ y1: crosshairData.value.plotArea.y,
1262
+ x2: crosshairData.value.cursorX,
1263
+ y2: crosshairData.value.plotArea.y + crosshairData.value.plotArea.height,
1264
+ stroke: crosshairData.value.lineColor,
1265
+ "stroke-width": crosshairData.value.sw,
1266
+ "stroke-dasharray": crosshairData.value.dash
1267
+ }, null, 8, _hoisted_19)) : createCommentVNode("", true),
1268
+ crosshairData.value.showY ? (openBlock(), createElementBlock("line", {
1269
+ key: 1,
1270
+ x1: crosshairData.value.plotArea.x,
1271
+ y1: crosshairData.value.cursorY,
1272
+ x2: crosshairData.value.plotArea.x + crosshairData.value.plotArea.width,
1273
+ y2: crosshairData.value.cursorY,
1274
+ stroke: crosshairData.value.lineColor,
1275
+ "stroke-width": crosshairData.value.sw,
1276
+ "stroke-dasharray": crosshairData.value.dash
1277
+ }, null, 8, _hoisted_20)) : createCommentVNode("", true),
1278
+ crosshairData.value.catBadge ? (openBlock(), createElementBlock("g", _hoisted_21, [createElementVNode("rect", {
1279
+ class: "p-chart-crosshair-badge",
1280
+ x: crosshairData.value.catBadge.x,
1281
+ y: crosshairData.value.catBadge.y,
1282
+ width: crosshairData.value.catBadge.w,
1283
+ height: crosshairData.value.catBadge.h,
1284
+ rx: crosshairData.value.badgeRadius
1285
+ }, null, 8, _hoisted_22), createElementVNode("text", {
1286
+ class: "p-chart-crosshair-badge-text",
1287
+ x: crosshairData.value.catBadge.textX,
1288
+ y: crosshairData.value.catBadge.textY,
1289
+ "text-anchor": "middle",
1290
+ "dominant-baseline": "central",
1291
+ "font-size": crosshairData.value.badgeFontSize,
1292
+ "font-family": "Arial, sans-serif"
1293
+ }, toDisplayString(crosshairData.value.catBadge.text), 9, _hoisted_23)])) : createCommentVNode("", true),
1294
+ crosshairData.value.valBadge ? (openBlock(), createElementBlock("g", _hoisted_24, [createElementVNode("rect", {
1295
+ class: "p-chart-crosshair-badge",
1296
+ x: crosshairData.value.valBadge.x,
1297
+ y: crosshairData.value.valBadge.y,
1298
+ width: crosshairData.value.valBadge.w,
1299
+ height: crosshairData.value.valBadge.h,
1300
+ rx: crosshairData.value.badgeRadius
1301
+ }, null, 8, _hoisted_25), createElementVNode("text", {
1302
+ class: "p-chart-crosshair-badge-text",
1303
+ x: crosshairData.value.valBadge.textX,
1304
+ y: crosshairData.value.valBadge.textY,
1305
+ "text-anchor": "middle",
1306
+ "dominant-baseline": "central",
1307
+ "font-size": crosshairData.value.badgeFontSize,
1308
+ "font-family": "Arial, sans-serif"
1309
+ }, toDisplayString(crosshairData.value.valBadge.text), 9, _hoisted_26)])) : createCommentVNode("", true),
1310
+ crosshairData.value.barLabel ? (openBlock(), createElementBlock("g", _hoisted_27, [createElementVNode("rect", {
1311
+ x: crosshairData.value.barLabel.x,
1312
+ y: crosshairData.value.barLabel.y,
1313
+ width: crosshairData.value.barLabel.w,
1314
+ height: crosshairData.value.barLabel.h,
1315
+ rx: crosshairData.value.badgeRadius,
1316
+ fill: crosshairData.value.barLabel.color
1317
+ }, null, 8, _hoisted_28), createElementVNode("text", {
1318
+ x: crosshairData.value.barLabel.textX,
1319
+ y: crosshairData.value.barLabel.textY,
1320
+ "text-anchor": "middle",
1321
+ "dominant-baseline": "central",
1322
+ fill: "#ffffff",
1323
+ "font-size": crosshairData.value.badgeFontSize,
1324
+ "font-weight": 500,
1325
+ "font-family": "Arial, sans-serif"
1326
+ }, toDisplayString(crosshairData.value.barLabel.text), 9, _hoisted_29)])) : createCommentVNode("", true),
1327
+ (openBlock(true), createElementBlock(Fragment, null, renderList(crosshairData.value.seriesLabels, (label, i) => {
1328
+ return openBlock(), createElementBlock("g", { key: i }, [createElementVNode("rect", {
1329
+ x: label.x,
1330
+ y: label.y,
1331
+ width: label.w,
1332
+ height: label.h,
1333
+ rx: crosshairData.value.badgeRadius,
1334
+ fill: label.color
1335
+ }, null, 8, _hoisted_30), createElementVNode("text", {
1336
+ x: label.textX,
1337
+ y: label.textY,
1338
+ "text-anchor": "middle",
1339
+ "dominant-baseline": "central",
1340
+ fill: "#ffffff",
1341
+ "font-size": crosshairData.value.badgeFontSize,
1342
+ "font-weight": 500,
1343
+ "font-family": "Arial, sans-serif"
1344
+ }, toDisplayString(label.text), 9, _hoisted_31)]);
1345
+ }), 128))
1346
+ ], 8, _hoisted_18)) : createCommentVNode("", true),
1347
+ tooltipConfig.value && !hasCrosshair.value && !unref(zoomIsDragging) && unref(ruleOverrides).tooltip?.enabled !== false ? (openBlock(), createBlock(TooltipRenderer_default, {
1348
+ key: 12,
1349
+ "tooltip-config": tooltipConfig.value,
1350
+ rtl: resolvedDir.value === "rtl",
1351
+ locale: unref(methods).locale,
1352
+ width: unref(width),
1353
+ height: unref(height)
1354
+ }, null, 8, [
1355
+ "tooltip-config",
1356
+ "rtl",
1357
+ "locale",
1358
+ "width",
1359
+ "height"
1360
+ ])) : createCommentVNode("", true),
1361
+ unref(selectionRect) ? (openBlock(), createElementBlock("svg", {
1362
+ key: 13,
1363
+ width: unref(width),
1364
+ height: unref(height),
1365
+ style: {
1366
+ position: "absolute",
1367
+ top: 0,
1368
+ left: 0,
1369
+ pointerEvents: "none",
1370
+ zIndex: 5
1371
+ }
1372
+ }, [createElementVNode("rect", {
1373
+ x: unref(selectionRect).x,
1374
+ y: unref(selectionRect).y,
1375
+ width: unref(selectionRect).width,
1376
+ height: unref(selectionRect).height,
1377
+ fill: "rgba(59, 130, 246, 0.15)",
1378
+ stroke: "rgba(59, 130, 246, 0.6)",
1379
+ "stroke-width": 1,
1380
+ rx: "2"
1381
+ }, null, 8, _hoisted_33)], 8, _hoisted_32)) : createCommentVNode("", true),
1382
+ unref(chartIsZoomed) && chartArea.value && resetButtonConfig.value !== null ? (openBlock(), createElementBlock("button", {
1383
+ key: 14,
1384
+ class: normalizeClass(["chart-reset-zoom", resetButtonConfig.value?.className].filter(Boolean).join(" ")),
1385
+ style: normalizeStyle({
1386
+ position: "absolute",
1387
+ top: `${resetZoomTop.value}px`,
1388
+ [resolvedDir.value === "rtl" ? "left" : "right"]: `${unref(width) - chartArea.value.x - chartArea.value.width + 8}px`,
1389
+ padding: "3px 8px",
1390
+ fontSize: "11px",
1391
+ fontWeight: "500",
1392
+ border: "1px solid rgba(0,0,0,0.15)",
1393
+ borderRadius: "4px",
1394
+ background: "rgba(255,255,255,0.92)",
1395
+ color: "#374151",
1396
+ cursor: "pointer",
1397
+ zIndex: 10,
1398
+ backdropFilter: "blur(4px)",
1399
+ lineHeight: "1.4"
1400
+ }),
1401
+ onClick: _cache[0] || (_cache[0] = withModifiers(
1402
+ //@ts-ignore
1403
+ (...args) => unref(resetZoom) && unref(resetZoom)(...args),
1404
+ ["stop"]
1405
+ ))
1406
+ }, toDisplayString(resetButtonConfig.value?.text ?? "Reset zoom"), 7)) : createCommentVNode("", true),
1407
+ unref(drilldownState).isActive.value && chartArea.value ? (openBlock(), createElementBlock("nav", {
1408
+ key: 15,
1409
+ onClick: _cache[1] || (_cache[1] = withModifiers(() => {
1410
+ }, ["stop"])),
1411
+ class: normalizeClass(breadcrumbConfig.value?.class),
1412
+ style: normalizeStyle({
1413
+ position: "absolute",
1414
+ top: `${chartArea.value.y - 28}px`,
1415
+ height: "25px",
1416
+ boxSizing: "border-box",
1417
+ left: "0",
1418
+ right: "0",
1419
+ display: "flex",
1420
+ alignItems: "center",
1421
+ padding: "6px 8px",
1422
+ fontSize: "13px",
1423
+ zIndex: 10,
1424
+ pointerEvents: "auto",
1425
+ color: "white",
1426
+ background: "rgba(0, 0, 0, 0.55)",
1427
+ backdropFilter: "blur(4px)",
1428
+ ...breadcrumbConfig.value?.style
1429
+ })
1430
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(breadcrumbItems.value, (item) => {
1431
+ return openBlock(), createElementBlock(Fragment, { key: item.i }, [item.i > 0 ? (openBlock(), createElementBlock("span", _hoisted_34, toDisplayString(breadcrumbConfig.value?.separator ?? " / "), 1)) : createCommentVNode("", true), item.vnode ? (openBlock(), createBlock(unref(VNodeRenderer), {
1432
+ key: 1,
1433
+ node: item.vnode
1434
+ }, null, 8, ["node"])) : (openBlock(), createElementBlock("span", {
1435
+ key: 2,
1436
+ style: normalizeStyle({
1437
+ cursor: item.isActive ? "default" : "pointer",
1438
+ fontWeight: item.isActive ? "600" : "400",
1439
+ opacity: item.isActive ? 1 : 0.7,
1440
+ textDecoration: item.isActive ? "none" : "underline"
1441
+ }),
1442
+ onClick: ($event) => item.isActive ? void 0 : wrappedDrillToLevel(item.i)
1443
+ }, toDisplayString(item.crumb.label), 13, _hoisted_35))], 64);
1444
+ }), 128))], 6)) : createCommentVNode("", true),
1445
+ unref(keyboardNav).state.value.active && unref(keyboardNav).focusPosition.value ? (openBlock(), createElementBlock("svg", {
1446
+ key: 16,
1447
+ width: unref(width),
1448
+ height: unref(height),
1449
+ "aria-hidden": "true",
1450
+ style: {
1451
+ position: "absolute",
1452
+ top: 0,
1453
+ left: 0,
1454
+ pointerEvents: "none"
1455
+ },
1456
+ class: "chart-focus-indicator"
1457
+ }, [createElementVNode("rect", {
1458
+ x: unref(keyboardNav).focusPosition.value.x - (keyboardNavConfig.value?.focusBorder?.margin ?? 2),
1459
+ y: unref(keyboardNav).focusPosition.value.y - (keyboardNavConfig.value?.focusBorder?.margin ?? 2),
1460
+ width: unref(keyboardNav).focusPosition.value.width + (keyboardNavConfig.value?.focusBorder?.margin ?? 2) * 2,
1461
+ height: unref(keyboardNav).focusPosition.value.height + (keyboardNavConfig.value?.focusBorder?.margin ?? 2) * 2,
1462
+ rx: keyboardNavConfig.value?.focusBorder?.style?.borderRadius ?? (unref(keyboardNav).focusPosition.value.shape === "circle" ? 999 : 3),
1463
+ fill: "none",
1464
+ stroke: keyboardNavConfig.value?.focusBorder?.style?.color ?? "var(--p-chart-title-color, #888)",
1465
+ "stroke-width": keyboardNavConfig.value?.focusBorder?.style?.width ?? 2,
1466
+ "stroke-dasharray": keyboardNavConfig.value?.focusBorder?.style?.lineStyle === "dotted" ? "2 2" : keyboardNavConfig.value?.focusBorder?.style?.lineStyle === "solid" ? void 0 : "4 3"
1467
+ }, null, 8, _hoisted_37)], 8, _hoisted_36)) : createCommentVNode("", true),
1468
+ keyboardNavEnabled.value ? (openBlock(), createElementBlock("div", _hoisted_38, toDisplayString(unref(keyboardNav).announcement.value), 1)) : createCommentVNode("", true)
1469
+ ], 44, _hoisted_2)
1470
+ ], 6);
1471
+ };
1472
+ }
1473
+ });
1474
+ var Chart_default = _sfc_main;
1475
+
1476
+ export { Chart_default };