@splunk/visualizations 28.6.0 → 28.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (501) hide show
  1. package/Area.js +2 -2
  2. package/Area.js.map +2 -2
  3. package/Bar.js +2 -2
  4. package/Bar.js.map +2 -2
  5. package/Bubble.js +2 -2
  6. package/Bubble.js.map +2 -2
  7. package/CHANGELOG.external.md +45 -50
  8. package/ChoroplethSvg.js +2 -2
  9. package/ChoroplethSvg.js.map +2 -2
  10. package/Column.js +2 -2
  11. package/Column.js.map +2 -2
  12. package/Ellipse.js +2 -2
  13. package/Ellipse.js.map +2 -2
  14. package/Events/PureEvents/FieldSummaryTooltip.d.ts +8 -31
  15. package/Events/PureEvents/FieldSummaryTooltip.d.ts.map +1 -1
  16. package/Events/PureEvents/PureEvents.d.ts.map +1 -1
  17. package/Events/PureEvents/TimeControlsPopover.d.ts +6 -25
  18. package/Events/PureEvents/TimeControlsPopover.d.ts.map +1 -1
  19. package/Events.js +27 -101
  20. package/Events.js.map +2 -2
  21. package/FillerGauge.js +10 -5
  22. package/FillerGauge.js.map +2 -2
  23. package/Image.js +2 -2
  24. package/Image.js.map +2 -2
  25. package/Line.js +2 -2
  26. package/Line.js.map +2 -2
  27. package/LinkGraph.js +2 -2
  28. package/LinkGraph.js.map +2 -2
  29. package/Map/Map.d.ts +1 -0
  30. package/Map/Map.d.ts.map +1 -1
  31. package/Map/PureMap/BubbleLayer.d.ts +22 -4
  32. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  33. package/Map/PureMap/ChoroplethLayer.d.ts +9 -1
  34. package/Map/PureMap/ChoroplethLayer.d.ts.map +1 -1
  35. package/Map/PureMap/ClusterLayer.d.ts +3 -1
  36. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  37. package/Map/PureMap/LocalChoroplethLayer.d.ts +1 -0
  38. package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
  39. package/Map/PureMap/MapContext.d.ts +13 -0
  40. package/Map/PureMap/MapContext.d.ts.map +1 -0
  41. package/Map/PureMap/MarkerLayer.d.ts +19 -2
  42. package/Map/PureMap/MarkerLayer.d.ts.map +1 -1
  43. package/Map/PureMap/MarkerWrapper.d.ts +3 -2
  44. package/Map/PureMap/MarkerWrapper.d.ts.map +1 -1
  45. package/Map/PureMap/PureMap.d.ts +1 -0
  46. package/Map/PureMap/PureMap.d.ts.map +1 -1
  47. package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
  48. package/Map/PureMap/Tooltip.d.ts +6 -1
  49. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  50. package/Map/PureMap/keyboardConstants.d.ts +11 -0
  51. package/Map/PureMap/keyboardConstants.d.ts.map +1 -0
  52. package/Map/PureMap/useRovingTabindex.d.ts +18 -0
  53. package/Map/PureMap/useRovingTabindex.d.ts.map +1 -0
  54. package/Map.js +1317 -478
  55. package/Map.js.map +4 -4
  56. package/Markdown/Markdown.d.ts.map +1 -1
  57. package/Markdown.config.js +1 -1
  58. package/Markdown.config.js.map +1 -1
  59. package/Markdown.js +24 -7
  60. package/Markdown.js.map +2 -2
  61. package/MarkerGauge.js +10 -5
  62. package/MarkerGauge.js.map +2 -2
  63. package/NetworkGraph/NetworkGraph.d.ts +2 -5
  64. package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
  65. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
  66. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +1 -0
  67. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -1
  68. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +1 -0
  69. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
  70. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +1 -1
  71. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -1
  72. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +1 -0
  73. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
  74. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +23 -0
  75. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
  76. package/NetworkGraph.config.js +2 -0
  77. package/NetworkGraph.config.js.map +2 -2
  78. package/NetworkGraph.js +353 -40
  79. package/NetworkGraph.js.map +4 -4
  80. package/ParallelCoordinates.js +2 -2
  81. package/ParallelCoordinates.js.map +2 -2
  82. package/Pie.js +2 -2
  83. package/Pie.js.map +2 -2
  84. package/ProcessTree/ProcessTree.d.ts +3 -1
  85. package/ProcessTree/ProcessTree.d.ts.map +1 -1
  86. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +1 -0
  87. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -1
  88. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +2 -0
  89. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -1
  90. package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -1
  91. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +3 -1
  92. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -1
  93. package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -1
  94. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +3 -1
  95. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -1
  96. package/ProcessTree.js +101 -31
  97. package/ProcessTree.js.map +3 -3
  98. package/Punchcard.js +2 -2
  99. package/Punchcard.js.map +2 -2
  100. package/README.md +2 -0
  101. package/Rectangle.js +2 -2
  102. package/Rectangle.js.map +2 -2
  103. package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -1
  104. package/RichText/PureRichText/InnerEditor.d.ts +10 -0
  105. package/RichText/PureRichText/InnerEditor.d.ts.map +1 -1
  106. package/RichText/PureRichText/PureRichText.d.ts +17 -0
  107. package/RichText/PureRichText/PureRichText.d.ts.map +1 -1
  108. package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -1
  109. package/RichText/PureRichText/hooks/useContentSave.d.ts +6 -0
  110. package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -1
  111. package/RichText/PureRichText/hooks/useContentSync.d.ts +13 -1
  112. package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -1
  113. package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -1
  114. package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -1
  115. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +1 -16
  116. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -1
  117. package/RichText/PureRichText/hooks/useTokenMap.d.ts +37 -35
  118. package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -1
  119. package/RichText/PureRichText/renderers/LeafRenderer.d.ts +0 -4
  120. package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -1
  121. package/RichText/PureRichText/types.d.ts +15 -0
  122. package/RichText/PureRichText/types.d.ts.map +1 -1
  123. package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -1
  124. package/RichText/RichText.d.ts +2 -0
  125. package/RichText/RichText.d.ts.map +1 -1
  126. package/RichText/config.d.ts.map +1 -1
  127. package/RichText.config.js +14 -1
  128. package/RichText.config.js.map +2 -2
  129. package/RichText.js +733 -263
  130. package/RichText.js.map +4 -4
  131. package/Sankey.js +2 -2
  132. package/Sankey.js.map +2 -2
  133. package/Scatter.js +2 -2
  134. package/Scatter.js.map +2 -2
  135. package/SingleValue.js +368 -471
  136. package/SingleValue.js.map +4 -4
  137. package/SingleValueIcon.js +2 -2
  138. package/SingleValueIcon.js.map +2 -2
  139. package/SingleValueRadial.js +2 -2
  140. package/SingleValueRadial.js.map +2 -2
  141. package/SparkLine/SparkLine.d.ts +57 -0
  142. package/SparkLine/SparkLine.d.ts.map +1 -0
  143. package/SparkLine/index.d.ts +1 -1
  144. package/SparkLine/index.d.ts.map +1 -1
  145. package/SparkLine.js +384 -485
  146. package/SparkLine.js.map +4 -4
  147. package/Table/PureTable.d.ts +2 -0
  148. package/Table/PureTable.d.ts.map +1 -1
  149. package/Table/config.d.ts.map +1 -1
  150. package/Table/hooks.d.ts +1 -1
  151. package/Table/hooks.d.ts.map +1 -1
  152. package/Table.config.js +7 -0
  153. package/Table.config.js.map +2 -2
  154. package/Table.js +480 -500
  155. package/Table.js.map +4 -4
  156. package/Timeline/PureTimeline/PureTimeline.d.ts +6 -5
  157. package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
  158. package/Timeline/PureTimeline/src/CursorPlugin.d.ts +1 -0
  159. package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
  160. package/Timeline/PureTimeline/src/TimelineLegend.d.ts +10 -7
  161. package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
  162. package/Timeline/PureTimeline/src/TimelineTooltip.d.ts +5 -1
  163. package/Timeline/PureTimeline/src/TimelineTooltip.d.ts.map +1 -1
  164. package/Timeline/PureTimeline/src/TimelineUplot.d.ts +19 -2
  165. package/Timeline/PureTimeline/src/TimelineUplot.d.ts.map +1 -1
  166. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  167. package/Timeline/PureTimeline/src/XAxisPlugin.d.ts +1 -0
  168. package/Timeline/PureTimeline/src/XAxisPlugin.d.ts.map +1 -1
  169. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +8 -0
  170. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  171. package/Timeline.js +449 -211
  172. package/Timeline.js.map +4 -4
  173. package/Treemap/PureTreemap/components/PureTreemap.d.ts +42 -0
  174. package/Treemap/PureTreemap/components/PureTreemap.d.ts.map +1 -0
  175. package/Treemap/PureTreemap/components/TreemapBreadcrumb.d.ts +10 -0
  176. package/Treemap/PureTreemap/components/TreemapBreadcrumb.d.ts.map +1 -0
  177. package/Treemap/PureTreemap/components/TreemapChildCell.d.ts +28 -0
  178. package/Treemap/PureTreemap/components/TreemapChildCell.d.ts.map +1 -0
  179. package/Treemap/PureTreemap/components/TreemapHeader.d.ts +19 -0
  180. package/Treemap/PureTreemap/components/TreemapHeader.d.ts.map +1 -0
  181. package/Treemap/PureTreemap/components/TreemapHoverTarget.d.ts +17 -0
  182. package/Treemap/PureTreemap/components/TreemapHoverTarget.d.ts.map +1 -0
  183. package/Treemap/PureTreemap/components/TreemapLegend.d.ts +20 -0
  184. package/Treemap/PureTreemap/components/TreemapLegend.d.ts.map +1 -0
  185. package/Treemap/PureTreemap/components/TreemapNode.d.ts +5 -0
  186. package/Treemap/PureTreemap/components/TreemapNode.d.ts.map +1 -0
  187. package/Treemap/PureTreemap/components/TreemapParentNode.d.ts +10 -0
  188. package/Treemap/PureTreemap/components/TreemapParentNode.d.ts.map +1 -0
  189. package/Treemap/PureTreemap/components/TreemapStandaloneNode.d.ts +6 -0
  190. package/Treemap/PureTreemap/components/TreemapStandaloneNode.d.ts.map +1 -0
  191. package/Treemap/PureTreemap/components/TreemapTooltip.d.ts +17 -0
  192. package/Treemap/PureTreemap/components/TreemapTooltip.d.ts.map +1 -0
  193. package/Treemap/PureTreemap/mockdata/data.d.ts +90 -0
  194. package/Treemap/PureTreemap/mockdata/data.d.ts.map +1 -0
  195. package/Treemap/PureTreemap/utils/treemapColorUtils.d.ts +67 -0
  196. package/Treemap/PureTreemap/utils/treemapColorUtils.d.ts.map +1 -0
  197. package/Treemap/PureTreemap/utils/treemapDataColorUtils.d.ts +5 -0
  198. package/Treemap/PureTreemap/utils/treemapDataColorUtils.d.ts.map +1 -0
  199. package/Treemap/PureTreemap/utils/treemapDataUtils.d.ts +14 -0
  200. package/Treemap/PureTreemap/utils/treemapDataUtils.d.ts.map +1 -0
  201. package/Treemap/PureTreemap/utils/treemapLayout.d.ts +49 -0
  202. package/Treemap/PureTreemap/utils/treemapLayout.d.ts.map +1 -0
  203. package/Treemap/PureTreemap/utils/treemapNodeUtils.d.ts +81 -0
  204. package/Treemap/PureTreemap/utils/treemapNodeUtils.d.ts.map +1 -0
  205. package/Treemap/PureTreemap/utils/treemapTypes.d.ts +37 -0
  206. package/Treemap/PureTreemap/utils/treemapTypes.d.ts.map +1 -0
  207. package/Treemap/PureTreemap/utils/treemapUtils.d.ts +76 -0
  208. package/Treemap/PureTreemap/utils/treemapUtils.d.ts.map +1 -0
  209. package/Treemap/Treemap.d.ts +12 -0
  210. package/Treemap/Treemap.d.ts.map +1 -0
  211. package/Treemap/config.d.ts +4 -0
  212. package/Treemap/config.d.ts.map +1 -0
  213. package/Treemap/index.d.ts +3 -0
  214. package/Treemap/index.d.ts.map +1 -0
  215. package/Treemap.config.js +465 -0
  216. package/Treemap.config.js.map +7 -0
  217. package/Treemap.js +6233 -0
  218. package/Treemap.js.map +7 -0
  219. package/common/DocExampleWithVizSandbox.js.map +2 -2
  220. package/common/GaugeMajorTicks.js.map +2 -2
  221. package/common/GaugeValueMarker.js +1 -0
  222. package/common/GaugeValueMarker.js.map +2 -2
  223. package/common/OptionsDoc.js.map +1 -1
  224. package/common/OverviewDoc.js.map +2 -2
  225. package/common/docUtils.d.ts.map +1 -1
  226. package/common/docUtils.js +1 -8
  227. package/common/docUtils.js.map +2 -2
  228. package/common/gaugeUtils.d.ts.map +1 -1
  229. package/common/gaugeUtils.js +7 -3
  230. package/common/gaugeUtils.js.map +2 -2
  231. package/common/hocs/FixedSizeContainer.d.ts.map +1 -1
  232. package/common/hooks/useDynamicHeight.d.ts +67 -0
  233. package/common/hooks/useDynamicHeight.d.ts.map +1 -0
  234. package/common/interfaces/VizCategory.d.ts +2 -1
  235. package/common/interfaces/VizCategory.d.ts.map +1 -1
  236. package/common/utils/mapUtils.js +512 -179
  237. package/common/utils/mapUtils.js.map +4 -4
  238. package/common/utils/shadowDomUtils.d.ts +2 -0
  239. package/common/utils/shadowDomUtils.d.ts.map +1 -0
  240. package/common/utils/shadowDomUtils.js +39 -0
  241. package/common/utils/shadowDomUtils.js.map +7 -0
  242. package/common/withDashboardViz.js +2 -2
  243. package/common/withDashboardViz.js.map +2 -2
  244. package/docs-llm/INDEX.md +119 -0
  245. package/docs-llm/area/examples-json.md +3854 -0
  246. package/docs-llm/area/examples-react.md +2816 -0
  247. package/docs-llm/area/options.md +97 -0
  248. package/docs-llm/area/overview.md +27 -0
  249. package/docs-llm/bar/examples-json.md +3380 -0
  250. package/docs-llm/bar/examples-react.md +2352 -0
  251. package/docs-llm/bar/options.md +89 -0
  252. package/docs-llm/bar/overview.md +25 -0
  253. package/docs-llm/bubble/examples-json.md +4082 -0
  254. package/docs-llm/bubble/examples-react.md +3977 -0
  255. package/docs-llm/bubble/options.md +62 -0
  256. package/docs-llm/bubble/overview.md +26 -0
  257. package/docs-llm/choropleth-svg/examples-json.md +397 -0
  258. package/docs-llm/choropleth-svg/examples-react.md +389 -0
  259. package/docs-llm/choropleth-svg/options.md +15 -0
  260. package/docs-llm/choropleth-svg/overview.md +23 -0
  261. package/docs-llm/column/examples-json.md +3898 -0
  262. package/docs-llm/column/examples-react.md +2653 -0
  263. package/docs-llm/column/options.md +94 -0
  264. package/docs-llm/column/overview.md +31 -0
  265. package/docs-llm/dsl/examples-json.md +43 -0
  266. package/docs-llm/dsl/examples-react.md +78 -0
  267. package/docs-llm/dsl/formatters/format-by-type-examples-json.md +58 -0
  268. package/docs-llm/dsl/formatters/format-by-type-examples-react.md +43 -0
  269. package/docs-llm/dsl/formatters/format-by-type.md +38 -0
  270. package/docs-llm/dsl/formatters/frame-examples-json.md +42 -0
  271. package/docs-llm/dsl/formatters/frame-examples-react.md +24 -0
  272. package/docs-llm/dsl/formatters/frame.md +6 -0
  273. package/docs-llm/dsl/formatters/gradient-examples-json.md +98 -0
  274. package/docs-llm/dsl/formatters/gradient-examples-react.md +44 -0
  275. package/docs-llm/dsl/formatters/gradient.md +23 -0
  276. package/docs-llm/dsl/formatters/lerp-examples-json.md +40 -0
  277. package/docs-llm/dsl/formatters/lerp-examples-react.md +28 -0
  278. package/docs-llm/dsl/formatters/lerp.md +19 -0
  279. package/docs-llm/dsl/formatters/match-value-examples-json.md +65 -0
  280. package/docs-llm/dsl/formatters/match-value-examples-react.md +37 -0
  281. package/docs-llm/dsl/formatters/match-value.md +13 -0
  282. package/docs-llm/dsl/formatters/max-contrast-examples-json.md +39 -0
  283. package/docs-llm/dsl/formatters/max-contrast-examples-react.md +27 -0
  284. package/docs-llm/dsl/formatters/max-contrast.md +9 -0
  285. package/docs-llm/dsl/formatters/multi-format-examples-json.md +67 -0
  286. package/docs-llm/dsl/formatters/multi-format-examples-react.md +49 -0
  287. package/docs-llm/dsl/formatters/multi-format.md +12 -0
  288. package/docs-llm/dsl/formatters/objects-examples-json.md +49 -0
  289. package/docs-llm/dsl/formatters/objects-examples-react.md +37 -0
  290. package/docs-llm/dsl/formatters/objects.md +3 -0
  291. package/docs-llm/dsl/formatters/pick-examples-json.md +59 -0
  292. package/docs-llm/dsl/formatters/pick-examples-react.md +30 -0
  293. package/docs-llm/dsl/formatters/pick.md +9 -0
  294. package/docs-llm/dsl/formatters/prefix-examples-json.md +29 -0
  295. package/docs-llm/dsl/formatters/prefix-examples-react.md +19 -0
  296. package/docs-llm/dsl/formatters/prefix.md +3 -0
  297. package/docs-llm/dsl/formatters/prepend-examples-json.md +51 -0
  298. package/docs-llm/dsl/formatters/prepend-examples-react.md +33 -0
  299. package/docs-llm/dsl/formatters/prepend.md +9 -0
  300. package/docs-llm/dsl/formatters/range-value-examples-json.md +48 -0
  301. package/docs-llm/dsl/formatters/range-value-examples-react.md +34 -0
  302. package/docs-llm/dsl/formatters/range-value.md +15 -0
  303. package/docs-llm/dsl/formatters/set-color-channel-examples-json.md +40 -0
  304. package/docs-llm/dsl/formatters/set-color-channel-examples-react.md +31 -0
  305. package/docs-llm/dsl/formatters/set-color-channel.md +9 -0
  306. package/docs-llm/dsl/formatters/suffix-examples-json.md +29 -0
  307. package/docs-llm/dsl/formatters/suffix-examples-react.md +19 -0
  308. package/docs-llm/dsl/formatters/suffix.md +3 -0
  309. package/docs-llm/dsl/formatters/type-examples-json.md +37 -0
  310. package/docs-llm/dsl/formatters/type-examples-react.md +20 -0
  311. package/docs-llm/dsl/formatters/type.md +3 -0
  312. package/docs-llm/dsl/overview.md +41 -0
  313. package/docs-llm/dsl/selectors/abs.md +7 -0
  314. package/docs-llm/dsl/selectors/ceil.md +7 -0
  315. package/docs-llm/dsl/selectors/data-frame-average-examples-json.md +41 -0
  316. package/docs-llm/dsl/selectors/data-frame-average-examples-react.md +36 -0
  317. package/docs-llm/dsl/selectors/data-frame-average.md +7 -0
  318. package/docs-llm/dsl/selectors/data-frame-count-examples-json.md +41 -0
  319. package/docs-llm/dsl/selectors/data-frame-count-examples-react.md +36 -0
  320. package/docs-llm/dsl/selectors/data-frame-count.md +7 -0
  321. package/docs-llm/dsl/selectors/data-frame-examples-json.md +830 -0
  322. package/docs-llm/dsl/selectors/data-frame-examples-react.md +929 -0
  323. package/docs-llm/dsl/selectors/data-frame-get-field-examples-json.md +89 -0
  324. package/docs-llm/dsl/selectors/data-frame-get-field-examples-react.md +124 -0
  325. package/docs-llm/dsl/selectors/data-frame-get-field.md +5 -0
  326. package/docs-llm/dsl/selectors/data-frame-get-raw-value.md +5 -0
  327. package/docs-llm/dsl/selectors/data-frame-get-type.md +5 -0
  328. package/docs-llm/dsl/selectors/data-frame-get-value.md +5 -0
  329. package/docs-llm/dsl/selectors/data-frame-max-examples-json.md +51 -0
  330. package/docs-llm/dsl/selectors/data-frame-max-examples-react.md +41 -0
  331. package/docs-llm/dsl/selectors/data-frame-max.md +7 -0
  332. package/docs-llm/dsl/selectors/data-frame-min-examples-json.md +51 -0
  333. package/docs-llm/dsl/selectors/data-frame-min-examples-react.md +41 -0
  334. package/docs-llm/dsl/selectors/data-frame-min.md +7 -0
  335. package/docs-llm/dsl/selectors/data-frame-percentile-examples-json.md +41 -0
  336. package/docs-llm/dsl/selectors/data-frame-percentile-examples-react.md +36 -0
  337. package/docs-llm/dsl/selectors/data-frame-percentile.md +8 -0
  338. package/docs-llm/dsl/selectors/data-frame-set-value.md +5 -0
  339. package/docs-llm/dsl/selectors/data-frame-sum-examples-json.md +51 -0
  340. package/docs-llm/dsl/selectors/data-frame-sum-examples-react.md +41 -0
  341. package/docs-llm/dsl/selectors/data-frame-sum.md +7 -0
  342. package/docs-llm/dsl/selectors/data-frame.md +4 -0
  343. package/docs-llm/dsl/selectors/data-point-get-field.md +5 -0
  344. package/docs-llm/dsl/selectors/data-point-get-raw-value.md +4 -0
  345. package/docs-llm/dsl/selectors/data-point-get-type.md +5 -0
  346. package/docs-llm/dsl/selectors/data-point-get-value.md +5 -0
  347. package/docs-llm/dsl/selectors/data-point-set-value.md +4 -0
  348. package/docs-llm/dsl/selectors/data-point.md +5 -0
  349. package/docs-llm/dsl/selectors/data-series-average.md +22 -0
  350. package/docs-llm/dsl/selectors/data-series-count.md +14 -0
  351. package/docs-llm/dsl/selectors/data-series-get-field.md +5 -0
  352. package/docs-llm/dsl/selectors/data-series-get-raw-value.md +4 -0
  353. package/docs-llm/dsl/selectors/data-series-get-type.md +5 -0
  354. package/docs-llm/dsl/selectors/data-series-get-value.md +4 -0
  355. package/docs-llm/dsl/selectors/data-series-max.md +5 -0
  356. package/docs-llm/dsl/selectors/data-series-min.md +5 -0
  357. package/docs-llm/dsl/selectors/data-series-percentile.md +17 -0
  358. package/docs-llm/dsl/selectors/data-series-set-value.md +4 -0
  359. package/docs-llm/dsl/selectors/data-series-sum.md +24 -0
  360. package/docs-llm/dsl/selectors/data-series.md +4 -0
  361. package/docs-llm/dsl/selectors/delta.md +7 -0
  362. package/docs-llm/dsl/selectors/divide.md +8 -0
  363. package/docs-llm/dsl/selectors/first-point.md +5 -0
  364. package/docs-llm/dsl/selectors/floor.md +7 -0
  365. package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-json.md +89 -0
  366. package/docs-llm/dsl/selectors/frame-by-series-index-range-examples-react.md +88 -0
  367. package/docs-llm/dsl/selectors/frame-by-series-index-range.md +10 -0
  368. package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-json.md +88 -0
  369. package/docs-llm/dsl/selectors/frame-by-series-indexes-examples-react.md +87 -0
  370. package/docs-llm/dsl/selectors/frame-by-series-indexes.md +9 -0
  371. package/docs-llm/dsl/selectors/frame-by-series-names-examples-json.md +89 -0
  372. package/docs-llm/dsl/selectors/frame-by-series-names-examples-react.md +88 -0
  373. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-json.md +89 -0
  374. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes-examples-react.md +88 -0
  375. package/docs-llm/dsl/selectors/frame-by-series-names-or-indexes.md +9 -0
  376. package/docs-llm/dsl/selectors/frame-by-series-names.md +9 -0
  377. package/docs-llm/dsl/selectors/frame-by-series-types-examples-json.md +89 -0
  378. package/docs-llm/dsl/selectors/frame-by-series-types-examples-react.md +88 -0
  379. package/docs-llm/dsl/selectors/frame-by-series-types.md +9 -0
  380. package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-json.md +137 -0
  381. package/docs-llm/dsl/selectors/frame-without-internal-fields-examples-react.md +135 -0
  382. package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-json.md +157 -0
  383. package/docs-llm/dsl/selectors/frame-without-internal-fields-except-examples-react.md +155 -0
  384. package/docs-llm/dsl/selectors/frame-without-internal-fields-except.md +21 -0
  385. package/docs-llm/dsl/selectors/frame-without-internal-fields.md +17 -0
  386. package/docs-llm/dsl/selectors/frame-without-series-names.md +8 -0
  387. package/docs-llm/dsl/selectors/last-point.md +5 -0
  388. package/docs-llm/dsl/selectors/minus.md +8 -0
  389. package/docs-llm/dsl/selectors/multiply.md +8 -0
  390. package/docs-llm/dsl/selectors/plus.md +8 -0
  391. package/docs-llm/dsl/selectors/point-by-index.md +6 -0
  392. package/docs-llm/dsl/selectors/points-by-indexes.md +6 -0
  393. package/docs-llm/dsl/selectors/round.md +7 -0
  394. package/docs-llm/dsl/selectors/series-by-index-examples-json.md +49 -0
  395. package/docs-llm/dsl/selectors/series-by-index-examples-react.md +39 -0
  396. package/docs-llm/dsl/selectors/series-by-index.md +8 -0
  397. package/docs-llm/dsl/selectors/series-by-name-examples-json.md +49 -0
  398. package/docs-llm/dsl/selectors/series-by-name-examples-react.md +39 -0
  399. package/docs-llm/dsl/selectors/series-by-name.md +8 -0
  400. package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-json.md +47 -0
  401. package/docs-llm/dsl/selectors/series-by-prioritized-types-examples-react.md +39 -0
  402. package/docs-llm/dsl/selectors/series-by-prioritized-types.md +10 -0
  403. package/docs-llm/dsl/selectors/series-by-type-examples-json.md +49 -0
  404. package/docs-llm/dsl/selectors/series-by-type-examples-react.md +39 -0
  405. package/docs-llm/dsl/selectors/series-by-type.md +10 -0
  406. package/docs-llm/dsl/selectors/series-by-types.md +6 -0
  407. package/docs-llm/ellipse/examples-json.md +5 -0
  408. package/docs-llm/ellipse/examples-react.md +5 -0
  409. package/docs-llm/ellipse/options.md +16 -0
  410. package/docs-llm/ellipse/overview.md +5 -0
  411. package/docs-llm/events/examples-json.md +705 -0
  412. package/docs-llm/events/examples-react.md +536 -0
  413. package/docs-llm/events/options.md +18 -0
  414. package/docs-llm/events/overview.md +5 -0
  415. package/docs-llm/filler-gauge/examples-json.md +376 -0
  416. package/docs-llm/filler-gauge/examples-react.md +274 -0
  417. package/docs-llm/filler-gauge/options.md +26 -0
  418. package/docs-llm/filler-gauge/overview.md +5 -0
  419. package/docs-llm/image/examples-json.md +39 -0
  420. package/docs-llm/image/examples-react.md +65 -0
  421. package/docs-llm/image/options.md +13 -0
  422. package/docs-llm/image/overview.md +5 -0
  423. package/docs-llm/line/examples-json.md +3724 -0
  424. package/docs-llm/line/examples-react.md +2683 -0
  425. package/docs-llm/line/options.md +95 -0
  426. package/docs-llm/line/overview.md +29 -0
  427. package/docs-llm/link-graph/examples-json.md +5 -0
  428. package/docs-llm/link-graph/examples-react.md +5 -0
  429. package/docs-llm/link-graph/options.md +26 -0
  430. package/docs-llm/link-graph/overview.md +16 -0
  431. package/docs-llm/map/examples-json.md +13973 -0
  432. package/docs-llm/map/examples-react.md +6154 -0
  433. package/docs-llm/map/options.md +22 -0
  434. package/docs-llm/map/overview.md +32 -0
  435. package/docs-llm/markdown/examples-json.md +63 -0
  436. package/docs-llm/markdown/examples-react.md +98 -0
  437. package/docs-llm/markdown/options.md +17 -0
  438. package/docs-llm/markdown/overview.md +5 -0
  439. package/docs-llm/marker-gauge/examples-json.md +436 -0
  440. package/docs-llm/marker-gauge/examples-react.md +367 -0
  441. package/docs-llm/marker-gauge/options.md +26 -0
  442. package/docs-llm/marker-gauge/overview.md +5 -0
  443. package/docs-llm/network-graph/examples-json.md +8843 -0
  444. package/docs-llm/network-graph/examples-react.md +7339 -0
  445. package/docs-llm/network-graph/options.md +50 -0
  446. package/docs-llm/network-graph/overview.md +28 -0
  447. package/docs-llm/parallel-coordinates/examples-json.md +8376 -0
  448. package/docs-llm/parallel-coordinates/examples-react.md +2771 -0
  449. package/docs-llm/parallel-coordinates/options.md +14 -0
  450. package/docs-llm/parallel-coordinates/overview.md +22 -0
  451. package/docs-llm/pie/examples-json.md +851 -0
  452. package/docs-llm/pie/examples-react.md +606 -0
  453. package/docs-llm/pie/options.md +34 -0
  454. package/docs-llm/pie/overview.md +23 -0
  455. package/docs-llm/process-tree/options.md +32 -0
  456. package/docs-llm/punchcard/examples-json.md +6134 -0
  457. package/docs-llm/punchcard/examples-react.md +4562 -0
  458. package/docs-llm/punchcard/options.md +33 -0
  459. package/docs-llm/punchcard/overview.md +5 -0
  460. package/docs-llm/pure-rich-text/options.md +29 -0
  461. package/docs-llm/rectangle/examples-json.md +5 -0
  462. package/docs-llm/rectangle/examples-react.md +5 -0
  463. package/docs-llm/rectangle/options.md +19 -0
  464. package/docs-llm/rectangle/overview.md +5 -0
  465. package/docs-llm/rich-text/examples-json.md +96 -0
  466. package/docs-llm/rich-text/examples-react.md +119 -0
  467. package/docs-llm/rich-text/options.md +29 -0
  468. package/docs-llm/rich-text/overview.md +5 -0
  469. package/docs-llm/sankey/examples-json.md +844 -0
  470. package/docs-llm/sankey/examples-react.md +546 -0
  471. package/docs-llm/sankey/options.md +19 -0
  472. package/docs-llm/sankey/overview.md +24 -0
  473. package/docs-llm/scatter/examples-json.md +4012 -0
  474. package/docs-llm/scatter/examples-react.md +3914 -0
  475. package/docs-llm/scatter/options.md +68 -0
  476. package/docs-llm/scatter/overview.md +25 -0
  477. package/docs-llm/single-value/examples-json.md +2613 -0
  478. package/docs-llm/single-value/examples-react.md +2296 -0
  479. package/docs-llm/single-value/options.md +49 -0
  480. package/docs-llm/single-value/overview.md +23 -0
  481. package/docs-llm/single-value-icon/examples-json.md +1686 -0
  482. package/docs-llm/single-value-icon/examples-react.md +1573 -0
  483. package/docs-llm/single-value-icon/options.md +43 -0
  484. package/docs-llm/single-value-icon/overview.md +5 -0
  485. package/docs-llm/single-value-radial/examples-json.md +1178 -0
  486. package/docs-llm/single-value-radial/examples-react.md +1028 -0
  487. package/docs-llm/single-value-radial/options.md +41 -0
  488. package/docs-llm/single-value-radial/overview.md +5 -0
  489. package/docs-llm/table/examples-json.md +5 -0
  490. package/docs-llm/table/examples-react.md +5 -0
  491. package/docs-llm/table/options.md +26 -0
  492. package/docs-llm/table/overview.md +24 -0
  493. package/docs-llm/timeline/examples-json.md +5 -0
  494. package/docs-llm/timeline/examples-react.md +5 -0
  495. package/docs-llm/timeline/options.md +27 -0
  496. package/docs-llm/timeline/overview.md +24 -0
  497. package/docs-llm/treemap/examples-json.md +5 -0
  498. package/docs-llm/treemap/examples-react.md +5 -0
  499. package/docs-llm/treemap/options.md +26 -0
  500. package/docs-llm/treemap/overview.md +27 -0
  501. package/package.json +33 -28
package/Table.js CHANGED
@@ -454,6 +454,13 @@ var editorConfig = [
454
454
  }
455
455
  }
456
456
  ],
457
+ [
458
+ {
459
+ label: (0, i18n_exports._)("Dynamic table height"),
460
+ option: "dynamicHeight",
461
+ editor: "editor.toggle"
462
+ }
463
+ ],
457
464
  [
458
465
  {
459
466
  label: (0, i18n_exports._)("Row numbers"),
@@ -1147,7 +1154,7 @@ var SizeAwareWrapper_default = "default" in defaultImport29 ? defaultImport29.de
1147
1154
  var isMissing = (v) => {
1148
1155
  return v === null || v === void 0;
1149
1156
  };
1150
- var missingKeys = (keys2, target) => keys2.filter((k) => isMissing(target[k]));
1157
+ var missingKeys = (keys, target) => keys.filter((k) => isMissing(target[k]));
1151
1158
  var MissingPropsMessage = (props) => {
1152
1159
  const {
1153
1160
  width = SplunkVisualization_default.defaults.width,
@@ -1196,7 +1203,7 @@ var Cover = styled_components_default.div`
1196
1203
  bottom: 0;
1197
1204
  `;
1198
1205
  var Blocker = styled_components_default.div.attrs({
1199
- "data-splunk-visualization-version": "28.6.0 - 92427899a"
1206
+ "data-splunk-visualization-version": "28.8.0 - 633c53372"
1200
1207
  })`
1201
1208
  position: relative;
1202
1209
  width: 100%;
@@ -1277,7 +1284,7 @@ var withFixedSizeContainer = (Viz) => {
1277
1284
  FixSizeItem,
1278
1285
  {
1279
1286
  "data-test": "fix-size-item",
1280
- "data-splunk-visualization-version": "28.6.0 - 92427899a",
1287
+ "data-splunk-visualization-version": "28.8.0 - 633c53372",
1281
1288
  width,
1282
1289
  height,
1283
1290
  backgroundColor
@@ -3247,18 +3254,6 @@ var getTextOverflowType = (columnFormat, columnId, tableFormat, currentColumn, d
3247
3254
  }
3248
3255
  return (tableFormat == null ? void 0 : tableFormat.textOverflow) || defaultValue;
3249
3256
  };
3250
- var getTextOverflow = (columnFormat, columnId, tableFormat, currentColumn) => {
3251
- const columnTextOverflow = getAttributeFromColumnFormat(
3252
- "textOverflow",
3253
- columnFormat,
3254
- columnId,
3255
- currentColumn
3256
- );
3257
- if (columnTextOverflow) {
3258
- return columnTextOverflow;
3259
- }
3260
- return tableFormat == null ? void 0 : tableFormat.textOverflow;
3261
- };
3262
3257
  var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInternalFields) => {
3263
3258
  const ret = {
3264
3259
  key: generateKey(value, String(i)),
@@ -3274,10 +3269,8 @@ var generateHeader = (value, columnId, i, columnFormat, tableFormat, showInterna
3274
3269
  const headerAlign = getColumnFormatHeaderAlign(columnFormat, columnId, value) || getTableFormatHeaderAlign(tableFormat) || "left";
3275
3270
  ret.align = headerAlign;
3276
3271
  ret.truncate = true;
3277
- const textOverflow = getTextOverflow(columnFormat, columnId, tableFormat, value);
3278
- if (textOverflow) {
3279
- ret.textOverflowType = textOverflow;
3280
- }
3272
+ const explicitTextOverflow = getAttributeFromColumnFormat("textOverflow", columnFormat, columnId, value) || (tableFormat == null ? void 0 : tableFormat.textOverflow);
3273
+ ret.textOverflowType = explicitTextOverflow || (/\s/.test(value) ? "break-word" : "ellipsis");
3281
3274
  return ret;
3282
3275
  };
3283
3276
  var getColumnFormatAlign = (columnFormat, currentColumn, currentRow) => {
@@ -3908,7 +3901,7 @@ var defaultImport45 = __toESM(require("@splunk/react-ui/Popover"));
3908
3901
  __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
3909
3902
  var Popover_default = "default" in defaultImport45 ? defaultImport45.default : defaultImport45;
3910
3903
 
3911
- // src/SparkLine/SparkLine.jsx
3904
+ // src/SparkLine/SparkLine.tsx
3912
3905
  var StyledSvg = styled_components_default.svg`
3913
3906
  /* For fixing IE11 shows overflow part line issue */
3914
3907
  overflow: hidden;
@@ -3920,233 +3913,262 @@ var StyledTooltip = styled_components_default.div`
3920
3913
  min-width: 20px;
3921
3914
  `;
3922
3915
  var preventDefault = (e) => e.preventDefault();
3923
- var _SparkLine = class _SparkLine extends react_exports.Component {
3924
- constructor(props, ...rest) {
3925
- super(props, ...rest);
3926
- __publicField(this, "handleCursorMount", (el) => {
3927
- this.setState({
3928
- anchor: el
3929
- });
3930
- });
3931
- this.state = {
3932
- anchor: null,
3933
- activeIndex: 0,
3934
- hoveredIndex: null,
3935
- componentIsFocused: false
3936
- };
3937
- this.titleId = (0, id_exports.createDOMID)("sparkline-title");
3938
- this.pointRefs = [];
3939
- this.containerRef = react_default.createRef();
3940
- this.handleKeyDown = this.handleKeyDown.bind(this);
3941
- this.handleMouseOver = this.handleMouseOver.bind(this);
3942
- this.handleMouseLeave = this.handleMouseLeave.bind(this);
3943
- this.handleFocus = this.handleFocus.bind(this);
3944
- this.handleBlur = this.handleBlur.bind(this);
3945
- }
3946
- handleFocus(event) {
3947
- const { target } = event;
3948
- const { pointIndex: pointIndexStr } = target.dataset || {};
3949
- const { activeIndex, componentIsFocused, hoveredIndex } = this.state;
3950
- if (pointIndexStr !== void 0) {
3951
- const pointIndex = Number.parseInt(pointIndexStr, 10);
3952
- if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
3953
- this.setState({
3954
- activeIndex: pointIndex,
3955
- hoveredIndex: null,
3956
- componentIsFocused: true
3957
- });
3916
+ var PROP_KEYS = [
3917
+ "acceptNull",
3918
+ "data",
3919
+ "elementRef",
3920
+ "endDotCount",
3921
+ "endDotFillColor",
3922
+ "endDotRadius",
3923
+ "endDotStroke",
3924
+ "endDotStrokeWidth",
3925
+ "fillColor",
3926
+ "fillOpacity",
3927
+ "cursorStroke",
3928
+ "cursorStrokeWidth",
3929
+ "cursorStrokeLinecap",
3930
+ "cursorStrokeDasharray",
3931
+ "height",
3932
+ "isArea",
3933
+ "lineColor",
3934
+ "lineLength",
3935
+ "lineStrokeWidth",
3936
+ "showEndDot",
3937
+ "showTooltip",
3938
+ "yMax",
3939
+ "yMin",
3940
+ "width",
3941
+ "title"
3942
+ ];
3943
+ var SparkLineInner = (_a) => {
3944
+ var _b = _a, {
3945
+ acceptNull = false,
3946
+ data = [],
3947
+ elementRef,
3948
+ endDotCount = 0,
3949
+ endDotFillColor = "white",
3950
+ endDotRadius = 0,
3951
+ endDotStroke = "black",
3952
+ endDotStrokeWidth = 0,
3953
+ fillColor = "#65a637",
3954
+ fillOpacity = ".1",
3955
+ cursorStroke = "#5184AF",
3956
+ cursorStrokeWidth = 3,
3957
+ cursorStrokeLinecap = "square",
3958
+ cursorStrokeDasharray = "1, 5",
3959
+ height,
3960
+ isArea = false,
3961
+ lineColor = "#65a637",
3962
+ lineLength,
3963
+ lineStrokeWidth = 1,
3964
+ showEndDot = false,
3965
+ showTooltip = true,
3966
+ yMax,
3967
+ yMin,
3968
+ width,
3969
+ title
3970
+ } = _b, restProps = __objRest(_b, [
3971
+ "acceptNull",
3972
+ "data",
3973
+ "elementRef",
3974
+ "endDotCount",
3975
+ "endDotFillColor",
3976
+ "endDotRadius",
3977
+ "endDotStroke",
3978
+ "endDotStrokeWidth",
3979
+ "fillColor",
3980
+ "fillOpacity",
3981
+ "cursorStroke",
3982
+ "cursorStrokeWidth",
3983
+ "cursorStrokeLinecap",
3984
+ "cursorStrokeDasharray",
3985
+ "height",
3986
+ "isArea",
3987
+ "lineColor",
3988
+ "lineLength",
3989
+ "lineStrokeWidth",
3990
+ "showEndDot",
3991
+ "showTooltip",
3992
+ "yMax",
3993
+ "yMin",
3994
+ "width",
3995
+ "title"
3996
+ ]);
3997
+ const [anchor, setAnchor] = (0, react_exports.useState)(null);
3998
+ const [activeIndex, setActiveIndex] = (0, react_exports.useState)(0);
3999
+ const [hoveredIndex, setHoveredIndex] = (0, react_exports.useState)(null);
4000
+ const [componentIsFocused, setComponentIsFocused] = (0, react_exports.useState)(false);
4001
+ const titleId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("sparkline-title"), []);
4002
+ const pointRefs = (0, react_exports.useRef)([]);
4003
+ const containerRef = (0, react_exports.useRef)(null);
4004
+ const fillNull = (0, react_exports.useCallback)(() => data.map((value) => value != null ? value : 0), [data]);
4005
+ const getMax = (0, react_exports.useCallback)(() => {
4006
+ const dataMax = () => acceptNull ? (0, lodash_exports.max)(fillNull()) : (0, lodash_exports.max)(data);
4007
+ return yMax != null ? yMax : dataMax();
4008
+ }, [acceptNull, data, fillNull, yMax]);
4009
+ const getMin = (0, react_exports.useCallback)(() => {
4010
+ const dataMin = () => acceptNull ? (0, lodash_exports.min)(fillNull()) : (0, lodash_exports.min)(data);
4011
+ return yMin != null ? yMin : dataMin();
4012
+ }, [acceptNull, data, fillNull, yMin]);
4013
+ const getXUnit = (0, react_exports.useCallback)(
4014
+ (xMargin2) => {
4015
+ const xUnit = (width - xMargin2 * 2) / (data.length > 1 ? data.length - 1 : 1);
4016
+ return Math.max(0, xUnit);
4017
+ },
4018
+ [data.length, width]
4019
+ );
4020
+ const getYUnit = (0, react_exports.useCallback)(
4021
+ (yMargin2) => {
4022
+ const maxValue = getMax();
4023
+ const minValue = getMin();
4024
+ const yUnit = (height - yMargin2 * 2) / (maxValue - minValue || 2);
4025
+ return Math.max(0, yUnit);
4026
+ },
4027
+ [getMax, getMin, height]
4028
+ );
4029
+ const getSegmentSets = (0, react_exports.useCallback)(
4030
+ (segmentData, points2) => {
4031
+ const lines = [];
4032
+ const isolatedPoints = [];
4033
+ let currentLine = [];
4034
+ for (const [idx, p] of segmentData.entries()) {
4035
+ if (!acceptNull && (0, lodash_exports.isNull)(p)) {
4036
+ if (currentLine.length > 1) {
4037
+ lines.push(currentLine);
4038
+ } else if (currentLine.length === 1) {
4039
+ isolatedPoints.push(currentLine[0]);
4040
+ }
4041
+ currentLine = [];
4042
+ } else {
4043
+ currentLine.push(points2[idx]);
4044
+ }
3958
4045
  }
3959
- } else if (this.pointRefs.length > 0) {
3960
- const indexToFocus = activeIndex ? Math.min(this.pointRefs.length - 1, activeIndex) : 0;
3961
- this.pointRefs[indexToFocus].focus();
3962
- }
3963
- }
3964
- handleBlur(event) {
3965
- if (this.containerRef.current && !this.containerRef.current.contains(event.relatedTarget)) {
3966
- this.setState({ componentIsFocused: false });
3967
- }
3968
- }
3969
- handleKeyDown(event) {
3970
- const { data } = this.props;
3971
- const { activeIndex } = this.state;
3972
- const numPoints = data.length;
3973
- if (numPoints === 0) {
3974
- return;
3975
- }
3976
- const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
3977
- if (!allowedKeys.includes(event.key)) {
3978
- return;
4046
+ if (currentLine.length > 1) {
4047
+ lines.push(currentLine);
4048
+ } else if (currentLine.length === 1) {
4049
+ isolatedPoints.push(currentLine[0]);
4050
+ }
4051
+ return { lines, isolatedPoints };
4052
+ },
4053
+ [acceptNull]
4054
+ );
4055
+ const dataToPoints = (0, react_exports.useCallback)(
4056
+ (xMargin2, yMargin2) => {
4057
+ const xUnit = getXUnit(xMargin2);
4058
+ const yUnit = getYUnit(yMargin2);
4059
+ const maxValue = getMax();
4060
+ const minValue = getMin();
4061
+ return data.map((val, idx) => ({
4062
+ x: idx * xUnit + xMargin2,
4063
+ y: maxValue === minValue ? yUnit + yMargin2 : (maxValue - val) * yUnit + yMargin2
4064
+ })).map((p) => [p.x, p.y]);
4065
+ },
4066
+ [data, getMax, getMin, getXUnit, getYUnit]
4067
+ );
4068
+ const handleFocus = (0, react_exports.useCallback)(
4069
+ (event) => {
4070
+ const { target } = event;
4071
+ const { pointIndex: pointIndexStr } = target.dataset || {};
4072
+ if (pointIndexStr !== void 0) {
4073
+ const pointIndex = Number.parseInt(pointIndexStr, 10);
4074
+ if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
4075
+ setActiveIndex(pointIndex);
4076
+ setHoveredIndex(null);
4077
+ setComponentIsFocused(true);
4078
+ }
4079
+ } else if (pointRefs.current.length > 0) {
4080
+ const indexToFocus = activeIndex ? Math.min(pointRefs.current.length - 1, activeIndex) : 0;
4081
+ pointRefs.current[indexToFocus].focus();
4082
+ }
4083
+ },
4084
+ [activeIndex, componentIsFocused, hoveredIndex]
4085
+ );
4086
+ const handleBlur = (0, react_exports.useCallback)((event) => {
4087
+ if (containerRef.current && !containerRef.current.contains(event.relatedTarget)) {
4088
+ setComponentIsFocused(false);
3979
4089
  }
3980
- let newIndex;
3981
- switch (event.key) {
3982
- case "Home":
4090
+ }, []);
4091
+ const handleKeyDown = (0, react_exports.useCallback)(
4092
+ (event) => {
4093
+ const numPoints = data.length;
4094
+ const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
4095
+ if (!allowedKeys.includes(event.key)) {
4096
+ return;
4097
+ }
4098
+ let newIndex;
4099
+ if (event.key === "Home") {
3983
4100
  newIndex = 0;
3984
- break;
3985
- case "End":
4101
+ } else if (event.key === "End") {
3986
4102
  newIndex = numPoints - 1;
3987
- break;
3988
- case "ArrowLeft":
4103
+ } else if (event.key === "ArrowLeft") {
3989
4104
  newIndex = Math.max(0, activeIndex - 1);
3990
- break;
3991
- case "ArrowRight":
4105
+ } else {
3992
4106
  newIndex = Math.min(numPoints - 1, activeIndex + 1);
3993
- break;
3994
- default:
3995
- return;
3996
- }
3997
- if (newIndex !== activeIndex) {
3998
- event.preventDefault();
3999
- if (this.pointRefs[newIndex]) {
4000
- this.pointRefs[newIndex].focus();
4001
4107
  }
4002
- }
4003
- }
4004
- handleMouseOver(event) {
4005
- const pointIndexStr = event.target.dataset && event.target.dataset.pointIndex;
4006
- if (pointIndexStr !== void 0) {
4007
- const pointIndex = Number.parseInt(pointIndexStr, 10);
4008
- if (this.state.hoveredIndex !== pointIndex) {
4009
- this.setState({ hoveredIndex: pointIndex });
4108
+ if (newIndex !== activeIndex) {
4109
+ event.preventDefault();
4110
+ if (pointRefs.current[newIndex]) {
4111
+ pointRefs.current[newIndex].focus();
4112
+ }
4010
4113
  }
4011
- }
4012
- }
4013
- handleMouseLeave() {
4014
- if (this.state.hoveredIndex !== null) {
4015
- this.setState({ hoveredIndex: null });
4016
- }
4017
- }
4018
- getMax() {
4019
- const { data, acceptNull, yMax } = this.props;
4020
- const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull()) : (0, lodash_exports.max)(data);
4021
- return yMax === void 0 ? dataMax() : yMax;
4022
- }
4023
- getMin() {
4024
- const { data, acceptNull, yMin } = this.props;
4025
- const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
4026
- return yMin === void 0 ? dataMin() : yMin;
4027
- }
4028
- /**
4029
- * Gets unit value of x axis.
4030
- * @param {Number} xMargin - margin of x axis.
4031
- * @return {Number} unit value of x axis.
4032
- * @private
4033
- */
4034
- getXUnit(xMargin) {
4035
- const { data, width } = this.props;
4036
- const xUnit = (width - xMargin * 2) / (data.length > 1 ? data.length - 1 : 1);
4037
- return Math.max(0, xUnit);
4038
- }
4039
- /**
4040
- * Gets unit value of y axis.
4041
- * @param {String} yMargin - margin of y axis.
4042
- * @return {Number} unit value of y axis.
4043
- * @private
4044
- */
4045
- getYUnit(yMargin) {
4046
- const { height } = this.props;
4047
- const maxValue = this.getMax();
4048
- const minValue = this.getMin();
4049
- const yUnit = (height - yMargin * 2) / (maxValue - minValue || 2);
4050
- return Math.max(0, yUnit);
4051
- }
4052
- /**
4053
- * Get a list of arrays of points for drawing lines, based on acceptNull property
4054
- * @method getSegmentSets
4055
- * @param {Array} data
4056
- * @param {Array} points
4057
- * @returns {Object} Object containing lines (arrays of points for polylines) and isolatedPoints (single points surrounded by nulls)
4058
- */
4059
- getSegmentSets(data, points) {
4060
- const { acceptNull } = this.props;
4061
- const lines = [];
4062
- const isolatedPoints = [];
4063
- let currentLine = [];
4064
- for (const [idx, p] of data.entries()) {
4065
- if (!acceptNull && (0, lodash_exports.isNull)(p)) {
4066
- if (currentLine.length > 1) {
4067
- lines.push(currentLine);
4068
- } else if (currentLine.length === 1) {
4069
- isolatedPoints.push(currentLine[0]);
4114
+ },
4115
+ [activeIndex, data.length]
4116
+ );
4117
+ const handleMouseOver = (0, react_exports.useCallback)(
4118
+ (event) => {
4119
+ var _a2;
4120
+ const pointIndexStr = (_a2 = event.target.dataset) == null ? void 0 : _a2.pointIndex;
4121
+ if (pointIndexStr !== void 0) {
4122
+ const pointIndex = Number.parseInt(pointIndexStr, 10);
4123
+ if (hoveredIndex !== pointIndex) {
4124
+ setHoveredIndex(pointIndex);
4070
4125
  }
4071
- currentLine = [];
4072
- } else {
4073
- currentLine.push(points[idx]);
4074
4126
  }
4127
+ },
4128
+ [hoveredIndex]
4129
+ );
4130
+ const handleMouseLeave = (0, react_exports.useCallback)(() => {
4131
+ if (hoveredIndex !== null) {
4132
+ setHoveredIndex(null);
4075
4133
  }
4076
- if (currentLine.length > 1) {
4077
- lines.push(currentLine);
4078
- } else if (currentLine.length === 1) {
4079
- isolatedPoints.push(currentLine[0]);
4080
- }
4081
- return { lines, isolatedPoints };
4082
- }
4083
- /**
4084
- * Utility for fill null value with number 0.
4085
- * @private
4086
- */
4087
- fillNull() {
4088
- const { data } = this.props;
4089
- return data.map((value) => value === null ? 0 : value);
4090
- }
4091
- /**
4092
- * Converts data to points in svg
4093
- * @param {Number} xMargin - margin of x axis.
4094
- * @param {Number} yMargin - margin of x axis.
4095
- * @return {Array} points coordination.
4096
- * @private
4097
- */
4098
- dataToPoints(xMargin, yMargin) {
4099
- const { data } = this.props;
4100
- const xUnit = this.getXUnit(xMargin);
4101
- const yUnit = this.getYUnit(yMargin);
4102
- const maxValue = this.getMax();
4103
- const minValue = this.getMin();
4104
- return data.map((val, idx) => ({
4105
- x: idx * xUnit + xMargin,
4106
- y: maxValue === minValue ? yUnit + yMargin : (maxValue - val) * yUnit + yMargin
4107
- })).map((p) => [p.x, p.y]);
4108
- }
4109
- /**
4110
- * Renders rect area for each datapoint for interactions and screen reader support
4111
- * @param {Array} points - array of points coordination.
4112
- * @param {Number} xMargin - margin of x axis.
4113
- * @return {Array} array of svg rect objects
4114
- * @private
4115
- */
4116
- renderRect(points, xMargin) {
4117
- const { data, height, showTooltip } = this.props;
4118
- const xUnit = this.getXUnit(xMargin);
4119
- return points.map((p, i) => (
4120
- /* eslint-disable react/no-array-index-key */
4121
- /* @__PURE__ */ react_default.createElement(
4122
- "rect",
4123
- {
4124
- key: `${i}_${p[0]}`,
4125
- role: "graphics-symbol",
4126
- "aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
4127
- "data-test": `rect-${i}`,
4128
- "data-point-index": i,
4129
- tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
4130
- ref: (el) => {
4131
- this.pointRefs[i] = el;
4132
- },
4133
- x: Math.max(0, p[0] - xUnit / 2),
4134
- y: 0,
4135
- width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
4136
- height,
4137
- style: { fillOpacity: 0 },
4138
- onMouseDown: preventDefault
4139
- }
4140
- )
4141
- ));
4142
- }
4143
- // Renders area chart
4144
- renderArea(points) {
4145
- const { data, fillColor, fillOpacity, height, isArea } = this.props;
4146
- if (!isArea || points.length === 0) {
4134
+ }, [hoveredIndex]);
4135
+ const handleCursorMount = (0, react_exports.useCallback)((el) => {
4136
+ setAnchor(el);
4137
+ }, []);
4138
+ const renderRect = (points2, xMargin2) => {
4139
+ const xUnit = getXUnit(xMargin2);
4140
+ return points2.map((p, i) => {
4141
+ var _a2;
4142
+ return (
4143
+ /* eslint-disable react/no-array-index-key */
4144
+ /* @__PURE__ */ react_default.createElement(
4145
+ "rect",
4146
+ {
4147
+ key: `${i}_${p[0]}`,
4148
+ role: "graphics-symbol",
4149
+ "aria-label": `Value: ${(_a2 = data[i]) != null ? _a2 : "N/A"}, point ${i + 1} of ${data.length}`,
4150
+ "data-test": `rect-${i}`,
4151
+ "data-point-index": i,
4152
+ tabIndex: showTooltip && activeIndex === i ? 0 : -1,
4153
+ ref: (el) => {
4154
+ pointRefs.current[i] = el;
4155
+ },
4156
+ x: Math.max(0, p[0] - xUnit / 2),
4157
+ y: 0,
4158
+ width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
4159
+ height,
4160
+ style: { fillOpacity: 0 },
4161
+ onMouseDown: preventDefault
4162
+ }
4163
+ )
4164
+ );
4165
+ });
4166
+ };
4167
+ const renderArea = (points2) => {
4168
+ if (!isArea || points2.length === 0) {
4147
4169
  return null;
4148
4170
  }
4149
- const { lines } = this.getSegmentSets(data, points);
4171
+ const { lines } = getSegmentSets(data, points2);
4150
4172
  const segments = lines.map(
4151
4173
  (s) => s.concat([
4152
4174
  [s.at(-1)[0], height],
@@ -4170,80 +4192,56 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4170
4192
  }
4171
4193
  }
4172
4194
  )));
4173
- }
4174
- renderCursor(currentPointX, shouldRender) {
4175
- const { cursorStroke, cursorStrokeWidth, cursorStrokeLinecap, cursorStrokeDasharray, height } = this.props;
4176
- return shouldRender && /* @__PURE__ */ react_default.createElement(
4177
- "line",
4178
- {
4179
- "data-test": "cursor",
4180
- ref: this.handleCursorMount,
4181
- x1: currentPointX,
4182
- y1: 0,
4183
- x2: currentPointX,
4184
- y2: height,
4185
- style: {
4186
- stroke: cursorStroke,
4187
- strokeWidth: cursorStrokeWidth,
4188
- strokeLinecap: cursorStrokeLinecap,
4189
- strokeDasharray: cursorStrokeDasharray
4190
- }
4195
+ };
4196
+ const renderCursor = (currentPointX2, shouldRender) => shouldRender && /* @__PURE__ */ react_default.createElement(
4197
+ "line",
4198
+ {
4199
+ "data-test": "cursor",
4200
+ ref: handleCursorMount,
4201
+ x1: currentPointX2,
4202
+ y1: 0,
4203
+ x2: currentPointX2,
4204
+ y2: height,
4205
+ style: {
4206
+ stroke: cursorStroke,
4207
+ strokeWidth: cursorStrokeWidth,
4208
+ strokeLinecap: cursorStrokeLinecap,
4209
+ strokeDasharray: cursorStrokeDasharray
4191
4210
  }
4192
- );
4193
- }
4194
- renderTooltip(tooltipValue, isOpen) {
4195
- const { anchor } = this.state;
4196
- const displayValue = tooltipValue === null ? "-" : tooltipValue;
4211
+ }
4212
+ );
4213
+ const renderTooltip = (tooltipValue2, isOpen) => {
4214
+ const displayValue = tooltipValue2 === null ? "-" : tooltipValue2;
4197
4215
  return /* @__PURE__ */ react_default.createElement(
4198
4216
  Popover_default,
4199
4217
  {
4200
4218
  "data-test": "tooltip",
4201
4219
  open: isOpen,
4202
4220
  anchor,
4203
- "data-test-value": tooltipValue,
4221
+ "data-test-value": tooltipValue2,
4204
4222
  appearance: "inverted",
4205
4223
  defaultPlacement: "above",
4206
4224
  animation: false
4207
4225
  },
4208
4226
  /* @__PURE__ */ react_default.createElement(StyledTooltip, null, displayValue)
4209
4227
  );
4210
- }
4211
- /**
4212
- * Renders one or more svg circles to highlight values on the sparkline
4213
- * @method renderEndDots
4214
- * @param {Array[Array[Number]]} points // x,y coordinates of values
4215
- * @param {Number} dotsToShow // number of end dots to display
4216
- * @param {Number} xMargin // used when calculating the dot radius
4217
- * @returns {Object} React representation of SVG group
4218
- * @private
4219
- */
4220
- renderEndDots(points, dotsToShow, xMargin) {
4221
- const { endDotFillColor, endDotRadius, endDotStroke, endDotStrokeWidth } = this.props;
4222
- return /* @__PURE__ */ react_default.createElement("g", null, points.slice(-dotsToShow).map((point) => /* @__PURE__ */ react_default.createElement(
4223
- "circle",
4224
- {
4225
- key: `end-dot${point[0]}${point[1]}`,
4226
- "data-test": "end-dot",
4227
- cx: point[0],
4228
- cy: point[1],
4229
- r: endDotRadius === 0 ? xMargin : endDotRadius,
4230
- style: {
4231
- fill: endDotFillColor,
4232
- stroke: endDotStroke,
4233
- strokeWidth: endDotStrokeWidth
4234
- }
4228
+ };
4229
+ const renderEndDots = (points2, dotsToShow2, xMargin2) => /* @__PURE__ */ react_default.createElement("g", null, points2.slice(-dotsToShow2).map((point) => /* @__PURE__ */ react_default.createElement(
4230
+ "circle",
4231
+ {
4232
+ key: `end-dot${point[0]}${point[1]}`,
4233
+ "data-test": "end-dot",
4234
+ cx: point[0],
4235
+ cy: point[1],
4236
+ r: endDotRadius === 0 ? xMargin2 : endDotRadius,
4237
+ style: {
4238
+ fill: endDotFillColor,
4239
+ stroke: endDotStroke,
4240
+ strokeWidth: endDotStrokeWidth
4235
4241
  }
4236
- )));
4237
- }
4238
- /**
4239
- * Renders circles for isolated points (single data points surrounded by nulls)
4240
- * These would otherwise be invisible since a line requires at least 2 points
4241
- * @method renderIsolatedPoints
4242
- * @param {Array} isolatedPoints - Array of [x, y] coordinates for isolated points
4243
- * @returns {Object} SVG Group of circles
4244
- */
4245
- renderIsolatedPoints(isolatedPoints) {
4246
- const { lineColor, lineStrokeWidth } = this.props;
4242
+ }
4243
+ )));
4244
+ const renderIsolatedPoints = (isolatedPoints) => {
4247
4245
  if (!isolatedPoints || isolatedPoints.length === 0) {
4248
4246
  return null;
4249
4247
  }
@@ -4261,20 +4259,10 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4261
4259
  }
4262
4260
  }
4263
4261
  )));
4264
- }
4265
- /**
4266
- * Renders the line(s) above the area graph
4267
- * @method renderPolyline
4268
- * @param {Array} points
4269
- * @returns {Object} SVG Group of polylines and isolated points
4270
- */
4271
- renderPolyline(points) {
4272
- const { data, lineColor, lineLength, lineStrokeWidth } = this.props;
4273
- const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points.length;
4274
- const { lines, isolatedPoints } = this.getSegmentSets(
4275
- data.slice(-linePoints),
4276
- points.slice(-linePoints)
4277
- );
4262
+ };
4263
+ const renderPolyline = (points2) => {
4264
+ const linePoints = (0, lodash_exports.isFinite)(lineLength) && lineLength > 0 ? lineLength : points2.length;
4265
+ const { lines, isolatedPoints } = getSegmentSets(data.slice(-linePoints), points2.slice(-linePoints));
4278
4266
  return /* @__PURE__ */ react_default.createElement("g", { "data-test": "sparkline" }, lines.map((lineData) => /* @__PURE__ */ react_default.createElement(
4279
4267
  "polyline",
4280
4268
  {
@@ -4289,10 +4277,18 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4289
4277
  },
4290
4278
  points: lineData.join(" ")
4291
4279
  }
4292
- )), this.renderIsolatedPoints(isolatedPoints));
4293
- }
4294
- getInteractionState({ data, points, showTooltip, activeIndex, hoveredIndex, componentIsFocused }) {
4295
- if (!showTooltip) {
4280
+ )), renderIsolatedPoints(isolatedPoints));
4281
+ };
4282
+ const getInteractionState = ({
4283
+ interactionData,
4284
+ points: interactionPoints,
4285
+ interactionShowTooltip,
4286
+ interactionActiveIndex,
4287
+ interactionHoveredIndex,
4288
+ interactionComponentIsFocused
4289
+ }) => {
4290
+ var _a2;
4291
+ if (!interactionShowTooltip) {
4296
4292
  return {
4297
4293
  currentPointX: null,
4298
4294
  tooltipValue: null,
@@ -4300,200 +4296,94 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
4300
4296
  interactiveProps: {}
4301
4297
  };
4302
4298
  }
4303
- const interactiveProps = {
4304
- onKeyDown: this.handleKeyDown,
4305
- onMouseOver: this.handleMouseOver,
4306
- onMouseLeave: this.handleMouseLeave,
4307
- onFocus: this.handleFocus,
4308
- onBlur: this.handleBlur
4299
+ const interactiveProps2 = {
4300
+ onKeyDown: handleKeyDown,
4301
+ onMouseOver: handleMouseOver,
4302
+ onMouseLeave: handleMouseLeave,
4303
+ onFocus: handleFocus,
4304
+ onBlur: handleBlur
4309
4305
  };
4310
- const isHovered = hoveredIndex !== null;
4311
- const shouldDisplayInteractiveElements = (isHovered || componentIsFocused) && data.length > 0;
4306
+ const isHovered = interactionHoveredIndex !== null;
4307
+ const shouldDisplayInteractiveElements = (isHovered || interactionComponentIsFocused) && interactionData.length > 0;
4312
4308
  if (!shouldDisplayInteractiveElements) {
4313
4309
  return {
4314
4310
  currentPointX: null,
4315
4311
  tooltipValue: null,
4316
4312
  showCursorAndTooltip: false,
4317
- interactiveProps
4313
+ interactiveProps: interactiveProps2
4318
4314
  };
4319
4315
  }
4320
- const displayIndex = isHovered ? hoveredIndex : activeIndex;
4316
+ const displayIndex = isHovered ? interactionHoveredIndex : interactionActiveIndex;
4321
4317
  const isValidIndex = displayIndex !== null && displayIndex >= 0;
4322
- const withinBounds = isValidIndex && displayIndex < data.length && displayIndex < points.length;
4318
+ const withinBounds = isValidIndex && displayIndex < interactionData.length && displayIndex < interactionPoints.length;
4323
4319
  if (!withinBounds) {
4324
4320
  return {
4325
4321
  currentPointX: null,
4326
4322
  tooltipValue: null,
4327
4323
  showCursorAndTooltip: false,
4328
- interactiveProps
4324
+ interactiveProps: interactiveProps2
4329
4325
  };
4330
4326
  }
4331
- const displayPointCoords = points[displayIndex];
4332
- const currentPointX = displayPointCoords ? displayPointCoords[0] : null;
4333
- const tooltipValue = data[displayIndex];
4327
+ const displayPointCoords = interactionPoints[displayIndex];
4328
+ const currentPointX2 = (_a2 = displayPointCoords == null ? void 0 : displayPointCoords[0]) != null ? _a2 : null;
4329
+ const tooltipValue2 = interactionData[displayIndex];
4334
4330
  return {
4335
- currentPointX,
4336
- tooltipValue,
4337
- showCursorAndTooltip: currentPointX !== null,
4338
- interactiveProps
4331
+ currentPointX: currentPointX2,
4332
+ tooltipValue: tooltipValue2,
4333
+ showCursorAndTooltip: currentPointX2 !== null,
4334
+ interactiveProps: interactiveProps2
4339
4335
  };
4336
+ };
4337
+ if (data.length === 0) {
4338
+ return null;
4340
4339
  }
4341
- render() {
4342
- const {
4343
- data,
4344
- elementRef,
4345
- showTooltip,
4346
- showEndDot,
4347
- endDotRadius,
4348
- endDotStrokeWidth,
4349
- endDotCount,
4350
- height,
4351
- isArea,
4352
- lineStrokeWidth,
4353
- width,
4354
- title
4355
- } = this.props;
4356
- const { activeIndex, hoveredIndex, componentIsFocused } = this.state;
4357
- if (data.length === 0) {
4340
+ if (pointRefs.current.length !== data.length) {
4341
+ pointRefs.current.length = data.length;
4342
+ }
4343
+ const xMargin = endDotRadius + endDotStrokeWidth / 2;
4344
+ const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
4345
+ const points = dataToPoints(xMargin, yMargin);
4346
+ const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
4347
+ const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = getInteractionState({
4348
+ interactionData: data,
4349
+ points,
4350
+ interactionShowTooltip: showTooltip,
4351
+ interactionActiveIndex: activeIndex,
4352
+ interactionHoveredIndex: hoveredIndex,
4353
+ interactionComponentIsFocused: componentIsFocused
4354
+ });
4355
+ const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
4356
+ return /* @__PURE__ */ react_default.createElement(
4357
+ "div",
4358
+ __spreadValues(__spreadValues({
4359
+ "data-test": "line",
4360
+ "data-test-type": isArea ? "area" : "line",
4361
+ ref: (el) => {
4362
+ containerRef.current = el;
4363
+ if (typeof elementRef === "function") {
4364
+ elementRef(el);
4365
+ } else if (elementRef && typeof elementRef === "object") {
4366
+ elementRef.current = el;
4367
+ }
4368
+ }
4369
+ }, interactiveProps), (0, lodash_exports.omit)(restProps, PROP_KEYS)),
4370
+ /* @__PURE__ */ react_default.createElement(StyledSvg, { height, width, "aria-labelledby": titleId, "data-test": "sparkline-svg" }, /* @__PURE__ */ react_default.createElement("title", { id: titleId, "data-test": "sparkline-title" }, ariaLabel), /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? renderCursor(currentPointX, showCursorAndTooltip) : null, renderPolyline(points), renderArea(points), dotsToShow ? renderEndDots(points, dotsToShow, xMargin) : null, renderRect(points, xMargin), showTooltip ? renderTooltip(tooltipValue, showCursorAndTooltip) : null))
4371
+ );
4372
+ };
4373
+ var SparkLine = (_a) => {
4374
+ var _b = _a, { data = [] } = _b, props = __objRest(_b, ["data"]);
4375
+ if (true) {
4376
+ if (!Array.isArray(data)) {
4377
+ console.error("Data provided to SparkLine must be an array.");
4358
4378
  return null;
4359
4379
  }
4360
- if (this.pointRefs.length !== data.length) {
4361
- this.pointRefs.length = data.length;
4380
+ if (!data.every((value) => value === null || (0, lodash_exports.isFinite)(value))) {
4381
+ console.error("Data provided to SparkLine must contain finite numbers or null.");
4382
+ return null;
4362
4383
  }
4363
- const xMargin = endDotRadius + endDotStrokeWidth / 2;
4364
- const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
4365
- const points = this.dataToPoints(xMargin, yMargin);
4366
- const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
4367
- const { currentPointX, tooltipValue, showCursorAndTooltip, interactiveProps } = this.getInteractionState({
4368
- data,
4369
- points,
4370
- showTooltip,
4371
- activeIndex,
4372
- hoveredIndex,
4373
- componentIsFocused
4374
- });
4375
- const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
4376
- return /* @__PURE__ */ react_default.createElement(
4377
- "div",
4378
- __spreadValues(__spreadValues({
4379
- "data-test": "line",
4380
- "data-test-type": isArea ? "area" : "line",
4381
- ref: (el) => {
4382
- this.containerRef.current = el;
4383
- if (typeof elementRef === "function") {
4384
- elementRef(el);
4385
- } else if (elementRef && typeof elementRef === "object") {
4386
- elementRef.current = el;
4387
- }
4388
- }
4389
- }, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
4390
- /* @__PURE__ */ react_default.createElement(
4391
- StyledSvg,
4392
- {
4393
- height,
4394
- width,
4395
- "aria-labelledby": this.titleId,
4396
- "data-test": "sparkline-svg"
4397
- },
4398
- /* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
4399
- /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
4400
- )
4401
- );
4402
4384
  }
4385
+ return /* @__PURE__ */ react_default.createElement(SparkLineInner, __spreadValues({ data }, props));
4403
4386
  };
4404
- __publicField(_SparkLine, "propTypes", {
4405
- /**
4406
- * If true, data can contain `null` as a value and is treated as `0`. If false, this throws error when data contains `null`.
4407
- */
4408
- acceptNull: prop_types_default.bool,
4409
- /** Array of numbers. These data numbers are converted to points and show on sparkline. */
4410
- data: (props) => {
4411
- if (!(0, lodash_exports.isArray)(props.data)) {
4412
- return new Error("Data provided to Sparkline must be an array.");
4413
- }
4414
- if (props.acceptNull && !props.data.every((value) => (0, lodash_exports.isNull)(value) || (0, lodash_exports.isFinite)(value))) {
4415
- return new Error("Data provided to Sparkline must be finite numbers or null.");
4416
- }
4417
- if (!props.acceptNull && !props.data.every((value) => (0, lodash_exports.isFinite)(value))) {
4418
- return new Error("Data provided to Sparkline must be finite numbers.");
4419
- }
4420
- return null;
4421
- },
4422
- /** A React ref which is set to the DOM element when the component mounts and `null` when it unmounts. */
4423
- elementRef: prop_types_default.oneOfType([prop_types_default.func, prop_types_default.object]),
4424
- /** Sets the number of end dots to display. When showEndDot is set to `true`, endDotCount is at least 1. If set to a positive value, this overrides showEndDot. */
4425
- endDotCount: prop_types_default.number,
4426
- /** Fills color to the end dot. */
4427
- endDotFillColor: prop_types_default.string,
4428
- /**
4429
- * Sets end dot radius. End dot radius must be less than or equal to the margin. By default, its value equals the margin.
4430
- */
4431
- endDotRadius: prop_types_default.number,
4432
- /** Sets end dot circle stroke color. */
4433
- endDotStroke: prop_types_default.string,
4434
- /** Sets end dot circle stroke width in pixels. */
4435
- endDotStrokeWidth: prop_types_default.number,
4436
- /** Fills color to area. */
4437
- fillColor: prop_types_default.string,
4438
- /** Fills opacity to area. Value must be in 0 ~ 1. */
4439
- fillOpacity: prop_types_default.string,
4440
- /** Sets cursor stroke color. */
4441
- cursorStroke: prop_types_default.string,
4442
- /** Sets cursor stroke width in pixels. */
4443
- cursorStrokeWidth: prop_types_default.number,
4444
- /** Sets cursor line cap style. */
4445
- cursorStrokeLinecap: prop_types_default.oneOf(["butt", "round", "square"]),
4446
- /** Sets cursor dash array style. */
4447
- cursorStrokeDasharray: prop_types_default.string,
4448
- /**
4449
- * Container height. If this value is specified, sparkline calculates the size using this height. If height isn't specified,
4450
- * sparkline figures out the container height by itself.
4451
- */
4452
- height: prop_types_default.number.isRequired,
4453
- /** When set to `true`, sparkline shows as area. */
4454
- isArea: prop_types_default.bool,
4455
- /** The sparkline line color. */
4456
- lineColor: prop_types_default.string,
4457
- /** Allows user to draw only the last data points for the line. */
4458
- lineLength: prop_types_default.number,
4459
- /** The sparkline line stroke width in pixels. */
4460
- lineStrokeWidth: prop_types_default.number,
4461
- /** Enable to show end dot. */
4462
- showEndDot: prop_types_default.bool,
4463
- /** Enable to show tooltip. */
4464
- showTooltip: prop_types_default.bool,
4465
- /** Sets the data value range and maximum value shown on sparkline. */
4466
- yMax: prop_types_default.number,
4467
- /** Sets the data value range and minimum value shown on sparkline. */
4468
- yMin: prop_types_default.number,
4469
- /**
4470
- * The width of the container.
4471
- */
4472
- width: prop_types_default.number.isRequired,
4473
- /** Sets the a11y title text on sparkline. */
4474
- title: prop_types_default.string
4475
- });
4476
- __publicField(_SparkLine, "defaultProps", {
4477
- acceptNull: false,
4478
- data: [],
4479
- showTooltip: true,
4480
- endDotCount: 0,
4481
- showEndDot: false,
4482
- endDotRadius: 0,
4483
- endDotFillColor: "white",
4484
- endDotStroke: "black",
4485
- endDotStrokeWidth: 0,
4486
- fillColor: "#65a637",
4487
- fillOpacity: ".1",
4488
- cursorStroke: "#5184AF",
4489
- cursorStrokeWidth: 3,
4490
- cursorStrokeLinecap: "square",
4491
- cursorStrokeDasharray: "1, 5",
4492
- isArea: false,
4493
- lineColor: "#65a637",
4494
- lineStrokeWidth: 1
4495
- });
4496
- var SparkLine = _SparkLine;
4497
4387
  var SparkLine_default = SparkLine;
4498
4388
 
4499
4389
  // src/Table/cells/SparklineCell.tsx
@@ -4587,6 +4477,72 @@ var SparklineCell = ({
4587
4477
  };
4588
4478
  SparklineCell.displayName = "SparklineCell";
4589
4479
 
4480
+ // src/common/hooks/useDynamicHeight.ts
4481
+ var PAGINATOR_CONTAINER_HEIGHT = 38;
4482
+ var PAGINATOR_SPACING = 5;
4483
+ var useDynamicHeight = ({
4484
+ dynamicHeight,
4485
+ onRequestHeight,
4486
+ isPaging,
4487
+ rows,
4488
+ expandedRowJson
4489
+ }) => {
4490
+ const containerRef = (0, react_exports.useRef)(null);
4491
+ const containerRefInner = (0, react_exports.useRef)(null);
4492
+ const suiTableRef = (0, react_exports.useRef)(null);
4493
+ const lastReportedHeight = (0, react_exports.useRef)(null);
4494
+ const lastContentHeightRef = (0, react_exports.useRef)(void 0);
4495
+ const prevRowsRef = (0, react_exports.useRef)(rows);
4496
+ const prevExpandedRef = (0, react_exports.useRef)(expandedRowJson);
4497
+ (0, react_exports.useEffect)(() => {
4498
+ var _a, _b;
4499
+ if (!dynamicHeight || !onRequestHeight) {
4500
+ return void 0;
4501
+ }
4502
+ const contentChanged = prevRowsRef.current !== rows || prevExpandedRef.current !== expandedRowJson;
4503
+ prevRowsRef.current = rows;
4504
+ prevExpandedRef.current = expandedRowJson;
4505
+ if (contentChanged) {
4506
+ lastReportedHeight.current = null;
4507
+ }
4508
+ const containerEl = containerRef.current;
4509
+ const viewport = containerRefInner.current;
4510
+ const contentNode = (_b = (_a = suiTableRef.current) == null ? void 0 : _a.querySelector("table")) != null ? _b : null;
4511
+ const reportNaturalHeight = () => {
4512
+ var _a2, _b2;
4513
+ const rawPadding = containerEl ? Number.parseInt(getComputedStyle(containerEl).paddingTop, 10) : 0;
4514
+ const paddingOffset = (Number.isNaN(rawPadding) ? 0 : rawPadding) * 2;
4515
+ const paginatorChrome = isPaging ? PAGINATOR_CONTAINER_HEIGHT + PAGINATOR_SPACING : 0;
4516
+ const measuredHeight = (_b2 = (_a2 = contentNode == null ? void 0 : contentNode.scrollHeight) != null ? _a2 : viewport == null ? void 0 : viewport.scrollHeight) != null ? _b2 : 0;
4517
+ const naturalHeight = Math.ceil(measuredHeight + paddingOffset + paginatorChrome);
4518
+ lastContentHeightRef.current = naturalHeight;
4519
+ if (naturalHeight !== lastReportedHeight.current) {
4520
+ lastReportedHeight.current = naturalHeight;
4521
+ onRequestHeight(naturalHeight);
4522
+ }
4523
+ };
4524
+ if (!contentNode) {
4525
+ reportNaturalHeight();
4526
+ return void 0;
4527
+ }
4528
+ reportNaturalHeight();
4529
+ const observer = new ResizeObserver(reportNaturalHeight);
4530
+ observer.observe(contentNode);
4531
+ return () => observer.disconnect();
4532
+ }, [dynamicHeight, isPaging, rows, expandedRowJson, onRequestHeight]);
4533
+ (0, react_exports.useEffect)(() => {
4534
+ if (lastContentHeightRef.current === void 0) {
4535
+ return;
4536
+ }
4537
+ if (dynamicHeight) {
4538
+ onRequestHeight == null ? void 0 : onRequestHeight(lastContentHeightRef.current);
4539
+ } else {
4540
+ onRequestHeight == null ? void 0 : onRequestHeight(void 0);
4541
+ }
4542
+ }, [dynamicHeight, onRequestHeight]);
4543
+ return { containerRef, containerRefInner, suiTableRef };
4544
+ };
4545
+
4590
4546
  // src/common/utils/textUtils.ts
4591
4547
  var VIZ_FONT_FAMILY = "'Splunk Platform Sans', 'Splunk Data Sans', Roboto, Droid, 'Helvetica Neue', Helvetica, Arial, sans-serif";
4592
4548
 
@@ -4737,20 +4693,35 @@ var headerTextOverflowStyles = {
4737
4693
  `,
4738
4694
  anywhere: `
4739
4695
  word-break: break-all;
4740
- white-space: inherit;
4696
+ white-space: pre-wrap;
4697
+ text-overflow: clip;
4741
4698
  display: inline;
4742
4699
  `,
4743
- default: `
4744
- word-break: inherit;
4745
- word-wrap: inherit;
4746
- white-space: inherit;
4747
- display: inline;
4700
+ "break-word": `
4701
+ word-break: normal;
4702
+ overflow-wrap: normal;
4703
+ white-space: normal;
4704
+ overflow: hidden;
4705
+ text-overflow: ellipsis;
4706
+ display: block;
4748
4707
  `
4749
4708
  };
4750
4709
  var TableHeadCell = styled_components_default(Table_default.HeadCell)`
4751
- button > span {
4752
- ${(props) => headerTextOverflowStyles[props.textOverflowType] || headerTextOverflowStyles.default}
4753
- }
4710
+ ${(props) => {
4711
+ const type = props.textOverflowType;
4712
+ const styles = type && headerTextOverflowStyles[type];
4713
+ if (!styles) return "";
4714
+ const expandsHeader = type === "break-word" || type === "anywhere";
4715
+ return styled_components_exports.css`
4716
+ && :is(button, div) {
4717
+ min-height: 100%;
4718
+ ${expandsHeader ? "grid-template-rows: auto 1fr; height: auto;" : ""}
4719
+ }
4720
+ && :is(button, div) > span {
4721
+ ${styles}
4722
+ }
4723
+ `;
4724
+ }}
4754
4725
  `;
4755
4726
  var VizTableContainer = styled_components_default.div`
4756
4727
  box-sizing: border-box;
@@ -4775,8 +4746,6 @@ var VizTableContainer = styled_components_default.div`
4775
4746
  }
4776
4747
  `;
4777
4748
  VizTableContainer.displayName = "VizTableContainer";
4778
- var PAGINATOR_CONTAINER_HEIGHT = 38;
4779
- var PAGINATOR_SPACING = 5;
4780
4749
  var SUITableContainer = styled_components_default.div`
4781
4750
  & * {
4782
4751
  font-family: ${(props) => props.font};
@@ -4988,11 +4957,11 @@ var PureTable = (props) => {
4988
4957
  headerVisibility,
4989
4958
  font,
4990
4959
  fontSize,
4991
- showColumnAsExpandedJson
4960
+ showColumnAsExpandedJson,
4961
+ dynamicHeight,
4962
+ onRequestHeight
4992
4963
  } = _a;
4993
4964
  const [columns, setColumns] = react_exports.useState(columnFormat);
4994
- const containerRef = react_exports.useRef(null);
4995
- const containerRefInner = react_exports.useRef(null);
4996
4965
  const [isResizing, setResizing] = react_exports.useState(false);
4997
4966
  const firstRenderCount = react_exports.useRef(count);
4998
4967
  react_exports.useEffect(() => {
@@ -5019,6 +4988,13 @@ var PureTable = (props) => {
5019
4988
  () => expandedRowJson.some((rowJson) => rowJson.isExpandable),
5020
4989
  [expandedRowJson]
5021
4990
  );
4991
+ const { containerRef, containerRefInner, suiTableRef } = useDynamicHeight({
4992
+ dynamicHeight,
4993
+ onRequestHeight,
4994
+ isPaging,
4995
+ rows: tableBody.rows,
4996
+ expandedRowJson
4997
+ });
5022
4998
  const TableHead = useTableHead(headerVisibility);
5023
4999
  const debouncedDrilldown = react_exports.useMemo(
5024
5000
  () => debounce_default((e, payload) => {
@@ -5192,6 +5168,7 @@ var PureTable = (props) => {
5192
5168
  /* @__PURE__ */ react_exports.createElement(
5193
5169
  Table_default,
5194
5170
  {
5171
+ elementRef: suiTableRef,
5195
5172
  resizableFillLayout: true,
5196
5173
  headType: isHeaderHidden ? void 0 : "inline",
5197
5174
  rowExpansion: hasExpandableRows ? "multi" : "none",
@@ -5368,7 +5345,9 @@ PureTable.propTypes = {
5368
5345
  width: prop_types_exports.oneOfType([prop_types_exports.number]),
5369
5346
  onColumnFormatChange: prop_types_exports.func,
5370
5347
  font: prop_types_exports.string,
5371
- fontSize: prop_types_exports.string
5348
+ fontSize: prop_types_exports.string,
5349
+ dynamicHeight: prop_types_exports.bool,
5350
+ onRequestHeight: prop_types_exports.func
5372
5351
  };
5373
5352
  PureTable.defaultProps = {
5374
5353
  columnFormat: {},
@@ -5394,7 +5373,8 @@ PureTable.defaultProps = {
5394
5373
  width: 300,
5395
5374
  onColumnFormatChange: lodash_exports.noop,
5396
5375
  font: fontMap.proportional,
5397
- fontSize: fontSizeMap.default
5376
+ fontSize: fontSizeMap.default,
5377
+ dynamicHeight: false
5398
5378
  };
5399
5379
  PureTable.displayName = "VizTable";
5400
5380
  var PureTable_default = withEmptyTableMessage(FixedSizeContainer_default(PureTable));
@@ -5432,9 +5412,9 @@ var computeVizProps = (_a) => {
5432
5412
  const handleColumnFormatChange = (updatedColumnFormat) => {
5433
5413
  var _a3;
5434
5414
  const cloneOfExistingColumnFormat = __spreadValues({}, ((_a3 = vizProps == null ? void 0 : vizProps.options) == null ? void 0 : _a3.columnFormat) || {});
5435
- const keys2 = Object.keys(updatedColumnFormat);
5415
+ const keys = Object.keys(updatedColumnFormat);
5436
5416
  const values = Object.values(updatedColumnFormat);
5437
- keys2.forEach((key, index) => {
5417
+ keys.forEach((key, index) => {
5438
5418
  if (!cloneOfExistingColumnFormat[key]) {
5439
5419
  cloneOfExistingColumnFormat[key] = {};
5440
5420
  }