@splunk/visualizations 28.5.2 → 28.6.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 (359) hide show
  1. package/Area/Area.d.ts.map +1 -1
  2. package/Area/areaUtils.d.ts +1 -1
  3. package/Area/areaUtils.d.ts.map +1 -1
  4. package/Area/config.d.ts.map +1 -1
  5. package/Area.config.js +93 -25
  6. package/Area.config.js.map +3 -3
  7. package/Area.js +708 -319
  8. package/Area.js.map +4 -4
  9. package/Bar/Bar.d.ts.map +1 -1
  10. package/Bar.config.js +81 -24
  11. package/Bar.config.js.map +3 -3
  12. package/Bar.js +528 -297
  13. package/Bar.js.map +4 -4
  14. package/Bubble.config.js +80 -23
  15. package/Bubble.config.js.map +2 -2
  16. package/Bubble.js +375 -208
  17. package/Bubble.js.map +4 -4
  18. package/CHANGELOG.external.md +75 -8
  19. package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts +1 -0
  20. package/ChoroplethSvg/PureChoroplethSvg/PureChoroplethSvg.d.ts.map +1 -1
  21. package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts +12 -25
  22. package/ChoroplethSvg/PureChoroplethSvg/SvgChoroplethDynamic.d.ts.map +1 -1
  23. package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts +11 -4
  24. package/ChoroplethSvg/PureChoroplethSvg/SvgMutator.d.ts.map +1 -1
  25. package/ChoroplethSvg.js +1133 -253
  26. package/ChoroplethSvg.js.map +4 -4
  27. package/Column/Column.d.ts.map +1 -1
  28. package/Column.config.js +81 -24
  29. package/Column.config.js.map +3 -3
  30. package/Column.js +531 -300
  31. package/Column.js.map +4 -4
  32. package/Ellipse.config.js +1 -1
  33. package/Ellipse.config.js.map +2 -2
  34. package/Ellipse.js +277 -161
  35. package/Ellipse.js.map +4 -4
  36. package/Events/config.d.ts.map +1 -1
  37. package/Events.config.js +13 -3
  38. package/Events.config.js.map +2 -2
  39. package/Events.js +330 -194
  40. package/Events.js.map +4 -4
  41. package/FillerGauge/FillerGauge.d.ts.map +1 -1
  42. package/FillerGauge/config.d.ts.map +1 -1
  43. package/FillerGauge.config.js +76 -24
  44. package/FillerGauge.config.js.map +2 -2
  45. package/FillerGauge.js +512 -271
  46. package/FillerGauge.js.map +4 -4
  47. package/Image/config.d.ts.map +1 -1
  48. package/Image.config.js +7 -0
  49. package/Image.config.js.map +2 -2
  50. package/Image.js +282 -149
  51. package/Image.js.map +4 -4
  52. package/LICENSE +13 -0
  53. package/Line/Line.d.ts.map +1 -1
  54. package/Line/config.d.ts.map +1 -1
  55. package/Line/lineUtils.d.ts.map +1 -1
  56. package/Line/mockdata/LineData.d.ts +21 -0
  57. package/Line/mockdata/LineData.d.ts.map +1 -1
  58. package/Line.config.js +86 -25
  59. package/Line.config.js.map +3 -3
  60. package/Line.js +638 -382
  61. package/Line.js.map +4 -4
  62. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +47 -73
  63. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
  64. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts +11 -2
  65. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
  66. package/LinkGraph/PureLinkGraph/components/Graph.d.ts +5 -5
  67. package/LinkGraph/PureLinkGraph/components/Node.d.ts +2 -2
  68. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +2 -2
  69. package/LinkGraph.js +886 -759
  70. package/LinkGraph.js.map +4 -4
  71. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  72. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  73. package/Map/config.d.ts.map +1 -1
  74. package/Map.config.js +4 -1
  75. package/Map.config.js.map +2 -2
  76. package/Map.js +296 -169
  77. package/Map.js.map +4 -4
  78. package/Markdown/Markdown.d.ts.map +1 -1
  79. package/Markdown.config.js.map +1 -1
  80. package/Markdown.js +283 -157
  81. package/Markdown.js.map +4 -4
  82. package/MarkerGauge/MarkerGauge.d.ts +1 -47
  83. package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
  84. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +22 -68
  85. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
  86. package/MarkerGauge/config.d.ts.map +1 -1
  87. package/MarkerGauge.config.js +75 -23
  88. package/MarkerGauge.config.js.map +2 -2
  89. package/MarkerGauge.js +560 -375
  90. package/MarkerGauge.js.map +4 -4
  91. package/NetworkGraph/NetworkGraph.d.ts +2 -1
  92. package/NetworkGraph/NetworkGraph.d.ts.map +1 -1
  93. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
  94. package/NetworkGraph.config.js.map +2 -2
  95. package/NetworkGraph.js +628 -434
  96. package/NetworkGraph.js.map +4 -4
  97. package/ParallelCoordinates.config.js.map +1 -1
  98. package/ParallelCoordinates.js +288 -172
  99. package/ParallelCoordinates.js.map +4 -4
  100. package/Pie/Pie.d.ts.map +1 -1
  101. package/Pie/pieUtils.d.ts +2 -2
  102. package/Pie.config.js +74 -22
  103. package/Pie.config.js.map +2 -2
  104. package/Pie.js +522 -296
  105. package/Pie.js.map +4 -4
  106. package/ProcessTree/ProcessTree.d.ts +21 -0
  107. package/ProcessTree/ProcessTree.d.ts.map +1 -0
  108. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts +32 -0
  109. package/ProcessTree/PureProcessTree/PureProcessTree.d.ts.map +1 -0
  110. package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts +8 -0
  111. package/ProcessTree/PureProcessTree/components/DirectionalBytes.d.ts.map +1 -0
  112. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts +44 -0
  113. package/ProcessTree/PureProcessTree/components/ProcessTreeLeftPanel.d.ts.map +1 -0
  114. package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts +20 -0
  115. package/ProcessTree/PureProcessTree/components/ProcessTreeRightPanel.d.ts.map +1 -0
  116. package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts +20 -0
  117. package/ProcessTree/PureProcessTree/hooks/useProcessTreeExpansionState.d.ts.map +1 -0
  118. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts +44 -0
  119. package/ProcessTree/PureProcessTree/hooks/useProcessTreeGraphData.d.ts.map +1 -0
  120. package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts +23 -0
  121. package/ProcessTree/PureProcessTree/hooks/useProcessTreeLinkOverlay.d.ts.map +1 -0
  122. package/ProcessTree/PureProcessTree/mockdata/data.d.ts +235 -0
  123. package/ProcessTree/PureProcessTree/mockdata/data.d.ts.map +1 -0
  124. package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts +9 -0
  125. package/ProcessTree/PureProcessTree/utils/iconLoader.d.ts.map +1 -0
  126. package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts +36 -0
  127. package/ProcessTree/PureProcessTree/utils/processTreeLinkOverlayUtils.d.ts.map +1 -0
  128. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts +80 -0
  129. package/ProcessTree/PureProcessTree/utils/processTreeUtils.d.ts.map +1 -0
  130. package/ProcessTree/config.d.ts +4 -0
  131. package/ProcessTree/config.d.ts.map +1 -0
  132. package/ProcessTree/index.d.ts +3 -0
  133. package/ProcessTree/index.d.ts.map +1 -0
  134. package/ProcessTree.config.js +192 -0
  135. package/ProcessTree.config.js.map +7 -0
  136. package/ProcessTree.js +5058 -0
  137. package/ProcessTree.js.map +7 -0
  138. package/Punchcard/Punchcard.d.ts +1 -5
  139. package/Punchcard/Punchcard.d.ts.map +1 -1
  140. package/Punchcard/PurePunchcard/Punchcard.d.ts +28 -32
  141. package/Punchcard/PurePunchcard/Punchcard.d.ts.map +1 -1
  142. package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts +7 -12
  143. package/Punchcard/PurePunchcard/src/PunchcardAxis.d.ts.map +1 -1
  144. package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts +14 -19
  145. package/Punchcard/PurePunchcard/src/PunchcardBubble.d.ts.map +1 -1
  146. package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts +22 -27
  147. package/Punchcard/PurePunchcard/src/PunchcardChartArea.d.ts.map +1 -1
  148. package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts +3 -8
  149. package/Punchcard/PurePunchcard/src/PunchcardGridLines.d.ts.map +1 -1
  150. package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts +9 -14
  151. package/Punchcard/PurePunchcard/src/PunchcardLegend.d.ts.map +1 -1
  152. package/Punchcard/PurePunchcard/src/PunchcardRow.d.ts.map +1 -1
  153. package/Punchcard.config.js.map +1 -1
  154. package/Punchcard.js +444 -631
  155. package/Punchcard.js.map +4 -4
  156. package/Rectangle.config.js +1 -1
  157. package/Rectangle.config.js.map +2 -2
  158. package/Rectangle.js +289 -173
  159. package/Rectangle.js.map +4 -4
  160. package/RichText/PureRichText/Editor/EditorPanel.d.ts +20 -0
  161. package/RichText/PureRichText/Editor/EditorPanel.d.ts.map +1 -0
  162. package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts +17 -0
  163. package/RichText/PureRichText/Editor/EditorPanelStyles.d.ts.map +1 -0
  164. package/RichText/PureRichText/Editor/FontSelector.d.ts +15 -0
  165. package/RichText/PureRichText/Editor/FontSelector.d.ts.map +1 -0
  166. package/RichText/PureRichText/Editor/FormatButton.d.ts +23 -0
  167. package/RichText/PureRichText/Editor/FormatButton.d.ts.map +1 -0
  168. package/RichText/PureRichText/Editor/editorPanelUtils.d.ts +19 -0
  169. package/RichText/PureRichText/Editor/editorPanelUtils.d.ts.map +1 -0
  170. package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts +11 -0
  171. package/RichText/PureRichText/Editor/hooks/useLineSpacing.d.ts.map +1 -0
  172. package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts +26 -0
  173. package/RichText/PureRichText/Editor/hooks/useLinkHandlers.d.ts.map +1 -0
  174. package/RichText/PureRichText/Editor/index.d.ts +9 -0
  175. package/RichText/PureRichText/Editor/index.d.ts.map +1 -0
  176. package/RichText/PureRichText/InnerEditor.d.ts +41 -0
  177. package/RichText/PureRichText/InnerEditor.d.ts.map +1 -0
  178. package/RichText/PureRichText/PureRichText.d.ts +19 -0
  179. package/RichText/PureRichText/PureRichText.d.ts.map +1 -0
  180. package/RichText/PureRichText/PureRichTextContext.d.ts +64 -0
  181. package/RichText/PureRichText/PureRichTextContext.d.ts.map +1 -0
  182. package/RichText/PureRichText/RichTextStyles.d.ts +25 -0
  183. package/RichText/PureRichText/RichTextStyles.d.ts.map +1 -0
  184. package/RichText/PureRichText/activeInstance.d.ts +23 -0
  185. package/RichText/PureRichText/activeInstance.d.ts.map +1 -0
  186. package/RichText/PureRichText/config.d.ts +17 -0
  187. package/RichText/PureRichText/config.d.ts.map +1 -0
  188. package/RichText/PureRichText/hooks/index.d.ts +12 -0
  189. package/RichText/PureRichText/hooks/index.d.ts.map +1 -0
  190. package/RichText/PureRichText/hooks/useContentSave.d.ts +25 -0
  191. package/RichText/PureRichText/hooks/useContentSave.d.ts.map +1 -0
  192. package/RichText/PureRichText/hooks/useContentSync.d.ts +28 -0
  193. package/RichText/PureRichText/hooks/useContentSync.d.ts.map +1 -0
  194. package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts +33 -0
  195. package/RichText/PureRichText/hooks/useDashboardKeyboardNav.d.ts.map +1 -0
  196. package/RichText/PureRichText/hooks/useEditModeEffect.d.ts +10 -0
  197. package/RichText/PureRichText/hooks/useEditModeEffect.d.ts.map +1 -0
  198. package/RichText/PureRichText/hooks/useEditorSetup.d.ts +36 -0
  199. package/RichText/PureRichText/hooks/useEditorSetup.d.ts.map +1 -0
  200. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts +33 -0
  201. package/RichText/PureRichText/hooks/useFakeHighlight.d.ts.map +1 -0
  202. package/RichText/PureRichText/hooks/useFocusHandlers.d.ts +35 -0
  203. package/RichText/PureRichText/hooks/useFocusHandlers.d.ts.map +1 -0
  204. package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts +18 -0
  205. package/RichText/PureRichText/hooks/useKeyboardShortcuts.d.ts.map +1 -0
  206. package/RichText/PureRichText/hooks/useMouseHandlers.d.ts +24 -0
  207. package/RichText/PureRichText/hooks/useMouseHandlers.d.ts.map +1 -0
  208. package/RichText/PureRichText/hooks/useRichTextState.d.ts +38 -0
  209. package/RichText/PureRichText/hooks/useRichTextState.d.ts.map +1 -0
  210. package/RichText/PureRichText/hooks/useStepFontSize.d.ts +17 -0
  211. package/RichText/PureRichText/hooks/useStepFontSize.d.ts.map +1 -0
  212. package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts +18 -0
  213. package/RichText/PureRichText/hooks/useStepLineSpacing.d.ts.map +1 -0
  214. package/RichText/PureRichText/hooks/useTokenMap.d.ts +45 -0
  215. package/RichText/PureRichText/hooks/useTokenMap.d.ts.map +1 -0
  216. package/RichText/PureRichText/index.d.ts +16 -0
  217. package/RichText/PureRichText/index.d.ts.map +1 -0
  218. package/RichText/PureRichText/renderers/ElementRenderer.d.ts +8 -0
  219. package/RichText/PureRichText/renderers/ElementRenderer.d.ts.map +1 -0
  220. package/RichText/PureRichText/renderers/LeafRenderer.d.ts +8 -0
  221. package/RichText/PureRichText/renderers/LeafRenderer.d.ts.map +1 -0
  222. package/RichText/PureRichText/types.d.ts +111 -0
  223. package/RichText/PureRichText/types.d.ts.map +1 -0
  224. package/RichText/PureRichText/utils/a11yUtils.d.ts +9 -0
  225. package/RichText/PureRichText/utils/a11yUtils.d.ts.map +1 -0
  226. package/RichText/PureRichText/utils/fontSize.d.ts +6 -0
  227. package/RichText/PureRichText/utils/fontSize.d.ts.map +1 -0
  228. package/RichText/PureRichText/utils/slateUtils.d.ts +99 -0
  229. package/RichText/PureRichText/utils/slateUtils.d.ts.map +1 -0
  230. package/RichText/RichText.d.ts +17 -0
  231. package/RichText/RichText.d.ts.map +1 -0
  232. package/RichText/config.d.ts +4 -0
  233. package/RichText/config.d.ts.map +1 -0
  234. package/RichText/index.d.ts +7 -0
  235. package/RichText/index.d.ts.map +1 -0
  236. package/RichText.config.js +268 -0
  237. package/RichText.config.js.map +7 -0
  238. package/RichText.js +7674 -0
  239. package/RichText.js.map +7 -0
  240. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  241. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  242. package/Sankey/PureSankey/SankeyNode.d.ts +10 -3
  243. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  244. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  245. package/Sankey/PureSankey/SankeyUtils.d.ts +10 -0
  246. package/Sankey/PureSankey/SankeyUtils.d.ts.map +1 -1
  247. package/Sankey.config.js.map +1 -1
  248. package/Sankey.js +562 -290
  249. package/Sankey.js.map +4 -4
  250. package/Scatter/Scatter.d.ts.map +1 -1
  251. package/Scatter.config.js +81 -24
  252. package/Scatter.config.js.map +3 -3
  253. package/Scatter.js +528 -297
  254. package/Scatter.js.map +4 -4
  255. package/SingleValue/SingleValue.d.ts.map +1 -1
  256. package/SingleValue/config.d.ts.map +1 -1
  257. package/SingleValue.config.js +76 -24
  258. package/SingleValue.config.js.map +2 -2
  259. package/SingleValue.js +534 -314
  260. package/SingleValue.js.map +4 -4
  261. package/SingleValueBasic.js.map +1 -1
  262. package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
  263. package/SingleValueIcon/config.d.ts.map +1 -1
  264. package/SingleValueIcon.config.js +76 -24
  265. package/SingleValueIcon.config.js.map +2 -2
  266. package/SingleValueIcon.js +512 -287
  267. package/SingleValueIcon.js.map +4 -4
  268. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
  269. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
  270. package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
  271. package/SingleValueRadial/config.d.ts.map +1 -1
  272. package/SingleValueRadial.config.js +76 -24
  273. package/SingleValueRadial.config.js.map +2 -2
  274. package/SingleValueRadial.js +543 -326
  275. package/SingleValueRadial.js.map +4 -4
  276. package/TRELLIS.md +48 -0
  277. package/Table/PureTable.d.ts +1 -0
  278. package/Table/PureTable.d.ts.map +1 -1
  279. package/Table/Table.d.ts.map +1 -1
  280. package/Table/cells/ArrayCell.d.ts.map +1 -1
  281. package/Table/config.d.ts.map +1 -1
  282. package/Table/hooks.d.ts.map +1 -1
  283. package/Table/tableUtils.d.ts +14 -0
  284. package/Table/tableUtils.d.ts.map +1 -0
  285. package/Table.config.js +4 -10
  286. package/Table.config.js.map +2 -2
  287. package/Table.js +769 -355
  288. package/Table.js.map +4 -4
  289. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  290. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +5 -0
  291. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  292. package/Timeline/Timeline.d.ts +2 -0
  293. package/Timeline/Timeline.d.ts.map +1 -1
  294. package/Timeline/config.d.ts.map +1 -1
  295. package/Timeline/mockdata/timelineDataSource.d.ts +34 -0
  296. package/Timeline/mockdata/timelineDataSource.d.ts.map +1 -1
  297. package/Timeline.config.js +15 -0
  298. package/Timeline.config.js.map +2 -2
  299. package/Timeline.js +348 -186
  300. package/Timeline.js.map +4 -4
  301. package/common/Charting.d.ts.map +1 -1
  302. package/common/Charting.js +50 -28
  303. package/common/Charting.js.map +2 -2
  304. package/common/ChartingApi.d.ts +1 -1
  305. package/common/ChartingApi.d.ts.map +1 -1
  306. package/common/ChartingApi.js.map +2 -2
  307. package/common/DocExampleWithVizSandbox.js.map +1 -1
  308. package/common/OptionsDoc.js.map +1 -1
  309. package/common/OverviewDoc.js.map +1 -1
  310. package/common/SplunkVisualization.d.ts +1 -1
  311. package/common/SplunkVisualization.d.ts.map +1 -1
  312. package/common/SplunkVisualization.js +6 -4
  313. package/common/SplunkVisualization.js.map +2 -2
  314. package/common/StyledSkipLink.d.ts +2 -0
  315. package/common/StyledSkipLink.d.ts.map +1 -0
  316. package/common/StyledSkipLink.js +81 -0
  317. package/common/StyledSkipLink.js.map +7 -0
  318. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  319. package/common/TimeSeriesChartWrapper.js +228 -107
  320. package/common/TimeSeriesChartWrapper.js.map +4 -4
  321. package/common/chartingUtils.d.ts +32 -6
  322. package/common/chartingUtils.d.ts.map +1 -1
  323. package/common/chartingUtils.js +166 -39
  324. package/common/chartingUtils.js.map +4 -4
  325. package/common/components/TrellisTitle.d.ts.map +1 -1
  326. package/common/docUtils.js +1 -1
  327. package/common/docUtils.js.map +2 -2
  328. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  329. package/common/editorConfig/AxesChartYGridAndLabels.d.ts.map +1 -1
  330. package/common/editorConfig/BackgroundColor.d.ts +2 -2
  331. package/common/editorConfig/TrellisEditors.d.ts +33 -5
  332. package/common/editorConfig/TrellisEditors.d.ts.map +1 -1
  333. package/common/hocs/mockdata/trellisData.d.ts +54 -0
  334. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  335. package/common/hocs/withTrellis.d.ts +9 -0
  336. package/common/hocs/withTrellis.d.ts.map +1 -1
  337. package/common/hooks/useSorting.d.ts +2 -2
  338. package/common/hooks/useSorting.d.ts.map +1 -1
  339. package/common/shapeUtils.d.ts +1 -1
  340. package/common/shapeUtils.d.ts.map +1 -1
  341. package/common/shapeUtils.js.map +2 -2
  342. package/common/utils/dataUtils.js +2 -1
  343. package/common/utils/dataUtils.js.map +2 -2
  344. package/common/utils/focusUtils.d.ts +4 -0
  345. package/common/utils/focusUtils.d.ts.map +1 -0
  346. package/common/utils/focusUtils.js +101 -0
  347. package/common/utils/focusUtils.js.map +7 -0
  348. package/common/utils/mapUtils.js +2 -6
  349. package/common/utils/mapUtils.js.map +2 -2
  350. package/common/utils/singleValueUtils.js +14 -26
  351. package/common/utils/singleValueUtils.js.map +2 -2
  352. package/common/utils/trellisUtils.d.ts.map +1 -1
  353. package/common/utils/trellisUtils.js +76 -70
  354. package/common/utils/trellisUtils.js.map +2 -2
  355. package/common/withDashboardViz.d.ts.map +1 -1
  356. package/common/withDashboardViz.js +276 -151
  357. package/common/withDashboardViz.js.map +4 -4
  358. package/package.json +32 -27
  359. package/LICENSE.md +0 -449
package/FillerGauge.js CHANGED
@@ -12,6 +12,7 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
12
12
  var __getProtoOf = Object.getPrototypeOf;
13
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
14
  var __propIsEnum = Object.prototype.propertyIsEnumerable;
15
+ var __pow = Math.pow;
15
16
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
16
17
  var __spreadValues = (a, b) => {
17
18
  for (var prop in b || (b = {}))
@@ -59,6 +60,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
59
60
  mod
60
61
  ));
61
62
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
63
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
62
64
 
63
65
  // src/FillerGauge/index.ts
64
66
  var FillerGauge_exports = {};
@@ -314,26 +316,59 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
314
316
  const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
315
317
  return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
316
318
  };
317
- var TrellisEditorConfig = [
318
- [
319
- {
320
- label: (0, i18n_exports._)("Trellis layout"),
321
- option: "splitByLayout",
322
- editor: "editor.toggle",
323
- showEditor: isTrellisFeatureFlagOn
324
- }
325
- ],
326
- [
327
- {
328
- label: (0, i18n_exports._)("Split by"),
329
- option: "trellisSplitBy",
330
- editor: "editor.trellisSplitBy",
331
- editorProps: {
332
- dataSourceKey: "primary"
333
- },
334
- showEditor: isTrellisEnabled
335
- }
336
- ],
319
+ var sortByValuesBase = [
320
+ { label: (0, i18n_exports._)("Result"), value: "result" },
321
+ { label: (0, i18n_exports._)("Name"), value: "name" }
322
+ ];
323
+ var sortByValuesWithValue = [...sortByValuesBase, { label: (0, i18n_exports._)("Value"), value: "value" }];
324
+ var sortByValuesWithValueAndTrend = [
325
+ ...sortByValuesBase,
326
+ { label: (0, i18n_exports._)("Value"), value: "value" },
327
+ { label: (0, i18n_exports._)("Trend"), value: "trend" }
328
+ ];
329
+ var makeSortRow = (sortByValues) => [
330
+ {
331
+ label: (0, i18n_exports._)("Sort by"),
332
+ option: "trellisSortBy",
333
+ editor: "editor.select",
334
+ editorProps: {
335
+ values: sortByValues
336
+ },
337
+ showEditor: isTrellisEnabled
338
+ },
339
+ {
340
+ label: (0, i18n_exports._)("Sort order"),
341
+ option: "trellisSortOrder",
342
+ editor: "editor.select",
343
+ editorProps: {
344
+ values: [
345
+ { label: (0, i18n_exports._)("Ascending"), value: "ascending" },
346
+ { label: (0, i18n_exports._)("Descending"), value: "descending" }
347
+ ]
348
+ },
349
+ showEditor: isTrellisEnabled
350
+ }
351
+ ];
352
+ var trellisLayoutRow = [
353
+ {
354
+ label: (0, i18n_exports._)("Trellis layout"),
355
+ option: "splitByLayout",
356
+ editor: "editor.toggle",
357
+ showEditor: isTrellisFeatureFlagOn
358
+ }
359
+ ];
360
+ var trellisSplitByRow = [
361
+ {
362
+ label: (0, i18n_exports._)("Split by"),
363
+ option: "trellisSplitBy",
364
+ editor: "editor.trellisSplitBy",
365
+ editorProps: {
366
+ dataSourceKey: "primary"
367
+ },
368
+ showEditor: isTrellisEnabled
369
+ }
370
+ ];
371
+ var trellisLayoutRows = [
337
372
  [
338
373
  {
339
374
  label: (0, i18n_exports._)("Number of columns"),
@@ -377,6 +412,24 @@ var TrellisEditorConfig = [
377
412
  }
378
413
  ]
379
414
  ];
415
+ var TrellisEditorConfig = [
416
+ trellisLayoutRow,
417
+ trellisSplitByRow,
418
+ makeSortRow(sortByValuesBase),
419
+ ...trellisLayoutRows
420
+ ];
421
+ var GaugeTrellisEditorConfig = [
422
+ trellisLayoutRow,
423
+ trellisSplitByRow,
424
+ makeSortRow(sortByValuesWithValue),
425
+ ...trellisLayoutRows
426
+ ];
427
+ var SingleValueTrellisEditorConfig = [
428
+ trellisLayoutRow,
429
+ trellisSplitByRow,
430
+ makeSortRow(sortByValuesWithValueAndTrend),
431
+ ...trellisLayoutRows
432
+ ];
380
433
  var TimechartTrellisEditorConfig = [
381
434
  [
382
435
  {
@@ -384,7 +437,6 @@ var TimechartTrellisEditorConfig = [
384
437
  option: "splitByLayout",
385
438
  editor: "editor.toggle",
386
439
  showEditor: isTrellisFeatureFlagOn,
387
- // add help text for timecharts
388
440
  editorProps: {
389
441
  help: (0, i18n_exports._)(
390
442
  "Y2-axis and overlay field configurations are not supported when trellis is enabled."
@@ -393,7 +445,9 @@ var TimechartTrellisEditorConfig = [
393
445
  }
394
446
  }
395
447
  ],
396
- ...TrellisEditorConfig.slice(1),
448
+ trellisSplitByRow,
449
+ makeSortRow(sortByValuesBase),
450
+ ...trellisLayoutRows,
397
451
  [
398
452
  {
399
453
  label: (0, i18n_exports._)("Shared y-axis scale"),
@@ -528,7 +582,7 @@ var editorConfig = [
528
582
  },
529
583
  {
530
584
  label: Gauge_default.label,
531
- layout: [...Gauge_default.layout, ...TrellisEditorConfig]
585
+ layout: [...Gauge_default.layout, ...GaugeTrellisEditorConfig]
532
586
  },
533
587
  {
534
588
  label: (0, i18n_exports._)("Color and style"),
@@ -542,7 +596,7 @@ var editorConfig = [
542
596
  presets,
543
597
  value: ({ context, options }) => {
544
598
  const initialPreset = getInitialPreset(context, options, presets);
545
- return initialPreset && initialPreset.label || null;
599
+ return (initialPreset == null ? void 0 : initialPreset.label) || null;
546
600
  }
547
601
  }
548
602
  }
@@ -726,7 +780,7 @@ var DefaultVizActionHandler = class {
726
780
  var INITIAL_HEIGHT = 250;
727
781
  var SplunkVisualization = class {
728
782
  };
729
- SplunkVisualization.propTypes = {
783
+ __publicField(SplunkVisualization, "propTypes", {
730
784
  /**
731
785
  * display mode
732
786
  */
@@ -802,11 +856,11 @@ SplunkVisualization.propTypes = {
802
856
  * A callback to request new data with updated request params
803
857
  */
804
858
  onRequestParamsChange: prop_types_exports.func
805
- };
859
+ });
806
860
  /**
807
861
  *
808
862
  */
809
- SplunkVisualization.defaults = {
863
+ __publicField(SplunkVisualization, "defaults", {
810
864
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
811
865
  width: "100%",
812
866
  height: INITIAL_HEIGHT,
@@ -821,7 +875,7 @@ SplunkVisualization.defaults = {
821
875
  onComputedProps: () => ({}),
822
876
  loading: false,
823
877
  onRequestParamsChange: lodash_exports.noop
824
- };
878
+ });
825
879
  var SplunkVisualization_default = SplunkVisualization;
826
880
 
827
881
  // src/common/interfaces/DataSource.ts
@@ -875,9 +929,9 @@ var usePaginationParams = ({
875
929
  meta,
876
930
  onRequestParamsChange
877
931
  }) => {
878
- const totalCount = meta && meta.totalCount || 0;
879
- const offset = requestParams && requestParams.offset || 0;
880
- const count = requestParams && requestParams.count;
932
+ const totalCount = (meta == null ? void 0 : meta.totalCount) || 0;
933
+ const offset = (requestParams == null ? void 0 : requestParams.offset) || 0;
934
+ const count = requestParams == null ? void 0 : requestParams.count;
881
935
  const totalPages = typeof count === "number" && count > 0 ? Math.ceil(totalCount / count) : 0;
882
936
  const current = typeof count === "number" && count > 0 ? Math.floor(offset / count) + 1 : 0;
883
937
  const isPaging = totalPages > 1 && typeof onRequestParamsChange === "function";
@@ -985,7 +1039,7 @@ var Cover = styled_components_default.div`
985
1039
  bottom: 0;
986
1040
  `;
987
1041
  var Blocker = styled_components_default.div.attrs({
988
- "data-splunk-visualization-version": "28.5.2 - fd77ce608"
1042
+ "data-splunk-visualization-version": "28.6.0 - 92427899a"
989
1043
  })`
990
1044
  position: relative;
991
1045
  width: 100%;
@@ -1075,7 +1129,7 @@ var withFixedSizeContainer = (Viz) => {
1075
1129
  FixSizeItem,
1076
1130
  {
1077
1131
  "data-test": "fix-size-item",
1078
- "data-splunk-visualization-version": "28.5.2 - fd77ce608",
1132
+ "data-splunk-visualization-version": "28.6.0 - 92427899a",
1079
1133
  width,
1080
1134
  height,
1081
1135
  backgroundColor
@@ -1581,7 +1635,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
1581
1635
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
1582
1636
  let splitDataSources = null;
1583
1637
  let errorCode = null;
1584
- if (fields && fields.length) {
1638
+ if (fields == null ? void 0 : fields.length) {
1585
1639
  splitDataSources = {};
1586
1640
  for (let i = 0; i < fields.length; i += 1) {
1587
1641
  const fieldName = fields[i].name;
@@ -1632,7 +1686,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
1632
1686
  }
1633
1687
  });
1634
1688
  });
1635
- } else if ((!splitByFields || !splitByFields.length) && fields.length > 1) {
1689
+ } else if (!(splitByFields == null ? void 0 : splitByFields.length) && fields.length > 1) {
1636
1690
  splitDataSources = {};
1637
1691
  for (let i = 1; i < fields.length; i += 1) {
1638
1692
  const fieldName = fields[i].name;
@@ -1688,7 +1742,7 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
1688
1742
  if (fields.length > 0) {
1689
1743
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
1690
1744
  }
1691
- if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
1745
+ if (splitByFields == null ? void 0 : splitByFields.includes(splitBy)) {
1692
1746
  splitDataSources = {};
1693
1747
  const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
1694
1748
  const valueKeys = [];
@@ -1719,6 +1773,68 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
1719
1773
  }
1720
1774
  return { splitDataSources, errorCode };
1721
1775
  };
1776
+ var splitRowWise = (dataSource, columns, fields, otherSplitBy, dataSourceKeys, nonDataSourceAggregations) => {
1777
+ const splitDataSources = {};
1778
+ const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
1779
+ valueKeys.forEach((val, idx) => {
1780
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)((0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"]));
1781
+ splitDataSources[val].primary.data.fields = [];
1782
+ if (otherSplitBy.length) {
1783
+ splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
1784
+ }
1785
+ if (dataSourceKeys.length) {
1786
+ const columnValues = [[]];
1787
+ splitDataSources[val].primary.data.fields = [
1788
+ ...splitDataSources[val].primary.data.fields,
1789
+ ...dataSourceKeys.map((k) => ({ name: k }))
1790
+ ];
1791
+ dataSourceKeys.forEach(() => {
1792
+ columnValues.push([]);
1793
+ });
1794
+ for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
1795
+ columnValues[0].push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
1796
+ dataSourceKeys.forEach((dskey, dsIndx) => {
1797
+ const mul = (fields.length - 1) / dataSourceKeys.length;
1798
+ columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
1799
+ });
1800
+ }
1801
+ splitDataSources[val].primary.data.columns = columnValues;
1802
+ } else if (nonDataSourceAggregations.length) {
1803
+ const columnValues = [];
1804
+ fields.forEach((aggregationField, fieldIdx) => {
1805
+ if (fieldIdx > 0) {
1806
+ splitDataSources[val].primary.data.fields.push(aggregationField);
1807
+ columnValues.push([columns[fieldIdx][idx]]);
1808
+ }
1809
+ });
1810
+ splitDataSources[val].primary.data.columns = columnValues;
1811
+ }
1812
+ });
1813
+ return splitDataSources;
1814
+ };
1815
+ var splitColumnWise = (dataSource, columns, fields, otherSplitBy, dataSourceKeys) => {
1816
+ const splitDataSources = {};
1817
+ const valueKeys = [];
1818
+ for (let i = 1; i < fields.length; i += 1) {
1819
+ valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
1820
+ }
1821
+ valueKeys.forEach((val) => {
1822
+ splitDataSources[val] = (0, lodash_exports.cloneDeep)((0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"]));
1823
+ splitDataSources[val].primary.data.fields = [
1824
+ { name: otherSplitBy[0] },
1825
+ ...dataSourceKeys.map((k) => ({ name: k }))
1826
+ ];
1827
+ splitDataSources[val].primary.data.columns = [[...columns[0]]];
1828
+ dataSourceKeys.forEach((dsKey) => {
1829
+ fields.forEach((field, idx) => {
1830
+ if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
1831
+ splitDataSources[val].primary.data.columns.push([...columns[idx]]);
1832
+ }
1833
+ });
1834
+ });
1835
+ });
1836
+ return splitDataSources;
1837
+ };
1722
1838
  var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
1723
1839
  var _a, _b, _c, _d;
1724
1840
  const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
@@ -1729,8 +1845,7 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
1729
1845
  if (fields.length > 0) {
1730
1846
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
1731
1847
  }
1732
- if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
1733
- splitDataSources = {};
1848
+ if (splitByFields == null ? void 0 : splitByFields.includes(splitBy)) {
1734
1849
  const splitByFieldIdx = splitByFields.findIndex((f) => f === splitBy);
1735
1850
  const otherSplitBy = splitByFields.filter((f) => f !== splitBy);
1736
1851
  const dataSourceKeys = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
@@ -1741,71 +1856,16 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
1741
1856
  }
1742
1857
  }
1743
1858
  if (splitByFieldIdx === 0) {
1744
- const valueKeys = (0, lodash_exports.cloneDeep)(columns[0]);
1745
- valueKeys.forEach((val, idx) => {
1746
- splitDataSources[val] = (0, lodash_exports.cloneDeep)(
1747
- (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
1748
- );
1749
- splitDataSources[val].primary.data.fields = [];
1750
- if (otherSplitBy.length) {
1751
- splitDataSources[val].primary.data.fields = [{ name: otherSplitBy[0] }];
1752
- }
1753
- if (dataSourceKeys.length) {
1754
- const columnValues = [[]];
1755
- splitDataSources[val].primary.data.fields = [
1756
- ...splitDataSources[val].primary.data.fields,
1757
- ...dataSourceKeys.map((k) => ({
1758
- name: k
1759
- }))
1760
- ];
1761
- dataSourceKeys.forEach(() => {
1762
- columnValues.push([]);
1763
- });
1764
- for (let i = 1; i <= Math.ceil((fields.length - 1) / dataSourceKeys.length); i += 1) {
1765
- columnValues[0].push(
1766
- fields[i].splitby_value ? fields[i].splitby_value : fields[i].name
1767
- );
1768
- dataSourceKeys.forEach((dskey, dsIndx) => {
1769
- const mul = (fields.length - 1) / dataSourceKeys.length;
1770
- columnValues[dsIndx + 1].push(columns[i + dsIndx * mul][idx]);
1771
- });
1772
- }
1773
- splitDataSources[val].primary.data.columns = columnValues;
1774
- } else if (nonDataSourceAggregations.length) {
1775
- const columnValues = [];
1776
- fields.forEach((aggregationField, fieldIdx) => {
1777
- if (fieldIdx > 0) {
1778
- splitDataSources[val].primary.data.fields.push(aggregationField);
1779
- columnValues.push([columns[fieldIdx][idx]]);
1780
- }
1781
- });
1782
- splitDataSources[val].primary.data.columns = columnValues;
1783
- }
1784
- });
1859
+ splitDataSources = splitRowWise(
1860
+ dataSource,
1861
+ columns,
1862
+ fields,
1863
+ otherSplitBy,
1864
+ dataSourceKeys,
1865
+ nonDataSourceAggregations
1866
+ );
1785
1867
  } else {
1786
- const valueKeys = [];
1787
- for (let i = 1; i < fields.length; i += 1) {
1788
- valueKeys.push(fields[i].splitby_value ? fields[i].splitby_value : fields[i].name);
1789
- }
1790
- valueKeys.forEach((val) => {
1791
- splitDataSources[val] = (0, lodash_exports.cloneDeep)(
1792
- (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
1793
- );
1794
- splitDataSources[val].primary.data.fields = [
1795
- { name: otherSplitBy[0] },
1796
- ...dataSourceKeys.map((k) => ({
1797
- name: k
1798
- }))
1799
- ];
1800
- splitDataSources[val].primary.data.columns = [[...columns[0]]];
1801
- dataSourceKeys.forEach((dsKey) => {
1802
- fields.forEach((field, idx) => {
1803
- if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
1804
- splitDataSources[val].primary.data.columns.push([...columns[idx]]);
1805
- }
1806
- });
1807
- });
1808
- });
1868
+ splitDataSources = splitColumnWise(dataSource, columns, fields, otherSplitBy, dataSourceKeys);
1809
1869
  }
1810
1870
  } else {
1811
1871
  errorCode = "INVALID_SPLIT_BY_FIELD";
@@ -1823,7 +1883,7 @@ var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
1823
1883
  splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
1824
1884
  }
1825
1885
  const splitByIndex = fields.findIndex((field) => field.name === splitBy);
1826
- if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
1886
+ if (splitByFields == null ? void 0 : splitByFields.includes(splitBy)) {
1827
1887
  const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
1828
1888
  splitDataSources = {};
1829
1889
  splitByColumn.forEach((val, idx) => {
@@ -1945,6 +2005,24 @@ var defaultImport32 = __toESM(require("@splunk/react-icons/Triangle"));
1945
2005
  __reExport(Triangle_exports, require("@splunk/react-icons/Triangle"));
1946
2006
  var Triangle_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
1947
2007
 
2008
+ // esm-externals:@splunk/visualizations-shared/propUtils
2009
+ var propUtils_exports = {};
2010
+ __export(propUtils_exports, {
2011
+ default: () => propUtils_default
2012
+ });
2013
+ var defaultImport33 = __toESM(require("@splunk/visualizations-shared/propUtils"));
2014
+ __reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
2015
+ var propUtils_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
2016
+
2017
+ // esm-externals:@splunk/visualizations-shared/simpleXMLOptions
2018
+ var simpleXMLOptions_exports = {};
2019
+ __export(simpleXMLOptions_exports, {
2020
+ default: () => simpleXMLOptions_default
2021
+ });
2022
+ var defaultImport34 = __toESM(require("@splunk/visualizations-shared/simpleXMLOptions"));
2023
+ __reExport(simpleXMLOptions_exports, require("@splunk/visualizations-shared/simpleXMLOptions"));
2024
+ var simpleXMLOptions_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
2025
+
1948
2026
  // src/common/chartingUtils.ts
1949
2027
  var DEFAULT_LINE_WIDTH = 2;
1950
2028
  var getAnnotationsForCanvas = ({
@@ -1982,9 +2060,9 @@ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1982
2060
  const xAxisIsTime = xField === "_time";
1983
2061
  return !!rangeSelectEventHandler && xAxisIsTime;
1984
2062
  };
1985
- var canvasSupportedTimeSeriesCharts = ["splunk.line"];
2063
+ var canvasSupportedTimeSeriesCharts = ["splunk.line", "splunk.area"];
1986
2064
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1987
- return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
2065
+ return canvasSupportedTimeSeriesCharts.includes(vizConfigKey);
1988
2066
  };
1989
2067
  var filterChartDataFromInternalFields = (chartData) => {
1990
2068
  const { fields, columns } = chartData;
@@ -2139,46 +2217,66 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
2139
2217
  }
2140
2218
  return y2Config;
2141
2219
  };
2142
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
2220
+ var getSeriesType = (isOverlay, isAreaChart, isStacked) => {
2221
+ if (isOverlay) return "line";
2222
+ if (!isAreaChart) return void 0;
2223
+ return isStacked ? "stacked-area" : "area";
2224
+ };
2225
+ var getY2Scale = (field, y2fields, overlayFields) => {
2226
+ const assignToY2 = (y2fields == null ? void 0 : y2fields.length) > 0 && y2fields.includes(field) || !(y2fields == null ? void 0 : y2fields.length) && (overlayFields == null ? void 0 : overlayFields.includes(field));
2227
+ return assignToY2 ? "y2" : "y";
2228
+ };
2229
+ var getSeriesOverrides = (opts) => {
2230
+ var _a;
2231
+ const {
2232
+ yfields,
2233
+ y2fields,
2234
+ lineWidth,
2235
+ overlayFields,
2236
+ y2Enabled,
2237
+ nullValueMode,
2238
+ markerDisplay,
2239
+ lineDashStyle,
2240
+ lineDashStylesByField,
2241
+ stepPosition,
2242
+ stepPositionsByField,
2243
+ type,
2244
+ stackMode,
2245
+ showLines
2246
+ } = opts;
2143
2247
  const seriesConfig = {};
2144
2248
  let spanGaps;
2145
- let replaceNullsWithZero;
2146
2249
  if (nullValueMode === "gaps") {
2147
2250
  spanGaps = false;
2148
- } else if (nullValueMode === "connect" || nullValueMode === "zero") {
2251
+ } else if (nullValueMode != null) {
2149
2252
  spanGaps = true;
2150
- if (nullValueMode === "zero") {
2151
- replaceNullsWithZero = true;
2152
- }
2253
+ } else {
2254
+ spanGaps = void 0;
2153
2255
  }
2154
- yfields.forEach((field) => {
2256
+ const replaceNullsWithZero = nullValueMode === "zero" ? true : void 0;
2257
+ const isAreaChart = type === "area";
2258
+ const isStacked = isAreaChart && (stackMode === "stacked" || stackMode === "stacked100");
2259
+ const areaFields = isAreaChart ? yfields.filter((f) => !(overlayFields == null ? void 0 : overlayFields.includes(f))) : yfields;
2260
+ const overlayFieldsInOrder = (_a = overlayFields == null ? void 0 : overlayFields.filter((f) => yfields.includes(f))) != null ? _a : [];
2261
+ const orderedFields = isAreaChart ? [...areaFields, ...overlayFieldsInOrder] : yfields;
2262
+ orderedFields.forEach((field) => {
2263
+ var _a2;
2264
+ const isOverlay = (_a2 = overlayFields == null ? void 0 : overlayFields.includes(field)) != null ? _a2 : false;
2265
+ const isPercent = isAreaChart && stackMode === "stacked100" && !isOverlay;
2266
+ const shouldHideAreaOutline = isAreaChart && showLines === false && !isOverlay;
2155
2267
  seriesConfig[field] = {
2156
- overrides: { width: lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH }
2268
+ overrides: __spreadValues({
2269
+ width: shouldHideAreaOutline ? 0 : lineWidth != null ? lineWidth : DEFAULT_LINE_WIDTH
2270
+ }, isPercent ? { stacking: { mode: "percent", group: "A" } } : {})
2157
2271
  };
2158
- if (spanGaps !== void 0) {
2159
- seriesConfig[field].overrides.spanGaps = spanGaps;
2160
- }
2161
- if (y2Enabled) {
2162
- const shouldAssignToY2 = (
2163
- // If y2Fields are present, assign all y2Fields to y2 scale
2164
- (y2fields == null ? void 0 : y2fields.length) > 0 && y2fields.includes(field) || // Else, assign all overlayFields to y2 scale
2165
- (!y2fields || y2fields.length === 0) && (overlayFields == null ? void 0 : overlayFields.includes(field))
2166
- );
2167
- if (shouldAssignToY2) {
2168
- seriesConfig[field].overrides.scale = "y2";
2169
- } else {
2170
- seriesConfig[field].overrides.scale = "y";
2171
- }
2172
- }
2173
- if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
2174
- seriesConfig[field].type = "line";
2175
- }
2176
- if (markerDisplay !== void 0) {
2177
- seriesConfig[field].markerDisplay = markerDisplay;
2178
- }
2179
- const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2180
- if (fieldDashStyle) {
2181
- seriesConfig[field].lineDashStyle = fieldDashStyle;
2272
+ const seriesType = getSeriesType(isOverlay, isAreaChart, isStacked);
2273
+ if (seriesType !== void 0) seriesConfig[field].type = seriesType;
2274
+ if (spanGaps !== void 0) seriesConfig[field].overrides.spanGaps = spanGaps;
2275
+ if (y2Enabled) seriesConfig[field].overrides.scale = getY2Scale(field, y2fields, overlayFields);
2276
+ if (markerDisplay !== void 0) seriesConfig[field].markerDisplay = markerDisplay;
2277
+ if (!isAreaChart || isOverlay) {
2278
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2279
+ if (fieldDashStyle) seriesConfig[field].lineDashStyle = fieldDashStyle;
2182
2280
  }
2183
2281
  const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
2184
2282
  const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
@@ -2249,8 +2347,27 @@ var TrellisTitleDiv = styled_components_default.div`
2249
2347
  background-color: ${(props) => props.backgroundColor};
2250
2348
  box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
2251
2349
  `;
2350
+ var formatTrellisKey = (value) => {
2351
+ if (value === null || value === void 0) {
2352
+ return "";
2353
+ }
2354
+ if (typeof value === "string") {
2355
+ return value;
2356
+ }
2357
+ if (typeof value === "number" || typeof value === "boolean") {
2358
+ return value.toString();
2359
+ }
2360
+ if (typeof value === "symbol") {
2361
+ return value.toString();
2362
+ }
2363
+ try {
2364
+ return JSON.stringify(value);
2365
+ } catch (e) {
2366
+ return typeof value === "bigint" ? value.toString() : "";
2367
+ }
2368
+ };
2252
2369
  var TrellisTitle = (props) => {
2253
- const titleText = String(props.trellisKey).toString();
2370
+ const titleText = formatTrellisKey(props.trellisKey);
2254
2371
  return /* @__PURE__ */ react_exports.createElement(
2255
2372
  TrellisTitleDiv,
2256
2373
  {
@@ -2386,6 +2503,38 @@ var parseArrayOption = (value) => {
2386
2503
  }
2387
2504
  return void 0;
2388
2505
  };
2506
+ var getAreaOpacityForCanvas = (areaOpacity) => (
2507
+ // Preserve legacy visualizations behavior where area opacity is squared to match charting output.
2508
+ areaOpacity !== void 0 && areaOpacity !== null ? __pow(areaOpacity, 2) : areaOpacity
2509
+ );
2510
+ var parseTickIntervalOption = (simpleXMLValue, canvasValue) => {
2511
+ if (simpleXMLValue) return Number(simpleXMLValue);
2512
+ if (canvasValue) return Number(canvasValue);
2513
+ return void 0;
2514
+ };
2515
+ var getYAxisTitles = ({
2516
+ y2Enabled,
2517
+ yFields,
2518
+ y2Fields,
2519
+ overlayFields,
2520
+ yAxisTitleText,
2521
+ yAxisTitleVisibility,
2522
+ y2AxisTitleText,
2523
+ y2AxisTitleVisibility,
2524
+ containerHeight
2525
+ }) => {
2526
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2527
+ const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
2528
+ const yAxisTitle = ellipsisAxisTitle(
2529
+ getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility),
2530
+ containerHeight
2531
+ );
2532
+ const y2AxisTitle = ellipsisAxisTitle(
2533
+ getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility),
2534
+ containerHeight
2535
+ );
2536
+ return { yAxisTitle, y2AxisTitle };
2537
+ };
2389
2538
  var TimeSeriesChartWrapper = (props) => {
2390
2539
  var _b, _c, _d;
2391
2540
  const _a = props, {
@@ -2475,6 +2624,8 @@ var TimeSeriesChartWrapper = (props) => {
2475
2624
  "chart.overlayFields": overlayFieldsStr,
2476
2625
  "chart.nullValueMode": nullValueMode,
2477
2626
  "chart.showDataLabels": showDataLabels,
2627
+ "chart.showLines": showLines,
2628
+ "chart.stackMode": stackMode,
2478
2629
  lineWidth,
2479
2630
  lineDashStyle,
2480
2631
  fieldDashStyles: lineDashStylesByFieldStr,
@@ -2503,7 +2654,10 @@ var TimeSeriesChartWrapper = (props) => {
2503
2654
  yAxisMinorTickSize,
2504
2655
  y2AxisMinorTickSize,
2505
2656
  showYAxisWithZero: showYAxisWithZeroFromOptions,
2506
- showY2AxisWithZero: showY2AxisWithZeroFromOptions
2657
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions,
2658
+ // area only props
2659
+ areaFillOpacity: areaOpacity,
2660
+ chart: chartType
2507
2661
  } = options;
2508
2662
  const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
2509
2663
  const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
@@ -2520,13 +2674,11 @@ var TimeSeriesChartWrapper = (props) => {
2520
2674
  const yAxisMax = parseAxisValue(yAxisMaxRaw);
2521
2675
  const y2AxisMin = parseAxisValue(y2AxisMinRaw);
2522
2676
  const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
2523
- const parseTickInterval = (simpleXMLValue, canvasValue) => {
2524
- if (simpleXMLValue) return Number(simpleXMLValue);
2525
- if (canvasValue) return Number(canvasValue);
2526
- return void 0;
2527
- };
2528
- const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
2529
- const y2AxisMajorTickIntervalNum = parseTickInterval(
2677
+ const yAxisMajorTickIntervalNum = parseTickIntervalOption(
2678
+ yAxisMajorUnitFromSimpleXML,
2679
+ yAxisMajorTickInterval
2680
+ );
2681
+ const y2AxisMajorTickIntervalNum = parseTickIntervalOption(
2530
2682
  y2AxisMajorUnitFromSimpleXML,
2531
2683
  y2AxisMajorTickInterval
2532
2684
  );
@@ -2535,6 +2687,7 @@ var TimeSeriesChartWrapper = (props) => {
2535
2687
  const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
2536
2688
  const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
2537
2689
  const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
2690
+ const areaOpacityForCanvas = getAreaOpacityForCanvas(areaOpacity);
2538
2691
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
2539
2692
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
2540
2693
  const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
@@ -2565,26 +2718,40 @@ var TimeSeriesChartWrapper = (props) => {
2565
2718
  );
2566
2719
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
2567
2720
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
2568
- const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2569
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
2570
- yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
2571
- const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
2572
- let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
2573
- y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
2721
+ const { yAxisTitle, y2AxisTitle } = getYAxisTitles({
2722
+ y2Enabled,
2723
+ yFields,
2724
+ y2Fields,
2725
+ overlayFields,
2726
+ yAxisTitleText,
2727
+ yAxisTitleVisibility,
2728
+ y2AxisTitleText,
2729
+ y2AxisTitleVisibility,
2730
+ containerHeight
2731
+ });
2574
2732
  const xScaleConfig = (0, react_exports.useMemo)(
2575
2733
  () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
2576
2734
  [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
2577
2735
  );
2736
+ const isStacked100 = stackMode === "stacked100";
2578
2737
  const yScaleConfig = (0, react_exports.useMemo)(
2579
- () => getYScaleConfig(
2580
- yAxisTitle,
2581
- yAxisAbbreviation,
2582
- yAxisScale,
2583
- yAxisLabelVisibility,
2584
- yAxisMin,
2585
- yAxisMax
2586
- ),
2587
- [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
2738
+ () => {
2739
+ const config3 = getYScaleConfig(
2740
+ yAxisTitle,
2741
+ yAxisAbbreviation,
2742
+ yAxisScale,
2743
+ yAxisLabelVisibility,
2744
+ yAxisMin,
2745
+ yAxisMax
2746
+ );
2747
+ if (isStacked100) {
2748
+ config3.y.tickFmt = (v) => `${Math.round(v * 100)}%`;
2749
+ config3.y.range = () => [0, 1];
2750
+ }
2751
+ return config3;
2752
+ },
2753
+ // eslint-disable-next-line react-hooks/exhaustive-deps
2754
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax, isStacked100]
2588
2755
  );
2589
2756
  const y2ScaleConfig = (0, react_exports.useMemo)(() => {
2590
2757
  if (y2Enabled) {
@@ -2616,10 +2783,11 @@ var TimeSeriesChartWrapper = (props) => {
2616
2783
  ];
2617
2784
  chartData.fields = filteredChartData.fields;
2618
2785
  chartData.columns = seriesDataFormatted;
2786
+ const normalizedStackMode = stackMode === "stacked" || stackMode === "stacked100" ? stackMode : "auto";
2619
2787
  const seriesOverrides = (0, react_exports.useMemo)(
2620
- () => getSeriesOverrides(
2621
- yFields,
2622
- y2Fields,
2788
+ () => getSeriesOverrides({
2789
+ yfields: yFields,
2790
+ y2fields: y2Fields,
2623
2791
  lineWidth,
2624
2792
  overlayFields,
2625
2793
  y2Enabled,
@@ -2628,8 +2796,11 @@ var TimeSeriesChartWrapper = (props) => {
2628
2796
  lineDashStyle,
2629
2797
  lineDashStylesByField,
2630
2798
  stepPosition,
2631
- stepPositionsByField
2632
- ),
2799
+ stepPositionsByField,
2800
+ type: chartType,
2801
+ stackMode: normalizedStackMode,
2802
+ showLines
2803
+ }),
2633
2804
  [
2634
2805
  yFields,
2635
2806
  y2Fields,
@@ -2641,7 +2812,10 @@ var TimeSeriesChartWrapper = (props) => {
2641
2812
  lineDashStyle,
2642
2813
  lineDashStylesByField,
2643
2814
  stepPosition,
2644
- stepPositionsByField
2815
+ stepPositionsByField,
2816
+ chartType,
2817
+ normalizedStackMode,
2818
+ showLines
2645
2819
  ]
2646
2820
  );
2647
2821
  const chartingEventAnnotations = (0, react_exports.useMemo)(
@@ -2709,50 +2883,54 @@ var TimeSeriesChartWrapper = (props) => {
2709
2883
  react_exports.useEffect(() => {
2710
2884
  additionalTooltipValuesRef.current = additionalTooltipValues;
2711
2885
  }, [additionalTooltipValues]);
2886
+ const handleCrosshairMouseout = react_exports.useCallback(() => {
2887
+ if (onPointMouseOut && lastPayloadRef.current) {
2888
+ onPointMouseOut({
2889
+ type: "point.mouseout",
2890
+ originalEvent: lastOriginalEventRef.current,
2891
+ payload: lastPayloadRef.current
2892
+ });
2893
+ }
2894
+ previousMouseoverPayloadRef.current = null;
2895
+ }, [onPointMouseOut]);
2712
2896
  const handleChartCrosshairChange = react_exports.useCallback(
2713
2897
  (event) => {
2714
- if (onPointMouseOver || onPointMouseOut) {
2715
- if (!event) {
2716
- if (onPointMouseOut && lastPayloadRef.current) {
2717
- onPointMouseOut({
2718
- type: "point.mouseout",
2719
- originalEvent: lastOriginalEventRef.current,
2720
- payload: lastPayloadRef.current
2721
- });
2722
- }
2723
- previousMouseoverPayloadRef.current = null;
2724
- return;
2725
- }
2726
- const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
2727
- name: event.seriesKey
2898
+ if (!onPointMouseOver && !onPointMouseOut) {
2899
+ return;
2900
+ }
2901
+ if (!event) {
2902
+ handleCrosshairMouseout();
2903
+ return;
2904
+ }
2905
+ const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
2906
+ name: event.seriesKey
2907
+ });
2908
+ delete payload.seriesKey;
2909
+ if (event.rowContext) {
2910
+ Object.assign(
2911
+ payload,
2912
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
2913
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2914
+ return acc;
2915
+ }, {})
2916
+ );
2917
+ }
2918
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2919
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2920
+ return;
2921
+ }
2922
+ lastPayloadRef.current = updatedPayload;
2923
+ lastOriginalEventRef.current = event;
2924
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
2925
+ if (onPointMouseOver) {
2926
+ onPointMouseOver({
2927
+ type: "point.mouseover",
2928
+ originalEvent: event,
2929
+ payload: updatedPayload
2728
2930
  });
2729
- delete payload.seriesKey;
2730
- if (event.rowContext) {
2731
- Object.assign(
2732
- payload,
2733
- Object.keys(event.rowContext).reduce((acc, fieldName) => {
2734
- acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2735
- return acc;
2736
- }, {})
2737
- );
2738
- }
2739
- const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2740
- if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2741
- return;
2742
- }
2743
- lastPayloadRef.current = updatedPayload;
2744
- lastOriginalEventRef.current = event;
2745
- previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
2746
- if (onPointMouseOver) {
2747
- onPointMouseOver({
2748
- type: "point.mouseover",
2749
- originalEvent: event,
2750
- payload: updatedPayload
2751
- });
2752
- }
2753
2931
  }
2754
2932
  },
2755
- [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
2933
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy, handleCrosshairMouseout]
2756
2934
  );
2757
2935
  const dataKey = `${(_b = chartData.columns[0]) == null ? void 0 : _b[0]}-${(_c = chartData.columns[0]) == null ? void 0 : _c[chartData.columns[0].length - 1]}-${(_d = chartData.columns[0]) == null ? void 0 : _d.length}`;
2758
2936
  const memoizedChart = (0, react_exports.useMemo)(() => {
@@ -2807,7 +2985,8 @@ var TimeSeriesChartWrapper = (props) => {
2807
2985
  showXAxisLine,
2808
2986
  showYAxisLine,
2809
2987
  showY2AxisLine,
2810
- xAxisMaxLabelParts
2988
+ xAxisMaxLabelParts,
2989
+ areaOpacity: areaOpacityForCanvas
2811
2990
  }
2812
2991
  ));
2813
2992
  }, [
@@ -2859,7 +3038,8 @@ var TimeSeriesChartWrapper = (props) => {
2859
3038
  showYAxisLine,
2860
3039
  showY2AxisLine,
2861
3040
  legendMode,
2862
- xAxisMaxLabelParts
3041
+ xAxisMaxLabelParts,
3042
+ areaOpacityForCanvas
2863
3043
  ]);
2864
3044
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
2865
3045
  return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
@@ -2887,6 +3067,37 @@ var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
2887
3067
 
2888
3068
  // src/common/withDashboardViz.tsx
2889
3069
  var SanitizedTimeSeriesChartWrapper = (0, SanitizeProps_exports.withSanitizedProps)(TimeSeriesChartWrapper_default);
3070
+ var buildEventCallbackProps = (supportedEvents, evaluatedOptionsToUse, onEventTrigger) => {
3071
+ const result = {};
3072
+ Object.keys(supportedEvents).forEach((eventName) => {
3073
+ const { parentKeys, payloadKeys } = supportedEvents[eventName];
3074
+ const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
3075
+ let payload = {};
3076
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
3077
+ payloadKeys.forEach((p) => {
3078
+ payload[p] = evaluatedOptionsToUse[p];
3079
+ });
3080
+ }
3081
+ result[eventCallbackPropName] = (ev) => {
3082
+ if (ev == null ? void 0 : ev.payload) {
3083
+ payload = __spreadValues({}, ev.payload);
3084
+ }
3085
+ return onEventTrigger({
3086
+ originalEvent: ev,
3087
+ payload,
3088
+ type: eventName
3089
+ });
3090
+ };
3091
+ if (parentKeys) {
3092
+ for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
3093
+ const newObject = {};
3094
+ newObject[parentKeys[i]] = result[eventCallbackPropName];
3095
+ result[eventCallbackPropName] = newObject;
3096
+ }
3097
+ }
3098
+ });
3099
+ return result;
3100
+ };
2890
3101
  var withDashboardViz = (opts) => {
2891
3102
  const {
2892
3103
  ReactViz,
@@ -2944,9 +3155,7 @@ var withDashboardViz = (opts) => {
2944
3155
  const isDownsamplingEnabledByFeatureFlag = Boolean(
2945
3156
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
2946
3157
  );
2947
- const isTrellisFeatureFlagOn2 = Boolean(
2948
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
2949
- );
3158
+ const isTrellisFeatureFlagOn2 = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
2950
3159
  const isTrellisOn = isTrellisFeatureFlagOn2 && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
2951
3160
  const isAcceleratedRenderFeatureFlagOn = Boolean(
2952
3161
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableAcceleratedRender
@@ -3111,38 +3320,12 @@ var withDashboardViz = (opts) => {
3111
3320
  }
3112
3321
  );
3113
3322
  }
3114
- const eventCallbackProps = {};
3115
- if (hasEventHandlers && mode === "view" && vizConfig.supports.indexOf("events" /* EVENTS */) > -1) {
3116
- const supportedEvents = vizConfig.events;
3117
- Object.keys(supportedEvents).forEach((eventName) => {
3118
- const { parentKeys, payloadKeys } = supportedEvents[eventName];
3119
- const eventCallbackPropName = (0, lodash_exports.camelCase)(`on.${eventName}`);
3120
- let payload = {};
3121
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
3122
- payloadKeys.forEach((p) => {
3123
- payload[p] = evaluatedOptionsToUse[p];
3124
- });
3125
- }
3126
- eventCallbackProps[eventCallbackPropName] = (ev) => {
3127
- if (ev == null ? void 0 : ev.payload) {
3128
- payload = __spreadValues({}, ev.payload);
3129
- }
3130
- return onEventTrigger({
3131
- originalEvent: ev,
3132
- payload,
3133
- type: eventName
3134
- });
3135
- };
3136
- if (parentKeys) {
3137
- for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
3138
- const newObject = {};
3139
- newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
3140
- eventCallbackProps[eventCallbackPropName] = newObject;
3141
- }
3142
- }
3143
- });
3144
- }
3145
- const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), eventCallbackProps), {
3323
+ const eventCallbackProps = hasEventHandlers && mode === "view" && vizConfig.supports.includes("events" /* EVENTS */) ? buildEventCallbackProps(vizConfig.events, evaluatedOptionsToUse, onEventTrigger) : {};
3324
+ const computedVizProps = computeVizProps2(__spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, props), evaluatedOptionsToUse), {
3325
+ // Align option transformation with the actual renderer selected below.
3326
+ // This prevents canvas-only option preservation from leaking into Highcharts mode.
3327
+ isAcceleratedRenderOn
3328
+ }), eventCallbackProps), {
3146
3329
  themeFunc
3147
3330
  }));
3148
3331
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
@@ -3176,9 +3359,9 @@ var colorConstants_exports = {};
3176
3359
  __export(colorConstants_exports, {
3177
3360
  default: () => colorConstants_default
3178
3361
  });
3179
- var defaultImport33 = __toESM(require("@splunk/visualizations-shared/colorConstants"));
3362
+ var defaultImport35 = __toESM(require("@splunk/visualizations-shared/colorConstants"));
3180
3363
  __reExport(colorConstants_exports, require("@splunk/visualizations-shared/colorConstants"));
3181
- var colorConstants_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
3364
+ var colorConstants_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3182
3365
 
3183
3366
  // src/common/gaugeUtils.ts
3184
3367
  var GAUGE_THICKNESS = 50;
@@ -3675,9 +3858,9 @@ var format_exports = {};
3675
3858
  __export(format_exports, {
3676
3859
  default: () => format_default
3677
3860
  });
3678
- var defaultImport34 = __toESM(require("@splunk/ui-utils/format"));
3861
+ var defaultImport36 = __toESM(require("@splunk/ui-utils/format"));
3679
3862
  __reExport(format_exports, require("@splunk/ui-utils/format"));
3680
- var format_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
3863
+ var format_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3681
3864
 
3682
3865
  // src/common/GaugeValueMarker.jsx
3683
3866
  var MARKER_THICKNESS = 15;
@@ -4022,29 +4205,76 @@ var Paginator_exports = {};
4022
4205
  __export(Paginator_exports, {
4023
4206
  default: () => Paginator_default
4024
4207
  });
4025
- var defaultImport35 = __toESM(require("@splunk/react-ui/Paginator"));
4208
+ var defaultImport37 = __toESM(require("@splunk/react-ui/Paginator"));
4026
4209
  __reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
4027
- var Paginator_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
4210
+ var Paginator_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
4028
4211
 
4029
4212
  // esm-externals:@splunk/themes
4030
4213
  var themes_exports = {};
4031
4214
  __export(themes_exports, {
4032
4215
  default: () => themes_default
4033
4216
  });
4034
- var defaultImport36 = __toESM(require("@splunk/themes"));
4217
+ var defaultImport38 = __toESM(require("@splunk/themes"));
4035
4218
  __reExport(themes_exports, require("@splunk/themes"));
4036
- var themes_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
4219
+ var themes_default = "default" in defaultImport38 ? defaultImport38.default : defaultImport38;
4037
4220
 
4038
4221
  // esm-externals:@splunk/themes/useSplunkTheme
4039
4222
  var useSplunkTheme_exports = {};
4040
4223
  __export(useSplunkTheme_exports, {
4041
4224
  default: () => useSplunkTheme_default
4042
4225
  });
4043
- var defaultImport37 = __toESM(require("@splunk/themes/useSplunkTheme"));
4226
+ var defaultImport39 = __toESM(require("@splunk/themes/useSplunkTheme"));
4044
4227
  __reExport(useSplunkTheme_exports, require("@splunk/themes/useSplunkTheme"));
4045
- var useSplunkTheme_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
4228
+ var useSplunkTheme_default = "default" in defaultImport39 ? defaultImport39.default : defaultImport39;
4046
4229
 
4047
4230
  // src/common/hocs/withTrellis.tsx
4231
+ var evaluatePanelOption = (panelDataSources, allOptions, optionKey, vizContext) => {
4232
+ try {
4233
+ const evaluated = Options_exports.Options.evaluate({ context: vizContext, options: allOptions }, panelDataSources);
4234
+ const num = Number(evaluated == null ? void 0 : evaluated[optionKey]);
4235
+ return Number.isNaN(num) ? Number.NaN : num;
4236
+ } catch (e) {
4237
+ return Number.NaN;
4238
+ }
4239
+ };
4240
+ var sortTrellisKeys = (keys, trellisSortBy, trellisSortOrder, modifiedDataSourceBySplitBy, mergedOptions, vizContext) => {
4241
+ if (trellisSortBy === "name") {
4242
+ keys.sort((a, b) => {
4243
+ const cmp = a.localeCompare(b, void 0, { numeric: true, sensitivity: "base" });
4244
+ return trellisSortOrder === "descending" ? -cmp : cmp;
4245
+ });
4246
+ } else if (trellisSortBy === "value" || trellisSortBy === "trend") {
4247
+ let optionKey;
4248
+ if (trellisSortBy === "trend") {
4249
+ optionKey = "trendValue";
4250
+ } else {
4251
+ optionKey = mergedOptions.value !== void 0 ? "value" : "majorValue";
4252
+ }
4253
+ keys.sort((a, b) => {
4254
+ const valA = evaluatePanelOption(
4255
+ modifiedDataSourceBySplitBy[a],
4256
+ mergedOptions,
4257
+ optionKey,
4258
+ vizContext
4259
+ );
4260
+ const valB = evaluatePanelOption(
4261
+ modifiedDataSourceBySplitBy[b],
4262
+ mergedOptions,
4263
+ optionKey,
4264
+ vizContext
4265
+ );
4266
+ const nanA = Number.isNaN(valA);
4267
+ const nanB = Number.isNaN(valB);
4268
+ if (nanA && nanB) return 0;
4269
+ if (nanA) return 1;
4270
+ if (nanB) return -1;
4271
+ const cmp = valA - valB;
4272
+ return trellisSortOrder === "descending" ? -cmp : cmp;
4273
+ });
4274
+ } else if (trellisSortOrder === "descending") {
4275
+ keys.reverse();
4276
+ }
4277
+ };
4048
4278
  var TrellisContainer = styled_components_default.div`
4049
4279
  overflow: hidden;
4050
4280
  display: flex;
@@ -4089,6 +4319,14 @@ var showErrorMessage = (errorCode, width, height) => {
4089
4319
  }
4090
4320
  return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Error render in trellis"), level: "info" });
4091
4321
  };
4322
+ var resolveTrellisSplitBy = (trellisSplitBy, fields) => {
4323
+ var _a;
4324
+ if (trellisSplitBy && trellisSplitBy.length > 0) {
4325
+ return trellisSplitBy;
4326
+ }
4327
+ const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
4328
+ return ((_a = splitByPossibleFields.fields) == null ? void 0 : _a.length) ? splitByPossibleFields.fields[0] : AGGREGATIONS;
4329
+ };
4092
4330
  var withTrellis = (Viz) => {
4093
4331
  const VizWithTrellis = (opts) => {
4094
4332
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -4097,7 +4335,7 @@ var withTrellis = (Viz) => {
4097
4335
  }, []);
4098
4336
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(opts.width));
4099
4337
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(opts.height));
4100
- const _a = opts, { options = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "height", "width"]);
4338
+ const _a = opts, { options = {}, context = {}, height, width } = _a, otherProps = __objRest(_a, ["options", "context", "height", "width"]);
4101
4339
  const defaultOptions = (0, JSONSchemaUtils_exports.pickFieldFromJSONSchema)(Viz.config.optionsSchema, "default");
4102
4340
  const mergedOptions = (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
4103
4341
  const {
@@ -4107,6 +4345,8 @@ var withTrellis = (Viz) => {
4107
4345
  trellisRowHeight,
4108
4346
  splitByLayout,
4109
4347
  trellisSplitBy,
4348
+ trellisSortBy,
4349
+ trellisSortOrder,
4110
4350
  trellisSharedScale,
4111
4351
  stackMode,
4112
4352
  yAxisMin,
@@ -4175,7 +4415,7 @@ var withTrellis = (Viz) => {
4175
4415
  }, [pageCount, trellisSplitBy]);
4176
4416
  (0, react_exports.useEffect)(() => {
4177
4417
  updateDataDisplay(pageNum);
4178
- }, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
4418
+ }, [columns, fields, trellisSplitBy, trellisSortBy, trellisSortOrder, pageNum, splitByLayout]);
4179
4419
  const handlePageChange = (0, react_exports.useCallback)(
4180
4420
  (event, { page }) => {
4181
4421
  setPageNum(page);
@@ -4183,9 +4423,7 @@ var withTrellis = (Viz) => {
4183
4423
  [pageNum, pagedData]
4184
4424
  );
4185
4425
  const featureFlagContext = react_exports.useContext(FeatureFlagContext_default);
4186
- const isTrellisFeatureFlagOn2 = Boolean(
4187
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
4188
- );
4426
+ const isTrellisFeatureFlagOn2 = Boolean(featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableTrellis);
4189
4427
  if (!isTrellisFeatureFlagOn2 || !splitByLayout || splitByLayout !== visualization_schemas_exports.LAYOUT_TYPE.Trellis) {
4190
4428
  return /* @__PURE__ */ react_exports.createElement(Viz, __spreadValues({}, opts));
4191
4429
  }
@@ -4193,14 +4431,9 @@ var withTrellis = (Viz) => {
4193
4431
  if (noColumns || noFields) {
4194
4432
  return /* @__PURE__ */ react_exports.createElement(Message_default, { width, height, message: (0, i18n_exports._)("Loading"), level: "info" });
4195
4433
  }
4196
- let currTrellisSplitBy = trellisSplitBy;
4197
- if (!trellisSplitBy || trellisSplitBy.length === 0) {
4198
- const splitByPossibleFields = (0, trellisUtils_exports.getAllPossibleSplitByFields)(fields);
4199
- currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : AGGREGATIONS;
4200
- }
4201
- const splitMode = (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields);
4434
+ const currTrellisSplitBy = resolveTrellisSplitBy(trellisSplitBy, fields);
4202
4435
  const dataSplitResult = getTrellisDataSourcesBySplitMode(
4203
- splitMode,
4436
+ (0, trellisUtils_exports.getTrellisDataSplitterMode)(fields),
4204
4437
  dataSources,
4205
4438
  currTrellisSplitBy
4206
4439
  );
@@ -4209,12 +4442,19 @@ var withTrellis = (Viz) => {
4209
4442
  if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
4210
4443
  return showErrorMessage(dataSplitErrorCode, width, height);
4211
4444
  }
4212
- const splitByKeysModified = modifiedDataSourceBySplitBy ? Object.keys(modifiedDataSourceBySplitBy) : [];
4213
- if (splitByKeysModified) {
4214
- showPaginator = splitByKeysModified.length > pageCount;
4215
- splitByKeys = splitByKeysModified;
4216
- totalPages = splitByKeysModified ? Math.ceil(splitByKeysModified.length / pageCount) : 0;
4217
- }
4445
+ const splitByKeysModified = Object.keys(modifiedDataSourceBySplitBy);
4446
+ const vizContext = (0, lodash_exports.defaultsDeep)({}, context, Viz.config.defaultContext);
4447
+ sortTrellisKeys(
4448
+ splitByKeysModified,
4449
+ trellisSortBy,
4450
+ trellisSortOrder,
4451
+ modifiedDataSourceBySplitBy,
4452
+ mergedOptions,
4453
+ vizContext
4454
+ );
4455
+ showPaginator = splitByKeysModified.length > pageCount;
4456
+ splitByKeys = splitByKeysModified;
4457
+ totalPages = Math.ceil(splitByKeysModified.length / pageCount);
4218
4458
  const [calculatedMin, calculatedMax] = determineMinMax(
4219
4459
  modifiedDataSourceBySplitBy,
4220
4460
  trellisSharedScale,
@@ -4248,6 +4488,7 @@ var withTrellis = (Viz) => {
4248
4488
  /* @__PURE__ */ react_exports.createElement(
4249
4489
  Viz,
4250
4490
  __spreadProps(__spreadValues({}, otherProps), {
4491
+ context,
4251
4492
  trellisKey: splitByKey,
4252
4493
  trellisSplitBy: currTrellisSplitBy,
4253
4494
  dataSources: modifiedDataSourceBySplitBy[splitByKey],