@fluentui/react-charts 9.3.6 → 9.3.8

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 (210) hide show
  1. package/CHANGELOG.md +46 -2
  2. package/dist/index.d.ts +70 -17
  3. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
  4. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  5. package/lib/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  6. package/lib/components/AreaChart/AreaChart.js +3 -43
  7. package/lib/components/AreaChart/AreaChart.js.map +1 -1
  8. package/lib/components/AreaChart/useAreaChartStyles.styles.js +1 -2
  9. package/lib/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  10. package/lib/components/ChartTable/ChartTable.js +8 -11
  11. package/lib/components/ChartTable/ChartTable.js.map +1 -1
  12. package/lib/components/ChartTable/ChartTable.types.js.map +1 -1
  13. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
  14. package/lib/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  15. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
  16. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
  17. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
  18. package/lib/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  19. package/lib/components/CommonComponents/CartesianChart.js +52 -32
  20. package/lib/components/CommonComponents/CartesianChart.js.map +1 -1
  21. package/lib/components/CommonComponents/CartesianChart.types.js.map +1 -1
  22. package/lib/components/CommonComponents/ChartPopover.js +1 -2
  23. package/lib/components/CommonComponents/ChartPopover.js.map +1 -1
  24. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js +9 -7
  25. package/lib/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  26. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js +8 -5
  27. package/lib/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  28. package/lib/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  29. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
  30. package/lib/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  31. package/lib/components/DeclarativeChart/DeclarativeChart.js +48 -25
  32. package/lib/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  33. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -209
  34. package/lib/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  35. package/lib/components/DonutChart/DonutChart.js +9 -15
  36. package/lib/components/DonutChart/DonutChart.js.map +1 -1
  37. package/lib/components/DonutChart/DonutChart.types.js.map +1 -1
  38. package/lib/components/DonutChart/Pie/Pie.js +4 -2
  39. package/lib/components/DonutChart/Pie/Pie.js.map +1 -1
  40. package/lib/components/FunnelChart/FunnelChart.js +8 -13
  41. package/lib/components/FunnelChart/FunnelChart.js.map +1 -1
  42. package/lib/components/FunnelChart/FunnelChart.types.js.map +1 -1
  43. package/lib/components/GanttChart/GanttChart.js +4 -17
  44. package/lib/components/GanttChart/GanttChart.js.map +1 -1
  45. package/lib/components/GaugeChart/GaugeChart.js +8 -13
  46. package/lib/components/GaugeChart/GaugeChart.js.map +1 -1
  47. package/lib/components/GaugeChart/GaugeChart.types.js.map +1 -1
  48. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +24 -36
  49. package/lib/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  50. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +1 -2
  51. package/lib/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  52. package/lib/components/HeatMapChart/HeatMapChart.js +3 -16
  53. package/lib/components/HeatMapChart/HeatMapChart.js.map +1 -1
  54. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +5 -25
  55. package/lib/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  56. package/lib/components/Legends/Legends.js +3 -4
  57. package/lib/components/Legends/Legends.js.map +1 -1
  58. package/lib/components/Legends/Legends.types.js.map +1 -1
  59. package/lib/components/Legends/OverflowMenu.js.map +1 -1
  60. package/lib/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  61. package/lib/components/LineChart/LineChart.js +68 -75
  62. package/lib/components/LineChart/LineChart.js.map +1 -1
  63. package/lib/components/LineChart/LineChart.types.js +1 -1
  64. package/lib/components/LineChart/LineChart.types.js.map +1 -1
  65. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js +3 -4
  66. package/lib/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  67. package/lib/components/LineChart/useLineChartStyles.styles.js +1 -2
  68. package/lib/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  69. package/lib/components/SankeyChart/SankeyChart.js +4 -10
  70. package/lib/components/SankeyChart/SankeyChart.js.map +1 -1
  71. package/lib/components/SankeyChart/SankeyChart.types.js.map +1 -1
  72. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js +1 -2
  73. package/lib/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  74. package/lib/components/ScatterChart/ScatterChart.js +41 -49
  75. package/lib/components/ScatterChart/ScatterChart.js.map +1 -1
  76. package/lib/components/ScatterChart/ScatterChart.types.js.map +1 -1
  77. package/lib/components/ScatterChart/useScatterChartStyles.styles.js +1 -2
  78. package/lib/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  79. package/lib/components/Sparkline/Sparkline.js +11 -7
  80. package/lib/components/Sparkline/Sparkline.js.map +1 -1
  81. package/lib/components/VerticalBarChart/VerticalBarChart.js +15 -92
  82. package/lib/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  83. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +1 -2
  84. package/lib/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  85. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js +28 -49
  86. package/lib/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  87. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +1 -2
  88. package/lib/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  89. package/lib/types/ChartAnnotation.js.map +1 -1
  90. package/lib/types/DataPoint.js.map +1 -1
  91. package/lib/utilities/Common.styles.js +0 -1
  92. package/lib/utilities/Common.styles.js.map +1 -1
  93. package/lib/utilities/Common.styles.raw.js +0 -1
  94. package/lib/utilities/Common.styles.raw.js.map +1 -1
  95. package/lib/utilities/FocusableTooltipText.js +1 -1
  96. package/lib/utilities/FocusableTooltipText.js.map +1 -1
  97. package/lib/utilities/getWindow.js +0 -1
  98. package/lib/utilities/getWindow.js.map +1 -1
  99. package/lib/utilities/hooks.js +34 -0
  100. package/lib/utilities/hooks.js.map +1 -0
  101. package/lib/utilities/image-export-utils.js +118 -78
  102. package/lib/utilities/image-export-utils.js.map +1 -1
  103. package/lib/utilities/utilities.js +243 -102
  104. package/lib/utilities/utilities.js.map +1 -1
  105. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js +2 -16
  106. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.js.map +1 -1
  107. package/lib-commonjs/components/AnnotationOnlyChart/AnnotationOnlyChart.types.js.map +1 -1
  108. package/lib-commonjs/components/AreaChart/AreaChart.js +2 -41
  109. package/lib-commonjs/components/AreaChart/AreaChart.js.map +1 -1
  110. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js +0 -2
  111. package/lib-commonjs/components/AreaChart/useAreaChartStyles.styles.js.map +1 -1
  112. package/lib-commonjs/components/ChartTable/ChartTable.js +9 -11
  113. package/lib-commonjs/components/ChartTable/ChartTable.js.map +1 -1
  114. package/lib-commonjs/components/ChartTable/ChartTable.types.js.map +1 -1
  115. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js +107 -67
  116. package/lib-commonjs/components/CommonComponents/Annotations/ChartAnnotationLayer.js.map +1 -1
  117. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js +7 -1
  118. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.js.map +1 -1
  119. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js +7 -1
  120. package/lib-commonjs/components/CommonComponents/Annotations/useChartAnnotationLayer.styles.raw.js.map +1 -1
  121. package/lib-commonjs/components/CommonComponents/CartesianChart.js +51 -31
  122. package/lib-commonjs/components/CommonComponents/CartesianChart.js.map +1 -1
  123. package/lib-commonjs/components/CommonComponents/CartesianChart.types.js.map +1 -1
  124. package/lib-commonjs/components/CommonComponents/ChartPopover.js +1 -2
  125. package/lib-commonjs/components/CommonComponents/ChartPopover.js.map +1 -1
  126. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js +7 -6
  127. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.js.map +1 -1
  128. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js +7 -4
  129. package/lib-commonjs/components/CommonComponents/useCartesianChartStyles.styles.raw.js.map +1 -1
  130. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.js.map +1 -1
  131. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js +0 -2
  132. package/lib-commonjs/components/CommonComponents/useChartPopoverStyles.styles.raw.js.map +1 -1
  133. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js +48 -25
  134. package/lib-commonjs/components/DeclarativeChart/DeclarativeChart.js.map +1 -1
  135. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js +309 -208
  136. package/lib-commonjs/components/DeclarativeChart/PlotlySchemaAdapter.js.map +1 -1
  137. package/lib-commonjs/components/DonutChart/DonutChart.js +7 -13
  138. package/lib-commonjs/components/DonutChart/DonutChart.js.map +1 -1
  139. package/lib-commonjs/components/DonutChart/DonutChart.types.js.map +1 -1
  140. package/lib-commonjs/components/DonutChart/Pie/Pie.js +4 -2
  141. package/lib-commonjs/components/DonutChart/Pie/Pie.js.map +1 -1
  142. package/lib-commonjs/components/FunnelChart/FunnelChart.js +7 -12
  143. package/lib-commonjs/components/FunnelChart/FunnelChart.js.map +1 -1
  144. package/lib-commonjs/components/FunnelChart/FunnelChart.types.js.map +1 -1
  145. package/lib-commonjs/components/GanttChart/GanttChart.js +3 -16
  146. package/lib-commonjs/components/GanttChart/GanttChart.js.map +1 -1
  147. package/lib-commonjs/components/GaugeChart/GaugeChart.js +7 -12
  148. package/lib-commonjs/components/GaugeChart/GaugeChart.js.map +1 -1
  149. package/lib-commonjs/components/GaugeChart/GaugeChart.types.js.map +1 -1
  150. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js +22 -34
  151. package/lib-commonjs/components/GroupedVerticalBarChart/GroupedVerticalBarChart.js.map +1 -1
  152. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js +0 -2
  153. package/lib-commonjs/components/GroupedVerticalBarChart/useGroupedVerticalBarChartStyles.styles.js.map +1 -1
  154. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js +2 -15
  155. package/lib-commonjs/components/HeatMapChart/HeatMapChart.js.map +1 -1
  156. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js +4 -23
  157. package/lib-commonjs/components/HorizontalBarChartWithAxis/HorizontalBarChartWithAxis.js.map +1 -1
  158. package/lib-commonjs/components/Legends/Legends.js +3 -4
  159. package/lib-commonjs/components/Legends/Legends.js.map +1 -1
  160. package/lib-commonjs/components/Legends/Legends.types.js.map +1 -1
  161. package/lib-commonjs/components/Legends/OverflowMenu.js.map +1 -1
  162. package/lib-commonjs/components/Legends/useLegendsStyles.styles.raw.js.map +1 -1
  163. package/lib-commonjs/components/LineChart/LineChart.js +67 -74
  164. package/lib-commonjs/components/LineChart/LineChart.js.map +1 -1
  165. package/lib-commonjs/components/LineChart/LineChart.types.js +1 -1
  166. package/lib-commonjs/components/LineChart/LineChart.types.js.map +1 -1
  167. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js +2 -2
  168. package/lib-commonjs/components/LineChart/eventAnnotation/EventAnnotation.js.map +1 -1
  169. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js +0 -2
  170. package/lib-commonjs/components/LineChart/useLineChartStyles.styles.js.map +1 -1
  171. package/lib-commonjs/components/SankeyChart/SankeyChart.js +4 -10
  172. package/lib-commonjs/components/SankeyChart/SankeyChart.js.map +1 -1
  173. package/lib-commonjs/components/SankeyChart/SankeyChart.types.js.map +1 -1
  174. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js +0 -2
  175. package/lib-commonjs/components/SankeyChart/useSankeyChartStyles.styles.js.map +1 -1
  176. package/lib-commonjs/components/ScatterChart/ScatterChart.js +38 -46
  177. package/lib-commonjs/components/ScatterChart/ScatterChart.js.map +1 -1
  178. package/lib-commonjs/components/ScatterChart/ScatterChart.types.js.map +1 -1
  179. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js +0 -2
  180. package/lib-commonjs/components/ScatterChart/useScatterChartStyles.styles.js.map +1 -1
  181. package/lib-commonjs/components/Sparkline/Sparkline.js +11 -7
  182. package/lib-commonjs/components/Sparkline/Sparkline.js.map +1 -1
  183. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js +14 -91
  184. package/lib-commonjs/components/VerticalBarChart/VerticalBarChart.js.map +1 -1
  185. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js +0 -2
  186. package/lib-commonjs/components/VerticalBarChart/useVerticalBarChartStyles.styles.js.map +1 -1
  187. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js +26 -47
  188. package/lib-commonjs/components/VerticalStackedBarChart/VerticalStackedBarChart.js.map +1 -1
  189. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js +0 -2
  190. package/lib-commonjs/components/VerticalStackedBarChart/useVerticalStackedBarChartStyles.styles.js.map +1 -1
  191. package/lib-commonjs/types/ChartAnnotation.js.map +1 -1
  192. package/lib-commonjs/types/DataPoint.js.map +1 -1
  193. package/lib-commonjs/utilities/Common.styles.js +0 -1
  194. package/lib-commonjs/utilities/Common.styles.js.map +1 -1
  195. package/lib-commonjs/utilities/Common.styles.raw.js +0 -1
  196. package/lib-commonjs/utilities/Common.styles.raw.js.map +1 -1
  197. package/lib-commonjs/utilities/FocusableTooltipText.js.map +1 -1
  198. package/lib-commonjs/utilities/getWindow.js +0 -1
  199. package/lib-commonjs/utilities/getWindow.js.map +1 -1
  200. package/lib-commonjs/utilities/hooks.js +45 -0
  201. package/lib-commonjs/utilities/hooks.js.map +1 -0
  202. package/lib-commonjs/utilities/image-export-utils.js +119 -79
  203. package/lib-commonjs/utilities/image-export-utils.js.map +1 -1
  204. package/lib-commonjs/utilities/utilities.js +253 -101
  205. package/lib-commonjs/utilities/utilities.js.map +1 -1
  206. package/package.json +9 -9
  207. package/lib/components/DeclarativeChart/imageExporter.js +0 -223
  208. package/lib/components/DeclarativeChart/imageExporter.js.map +0 -1
  209. package/lib-commonjs/components/DeclarativeChart/imageExporter.js +0 -233
  210. package/lib-commonjs/components/DeclarativeChart/imageExporter.js.map +0 -1
@@ -25,10 +25,6 @@ const ARROW_SIZE_SCALE = 0.35;
25
25
  const MAX_SIMPLE_MARKUP_DEPTH = 5;
26
26
  const CHAR_CODE_LESS_THAN = '<'.codePointAt(0);
27
27
  const CHAR_CODE_GREATER_THAN = '>'.codePointAt(0);
28
- const getAnnotationKey = (annotation, index)=>{
29
- var _annotation_id, _ref;
30
- return (_ref = (_annotation_id = annotation.id) !== null && _annotation_id !== void 0 ? _annotation_id : typeof annotation.text === 'string' || typeof annotation.text === 'number' ? String(annotation.text) : undefined) !== null && _ref !== void 0 ? _ref : `annotation-${index}`;
31
- };
32
28
  const decodeSimpleMarkupInput = (input)=>{
33
29
  const namedEntities = {
34
30
  amp: '&',
@@ -227,6 +223,40 @@ const normalizeBandOffset = (scale, value)=>{
227
223
  return position;
228
224
  };
229
225
  const clamp = (value, min, max)=>Math.max(min, Math.min(max, value));
226
+ const resolveDataCoordinate = (axis, value, context, yAxis = 'primary')=>{
227
+ if (axis === 'x') {
228
+ const xScale = context.xScale;
229
+ if (!xScale) {
230
+ return undefined;
231
+ }
232
+ const parsedValue = value instanceof Date ? value.getTime() : value;
233
+ return normalizeBandOffset(xScale, parsedValue);
234
+ }
235
+ const yScale = yAxis === 'secondary' ? context.yScaleSecondary : context.yScalePrimary;
236
+ if (!yScale) {
237
+ return undefined;
238
+ }
239
+ const parsedValue = value instanceof Date ? value.getTime() : value;
240
+ return normalizeBandOffset(yScale, parsedValue);
241
+ };
242
+ const resolveAxisCoordinate = (axis, coordinateType, value, context, options = {})=>{
243
+ switch(coordinateType){
244
+ case 'data':
245
+ return resolveDataCoordinate(axis, value, context, options.yAxis);
246
+ case 'relative':
247
+ if (typeof value !== 'number' || Number.isNaN(value)) {
248
+ return undefined;
249
+ }
250
+ return axis === 'x' ? context.plotRect.x + context.plotRect.width * value : context.plotRect.y + context.plotRect.height * value;
251
+ case 'pixel':
252
+ if (typeof value !== 'number' || Number.isNaN(value)) {
253
+ return undefined;
254
+ }
255
+ return axis === 'x' ? context.plotRect.x + value : context.plotRect.y + value;
256
+ default:
257
+ return undefined;
258
+ }
259
+ };
230
260
  const createMeasurementSignature = (annotationContentSignature, containerStyle, contentStyle, layoutClassName, styleClassName)=>JSON.stringify({
231
261
  annotationContentSignature,
232
262
  containerStyle,
@@ -234,58 +264,58 @@ const createMeasurementSignature = (annotationContentSignature, containerStyle,
234
264
  layoutClassName: layoutClassName !== null && layoutClassName !== void 0 ? layoutClassName : '',
235
265
  styleClassName: styleClassName !== null && styleClassName !== void 0 ? styleClassName : ''
236
266
  });
267
+ const getCoordinateDescriptor = (coordinates)=>{
268
+ switch(coordinates.type){
269
+ case 'data':
270
+ return {
271
+ xType: 'data',
272
+ yType: 'data',
273
+ yAxis: coordinates.yAxis
274
+ };
275
+ case 'relative':
276
+ return {
277
+ xType: 'relative',
278
+ yType: 'relative'
279
+ };
280
+ case 'pixel':
281
+ return {
282
+ xType: 'pixel',
283
+ yType: 'pixel'
284
+ };
285
+ case 'mixed':
286
+ return {
287
+ xType: coordinates.xCoordinateType,
288
+ yType: coordinates.yCoordinateType,
289
+ yAxis: coordinates.yAxis
290
+ };
291
+ default:
292
+ return undefined;
293
+ }
294
+ };
237
295
  const resolveCoordinates = (annotation, context)=>{
238
296
  const { coordinates, layout } = annotation;
239
297
  if (!coordinates) {
240
298
  return undefined;
241
299
  }
300
+ const descriptor = getCoordinateDescriptor(coordinates);
301
+ if (!descriptor) {
302
+ return undefined;
303
+ }
242
304
  var _layout_offsetX;
243
305
  const offsetX = (_layout_offsetX = layout === null || layout === void 0 ? void 0 : layout.offsetX) !== null && _layout_offsetX !== void 0 ? _layout_offsetX : 0;
244
306
  var _layout_offsetY;
245
307
  const offsetY = (_layout_offsetY = layout === null || layout === void 0 ? void 0 : layout.offsetY) !== null && _layout_offsetY !== void 0 ? _layout_offsetY : 0;
308
+ const anchorX = resolveAxisCoordinate('x', descriptor.xType, coordinates.x, context);
309
+ const anchorY = resolveAxisCoordinate('y', descriptor.yType, coordinates.y, context, {
310
+ yAxis: descriptor.yAxis
311
+ });
312
+ if (anchorX === undefined || anchorY === undefined) {
313
+ return undefined;
314
+ }
246
315
  const anchor = {
247
- x: 0,
248
- y: 0
316
+ x: anchorX,
317
+ y: anchorY
249
318
  };
250
- switch(coordinates.type){
251
- case 'data':
252
- {
253
- const { x, y, yAxis = 'primary' } = coordinates;
254
- const xScale = context.xScale;
255
- const yScale = yAxis === 'secondary' ? context.yScaleSecondary : context.yScalePrimary;
256
- if (!xScale || !yScale) {
257
- return undefined;
258
- }
259
- const xValue = normalizeBandOffset(xScale, x instanceof Date ? x.getTime() : x);
260
- const yValue = normalizeBandOffset(yScale, y instanceof Date ? y.getTime() : y);
261
- if (typeof xValue !== 'number' || typeof yValue !== 'number') {
262
- return undefined;
263
- }
264
- anchor.x = xValue;
265
- anchor.y = yValue;
266
- break;
267
- }
268
- case 'relative':
269
- {
270
- if (typeof coordinates.x !== 'number' || typeof coordinates.y !== 'number') {
271
- return undefined;
272
- }
273
- anchor.x = context.plotRect.x + context.plotRect.width * coordinates.x;
274
- anchor.y = context.plotRect.y + context.plotRect.height * coordinates.y;
275
- break;
276
- }
277
- case 'pixel':
278
- {
279
- if (typeof coordinates.x !== 'number' || typeof coordinates.y !== 'number') {
280
- return undefined;
281
- }
282
- anchor.x = context.plotRect.x + coordinates.x;
283
- anchor.y = context.plotRect.y + coordinates.y;
284
- break;
285
- }
286
- default:
287
- return undefined;
288
- }
289
319
  let left = anchor.x + offsetX;
290
320
  let top = anchor.y + offsetY;
291
321
  if (layout === null || layout === void 0 ? void 0 : layout.clipToBounds) {
@@ -304,12 +334,20 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
304
334
  const { annotations: annotationsProp, context } = props;
305
335
  const classes = (0, _useChartAnnotationLayerstyles.useChartAnnotationLayerStyles)(props);
306
336
  const idPrefix = (0, _reactutilities.useId)('chart-annotation');
337
+ const autoKeyPrefix = (0, _reactutilities.useId)('chart-annotation-item');
307
338
  const [measurements, setMeasurements] = _react.useState({});
308
- const resolvedAnnotations = _react.useMemo(()=>(annotationsProp !== null && annotationsProp !== void 0 ? annotationsProp : []).map((annotation, index)=>({
339
+ const resolvedAnnotations = _react.useMemo(()=>{
340
+ let fallbackIndex = 0;
341
+ return (annotationsProp !== null && annotationsProp !== void 0 ? annotationsProp : []).map((annotation)=>{
342
+ var _annotation_id;
343
+ return {
309
344
  annotation,
310
- key: getAnnotationKey(annotation, index)
311
- })), [
312
- annotationsProp
345
+ key: (_annotation_id = annotation.id) !== null && _annotation_id !== void 0 ? _annotation_id : `${autoKeyPrefix}-${fallbackIndex++}`
346
+ };
347
+ });
348
+ }, [
349
+ annotationsProp,
350
+ autoKeyPrefix
313
351
  ]);
314
352
  _react.useEffect(()=>{
315
353
  setMeasurements((prev)=>{
@@ -365,7 +403,7 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
365
403
  const measurementElements = [];
366
404
  const connectors = [];
367
405
  resolvedAnnotations.forEach(({ annotation, key })=>{
368
- var _annotation_style, _annotation_style1, _annotation_style2, _annotation_style3, _annotation_style4, _annotation_style5, _annotation_style6, _annotation_style7, _annotation_style8, _annotation_style9, _annotation_style10, _annotation_style11, _annotation_style12, _annotation_style13, _annotation_style14, _annotation_style15, _annotation_style16, _annotation_style17, _annotation_accessibility, _annotation_accessibility1, _annotation_accessibility2;
406
+ var _annotation_style, _annotation_style1, _annotation_style2, _annotation_style3, _annotation_style4, _annotation_style5, _annotation_style6, _annotation_style7, _annotation_style8, _annotation_style9, _annotation_style10, _annotation_style11, _annotation_style12, _annotation_style13, _annotation_style14, _annotation_style15, _annotation_style16, _annotation_style17, _annotation_style18, _annotation_accessibility, _annotation_accessibility1, _annotation_accessibility2;
369
407
  const resolved = resolveCoordinates(annotation, context);
370
408
  if (!resolved) {
371
409
  return;
@@ -387,28 +425,30 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
387
425
  const containerStyle = {
388
426
  maxWidth: layout === null || layout === void 0 ? void 0 : layout.maxWidth,
389
427
  ...hasCustomBackground ? {
390
- backgroundColor: (0, _useChartAnnotationLayerstyles.applyOpacityToColor)(baseBackgroundColor, backgroundOpacity)
428
+ backgroundColor: (0, _useChartAnnotationLayerstyles.applyOpacityToColor)(baseBackgroundColor, backgroundOpacity, {
429
+ preserveOriginalOpacity: ((_annotation_style4 = annotation.style) === null || _annotation_style4 === void 0 ? void 0 : _annotation_style4.opacity) === undefined
430
+ })
391
431
  } : {
392
432
  backgroundColor: (0, _useChartAnnotationLayerstyles.applyOpacityToColor)(_reacttheme.tokens.colorNeutralBackground1, _useChartAnnotationLayerstyles.DEFAULT_ANNOTATION_BACKGROUND_OPACITY)
393
433
  },
394
- borderColor: (_annotation_style4 = annotation.style) === null || _annotation_style4 === void 0 ? void 0 : _annotation_style4.borderColor,
395
- borderWidth: (_annotation_style5 = annotation.style) === null || _annotation_style5 === void 0 ? void 0 : _annotation_style5.borderWidth,
396
- borderStyle: (_annotation_style_borderStyle = (_annotation_style6 = annotation.style) === null || _annotation_style6 === void 0 ? void 0 : _annotation_style6.borderStyle) !== null && _annotation_style_borderStyle !== void 0 ? _annotation_style_borderStyle : ((_annotation_style7 = annotation.style) === null || _annotation_style7 === void 0 ? void 0 : _annotation_style7.borderColor) ? 'solid' : undefined,
397
- borderRadius: (_annotation_style8 = annotation.style) === null || _annotation_style8 === void 0 ? void 0 : _annotation_style8.borderRadius,
398
- padding: (_annotation_style9 = annotation.style) === null || _annotation_style9 === void 0 ? void 0 : _annotation_style9.padding,
399
- boxShadow: (_annotation_style10 = annotation.style) === null || _annotation_style10 === void 0 ? void 0 : _annotation_style10.boxShadow
434
+ borderColor: (_annotation_style5 = annotation.style) === null || _annotation_style5 === void 0 ? void 0 : _annotation_style5.borderColor,
435
+ borderWidth: (_annotation_style6 = annotation.style) === null || _annotation_style6 === void 0 ? void 0 : _annotation_style6.borderWidth,
436
+ borderStyle: (_annotation_style_borderStyle = (_annotation_style7 = annotation.style) === null || _annotation_style7 === void 0 ? void 0 : _annotation_style7.borderStyle) !== null && _annotation_style_borderStyle !== void 0 ? _annotation_style_borderStyle : ((_annotation_style8 = annotation.style) === null || _annotation_style8 === void 0 ? void 0 : _annotation_style8.borderColor) ? 'solid' : undefined,
437
+ borderRadius: (_annotation_style9 = annotation.style) === null || _annotation_style9 === void 0 ? void 0 : _annotation_style9.borderRadius,
438
+ padding: (_annotation_style10 = annotation.style) === null || _annotation_style10 === void 0 ? void 0 : _annotation_style10.padding,
439
+ boxShadow: (_annotation_style11 = annotation.style) === null || _annotation_style11 === void 0 ? void 0 : _annotation_style11.boxShadow
400
440
  };
401
441
  const contentStyle = {
402
- color: (_annotation_style11 = annotation.style) === null || _annotation_style11 === void 0 ? void 0 : _annotation_style11.textColor,
403
- fontSize: (_annotation_style12 = annotation.style) === null || _annotation_style12 === void 0 ? void 0 : _annotation_style12.fontSize,
404
- fontWeight: (_annotation_style13 = annotation.style) === null || _annotation_style13 === void 0 ? void 0 : _annotation_style13.fontWeight,
442
+ color: (_annotation_style12 = annotation.style) === null || _annotation_style12 === void 0 ? void 0 : _annotation_style12.textColor,
443
+ fontSize: (_annotation_style13 = annotation.style) === null || _annotation_style13 === void 0 ? void 0 : _annotation_style13.fontSize,
444
+ fontWeight: (_annotation_style14 = annotation.style) === null || _annotation_style14 === void 0 ? void 0 : _annotation_style14.fontWeight,
405
445
  opacity: 1
406
446
  };
407
- if (typeof ((_annotation_style14 = annotation.style) === null || _annotation_style14 === void 0 ? void 0 : _annotation_style14.rotation) === 'number' && !Number.isNaN(annotation.style.rotation)) {
447
+ if (typeof ((_annotation_style15 = annotation.style) === null || _annotation_style15 === void 0 ? void 0 : _annotation_style15.rotation) === 'number' && !Number.isNaN(annotation.style.rotation)) {
408
448
  containerStyle.transform = `rotate(${annotation.style.rotation}deg)`;
409
449
  containerStyle.transformOrigin = '50% 50%';
410
450
  }
411
- const measurementSignature = createMeasurementSignature(annotationMarkupSignature, containerStyle, contentStyle, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style15 = annotation.style) === null || _annotation_style15 === void 0 ? void 0 : _annotation_style15.className);
451
+ const measurementSignature = createMeasurementSignature(annotationMarkupSignature, containerStyle, contentStyle, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style16 = annotation.style) === null || _annotation_style16 === void 0 ? void 0 : _annotation_style16.className);
412
452
  const measurementEntry = measurements[key];
413
453
  const isMeasurementValid = (measurementEntry === null || measurementEntry === void 0 ? void 0 : measurementEntry.signature) === measurementSignature;
414
454
  const measuredSize = isMeasurementValid ? measurementEntry : undefined;
@@ -475,7 +515,7 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
475
515
  ...containerStyle
476
516
  };
477
517
  if (!isMeasurementValid) {
478
- var _annotation_style18, _annotation_style19;
518
+ var _annotation_style19, _annotation_style20;
479
519
  measurementElements.push(/*#__PURE__*/ _react.createElement("div", {
480
520
  key: `${key}-measurement`,
481
521
  ref: (node)=>{
@@ -486,13 +526,13 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
486
526
  }
487
527
  }
488
528
  },
489
- className: (0, _react1.mergeClasses)(classes.annotation, classes.measurement, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style18 = annotation.style) === null || _annotation_style18 === void 0 ? void 0 : _annotation_style18.className),
529
+ className: (0, _react1.mergeClasses)(classes.annotation, classes.measurement, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style19 = annotation.style) === null || _annotation_style19 === void 0 ? void 0 : _annotation_style19.className),
490
530
  style: measurementStyle,
491
531
  "aria-hidden": true,
492
532
  "data-annotation-key": key,
493
533
  "data-chart-annotation-measurement": "true"
494
534
  }, /*#__PURE__*/ _react.createElement("div", {
495
- className: (0, _react1.mergeClasses)(classes.annotationContent, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style19 = annotation.style) === null || _annotation_style19 === void 0 ? void 0 : _annotation_style19.className),
535
+ className: (0, _react1.mergeClasses)(classes.annotationContent, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style20 = annotation.style) === null || _annotation_style20 === void 0 ? void 0 : _annotation_style20.className),
496
536
  style: contentStyle
497
537
  }, renderSimpleMarkup(annotationMarkupNodes, `${key}-measurement`))));
498
538
  }
@@ -506,11 +546,11 @@ const ChartAnnotationLayer = /*#__PURE__*/ _react.memo((props)=>{
506
546
  className: (0, _react1.mergeClasses)(classes.annotationForeignObject),
507
547
  "data-annotation-key": key
508
548
  }, /*#__PURE__*/ _react.createElement("div", {
509
- className: (0, _react1.mergeClasses)(classes.annotation, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style16 = annotation.style) === null || _annotation_style16 === void 0 ? void 0 : _annotation_style16.className),
549
+ className: (0, _react1.mergeClasses)(classes.annotation, layout === null || layout === void 0 ? void 0 : layout.className, (_annotation_style17 = annotation.style) === null || _annotation_style17 === void 0 ? void 0 : _annotation_style17.className),
510
550
  style: containerStyle,
511
551
  "data-annotation-key": key
512
552
  }, /*#__PURE__*/ _react.createElement("div", {
513
- className: (0, _react1.mergeClasses)(classes.annotationContent, (_annotation_style17 = annotation.style) === null || _annotation_style17 === void 0 ? void 0 : _annotation_style17.className),
553
+ className: (0, _react1.mergeClasses)(classes.annotationContent, (_annotation_style18 = annotation.style) === null || _annotation_style18 === void 0 ? void 0 : _annotation_style18.className),
514
554
  style: contentStyle,
515
555
  role: (_annotation_accessibility_role = (_annotation_accessibility = annotation.accessibility) === null || _annotation_accessibility === void 0 ? void 0 : _annotation_accessibility.role) !== null && _annotation_accessibility_role !== void 0 ? _annotation_accessibility_role : 'note',
516
556
  "aria-label": (_annotation_accessibility_ariaLabel = (_annotation_accessibility1 = annotation.accessibility) === null || _annotation_accessibility1 === void 0 ? void 0 : _annotation_accessibility1.ariaLabel) !== null && _annotation_accessibility_ariaLabel !== void 0 ? _annotation_accessibility_ariaLabel : annotationPlainText ? annotationPlainText : undefined,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CommonComponents/Annotations/ChartAnnotationLayer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeClasses } from '@griffel/react';\nimport type { ChartAnnotation } from '../../../types/ChartAnnotation';\nimport type {\n AnnotationPoint,\n ChartAnnotationContext,\n ChartAnnotationLayerProps,\n ConnectorRenderData,\n ResolvedAnnotationPosition,\n} from './ChartAnnotationLayer.types';\nimport {\n applyOpacityToColor,\n DEFAULT_ANNOTATION_BACKGROUND_OPACITY,\n DEFAULT_CONNECTOR_ARROW,\n DEFAULT_CONNECTOR_END_PADDING,\n DEFAULT_CONNECTOR_START_PADDING,\n DEFAULT_CONNECTOR_STROKE_WIDTH,\n getDefaultConnectorStrokeColor,\n useChartAnnotationLayerStyles,\n} from './useChartAnnotationLayer.styles';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nconst DEFAULT_HORIZONTAL_ALIGN = 'center';\nconst DEFAULT_VERTICAL_ALIGN = 'middle';\nconst DEFAULT_FOREIGN_OBJECT_WIDTH = 180;\nconst DEFAULT_FOREIGN_OBJECT_HEIGHT = 60;\nconst MIN_ARROW_SIZE = 6;\nconst MAX_ARROW_SIZE = 24;\nconst ARROW_SIZE_SCALE = 0.35;\nconst MAX_SIMPLE_MARKUP_DEPTH = 5;\nconst CHAR_CODE_LESS_THAN = '<'.codePointAt(0)!;\nconst CHAR_CODE_GREATER_THAN = '>'.codePointAt(0)!;\nconst getAnnotationKey = (annotation: ChartAnnotation, index: number) =>\n annotation.id ??\n (typeof annotation.text === 'string' || typeof annotation.text === 'number' ? String(annotation.text) : undefined) ??\n `annotation-${index}`;\n\ntype SimpleMarkupNode =\n | { type: 'text'; content: string }\n | { type: 'br' }\n | { type: 'element'; tag: 'b' | 'i'; children: SimpleMarkupNode[] };\n\ntype ElementMarkupNode = Extract<SimpleMarkupNode, { type: 'element' }>;\n\ntype StackFrame = {\n node: ElementMarkupNode | null;\n};\n\nconst decodeSimpleMarkupInput = (input: string): string => {\n const namedEntities: Record<string, string> = {\n amp: '&',\n quot: '\"',\n apos: \"'\",\n nbsp: '\\u00a0',\n };\n\n const withBasicEntitiesDecoded = input.replace(/&(#x?[0-9a-f]+|#\\d+|[a-z][\\w-]*);/gi, (match, entity) => {\n const lower = entity.toLowerCase();\n if (lower === 'lt' || lower === 'gt') {\n return `&${lower};`;\n }\n if (lower.startsWith('#')) {\n const isHex = lower[1] === 'x';\n const digits = lower.slice(isHex ? 2 : 1);\n const codePoint = Number.parseInt(digits, isHex ? 16 : 10);\n if (Number.isNaN(codePoint)) {\n return match;\n }\n if (codePoint === CHAR_CODE_LESS_THAN) {\n return '&lt;';\n }\n if (codePoint === CHAR_CODE_GREATER_THAN) {\n return '&gt;';\n }\n return String.fromCodePoint(codePoint);\n }\n return namedEntities[lower] ?? match;\n });\n\n return withBasicEntitiesDecoded.replace(/&lt;([^;]+)&gt;/gi, (match, inner) => {\n const normalized = inner.trim().replace(/\\s+/g, ' ');\n const lower = normalized.toLowerCase();\n\n switch (lower) {\n case 'b':\n return '<b>';\n case '/b':\n return '</b>';\n case 'i':\n return '<i>';\n case '/i':\n return '</i>';\n case 'br':\n case 'br/':\n case 'br /':\n return '<br />';\n default:\n return match;\n }\n });\n};\n\nconst appendTextNode = (nodes: SimpleMarkupNode[], text: string) => {\n if (text.length === 0) {\n return;\n }\n\n const last = nodes[nodes.length - 1];\n if (last && last.type === 'text') {\n last.content += text;\n } else {\n nodes.push({ type: 'text', content: text });\n }\n};\n\nconst serializeSimpleMarkup = (nodes: SimpleMarkupNode[]): string =>\n nodes\n .map(node => {\n if (node.type === 'text') {\n return node.content;\n }\n if (node.type === 'br') {\n return '<br />';\n }\n return `<${node.tag}>${serializeSimpleMarkup(node.children)}</${node.tag}>`;\n })\n .join('');\n\nconst parseSimpleMarkup = (input: string): SimpleMarkupNode[] => {\n if (!input) {\n return [];\n }\n\n const decodedInput = decodeSimpleMarkupInput(input);\n const rootChildren: SimpleMarkupNode[] = [];\n const stack: StackFrame[] = [{ node: null }];\n const currentChildren = () => stack[stack.length - 1].node?.children ?? rootChildren;\n const tagRegex = /<\\/?([a-z]+)\\s*\\/?\\s*>/gi;\n let lastIndex = 0;\n\n let match: RegExpExecArray | null;\n while ((match = tagRegex.exec(decodedInput)) !== null) {\n const [fullMatch, rawTagName] = match;\n const tagName = rawTagName.toLowerCase();\n const isClosing = fullMatch.startsWith('</');\n const isSelfClosing = /\\/\\s*>$/.test(fullMatch);\n\n appendTextNode(currentChildren(), decodedInput.slice(lastIndex, match.index));\n lastIndex = match.index + fullMatch.length;\n\n if (tagName === 'br' && !isClosing) {\n currentChildren().push({ type: 'br' });\n continue;\n }\n\n if ((tagName === 'b' || tagName === 'i') && !isSelfClosing) {\n if (isClosing) {\n const top = stack[stack.length - 1].node;\n if (stack.length > 1 && top?.tag === tagName) {\n stack.pop();\n } else {\n appendTextNode(currentChildren(), fullMatch);\n }\n } else {\n if (stack.length - 1 >= MAX_SIMPLE_MARKUP_DEPTH) {\n appendTextNode(currentChildren(), fullMatch);\n continue;\n }\n const elementNode: ElementMarkupNode = {\n type: 'element',\n tag: tagName as 'b' | 'i',\n children: [],\n };\n currentChildren().push(elementNode);\n stack.push({ node: elementNode });\n }\n continue;\n }\n\n appendTextNode(currentChildren(), fullMatch);\n }\n\n appendTextNode(currentChildren(), decodedInput.slice(lastIndex));\n\n while (stack.length > 1) {\n const unclosed = stack.pop()!;\n const elementNode = unclosed.node;\n if (!elementNode) {\n continue;\n }\n\n const parentChildren = stack[stack.length - 1].node?.children ?? rootChildren;\n const lastChild = parentChildren[parentChildren.length - 1];\n if (lastChild === elementNode) {\n parentChildren.pop();\n } else {\n const nodeIndex = parentChildren.indexOf(elementNode);\n if (nodeIndex !== -1) {\n parentChildren.splice(nodeIndex, 1);\n }\n }\n\n appendTextNode(\n parentChildren,\n `<${elementNode.tag}>${serializeSimpleMarkup(elementNode.children)}</${elementNode.tag}>`,\n );\n }\n\n return rootChildren;\n};\n\nconst simpleMarkupNodesToPlainText = (nodes: SimpleMarkupNode[]): string =>\n nodes\n .map(node => {\n if (node.type === 'text') {\n return node.content;\n }\n if (node.type === 'br') {\n return '\\n';\n }\n return simpleMarkupNodesToPlainText(node.children);\n })\n .join('');\n\nconst renderSimpleMarkupNodeList = (nodes: SimpleMarkupNode[], keyPrefix: string): React.ReactNode[] =>\n nodes.map((node, index) => {\n const key = `${keyPrefix}-${index}`;\n\n if (node.type === 'text') {\n return <React.Fragment key={key}>{node.content}</React.Fragment>;\n }\n\n if (node.type === 'br') {\n return <br key={key} />;\n }\n\n const Tag = node.tag === 'b' ? 'strong' : 'em';\n return React.createElement(Tag, { key }, ...renderSimpleMarkupNodeList(node.children, key));\n });\nconst renderSimpleMarkup = (nodes: SimpleMarkupNode[], keyPrefix: string): React.ReactNode => {\n const rendered = renderSimpleMarkupNodeList(nodes, keyPrefix);\n return rendered.length <= 1 ? rendered[0] ?? null : rendered;\n};\n\nconst normalizeBandOffset = (\n scale: (((value: unknown) => number) & { bandwidth?: () => number }) | undefined,\n value: unknown,\n) => {\n const position = scale?.(value as never);\n if (typeof position !== 'number' || Number.isNaN(position)) {\n return undefined;\n }\n if (scale && typeof scale.bandwidth === 'function') {\n return position + scale.bandwidth() / 2;\n }\n return position;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\nconst createMeasurementSignature = (\n annotationContentSignature: string,\n containerStyle: React.CSSProperties,\n contentStyle: React.CSSProperties,\n layoutClassName?: string,\n styleClassName?: string,\n) =>\n JSON.stringify({\n annotationContentSignature,\n containerStyle,\n contentStyle,\n layoutClassName: layoutClassName ?? '',\n styleClassName: styleClassName ?? '',\n });\n\ntype MeasurementEntry = { width: number; height: number; signature: string };\n\nconst resolveCoordinates = (\n annotation: ChartAnnotation,\n context: ChartAnnotationContext,\n): ResolvedAnnotationPosition | undefined => {\n const { coordinates, layout } = annotation;\n\n if (!coordinates) {\n return undefined;\n }\n\n const offsetX = layout?.offsetX ?? 0;\n const offsetY = layout?.offsetY ?? 0;\n\n const anchor: AnnotationPoint = { x: 0, y: 0 };\n\n switch (coordinates.type) {\n case 'data': {\n const { x, y, yAxis = 'primary' } = coordinates;\n const xScale = context.xScale;\n const yScale = yAxis === 'secondary' ? context.yScaleSecondary : context.yScalePrimary;\n if (!xScale || !yScale) {\n return undefined;\n }\n const xValue = normalizeBandOffset(xScale, x instanceof Date ? x.getTime() : x);\n const yValue = normalizeBandOffset(yScale, y instanceof Date ? y.getTime() : y);\n if (typeof xValue !== 'number' || typeof yValue !== 'number') {\n return undefined;\n }\n anchor.x = xValue;\n anchor.y = yValue;\n break;\n }\n case 'relative': {\n if (typeof coordinates.x !== 'number' || typeof coordinates.y !== 'number') {\n return undefined;\n }\n anchor.x = context.plotRect.x + context.plotRect.width * coordinates.x;\n anchor.y = context.plotRect.y + context.plotRect.height * coordinates.y;\n break;\n }\n case 'pixel': {\n if (typeof coordinates.x !== 'number' || typeof coordinates.y !== 'number') {\n return undefined;\n }\n anchor.x = context.plotRect.x + coordinates.x;\n anchor.y = context.plotRect.y + coordinates.y;\n break;\n }\n default:\n return undefined;\n }\n\n let left = anchor.x + offsetX;\n let top = anchor.y + offsetY;\n\n if (layout?.clipToBounds) {\n left = clamp(left, context.plotRect.x, context.plotRect.x + context.plotRect.width);\n top = clamp(top, context.plotRect.y, context.plotRect.y + context.plotRect.height);\n }\n\n return {\n anchor,\n point: { x: left, y: top },\n };\n};\n\nexport const ChartAnnotationLayer: React.FC<ChartAnnotationLayerProps> = React.memo(props => {\n const { annotations: annotationsProp, context } = props;\n\n const classes = useChartAnnotationLayerStyles(props);\n const idPrefix = useId('chart-annotation');\n\n const [measurements, setMeasurements] = React.useState<Record<string, MeasurementEntry>>({});\n\n const resolvedAnnotations = React.useMemo(\n () =>\n (annotationsProp ?? []).map((annotation, index) => ({ annotation, key: getAnnotationKey(annotation, index) })),\n [annotationsProp],\n );\n\n React.useEffect(() => {\n setMeasurements(prev => {\n if (resolvedAnnotations.length === 0) {\n if (Object.keys(prev).length === 0) {\n return prev;\n }\n return {} as Record<string, MeasurementEntry>;\n }\n\n const next: Record<string, MeasurementEntry> = {};\n resolvedAnnotations.forEach(({ key }) => {\n if (prev[key]) {\n next[key] = prev[key];\n }\n });\n\n if (Object.keys(next).length === Object.keys(prev).length) {\n let identical = true;\n for (const key of Object.keys(next)) {\n if (next[key] !== prev[key]) {\n identical = false;\n break;\n }\n }\n if (identical) {\n return prev;\n }\n }\n\n return next;\n });\n }, [resolvedAnnotations]);\n\n const updateMeasurement = React.useCallback((key: string, width: number, height: number, signature: string) => {\n setMeasurements(prev => {\n const prevEntry = prev[key];\n if (\n prevEntry &&\n prevEntry.signature === signature &&\n Math.abs(prevEntry.width - width) < 0.5 &&\n Math.abs(prevEntry.height - height) < 0.5\n ) {\n return prev;\n }\n\n if (width === 0 && height === 0) {\n return prev;\n }\n\n return {\n ...prev,\n [key]: { width, height, signature },\n };\n });\n }, []);\n\n const annotationForeignObjects: React.ReactNode[] = [];\n const measurementElements: React.ReactNode[] = [];\n const connectors: ConnectorRenderData[] = [];\n\n resolvedAnnotations.forEach(({ annotation, key }) => {\n const resolved = resolveCoordinates(annotation, context);\n if (!resolved) {\n return;\n }\n\n const rawAnnotationText = annotation.text === undefined || annotation.text === null ? '' : String(annotation.text);\n const annotationMarkupNodes = parseSimpleMarkup(rawAnnotationText);\n const annotationMarkupSignature = JSON.stringify(annotationMarkupNodes);\n const annotationPlainText = simpleMarkupNodesToPlainText(annotationMarkupNodes);\n\n const layout = annotation.layout;\n const horizontalAlign = layout?.align ?? DEFAULT_HORIZONTAL_ALIGN;\n const verticalAlign = layout?.verticalAlign ?? DEFAULT_VERTICAL_ALIGN;\n const backgroundOpacity = annotation.style?.opacity ?? DEFAULT_ANNOTATION_BACKGROUND_OPACITY;\n const baseBackgroundColor = annotation.style?.backgroundColor;\n const hasCustomBackground =\n annotation.style?.backgroundColor !== undefined || annotation.style?.opacity !== undefined;\n\n const containerStyle: React.CSSProperties = {\n maxWidth: layout?.maxWidth,\n ...(hasCustomBackground\n ? {\n backgroundColor: applyOpacityToColor(baseBackgroundColor, backgroundOpacity),\n }\n : {\n backgroundColor: applyOpacityToColor(tokens.colorNeutralBackground1, DEFAULT_ANNOTATION_BACKGROUND_OPACITY),\n }),\n borderColor: annotation.style?.borderColor,\n borderWidth: annotation.style?.borderWidth,\n borderStyle: annotation.style?.borderStyle ?? (annotation.style?.borderColor ? 'solid' : undefined),\n borderRadius: annotation.style?.borderRadius,\n padding: annotation.style?.padding,\n boxShadow: annotation.style?.boxShadow,\n };\n\n const contentStyle: React.CSSProperties = {\n color: annotation.style?.textColor,\n fontSize: annotation.style?.fontSize,\n fontWeight: annotation.style?.fontWeight,\n opacity: 1,\n };\n\n if (typeof annotation.style?.rotation === 'number' && !Number.isNaN(annotation.style.rotation)) {\n containerStyle.transform = `rotate(${annotation.style.rotation}deg)`;\n containerStyle.transformOrigin = '50% 50%';\n }\n\n const measurementSignature = createMeasurementSignature(\n annotationMarkupSignature,\n containerStyle,\n contentStyle,\n layout?.className,\n annotation.style?.className,\n );\n const measurementEntry = measurements[key];\n const isMeasurementValid = measurementEntry?.signature === measurementSignature;\n const measuredSize = isMeasurementValid ? measurementEntry : undefined;\n const width = Math.max(measuredSize?.width ?? layout?.maxWidth ?? DEFAULT_FOREIGN_OBJECT_WIDTH, 1);\n const height = Math.max(measuredSize?.height ?? DEFAULT_FOREIGN_OBJECT_HEIGHT, 1);\n\n const offsetX = horizontalAlign === 'center' ? -width / 2 : horizontalAlign === 'end' ? -width : 0;\n const offsetY = verticalAlign === 'middle' ? -height / 2 : verticalAlign === 'bottom' ? -height : 0;\n\n const baseTopLeftX = resolved.point.x + offsetX;\n const baseTopLeftY = resolved.point.y + offsetY;\n\n const usePlotBounds = layout?.clipToBounds !== false;\n const viewportX = usePlotBounds ? context.plotRect.x : 0;\n const viewportY = usePlotBounds ? context.plotRect.y : 0;\n const viewportWidth = usePlotBounds ? context.plotRect.width : context.svgRect.width ?? 0;\n const viewportHeight = usePlotBounds ? context.plotRect.height : context.svgRect.height ?? 0;\n\n const maxTopLeftX = viewportWidth > 0 ? viewportX + viewportWidth - width : baseTopLeftX;\n const maxTopLeftY = viewportHeight > 0 ? viewportY + viewportHeight - height : baseTopLeftY;\n\n let topLeftX = viewportWidth > 0 ? clamp(baseTopLeftX, viewportX, Math.max(viewportX, maxTopLeftX)) : baseTopLeftX;\n let topLeftY = viewportHeight > 0 ? clamp(baseTopLeftY, viewportY, Math.max(viewportY, maxTopLeftY)) : baseTopLeftY;\n\n let displayPoint = {\n x: topLeftX - offsetX,\n y: topLeftY - offsetY,\n };\n\n if (annotation.connector) {\n const startPadding = annotation.connector.startPadding ?? 12;\n const endPadding = annotation.connector.endPadding ?? 0;\n const minArrowClearance = 6;\n const minDistance = Math.max(startPadding + endPadding + minArrowClearance, startPadding);\n\n const dx = displayPoint.x - resolved.anchor.x;\n const dy = displayPoint.y - resolved.anchor.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < minDistance) {\n const fallbackDirection: AnnotationPoint = { x: 0, y: -1 };\n const ux = distance === 0 ? fallbackDirection.x : dx / distance;\n const uy = distance === 0 ? fallbackDirection.y : dy / distance;\n\n const desiredDisplayX = resolved.anchor.x + ux * minDistance;\n const desiredDisplayY = resolved.anchor.y + uy * minDistance;\n\n let desiredTopLeftX = desiredDisplayX + offsetX;\n let desiredTopLeftY = desiredDisplayY + offsetY;\n\n desiredTopLeftX =\n viewportWidth > 0 ? clamp(desiredTopLeftX, viewportX, Math.max(viewportX, maxTopLeftX)) : desiredTopLeftX;\n desiredTopLeftY =\n viewportHeight > 0 ? clamp(desiredTopLeftY, viewportY, Math.max(viewportY, maxTopLeftY)) : desiredTopLeftY;\n\n topLeftX = desiredTopLeftX;\n topLeftY = desiredTopLeftY;\n displayPoint = {\n x: topLeftX - offsetX,\n y: topLeftY - offsetY,\n };\n }\n }\n\n const measurementStyle: React.CSSProperties = {\n position: 'absolute',\n left: topLeftX,\n top: topLeftY,\n pointerEvents: 'none',\n visibility: 'hidden',\n ...containerStyle,\n };\n\n if (!isMeasurementValid) {\n measurementElements.push(\n <div\n key={`${key}-measurement`}\n ref={node => {\n if (node) {\n const rect = node.getBoundingClientRect();\n if (rect.width !== 0 || rect.height !== 0) {\n updateMeasurement(key, rect.width, rect.height, measurementSignature);\n }\n }\n }}\n className={mergeClasses(\n classes.annotation,\n classes.measurement,\n layout?.className,\n annotation.style?.className,\n )}\n style={measurementStyle}\n aria-hidden={true}\n data-annotation-key={key}\n data-chart-annotation-measurement=\"true\"\n >\n <div\n className={mergeClasses(classes.annotationContent, layout?.className, annotation.style?.className)}\n style={contentStyle}\n >\n {renderSimpleMarkup(annotationMarkupNodes, `${key}-measurement`)}\n </div>\n </div>,\n );\n }\n\n annotationForeignObjects.push(\n <foreignObject\n key={`${key}-annotation`}\n x={topLeftX}\n y={topLeftY}\n width={width}\n height={height}\n className={mergeClasses(classes.annotationForeignObject)}\n data-annotation-key={key}\n >\n <div\n className={mergeClasses(classes.annotation, layout?.className, annotation.style?.className)}\n style={containerStyle}\n data-annotation-key={key}\n >\n <div\n className={mergeClasses(classes.annotationContent, annotation.style?.className)}\n style={contentStyle}\n role={annotation.accessibility?.role ?? 'note'}\n aria-label={annotation.accessibility?.ariaLabel ?? (annotationPlainText ? annotationPlainText : undefined)}\n aria-describedby={annotation.accessibility?.ariaDescribedBy}\n data-chart-annotation=\"true\"\n data-annotation-key={key}\n >\n {renderSimpleMarkup(annotationMarkupNodes, `${key}-content`)}\n </div>\n </div>\n </foreignObject>,\n );\n\n if (annotation.connector) {\n const {\n startPadding = DEFAULT_CONNECTOR_START_PADDING,\n endPadding = DEFAULT_CONNECTOR_END_PADDING,\n strokeColor = getDefaultConnectorStrokeColor(),\n strokeWidth = DEFAULT_CONNECTOR_STROKE_WIDTH,\n dashArray,\n arrow = DEFAULT_CONNECTOR_ARROW,\n } = annotation.connector;\n\n const dx = resolved.anchor.x - displayPoint.x;\n const dy = resolved.anchor.y - displayPoint.y;\n const distance = Math.sqrt(dx * dx + dy * dy) || 1;\n const ux = dx / distance;\n const uy = dy / distance;\n\n const sizeBasis = Math.max(1, Math.min(width, height));\n const proportionalSize = sizeBasis * ARROW_SIZE_SCALE;\n const maxByPadding = startPadding > 0 ? startPadding * 1.25 : MAX_ARROW_SIZE;\n const maxByDistance = distance * 0.6;\n const markerSize = clamp(proportionalSize, MIN_ARROW_SIZE, Math.min(MAX_ARROW_SIZE, maxByPadding, maxByDistance));\n const markerStrokeWidth = clamp(strokeWidth, 1, markerSize / 2);\n\n const start: AnnotationPoint = {\n x: displayPoint.x + ux * startPadding,\n y: displayPoint.y + uy * startPadding,\n };\n\n const end: AnnotationPoint = {\n x: resolved.anchor.x - ux * endPadding,\n y: resolved.anchor.y - uy * endPadding,\n };\n\n connectors.push({\n key: `${key}-connector`,\n start,\n end,\n strokeColor,\n strokeWidth,\n dashArray,\n arrow,\n markerSize,\n markerStrokeWidth,\n });\n }\n });\n\n if (annotationForeignObjects.length === 0 && connectors.length === 0) {\n return null;\n }\n\n const viewBoxWidth = context.svgRect.width || 1;\n const viewBoxHeight = context.svgRect.height || 1;\n\n const markerDefs: React.ReactNode[] = [];\n\n const createMarkerId = (color: string, position: 'start' | 'end', size: number, markerStrokeWidth: number) => {\n const id = `${idPrefix}-${position}-${markerDefs.length}`;\n const refY = size / 2;\n const refX = position === 'end' ? size : 0;\n const pathEnd = `M0 0 L ${size} ${refY} L0 ${size} Z`;\n const pathStart = `M ${size} 0 L0 ${refY} L ${size} ${size} Z`;\n const path = position === 'end' ? pathEnd : pathStart;\n\n markerDefs.push(\n <marker\n key={id}\n id={id}\n markerWidth={size}\n markerHeight={size}\n viewBox={`0 0 ${size} ${size}`}\n refX={refX}\n refY={refY}\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path\n d={path}\n fill={color}\n stroke={color}\n strokeWidth={markerStrokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </marker>,\n );\n\n return id;\n };\n\n const connectorElements = connectors.map(connector => {\n let markerStart: string | undefined;\n let markerEnd: string | undefined;\n\n if (connector.arrow === 'start' || connector.arrow === 'both') {\n markerStart = createMarkerId(connector.strokeColor, 'start', connector.markerSize, connector.markerStrokeWidth);\n }\n if (connector.arrow === 'end' || connector.arrow === 'both') {\n markerEnd = createMarkerId(connector.strokeColor, 'end', connector.markerSize, connector.markerStrokeWidth);\n }\n\n return (\n <line\n key={connector.key}\n x1={connector.start.x}\n y1={connector.start.y}\n x2={connector.end.x}\n y2={connector.end.y}\n stroke={connector.strokeColor}\n strokeWidth={connector.strokeWidth}\n strokeDasharray={connector.dashArray}\n strokeLinecap=\"round\"\n markerStart={markerStart ? `url(#${markerStart})` : undefined}\n markerEnd={markerEnd ? `url(#${markerEnd})` : undefined}\n />\n );\n });\n\n const shouldRenderSvg = connectors.length > 0 || annotationForeignObjects.length > 0;\n return (\n <div className={classes.root} role=\"presentation\" data-chart-annotation-layer=\"true\">\n {shouldRenderSvg && (\n <svg\n className={classes.connectorLayer}\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}\n preserveAspectRatio=\"none\"\n data-chart-annotation-svg=\"true\"\n >\n {markerDefs.length > 0 && <defs>{markerDefs}</defs>}\n {connectorElements.length > 0 && (\n <g aria-hidden=\"true\" className={classes.connectorGroup}>\n {connectorElements}\n </g>\n )}\n {annotationForeignObjects}\n </svg>\n )}\n {measurementElements}\n </div>\n );\n});\n\nChartAnnotationLayer.displayName = 'ChartAnnotationLayer';\n"],"names":["React","mergeClasses","applyOpacityToColor","DEFAULT_ANNOTATION_BACKGROUND_OPACITY","DEFAULT_CONNECTOR_ARROW","DEFAULT_CONNECTOR_END_PADDING","DEFAULT_CONNECTOR_START_PADDING","DEFAULT_CONNECTOR_STROKE_WIDTH","getDefaultConnectorStrokeColor","useChartAnnotationLayerStyles","useId","tokens","DEFAULT_HORIZONTAL_ALIGN","DEFAULT_VERTICAL_ALIGN","DEFAULT_FOREIGN_OBJECT_WIDTH","DEFAULT_FOREIGN_OBJECT_HEIGHT","MIN_ARROW_SIZE","MAX_ARROW_SIZE","ARROW_SIZE_SCALE","MAX_SIMPLE_MARKUP_DEPTH","CHAR_CODE_LESS_THAN","codePointAt","CHAR_CODE_GREATER_THAN","getAnnotationKey","annotation","index","id","text","String","undefined","decodeSimpleMarkupInput","input","namedEntities","amp","quot","apos","nbsp","withBasicEntitiesDecoded","replace","match","entity","lower","toLowerCase","startsWith","isHex","digits","slice","codePoint","Number","parseInt","isNaN","fromCodePoint","inner","normalized","trim","appendTextNode","nodes","length","last","type","content","push","serializeSimpleMarkup","map","node","tag","children","join","parseSimpleMarkup","decodedInput","rootChildren","stack","currentChildren","tagRegex","lastIndex","exec","fullMatch","rawTagName","tagName","isClosing","isSelfClosing","test","top","pop","elementNode","unclosed","parentChildren","lastChild","nodeIndex","indexOf","splice","simpleMarkupNodesToPlainText","renderSimpleMarkupNodeList","keyPrefix","key","Fragment","br","Tag","createElement","renderSimpleMarkup","rendered","normalizeBandOffset","scale","value","position","bandwidth","clamp","min","max","Math","createMeasurementSignature","annotationContentSignature","containerStyle","contentStyle","layoutClassName","styleClassName","JSON","stringify","resolveCoordinates","context","coordinates","layout","offsetX","offsetY","anchor","x","y","yAxis","xScale","yScale","yScaleSecondary","yScalePrimary","xValue","Date","getTime","yValue","plotRect","width","height","left","clipToBounds","point","ChartAnnotationLayer","memo","props","annotations","annotationsProp","classes","idPrefix","measurements","setMeasurements","useState","resolvedAnnotations","useMemo","useEffect","prev","Object","keys","next","forEach","identical","updateMeasurement","useCallback","signature","prevEntry","abs","annotationForeignObjects","measurementElements","connectors","resolved","rawAnnotationText","annotationMarkupNodes","annotationMarkupSignature","annotationPlainText","horizontalAlign","align","verticalAlign","backgroundOpacity","style","opacity","baseBackgroundColor","backgroundColor","hasCustomBackground","maxWidth","colorNeutralBackground1","borderColor","borderWidth","borderStyle","borderRadius","padding","boxShadow","color","textColor","fontSize","fontWeight","rotation","transform","transformOrigin","measurementSignature","className","measurementEntry","isMeasurementValid","measuredSize","baseTopLeftX","baseTopLeftY","usePlotBounds","viewportX","viewportY","viewportWidth","svgRect","viewportHeight","maxTopLeftX","maxTopLeftY","topLeftX","topLeftY","displayPoint","connector","startPadding","endPadding","minArrowClearance","minDistance","dx","dy","distance","sqrt","fallbackDirection","ux","uy","desiredDisplayX","desiredDisplayY","desiredTopLeftX","desiredTopLeftY","measurementStyle","pointerEvents","visibility","div","ref","rect","getBoundingClientRect","measurement","aria-hidden","data-annotation-key","data-chart-annotation-measurement","annotationContent","foreignObject","annotationForeignObject","role","accessibility","aria-label","ariaLabel","aria-describedby","ariaDescribedBy","data-chart-annotation","strokeColor","strokeWidth","dashArray","arrow","sizeBasis","proportionalSize","maxByPadding","maxByDistance","markerSize","markerStrokeWidth","start","end","viewBoxWidth","viewBoxHeight","markerDefs","createMarkerId","size","refY","refX","pathEnd","pathStart","path","marker","markerWidth","markerHeight","viewBox","orient","markerUnits","d","fill","stroke","strokeLinecap","strokeLinejoin","connectorElements","markerStart","markerEnd","line","x1","y1","x2","y2","strokeDasharray","shouldRenderSvg","root","data-chart-annotation-layer","svg","connectorLayer","preserveAspectRatio","data-chart-annotation-svg","defs","g","connectorGroup","displayName"],"mappings":"AAAA;;;;;+BA0Va8I;;;;;;;iEAxVU,QAAQ;wBACF,iBAAiB;+CAkBvC,mCAAmC;gCACpB,4BAA4B;4BAC3B,wBAAwB;AAE/C,MAAMlI,2BAA2B;AACjC,MAAMC,yBAAyB;AAC/B,MAAMC,+BAA+B;AACrC,MAAMC,gCAAgC;AACtC,MAAMC,iBAAiB;AACvB,MAAMC,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,0BAA0B;AAChC,MAAMC,sBAAsB,IAAIC,WAAW,CAAC;AAC5C,MAAMC,yBAAyB,IAAID,WAAW,CAAC;AAC/C,MAAME,mBAAmB,CAACC,YAA6BC;QACrDD,gBAAAA;WAAAA,CAAAA,OAAAA,CAAAA,iBAAAA,WAAWE,EAAAA,AAAE,MAAA,QAAbF,mBAAAA,KAAAA,IAAAA,iBACC,OAAOA,WAAWG,IAAI,KAAK,YAAY,OAAOH,WAAWG,IAAI,KAAK,WAAWC,OAAOJ,WAAWG,IAAI,IAAIE,SAAAA,MAAAA,QADxGL,SAAAA,KAAAA,IAAAA,OAEA,CAAC,WAAW,EAAEC,OAAO;;AAavB,MAAMK,0BAA0B,CAACC;IAC/B,MAAMC,gBAAwC;QAC5CC,KA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AO;QACP4I,SAAS,CAAC,IAAI,EAAEb,aAAa,CAAC,EAAEC,eAAe;QAC/CkC,qBAAoB;QACpBC,6BAA0B;OAEzBlC,WAAWlN,MAAM,GAAG,KAAA,WAAA,GAAK,OAAA,aAAA,CAACqP,QAAAA,MAAMnC,aAChCmB,kBAAkBrO,MAAM,GAAG,KAAA,WAAA,GAC1B,OAAA,aAAA,CAACsP,KAAAA;QAAE/D,eAAY;QAAOzC,WAAWpD,QAAQ6J,cAAc;OACpDlB,oBAGJxH,2BAGJC;AAGP,GAAG;AAEHzB,qBAAqBmK,WAAW,GAAG"}
1
+ {"version":3,"sources":["../src/components/CommonComponents/Annotations/ChartAnnotationLayer.tsx"],"sourcesContent":["'use client';\n\nimport * as React from 'react';\nimport { mergeClasses } from '@griffel/react';\nimport type { ChartAnnotation } from '../../../types/ChartAnnotation';\nimport type {\n AnnotationPoint,\n ChartAnnotationContext,\n ChartAnnotationLayerProps,\n ConnectorRenderData,\n ResolvedAnnotationPosition,\n} from './ChartAnnotationLayer.types';\nimport {\n applyOpacityToColor,\n DEFAULT_ANNOTATION_BACKGROUND_OPACITY,\n DEFAULT_CONNECTOR_ARROW,\n DEFAULT_CONNECTOR_END_PADDING,\n DEFAULT_CONNECTOR_START_PADDING,\n DEFAULT_CONNECTOR_STROKE_WIDTH,\n getDefaultConnectorStrokeColor,\n useChartAnnotationLayerStyles,\n} from './useChartAnnotationLayer.styles';\nimport { useId } from '@fluentui/react-utilities';\nimport { tokens } from '@fluentui/react-theme';\n\nconst DEFAULT_HORIZONTAL_ALIGN = 'center';\nconst DEFAULT_VERTICAL_ALIGN = 'middle';\nconst DEFAULT_FOREIGN_OBJECT_WIDTH = 180;\nconst DEFAULT_FOREIGN_OBJECT_HEIGHT = 60;\nconst MIN_ARROW_SIZE = 6;\nconst MAX_ARROW_SIZE = 24;\nconst ARROW_SIZE_SCALE = 0.35;\nconst MAX_SIMPLE_MARKUP_DEPTH = 5;\nconst CHAR_CODE_LESS_THAN = '<'.codePointAt(0)!;\nconst CHAR_CODE_GREATER_THAN = '>'.codePointAt(0)!;\ntype SimpleMarkupNode =\n | { type: 'text'; content: string }\n | { type: 'br' }\n | { type: 'element'; tag: 'b' | 'i'; children: SimpleMarkupNode[] };\n\ntype ElementMarkupNode = Extract<SimpleMarkupNode, { type: 'element' }>;\n\ntype StackFrame = {\n node: ElementMarkupNode | null;\n};\n\nconst decodeSimpleMarkupInput = (input: string): string => {\n const namedEntities: Record<string, string> = {\n amp: '&',\n quot: '\"',\n apos: \"'\",\n nbsp: '\\u00a0',\n };\n\n const withBasicEntitiesDecoded = input.replace(/&(#x?[0-9a-f]+|#\\d+|[a-z][\\w-]*);/gi, (match, entity) => {\n const lower = entity.toLowerCase();\n if (lower === 'lt' || lower === 'gt') {\n return `&${lower};`;\n }\n if (lower.startsWith('#')) {\n const isHex = lower[1] === 'x';\n const digits = lower.slice(isHex ? 2 : 1);\n const codePoint = Number.parseInt(digits, isHex ? 16 : 10);\n if (Number.isNaN(codePoint)) {\n return match;\n }\n if (codePoint === CHAR_CODE_LESS_THAN) {\n return '&lt;';\n }\n if (codePoint === CHAR_CODE_GREATER_THAN) {\n return '&gt;';\n }\n return String.fromCodePoint(codePoint);\n }\n return namedEntities[lower] ?? match;\n });\n\n return withBasicEntitiesDecoded.replace(/&lt;([^;]+)&gt;/gi, (match, inner) => {\n const normalized = inner.trim().replace(/\\s+/g, ' ');\n const lower = normalized.toLowerCase();\n\n switch (lower) {\n case 'b':\n return '<b>';\n case '/b':\n return '</b>';\n case 'i':\n return '<i>';\n case '/i':\n return '</i>';\n case 'br':\n case 'br/':\n case 'br /':\n return '<br />';\n default:\n return match;\n }\n });\n};\n\nconst appendTextNode = (nodes: SimpleMarkupNode[], text: string) => {\n if (text.length === 0) {\n return;\n }\n\n const last = nodes[nodes.length - 1];\n if (last && last.type === 'text') {\n last.content += text;\n } else {\n nodes.push({ type: 'text', content: text });\n }\n};\n\nconst serializeSimpleMarkup = (nodes: SimpleMarkupNode[]): string =>\n nodes\n .map(node => {\n if (node.type === 'text') {\n return node.content;\n }\n if (node.type === 'br') {\n return '<br />';\n }\n return `<${node.tag}>${serializeSimpleMarkup(node.children)}</${node.tag}>`;\n })\n .join('');\n\nconst parseSimpleMarkup = (input: string): SimpleMarkupNode[] => {\n if (!input) {\n return [];\n }\n\n const decodedInput = decodeSimpleMarkupInput(input);\n const rootChildren: SimpleMarkupNode[] = [];\n const stack: StackFrame[] = [{ node: null }];\n const currentChildren = () => stack[stack.length - 1].node?.children ?? rootChildren;\n const tagRegex = /<\\/?([a-z]+)\\s*\\/?\\s*>/gi;\n let lastIndex = 0;\n\n let match: RegExpExecArray | null;\n while ((match = tagRegex.exec(decodedInput)) !== null) {\n const [fullMatch, rawTagName] = match;\n const tagName = rawTagName.toLowerCase();\n const isClosing = fullMatch.startsWith('</');\n const isSelfClosing = /\\/\\s*>$/.test(fullMatch);\n\n appendTextNode(currentChildren(), decodedInput.slice(lastIndex, match.index));\n lastIndex = match.index + fullMatch.length;\n\n if (tagName === 'br' && !isClosing) {\n currentChildren().push({ type: 'br' });\n continue;\n }\n\n if ((tagName === 'b' || tagName === 'i') && !isSelfClosing) {\n if (isClosing) {\n const top = stack[stack.length - 1].node;\n if (stack.length > 1 && top?.tag === tagName) {\n stack.pop();\n } else {\n appendTextNode(currentChildren(), fullMatch);\n }\n } else {\n if (stack.length - 1 >= MAX_SIMPLE_MARKUP_DEPTH) {\n appendTextNode(currentChildren(), fullMatch);\n continue;\n }\n const elementNode: ElementMarkupNode = {\n type: 'element',\n tag: tagName as 'b' | 'i',\n children: [],\n };\n currentChildren().push(elementNode);\n stack.push({ node: elementNode });\n }\n continue;\n }\n\n appendTextNode(currentChildren(), fullMatch);\n }\n\n appendTextNode(currentChildren(), decodedInput.slice(lastIndex));\n\n while (stack.length > 1) {\n const unclosed = stack.pop()!;\n const elementNode = unclosed.node;\n if (!elementNode) {\n continue;\n }\n\n const parentChildren = stack[stack.length - 1].node?.children ?? rootChildren;\n const lastChild = parentChildren[parentChildren.length - 1];\n if (lastChild === elementNode) {\n parentChildren.pop();\n } else {\n const nodeIndex = parentChildren.indexOf(elementNode);\n if (nodeIndex !== -1) {\n parentChildren.splice(nodeIndex, 1);\n }\n }\n\n appendTextNode(\n parentChildren,\n `<${elementNode.tag}>${serializeSimpleMarkup(elementNode.children)}</${elementNode.tag}>`,\n );\n }\n\n return rootChildren;\n};\n\nconst simpleMarkupNodesToPlainText = (nodes: SimpleMarkupNode[]): string =>\n nodes\n .map(node => {\n if (node.type === 'text') {\n return node.content;\n }\n if (node.type === 'br') {\n return '\\n';\n }\n return simpleMarkupNodesToPlainText(node.children);\n })\n .join('');\n\nconst renderSimpleMarkupNodeList = (nodes: SimpleMarkupNode[], keyPrefix: string): React.ReactNode[] =>\n nodes.map((node, index) => {\n const key = `${keyPrefix}-${index}`;\n\n if (node.type === 'text') {\n return <React.Fragment key={key}>{node.content}</React.Fragment>;\n }\n\n if (node.type === 'br') {\n return <br key={key} />;\n }\n\n const Tag = node.tag === 'b' ? 'strong' : 'em';\n return React.createElement(Tag, { key }, ...renderSimpleMarkupNodeList(node.children, key));\n });\nconst renderSimpleMarkup = (nodes: SimpleMarkupNode[], keyPrefix: string): React.ReactNode => {\n const rendered = renderSimpleMarkupNodeList(nodes, keyPrefix);\n return rendered.length <= 1 ? rendered[0] ?? null : rendered;\n};\n\nconst normalizeBandOffset = (\n scale: (((value: unknown) => number) & { bandwidth?: () => number }) | undefined,\n value: unknown,\n) => {\n const position = scale?.(value as never);\n if (typeof position !== 'number' || Number.isNaN(position)) {\n return undefined;\n }\n if (scale && typeof scale.bandwidth === 'function') {\n return position + scale.bandwidth() / 2;\n }\n return position;\n};\n\nconst clamp = (value: number, min: number, max: number) => Math.max(min, Math.min(max, value));\n\ntype AxisCoordinateType = 'data' | 'relative' | 'pixel';\n\nconst resolveDataCoordinate = (\n axis: 'x' | 'y',\n value: number | string | Date,\n context: ChartAnnotationContext,\n yAxis: 'primary' | 'secondary' = 'primary',\n): number | undefined => {\n if (axis === 'x') {\n const xScale = context.xScale;\n if (!xScale) {\n return undefined;\n }\n const parsedValue = value instanceof Date ? value.getTime() : value;\n return normalizeBandOffset(xScale, parsedValue);\n }\n\n const yScale = yAxis === 'secondary' ? context.yScaleSecondary : context.yScalePrimary;\n if (!yScale) {\n return undefined;\n }\n const parsedValue = value instanceof Date ? value.getTime() : value;\n return normalizeBandOffset(yScale, parsedValue);\n};\n\nconst resolveAxisCoordinate = (\n axis: 'x' | 'y',\n coordinateType: AxisCoordinateType,\n value: number | string | Date,\n context: ChartAnnotationContext,\n options: { yAxis?: 'primary' | 'secondary' } = {},\n): number | undefined => {\n switch (coordinateType) {\n case 'data':\n return resolveDataCoordinate(axis, value, context, options.yAxis);\n case 'relative':\n if (typeof value !== 'number' || Number.isNaN(value)) {\n return undefined;\n }\n return axis === 'x'\n ? context.plotRect.x + context.plotRect.width * value\n : context.plotRect.y + context.plotRect.height * value;\n case 'pixel':\n if (typeof value !== 'number' || Number.isNaN(value)) {\n return undefined;\n }\n return axis === 'x' ? context.plotRect.x + value : context.plotRect.y + value;\n default:\n return undefined;\n }\n};\n\nconst createMeasurementSignature = (\n annotationContentSignature: string,\n containerStyle: React.CSSProperties,\n contentStyle: React.CSSProperties,\n layoutClassName?: string,\n styleClassName?: string,\n) =>\n JSON.stringify({\n annotationContentSignature,\n containerStyle,\n contentStyle,\n layoutClassName: layoutClassName ?? '',\n styleClassName: styleClassName ?? '',\n });\n\ntype MeasurementEntry = { width: number; height: number; signature: string };\n\ntype CoordinateDescriptor = {\n xType: AxisCoordinateType;\n yType: AxisCoordinateType;\n yAxis?: 'primary' | 'secondary';\n};\n\nconst getCoordinateDescriptor = (coordinates: ChartAnnotation['coordinates']): CoordinateDescriptor | undefined => {\n switch (coordinates.type) {\n case 'data':\n return { xType: 'data', yType: 'data', yAxis: coordinates.yAxis };\n case 'relative':\n return { xType: 'relative', yType: 'relative' };\n case 'pixel':\n return { xType: 'pixel', yType: 'pixel' };\n case 'mixed':\n return {\n xType: coordinates.xCoordinateType,\n yType: coordinates.yCoordinateType,\n yAxis: coordinates.yAxis,\n };\n default:\n return undefined;\n }\n};\n\nconst resolveCoordinates = (\n annotation: ChartAnnotation,\n context: ChartAnnotationContext,\n): ResolvedAnnotationPosition | undefined => {\n const { coordinates, layout } = annotation;\n\n if (!coordinates) {\n return undefined;\n }\n\n const descriptor = getCoordinateDescriptor(coordinates);\n if (!descriptor) {\n return undefined;\n }\n\n const offsetX = layout?.offsetX ?? 0;\n const offsetY = layout?.offsetY ?? 0;\n\n const anchorX = resolveAxisCoordinate('x', descriptor.xType, coordinates.x, context);\n const anchorY = resolveAxisCoordinate('y', descriptor.yType, coordinates.y, context, {\n yAxis: descriptor.yAxis,\n });\n\n if (anchorX === undefined || anchorY === undefined) {\n return undefined;\n }\n\n const anchor: AnnotationPoint = { x: anchorX, y: anchorY };\n\n let left = anchor.x + offsetX;\n let top = anchor.y + offsetY;\n\n if (layout?.clipToBounds) {\n left = clamp(left, context.plotRect.x, context.plotRect.x + context.plotRect.width);\n top = clamp(top, context.plotRect.y, context.plotRect.y + context.plotRect.height);\n }\n\n return {\n anchor,\n point: { x: left, y: top },\n };\n};\n\nexport const ChartAnnotationLayer: React.FC<ChartAnnotationLayerProps> = React.memo(props => {\n const { annotations: annotationsProp, context } = props;\n\n const classes = useChartAnnotationLayerStyles(props);\n const idPrefix = useId('chart-annotation');\n const autoKeyPrefix = useId('chart-annotation-item');\n\n const [measurements, setMeasurements] = React.useState<Record<string, MeasurementEntry>>({});\n\n const resolvedAnnotations = React.useMemo(() => {\n let fallbackIndex = 0;\n return (annotationsProp ?? []).map(annotation => ({\n annotation,\n key: annotation.id ?? `${autoKeyPrefix}-${fallbackIndex++}`,\n }));\n }, [annotationsProp, autoKeyPrefix]);\n\n React.useEffect(() => {\n setMeasurements(prev => {\n if (resolvedAnnotations.length === 0) {\n if (Object.keys(prev).length === 0) {\n return prev;\n }\n return {} as Record<string, MeasurementEntry>;\n }\n\n const next: Record<string, MeasurementEntry> = {};\n resolvedAnnotations.forEach(({ key }) => {\n if (prev[key]) {\n next[key] = prev[key];\n }\n });\n\n if (Object.keys(next).length === Object.keys(prev).length) {\n let identical = true;\n for (const key of Object.keys(next)) {\n if (next[key] !== prev[key]) {\n identical = false;\n break;\n }\n }\n if (identical) {\n return prev;\n }\n }\n\n return next;\n });\n }, [resolvedAnnotations]);\n\n const updateMeasurement = React.useCallback((key: string, width: number, height: number, signature: string) => {\n setMeasurements(prev => {\n const prevEntry = prev[key];\n if (\n prevEntry &&\n prevEntry.signature === signature &&\n Math.abs(prevEntry.width - width) < 0.5 &&\n Math.abs(prevEntry.height - height) < 0.5\n ) {\n return prev;\n }\n\n if (width === 0 && height === 0) {\n return prev;\n }\n\n return {\n ...prev,\n [key]: { width, height, signature },\n };\n });\n }, []);\n\n const annotationForeignObjects: React.ReactNode[] = [];\n const measurementElements: React.ReactNode[] = [];\n const connectors: ConnectorRenderData[] = [];\n\n resolvedAnnotations.forEach(({ annotation, key }) => {\n const resolved = resolveCoordinates(annotation, context);\n if (!resolved) {\n return;\n }\n\n const rawAnnotationText = annotation.text === undefined || annotation.text === null ? '' : String(annotation.text);\n const annotationMarkupNodes = parseSimpleMarkup(rawAnnotationText);\n const annotationMarkupSignature = JSON.stringify(annotationMarkupNodes);\n const annotationPlainText = simpleMarkupNodesToPlainText(annotationMarkupNodes);\n\n const layout = annotation.layout;\n const horizontalAlign = layout?.align ?? DEFAULT_HORIZONTAL_ALIGN;\n const verticalAlign = layout?.verticalAlign ?? DEFAULT_VERTICAL_ALIGN;\n const backgroundOpacity = annotation.style?.opacity ?? DEFAULT_ANNOTATION_BACKGROUND_OPACITY;\n const baseBackgroundColor = annotation.style?.backgroundColor;\n const hasCustomBackground =\n annotation.style?.backgroundColor !== undefined || annotation.style?.opacity !== undefined;\n\n const containerStyle: React.CSSProperties = {\n maxWidth: layout?.maxWidth,\n ...(hasCustomBackground\n ? {\n backgroundColor: applyOpacityToColor(baseBackgroundColor, backgroundOpacity, {\n preserveOriginalOpacity: annotation.style?.opacity === undefined,\n }),\n }\n : {\n backgroundColor: applyOpacityToColor(tokens.colorNeutralBackground1, DEFAULT_ANNOTATION_BACKGROUND_OPACITY),\n }),\n borderColor: annotation.style?.borderColor,\n borderWidth: annotation.style?.borderWidth,\n borderStyle: annotation.style?.borderStyle ?? (annotation.style?.borderColor ? 'solid' : undefined),\n borderRadius: annotation.style?.borderRadius,\n padding: annotation.style?.padding,\n boxShadow: annotation.style?.boxShadow,\n };\n\n const contentStyle: React.CSSProperties = {\n color: annotation.style?.textColor,\n fontSize: annotation.style?.fontSize,\n fontWeight: annotation.style?.fontWeight,\n opacity: 1,\n };\n\n if (typeof annotation.style?.rotation === 'number' && !Number.isNaN(annotation.style.rotation)) {\n containerStyle.transform = `rotate(${annotation.style.rotation}deg)`;\n containerStyle.transformOrigin = '50% 50%';\n }\n\n const measurementSignature = createMeasurementSignature(\n annotationMarkupSignature,\n containerStyle,\n contentStyle,\n layout?.className,\n annotation.style?.className,\n );\n const measurementEntry = measurements[key];\n const isMeasurementValid = measurementEntry?.signature === measurementSignature;\n const measuredSize = isMeasurementValid ? measurementEntry : undefined;\n const width = Math.max(measuredSize?.width ?? layout?.maxWidth ?? DEFAULT_FOREIGN_OBJECT_WIDTH, 1);\n const height = Math.max(measuredSize?.height ?? DEFAULT_FOREIGN_OBJECT_HEIGHT, 1);\n\n const offsetX = horizontalAlign === 'center' ? -width / 2 : horizontalAlign === 'end' ? -width : 0;\n const offsetY = verticalAlign === 'middle' ? -height / 2 : verticalAlign === 'bottom' ? -height : 0;\n\n const baseTopLeftX = resolved.point.x + offsetX;\n const baseTopLeftY = resolved.point.y + offsetY;\n\n const usePlotBounds = layout?.clipToBounds !== false;\n const viewportX = usePlotBounds ? context.plotRect.x : 0;\n const viewportY = usePlotBounds ? context.plotRect.y : 0;\n const viewportWidth = usePlotBounds ? context.plotRect.width : context.svgRect.width ?? 0;\n const viewportHeight = usePlotBounds ? context.plotRect.height : context.svgRect.height ?? 0;\n\n const maxTopLeftX = viewportWidth > 0 ? viewportX + viewportWidth - width : baseTopLeftX;\n const maxTopLeftY = viewportHeight > 0 ? viewportY + viewportHeight - height : baseTopLeftY;\n\n let topLeftX = viewportWidth > 0 ? clamp(baseTopLeftX, viewportX, Math.max(viewportX, maxTopLeftX)) : baseTopLeftX;\n let topLeftY = viewportHeight > 0 ? clamp(baseTopLeftY, viewportY, Math.max(viewportY, maxTopLeftY)) : baseTopLeftY;\n\n let displayPoint = {\n x: topLeftX - offsetX,\n y: topLeftY - offsetY,\n };\n\n if (annotation.connector) {\n const startPadding = annotation.connector.startPadding ?? 12;\n const endPadding = annotation.connector.endPadding ?? 0;\n const minArrowClearance = 6;\n const minDistance = Math.max(startPadding + endPadding + minArrowClearance, startPadding);\n\n const dx = displayPoint.x - resolved.anchor.x;\n const dy = displayPoint.y - resolved.anchor.y;\n const distance = Math.sqrt(dx * dx + dy * dy);\n\n if (distance < minDistance) {\n const fallbackDirection: AnnotationPoint = { x: 0, y: -1 };\n const ux = distance === 0 ? fallbackDirection.x : dx / distance;\n const uy = distance === 0 ? fallbackDirection.y : dy / distance;\n\n const desiredDisplayX = resolved.anchor.x + ux * minDistance;\n const desiredDisplayY = resolved.anchor.y + uy * minDistance;\n\n let desiredTopLeftX = desiredDisplayX + offsetX;\n let desiredTopLeftY = desiredDisplayY + offsetY;\n\n desiredTopLeftX =\n viewportWidth > 0 ? clamp(desiredTopLeftX, viewportX, Math.max(viewportX, maxTopLeftX)) : desiredTopLeftX;\n desiredTopLeftY =\n viewportHeight > 0 ? clamp(desiredTopLeftY, viewportY, Math.max(viewportY, maxTopLeftY)) : desiredTopLeftY;\n\n topLeftX = desiredTopLeftX;\n topLeftY = desiredTopLeftY;\n displayPoint = {\n x: topLeftX - offsetX,\n y: topLeftY - offsetY,\n };\n }\n }\n\n const measurementStyle: React.CSSProperties = {\n position: 'absolute',\n left: topLeftX,\n top: topLeftY,\n pointerEvents: 'none',\n visibility: 'hidden',\n ...containerStyle,\n };\n\n if (!isMeasurementValid) {\n measurementElements.push(\n <div\n key={`${key}-measurement`}\n ref={node => {\n if (node) {\n const rect = node.getBoundingClientRect();\n if (rect.width !== 0 || rect.height !== 0) {\n updateMeasurement(key, rect.width, rect.height, measurementSignature);\n }\n }\n }}\n className={mergeClasses(\n classes.annotation,\n classes.measurement,\n layout?.className,\n annotation.style?.className,\n )}\n style={measurementStyle}\n aria-hidden={true}\n data-annotation-key={key}\n data-chart-annotation-measurement=\"true\"\n >\n <div\n className={mergeClasses(classes.annotationContent, layout?.className, annotation.style?.className)}\n style={contentStyle}\n >\n {renderSimpleMarkup(annotationMarkupNodes, `${key}-measurement`)}\n </div>\n </div>,\n );\n }\n\n annotationForeignObjects.push(\n <foreignObject\n key={`${key}-annotation`}\n x={topLeftX}\n y={topLeftY}\n width={width}\n height={height}\n className={mergeClasses(classes.annotationForeignObject)}\n data-annotation-key={key}\n >\n <div\n className={mergeClasses(classes.annotation, layout?.className, annotation.style?.className)}\n style={containerStyle}\n data-annotation-key={key}\n >\n <div\n className={mergeClasses(classes.annotationContent, annotation.style?.className)}\n style={contentStyle}\n role={annotation.accessibility?.role ?? 'note'}\n aria-label={annotation.accessibility?.ariaLabel ?? (annotationPlainText ? annotationPlainText : undefined)}\n aria-describedby={annotation.accessibility?.ariaDescribedBy}\n data-chart-annotation=\"true\"\n data-annotation-key={key}\n >\n {renderSimpleMarkup(annotationMarkupNodes, `${key}-content`)}\n </div>\n </div>\n </foreignObject>,\n );\n\n if (annotation.connector) {\n const {\n startPadding = DEFAULT_CONNECTOR_START_PADDING,\n endPadding = DEFAULT_CONNECTOR_END_PADDING,\n strokeColor = getDefaultConnectorStrokeColor(),\n strokeWidth = DEFAULT_CONNECTOR_STROKE_WIDTH,\n dashArray,\n arrow = DEFAULT_CONNECTOR_ARROW,\n } = annotation.connector;\n\n const dx = resolved.anchor.x - displayPoint.x;\n const dy = resolved.anchor.y - displayPoint.y;\n const distance = Math.sqrt(dx * dx + dy * dy) || 1;\n const ux = dx / distance;\n const uy = dy / distance;\n\n const sizeBasis = Math.max(1, Math.min(width, height));\n const proportionalSize = sizeBasis * ARROW_SIZE_SCALE;\n const maxByPadding = startPadding > 0 ? startPadding * 1.25 : MAX_ARROW_SIZE;\n const maxByDistance = distance * 0.6;\n const markerSize = clamp(proportionalSize, MIN_ARROW_SIZE, Math.min(MAX_ARROW_SIZE, maxByPadding, maxByDistance));\n const markerStrokeWidth = clamp(strokeWidth, 1, markerSize / 2);\n\n const start: AnnotationPoint = {\n x: displayPoint.x + ux * startPadding,\n y: displayPoint.y + uy * startPadding,\n };\n\n const end: AnnotationPoint = {\n x: resolved.anchor.x - ux * endPadding,\n y: resolved.anchor.y - uy * endPadding,\n };\n\n connectors.push({\n key: `${key}-connector`,\n start,\n end,\n strokeColor,\n strokeWidth,\n dashArray,\n arrow,\n markerSize,\n markerStrokeWidth,\n });\n }\n });\n\n if (annotationForeignObjects.length === 0 && connectors.length === 0) {\n return null;\n }\n\n const viewBoxWidth = context.svgRect.width || 1;\n const viewBoxHeight = context.svgRect.height || 1;\n\n const markerDefs: React.ReactNode[] = [];\n\n const createMarkerId = (color: string, position: 'start' | 'end', size: number, markerStrokeWidth: number) => {\n const id = `${idPrefix}-${position}-${markerDefs.length}`;\n const refY = size / 2;\n const refX = position === 'end' ? size : 0;\n const pathEnd = `M0 0 L ${size} ${refY} L0 ${size} Z`;\n const pathStart = `M ${size} 0 L0 ${refY} L ${size} ${size} Z`;\n const path = position === 'end' ? pathEnd : pathStart;\n\n markerDefs.push(\n <marker\n key={id}\n id={id}\n markerWidth={size}\n markerHeight={size}\n viewBox={`0 0 ${size} ${size}`}\n refX={refX}\n refY={refY}\n orient=\"auto\"\n markerUnits=\"userSpaceOnUse\"\n >\n <path\n d={path}\n fill={color}\n stroke={color}\n strokeWidth={markerStrokeWidth}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </marker>,\n );\n\n return id;\n };\n\n const connectorElements = connectors.map(connector => {\n let markerStart: string | undefined;\n let markerEnd: string | undefined;\n\n if (connector.arrow === 'start' || connector.arrow === 'both') {\n markerStart = createMarkerId(connector.strokeColor, 'start', connector.markerSize, connector.markerStrokeWidth);\n }\n if (connector.arrow === 'end' || connector.arrow === 'both') {\n markerEnd = createMarkerId(connector.strokeColor, 'end', connector.markerSize, connector.markerStrokeWidth);\n }\n\n return (\n <line\n key={connector.key}\n x1={connector.start.x}\n y1={connector.start.y}\n x2={connector.end.x}\n y2={connector.end.y}\n stroke={connector.strokeColor}\n strokeWidth={connector.strokeWidth}\n strokeDasharray={connector.dashArray}\n strokeLinecap=\"round\"\n markerStart={markerStart ? `url(#${markerStart})` : undefined}\n markerEnd={markerEnd ? `url(#${markerEnd})` : undefined}\n />\n );\n });\n\n const shouldRenderSvg = connectors.length > 0 || annotationForeignObjects.length > 0;\n return (\n <div className={classes.root} role=\"presentation\" data-chart-annotation-layer=\"true\">\n {shouldRenderSvg && (\n <svg\n className={classes.connectorLayer}\n width=\"100%\"\n height=\"100%\"\n viewBox={`0 0 ${viewBoxWidth} ${viewBoxHeight}`}\n preserveAspectRatio=\"none\"\n data-chart-annotation-svg=\"true\"\n >\n {markerDefs.length > 0 && <defs>{markerDefs}</defs>}\n {connectorElements.length > 0 && (\n <g aria-hidden=\"true\" className={classes.connectorGroup}>\n {connectorElements}\n </g>\n )}\n {annotationForeignObjects}\n </svg>\n )}\n {measurementElements}\n </div>\n );\n});\n\nChartAnnotationLayer.displayName = 'ChartAnnotationLayer';\n"],"names":["React","mergeClasses","applyOpacityToColor","DEFAULT_ANNOTATION_BACKGROUND_OPACITY","DEFAULT_CONNECTOR_ARROW","DEFAULT_CONNECTOR_END_PADDING","DEFAULT_CONNECTOR_START_PADDING","DEFAULT_CONNECTOR_STROKE_WIDTH","getDefaultConnectorStrokeColor","useChartAnnotationLayerStyles","useId","tokens","DEFAULT_HORIZONTAL_ALIGN","DEFAULT_VERTICAL_ALIGN","DEFAULT_FOREIGN_OBJECT_WIDTH","DEFAULT_FOREIGN_OBJECT_HEIGHT","MIN_ARROW_SIZE","MAX_ARROW_SIZE","ARROW_SIZE_SCALE","MAX_SIMPLE_MARKUP_DEPTH","CHAR_CODE_LESS_THAN","codePointAt","CHAR_CODE_GREATER_THAN","decodeSimpleMarkupInput","input","namedEntities","amp","quot","apos","nbsp","withBasicEntitiesDecoded","replace","match","entity","lower","toLowerCase","startsWith","isHex","digits","slice","codePoint","Number","parseInt","isNaN","String","fromCodePoint","inner","normalized","trim","appendTextNode","nodes","text","length","last","type","content","push","serializeSimpleMarkup","map","node","tag","children","join","parseSimpleMarkup","decodedInput","rootChildren","stack","currentChildren","tagRegex","lastIndex","exec","fullMatch","rawTagName","tagName","isClosing","isSelfClosing","test","index","top","pop","elementNode","unclosed","parentChildren","lastChild","nodeIndex","indexOf","splice","simpleMarkupNodesToPlainText","renderSimpleMarkupNodeList","keyPrefix","key","Fragment","br","Tag","createElement","renderSimpleMarkup","rendered","normalizeBandOffset","scale","value","position","undefined","bandwidth","clamp","min","max","Math","resolveDataCoordinate","axis","context","yAxis","xScale","parsedValue","Date","getTime","yScale","yScaleSecondary","yScalePrimary","resolveAxisCoordinate","coordinateType","options","plotRect","x","width","y","height","createMeasurementSignature","annotationContentSignature","containerStyle","contentStyle","layoutClassName","styleClassName","JSON","stringify","getCoordinateDescriptor","coordinates","xType","yType","xCoordinateType","yCoordinateType","resolveCoordinates","annotation","layout","descriptor","offsetX","offsetY","anchorX","anchorY","anchor","left","clipToBounds","point","ChartAnnotationLayer","memo","props","annotations","annotationsProp","classes","idPrefix","autoKeyPrefix","measurements","setMeasurements","useState","resolvedAnnotations","useMemo","fallbackIndex","id","useEffect","prev","Object","keys","next","forEach","identical","updateMeasurement","useCallback","signature","prevEntry","abs","annotationForeignObjects","measurementElements","connectors","resolved","rawAnnotationText","annotationMarkupNodes","annotationMarkupSignature","annotationPlainText","horizontalAlign","align","verticalAlign","backgroundOpacity","style","opacity","baseBackgroundColor","backgroundColor","hasCustomBackground","maxWidth","preserveOriginalOpacity","colorNeutralBackground1","borderColor","borderWidth","borderStyle","borderRadius","padding","boxShadow","color","textColor","fontSize","fontWeight","rotation","transform","transformOrigin","measurementSignature","className","measurementEntry","isMeasurementValid","measuredSize","baseTopLeftX","baseTopLeftY","usePlotBounds","viewportX","viewportY","viewportWidth","svgRect","viewportHeight","maxTopLeftX","maxTopLeftY","topLeftX","topLeftY","displayPoint","connector","startPadding","endPadding","minArrowClearance","minDistance","dx","dy","distance","sqrt","fallbackDirection","ux","uy","desiredDisplayX","desiredDisplayY","desiredTopLeftX","desiredTopLeftY","measurementStyle","pointerEvents","visibility","div","ref","rect","getBoundingClientRect","measurement","aria-hidden","data-annotation-key","data-chart-annotation-measurement","annotationContent","foreignObject","annotationForeignObject","role","accessibility","aria-label","ariaLabel","aria-describedby","ariaDescribedBy","data-chart-annotation","strokeColor","strokeWidth","dashArray","arrow","sizeBasis","proportionalSize","maxByPadding","maxByDistance","markerSize","markerStrokeWidth","start","end","viewBoxWidth","viewBoxHeight","markerDefs","createMarkerId","size","refY","refX","pathEnd","pathStart","path","marker","markerWidth","markerHeight","viewBox","orient","markerUnits","d","fill","stroke","strokeLinecap","strokeLinejoin","connectorElements","markerStart","markerEnd","line","x1","y1","x2","y2","strokeDasharray","shouldRenderSvg","root","data-chart-annotation-layer","svg","connectorLayer","preserveAspectRatio","data-chart-annotation-svg","defs","g","connectorGroup","displayName"],"mappings":"AAAA;;;;;+BA2YawJ;;;;;;;iEAzYU,QAAQ;wBACF,iBAAiB;+CAkBvC,mCAAmC;gCACpB,4BAA4B;4BAC3B,wBAAwB;AAE/C,MAAM5I,2BAA2B;AACjC,MAAMC,yBAAyB;AAC/B,MAAMC,+BAA+B;AACrC,MAAMC,gCAAgC;AACtC,MAAMC,iBAAiB;AACvB,MAAMC,iBAAiB;AACvB,MAAMC,mBAAmB;AACzB,MAAMC,0BAA0B;AAChC,MAAMC,sBAAsB,IAAIC,WAAW,CAAC;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,aAChCmB,kBAAkBxP,MAAM,GAAG,KAAA,WAAA,GAC1B,OAAA,aAAA,CAACyQ,KAAAA;QAAE/D,eAAY;QAAOzC,WAAWxD,QAAQiK,cAAc;OACpDlB,oBAGJzH,2BAGJC;AAGP,GAAG;AAEH5B,qBAAqBuK,WAAW,GAAG"}
@@ -53,7 +53,7 @@ const DEFAULT_CONNECTOR_START_PADDING = 12;
53
53
  const DEFAULT_CONNECTOR_END_PADDING = 0;
54
54
  const DEFAULT_CONNECTOR_STROKE_WIDTH = 2;
55
55
  const DEFAULT_CONNECTOR_ARROW = 'end';
56
- const applyOpacityToColor = (color, opacity)=>{
56
+ const applyOpacityToColor = (color, opacity, options)=>{
57
57
  if (!color) {
58
58
  return undefined;
59
59
  }
@@ -61,6 +61,12 @@ const applyOpacityToColor = (color, opacity)=>{
61
61
  if (!parsed) {
62
62
  return color;
63
63
  }
64
+ const originalOpacity = typeof parsed.opacity === 'number' ? parsed.opacity : 1;
65
+ var _options_preserveOriginalOpacity;
66
+ const preserveOriginalOpacity = (_options_preserveOriginalOpacity = options === null || options === void 0 ? void 0 : options.preserveOriginalOpacity) !== null && _options_preserveOriginalOpacity !== void 0 ? _options_preserveOriginalOpacity : true;
67
+ if (preserveOriginalOpacity && originalOpacity < 1) {
68
+ return parsed.toString();
69
+ }
64
70
  parsed.opacity = Math.max(0, Math.min(1, opacity));
65
71
  return parsed.toString();
66
72
  };