@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/Timeline.js CHANGED
@@ -875,7 +875,7 @@ var Cover = styled_components_default.div`
875
875
  bottom: 0;
876
876
  `;
877
877
  var Blocker = styled_components_default.div.attrs({
878
- "data-splunk-visualization-version": "28.6.0 - 92427899a"
878
+ "data-splunk-visualization-version": "28.8.0 - 633c53372"
879
879
  })`
880
880
  position: relative;
881
881
  width: 100%;
@@ -956,7 +956,7 @@ var withFixedSizeContainer = (Viz) => {
956
956
  FixSizeItem,
957
957
  {
958
958
  "data-test": "fix-size-item",
959
- "data-splunk-visualization-version": "28.6.0 - 92427899a",
959
+ "data-splunk-visualization-version": "28.8.0 - 633c53372",
960
960
  width,
961
961
  height,
962
962
  backgroundColor
@@ -3116,6 +3116,19 @@ var tooltipLocaleTimeFormat = (displaySeconds) => {
3116
3116
  year: "numeric"
3117
3117
  }, seconds);
3118
3118
  };
3119
+ var MAX_TOOLTIP_MOVE_TRANSITION_DISTANCE = 200;
3120
+ var isNearbyTooltipAnchor = ({
3121
+ anchorPoint,
3122
+ previousAnchorPoint
3123
+ }) => {
3124
+ if (!previousAnchorPoint) {
3125
+ return false;
3126
+ }
3127
+ const deltaX = anchorPoint.x - previousAnchorPoint.x;
3128
+ const deltaY = anchorPoint.y - previousAnchorPoint.y;
3129
+ const distance = Math.hypot(deltaX, deltaY);
3130
+ return distance > 0 && distance <= MAX_TOOLTIP_MOVE_TRANSITION_DISTANCE;
3131
+ };
3119
3132
  var applyCanvasScale = (u, scaleFactor) => {
3120
3133
  var _a;
3121
3134
  if (!((_a = u.ctx) == null ? void 0 : _a.canvas)) {
@@ -3163,9 +3176,22 @@ var ZoomContext_default = "default" in defaultImport39 ? defaultImport39.default
3163
3176
 
3164
3177
  // src/Timeline/PureTimeline/src/CursorPlugin.tsx
3165
3178
  var FIXED_LANE_HEIGHT = 32;
3166
- var MIN_BAR_WIDTH = 20;
3167
- var CIRCLE_X_OFFSET = 10;
3179
+ var MIN_BAR_WIDTH = 1;
3180
+ var MIN_BAR_HOVER_WIDTH = 6;
3168
3181
  var CIRCLE_LANE_SCALE_FACTOR = 0.85;
3182
+ var EVENT_VERTICAL_HIT_PADDING = FIXED_LANE_HEIGHT * (1 - CIRCLE_LANE_SCALE_FACTOR) / 2;
3183
+ var TIMELINE_TOOLTIP_WIDTH = 300;
3184
+ var shouldClearOnPointerExit = (event, chartContainer) => {
3185
+ const { relatedTarget } = event;
3186
+ if (event.currentTarget !== chartContainer && relatedTarget !== null) {
3187
+ return false;
3188
+ }
3189
+ if (relatedTarget instanceof Node && chartContainer.contains(relatedTarget)) {
3190
+ return false;
3191
+ }
3192
+ const { target: eventTarget } = event;
3193
+ return eventTarget instanceof Node && chartContainer.contains(eventTarget);
3194
+ };
3169
3195
  var CursorPlugin = (props) => {
3170
3196
  const {
3171
3197
  laneSeries,
@@ -3177,22 +3203,24 @@ var CursorPlugin = (props) => {
3177
3203
  setHighlightedLane,
3178
3204
  handleEventClick,
3179
3205
  tooltipRef,
3206
+ scrollContainerRef,
3180
3207
  locale,
3181
3208
  scaleFactor
3182
3209
  } = props;
3183
3210
  let previousTooltipContent = null;
3211
+ const clearTooltip = (chart) => {
3212
+ clearTooltipIfVisible({
3213
+ chart,
3214
+ tooltipRef,
3215
+ setHighlightedLane,
3216
+ setHighlightedEvent,
3217
+ setHighlightedCategory
3218
+ });
3219
+ };
3184
3220
  const handleMouseLeave = (u) => {
3185
3221
  const xCursorLine = u.root.querySelector(".u-cursor-x");
3186
3222
  xCursorLine.classList.add("u-off");
3187
- tooltipRef.current = {
3188
- visible: false,
3189
- overflow: false,
3190
- content: "",
3191
- meta: ""
3192
- };
3193
- setHighlightedLane(null);
3194
- setHighlightedEvent(null);
3195
- setHighlightedCategory(null);
3223
+ clearTooltip(u);
3196
3224
  };
3197
3225
  const handleClick2 = () => {
3198
3226
  if (tooltipRef.current.visible) {
@@ -3206,18 +3234,44 @@ var CursorPlugin = (props) => {
3206
3234
  return {
3207
3235
  hooks: {
3208
3236
  init: (u) => {
3237
+ var _a;
3209
3238
  const chartContainer = u.root;
3210
3239
  chartContainer.addEventListener("click", handleClick2);
3211
3240
  const pointerExitHandler = (e) => {
3212
- if (!chartContainer.contains(e.relatedTarget)) {
3241
+ if (shouldClearOnPointerExit(e, chartContainer)) {
3213
3242
  handleMouseLeave(u);
3214
3243
  }
3215
3244
  };
3245
+ const pointerMoveHandler = (e) => {
3246
+ if (!tooltipRef.current.visible || !tooltipRef.current.bounds) {
3247
+ return;
3248
+ }
3249
+ const rect = chartContainer.getBoundingClientRect();
3250
+ const dpr = globalThis.devicePixelRatio || 1;
3251
+ const cursorPosition = getCursorPosition({
3252
+ mouseEvent: e,
3253
+ rect,
3254
+ bbox: u.bbox,
3255
+ scaleFactor,
3256
+ dpr
3257
+ });
3258
+ if (!isCursorWithinBounds({ cursorPosition, bounds: tooltipRef.current.bounds })) {
3259
+ clearTooltip(u);
3260
+ }
3261
+ };
3262
+ const scrollContainer = (_a = scrollContainerRef == null ? void 0 : scrollContainerRef.current) != null ? _a : chartContainer.closest('[data-test="timeline-chart-scroll-area"]');
3263
+ const scrollHandler = () => {
3264
+ clearTooltip(u);
3265
+ };
3216
3266
  chartContainer.addEventListener("pointerleave", pointerExitHandler);
3267
+ document.addEventListener("pointermove", pointerMoveHandler, true);
3217
3268
  document.addEventListener("pointerout", pointerExitHandler, true);
3269
+ scrollContainer == null ? void 0 : scrollContainer.addEventListener("scroll", scrollHandler);
3218
3270
  return () => {
3219
3271
  chartContainer.removeEventListener("pointerleave", pointerExitHandler);
3272
+ document.removeEventListener("pointermove", pointerMoveHandler, true);
3220
3273
  document.removeEventListener("pointerout", pointerExitHandler, true);
3274
+ scrollContainer == null ? void 0 : scrollContainer.removeEventListener("scroll", scrollHandler);
3221
3275
  chartContainer.removeEventListener("click", handleClick2);
3222
3276
  };
3223
3277
  },
@@ -3225,12 +3279,11 @@ var CursorPlugin = (props) => {
3225
3279
  const mouseEvent = u.cursor.event;
3226
3280
  const xCursorLine = u.root.querySelector(".u-cursor-x");
3227
3281
  if (!mouseEvent) {
3228
- tooltipRef.current.visible = false;
3229
3282
  toggleCursorLine(xCursorLine, true);
3230
3283
  return;
3231
3284
  }
3232
3285
  const rect = u.root.getBoundingClientRect();
3233
- const dpr = window.devicePixelRatio || 1;
3286
+ const dpr = globalThis.devicePixelRatio || 1;
3234
3287
  const cursorPosition = getCursorPosition({
3235
3288
  mouseEvent,
3236
3289
  rect,
@@ -3241,13 +3294,7 @@ var CursorPlugin = (props) => {
3241
3294
  u.cursor.left = cursorPosition.x;
3242
3295
  u.cursor.top = cursorPosition.y;
3243
3296
  if (updateCursorLine(xCursorLine, cursorPosition, u, dpr)) {
3244
- clearTooltipIfVisible({
3245
- chart: u,
3246
- tooltipRef,
3247
- setHighlightedLane,
3248
- setHighlightedEvent,
3249
- setHighlightedCategory
3250
- });
3297
+ clearTooltip(u);
3251
3298
  return;
3252
3299
  }
3253
3300
  const tooltipState = getTooltipState({
@@ -3261,13 +3308,7 @@ var CursorPlugin = (props) => {
3261
3308
  chart: u
3262
3309
  });
3263
3310
  if (!tooltipState) {
3264
- clearTooltipIfVisible({
3265
- chart: u,
3266
- tooltipRef,
3267
- setHighlightedLane,
3268
- setHighlightedEvent,
3269
- setHighlightedCategory
3270
- });
3311
+ clearTooltip(u);
3271
3312
  return;
3272
3313
  }
3273
3314
  applyTooltipState({
@@ -3353,12 +3394,15 @@ function getTooltipState({
3353
3394
  if (!lane) {
3354
3395
  return null;
3355
3396
  }
3356
- const tooltip = adjustForOverflow({
3357
- tooltipX: hit.tooltipX,
3358
- tooltipY: hit.tooltipY,
3359
- event: hit.event,
3360
- plotRightEdge: chart.bbox.width / dpr
3361
- });
3397
+ const tooltip = {
3398
+ x: hit.anchorX,
3399
+ y: hit.anchorY,
3400
+ eventWidth: hit.eventWidth,
3401
+ eventHeight: hit.eventHeight,
3402
+ eventAnchorOffsetX: hit.eventAnchorOffsetX,
3403
+ bounds: hit.bounds,
3404
+ overflow: hit.anchorX + hit.eventWidth + TIMELINE_TOOLTIP_WIDTH / 2 > chart.bbox.width / dpr
3405
+ };
3362
3406
  const displaySeconds = durationPerTick < 6e4 && hit.event.duration !== 0;
3363
3407
  const content = buildTooltipContent({ lane, event: hit.event, locale, displaySeconds });
3364
3408
  const meta = buildTooltipMeta(hit.event);
@@ -3392,6 +3436,7 @@ function findEventHit({
3392
3436
  widthPerTick,
3393
3437
  xScaleMin
3394
3438
  }) {
3439
+ const candidates = [];
3395
3440
  for (let i = events.length - 1; i >= 0; i -= 1) {
3396
3441
  const event = events[i];
3397
3442
  const metrics = getEventMetrics({
@@ -3402,56 +3447,97 @@ function findEventHit({
3402
3447
  xScaleMin
3403
3448
  });
3404
3449
  if (metrics && hitTestEvent({ metrics, cursorPosition })) {
3405
- return {
3406
- event,
3407
- tooltipX: metrics.tooltipX,
3408
- tooltipY: metrics.tooltipY
3409
- };
3450
+ candidates.push({ event, metrics });
3410
3451
  }
3411
3452
  }
3412
- return null;
3453
+ if (candidates.length === 0) {
3454
+ return null;
3455
+ }
3456
+ const minWidthCandidates = candidates.filter(({ metrics }) => metrics.isMinWidthBar);
3457
+ const hit = minWidthCandidates.length ? getClosestMinWidthHit({ candidates: minWidthCandidates, cursorPosition }) : candidates[0];
3458
+ return {
3459
+ event: hit.event,
3460
+ anchorX: hit.metrics.anchorX,
3461
+ anchorY: hit.metrics.anchorY,
3462
+ eventWidth: hit.metrics.eventWidth,
3463
+ eventHeight: hit.metrics.eventHeight,
3464
+ eventAnchorOffsetX: hit.metrics.eventAnchorOffsetX,
3465
+ bounds: {
3466
+ xMin: hit.metrics.hitMin,
3467
+ xMax: hit.metrics.hitMax,
3468
+ yMin: hit.metrics.hitYMin,
3469
+ yMax: hit.metrics.hitYMax
3470
+ }
3471
+ };
3472
+ }
3473
+ function getClosestMinWidthHit({ candidates, cursorPosition }) {
3474
+ return candidates.reduce((closest, candidate) => {
3475
+ const closestDistance = Math.abs(cursorPosition.x - closest.metrics.anchorX);
3476
+ const candidateDistance = Math.abs(cursorPosition.x - candidate.metrics.anchorX);
3477
+ return candidateDistance < closestDistance ? candidate : closest;
3478
+ }, candidates[0]);
3413
3479
  }
3414
3480
  function getEventMetrics({ event, cursorSeriesIndex, durationPerTick, widthPerTick, xScaleMin }) {
3415
3481
  const xStartFraction = (event.start - xScaleMin) / durationPerTick;
3416
3482
  const xStartBase = xStartFraction * widthPerTick;
3417
3483
  const xStart = cursorSeriesIndex - 1 === 0 ? xStartBase + 2 : xStartBase;
3418
- if (event.duration === 0) {
3419
- const circleRadius = FIXED_LANE_HEIGHT * CIRCLE_LANE_SCALE_FACTOR / 2;
3484
+ const laneTop = (cursorSeriesIndex - 1) * FIXED_LANE_HEIGHT;
3485
+ const laneCenterY = laneTop + FIXED_LANE_HEIGHT / 2;
3486
+ const eventHeight = FIXED_LANE_HEIGHT * CIRCLE_LANE_SCALE_FACTOR;
3487
+ const eventTop = laneCenterY - eventHeight / 2;
3488
+ const eventBottom = eventTop + eventHeight;
3489
+ const hitYMin = eventTop - EVENT_VERTICAL_HIT_PADDING;
3490
+ const hitYMax = eventBottom + EVENT_VERTICAL_HIT_PADDING;
3491
+ if (event.duration === null || event.duration === 0) {
3492
+ const circleRadius = eventHeight / 2;
3493
+ const circleLeft = xStart - circleRadius;
3420
3494
  return {
3421
- tooltipX: xStart + CIRCLE_X_OFFSET,
3422
- tooltipY: cursorSeriesIndex * FIXED_LANE_HEIGHT,
3423
- hitMin: xStart - circleRadius,
3424
- hitMax: xStart + circleRadius
3495
+ anchorX: circleLeft,
3496
+ anchorY: eventTop,
3497
+ eventWidth: eventHeight,
3498
+ eventHeight,
3499
+ eventAnchorOffsetX: circleRadius,
3500
+ hitMin: circleLeft,
3501
+ hitMax: xStart + circleRadius,
3502
+ hitYMin,
3503
+ hitYMax
3425
3504
  };
3426
3505
  }
3427
3506
  const durationWidth = event.duration / durationPerTick * widthPerTick;
3428
3507
  const barWidth = Math.max(durationWidth, MIN_BAR_WIDTH);
3508
+ const isMinWidthBar = barWidth <= MIN_BAR_WIDTH;
3509
+ const hitXMin = isMinWidthBar ? xStart - MIN_BAR_HOVER_WIDTH / 2 : xStart;
3510
+ const hitXMax = isMinWidthBar ? xStart + MIN_BAR_HOVER_WIDTH / 2 : xStart + barWidth;
3429
3511
  return {
3430
- tooltipX: xStart + CIRCLE_X_OFFSET,
3431
- tooltipY: cursorSeriesIndex * FIXED_LANE_HEIGHT,
3432
- hitMin: xStart,
3433
- hitMax: xStart + barWidth
3512
+ anchorX: xStart,
3513
+ anchorY: eventTop,
3514
+ eventWidth: barWidth,
3515
+ eventHeight,
3516
+ eventAnchorOffsetX: 0,
3517
+ hitMin: hitXMin,
3518
+ hitMax: hitXMax,
3519
+ hitYMin,
3520
+ hitYMax,
3521
+ isMinWidthBar
3434
3522
  };
3435
3523
  }
3436
3524
  function hitTestEvent({ metrics, cursorPosition }) {
3437
- const { x } = cursorPosition;
3438
- return x >= metrics.hitMin && x <= metrics.hitMax;
3525
+ return isCursorWithinBounds({
3526
+ cursorPosition,
3527
+ bounds: {
3528
+ xMin: metrics.hitMin,
3529
+ xMax: metrics.hitMax,
3530
+ yMin: metrics.hitYMin,
3531
+ yMax: metrics.hitYMax
3532
+ }
3533
+ });
3439
3534
  }
3440
- function adjustForOverflow({ tooltipX, tooltipY, event, plotRightEdge }) {
3441
- const tooltipWidth = 85;
3442
- let overflow = false;
3443
- let adjustedX = tooltipX;
3444
- let adjustedY = tooltipY;
3445
- if (tooltipX + tooltipWidth > plotRightEdge) {
3446
- overflow = true;
3447
- adjustedY -= FIXED_LANE_HEIGHT / 2;
3448
- adjustedX -= event.duration === 0 ? FIXED_LANE_HEIGHT : MIN_BAR_WIDTH;
3449
- }
3450
- return {
3451
- x: adjustedX,
3452
- y: adjustedY,
3453
- overflow
3454
- };
3535
+ function isCursorWithinBounds({
3536
+ cursorPosition,
3537
+ bounds
3538
+ }) {
3539
+ const { x, y } = cursorPosition;
3540
+ return x >= bounds.xMin && x <= bounds.xMax && y >= bounds.yMin && y <= bounds.yMax;
3455
3541
  }
3456
3542
  function buildTooltipContent({ lane, event, locale, displaySeconds }) {
3457
3543
  const startTime = new Date(event.start).toLocaleTimeString(
@@ -3485,6 +3571,10 @@ function applyTooltipState({
3485
3571
  visible: true,
3486
3572
  x: tooltipState.tooltip.x,
3487
3573
  y: tooltipState.tooltip.y,
3574
+ eventWidth: tooltipState.tooltip.eventWidth,
3575
+ eventHeight: tooltipState.tooltip.eventHeight,
3576
+ eventAnchorOffsetX: tooltipState.tooltip.eventAnchorOffsetX,
3577
+ bounds: tooltipState.tooltip.bounds,
3488
3578
  overflow: tooltipState.tooltip.overflow,
3489
3579
  content: tooltipState.content,
3490
3580
  meta: tooltipState.meta
@@ -3504,12 +3594,9 @@ function clearTooltipIfVisible({
3504
3594
  return;
3505
3595
  }
3506
3596
  chart.root.style.cursor = "default";
3507
- tooltipRef.current = {
3508
- visible: false,
3509
- overflow: false,
3510
- content: "",
3511
- meta: ""
3512
- };
3597
+ tooltipRef.current = __spreadProps(__spreadValues({}, tooltipRef.current), {
3598
+ visible: false
3599
+ });
3513
3600
  setHighlightedLane(null);
3514
3601
  setHighlightedEvent(null);
3515
3602
  setHighlightedCategory(null);
@@ -3620,7 +3707,7 @@ var TimelinePlugin = ({
3620
3707
  var TimelinePlugin_default = TimelinePlugin;
3621
3708
 
3622
3709
  // src/Timeline/PureTimeline/src/XAxisPlugin.tsx
3623
- var X_AXIS_HEIGHT = 60;
3710
+ var X_AXIS_HEIGHT = 50;
3624
3711
  var XAxisPlugin = ({
3625
3712
  durationPerTick = 0,
3626
3713
  numTicks = 0,
@@ -3660,7 +3747,6 @@ var XAxisPlugin = ({
3660
3747
  draw: (u) => {
3661
3748
  const { ctx } = u;
3662
3749
  const scaleMin = u.scales.x.min;
3663
- const maxLabelWidth = 50;
3664
3750
  const ticks = [scaleMin];
3665
3751
  for (let i = 1; i <= numTicks; i += 1) {
3666
3752
  ticks.push(scaleMin + i * durationPerTick);
@@ -3716,7 +3802,9 @@ var XAxisPlugin = ({
3716
3802
  } else {
3717
3803
  xTickPosition = i * (u.width / numTicks);
3718
3804
  }
3719
- if (i === ticks.length - 1 && xTickPosition + maxLabelWidth > u.width) {
3805
+ const label = labels[i];
3806
+ const labelPixelWidth = label ? Math.max(...label.map((line) => ctx.measureText(line).width)) : 0;
3807
+ if (xTickPosition + labelPixelWidth > u.width) {
3720
3808
  return;
3721
3809
  }
3722
3810
  const yLabelPosition = xAxisY + tickHeight + labelOffset;
@@ -3726,7 +3814,6 @@ var XAxisPlugin = ({
3726
3814
  ctx.strokeStyle = "rgba(144, 144, 144, 0.5)";
3727
3815
  ctx.lineWidth = i === 0 ? 1 : 0.5;
3728
3816
  ctx.stroke();
3729
- const label = labels[i];
3730
3817
  if (label) {
3731
3818
  label.forEach((line, idx) => {
3732
3819
  ctx.fillText(line, xTickPosition, yLabelPosition + idx * lineHeight);
@@ -3802,12 +3889,14 @@ var TimelineYAxis = ({
3802
3889
  laneTextColor = theme.contentColorActive;
3803
3890
  }
3804
3891
  }
3892
+ const laneText = lane.toString();
3805
3893
  const truncatedText = truncateText(
3806
- lane.toString(),
3894
+ laneText,
3807
3895
  yAxisLabelWidth - lanePadding,
3808
3896
  "ellipsisMiddle",
3809
3897
  `14px ${VIZ_FONT_FAMILY}`
3810
3898
  );
3899
+ const isTruncated = truncatedText !== laneText;
3811
3900
  return /* @__PURE__ */ react_exports.createElement(
3812
3901
  YAxisLane,
3813
3902
  {
@@ -3818,6 +3907,7 @@ var TimelineYAxis = ({
3818
3907
  isEven: (lanes.length - index - 1) % 2 === 0,
3819
3908
  backgroundColor,
3820
3909
  clickable: !!handleLaneClick,
3910
+ title: isTruncated ? laneText : void 0,
3821
3911
  onClick: () => {
3822
3912
  handleLaneClick == null ? void 0 : handleLaneClick(lane);
3823
3913
  }
@@ -3834,35 +3924,48 @@ TimelineYAxis.propTypes = {
3834
3924
  var TimelineYAxis_default = TimelineYAxis;
3835
3925
 
3836
3926
  // src/Timeline/PureTimeline/src/TimelineLegend.tsx
3837
- var LEGEND_WIDTH = 88;
3927
+ var LEGEND_WIDTH = 79;
3928
+ var SCROLLBAR_GUTTER_WIDTH = 16;
3838
3929
  var LEGEND_TEXT_WIDTH = 55;
3930
+ var BOTTOM_LEGEND_MIN_HEIGHT = 34;
3839
3931
  var LegendContainer = styled_components_default.div`
3840
3932
  display: flex;
3841
- justify-content: center;
3933
+ justify-content: ${({ legendDisplay, hasVerticalOverflow }) => legendDisplay === "right" && hasVerticalOverflow ? "flex-start" : "center"};
3842
3934
  flex-direction: ${({ legendDisplay }) => legendDisplay === "bottom" ? "row" : "column"};
3843
3935
  align-items: flex-start;
3844
3936
  background-color: ${({ backgroundColor }) => backgroundColor};
3845
3937
  color: #fafafa;
3846
3938
  font-size: 10px;
3847
- ${({ legendDisplay, height, width, yAxisLabelWidth }) => legendDisplay === "right" ? `
3939
+ flex-shrink: 0;
3940
+ box-sizing: border-box;
3941
+ padding-right: ${({ scrollbarGutterWidth }) => scrollbarGutterWidth}px;
3942
+ ${({ legendDisplay, height, maxHeight, yAxisLabelWidth }) => legendDisplay === "right" ? `
3848
3943
  width: ${LEGEND_WIDTH}px;
3849
- height: ${height}px;
3850
- margin-top: -30px;
3851
- margin-left: 10px;
3852
- margin-right: 12px;
3944
+ min-height: ${Math.min(height, maxHeight)}px;
3945
+ max-height: ${maxHeight}px;
3946
+ align-self: flex-start;
3947
+ margin-left: 9px;
3853
3948
  overflow-x: hidden;
3949
+ overflow-y: auto;
3854
3950
  ` : `
3855
3951
  flex-wrap: wrap;
3856
- height: 60px;
3857
- width: ${width}px;
3952
+ align-content: flex-start;
3953
+ min-height: ${BOTTOM_LEGEND_MIN_HEIGHT}px;
3954
+ max-height: ${maxHeight}px;
3955
+ overflow-y: auto;
3956
+ width: calc(100% - ${yAxisLabelWidth}px);
3858
3957
  margin-left: ${yAxisLabelWidth}px;
3859
- padding-bottom: 10px;
3958
+ padding-top: 8px;
3959
+ padding-bottom: 0;
3860
3960
  `}
3861
3961
  `;
3862
3962
  var LegendItem = styled_components_default.div`
3863
3963
  display: flex;
3864
3964
  align-items: ${({ legendTruncation }) => legendTruncation === "ellipsisOff" ? "flex-start" : "center"};
3865
- margin: ${({ legendDisplay }) => legendDisplay === "bottom" ? "10px 20px 10px 0px" : "4px"};
3965
+ margin: ${({ legendDisplay }) => legendDisplay === "bottom" ? "4px 20px 4px 0px" : "4px"};
3966
+ max-width: 100%;
3967
+ min-width: 0;
3968
+ box-sizing: border-box;
3866
3969
  cursor: pointer;
3867
3970
  opacity: ${({ isHighlighted }) => isHighlighted ? 1 : 0.5};
3868
3971
  transition: opacity 0.2s ease;
@@ -3889,19 +3992,43 @@ var LegendText = styled_components_default.div`
3889
3992
  `}
3890
3993
  font-size: 10px;
3891
3994
  color: ${themes_exports.variables.contentColorActive};
3995
+ max-width: 100%;
3996
+ min-width: 0;
3892
3997
  `;
3893
3998
  var TimelineLegend = ({
3894
3999
  backgroundColor,
3895
4000
  categoryColors,
3896
4001
  highlightedCategory = null,
3897
4002
  setHighlightedCategory,
3898
- height,
3899
- width,
3900
4003
  handleLegendClick: handleLegendClick2,
3901
4004
  legendDisplay = "right",
3902
4005
  legendTruncation = "ellipsisEnd",
4006
+ height = 0,
4007
+ maxHeight = height,
3903
4008
  yAxisLabelWidth = 0
3904
4009
  }) => {
4010
+ const containerRef = react_exports.useRef(null);
4011
+ const [scrollbarGutter, setScrollbarGutter] = react_exports.useState({
4012
+ reservedWidth: 0,
4013
+ paddingRight: 0,
4014
+ hasVerticalOverflow: false
4015
+ });
4016
+ const categoryColorEntries = Array.from(categoryColors.entries());
4017
+ const legendTextWidth = Math.max(0, LEGEND_TEXT_WIDTH - scrollbarGutter.reservedWidth);
4018
+ react_exports.useEffect(() => {
4019
+ const el = containerRef.current;
4020
+ if (!el) return;
4021
+ const hasVerticalOverflow = el.scrollHeight > el.clientHeight;
4022
+ const measuredScrollbarWidth = hasVerticalOverflow ? Math.max(0, el.offsetWidth - el.clientWidth) : 0;
4023
+ const nextGutter = hasVerticalOverflow ? {
4024
+ reservedWidth: Math.max(SCROLLBAR_GUTTER_WIDTH, measuredScrollbarWidth),
4025
+ paddingRight: Math.max(0, SCROLLBAR_GUTTER_WIDTH - measuredScrollbarWidth),
4026
+ hasVerticalOverflow
4027
+ } : { reservedWidth: 0, paddingRight: 0, hasVerticalOverflow };
4028
+ setScrollbarGutter(
4029
+ (current) => current.reservedWidth === nextGutter.reservedWidth && current.paddingRight === nextGutter.paddingRight && current.hasVerticalOverflow === nextGutter.hasVerticalOverflow ? current : nextGutter
4030
+ );
4031
+ }, [categoryColors, height, legendDisplay, legendTruncation, maxHeight]);
3905
4032
  const handleMouseEnter = (category) => {
3906
4033
  setHighlightedCategory == null ? void 0 : setHighlightedCategory(category);
3907
4034
  };
@@ -3911,31 +4038,36 @@ var TimelineLegend = ({
3911
4038
  return /* @__PURE__ */ react_exports.createElement(
3912
4039
  LegendContainer,
3913
4040
  {
4041
+ ref: containerRef,
3914
4042
  "data-test": "legend-container",
3915
4043
  "data-test-position-value": legendDisplay,
3916
4044
  "data-test-truncation-value": legendTruncation,
3917
4045
  legendDisplay,
3918
4046
  backgroundColor,
4047
+ yAxisLabelWidth,
3919
4048
  height,
3920
- width,
3921
- yAxisLabelWidth
4049
+ maxHeight,
4050
+ scrollbarGutterWidth: scrollbarGutter.paddingRight,
4051
+ hasVerticalOverflow: scrollbarGutter.hasVerticalOverflow
3922
4052
  },
3923
- Array.from(categoryColors.entries()).map(([category, color]) => {
4053
+ categoryColorEntries.map(([category, color]) => {
3924
4054
  const isHighlighted = !highlightedCategory || highlightedCategory === category;
3925
- const truncatedText = legendTruncation === "ellipsisOff" || legendDisplay === "bottom" ? category : truncateText(category, LEGEND_TEXT_WIDTH, legendTruncation);
4055
+ const truncatedText = legendTruncation === "ellipsisOff" || legendDisplay === "bottom" ? category : truncateText(category, legendTextWidth, legendTruncation);
4056
+ const canTruncate = legendTruncation !== "ellipsisOff";
3926
4057
  return /* @__PURE__ */ react_exports.createElement(
3927
4058
  LegendItem,
3928
4059
  {
3929
4060
  "data-test": "legend-item",
3930
4061
  key: category,
3931
- color,
3932
4062
  isHighlighted,
3933
4063
  legendDisplay,
3934
4064
  legendTruncation,
4065
+ title: canTruncate ? category : void 0,
4066
+ "aria-label": category,
3935
4067
  onMouseEnter: () => handleMouseEnter(category),
3936
4068
  onMouseLeave: handleMouseLeave,
3937
4069
  onClick: () => {
3938
- handleLegendClick2(category);
4070
+ handleLegendClick2 == null ? void 0 : handleLegendClick2(category);
3939
4071
  }
3940
4072
  },
3941
4073
  /* @__PURE__ */ react_exports.createElement(
@@ -3955,104 +4087,133 @@ var TimelineLegend = ({
3955
4087
  };
3956
4088
  TimelineLegend.propTypes = {
3957
4089
  backgroundColor: prop_types_exports.string.isRequired,
3958
- height: prop_types_exports.number.isRequired,
3959
- legendDisplay: prop_types_exports.oneOf(["right", "bottom"]),
4090
+ height: prop_types_exports.number,
4091
+ legendDisplay: prop_types_exports.oneOf(["right", "bottom", "off"]),
3960
4092
  legendTruncation: prop_types_exports.oneOf(["ellipsisEnd", "ellipsisMiddle", "ellipsisStart", "ellipsisOff"]),
3961
4093
  categoryColors: prop_types_exports.any,
3962
4094
  highlightedCategory: prop_types_exports.string,
3963
- setHighlightedCategory: prop_types_exports.func
4095
+ setHighlightedCategory: prop_types_exports.func,
4096
+ maxHeight: prop_types_exports.number
3964
4097
  };
3965
4098
  var TimelineLegend_default = TimelineLegend;
3966
4099
 
3967
- // esm-externals:@splunk/themes/useSplunkTheme
3968
- var useSplunkTheme_exports = {};
3969
- __export(useSplunkTheme_exports, {
3970
- default: () => useSplunkTheme_default
4100
+ // esm-externals:@splunk/react-ui/Popover
4101
+ var Popover_exports = {};
4102
+ __export(Popover_exports, {
4103
+ default: () => Popover_default
3971
4104
  });
3972
- var defaultImport40 = __toESM(require("@splunk/themes/useSplunkTheme"));
3973
- __reExport(useSplunkTheme_exports, require("@splunk/themes/useSplunkTheme"));
3974
- var useSplunkTheme_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
4105
+ var defaultImport40 = __toESM(require("@splunk/react-ui/Popover"));
4106
+ __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
4107
+ var Popover_default = "default" in defaultImport40 ? defaultImport40.default : defaultImport40;
3975
4108
 
3976
4109
  // src/Timeline/PureTimeline/src/TimelineTooltip.tsx
3977
- var TooltipContainer = styled_components_default.div`
4110
+ var TOOLTIP_ANCHOR_GAP = 4;
4111
+ var TOOLTIP_MOVE_TRANSITION = "transform 0.1s ease-out, left 0.1s ease-out, top 0.1s ease-out";
4112
+ var VirtualAnchor = styled_components_default.div`
3978
4113
  position: absolute;
3979
- background-color: ${({ backgroundColor }) => `${backgroundColor}`};
3980
- box-shadow: ${themes_exports.variables.overlayShadow};
3981
- padding: 12px 16px;
3982
- border-radius: 3px;
3983
4114
  pointer-events: none;
3984
- display: ${({ visible }) => visible ? "block" : "none"};
3985
- white-space: nowrap;
4115
+ width: ${({ width }) => `${width}px`};
4116
+ height: ${({ height }) => `${height}px`};
3986
4117
  left: ${({ x }) => `${x}px`};
3987
- top: ${({ y, chartOverflow }) => `${chartOverflow ? y : y + 7}px`};
3988
- transform: ${({ chartOverflow }) => chartOverflow ? "translate(-100%, -50%);" : "translate(-55%, 0);"}
3989
- transition: left 0.1s ease-out, top 0.1s ease-out;
3990
- z-index: 1000;
3991
-
3992
- ::after {
3993
- content: '';
3994
- position: absolute;
3995
- ${({ chartOverflow, backgroundColor }) => chartOverflow ? `
3996
- top: 50%;
3997
- left: 100%;
3998
- transform: translateY(-50%);
3999
- border-width: 5px;
4000
- border-style: solid;
4001
- border-bottom-color: transparent;
4002
- border-top-color: transparent;
4003
- border-right-color: transparent;
4004
- border-left-color: ${backgroundColor};
4005
- ` : `
4006
- bottom: 100%;
4007
- left: 50%;
4008
- transform: translateX(-50%);
4009
- border-width: 5px;
4010
- border-style: solid;
4011
- border-bottom-color: ${backgroundColor};
4012
- border-top-color: transparent;
4013
- border-right-color: transparent;
4014
- border-left-color: transparent;
4015
- `}
4016
- }
4118
+ top: ${({ y }) => `${y}px`};
4017
4119
  `;
4018
- var TooltipLabel = styled_components_default.div`
4019
- color: ${themes_exports.variables.contentColorDefault};
4020
- `;
4021
- var TooltipValue = styled_components_default.div`
4022
- color: ${themes_exports.variables.contentColorActive};
4120
+ var TooltipContainer = styled_components_default.div`
4121
+ padding: 12px 16px;
4023
4122
  `;
4024
- var TooltipContent = styled_components_default.div`
4025
- display: flex;
4026
- flex-direction: row;
4027
- justify-content: space-between;
4028
- align-items: center;
4029
- gap: 16px;
4123
+ var TooltipTable = styled_components_default.table`
4124
+ border-collapse: collapse;
4030
4125
  font-weight: 400;
4031
4126
  font-size: 12px;
4032
4127
  line-height: 16px;
4128
+ max-width: 280px;
4033
4129
  `;
4034
- var TimelineTooltip = ({ visible, content, x, y, overflow }) => {
4035
- const theme = useSplunkTheme_default();
4036
- let popoverBackground = "#33343b";
4037
- if (theme.isPrisma) {
4038
- popoverBackground = theme.backgroundColorPopup;
4039
- } else if (theme.isEnterprise && theme.isLight) {
4040
- popoverBackground = theme.white;
4041
- }
4042
- return /* @__PURE__ */ react_default.createElement(
4043
- TooltipContainer,
4130
+ var TooltipLabel = styled_components_default.td`
4131
+ color: ${themes_exports.variables.contentColorDefault};
4132
+ overflow-wrap: normal;
4133
+ word-break: normal;
4134
+ white-space: normal;
4135
+ vertical-align: top;
4136
+ padding-right: 16px;
4137
+ padding-bottom: 2px;
4138
+ min-width: 8ch;
4139
+ max-width: 18ch;
4140
+ `;
4141
+ var TooltipValue = styled_components_default.td`
4142
+ color: ${themes_exports.variables.contentColorActive};
4143
+ overflow-wrap: anywhere;
4144
+ word-break: normal;
4145
+ white-space: normal;
4146
+ vertical-align: top;
4147
+ text-align: right;
4148
+ padding-bottom: 2px;
4149
+ `;
4150
+ var POPOVER_STYLE = { pointerEvents: "none" };
4151
+ var TimelineTooltip = ({
4152
+ visible,
4153
+ content,
4154
+ x,
4155
+ y,
4156
+ eventWidth = 0,
4157
+ eventHeight = 0,
4158
+ eventAnchorOffsetX = 0,
4159
+ overflow,
4160
+ scaleFactor = 1
4161
+ }) => {
4162
+ const [anchorEl, setAnchorEl] = react_default.useState(null);
4163
+ const preferredPlacement = overflow ? "left" : "below";
4164
+ const previousAnchorRef = react_default.useRef(null);
4165
+ const anchorX = x - TOOLTIP_ANCHOR_GAP;
4166
+ const anchorY = y - TOOLTIP_ANCHOR_GAP;
4167
+ const anchorWidth = eventWidth + TOOLTIP_ANCHOR_GAP * 2;
4168
+ const anchorHeight = eventHeight + TOOLTIP_ANCHOR_GAP * 2;
4169
+ const pointTo = overflow ? void 0 : { x: (eventAnchorOffsetX + TOOLTIP_ANCHOR_GAP) * scaleFactor };
4170
+ const tooltipRows = Object.entries(content).filter(([, value]) => value !== void 0 && value !== null);
4171
+ const open = visible && anchorEl !== null;
4172
+ const previousAnchor = previousAnchorRef.current;
4173
+ const shouldTransitionTooltipMove = open ? isNearbyTooltipAnchor({
4174
+ anchorPoint: { x: anchorX, y: anchorY },
4175
+ previousAnchorPoint: previousAnchor
4176
+ }) : false;
4177
+ react_default.useEffect(() => {
4178
+ if (!open) {
4179
+ return;
4180
+ }
4181
+ previousAnchorRef.current = { x: anchorX, y: anchorY };
4182
+ }, [anchorX, anchorY, open]);
4183
+ const applyOuterPopoverStyles = react_default.useCallback(
4184
+ (element) => {
4185
+ if (!element) return;
4186
+ const { style } = element;
4187
+ style.pointerEvents = "none";
4188
+ style.minWidth = "0";
4189
+ style.transition = shouldTransitionTooltipMove ? TOOLTIP_MOVE_TRANSITION : "none";
4190
+ },
4191
+ [shouldTransitionTooltipMove]
4192
+ );
4193
+ return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(
4194
+ VirtualAnchor,
4195
+ {
4196
+ ref: setAnchorEl,
4197
+ x: anchorX,
4198
+ y: anchorY,
4199
+ width: anchorWidth,
4200
+ height: anchorHeight,
4201
+ "data-test": "timeline-tooltip-anchor"
4202
+ }
4203
+ ), /* @__PURE__ */ react_default.createElement(
4204
+ Popover_default,
4044
4205
  {
4045
4206
  "data-test": "timeline-tooltip",
4046
- backgroundColor: popoverBackground,
4047
- visible,
4048
- x,
4049
- y,
4050
- chartOverflow: overflow
4207
+ open,
4208
+ anchor: anchorEl,
4209
+ defaultPlacement: preferredPlacement,
4210
+ outerRef: applyOuterPopoverStyles,
4211
+ pointTo,
4212
+ repositionMode: "flip",
4213
+ style: POPOVER_STYLE
4051
4214
  },
4052
- Object.entries(content).map(
4053
- ([key, value]) => value !== void 0 && value !== null && /* @__PURE__ */ react_default.createElement(TooltipContent, { key }, /* @__PURE__ */ react_default.createElement(TooltipLabel, null, key.charAt(0).toUpperCase() + key.slice(1)), /* @__PURE__ */ react_default.createElement(TooltipValue, null, value))
4054
- )
4055
- );
4215
+ /* @__PURE__ */ react_default.createElement(TooltipContainer, null, /* @__PURE__ */ react_default.createElement(TooltipTable, null, /* @__PURE__ */ react_default.createElement("tbody", null, tooltipRows.map(([key, value]) => /* @__PURE__ */ react_default.createElement("tr", { key }, /* @__PURE__ */ react_default.createElement(TooltipLabel, null, key.charAt(0).toUpperCase() + key.slice(1)), /* @__PURE__ */ react_default.createElement(TooltipValue, null, value))))))
4216
+ ));
4056
4217
  };
4057
4218
  var TimelineTooltip_default = TimelineTooltip;
4058
4219
 
@@ -4066,18 +4227,66 @@ __reExport(uPlot_min_exports, require("uplot/dist/uPlot.min.css"));
4066
4227
  var uPlot_min_default = "default" in defaultImport41 ? defaultImport41.default : defaultImport41;
4067
4228
 
4068
4229
  // src/Timeline/PureTimeline/src/TimelineUplot.tsx
4230
+ var TIMELINE_CONTAINER_PADDING = 10;
4231
+ var BOTTOM_LEGEND_SCROLLBAR_GAP = 8;
4232
+ var LANE_HEIGHT = 32;
4233
+ var SCROLLBAR_GUTTER_WIDTH2 = 24;
4234
+ var RIGHT_LEGEND_FOOTPRINT = 88;
4235
+ var getTimelineLayout = ({
4236
+ width,
4237
+ height,
4238
+ yAxisLabelWidth,
4239
+ laneCount,
4240
+ showLegend = false,
4241
+ legendDisplay
4242
+ }) => {
4243
+ const laneBandHeight = LANE_HEIGHT * laneCount;
4244
+ const chartHeight = laneBandHeight + X_AXIS_HEIGHT;
4245
+ const visibleTimelineHeight = Math.max(0, height - TIMELINE_CONTAINER_PADDING * 2);
4246
+ const bottomLegendReservedHeight = showLegend && legendDisplay === "bottom" ? BOTTOM_LEGEND_SCROLLBAR_GAP + BOTTOM_LEGEND_MIN_HEIGHT : 0;
4247
+ const reserveScrollbarGutter = chartHeight > Math.max(0, visibleTimelineHeight - bottomLegendReservedHeight);
4248
+ const legendWidth = showLegend && legendDisplay === "right" ? RIGHT_LEGEND_FOOTPRINT : 0;
4249
+ const chartWidth = Math.max(
4250
+ 1,
4251
+ width - yAxisLabelWidth - legendWidth - TIMELINE_CONTAINER_PADDING * 2 - (reserveScrollbarGutter ? SCROLLBAR_GUTTER_WIDTH2 : 0)
4252
+ );
4253
+ const legendMaxHeight = legendDisplay === "bottom" ? Math.max(
4254
+ BOTTOM_LEGEND_MIN_HEIGHT,
4255
+ visibleTimelineHeight - BOTTOM_LEGEND_SCROLLBAR_GAP - chartHeight
4256
+ ) : visibleTimelineHeight;
4257
+ return {
4258
+ laneBandHeight,
4259
+ chartHeight,
4260
+ chartWidth,
4261
+ reserveScrollbarGutter,
4262
+ legendMaxHeight
4263
+ };
4264
+ };
4069
4265
  var TimelineUplotContainer = styled_components_default.div`
4070
4266
  display: flex;
4071
4267
  flex-direction: ${({ legendDisplay }) => legendDisplay === "bottom" ? "column" : "row"};
4072
4268
  width: 100%;
4073
4269
  height: 100%;
4074
- padding: 10px 10px;
4075
- overflow-y: scroll;
4270
+ padding: ${TIMELINE_CONTAINER_PADDING}px ${TIMELINE_CONTAINER_PADDING}px;
4271
+ overflow: visible;
4272
+ box-sizing: border-box;
4273
+ position: relative;
4274
+ ${({ legendDisplay }) => legendDisplay === "bottom" ? `gap: ${BOTTOM_LEGEND_SCROLLBAR_GAP}px;` : ""}
4275
+ `;
4276
+ var TimelineChartScrollArea = styled_components_default.div`
4277
+ flex: ${({ hasBottomLegend }) => hasBottomLegend ? "0 0 auto" : "1 1 auto"};
4278
+ max-height: ${({ hasBottomLegend }) => hasBottomLegend ? `calc(100% - ${BOTTOM_LEGEND_SCROLLBAR_GAP + BOTTOM_LEGEND_MIN_HEIGHT}px)` : "none"};
4279
+ min-height: 0;
4280
+ min-width: 0;
4281
+ overflow-y: auto;
4076
4282
  overflow-x: hidden;
4283
+ box-sizing: border-box;
4284
+ padding-right: ${({ reserveScrollbarGutter }) => reserveScrollbarGutter ? SCROLLBAR_GUTTER_WIDTH2 : 0}px;
4077
4285
  `;
4078
4286
  var TimelineUplotWrapper = styled_components_default.div`
4079
4287
  width: ${({ width }) => `${width}px`};
4080
4288
  position: relative;
4289
+ overflow: visible;
4081
4290
  `;
4082
4291
  var TimelineChartContainer = styled_components_default.div`
4083
4292
  display: flex;
@@ -4087,6 +4296,7 @@ var TimelineChartContainer = styled_components_default.div`
4087
4296
  var TimelineUplot = ({
4088
4297
  backgroundColor,
4089
4298
  width,
4299
+ height,
4090
4300
  yAxisLabelWidth,
4091
4301
  laneSeries,
4092
4302
  lanes,
@@ -4109,27 +4319,33 @@ var TimelineUplot = ({
4109
4319
  const fullscreenEl = typeof document !== "undefined" ? document.fullscreenElement : null;
4110
4320
  const scaleFactor = fullscreenEl && fullscreenEl.tagName !== "BODY" ? 1 : zoom || 1;
4111
4321
  const { version: dprVersion } = (0, visualization_canvas_exports.useDevicePixelRatio)();
4322
+ const scrollContainerRef = react_exports.useRef(null);
4112
4323
  const tooltipRef = react_exports.useRef({
4113
4324
  visible: false,
4114
4325
  x: 0,
4115
4326
  y: 0,
4327
+ eventAnchorOffsetX: 0,
4328
+ bounds: null,
4116
4329
  overflow: false,
4117
4330
  content: {},
4118
4331
  meta: {}
4119
4332
  });
4120
- const xMin = Math.min(...laneSeries.flatMap((lane) => lane.map((dp) => dp.start))) || 0;
4121
- const xMax = Math.max(...laneSeries.flatMap((lane) => lane.map((dp) => dp.end))) || 1;
4122
- const xAxisHeight = 60;
4123
- const laneHeight = 32;
4124
- const padding = 20;
4125
- const legendWidth = showLegend && legendDisplay === "right" ? 88 : 0;
4126
- const containerWidth = typeof width === "string" ? window.innerWidth : width;
4127
- const chartWidth = containerWidth - yAxisLabelWidth - legendWidth - padding;
4128
- const chartHeight = laneHeight * lanes.length + xAxisHeight;
4333
+ const eventStarts = laneSeries.flatMap((lane) => lane.map((dp) => dp.start));
4334
+ const eventEnds = laneSeries.flatMap((lane) => lane.map((dp) => dp.end));
4335
+ const xMin = eventStarts.length ? Math.min(...eventStarts) : 0;
4336
+ const xMax = eventEnds.length ? Math.max(...eventEnds) : 1;
4337
+ const { laneBandHeight, chartHeight, chartWidth, reserveScrollbarGutter, legendMaxHeight } = getTimelineLayout({
4338
+ width,
4339
+ height,
4340
+ yAxisLabelWidth,
4341
+ laneCount: lanes.length,
4342
+ showLegend,
4343
+ legendDisplay
4344
+ });
4129
4345
  const granularityMultiplier = convertTickIntervalToMs(tickInterval);
4130
4346
  const totalRange = xMax + granularityMultiplier - xMin;
4131
4347
  const totalNumberOfTicks = totalRange / granularityMultiplier;
4132
- const maxNumOfTicks = calculateMaxNumberOfTicks(chartWidth, 50, 10);
4348
+ const maxNumOfTicks = Math.max(1, calculateMaxNumberOfTicks(chartWidth, 50, 10));
4133
4349
  const unitsPerTick = Math.ceil(totalNumberOfTicks / maxNumOfTicks);
4134
4350
  const numTicks = totalNumberOfTicks / unitsPerTick;
4135
4351
  const durationPerTick = granularityMultiplier * unitsPerTick;
@@ -4193,6 +4409,7 @@ var TimelineUplot = ({
4193
4409
  setHighlightedLane,
4194
4410
  handleEventClick,
4195
4411
  tooltipRef,
4412
+ scrollContainerRef,
4196
4413
  locale,
4197
4414
  scaleFactor
4198
4415
  })
@@ -4221,32 +4438,42 @@ var TimelineUplot = ({
4221
4438
  setHighlightedLane,
4222
4439
  handleEventClick,
4223
4440
  tooltipRef,
4441
+ scrollContainerRef,
4224
4442
  theme
4225
4443
  ]
4226
4444
  );
4227
- return /* @__PURE__ */ react_exports.createElement(TimelineUplotContainer, { legendDisplay, "data-test": "timeline-uplot-container" }, /* @__PURE__ */ react_exports.createElement(TimelineChartContainer, { "data-test": "timeline-chart-container" }, /* @__PURE__ */ react_exports.createElement(
4228
- TimelineYAxis_default,
4229
- {
4230
- height: chartHeight,
4231
- laneHeight,
4232
- lanes,
4233
- yAxisLabelWidth,
4234
- backgroundColor,
4235
- highlightedLane,
4236
- handleLaneClick
4237
- }
4238
- ), /* @__PURE__ */ react_exports.createElement(TimelineUplotWrapper, { width: chartWidth }, /* @__PURE__ */ react_exports.createElement(
4239
- uplot_react_default,
4445
+ return /* @__PURE__ */ react_exports.createElement(TimelineUplotContainer, { legendDisplay, "data-test": "timeline-uplot-container" }, /* @__PURE__ */ react_exports.createElement(
4446
+ TimelineChartScrollArea,
4240
4447
  {
4241
- key: `timeline-${dprVersion}-${scaleFactor}`,
4242
- options: opts,
4243
- data: [[xMin], ...lanes.map(() => [])]
4244
- }
4245
- ), /* @__PURE__ */ react_exports.createElement(TimelineTooltip_default, __spreadValues({}, tooltipRef.current)))), showLegend && /* @__PURE__ */ react_exports.createElement(
4448
+ ref: scrollContainerRef,
4449
+ "data-test": "timeline-chart-scroll-area",
4450
+ hasBottomLegend: showLegend && legendDisplay === "bottom",
4451
+ reserveScrollbarGutter
4452
+ },
4453
+ /* @__PURE__ */ react_exports.createElement(TimelineChartContainer, { "data-test": "timeline-chart-container" }, /* @__PURE__ */ react_exports.createElement(
4454
+ TimelineYAxis_default,
4455
+ {
4456
+ height: chartHeight,
4457
+ laneHeight: LANE_HEIGHT,
4458
+ lanes,
4459
+ yAxisLabelWidth,
4460
+ backgroundColor,
4461
+ highlightedLane,
4462
+ handleLaneClick
4463
+ }
4464
+ ), /* @__PURE__ */ react_exports.createElement(TimelineUplotWrapper, { width: chartWidth }, /* @__PURE__ */ react_exports.createElement(
4465
+ uplot_react_default,
4466
+ {
4467
+ key: `timeline-${dprVersion}-${scaleFactor}`,
4468
+ options: opts,
4469
+ data: [[xMin], ...lanes.map(() => [])]
4470
+ }
4471
+ ), /* @__PURE__ */ react_exports.createElement(TimelineTooltip_default, __spreadProps(__spreadValues({}, tooltipRef.current), { scaleFactor }))))
4472
+ ), showLegend && /* @__PURE__ */ react_exports.createElement(
4246
4473
  TimelineLegend_default,
4247
4474
  {
4248
- height: chartHeight,
4249
- width: chartWidth,
4475
+ height: laneBandHeight,
4476
+ maxHeight: legendMaxHeight,
4250
4477
  yAxisLabelWidth,
4251
4478
  backgroundColor,
4252
4479
  legendDisplay,
@@ -4296,6 +4523,15 @@ var PureTimeline = (_a) => {
4296
4523
  const showLegend = (!dataColors || (dataColors == null ? void 0 : dataColors.length) === 0) && (category == null ? void 0 : category.length) > 0 && (legendDisplay === "right" || legendDisplay === "bottom");
4297
4524
  const timezone = react_exports.useContext(TimezoneContext_default);
4298
4525
  const theme = (0, themes_exports.useSplunkTheme)();
4526
+ const [containerSize, setContainerSize] = react_exports.useState({
4527
+ width: typeof width === "number" ? width : 0,
4528
+ height: typeof height === "number" ? height : 0
4529
+ });
4530
+ const handleResize = react_exports.useCallback((nextWidth, nextHeight) => {
4531
+ setContainerSize(
4532
+ (current) => current.width === nextWidth && current.height === nextHeight ? current : { width: nextWidth, height: nextHeight }
4533
+ );
4534
+ }, []);
4299
4535
  const { laneSeries, lanes, categoricalColors, tickInterval, hasInvalidData } = mapDataToTimeline({
4300
4536
  resultLimit,
4301
4537
  x,
@@ -4370,11 +4606,13 @@ var PureTimeline = (_a) => {
4370
4606
  height,
4371
4607
  "data-test-data-colors": JSON.stringify(dataColors)
4372
4608
  },
4609
+ /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: handleResize }),
4373
4610
  /* @__PURE__ */ react_exports.createElement(
4374
4611
  TimelineUplot_default,
4375
4612
  {
4376
4613
  backgroundColor: backgroundColor || theme.backgroundColorPage,
4377
- width,
4614
+ width: containerSize.width,
4615
+ height: containerSize.height,
4378
4616
  lanes,
4379
4617
  laneSeries,
4380
4618
  yAxisLabelWidth,
@@ -4397,8 +4635,8 @@ PureTimeline.propTypes = {
4397
4635
  duration: prop_types_exports.arrayOf(prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number])),
4398
4636
  category: prop_types_exports.arrayOf(prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number])),
4399
4637
  backgroundColor: prop_types_exports.string,
4400
- width: prop_types_exports.number,
4401
- height: prop_types_exports.number,
4638
+ width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
4639
+ height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
4402
4640
  xField: prop_types_exports.string,
4403
4641
  yField: prop_types_exports.string,
4404
4642
  durationField: prop_types_exports.string,