@kubit-ui-web/react-charts 0.1.0 → 1.1.0

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 (230) hide show
  1. package/README.md +31 -36
  2. package/dist/cjs/charts/barChart/barChart.js +12 -29
  3. package/dist/cjs/charts/barChart/barChart.type.js +1 -2
  4. package/dist/cjs/charts/barChart/barChartStructure.js +25 -29
  5. package/dist/cjs/charts/barChart/context/barChartContext.js +2 -5
  6. package/dist/cjs/charts/barChart/context/buildBarContextValues.js +17 -21
  7. package/dist/cjs/charts/barChart/fragments/barChartPath.js +12 -16
  8. package/dist/cjs/charts/barChart/fragments/barChartSeparator.js +10 -14
  9. package/dist/cjs/charts/barChart/fragments/barChartXAxis.js +10 -14
  10. package/dist/cjs/charts/barChart/fragments/barChartYAxis.js +13 -17
  11. package/dist/cjs/charts/barChart/fragments/fixture/barContextData.js +3 -6
  12. package/dist/cjs/charts/barChart/fragments/fixture/index.js +1 -5
  13. package/dist/cjs/charts/barChart/index.js +1 -17
  14. package/dist/cjs/charts/barChart/utils/countBarChildren.js +5 -9
  15. package/dist/cjs/charts/barChart/utils/getAxisExtraSpacing.js +31 -35
  16. package/dist/cjs/charts/barChart/utils/getBarDataValue.js +1 -5
  17. package/dist/cjs/charts/barChart/utils/getRoundedBarMaxValue.js +1 -5
  18. package/dist/cjs/charts/index.js +3 -19
  19. package/dist/cjs/charts/lineChart/context/buildLineContextValue.js +17 -21
  20. package/dist/cjs/charts/lineChart/context/index.js +2 -7
  21. package/dist/cjs/charts/lineChart/context/lineChartContext.js +2 -5
  22. package/dist/cjs/charts/lineChart/fragments/fixture/contextData.js +1 -4
  23. package/dist/cjs/charts/lineChart/fragments/fixture/index.js +1 -5
  24. package/dist/cjs/charts/lineChart/fragments/index.js +4 -11
  25. package/dist/cjs/charts/lineChart/fragments/lineChartPath.js +31 -35
  26. package/dist/cjs/charts/lineChart/fragments/lineChartProjection.js +6 -10
  27. package/dist/cjs/charts/lineChart/fragments/lineChartSeparator.js +10 -14
  28. package/dist/cjs/charts/lineChart/fragments/lineChartXAxis.js +14 -18
  29. package/dist/cjs/charts/lineChart/fragments/lineChartYAxis.js +17 -21
  30. package/dist/cjs/charts/lineChart/hook/index.js +3 -9
  31. package/dist/cjs/charts/lineChart/hook/useAutoClick.js +6 -10
  32. package/dist/cjs/charts/lineChart/hook/useHover.js +5 -9
  33. package/dist/cjs/charts/lineChart/hook/useIndicator.js +5 -9
  34. package/dist/cjs/charts/lineChart/index.js +1 -17
  35. package/dist/cjs/charts/lineChart/lineChart.js +12 -29
  36. package/dist/cjs/charts/lineChart/lineChart.type.js +1 -2
  37. package/dist/cjs/charts/lineChart/lineChartStructure.js +34 -38
  38. package/dist/cjs/charts/lineChart/utils/accessibilityTemplateProcessor.js +6 -10
  39. package/dist/cjs/charts/lineChart/utils/findSurroundingNumber.js +2 -7
  40. package/dist/cjs/charts/lineChart/utils/getDataValues.js +1 -5
  41. package/dist/cjs/charts/lineChart/utils/getExtraSpacing.js +26 -30
  42. package/dist/cjs/charts/lineChart/utils/getPathData.js +1 -5
  43. package/dist/cjs/charts/lineChart/utils/getProjection.js +1 -5
  44. package/dist/cjs/charts/lineChart/utils/getRoundedMaxValue.js +2 -7
  45. package/dist/cjs/charts/lineChart/utils/handleNodesFocus.js +1 -5
  46. package/dist/cjs/charts/lineChart/utils/index.js +6 -17
  47. package/dist/cjs/charts/pieChart/context/buildPieContextValue.js +8 -12
  48. package/dist/cjs/charts/pieChart/context/index.js +2 -7
  49. package/dist/cjs/charts/pieChart/context/pieChartContext.js +2 -5
  50. package/dist/cjs/charts/pieChart/fragments/index.js +2 -7
  51. package/dist/cjs/charts/pieChart/fragments/pieChartForeign.js +7 -11
  52. package/dist/cjs/charts/pieChart/fragments/pieChartPath.js +12 -16
  53. package/dist/cjs/charts/pieChart/fragments/pieChartSegment.js +6 -10
  54. package/dist/cjs/charts/pieChart/index.js +1 -17
  55. package/dist/cjs/charts/pieChart/pieChart.js +8 -25
  56. package/dist/cjs/charts/pieChart/pieChart.type.js +1 -2
  57. package/dist/cjs/charts/pieChart/pieChartStructure.js +16 -20
  58. package/dist/cjs/charts/pieChart/utils/buildL.js +1 -5
  59. package/dist/cjs/charts/pieChart/utils/calculatePoint.js +1 -5
  60. package/dist/cjs/charts/pieChart/utils/calculateSegmentPath.js +10 -14
  61. package/dist/cjs/charts/pieChart/utils/drawSegmentPath.js +6 -10
  62. package/dist/cjs/charts/pieChart/utils/index.js +2 -7
  63. package/dist/cjs/charts/pieChart/utils/rotationDirection.js +3 -7
  64. package/dist/cjs/components/axisChart/index.js +2 -18
  65. package/dist/cjs/components/axisChart/utils/filterLineProps/filterLineProps.js +1 -5
  66. package/dist/cjs/components/axisChart/utils/index.js +1 -17
  67. package/dist/cjs/components/axisChart/xAxis/index.js +2 -18
  68. package/dist/cjs/components/axisChart/xAxis/xAxis.js +14 -18
  69. package/dist/cjs/components/axisChart/xAxis/xAxis.types.js +1 -2
  70. package/dist/cjs/components/axisChart/yAxis/index.js +2 -18
  71. package/dist/cjs/components/axisChart/yAxis/yAxis.js +13 -17
  72. package/dist/cjs/components/axisChart/yAxis/yAxis.types.js +1 -2
  73. package/dist/cjs/components/bar/bar.js +9 -13
  74. package/dist/cjs/components/bar/bar.type.js +1 -4
  75. package/dist/cjs/components/bar/fragments/barChartSegment.js +3 -7
  76. package/dist/cjs/components/bar/index.js +2 -18
  77. package/dist/cjs/components/bar/utils/buildD.js +5 -9
  78. package/dist/cjs/components/bar/utils/getSegments.js +3 -7
  79. package/dist/cjs/components/chartText/chartText.js +3 -7
  80. package/dist/cjs/components/chartText/chartText.types.js +1 -2
  81. package/dist/cjs/components/chartText/index.js +2 -18
  82. package/dist/cjs/components/foreignObject/foreignObject.js +3 -7
  83. package/dist/cjs/components/foreignObject/foreignObject.types.js +1 -2
  84. package/dist/cjs/components/foreignObject/index.js +2 -18
  85. package/dist/cjs/components/index.js +10 -26
  86. package/dist/cjs/components/line/index.js +2 -18
  87. package/dist/cjs/components/line/line.js +3 -7
  88. package/dist/cjs/components/line/line.types.js +1 -2
  89. package/dist/cjs/components/node/components/circle/circle.js +4 -7
  90. package/dist/cjs/components/node/components/hexagon/hexagon.js +6 -9
  91. package/dist/cjs/components/node/components/pentagon/pentagon.js +6 -9
  92. package/dist/cjs/components/node/components/square/square.js +4 -7
  93. package/dist/cjs/components/node/components/star/star.js +6 -9
  94. package/dist/cjs/components/node/components/straight/straight.js +4 -7
  95. package/dist/cjs/components/node/components/triangle/triangle.js +4 -7
  96. package/dist/cjs/components/node/index.js +2 -18
  97. package/dist/cjs/components/node/node.js +22 -25
  98. package/dist/cjs/components/node/node.types.js +1 -4
  99. package/dist/cjs/components/node/utils/calculateShapePoints/calculateShapePoints.js +1 -5
  100. package/dist/cjs/components/path/components/nodePath/nodePath.js +9 -12
  101. package/dist/cjs/components/path/index.js +2 -18
  102. package/dist/cjs/components/path/path.js +20 -23
  103. package/dist/cjs/components/path/path.types.js +1 -2
  104. package/dist/cjs/components/plot/components/circle/circle.js +4 -7
  105. package/dist/cjs/components/plot/components/index.js +3 -19
  106. package/dist/cjs/components/plot/components/square/square.js +4 -7
  107. package/dist/cjs/components/plot/components/triangle/triangle.js +4 -7
  108. package/dist/cjs/components/plot/index.js +2 -18
  109. package/dist/cjs/components/plot/plot.js +21 -24
  110. package/dist/cjs/components/plot/plot.types.js +8 -11
  111. package/dist/cjs/components/svgContainer/index.js +1 -17
  112. package/dist/cjs/components/svgContainer/svgContainer.js +5 -8
  113. package/dist/cjs/components/svgContainer/svgContainer.types.js +1 -2
  114. package/dist/cjs/components/svgContainer/utils/buildViewBox/buildViewBox.js +1 -5
  115. package/dist/cjs/components/svgContainer/utils/index.js +1 -17
  116. package/dist/cjs/components/tick/index.js +2 -18
  117. package/dist/cjs/components/tick/tick.js +4 -8
  118. package/dist/cjs/components/tick/tick.types.js +1 -4
  119. package/dist/cjs/components/zoomArea/components/HandlerIcon.js +3 -7
  120. package/dist/cjs/components/zoomArea/components/LineRenderer.js +3 -7
  121. package/dist/cjs/components/zoomArea/components/SelectionArea.js +9 -14
  122. package/dist/cjs/components/zoomArea/components/ZoomHandler.js +6 -10
  123. package/dist/cjs/components/zoomArea/components/index.js +4 -12
  124. package/dist/cjs/components/zoomArea/hooks/index.js +5 -13
  125. package/dist/cjs/components/zoomArea/hooks/useDragInteraction.js +19 -23
  126. package/dist/cjs/components/zoomArea/hooks/useKeyboardNavigation.js +18 -22
  127. package/dist/cjs/components/zoomArea/hooks/useResponsiveCanvas.js +12 -16
  128. package/dist/cjs/components/zoomArea/hooks/useZoomAreaFocus.js +6 -10
  129. package/dist/cjs/components/zoomArea/hooks/useZoomData.js +8 -12
  130. package/dist/cjs/components/zoomArea/index.js +5 -21
  131. package/dist/cjs/components/zoomArea/utils/accessibilityLabels.js +6 -11
  132. package/dist/cjs/components/zoomArea/utils/index.js +3 -14
  133. package/dist/cjs/components/zoomArea/utils/indexRounding.js +5 -11
  134. package/dist/cjs/components/zoomArea/utils/interactionConfig.js +1 -5
  135. package/dist/cjs/components/zoomArea/utils/pathGeneration.js +4 -9
  136. package/dist/cjs/components/zoomArea/utils/rangeAndPositions.js +5 -13
  137. package/dist/cjs/components/zoomArea/utils/selectionConfig.js +1 -5
  138. package/dist/cjs/components/zoomArea/zoomArea.js +35 -39
  139. package/dist/cjs/components/zoomArea/zoomArea.type.js +1 -4
  140. package/dist/cjs/hooks/index.js +2 -18
  141. package/dist/cjs/hooks/useFocus/useFocus.js +5 -9
  142. package/dist/cjs/hooks/useFocus/useFocus.types.js +1 -2
  143. package/dist/cjs/hooks/useHover/useHover.js +5 -9
  144. package/dist/cjs/hooks/useHover/useHover.types.js +1 -2
  145. package/dist/cjs/index.js +3 -19
  146. package/dist/cjs/types/canvas.type.js +1 -4
  147. package/dist/cjs/types/errors.type.js +1 -4
  148. package/dist/cjs/types/focusConfig.type.js +1 -4
  149. package/dist/cjs/types/index.js +4 -20
  150. package/dist/cjs/types/position.enum.js +1 -4
  151. package/dist/cjs/types/unit.enum.js +1 -4
  152. package/dist/cjs/types/valueFormatter.type.js +1 -2
  153. package/dist/cjs/utils/ajustedTextSpace/ajustedTextSpace.js +1 -5
  154. package/dist/cjs/utils/buildErrors/buildErrors.js +3 -7
  155. package/dist/cjs/utils/buildTickValues/buildTickValues.js +2 -7
  156. package/dist/cjs/utils/calculateFocusOutline/calculateFocusOutline.js +8 -13
  157. package/dist/cjs/utils/classNames/classNames.js +1 -5
  158. package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.js +4 -8
  159. package/dist/cjs/utils/cssGradientToSvg/cssGradientToSvg.types.js +1 -2
  160. package/dist/cjs/utils/cursorNear/isNear.js +1 -5
  161. package/dist/cjs/utils/getAxisData/getAxisData.js +1 -5
  162. package/dist/cjs/utils/getCanvasDimensions/getCanvasDimensions.js +8 -12
  163. package/dist/cjs/utils/getChildrenAttr/getChildrenAttr.js +4 -8
  164. package/dist/cjs/utils/getCoordinates/getCoordinates.js +9 -14
  165. package/dist/cjs/utils/getDataFingerprint/getDataFingerprint.js +1 -5
  166. package/dist/cjs/utils/getPoints/getPoints.js +1 -5
  167. package/dist/cjs/utils/getTickTextCoordinate/getTickTextCoordinates.js +5 -10
  168. package/dist/cjs/utils/getTicks/getTicks.js +2 -7
  169. package/dist/cjs/utils/index.js +8 -24
  170. package/dist/cjs/utils/parseStringToNumberPx.ts/parseStringToNumberPx.js +3 -7
  171. package/dist/cjs/utils/pickCustomAttributes/pickCustomAttributes.js +1 -5
  172. package/dist/cjs/utils/shadowSvg/shadowSvg.js +3 -7
  173. package/dist/cjs/utils/shadowSvg/shadowSvg.types.js +1 -2
  174. package/dist/cjs/utils/textBound/textBound.js +1 -5
  175. package/dist/kubit-ui-web-react-charts.cjs.js +1 -10
  176. package/dist/kubit-ui-web-react-charts.es.js +1 -10
  177. package/dist/kubit-ui-web-react-charts.umd.js +1 -10
  178. package/dist/types/charts/barChart/barChart.d.ts +5 -5
  179. package/dist/types/charts/barChart/barChart.type.d.ts +1 -1
  180. package/dist/types/charts/barChart/context/barChartContext.d.ts +1 -1
  181. package/dist/types/charts/barChart/fragments/barChartSeparator.d.ts +1 -1
  182. package/dist/types/charts/barChart/fragments/barChartXAxis.d.ts +1 -1
  183. package/dist/types/charts/barChart/fragments/barChartYAxis.d.ts +1 -1
  184. package/dist/types/charts/lineChart/context/lineChartContext.d.ts +1 -1
  185. package/dist/types/charts/lineChart/fragments/lineChartPath.d.ts +1 -1
  186. package/dist/types/charts/lineChart/fragments/lineChartProjection.d.ts +1 -1
  187. package/dist/types/charts/lineChart/fragments/lineChartSeparator.d.ts +1 -1
  188. package/dist/types/charts/lineChart/fragments/lineChartXAxis.d.ts +1 -1
  189. package/dist/types/charts/lineChart/lineChart.d.ts +5 -5
  190. package/dist/types/charts/lineChart/lineChart.type.d.ts +1 -1
  191. package/dist/types/charts/lineChart/lineChartStructure.d.ts +1 -1
  192. package/dist/types/charts/pieChart/context/pieChartContext.d.ts +1 -1
  193. package/dist/types/charts/pieChart/fragments/pieChartForeign.d.ts +1 -1
  194. package/dist/types/charts/pieChart/fragments/pieChartPath.d.ts +1 -1
  195. package/dist/types/charts/pieChart/pieChart.d.ts +3 -3
  196. package/dist/types/charts/pieChart/pieChart.type.d.ts +1 -1
  197. package/dist/types/charts/pieChart/pieChartStructure.d.ts +1 -1
  198. package/dist/types/components/axisChart/xAxis/xAxis.d.ts +1 -1
  199. package/dist/types/components/axisChart/yAxis/yAxis.d.ts +1 -1
  200. package/dist/types/components/bar/bar.d.ts +1 -1
  201. package/dist/types/components/bar/fragments/barChartSegment.d.ts +1 -1
  202. package/dist/types/components/chartText/chartText.d.ts +1 -1
  203. package/dist/types/components/foreignObject/foreignObject.d.ts +1 -1
  204. package/dist/types/components/foreignObject/foreignObject.types.d.ts +1 -1
  205. package/dist/types/components/line/line.d.ts +1 -1
  206. package/dist/types/components/node/components/circle/circle.d.ts +1 -1
  207. package/dist/types/components/node/components/hexagon/hexagon.d.ts +1 -1
  208. package/dist/types/components/node/components/pentagon/pentagon.d.ts +1 -1
  209. package/dist/types/components/node/components/square/square.d.ts +1 -1
  210. package/dist/types/components/node/components/star/star.d.ts +1 -1
  211. package/dist/types/components/node/components/straight/straight.d.ts +1 -1
  212. package/dist/types/components/node/components/triangle/triangle.d.ts +1 -1
  213. package/dist/types/components/node/node.d.ts +1 -1
  214. package/dist/types/components/path/components/nodePath/nodePath.d.ts +2 -2
  215. package/dist/types/components/path/path.d.ts +1 -1
  216. package/dist/types/components/path/path.types.d.ts +1 -1
  217. package/dist/types/components/plot/components/circle/circle.d.ts +1 -1
  218. package/dist/types/components/plot/components/square/square.d.ts +1 -1
  219. package/dist/types/components/plot/components/triangle/triangle.d.ts +1 -1
  220. package/dist/types/components/plot/plot.d.ts +1 -1
  221. package/dist/types/components/svgContainer/svgContainer.d.ts +1 -1
  222. package/dist/types/components/tick/tick.d.ts +1 -1
  223. package/dist/types/components/zoomArea/components/HandlerIcon.d.ts +1 -1
  224. package/dist/types/components/zoomArea/components/LineRenderer.d.ts +1 -1
  225. package/dist/types/components/zoomArea/components/SelectionArea.d.ts +1 -1
  226. package/dist/types/components/zoomArea/components/ZoomHandler.d.ts +1 -1
  227. package/dist/types/hooks/useFocus/useFocus.types.d.ts +1 -1
  228. package/dist/types/hooks/useHover/useHover.types.d.ts +1 -1
  229. package/dist/types/utils/getChildrenAttr/getChildrenAttr.d.ts +1 -1
  230. package/package.json +44 -47
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./node"), exports);
18
- __exportStar(require("./node.types"), exports);
1
+ export * from './node';
2
+ export * from './node.types';
@@ -1,25 +1,22 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Node = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const hook_1 = require("../../charts/lineChart/hook");
7
- const circle_1 = require("./components/circle/circle");
8
- const hexagon_1 = require("./components/hexagon/hexagon");
9
- const pentagon_1 = require("./components/pentagon/pentagon");
10
- const square_1 = require("./components/square/square");
11
- const star_1 = require("./components/star/star");
12
- const straight_1 = require("./components/straight/straight");
13
- const triangle_1 = require("./components/triangle/triangle");
14
- const node_types_1 = require("./node.types");
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, } from 'react';
3
+ import { useAutoClick } from '../../charts/lineChart/hook';
4
+ import { Circle } from './components/circle/circle';
5
+ import { Hexagon } from './components/hexagon/hexagon';
6
+ import { Pentagon } from './components/pentagon/pentagon';
7
+ import { Square } from './components/square/square';
8
+ import { Star } from './components/star/star';
9
+ import { Straight } from './components/straight/straight';
10
+ import { Triangle } from './components/triangle/triangle';
11
+ import { NodeType } from './node.types';
15
12
  const Component = {
16
- [node_types_1.NodeType.Circle]: circle_1.Circle,
17
- [node_types_1.NodeType.Hexagon]: hexagon_1.Hexagon,
18
- [node_types_1.NodeType.Pentagon]: pentagon_1.Pentagon,
19
- [node_types_1.NodeType.Square]: square_1.Square,
20
- [node_types_1.NodeType.Star]: star_1.Star,
21
- [node_types_1.NodeType.Straight]: straight_1.Straight,
22
- [node_types_1.NodeType.Triangle]: triangle_1.Triangle,
13
+ [NodeType.Circle]: Circle,
14
+ [NodeType.Hexagon]: Hexagon,
15
+ [NodeType.Pentagon]: Pentagon,
16
+ [NodeType.Square]: Square,
17
+ [NodeType.Star]: Star,
18
+ [NodeType.Straight]: Straight,
19
+ [NodeType.Triangle]: Triangle,
23
20
  };
24
21
  /**
25
22
  * Node component that renders interactive geometric shapes for data visualization.
@@ -48,9 +45,9 @@ const Component = {
48
45
  *
49
46
  * @returns An SVG element corresponding to the specified node type (`circle`, `rect`, `polygon`), or `null` if the type is not recognized.
50
47
  */
51
- const NodeComponent = ({ dataTestId = 'node', haloConfig, hasHalo = false, onBlur, onClick, onDoubleClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, position = { x: 0, y: 0 }, size = 1, type = node_types_1.NodeType.Circle, ...props }, ref) => {
48
+ const NodeComponent = ({ dataTestId = 'node', haloConfig, hasHalo = false, onBlur, onClick, onDoubleClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, position = { x: 0, y: 0 }, size = 1, type = NodeType.Circle, ...props }, ref) => {
52
49
  // It needed to recovery the autoClick info into js event, because the react event can't be modified or handle custom properties
53
- const [clickRef, autoClick] = (0, hook_1.useAutoClick)(ref);
50
+ const [clickRef, autoClick] = useAutoClick(ref);
54
51
  // TODO - Enrich events with data, stop using extra parameters for callbacks
55
52
  const handleClick = (event) => {
56
53
  onClick?.(event, { ...props.data, nodePosition: position }, autoClick.current);
@@ -96,6 +93,6 @@ const NodeComponent = ({ dataTestId = 'node', haloConfig, hasHalo = false, onBlu
96
93
  strokeWidth: haloConfig?.strokeWidth || props.strokeWidth,
97
94
  };
98
95
  const InnerNode = Component[type];
99
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasHalo && ((0, jsx_runtime_1.jsx)(InnerNode, { ...haloProps, "aria-hidden": "true", dataTestId: `${dataTestId}-halo`, position: position, size: size + size / 2, tabIndex: -1 })), (0, jsx_runtime_1.jsx)(InnerNode, { ...nodeProps, ref: clickRef, dataTestId: dataTestId, position: position, size: size })] }));
96
+ return (_jsxs(_Fragment, { children: [hasHalo && (_jsx(InnerNode, { ...haloProps, "aria-hidden": "true", dataTestId: `${dataTestId}-halo`, position: position, size: size + size / 2, tabIndex: -1 })), _jsx(InnerNode, { ...nodeProps, ref: clickRef, dataTestId: dataTestId, position: position, size: size })] }));
100
97
  };
101
- exports.Node = (0, react_1.forwardRef)(NodeComponent);
98
+ export const Node = forwardRef(NodeComponent);
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodeType = void 0;
4
1
  /**
5
2
  * Enum for node types.
6
3
  *
@@ -10,7 +7,7 @@ exports.NodeType = void 0;
10
7
  *
11
8
  * @enum {string}
12
9
  */
13
- exports.NodeType = {
10
+ export const NodeType = {
14
11
  Circle: 'circle', // Represents a circle node.
15
12
  Hexagon: 'hexagon', // Represents a hexagon node.
16
13
  Pentagon: 'pentagon', // Represents a pentagon node.
@@ -1,7 +1,4 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.calculateShapePoints = void 0;
4
- const calculateShapePoints = (centerX, centerY, points, outerRadius, innerRadius) => {
1
+ export const calculateShapePoints = (centerX, centerY, points, outerRadius, innerRadius) => {
5
2
  let result = '';
6
3
  // Determine whether drawing a regular shape or a star
7
4
  const isRegularShape = outerRadius === innerRadius;
@@ -19,4 +16,3 @@ const calculateShapePoints = (centerX, centerY, points, outerRadius, innerRadius
19
16
  }
20
17
  return result.trim();
21
18
  };
22
- exports.calculateShapePoints = calculateShapePoints;
@@ -1,11 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NodePath = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const accessibilityTemplateProcessor_1 = require("../../../../charts/lineChart/utils/accessibilityTemplateProcessor");
7
- const pickCustomAttributes_1 = require("../../../../utils/pickCustomAttributes/pickCustomAttributes");
8
- const node_1 = require("../../../node/node");
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { processAccessibilityTemplate } from '../../../../charts/lineChart/utils/accessibilityTemplateProcessor';
4
+ import { pickCustomAttributes } from '../../../../utils/pickCustomAttributes/pickCustomAttributes';
5
+ import { Node } from '../../../node/node';
9
6
  const NODE_PATH_FOCUS_BORDER = 'node-path-focus-border';
10
7
  /**
11
8
  * NodePathComponent renders a Node with custom attributes including processed aria-label templates.
@@ -15,14 +12,14 @@ const NODE_PATH_FOCUS_BORDER = 'node-path-focus-border';
15
12
  */
16
13
  const NodePathComponent = ({ data, nodeConfig, tabIndex = 0, x, y }, ref) => {
17
14
  // Extract custom aria-* and data-* attributes from nodeConfig
18
- const customAttributes = nodeConfig ? (0, pickCustomAttributes_1.pickCustomAttributes)(nodeConfig) : {};
15
+ const customAttributes = nodeConfig ? pickCustomAttributes(nodeConfig) : {};
19
16
  // Process aria-label template if it exists and contains placeholders
20
17
  if (customAttributes['aria-label'] &&
21
18
  data &&
22
19
  typeof customAttributes['aria-label'] === 'string') {
23
20
  const ariaLabelValue = customAttributes['aria-label'];
24
21
  if (ariaLabelValue.includes('{{')) {
25
- const processedAriaLabel = (0, accessibilityTemplateProcessor_1.processAccessibilityTemplate)(ariaLabelValue, {
22
+ const processedAriaLabel = processAccessibilityTemplate(ariaLabelValue, {
26
23
  dataKey: data.dataKey,
27
24
  dataValue: data.dataValue,
28
25
  index: data.index ?? 0,
@@ -33,9 +30,9 @@ const NodePathComponent = ({ data, nodeConfig, tabIndex = 0, x, y }, ref) => {
33
30
  }
34
31
  }
35
32
  }
36
- return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: nodeConfig && ((0, jsx_runtime_1.jsx)(node_1.Node, { ...nodeConfig, ref: ref, ...customAttributes, className: NODE_PATH_FOCUS_BORDER, data: data, hasHalo: nodeConfig.hasHalo, position: {
33
+ return (_jsx(_Fragment, { children: nodeConfig && (_jsx(Node, { ...nodeConfig, ref: ref, ...customAttributes, className: NODE_PATH_FOCUS_BORDER, data: data, hasHalo: nodeConfig.hasHalo, position: {
37
34
  x: x,
38
35
  y: y,
39
36
  }, tabIndex: tabIndex })) }));
40
37
  };
41
- exports.NodePath = (0, react_1.forwardRef)(NodePathComponent);
38
+ export const NodePath = forwardRef(NodePathComponent);
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./path"), exports);
18
- __exportStar(require("./path.types"), exports);
1
+ export * from './path';
2
+ export * from './path.types';
@@ -1,15 +1,12 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Path = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const useFocus_1 = require("../../hooks/useFocus/useFocus");
7
- const useHover_1 = require("../../hooks/useHover/useHover");
8
- const cssGradientToSvg_1 = require("../../utils/cssGradientToSvg/cssGradientToSvg");
9
- const pickCustomAttributes_1 = require("../../utils/pickCustomAttributes/pickCustomAttributes");
10
- const shadowSvg_1 = require("../../utils/shadowSvg/shadowSvg");
11
- const nodePath_1 = require("./components/nodePath/nodePath");
12
- require("./path.css");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, useImperativeHandle, useRef, } from 'react';
3
+ import { useFocus } from '../../hooks/useFocus/useFocus';
4
+ import { useHover } from '../../hooks/useHover/useHover';
5
+ import { cssGradientToSVG } from '../../utils/cssGradientToSvg/cssGradientToSvg';
6
+ import { pickCustomAttributes } from '../../utils/pickCustomAttributes/pickCustomAttributes';
7
+ import { ShadowSvg } from '../../utils/shadowSvg/shadowSvg';
8
+ import { NodePath } from './components/nodePath/nodePath';
9
+ import './path.css';
13
10
  const ENTER = {
14
11
  code: 'Enter',
15
12
  key: 'Enter',
@@ -55,12 +52,12 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
55
52
  stroke: '#0000FF',
56
53
  strokeWidth: '0.5',
57
54
  }, role = 'img', ...props }, ref) => {
58
- const { handleBlur, handleFocus, isFocused } = (0, useFocus_1.useFocus)(props.onFocus, props.onBlur);
59
- const { handleMouseEnter, handleMouseLeave, isHovered } = (0, useHover_1.useHover)(props.onMouseEnter, props.onMouseLeave);
60
- const pathRef = (0, react_1.useRef)(null);
61
- const nodeRef = (0, react_1.useRef)([]);
62
- const mainRef = (0, react_1.useRef)(null);
63
- (0, react_1.useImperativeHandle)(ref, () => ({
55
+ const { handleBlur, handleFocus, isFocused } = useFocus(props.onFocus, props.onBlur);
56
+ const { handleMouseEnter, handleMouseLeave, isHovered } = useHover(props.onMouseEnter, props.onMouseLeave);
57
+ const pathRef = useRef(null);
58
+ const nodeRef = useRef([]);
59
+ const mainRef = useRef(null);
60
+ useImperativeHandle(ref, () => ({
64
61
  get main() {
65
62
  return mainRef.current;
66
63
  },
@@ -85,9 +82,9 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
85
82
  const handleMouseDown = (e) => {
86
83
  e.preventDefault();
87
84
  };
88
- const gradientSvgElement = props.gradient && (0, cssGradientToSvg_1.cssGradientToSVG)(props.gradient);
85
+ const gradientSvgElement = props.gradient && cssGradientToSVG(props.gradient);
89
86
  // Extract custom data-* and aria-* attributes
90
- const customAttributes = (0, pickCustomAttributes_1.pickCustomAttributes)(props);
87
+ const customAttributes = pickCustomAttributes(props);
91
88
  // Merge props to include focus and hover styles
92
89
  const defaultProps = {
93
90
  ...props,
@@ -103,7 +100,7 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
103
100
  ...(isFocused && focusConfig),
104
101
  ...(isHovered && hoverConfig),
105
102
  };
106
- return ((0, jsx_runtime_1.jsxs)("g", { ref: mainRef, tabIndex: -1, children: [gradientSvgElement && gradientSvgElement, mergedProps.shadowSvgConfig && ((0, jsx_runtime_1.jsx)(shadowSvg_1.ShadowSvg, { id: SHADOW_FILTER_ID, shadowSvgConfig: mergedProps.shadowSvgConfig })), (0, jsx_runtime_1.jsxs)("g", { "aria-label": mergedProps.ariaLabel, className: mergedProps.classNames, "data-draw": true, filter: mergedProps.shadowSvgConfig && mergedProps.filter, opacity: mergedProps.opacity, orientation: mergedProps.orientation, role: mergedProps.role, rotate: mergedProps.rotate, tabIndex: mergedProps.tabIndex, transform: mergedProps.transform, visibility: mergedProps.visibility, ...customAttributes, onBlur: handleBlur, onClick: handleClick, onDoubleClick: handleDoubleClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [(0, jsx_runtime_1.jsx)("path", { ref: pathRef, d: mergedProps.d, "data-testid": mergedProps.dataTestId, fill: mergedProps.dFill ? 'transparent' : mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule, stroke: mergedProps.stroke, strokeDasharray: mergedProps.strokeDasharray, strokeDashoffset: mergedProps.strokeDashoffset, strokeLinecap: mergedProps.strokeLinecap, strokeLinejoin: mergedProps.strokeLinejoin, strokeMiterlimit: mergedProps.strokeMiterlimit, strokeOpacity: mergedProps.strokeOpacity, strokeWidth: mergedProps.strokeWidth, children: mergedProps.title && (0, jsx_runtime_1.jsx)("title", { children: mergedProps.title }) }), mergedProps.dFill && ((0, jsx_runtime_1.jsx)("path", { d: mergedProps.dFill, fill: mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule }))] }), mergedProps.points &&
103
+ return (_jsxs("g", { ref: mainRef, tabIndex: -1, children: [gradientSvgElement && gradientSvgElement, mergedProps.shadowSvgConfig && (_jsx(ShadowSvg, { id: SHADOW_FILTER_ID, shadowSvgConfig: mergedProps.shadowSvgConfig })), _jsxs("g", { "aria-label": mergedProps.ariaLabel, className: mergedProps.classNames, "data-draw": true, filter: mergedProps.shadowSvgConfig && mergedProps.filter, opacity: mergedProps.opacity, orientation: mergedProps.orientation, role: mergedProps.role, rotate: mergedProps.rotate, tabIndex: mergedProps.tabIndex, transform: mergedProps.transform, visibility: mergedProps.visibility, ...customAttributes, onBlur: handleBlur, onClick: handleClick, onDoubleClick: handleDoubleClick, onFocus: handleFocus, onKeyDown: handleKeyDown, onMouseDown: handleMouseDown, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [_jsx("path", { ref: pathRef, d: mergedProps.d, "data-testid": mergedProps.dataTestId, fill: mergedProps.dFill ? 'transparent' : mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule, stroke: mergedProps.stroke, strokeDasharray: mergedProps.strokeDasharray, strokeDashoffset: mergedProps.strokeDashoffset, strokeLinecap: mergedProps.strokeLinecap, strokeLinejoin: mergedProps.strokeLinejoin, strokeMiterlimit: mergedProps.strokeMiterlimit, strokeOpacity: mergedProps.strokeOpacity, strokeWidth: mergedProps.strokeWidth, children: mergedProps.title && _jsx("title", { children: mergedProps.title }) }), mergedProps.dFill && (_jsx("path", { d: mergedProps.dFill, fill: mergedProps.fill, fillOpacity: mergedProps.fillOpacity, fillRule: mergedProps.fillRule }))] }), mergedProps.points &&
107
104
  mergedProps.nodeConfig &&
108
105
  mergedProps.points.map(([x, y], index) => {
109
106
  const nodeData = {
@@ -112,7 +109,7 @@ const PathComponent = ({ classNames = '', fill = 'transparent', stroke = '#0000F
112
109
  index,
113
110
  xKey: mergedProps?.xKey,
114
111
  };
115
- return ((0, jsx_runtime_1.jsx)(nodePath_1.NodePath, { ref: rf => (nodeRef.current[index] = rf), data: nodeData, nodeConfig: mergedProps.nodeConfig, tabIndex: -1, x: x, y: y }, `${index.toString()}`));
112
+ return (_jsx(NodePath, { ref: rf => (nodeRef.current[index] = rf), data: nodeData, nodeConfig: mergedProps.nodeConfig, tabIndex: -1, x: x, y: y }, `${index.toString()}`));
116
113
  })] }));
117
114
  };
118
- exports.Path = (0, react_1.forwardRef)(PathComponent);
115
+ export const Path = forwardRef(PathComponent);
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Circle = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const CircleComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
- return ((0, jsx_runtime_1.jsx)("circle", { ...props, ref: ref, cx: position.x, cy: position.y, "data-testid": `${dataTestId}-circle`, r: size / 2 }));
4
+ return (_jsx("circle", { ...props, ref: ref, cx: position.x, cy: position.y, "data-testid": `${dataTestId}-circle`, r: size / 2 }));
8
5
  };
9
- exports.Circle = (0, react_1.forwardRef)(CircleComponent);
6
+ export const Circle = forwardRef(CircleComponent);
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./circle/circle"), exports);
18
- __exportStar(require("./square/square"), exports);
19
- __exportStar(require("./triangle/triangle"), exports);
1
+ export * from './circle/circle';
2
+ export * from './square/square';
3
+ export * from './triangle/triangle';
@@ -1,9 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Square = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const SquareComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
- return ((0, jsx_runtime_1.jsx)("rect", { ...props, ref: ref, "data-testid": `${dataTestId}-square`, height: size, width: size, x: position.x - size / 2, y: position.y - size / 2 }));
4
+ return (_jsx("rect", { ...props, ref: ref, "data-testid": `${dataTestId}-square`, height: size, width: size, x: position.x - size / 2, y: position.y - size / 2 }));
8
5
  };
9
- exports.Square = (0, react_1.forwardRef)(SquareComponent);
6
+ export const Square = forwardRef(SquareComponent);
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Triangle = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  const TriangleComponent = ({ dataTestId, position, size, ...props }, ref) => {
7
4
  // Create an isosceles triangle where both width and height are size*2
8
5
  // This maintains consistency with the circle and square Plots
@@ -12,6 +9,6 @@ const TriangleComponent = ({ dataTestId, position, size, ...props }, ref) => {
12
9
  const bottomLeft = `${position.x - halfWidth},${position.y + height / 2}`;
13
10
  const bottomRight = `${position.x + halfWidth},${position.y + height / 2}`;
14
11
  const trianglePoints = `${topPoint} ${bottomLeft} ${bottomRight}`;
15
- return ((0, jsx_runtime_1.jsx)("polygon", { ...props, ref: ref, "data-testid": `${dataTestId}-triangle`, points: trianglePoints }));
12
+ return (_jsx("polygon", { ...props, ref: ref, "data-testid": `${dataTestId}-triangle`, points: trianglePoints }));
16
13
  };
17
- exports.Triangle = (0, react_1.forwardRef)(TriangleComponent);
14
+ export const Triangle = forwardRef(TriangleComponent);
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./plot"), exports);
18
- __exportStar(require("./plot.types"), exports);
1
+ export * from './plot';
2
+ export * from './plot.types';
@@ -1,32 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Plot = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
6
- const useFocus_1 = require("../../hooks/useFocus/useFocus");
7
- const useHover_1 = require("../../hooks/useHover/useHover");
8
- const calculateFocusOutline_1 = require("../../utils/calculateFocusOutline/calculateFocusOutline");
9
- const circle_1 = require("./components/circle/circle");
10
- const square_1 = require("./components/square/square");
11
- const triangle_1 = require("./components/triangle/triangle");
12
- require("./plot.css");
13
- const plot_types_1 = require("./plot.types");
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
3
+ import { useFocus } from '../../hooks/useFocus/useFocus';
4
+ import { useHover } from '../../hooks/useHover/useHover';
5
+ import { calculateFocusOutline, getFocusConfig, } from '../../utils/calculateFocusOutline/calculateFocusOutline';
6
+ import { Circle } from './components/circle/circle';
7
+ import { Square } from './components/square/square';
8
+ import { Triangle } from './components/triangle/triangle';
9
+ import './plot.css';
10
+ import { PLOT_SIZE_MAP, PlotSize, PlotType } from './plot.types';
14
11
  // Map of components by type
15
12
  const Component = {
16
- [plot_types_1.PlotType.CIRCLE]: circle_1.Circle,
17
- [plot_types_1.PlotType.SQUARE]: square_1.Square,
18
- [plot_types_1.PlotType.TRIANGLE]: triangle_1.Triangle,
13
+ [PlotType.CIRCLE]: Circle,
14
+ [PlotType.SQUARE]: Square,
15
+ [PlotType.TRIANGLE]: Triangle,
19
16
  };
20
- const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity, focusConfig, hasHoverEffect, hoverConfig, id, label, onBlur, onClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, opacity, position = { x: 0, y: 0 }, size = plot_types_1.PlotSize.MEDIUM, stroke, strokeWidth, tabIndex, type = plot_types_1.PlotType.CIRCLE, ...props }, ref) => {
21
- const { handleBlur, handleFocus, isFocused } = (0, useFocus_1.useFocus)(onFocus, onBlur);
22
- const { handleMouseEnter, handleMouseLeave, isHovered } = (0, useHover_1.useHover)(onMouseEnter, onMouseLeave);
17
+ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity, focusConfig, hasHoverEffect, hoverConfig, id, label, onBlur, onClick, onFocus, onKeyDown, onMouseEnter, onMouseLeave, opacity, position = { x: 0, y: 0 }, size = PlotSize.MEDIUM, stroke, strokeWidth, tabIndex, type = PlotType.CIRCLE, ...props }, ref) => {
18
+ const { handleBlur, handleFocus, isFocused } = useFocus(onFocus, onBlur);
19
+ const { handleMouseEnter, handleMouseLeave, isHovered } = useHover(onMouseEnter, onMouseLeave);
23
20
  // Extract properties from hoverConfig with default values
24
21
  const { fill: hoverFill = fill, opacity: hoverOpacity = 0.3, scale: hoverScale = 1.3, stroke: hoverStroke = fill, strokeWidth: hoverStrokeWidth = 0, } = hoverConfig || {};
25
22
  // Extract properties from focusConfig with default values
26
- const resolvedFocusConfig = (0, calculateFocusOutline_1.getFocusConfig)(focusConfig);
23
+ const resolvedFocusConfig = getFocusConfig(focusConfig);
27
24
  // Calculate focus outline dimensions using the utility
28
- const sizeInPixels = typeof size === 'number' ? size : plot_types_1.PLOT_SIZE_MAP[size];
29
- const focusOutline = (0, calculateFocusOutline_1.calculateFocusOutline)({
25
+ const sizeInPixels = typeof size === 'number' ? size : PLOT_SIZE_MAP[size];
26
+ const focusOutline = calculateFocusOutline({
30
27
  elementHeight: sizeInPixels,
31
28
  elementPosition: position,
32
29
  elementStrokeWidth: strokeWidth,
@@ -61,7 +58,7 @@ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity
61
58
  };
62
59
  // Get the correct component based on type
63
60
  const PlotShape = Component[type];
64
- return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [hasHoverEffect && isHovered && !isFocused && ((0, jsx_runtime_1.jsx)(PlotShape, { dataTestId: `${dataTestId}-hover`, fill: hoverFill, opacity: hoverOpacity, position: position, size: sizeInPixels * hoverScale, stroke: hoverStroke, strokeWidth: hoverStrokeWidth })), isFocused && focusOutline.type === 'rectangle' && ((0, jsx_runtime_1.jsxs)("g", { children: [(0, jsx_runtime_1.jsx)("rect", { className: "plot-focus-outer", "data-testid": `${dataTestId}-focus-outer`, fill: "none", height: focusOutline.outer.height, stroke: resolvedFocusConfig.outlineColor, strokeWidth: resolvedFocusConfig.outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), (0, jsx_runtime_1.jsx)("rect", { className: "plot-focus-inner", "data-testid": `${dataTestId}-focus-inner`, fill: "none", height: focusOutline.inner.height, stroke: resolvedFocusConfig.innerColor, strokeWidth: resolvedFocusConfig.innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] })), (0, jsx_runtime_1.jsx)(PlotShape, { ref: ref, ...plotShapeProps })] }));
61
+ return (_jsxs(_Fragment, { children: [hasHoverEffect && isHovered && !isFocused && (_jsx(PlotShape, { dataTestId: `${dataTestId}-hover`, fill: hoverFill, opacity: hoverOpacity, position: position, size: sizeInPixels * hoverScale, stroke: hoverStroke, strokeWidth: hoverStrokeWidth })), isFocused && focusOutline.type === 'rectangle' && (_jsxs("g", { children: [_jsx("rect", { className: "plot-focus-outer", "data-testid": `${dataTestId}-focus-outer`, fill: "none", height: focusOutline.outer.height, stroke: resolvedFocusConfig.outlineColor, strokeWidth: resolvedFocusConfig.outlineStrokeWidth, width: focusOutline.outer.width, x: focusOutline.outer.x, y: focusOutline.outer.y }), _jsx("rect", { className: "plot-focus-inner", "data-testid": `${dataTestId}-focus-inner`, fill: "none", height: focusOutline.inner.height, stroke: resolvedFocusConfig.innerColor, strokeWidth: resolvedFocusConfig.innerStrokeWidth, width: focusOutline.inner.width, x: focusOutline.inner.x, y: focusOutline.inner.y })] })), _jsx(PlotShape, { ref: ref, ...plotShapeProps })] }));
65
62
  };
66
63
  /**
67
64
  * `Plot` component which renders an interactive point in a chart with hover effects and accessibility features.
@@ -95,4 +92,4 @@ const PlotComponent = ({ className, data, dataTestId = 'plot', fill, fillOpacity
95
92
  *
96
93
  * @returns An SVG element representing the plot point with event handlers and accessibility features.
97
94
  */
98
- exports.Plot = (0, react_1.forwardRef)(PlotComponent);
95
+ export const Plot = forwardRef(PlotComponent);
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PLOT_SIZE_MAP = exports.PlotSize = exports.PlotType = void 0;
4
1
  /**
5
2
  * Enum for plot types.
6
3
  *
@@ -9,7 +6,7 @@ exports.PLOT_SIZE_MAP = exports.PlotSize = exports.PlotType = void 0;
9
6
  *
10
7
  * @enum {string}
11
8
  */
12
- exports.PlotType = {
9
+ export const PlotType = {
13
10
  /** Represents a circle plot point */
14
11
  CIRCLE: 'CIRCLE',
15
12
  /** Represents a square plot point */
@@ -25,7 +22,7 @@ exports.PlotType = {
25
22
  *
26
23
  * @enum {string}
27
24
  */
28
- exports.PlotSize = {
25
+ export const PlotSize = {
29
26
  /** Extra large plot point (40x40 pixels) */
30
27
  EXTRA_LARGE: 'EXTRA_LARGE',
31
28
  /** Extra small plot point (8x8 pixels) */
@@ -45,10 +42,10 @@ exports.PlotSize = {
45
42
  *
46
43
  * @type {Record<PlotSize, number>}
47
44
  */
48
- exports.PLOT_SIZE_MAP = {
49
- [exports.PlotSize.EXTRA_LARGE]: 40,
50
- [exports.PlotSize.EXTRA_SMALL]: 8,
51
- [exports.PlotSize.LARGE]: 32,
52
- [exports.PlotSize.MEDIUM]: 24,
53
- [exports.PlotSize.SMALL]: 16,
45
+ export const PLOT_SIZE_MAP = {
46
+ [PlotSize.EXTRA_LARGE]: 40,
47
+ [PlotSize.EXTRA_SMALL]: 8,
48
+ [PlotSize.LARGE]: 32,
49
+ [PlotSize.MEDIUM]: 24,
50
+ [PlotSize.SMALL]: 16,
54
51
  };
@@ -1,17 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./svgContainer"), exports);
1
+ export * from './svgContainer';
@@ -1,8 +1,5 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SvgContainer = void 0;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const react_1 = require("react");
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from 'react';
6
3
  /**
7
4
  * Renders an SVG container with customizable properties.
8
5
  *
@@ -28,10 +25,10 @@ const react_1 = require("react");
28
25
  * @returns {ReactElement} A React element representing the SVG container.
29
26
  */
30
27
  const SvgContainerComponent = ({ ariaHidden, ariaLabel, backgroundColor, caption, children, className, dataTestId, height, imageSrc, overflow, radius = '0px', role, tabIndex, viewBox, width, ...callbacks }, ref) => {
31
- return ((0, jsx_runtime_1.jsxs)("svg", { ref: ref, "aria-hidden": ariaHidden, "aria-label": ariaLabel, className: className, "data-testid": dataTestId, height: height, role: role, style: {
28
+ return (_jsxs("svg", { ref: ref, "aria-hidden": ariaHidden, "aria-label": ariaLabel, className: className, "data-testid": dataTestId, height: height, role: role, style: {
32
29
  backgroundColor: backgroundColor,
33
30
  borderRadius: radius,
34
31
  overflow: overflow,
35
- }, tabIndex: tabIndex, viewBox: viewBox, width: width, onMouseDown: e => e.preventDefault(), ...callbacks, children: [caption && (0, jsx_runtime_1.jsx)("title", { children: caption }), imageSrc && (0, jsx_runtime_1.jsx)("image", { height: height, href: imageSrc, width: width, x: "0", y: "0" }), children] }));
32
+ }, tabIndex: tabIndex, viewBox: viewBox, width: width, onMouseDown: e => e.preventDefault(), ...callbacks, children: [caption && _jsx("title", { children: caption }), imageSrc && _jsx("image", { height: height, href: imageSrc, width: width, x: "0", y: "0" }), children] }));
36
33
  };
37
- exports.SvgContainer = (0, react_1.forwardRef)(SvgContainerComponent);
34
+ export const SvgContainer = forwardRef(SvgContainerComponent);
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,6 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildViewBox = void 0;
4
1
  /**
5
2
  * Constructs a viewBox attribute value for an SVG element.
6
3
  *
@@ -14,11 +11,10 @@ exports.buildViewBox = void 0;
14
11
  *
15
12
  * @returns {string} The `viewBox` attribute value, formatted as "minX minY width height".
16
13
  */
17
- const buildViewBox = (width, height, extraSpace = 0) => {
14
+ export const buildViewBox = (width, height, extraSpace = 0) => {
18
15
  const minX = -extraSpace;
19
16
  const minY = -extraSpace;
20
17
  const viewBoxWidth = width;
21
18
  const viewBoxHeight = height;
22
19
  return `${minX} ${minY} ${viewBoxWidth} ${viewBoxHeight}`;
23
20
  };
24
- exports.buildViewBox = buildViewBox;
@@ -1,17 +1 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./buildViewBox/buildViewBox"), exports);
1
+ export * from './buildViewBox/buildViewBox';
@@ -1,18 +1,2 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./tick"), exports);
18
- __exportStar(require("./tick.types"), exports);
1
+ export * from './tick';
2
+ export * from './tick.types';