@splunk/visualizations 28.3.0 → 28.5.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 (285) hide show
  1. package/Area/Area.d.ts.map +1 -1
  2. package/Area.config.js +28 -8
  3. package/Area.config.js.map +2 -2
  4. package/Area.js +583 -120
  5. package/Area.js.map +3 -3
  6. package/Bar/Bar.d.ts.map +1 -1
  7. package/Bar.config.js +28 -8
  8. package/Bar.config.js.map +2 -2
  9. package/Bar.js +593 -120
  10. package/Bar.js.map +3 -3
  11. package/Bubble.config.js +4 -5
  12. package/Bubble.config.js.map +2 -2
  13. package/Bubble.js +554 -98
  14. package/Bubble.js.map +3 -3
  15. package/CHANGELOG.external.md +165 -0
  16. package/ChoroplethSvg/ChoroplethSvg.d.ts +4 -3
  17. package/ChoroplethSvg/ChoroplethSvg.d.ts.map +1 -1
  18. package/ChoroplethSvg.config.js +1 -3
  19. package/ChoroplethSvg.config.js.map +2 -2
  20. package/ChoroplethSvg.js +595 -111
  21. package/ChoroplethSvg.js.map +4 -4
  22. package/Column/Column.d.ts.map +1 -1
  23. package/Column.config.js +28 -8
  24. package/Column.config.js.map +2 -2
  25. package/Column.js +583 -120
  26. package/Column.js.map +3 -3
  27. package/Ellipse/config.d.ts.map +1 -1
  28. package/Ellipse.config.js +14 -5
  29. package/Ellipse.config.js.map +4 -4
  30. package/Ellipse.js +640 -159
  31. package/Ellipse.js.map +4 -4
  32. package/Events/PureEvents/PureEvents.d.ts.map +1 -1
  33. package/Events.js +668 -157
  34. package/Events.js.map +4 -4
  35. package/FillerGauge/FillerGauge.d.ts.map +1 -1
  36. package/FillerGauge/PureFillerGauge/FillerGauge.d.ts.map +1 -1
  37. package/FillerGauge.js +751 -169
  38. package/FillerGauge.js.map +4 -4
  39. package/Image/Image.d.ts.map +1 -1
  40. package/Image.js +620 -116
  41. package/Image.js.map +4 -4
  42. package/Line/Line.d.ts.map +1 -1
  43. package/Line/lineUtils.d.ts.map +1 -1
  44. package/Line/mockdata/LineData.d.ts +154 -0
  45. package/Line/mockdata/LineData.d.ts.map +1 -1
  46. package/Line.config.js +28 -8
  47. package/Line.config.js.map +2 -2
  48. package/Line.js +704 -122
  49. package/Line.js.map +3 -3
  50. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +5 -0
  51. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
  52. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
  53. package/LinkGraph/PureLinkGraph/components/Graph.d.ts +9 -1
  54. package/LinkGraph/PureLinkGraph/components/Graph.d.ts.map +1 -1
  55. package/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts.map +1 -1
  56. package/LinkGraph/PureLinkGraph/components/Node.d.ts +1 -0
  57. package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
  58. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +1 -0
  59. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts.map +1 -1
  60. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts +16 -0
  61. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts.map +1 -0
  62. package/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts.map +1 -1
  63. package/LinkGraph/config.d.ts.map +1 -1
  64. package/LinkGraph.config.js +15 -1
  65. package/LinkGraph.config.js.map +2 -2
  66. package/LinkGraph.js +1411 -662
  67. package/LinkGraph.js.map +4 -4
  68. package/Map/Map.d.ts +2 -2
  69. package/Map/Map.d.ts.map +1 -1
  70. package/Map/PureMap/BubbleLayer.d.ts +5 -0
  71. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  72. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  73. package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
  74. package/Map/PureMap/MapUtils.d.ts +2 -2
  75. package/Map/PureMap/MapUtils.d.ts.map +1 -1
  76. package/Map/PureMap/PureMap.d.ts.map +1 -1
  77. package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
  78. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  79. package/Map/config.d.ts.map +1 -1
  80. package/Map.config.js +0 -1
  81. package/Map.config.js.map +2 -2
  82. package/Map.js +831 -247
  83. package/Map.js.map +4 -4
  84. package/Markdown/Markdown.d.ts.map +1 -1
  85. package/Markdown/config.d.ts.map +1 -1
  86. package/Markdown.config.js +14 -5
  87. package/Markdown.config.js.map +4 -4
  88. package/Markdown.js +619 -109
  89. package/Markdown.js.map +4 -4
  90. package/MarkerGauge/MarkerGauge.d.ts +5 -1
  91. package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
  92. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +4 -0
  93. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
  94. package/MarkerGauge/config.d.ts.map +1 -1
  95. package/MarkerGauge.config.js +121 -3
  96. package/MarkerGauge.config.js.map +3 -3
  97. package/MarkerGauge.js +1535 -172
  98. package/MarkerGauge.js.map +4 -4
  99. package/NetworkGraph/NetworkGraph.d.ts +22 -0
  100. package/NetworkGraph/NetworkGraph.d.ts.map +1 -0
  101. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts +60 -0
  102. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -0
  103. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts +19 -0
  104. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts.map +1 -0
  105. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +29 -0
  106. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -0
  107. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +27 -0
  108. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -0
  109. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +12 -0
  110. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -0
  111. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +13 -0
  112. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -0
  113. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts +140 -0
  114. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts.map +1 -0
  115. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts +89 -0
  116. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts.map +1 -0
  117. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts +78 -0
  118. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts.map +1 -0
  119. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts +47 -0
  120. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts.map +1 -0
  121. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts +78 -0
  122. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts.map +1 -0
  123. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts +111 -0
  124. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts.map +1 -0
  125. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +122 -0
  126. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -0
  127. package/NetworkGraph/config.d.ts +4 -0
  128. package/NetworkGraph/config.d.ts.map +1 -0
  129. package/NetworkGraph/index.d.ts +3 -0
  130. package/NetworkGraph/index.d.ts.map +1 -0
  131. package/NetworkGraph.config.js +938 -0
  132. package/NetworkGraph.config.js.map +7 -0
  133. package/NetworkGraph.js +7053 -0
  134. package/NetworkGraph.js.map +7 -0
  135. package/PERFORMANCE.md +23 -0
  136. package/ParallelCoordinates/ParallelCoordinates.d.ts +1 -46
  137. package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
  138. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +12 -58
  139. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -1
  140. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +1 -0
  141. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -1
  142. package/ParallelCoordinates.js +664 -228
  143. package/ParallelCoordinates.js.map +4 -4
  144. package/Pie/Pie.d.ts.map +1 -1
  145. package/Pie/config.d.ts.map +1 -1
  146. package/Pie/pieUtils.d.ts +4 -0
  147. package/Pie/pieUtils.d.ts.map +1 -1
  148. package/Pie.config.js +16 -0
  149. package/Pie.config.js.map +2 -2
  150. package/Pie.js +610 -118
  151. package/Pie.js.map +3 -3
  152. package/Punchcard.js +579 -92
  153. package/Punchcard.js.map +4 -4
  154. package/Rectangle/config.d.ts.map +1 -1
  155. package/Rectangle.config.js +14 -5
  156. package/Rectangle.config.js.map +4 -4
  157. package/Rectangle.js +611 -130
  158. package/Rectangle.js.map +4 -4
  159. package/Sankey/PureSankey/PureSankey.d.ts +26 -72
  160. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  161. package/Sankey/PureSankey/SankeyLink.d.ts +3 -19
  162. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  163. package/Sankey/PureSankey/SankeyNode.d.ts +3 -20
  164. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  165. package/Sankey/PureSankey/SankeyTooltip.d.ts +3 -24
  166. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  167. package/Sankey.js +814 -429
  168. package/Sankey.js.map +4 -4
  169. package/Scatter/Scatter.d.ts.map +1 -1
  170. package/Scatter.config.js +168 -148
  171. package/Scatter.config.js.map +4 -4
  172. package/Scatter.js +733 -260
  173. package/Scatter.js.map +4 -4
  174. package/SingleValue/SingleValue.d.ts.map +1 -1
  175. package/SingleValue/config.d.ts.map +1 -1
  176. package/SingleValue.config.js +15 -2
  177. package/SingleValue.config.js.map +2 -2
  178. package/SingleValue.js +733 -229
  179. package/SingleValue.js.map +3 -3
  180. package/SingleValueBasic.js.map +1 -1
  181. package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
  182. package/SingleValueIcon/config.d.ts.map +1 -1
  183. package/SingleValueIcon.config.js +14 -6
  184. package/SingleValueIcon.config.js.map +4 -4
  185. package/SingleValueIcon.js +612 -182
  186. package/SingleValueIcon.js.map +4 -4
  187. package/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -1
  188. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
  189. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
  190. package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
  191. package/SingleValueRadial.config.js +0 -1
  192. package/SingleValueRadial.config.js.map +2 -2
  193. package/SingleValueRadial.js +594 -182
  194. package/SingleValueRadial.js.map +4 -4
  195. package/SparkLine.js +46 -8
  196. package/SparkLine.js.map +2 -2
  197. package/Table/PureTable.d.ts +10 -0
  198. package/Table/PureTable.d.ts.map +1 -1
  199. package/Table/Table.d.ts.map +1 -1
  200. package/Table/cells/SparklineCell.d.ts.map +1 -1
  201. package/Table/config.d.ts.map +1 -1
  202. package/Table/hooks.d.ts +6 -0
  203. package/Table/hooks.d.ts.map +1 -1
  204. package/Table.config.js +1 -1
  205. package/Table.config.js.map +2 -2
  206. package/Table.js +836 -253
  207. package/Table.js.map +4 -4
  208. package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
  209. package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
  210. package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
  211. package/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -1
  212. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  213. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +2 -1
  214. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  215. package/Timeline/config.d.ts.map +1 -1
  216. package/Timeline.config.js +31 -12
  217. package/Timeline.config.js.map +4 -4
  218. package/Timeline.js +785 -247
  219. package/Timeline.js.map +4 -4
  220. package/common/Charting.d.ts +5 -0
  221. package/common/Charting.d.ts.map +1 -1
  222. package/common/Charting.js +12 -0
  223. package/common/Charting.js.map +2 -2
  224. package/common/GaugeMajorTicks.js +150 -13
  225. package/common/GaugeMajorTicks.js.map +4 -4
  226. package/common/GaugeValueMarker.js +84 -17
  227. package/common/GaugeValueMarker.js.map +4 -4
  228. package/common/OptionsDoc.js.map +1 -1
  229. package/common/OverviewDoc.d.ts.map +1 -1
  230. package/common/OverviewDoc.js +2 -2
  231. package/common/OverviewDoc.js.map +2 -2
  232. package/common/ThemesDoc.js +0 -1
  233. package/common/ThemesDoc.js.map +2 -2
  234. package/common/TimeSeriesChartWrapper.d.ts +24 -11
  235. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  236. package/common/TimeSeriesChartWrapper.js +617 -91
  237. package/common/TimeSeriesChartWrapper.js.map +4 -4
  238. package/common/chartingUtils.d.ts +52 -6
  239. package/common/chartingUtils.d.ts.map +1 -1
  240. package/common/chartingUtils.js +116 -17
  241. package/common/chartingUtils.js.map +3 -3
  242. package/common/editorConfig/AxesChartDataConfig.d.ts +3 -3
  243. package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
  244. package/common/editorConfig/AxesChartDataDisplay.d.ts +4 -0
  245. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  246. package/common/editorConfig/AxesChartLegend.d.ts.map +1 -1
  247. package/common/gaugeUtils.d.ts +37 -0
  248. package/common/gaugeUtils.d.ts.map +1 -1
  249. package/common/gaugeUtils.js +152 -2
  250. package/common/gaugeUtils.js.map +4 -4
  251. package/common/hocs/mockdata/trellisData.d.ts +119 -0
  252. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  253. package/common/hocs/withTrellis.d.ts.map +1 -1
  254. package/common/interfaces/DashboardVizProps.d.ts +0 -3
  255. package/common/interfaces/DashboardVizProps.d.ts.map +1 -1
  256. package/common/interfaces/DataSource.d.ts +1 -1
  257. package/common/interfaces/DataSource.d.ts.map +1 -1
  258. package/common/interfaces/Overview.d.ts +1 -0
  259. package/common/interfaces/Overview.d.ts.map +1 -1
  260. package/common/interfaces/VizConfig.d.ts +2 -1
  261. package/common/interfaces/VizConfig.d.ts.map +1 -1
  262. package/common/shapeUtils.js +5 -20
  263. package/common/shapeUtils.js.map +2 -2
  264. package/common/utils/dataUtils.d.ts.map +1 -1
  265. package/common/utils/dataUtils.js +5 -4
  266. package/common/utils/dataUtils.js.map +2 -2
  267. package/common/utils/mapUtils.js +16 -9
  268. package/common/utils/mapUtils.js.map +2 -2
  269. package/common/utils/singleValueUtils.js +17 -18
  270. package/common/utils/singleValueUtils.js.map +2 -2
  271. package/common/utils/textUtils.d.ts +20 -0
  272. package/common/utils/textUtils.d.ts.map +1 -0
  273. package/common/utils/textUtils.js +76 -0
  274. package/common/utils/textUtils.js.map +7 -0
  275. package/common/utils/trellisUtils.d.ts.map +1 -1
  276. package/common/utils/trellisUtils.js +16 -20
  277. package/common/utils/trellisUtils.js.map +2 -2
  278. package/common/withDashboardViz.d.ts.map +1 -1
  279. package/common/withDashboardViz.js +600 -92
  280. package/common/withDashboardViz.js.map +4 -4
  281. package/package.json +46 -39
  282. package/common/utils/styleUtils.d.ts +0 -2
  283. package/common/utils/styleUtils.d.ts.map +0 -1
  284. package/common/utils/styleUtils.js +0 -30
  285. package/common/utils/styleUtils.js.map +0 -7
package/Sankey.js CHANGED
@@ -25,6 +25,18 @@ var __spreadValues = (a, b) => {
25
25
  return a;
26
26
  };
27
27
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
28
40
  var __export = (target, all) => {
29
41
  for (var name in all)
30
42
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -485,7 +497,7 @@ var Cover = styled_components_default.div`
485
497
  bottom: 0;
486
498
  `;
487
499
  var Blocker = styled_components_default.div.attrs({
488
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
500
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
489
501
  })`
490
502
  position: relative;
491
503
  width: 100%;
@@ -575,7 +587,7 @@ var withFixedSizeContainer = (Viz) => {
575
587
  FixSizeItem,
576
588
  {
577
589
  "data-test": "fix-size-item",
578
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
590
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
579
591
  width,
580
592
  height,
581
593
  backgroundColor
@@ -671,6 +683,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
671
683
  var numberUtils_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
672
684
 
673
685
  // src/common/utils/dataUtils.ts
686
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
674
687
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
675
688
  const dataLength = data.length;
676
689
  const downsampledIndices = [];
@@ -787,9 +800,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
787
800
  let xColumn = [];
788
801
  const yColumns = [];
789
802
  const canDownsample = !ds.data.fields.some((field, index) => {
790
- var _a, _b;
791
- const fieldName = (_a = field.name) != null ? _a : field;
792
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
803
+ var _a;
804
+ const fieldName = getFieldName(field);
805
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
793
806
  const column = ds.data.columns[index];
794
807
  let hasDisplayedColumnThatCantBeDownsampled = false;
795
808
  if (fieldName === xField) {
@@ -1142,6 +1155,16 @@ var triangleEventAnnotationRenderer = ({
1142
1155
  eventColor: eventWithColor.color
1143
1156
  });
1144
1157
  };
1158
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1159
+ const rangeSelectEventHandler = eventHandlers.find(
1160
+ (eventHandler) => {
1161
+ var _a;
1162
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1163
+ }
1164
+ );
1165
+ const xAxisIsTime = xField === "_time";
1166
+ return !!rangeSelectEventHandler && xAxisIsTime;
1167
+ };
1145
1168
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1146
1169
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1147
1170
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1162,17 +1185,34 @@ var filterChartDataFromInternalFields = (chartData) => {
1162
1185
  var convert2DArrayToNumbers = (arr) => {
1163
1186
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1164
1187
  };
1165
- var SideLegendWidth = 75;
1166
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1188
+ var parseAxisValue = (val) => {
1189
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1190
+ return void 0;
1191
+ }
1192
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1193
+ return Number.isNaN(num) ? void 0 : num;
1194
+ };
1195
+ var parseXAxisLineVisibility = (visibility) => {
1196
+ if (visibility === "hide") return false;
1197
+ if (visibility === "show") return true;
1198
+ return void 0;
1199
+ };
1167
1200
  var getLegend = (props) => {
1168
1201
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1202
+ const { isSeriesCompare, legendTruncation } = props;
1203
+ const commonLegendProps = {
1204
+ center: true,
1205
+ fontSize: 12,
1206
+ largerTiles: true,
1207
+ hideSeriesValue: !isSeriesCompare,
1208
+ // Show values if in seriesCompare mode
1209
+ legendTruncation
1210
+ };
1169
1211
  switch (legendPlacement) {
1170
1212
  case "off":
1171
1213
  return false;
1172
1214
  case "left":
1173
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1174
- width: SideLegendWidth
1175
- }, commonLegendProps));
1215
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
1176
1216
  case "bottom":
1177
1217
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
1178
1218
  wrap: true
@@ -1182,9 +1222,7 @@ var getLegend = (props) => {
1182
1222
  wrap: true
1183
1223
  }, commonLegendProps));
1184
1224
  default:
1185
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1186
- width: SideLegendWidth
1187
- }, commonLegendProps));
1225
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
1188
1226
  }
1189
1227
  };
1190
1228
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -1219,22 +1257,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1219
1257
  const end = axisTitle.slice(-halfChars);
1220
1258
  return `${start}...${end}`;
1221
1259
  };
1222
- var getFieldName = (field) => {
1260
+ var getFieldName2 = (field) => {
1223
1261
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1224
1262
  return fieldName;
1225
1263
  };
1226
1264
  var getFieldNames = (fields) => {
1227
- return fields.map((field) => getFieldName(field));
1265
+ return fields.map((field) => getFieldName2(field));
1228
1266
  };
1229
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1267
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1230
1268
  const xConfig = { x: {} };
1231
1269
  xConfig.x.label = label;
1232
1270
  if (xAxisLabelVisibility === "hide") {
1233
1271
  xConfig.x.hideLabels = true;
1234
1272
  }
1273
+ if (xAxisLabelRotation !== void 0) {
1274
+ xConfig.x.labelRotation = xAxisLabelRotation;
1275
+ }
1235
1276
  return xConfig;
1236
1277
  };
1237
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1278
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1238
1279
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1239
1280
  const yConfig = { y: {} };
1240
1281
  yConfig.y.label = label;
@@ -1242,34 +1283,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1242
1283
  if (yAxisAbbreviation !== "none") {
1243
1284
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
1244
1285
  }
1245
- if (yAxisAbbreviation === "none") {
1246
- yConfig.y.width = 55;
1247
- } else {
1286
+ if (yAxisAbbreviation !== "none") {
1248
1287
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
1249
1288
  }
1250
1289
  if (yAxisLabelVisibility === "hide") {
1251
1290
  yConfig.y.hideLabels = true;
1252
1291
  }
1292
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1293
+ yConfig.y.range = (u, dataMin, dataMax) => {
1294
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1295
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1296
+ return [min, max];
1297
+ };
1298
+ }
1253
1299
  return yConfig;
1254
1300
  };
1255
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1301
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1256
1302
  const y2Config = { y2: {} };
1257
1303
  const scaleType = axisScale != null ? axisScale : "linear";
1258
1304
  y2Config.y2.label = label;
1259
1305
  y2Config.y2.side = "right";
1260
- y2Config.y2.showGrid = false;
1261
1306
  y2Config.y2.type = scaleType;
1262
1307
  if (axisAbbreviation !== "none") {
1263
1308
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
1309
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
1264
1310
  } else if (roundAxisLabelsToInteger) {
1265
1311
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
1266
1312
  }
1267
1313
  if (y2AxisLabelVisibility === "hide") {
1268
1314
  y2Config.y2.hideLabels = true;
1269
1315
  }
1316
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1317
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1318
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1319
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1320
+ return [min, max];
1321
+ };
1322
+ }
1270
1323
  return y2Config;
1271
1324
  };
1272
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1325
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
1273
1326
  const seriesConfig = {};
1274
1327
  let spanGaps;
1275
1328
  let replaceNullsWithZero;
@@ -1296,6 +1349,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1296
1349
  );
1297
1350
  if (shouldAssignToY2) {
1298
1351
  seriesConfig[field].overrides.scale = "y2";
1352
+ } else {
1353
+ seriesConfig[field].overrides.scale = "y";
1299
1354
  }
1300
1355
  }
1301
1356
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -1304,12 +1359,101 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1304
1359
  if (markerDisplay !== void 0) {
1305
1360
  seriesConfig[field].markerDisplay = markerDisplay;
1306
1361
  }
1362
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1363
+ if (fieldDashStyle) {
1364
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1365
+ }
1366
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
1367
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
1368
+ if (fieldStepPosition && fieldStepPosition !== "off") {
1369
+ seriesConfig[field].stepPosition = fieldStepPosition;
1370
+ }
1307
1371
  if (replaceNullsWithZero !== void 0) {
1308
1372
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1309
1373
  }
1310
1374
  });
1311
1375
  return seriesConfig;
1312
1376
  };
1377
+ var findRangeIndices = (xData, startValue, endValue) => {
1378
+ let startXIndex = -1;
1379
+ let endXIndex = -1;
1380
+ const xDataEpoch = xData.map((val) => {
1381
+ if (typeof val === "string") {
1382
+ return new Date(val).getTime() / 1e3;
1383
+ }
1384
+ return val;
1385
+ });
1386
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1387
+ if (xDataEpoch[i] >= startValue) {
1388
+ startXIndex = i;
1389
+ break;
1390
+ }
1391
+ }
1392
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1393
+ startXIndex = xDataEpoch.length - 1;
1394
+ }
1395
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1396
+ if (xDataEpoch[i] <= endValue) {
1397
+ endXIndex = i;
1398
+ break;
1399
+ }
1400
+ }
1401
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1402
+ endXIndex = 0;
1403
+ }
1404
+ return { startXIndex, endXIndex };
1405
+ };
1406
+
1407
+ // esm-externals:@splunk/visualization-schemas
1408
+ var visualization_schemas_exports = {};
1409
+ __export(visualization_schemas_exports, {
1410
+ default: () => visualization_schemas_default
1411
+ });
1412
+ var defaultImport27 = __toESM(require("@splunk/visualization-schemas"));
1413
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1414
+ var visualization_schemas_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
1415
+
1416
+ // src/common/hooks/useTrellisEnabled.ts
1417
+ var useTrellisFeatureFlagOn = () => {
1418
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1419
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1420
+ };
1421
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1422
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1423
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1424
+ };
1425
+
1426
+ // src/common/components/TrellisTitle.tsx
1427
+ var TRELLIS_TITLE_HEIGHT = 28;
1428
+ var TrellisTitleText = styled_components_default.div`
1429
+ margin-left: 10px;
1430
+ margin-right: 10px;
1431
+ padding-top: 8px;
1432
+ text-overflow: ellipsis;
1433
+ white-space: nowrap;
1434
+ overflow: hidden;
1435
+ `;
1436
+ var TrellisTitleDiv = styled_components_default.div`
1437
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1438
+ font-size: 14px;
1439
+ font-weight: 700;
1440
+ color: ${(props) => props.fontColor};
1441
+ background-color: ${(props) => props.backgroundColor};
1442
+ 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.
1443
+ `;
1444
+ var TrellisTitle = (props) => {
1445
+ const titleText = String(props.trellisKey).toString();
1446
+ return /* @__PURE__ */ react_exports.createElement(
1447
+ TrellisTitleDiv,
1448
+ {
1449
+ fontColor: props.fontColor,
1450
+ backgroundColor: props.backgroundColor,
1451
+ "data-test": "trellis-title",
1452
+ title: titleText
1453
+ },
1454
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1455
+ );
1456
+ };
1313
1457
 
1314
1458
  // src/common/TimeSeriesChartWrapper.tsx
1315
1459
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1320,38 +1464,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1320
1464
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1321
1465
  }
1322
1466
  `;
1323
- var handleClick = (chartEvent, onClick) => {
1467
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1468
+ const result = __spreadValues({}, payload);
1469
+ if (trellisSplitBy) {
1470
+ result["trellis.name"] = trellisSplitBy;
1471
+ }
1472
+ if (trellisKey) {
1473
+ result["trellis.value"] = trellisKey;
1474
+ }
1475
+ return result;
1476
+ };
1477
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1478
+ if (!previousPayload) {
1479
+ return true;
1480
+ }
1481
+ if (currentPayload.index !== previousPayload.index) {
1482
+ return true;
1483
+ }
1484
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1485
+ return true;
1486
+ }
1487
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1488
+ return true;
1489
+ }
1490
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1491
+ return true;
1492
+ }
1493
+ return false;
1494
+ };
1495
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1324
1496
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1325
1497
  name: chartEvent.seriesKey
1326
1498
  });
1327
1499
  delete payload.seriesKey;
1328
1500
  if (chartEvent.rowContext) {
1329
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1330
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1331
- });
1501
+ Object.assign(
1502
+ payload,
1503
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1504
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1505
+ return acc;
1506
+ }, {})
1507
+ );
1332
1508
  }
1509
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1333
1510
  if (onClick) {
1334
1511
  onClick({
1335
1512
  type: "point.click",
1336
1513
  originalEvent: chartEvent,
1337
- payload
1514
+ payload: updatedPayload
1338
1515
  });
1339
1516
  }
1340
1517
  };
1341
- var handleLegendClick = (chartEvent, onClick) => {
1518
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1342
1519
  const payload = {
1343
1520
  name: chartEvent
1344
1521
  };
1522
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1345
1523
  if (onClick) {
1346
1524
  onClick({
1347
1525
  type: "legend.click",
1348
1526
  originalEvent: chartEvent,
1349
- payload
1527
+ payload: updatedPayload
1528
+ });
1529
+ }
1530
+ };
1531
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1532
+ var _a;
1533
+ if (!rangeEvent) {
1534
+ return;
1535
+ }
1536
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1537
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1538
+ const payload = {
1539
+ startXIndex,
1540
+ startXValue: rangeEvent.start,
1541
+ endXIndex,
1542
+ endXValue: rangeEvent.end
1543
+ };
1544
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1545
+ if (onSelect) {
1546
+ onSelect({
1547
+ type: "range.selectBeforeZoom",
1548
+ originalEvent: rangeEvent,
1549
+ payload: updatedPayload
1550
+ });
1551
+ }
1552
+ };
1553
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1554
+ var _a;
1555
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1556
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1557
+ const payload = {
1558
+ startXIndex,
1559
+ startXValue: rangeEvent.start,
1560
+ endXIndex,
1561
+ endXValue: rangeEvent.end
1562
+ };
1563
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1564
+ if (onSelect) {
1565
+ onSelect({
1566
+ type: "range.select",
1567
+ originalEvent: rangeEvent,
1568
+ payload: updatedPayload
1350
1569
  });
1351
1570
  }
1352
1571
  };
1572
+ var parseArrayOption = (value) => {
1573
+ if (Array.isArray(value)) {
1574
+ return value;
1575
+ }
1576
+ if (value) {
1577
+ return JSON.parse(value);
1578
+ }
1579
+ return void 0;
1580
+ };
1353
1581
  var TimeSeriesChartWrapper = (props) => {
1354
- const {
1582
+ var _b, _c, _d;
1583
+ const _a = props, {
1355
1584
  width,
1356
1585
  height,
1357
1586
  chartData,
@@ -1364,12 +1593,57 @@ var TimeSeriesChartWrapper = (props) => {
1364
1593
  markerDisplay,
1365
1594
  onClick,
1366
1595
  onPointMouseOver,
1367
- onPointMouseOut
1368
- } = props;
1369
- const {
1596
+ onPointMouseOut,
1597
+ onSelect,
1598
+ splitByLayout,
1599
+ trellisKey,
1600
+ trellisSplitBy,
1370
1601
  backgroundColor,
1602
+ defaultFontColor,
1603
+ additionalTooltipValues,
1604
+ xAxisLineVisibility: xAxisLineVisibility,
1605
+ yAxisLineVisibility,
1606
+ y2AxisLineVisibility,
1607
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1608
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1609
+ } = _a, otherOptions = __objRest(_a, [
1610
+ "width",
1611
+ "height",
1612
+ "chartData",
1613
+ "options",
1614
+ "userLocale",
1615
+ "annotationX",
1616
+ "annotationLabel",
1617
+ "annotationColor",
1618
+ "legendDisplay",
1619
+ "markerDisplay",
1620
+ "onClick",
1621
+ "onPointMouseOver",
1622
+ "onPointMouseOut",
1623
+ "onSelect",
1624
+ "splitByLayout",
1625
+ "trellisKey",
1626
+ "trellisSplitBy",
1627
+ "backgroundColor",
1628
+ "defaultFontColor",
1629
+ "additionalTooltipValues",
1630
+ // Extract axis line visibility options from props
1631
+ "xAxisLineVisibility",
1632
+ "yAxisLineVisibility",
1633
+ "y2AxisLineVisibility",
1634
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1635
+ "showYAxisWithZero",
1636
+ "showY2AxisWithZero"
1637
+ ]);
1638
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1639
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1640
+ const {
1641
+ backgroundColor: bgColorFromOptions,
1371
1642
  seriesColors: seriesColorsStr,
1372
1643
  fieldColors,
1644
+ legendLabels: legendLabelsStr,
1645
+ legendMode,
1646
+ legendTruncation,
1373
1647
  "axisTitleX.text": xAxisTitleText,
1374
1648
  "axisTitleY.text": yAxisTitleText,
1375
1649
  "axisTitleY2.text": y2AxisTitleText,
@@ -1377,8 +1651,12 @@ var TimeSeriesChartWrapper = (props) => {
1377
1651
  "axisTitleY.visibility": yAxisTitleVisibility,
1378
1652
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1379
1653
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1654
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1655
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
1380
1656
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1657
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1381
1658
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1659
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1382
1660
  "axisY.abbreviation": yAxisAbbreviation,
1383
1661
  "axisY.scale": yAxisScale,
1384
1662
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1388,10 +1666,73 @@ var TimeSeriesChartWrapper = (props) => {
1388
1666
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1389
1667
  "chart.overlayFields": overlayFieldsStr,
1390
1668
  "chart.nullValueMode": nullValueMode,
1391
- lineWidth
1669
+ "chart.showDataLabels": showDataLabels,
1670
+ lineWidth,
1671
+ lineDashStyle,
1672
+ fieldDashStyles: lineDashStylesByFieldStr,
1673
+ stepPosition,
1674
+ fieldStepPositions: stepPositionsByFieldStr,
1675
+ yAxisMin: yAxisMinRaw,
1676
+ yAxisMax: yAxisMaxRaw,
1677
+ y2AxisMin: y2AxisMinRaw,
1678
+ y2AxisMax: y2AxisMaxRaw,
1679
+ showXMajorGridLines,
1680
+ showYMajorGridLines,
1681
+ showY2MajorGridLines,
1682
+ showYMinorGridLines,
1683
+ showY2MinorGridLines,
1684
+ showLineSmoothing,
1685
+ xAxisMajorTickVisibility,
1686
+ xAxisMajorTickSize,
1687
+ yAxisMajorTickVisibility,
1688
+ y2AxisMajorTickVisibility,
1689
+ yAxisMajorTickSize,
1690
+ y2AxisMajorTickSize,
1691
+ yAxisMajorTickInterval,
1692
+ y2AxisMajorTickInterval,
1693
+ yAxisMinorTickVisibility,
1694
+ y2AxisMinorTickVisibility,
1695
+ yAxisMinorTickSize,
1696
+ y2AxisMinorTickSize,
1697
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1698
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1392
1699
  } = options;
1700
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1701
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1702
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1703
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
1704
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1705
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1706
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1707
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1708
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
1709
+ const showYAxisLine = yAxisLineVisibility === "show";
1710
+ const showY2AxisLine = y2AxisLineVisibility === "show";
1711
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1712
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1713
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1714
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1715
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1716
+ if (simpleXMLValue) return Number(simpleXMLValue);
1717
+ if (canvasValue) return Number(canvasValue);
1718
+ return void 0;
1719
+ };
1720
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1721
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1722
+ y2AxisMajorUnitFromSimpleXML,
1723
+ y2AxisMajorTickInterval
1724
+ );
1725
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
1726
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
1727
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
1728
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
1729
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
1393
1730
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1394
1731
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1732
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1733
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
1734
+ const legendLabels = parseArrayOption(legendLabelsStr);
1735
+ const bgColor = backgroundColor || bgColorFromOptions;
1395
1736
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1396
1737
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1397
1738
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1402,31 +1743,64 @@ var TimeSeriesChartWrapper = (props) => {
1402
1743
  fields: chartData.fields,
1403
1744
  columns: chartData.seriesList
1404
1745
  });
1405
- const xField = getFieldName(filteredChartData.fields[0]);
1746
+ const xField = getFieldName2(filteredChartData.fields[0]);
1406
1747
  const yFields = getFieldNames(
1407
1748
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1408
1749
  );
1409
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1410
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1750
+ const y2Fields = (0, react_exports.useMemo)(
1751
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1752
+ [y2FieldsStr]
1753
+ );
1754
+ const overlayFields = (0, react_exports.useMemo)(
1755
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1756
+ [overlayFieldsStr]
1757
+ );
1411
1758
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1412
1759
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1413
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1760
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1761
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1414
1762
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1415
1763
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1416
1764
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1417
1765
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1418
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1419
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1420
- let y2ScaleConfig = {};
1421
- if (y2Enabled) {
1422
- y2ScaleConfig = getY2ScaleConfig(
1423
- y2AxisTitle,
1424
- y2AxisAbbreviation,
1425
- y2AxisScale,
1426
- y2IntegerUnits,
1427
- y2AxisLabelVisibility
1428
- );
1429
- }
1766
+ const xScaleConfig = (0, react_exports.useMemo)(
1767
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1768
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1769
+ );
1770
+ const yScaleConfig = (0, react_exports.useMemo)(
1771
+ () => getYScaleConfig(
1772
+ yAxisTitle,
1773
+ yAxisAbbreviation,
1774
+ yAxisScale,
1775
+ yAxisLabelVisibility,
1776
+ yAxisMin,
1777
+ yAxisMax
1778
+ ),
1779
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1780
+ );
1781
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1782
+ if (y2Enabled) {
1783
+ return getY2ScaleConfig(
1784
+ y2AxisTitle,
1785
+ y2AxisAbbreviation,
1786
+ y2AxisScale,
1787
+ y2IntegerUnits,
1788
+ y2AxisLabelVisibility,
1789
+ y2AxisMin,
1790
+ y2AxisMax
1791
+ );
1792
+ }
1793
+ return {};
1794
+ }, [
1795
+ y2Enabled,
1796
+ y2AxisTitle,
1797
+ y2AxisAbbreviation,
1798
+ y2AxisScale,
1799
+ y2IntegerUnits,
1800
+ y2AxisLabelVisibility,
1801
+ y2AxisMin,
1802
+ y2AxisMax
1803
+ ]);
1430
1804
  const uplotContainerElement = (0, react_exports.useRef)(null);
1431
1805
  const seriesDataFormatted = [
1432
1806
  filteredChartData.columns[0],
@@ -1442,9 +1816,25 @@ var TimeSeriesChartWrapper = (props) => {
1442
1816
  overlayFields,
1443
1817
  y2Enabled,
1444
1818
  nullValueMode,
1445
- markerDisplay
1819
+ markerDisplay,
1820
+ lineDashStyle,
1821
+ lineDashStylesByField,
1822
+ stepPosition,
1823
+ stepPositionsByField
1446
1824
  ),
1447
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1825
+ [
1826
+ yFields,
1827
+ y2Fields,
1828
+ lineWidth,
1829
+ overlayFields,
1830
+ y2Enabled,
1831
+ nullValueMode,
1832
+ markerDisplay,
1833
+ lineDashStyle,
1834
+ lineDashStylesByField,
1835
+ stepPosition,
1836
+ stepPositionsByField
1837
+ ]
1448
1838
  );
1449
1839
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1450
1840
  () => getAnnotationsForCanvas({
@@ -1458,25 +1848,59 @@ var TimeSeriesChartWrapper = (props) => {
1458
1848
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1459
1849
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1460
1850
  );
1461
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1851
+ const isSeriesCompare = legendMode === "seriesCompare";
1852
+ const legend = (0, react_exports.useMemo)(
1853
+ () => getLegend({
1854
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
1855
+ isSeriesCompare,
1856
+ legendTruncation
1857
+ }),
1858
+ [legendDisplay, isSeriesCompare, legendTruncation]
1859
+ );
1462
1860
  const handleChartClick = react_exports.useCallback(
1463
1861
  (event) => {
1464
1862
  if (onClick) {
1465
- handleClick(event, onClick);
1863
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1466
1864
  }
1467
1865
  },
1468
- [onClick]
1866
+ [onClick, trellisKey, trellisSplitBy]
1469
1867
  );
1470
1868
  const handleChartLegendClick = react_exports.useCallback(
1471
1869
  (event) => {
1472
1870
  if (onClick) {
1473
- handleLegendClick(event, onClick);
1871
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1474
1872
  }
1475
1873
  },
1476
- [onClick]
1874
+ [onClick, trellisKey, trellisSplitBy]
1875
+ );
1876
+ const handleChartRangeSelection = react_exports.useCallback(
1877
+ (range2) => {
1878
+ if (onSelect) {
1879
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1880
+ }
1881
+ },
1882
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1883
+ );
1884
+ const handleChartRangeZoom = react_exports.useCallback(
1885
+ (range2) => {
1886
+ if (onSelect) {
1887
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1888
+ }
1889
+ },
1890
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1891
+ );
1892
+ const xFieldToUse = xFieldFromProps || xField;
1893
+ const enableSearchZoom = react_exports.useMemo(
1894
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1895
+ [eventHandlers, xFieldToUse]
1477
1896
  );
1478
1897
  const lastPayloadRef = react_exports.useRef(null);
1479
1898
  const lastOriginalEventRef = react_exports.useRef(null);
1899
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1900
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1901
+ react_exports.useEffect(() => {
1902
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1903
+ }, [additionalTooltipValues]);
1480
1904
  const handleChartCrosshairChange = react_exports.useCallback(
1481
1905
  (event) => {
1482
1906
  if (onPointMouseOver || onPointMouseOut) {
@@ -1488,6 +1912,7 @@ var TimeSeriesChartWrapper = (props) => {
1488
1912
  payload: lastPayloadRef.current
1489
1913
  });
1490
1914
  }
1915
+ previousMouseoverPayloadRef.current = null;
1491
1916
  return;
1492
1917
  }
1493
1918
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1495,25 +1920,36 @@ var TimeSeriesChartWrapper = (props) => {
1495
1920
  });
1496
1921
  delete payload.seriesKey;
1497
1922
  if (event.rowContext) {
1498
- Object.keys(event.rowContext).forEach((fieldName) => {
1499
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1500
- });
1923
+ Object.assign(
1924
+ payload,
1925
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1926
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1927
+ return acc;
1928
+ }, {})
1929
+ );
1930
+ }
1931
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1932
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1933
+ return;
1501
1934
  }
1502
- lastPayloadRef.current = payload;
1935
+ lastPayloadRef.current = updatedPayload;
1503
1936
  lastOriginalEventRef.current = event;
1937
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1504
1938
  if (onPointMouseOver) {
1505
1939
  onPointMouseOver({
1506
1940
  type: "point.mouseover",
1507
1941
  originalEvent: event,
1508
- payload
1942
+ payload: updatedPayload
1509
1943
  });
1510
1944
  }
1511
1945
  }
1512
1946
  },
1513
- [onPointMouseOver, onPointMouseOut]
1947
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1514
1948
  );
1515
- const memoizedChart = (0, react_exports.useMemo)(
1516
- () => /* @__PURE__ */ react_exports.createElement(
1949
+ 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}`;
1950
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1951
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1952
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1517
1953
  visualization_canvas_exports.TimeSeriesChart,
1518
1954
  {
1519
1955
  data: chartData,
@@ -1523,49 +1959,121 @@ var TimeSeriesChartWrapper = (props) => {
1523
1959
  seriesColorsByField,
1524
1960
  seriesConfig: seriesOverrides,
1525
1961
  legend,
1962
+ legendLabels,
1963
+ legendTruncation,
1964
+ isSeriesCompare: legendMode === "seriesCompare",
1965
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1526
1966
  scaleConfig,
1527
1967
  timestampFormat: "expanded",
1528
1968
  onCrosshairClick: onClick ? handleChartClick : void 0,
1529
1969
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1530
1970
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1971
+ onRangeSelection: handleChartRangeSelection,
1972
+ onRangeZoom: computedOnRangeZoom,
1973
+ serverSideZoom: enableSearchZoom,
1531
1974
  userLocale,
1532
1975
  events: chartingEventAnnotations,
1533
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
1976
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
1977
+ additionalTooltipValuesRef,
1978
+ showXMajorGridLines,
1979
+ showYMajorGridLines,
1980
+ showY2MajorGridLines,
1981
+ showYMinorGridLines,
1982
+ showY2MinorGridLines,
1983
+ showLineSmoothing,
1984
+ dataValuesDisplay,
1985
+ showXMajorTicks,
1986
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
1987
+ showYMajorTicks,
1988
+ showY2MajorTicks,
1989
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
1990
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
1991
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
1992
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
1993
+ showYMinorTicks,
1994
+ showY2MinorTicks,
1995
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
1996
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
1997
+ showYAxisWithZero,
1998
+ showY2AxisWithZero,
1999
+ showXAxisLine,
2000
+ showYAxisLine,
2001
+ showY2AxisLine,
2002
+ xAxisMaxLabelParts
1534
2003
  }
1535
- ),
1536
- [
1537
- chartData,
1538
- containerWidth,
1539
- containerHeight,
1540
- seriesColors,
1541
- seriesColorsByField,
1542
- seriesOverrides,
1543
- legend,
1544
- scaleConfig,
1545
- userLocale,
1546
- chartingEventAnnotations,
1547
- onClick,
1548
- handleChartClick,
1549
- onPointMouseOver,
1550
- onPointMouseOut,
1551
- handleChartCrosshairChange,
1552
- handleChartLegendClick
1553
- ]
1554
- );
2004
+ ));
2005
+ }, [
2006
+ onSelect,
2007
+ handleChartRangeZoom,
2008
+ dataKey,
2009
+ chartData,
2010
+ containerWidth,
2011
+ containerHeight,
2012
+ seriesColors,
2013
+ seriesColorsByField,
2014
+ seriesOverrides,
2015
+ legend,
2016
+ legendLabels,
2017
+ legendTruncation,
2018
+ scaleConfig,
2019
+ onClick,
2020
+ handleChartClick,
2021
+ onPointMouseOver,
2022
+ onPointMouseOut,
2023
+ handleChartCrosshairChange,
2024
+ handleChartLegendClick,
2025
+ handleChartRangeSelection,
2026
+ enableSearchZoom,
2027
+ userLocale,
2028
+ chartingEventAnnotations,
2029
+ showXMajorGridLines,
2030
+ showYMajorGridLines,
2031
+ showY2MajorGridLines,
2032
+ showYMinorGridLines,
2033
+ showY2MinorGridLines,
2034
+ showLineSmoothing,
2035
+ dataValuesDisplay,
2036
+ showXMajorTicks,
2037
+ xAxisMajorTickSizeNum,
2038
+ showYMajorTicks,
2039
+ showY2MajorTicks,
2040
+ yAxisMajorTickSizeNum,
2041
+ y2AxisMajorTickSizeNum,
2042
+ yAxisMajorTickIntervalNum,
2043
+ y2AxisMajorTickIntervalNum,
2044
+ showYMinorTicks,
2045
+ showY2MinorTicks,
2046
+ yAxisMinorTickSizeNum,
2047
+ y2AxisMinorTickSizeNum,
2048
+ showYAxisWithZero,
2049
+ showY2AxisWithZero,
2050
+ showXAxisLine,
2051
+ showYAxisLine,
2052
+ showY2AxisLine,
2053
+ legendMode,
2054
+ xAxisMaxLabelParts
2055
+ ]);
1555
2056
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1556
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1557
- }, [backgroundColor, memoizedChart]);
1558
- return /* @__PURE__ */ react_exports.createElement(
2057
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2058
+ }, [bgColor, memoizedChart]);
2059
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2060
+ TrellisTitle,
2061
+ {
2062
+ trellisKey,
2063
+ backgroundColor: bgColor,
2064
+ fontColor: defaultFontColor
2065
+ }
2066
+ ), /* @__PURE__ */ react_exports.createElement(
1559
2067
  TimeSeriesChartContainer,
1560
2068
  {
1561
- height,
2069
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1562
2070
  width,
1563
2071
  ref: uplotContainerElement,
1564
2072
  "data-test": "timeseries-chart-wrapper"
1565
2073
  },
1566
2074
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1567
2075
  memoizedVisualization
1568
- );
2076
+ ));
1569
2077
  };
1570
2078
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1571
2079
 
@@ -1860,36 +2368,36 @@ var visualization_color_palettes_exports = {};
1860
2368
  __export(visualization_color_palettes_exports, {
1861
2369
  default: () => visualization_color_palettes_default
1862
2370
  });
1863
- var defaultImport27 = __toESM(require("@splunk/visualization-color-palettes"));
2371
+ var defaultImport28 = __toESM(require("@splunk/visualization-color-palettes"));
1864
2372
  __reExport(visualization_color_palettes_exports, require("@splunk/visualization-color-palettes"));
1865
- var visualization_color_palettes_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
2373
+ var visualization_color_palettes_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
1866
2374
 
1867
2375
  // esm-externals:d3-interpolate
1868
2376
  var d3_interpolate_exports = {};
1869
2377
  __export(d3_interpolate_exports, {
1870
2378
  default: () => d3_interpolate_default
1871
2379
  });
1872
- var defaultImport28 = __toESM(require("d3-interpolate"));
2380
+ var defaultImport29 = __toESM(require("d3-interpolate"));
1873
2381
  __reExport(d3_interpolate_exports, require("d3-interpolate"));
1874
- var d3_interpolate_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
2382
+ var d3_interpolate_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
1875
2383
 
1876
2384
  // esm-externals:d3-array
1877
2385
  var d3_array_exports = {};
1878
2386
  __export(d3_array_exports, {
1879
2387
  default: () => d3_array_default
1880
2388
  });
1881
- var defaultImport29 = __toESM(require("d3-array"));
2389
+ var defaultImport30 = __toESM(require("d3-array"));
1882
2390
  __reExport(d3_array_exports, require("d3-array"));
1883
- var d3_array_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
2391
+ var d3_array_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
1884
2392
 
1885
2393
  // esm-externals:d3-collection
1886
2394
  var d3_collection_exports = {};
1887
2395
  __export(d3_collection_exports, {
1888
2396
  default: () => d3_collection_default
1889
2397
  });
1890
- var defaultImport30 = __toESM(require("d3-collection"));
2398
+ var defaultImport31 = __toESM(require("d3-collection"));
1891
2399
  __reExport(d3_collection_exports, require("d3-collection"));
1892
- var d3_collection_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
2400
+ var d3_collection_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
1893
2401
 
1894
2402
  // src/Sankey/PureSankey/lib/sankey.js
1895
2403
  var d3_sankey = function() {
@@ -2275,18 +2783,18 @@ var d3_scale_exports = {};
2275
2783
  __export(d3_scale_exports, {
2276
2784
  default: () => d3_scale_default
2277
2785
  });
2278
- var defaultImport31 = __toESM(require("d3-scale"));
2786
+ var defaultImport32 = __toESM(require("d3-scale"));
2279
2787
  __reExport(d3_scale_exports, require("d3-scale"));
2280
- var d3_scale_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
2788
+ var d3_scale_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
2281
2789
 
2282
2790
  // esm-externals:@splunk/visualization-encoding/utils/types
2283
2791
  var types_exports = {};
2284
2792
  __export(types_exports, {
2285
2793
  default: () => types_default
2286
2794
  });
2287
- var defaultImport32 = __toESM(require("@splunk/visualization-encoding/utils/types"));
2795
+ var defaultImport33 = __toESM(require("@splunk/visualization-encoding/utils/types"));
2288
2796
  __reExport(types_exports, require("@splunk/visualization-encoding/utils/types"));
2289
- var types_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
2797
+ var types_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
2290
2798
 
2291
2799
  // src/Sankey/PureSankey/SankeyUtils.ts
2292
2800
  var insertNodeIfNotExist = (sankeyData, nodeName) => {
@@ -2511,23 +3019,24 @@ var NodeText = styled_components_default.text`
2511
3019
  fill: ${(props) => props.isNodeValue && props.nodeValueColor ? props.nodeValueColor : props.nodeTextColor};
2512
3020
  opacity: ${(props) => props.isNodeValue ? "82%" : "100%"};
2513
3021
  `;
2514
- var SankeyNode = (props) => {
2515
- const {
2516
- node,
2517
- maxNode,
2518
- activeNodes,
2519
- nodeWidth,
2520
- chartWidth,
2521
- handleMouseOver,
2522
- handleMouseLeave,
2523
- handleNodeClick,
2524
- colorCategoryMapping,
2525
- nodeTextColor,
2526
- nodeValueColor,
2527
- labelDisplay: labelDisplayInput,
2528
- unit
2529
- } = props;
2530
- const labelDisplay = labelDisplayInput || "off";
3022
+ var SankeyNode = ({
3023
+ node,
3024
+ maxNode,
3025
+ activeNodes,
3026
+ nodeWidth,
3027
+ chartWidth,
3028
+ handleMouseOver = () => {
3029
+ },
3030
+ handleMouseLeave = () => {
3031
+ },
3032
+ handleNodeClick,
3033
+ colorCategoryMapping,
3034
+ nodeTextColor,
3035
+ nodeValueColor,
3036
+ labelDisplay: labelDisplayInput,
3037
+ unit
3038
+ }) => {
3039
+ const labelDisplay = labelDisplayInput != null ? labelDisplayInput : "off";
2531
3040
  const nodeTextRef = (0, react_exports.useRef)();
2532
3041
  const nodeValuePercentRef = (0, react_exports.useRef)();
2533
3042
  let nodeValueFormatted = "";
@@ -2542,7 +3051,7 @@ var SankeyNode = (props) => {
2542
3051
  (0, react_exports.useEffect)(() => {
2543
3052
  truncateSVGTextWithEllipsis(nodeTextRef.current, node.name, MAX_NODE_TEXT_WIDTH);
2544
3053
  });
2545
- const nodeClickHandler = (0, react_exports.useCallback)(() => handleNodeClick(node), [node]);
3054
+ const nodeClickHandler = (0, react_exports.useCallback)(() => handleNodeClick(node), [node, handleNodeClick]);
2546
3055
  const nodeHeight = getNodeHeight(node);
2547
3056
  return /* @__PURE__ */ react_exports.createElement(
2548
3057
  NodeGroup,
@@ -2563,8 +3072,8 @@ var SankeyNode = (props) => {
2563
3072
  height: nodeHeight,
2564
3073
  width: nodeWidth,
2565
3074
  colorCategoryMapping,
2566
- onMouseOver: (ev) => handleMouseOver(ev),
2567
- onMouseLeave: (ev) => handleMouseLeave(ev)
3075
+ onMouseOver: handleMouseOver,
3076
+ onMouseLeave: handleMouseLeave
2568
3077
  }
2569
3078
  ), /* @__PURE__ */ react_exports.createElement(
2570
3079
  NodeText,
@@ -2599,22 +3108,6 @@ var SankeyNode = (props) => {
2599
3108
  ))
2600
3109
  );
2601
3110
  };
2602
- SankeyNode.propTypes = {
2603
- node: prop_types_exports.object,
2604
- activeNodes: prop_types_exports.arrayOf(prop_types_exports.object),
2605
- nodeWidth: prop_types_exports.number,
2606
- chartWidth: prop_types_exports.number,
2607
- handleMouseOver: prop_types_exports.func,
2608
- handleMouseLeave: prop_types_exports.func,
2609
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)]),
2610
- nodeTextColor: prop_types_exports.string
2611
- };
2612
- SankeyNode.defaultProps = {
2613
- handleMouseOver: () => {
2614
- },
2615
- handleMouseLeave: () => {
2616
- }
2617
- };
2618
3111
  var SankeyNode_default = SankeyNode;
2619
3112
 
2620
3113
  // src/Sankey/PureSankey/SankeyLink.tsx
@@ -2636,18 +3129,19 @@ var StyledSankeyLink = styled_components_default.g`
2636
3129
  cursor: pointer;
2637
3130
  }
2638
3131
  `;
2639
- var SankeyLink = (props) => {
2640
- const {
2641
- link,
2642
- colorCategoryMapping,
2643
- activeLinks,
2644
- linkOpacity,
2645
- colorMode,
2646
- path,
2647
- handleMouseOver,
2648
- handleMouseLeave,
2649
- handleLinkClick
2650
- } = props;
3132
+ var SankeyLink = ({
3133
+ link,
3134
+ colorCategoryMapping,
3135
+ activeLinks,
3136
+ linkOpacity,
3137
+ colorMode,
3138
+ path,
3139
+ handleLinkClick,
3140
+ handleMouseOver = () => {
3141
+ },
3142
+ handleMouseLeave = () => {
3143
+ }
3144
+ }) => {
2651
3145
  const circlePoints = extractLinkMidPoint(path(1)(link));
2652
3146
  const linkClickHandler = (0, react_exports.useCallback)(() => handleLinkClick(link), [handleLinkClick, link]);
2653
3147
  return /* @__PURE__ */ react_exports.createElement(
@@ -2660,9 +3154,7 @@ var SankeyLink = (props) => {
2660
3154
  fill: getLinkFill(link, colorCategoryMapping, colorMode),
2661
3155
  opacity: getLinkOpacity(link, activeLinks, linkOpacity),
2662
3156
  onClick: linkClickHandler,
2663
- onMouseOver: (ev) => {
2664
- handleMouseOver(ev);
2665
- },
3157
+ onMouseOver: handleMouseOver,
2666
3158
  onMouseLeave: (ev) => {
2667
3159
  const relatedTarget = ev.relatedTarget;
2668
3160
  let isRelatedTargetPopover = false;
@@ -2685,21 +3177,6 @@ var SankeyLink = (props) => {
2685
3177
  circlePoints && /* @__PURE__ */ react_exports.createElement("circle", { cx: circlePoints.x, cy: circlePoints.y, r: 5, fill: "transparent" })
2686
3178
  );
2687
3179
  };
2688
- SankeyLink.propTypes = {
2689
- link: prop_types_exports.object,
2690
- activeLinks: prop_types_exports.arrayOf(prop_types_exports.object),
2691
- linkOpacity: prop_types_exports.number,
2692
- path: prop_types_exports.func,
2693
- handleMouseOver: prop_types_exports.func,
2694
- handleMouseLeave: prop_types_exports.func,
2695
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)])
2696
- };
2697
- SankeyLink.defaultProps = {
2698
- handleMouseOver: () => {
2699
- },
2700
- handleMouseLeave: () => {
2701
- }
2702
- };
2703
3180
  var SankeyLink_default = SankeyLink;
2704
3181
 
2705
3182
  // esm-externals:@splunk/react-ui/Popover
@@ -2707,9 +3184,9 @@ var Popover_exports = {};
2707
3184
  __export(Popover_exports, {
2708
3185
  default: () => Popover_default
2709
3186
  });
2710
- var defaultImport33 = __toESM(require("@splunk/react-ui/Popover"));
3187
+ var defaultImport34 = __toESM(require("@splunk/react-ui/Popover"));
2711
3188
  __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
2712
- var Popover_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
3189
+ var Popover_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
2713
3190
 
2714
3191
  // src/Sankey/PureSankey/SankeyTooltip.tsx
2715
3192
  var DEFAULT_PLACEMENT = "below";
@@ -2774,22 +3251,22 @@ var NodeValue = styled_components_default.div`
2774
3251
  overflow: hidden;
2775
3252
  white-space: nowrap;
2776
3253
  `;
2777
- var SankeyTooltip = (props) => {
2778
- const {
2779
- mode,
2780
- node,
2781
- link,
2782
- open,
2783
- connectionsMap,
2784
- anchor,
2785
- linkValue,
2786
- colorCategoryMapping,
2787
- width,
2788
- tooltipRowColor,
2789
- tooltipLinkHeaderColor,
2790
- tooltipHeaderColor,
2791
- handleTooltipRequestClose
2792
- } = props;
3254
+ var SankeyTooltip = ({
3255
+ mode,
3256
+ node,
3257
+ link,
3258
+ open,
3259
+ connectionsMap,
3260
+ anchor,
3261
+ linkValue,
3262
+ colorCategoryMapping,
3263
+ width,
3264
+ tooltipRowColor,
3265
+ tooltipLinkHeaderColor,
3266
+ tooltipHeaderColor,
3267
+ handleTooltipRequestClose = () => {
3268
+ }
3269
+ }) => {
2793
3270
  const showSection = (connection, nodeData, section) => {
2794
3271
  if (!connection) {
2795
3272
  return false;
@@ -2888,25 +3365,6 @@ var SankeyTooltip = (props) => {
2888
3365
  };
2889
3366
  return mode === "node" ? renderNodeToolTip() : renderLinkToolTip();
2890
3367
  };
2891
- SankeyTooltip.propTypes = {
2892
- mode: prop_types_exports.string,
2893
- node: prop_types_exports.object,
2894
- linkValue: prop_types_exports.string,
2895
- open: prop_types_exports.bool,
2896
- connectionsMap: prop_types_exports.object,
2897
- anchor: prop_types_exports.object,
2898
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)]),
2899
- tooltipRowColor: prop_types_exports.string,
2900
- tooltipLinkHeaderColor: prop_types_exports.string,
2901
- tooltipHeaderColor: prop_types_exports.string,
2902
- width: prop_types_exports.number,
2903
- height: prop_types_exports.number,
2904
- handleTooltipRequestClose: prop_types_exports.func
2905
- };
2906
- SankeyTooltip.defaultProps = {
2907
- handleTooltipRequestClose: () => {
2908
- }
2909
- };
2910
3368
  var SankeyTooltip_default = SankeyTooltip;
2911
3369
 
2912
3370
  // src/Sankey/PureSankey/PureSankey.tsx
@@ -2924,49 +3382,43 @@ var DEFAULT_CHART_HEIGHT = 300;
2924
3382
  var DEFAULT_SOURCE_INDEX = 0;
2925
3383
  var DEFAULT_TARGET_INDEX = 1;
2926
3384
  var DEFAULT_LINK_VALUE_INDEX = 2;
3385
+ var MARGIN = { top: 17, right: 25, bottom: 17, left: 30 };
3386
+ var TRANSLATE_POS = { x: 28, y: 17 };
2927
3387
  var SankeyContainer = styled_components_default.div`
2928
3388
  overflow: hidden;
2929
3389
  ${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
2930
3390
  `;
2931
- var PureSankey = (props) => {
2932
- const {
2933
- width,
2934
- height,
2935
- columns,
2936
- columnsFromDataSource,
2937
- fields,
2938
- colorMode,
2939
- nodeWidth,
2940
- nodePadding,
2941
- resultLimit,
2942
- seriesColors,
2943
- labelDisplay,
2944
- linkColors,
2945
- linkOpacity,
2946
- linkValueField,
2947
- backgroundColor,
2948
- nodeTextColor,
2949
- nodeValueColor,
2950
- tooltipRowColor,
2951
- tooltipLinkHeaderColor,
2952
- tooltipHeaderColor,
2953
- unit,
2954
- onNodeClick,
2955
- onLinkClick
2956
- } = props;
2957
- const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
2958
- const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
3391
+ var PureSankey = ({
3392
+ width = DEFAULT_CHART_WIDTH,
3393
+ height = DEFAULT_CHART_HEIGHT,
3394
+ columns = [],
3395
+ columnsFromDataSource = [],
3396
+ fields = [],
3397
+ colorMode = "categorical",
3398
+ nodeWidth = 12,
3399
+ nodePadding = 18,
3400
+ resultLimit = 1e3,
3401
+ seriesColors = DEFAULT_SERIES_COLOR,
3402
+ labelDisplay,
3403
+ linkColors = [],
3404
+ linkOpacity = DEFAULT_LINK_OPACITY,
3405
+ linkValueField = "value",
3406
+ backgroundColor = "#0b0c0e",
3407
+ nodeTextColor = "rgba(255, 255, 255, 0.98)",
3408
+ nodeValueColor = "rgba(255, 255, 255, 0.98)",
3409
+ tooltipRowColor = "rgba(255, 255, 255, 0.98)",
3410
+ tooltipLinkHeaderColor = "rgba(255, 255, 255, 0.98)",
3411
+ tooltipHeaderColor = "rgba(255, 255, 255, 0.5)",
3412
+ unit = "",
3413
+ onNodeClick = lodash_exports.noop,
3414
+ onLinkClick = lodash_exports.noop
3415
+ }) => {
3416
+ const [containerWidth, setContainerWidth] = react_exports.useState(Number(width));
3417
+ const [containerHeight, setContainerHeight] = react_exports.useState(Number(height));
2959
3418
  const cachedHandleResize = react_exports.useCallback((w, h) => {
2960
3419
  setContainerWidth(w);
2961
3420
  setContainerHeight(h);
2962
3421
  }, []);
2963
- const margin = {
2964
- top: 17,
2965
- right: 25,
2966
- bottom: 17,
2967
- left: 30
2968
- };
2969
- const translatePos = { x: 28, y: 17 };
2970
3422
  const [activeLinks, setActiveLinks] = (0, react_exports.useState)([]);
2971
3423
  const [activeNodes, setActiveNodes] = (0, react_exports.useState)([]);
2972
3424
  const [nodeHovered, setNodeHovered] = (0, react_exports.useState)(null);
@@ -2975,8 +3427,8 @@ var PureSankey = (props) => {
2975
3427
  const [hoveredLinkElement, setHoveredLinkElement] = (0, react_exports.useState)(null);
2976
3428
  const [openLinkToolTip, setOpenLinkToolTip] = (0, react_exports.useState)(false);
2977
3429
  const sankeyContainerElement = (0, react_exports.useRef)(null);
2978
- const [sankeyWidth, setSankeyWidth] = (0, react_exports.useState)(DEFAULT_CHART_WIDTH - margin.left - margin.right);
2979
- const [sankeyHeight, setSankeyHeight] = (0, react_exports.useState)(DEFAULT_CHART_HEIGHT - margin.top - margin.bottom);
3430
+ const [sankeyWidth, setSankeyWidth] = (0, react_exports.useState)(DEFAULT_CHART_WIDTH - MARGIN.left - MARGIN.right);
3431
+ const [sankeyHeight, setSankeyHeight] = (0, react_exports.useState)(DEFAULT_CHART_HEIGHT - MARGIN.top - MARGIN.bottom);
2980
3432
  const handleNodeClick = (0, react_exports.useCallback)(
2981
3433
  (node) => {
2982
3434
  if (node) {
@@ -2996,8 +3448,9 @@ var PureSankey = (props) => {
2996
3448
  if (link) {
2997
3449
  const payload = { name: linkValueField, value: link.value };
2998
3450
  fields.forEach((field, idx) => {
3451
+ var _a;
2999
3452
  const rowToken = `row.${field}.value`;
3000
- payload[rowToken] = columns[idx][link.index];
3453
+ payload[rowToken] = (_a = columns == null ? void 0 : columns[idx]) == null ? void 0 : _a[link.index];
3001
3454
  });
3002
3455
  onLinkClick({
3003
3456
  type: "link.click",
@@ -3013,10 +3466,10 @@ var PureSankey = (props) => {
3013
3466
  const h = sankeyContainerElement.current.getBoundingClientRect().height;
3014
3467
  const sWidth = checkDigitsOnly(width) ? parseInt(width, 10) : w;
3015
3468
  const sHeight = checkDigitsOnly(height) ? parseInt(height, 10) : h;
3016
- setSankeyWidth(sWidth - margin.left - margin.right);
3017
- setSankeyHeight(sHeight - margin.top - margin.bottom);
3469
+ setSankeyWidth(sWidth - MARGIN.left - MARGIN.right);
3470
+ setSankeyHeight(sHeight - MARGIN.top - MARGIN.bottom);
3018
3471
  }
3019
- }, [width, height, margin.left, margin.right, margin.top, margin.bottom]);
3472
+ }, [width, height]);
3020
3473
  const sankeyData = convertInputToSankeyDataFormat(
3021
3474
  columnsFromDataSource,
3022
3475
  DEFAULT_SOURCE_INDEX,
@@ -3057,175 +3510,116 @@ var PureSankey = (props) => {
3057
3510
  setOpenLinkToolTip(false);
3058
3511
  setOpenNodeToolTip(false);
3059
3512
  };
3060
- const renderVisualization = () => {
3061
- if (containerWidth < CHART_MIN_WIDTH || containerHeight < CHART_MIN_HEIGHT) {
3062
- return /* @__PURE__ */ react_exports.createElement(
3063
- Message_default,
3064
- {
3065
- width: containerWidth,
3066
- height: containerHeight,
3067
- message: (0, i18n_exports._)("Too small to render content"),
3068
- level: "info"
3069
- }
3070
- );
3071
- }
3072
- const renderLinks = (links) => {
3073
- return links.map((link) => {
3074
- return /* @__PURE__ */ react_exports.createElement(
3075
- SankeyLink_default,
3076
- {
3077
- link,
3078
- activeLinks,
3079
- linkOpacity,
3080
- path,
3081
- key: getLinkId(link),
3082
- "data-test": getLinkId(link),
3083
- colorCategoryMapping,
3084
- colorMode,
3085
- handleMouseOver: (ev) => {
3086
- setActiveLinks([link]);
3087
- setActiveNodes([link.source, link.target]);
3088
- setHoveredLinkElement(ev.currentTarget.querySelector("circle"));
3089
- setOpenNodeToolTip(false);
3090
- setOpenLinkToolTip(true);
3091
- },
3092
- handleMouseLeave: () => {
3093
- resetStates();
3094
- },
3095
- handleLinkClick
3096
- }
3097
- );
3098
- });
3099
- };
3100
- const maxNode = getMaxNode(sankeyData.nodes);
3101
- const renderNodes = (nodes) => {
3102
- const chartWidth = typeof width === "number" ? width : Number.parseInt(width, 10);
3103
- return nodes.map((node) => {
3104
- return /* @__PURE__ */ react_exports.createElement(
3105
- SankeyNode_default,
3106
- {
3107
- node,
3108
- maxNode,
3109
- key: getNodeId(node),
3110
- "data-test": getNodeId(node),
3111
- activeNodes,
3112
- nodeWidth,
3113
- chartWidth,
3114
- colorCategoryMapping,
3115
- labelDisplay,
3116
- unit,
3117
- nodeTextColor,
3118
- nodeValueColor,
3119
- handleMouseOver: (ev) => {
3120
- const connections = nodeConnectionsMap[node.index];
3121
- setActiveLinks(connections.links);
3122
- setNodeHovered(node);
3123
- setActiveNodes([...connections.sourceNodes, ...connections.targetNodes]);
3124
- setHoveredNodeElement(ev.currentTarget);
3125
- setOpenLinkToolTip(false);
3126
- setOpenNodeToolTip(true);
3127
- },
3128
- handleMouseLeave: () => resetStates(),
3129
- handleNodeClick
3130
- }
3131
- );
3132
- });
3133
- };
3134
- return /* @__PURE__ */ react_exports.createElement(
3135
- VizStyleWrapper_default,
3513
+ const maxNode = getMaxNode(sankeyData.nodes);
3514
+ const chartWidth = typeof width === "number" ? width : Number.parseInt(width, 10);
3515
+ const renderLinks = (links) => {
3516
+ return links.map((link) => /* @__PURE__ */ react_exports.createElement(
3517
+ SankeyLink_default,
3136
3518
  {
3137
- backgroundColor,
3138
- dataTestKey: "SankeyWrapper",
3139
- onMouseLeave: () => resetStates()
3140
- },
3141
- /* @__PURE__ */ react_exports.createElement("svg", { height: "100%", width: "100%", "data-test": "sankey-svg" }, /* @__PURE__ */ react_exports.createElement("g", { transform: `translate(${translatePos.x},${translatePos.y})` }, /* @__PURE__ */ react_exports.createElement("g", { className: "link-group", "data-test": "link-group" }, renderLinks(sankeyData.links), openLinkToolTip && /* @__PURE__ */ react_exports.createElement(
3142
- SankeyTooltip_default,
3143
- {
3144
- mode: "link",
3145
- open: openLinkToolTip,
3146
- handleTooltipRequestClose: () => resetStates(),
3147
- linkValue: linkValueField,
3148
- connectionsMap: nodeConnectionsMap,
3149
- anchor: hoveredLinkElement,
3150
- link: activeLinks[0],
3151
- height: sankeyHeight,
3152
- width: sankeyWidth,
3153
- colorCategoryMapping,
3154
- tooltipRowColor,
3155
- tooltipLinkHeaderColor,
3156
- tooltipHeaderColor
3157
- }
3158
- )), /* @__PURE__ */ react_exports.createElement("g", { className: "node-group", "data-test": "node-group" }, renderNodes(sankeyData.nodes), openNodeToolTip && /* @__PURE__ */ react_exports.createElement(
3159
- SankeyTooltip_default,
3160
- {
3161
- mode: "node",
3162
- open: openNodeToolTip,
3163
- handleTooltipRequestClose: () => resetStates(),
3164
- linkValue: linkValueField,
3165
- connectionsMap: nodeConnectionsMap,
3166
- anchor: hoveredNodeElement,
3167
- node: nodeHovered,
3168
- height: sankeyHeight,
3169
- width: sankeyWidth,
3170
- colorCategoryMapping,
3171
- tooltipRowColor,
3172
- tooltipLinkHeaderColor,
3173
- tooltipHeaderColor
3174
- }
3175
- ))))
3176
- );
3519
+ link,
3520
+ activeLinks,
3521
+ linkOpacity,
3522
+ path,
3523
+ key: getLinkId(link),
3524
+ "data-test": getLinkId(link),
3525
+ colorCategoryMapping,
3526
+ colorMode,
3527
+ handleMouseOver: (ev) => {
3528
+ setActiveLinks([link]);
3529
+ setActiveNodes([link.source, link.target]);
3530
+ setHoveredLinkElement(ev.currentTarget.querySelector("circle"));
3531
+ setOpenNodeToolTip(false);
3532
+ setOpenLinkToolTip(true);
3533
+ },
3534
+ handleMouseLeave: resetStates,
3535
+ handleLinkClick
3536
+ }
3537
+ ));
3177
3538
  };
3178
- return /* @__PURE__ */ react_exports.createElement(SankeyContainer, { height, width, ref: sankeyContainerElement }, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), renderVisualization());
3179
- };
3180
- PureSankey.propTypes = {
3181
- columns: prop_types_exports.array,
3182
- columnsFromDataSource: prop_types_exports.array,
3183
- fields: prop_types_exports.array,
3184
- width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
3185
- height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
3186
- // need this to satisfy props interface
3187
- // eslint-disable-next-line react/no-unused-prop-types
3188
- mode: prop_types_exports.string,
3189
- colorMode: prop_types_exports.string,
3190
- nodeWidth: prop_types_exports.number,
3191
- nodePadding: prop_types_exports.number,
3192
- resultLimit: prop_types_exports.number,
3193
- seriesColors: prop_types_exports.arrayOf(prop_types_exports.string),
3194
- linkColors: prop_types_exports.arrayOf(prop_types_exports.string),
3195
- linkOpacity: prop_types_exports.number,
3196
- linkValueField: prop_types_exports.string,
3197
- backgroundColor: prop_types_exports.string,
3198
- nodeTextColor: prop_types_exports.string,
3199
- nodeValueColor: prop_types_exports.string,
3200
- tooltipRowColor: prop_types_exports.string,
3201
- tooltipLinkHeaderColor: prop_types_exports.string,
3202
- tooltipHeaderColor: prop_types_exports.string,
3203
- unit: prop_types_exports.string
3204
- };
3205
- PureSankey.defaultProps = {
3206
- columnsFromDataSource: [],
3207
- columns: [],
3208
- fields: [],
3209
- width: DEFAULT_CHART_WIDTH,
3210
- height: DEFAULT_CHART_HEIGHT,
3211
- mode: "view",
3212
- colorMode: "categorical",
3213
- nodeWidth: 12,
3214
- nodePadding: 18,
3215
- resultLimit: 1e3,
3216
- seriesColors: DEFAULT_SERIES_COLOR,
3217
- linkColors: [],
3218
- linkOpacity: DEFAULT_LINK_OPACITY,
3219
- linkValueField: "value",
3220
- backgroundColor: "#0b0c0e",
3221
- nodeTextColor: "rgba(255, 255, 255, 0.98)",
3222
- nodeValueColor: "rgba(255, 255, 255, 0.98)",
3223
- tooltipRowColor: "rgba(255, 255, 255, 0.98)",
3224
- tooltipLinkHeaderColor: "rgba(255, 255, 255, 0.98)",
3225
- tooltipHeaderColor: "rgba(255, 255, 255, 0.5)",
3226
- onNodeClick: lodash_exports.noop,
3227
- onLinkClick: lodash_exports.noop,
3228
- unit: ""
3539
+ const renderNodes = (nodes) => {
3540
+ return nodes.map((node) => /* @__PURE__ */ react_exports.createElement(
3541
+ SankeyNode_default,
3542
+ {
3543
+ node,
3544
+ maxNode,
3545
+ key: getNodeId(node),
3546
+ "data-test": getNodeId(node),
3547
+ activeNodes,
3548
+ nodeWidth,
3549
+ chartWidth,
3550
+ colorCategoryMapping,
3551
+ labelDisplay,
3552
+ unit,
3553
+ nodeTextColor,
3554
+ nodeValueColor,
3555
+ handleMouseOver: (ev) => {
3556
+ const connections = nodeConnectionsMap[node.index];
3557
+ setActiveLinks(connections.links);
3558
+ setNodeHovered(node);
3559
+ setActiveNodes([...connections.sourceNodes, ...connections.targetNodes]);
3560
+ setHoveredNodeElement(ev.currentTarget);
3561
+ setOpenLinkToolTip(false);
3562
+ setOpenNodeToolTip(true);
3563
+ },
3564
+ handleMouseLeave: resetStates,
3565
+ handleNodeClick
3566
+ }
3567
+ ));
3568
+ };
3569
+ if (containerWidth < CHART_MIN_WIDTH || containerHeight < CHART_MIN_HEIGHT) {
3570
+ return /* @__PURE__ */ react_exports.createElement(SankeyContainer, { height, width, ref: sankeyContainerElement }, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), /* @__PURE__ */ react_exports.createElement(
3571
+ Message_default,
3572
+ {
3573
+ width: containerWidth,
3574
+ height: containerHeight,
3575
+ message: (0, i18n_exports._)("Too small to render content"),
3576
+ level: "info"
3577
+ }
3578
+ ));
3579
+ }
3580
+ return /* @__PURE__ */ react_exports.createElement(SankeyContainer, { height, width, ref: sankeyContainerElement }, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), /* @__PURE__ */ react_exports.createElement(
3581
+ VizStyleWrapper_default,
3582
+ {
3583
+ backgroundColor,
3584
+ dataTestKey: "SankeyWrapper",
3585
+ onMouseLeave: resetStates
3586
+ },
3587
+ /* @__PURE__ */ react_exports.createElement("svg", { height: "100%", width: "100%", "data-test": "sankey-svg" }, /* @__PURE__ */ react_exports.createElement("g", { transform: `translate(${TRANSLATE_POS.x},${TRANSLATE_POS.y})` }, /* @__PURE__ */ react_exports.createElement("g", { className: "link-group", "data-test": "link-group" }, renderLinks(sankeyData.links), openLinkToolTip && /* @__PURE__ */ react_exports.createElement(
3588
+ SankeyTooltip_default,
3589
+ {
3590
+ mode: "link",
3591
+ open: openLinkToolTip,
3592
+ handleTooltipRequestClose: resetStates,
3593
+ linkValue: linkValueField,
3594
+ connectionsMap: nodeConnectionsMap,
3595
+ anchor: hoveredLinkElement,
3596
+ link: activeLinks[0],
3597
+ height: sankeyHeight,
3598
+ width: sankeyWidth,
3599
+ colorCategoryMapping,
3600
+ tooltipRowColor,
3601
+ tooltipLinkHeaderColor,
3602
+ tooltipHeaderColor
3603
+ }
3604
+ )), /* @__PURE__ */ react_exports.createElement("g", { className: "node-group", "data-test": "node-group" }, renderNodes(sankeyData.nodes), openNodeToolTip && /* @__PURE__ */ react_exports.createElement(
3605
+ SankeyTooltip_default,
3606
+ {
3607
+ mode: "node",
3608
+ open: openNodeToolTip,
3609
+ handleTooltipRequestClose: resetStates,
3610
+ linkValue: linkValueField,
3611
+ connectionsMap: nodeConnectionsMap,
3612
+ anchor: hoveredNodeElement,
3613
+ node: nodeHovered,
3614
+ height: sankeyHeight,
3615
+ width: sankeyWidth,
3616
+ colorCategoryMapping,
3617
+ tooltipRowColor,
3618
+ tooltipLinkHeaderColor,
3619
+ tooltipHeaderColor
3620
+ }
3621
+ ))))
3622
+ ));
3229
3623
  };
3230
3624
  var PureSankey_default = PureSankey;
3231
3625
 
@@ -3234,27 +3628,18 @@ var visualization_icons_exports = {};
3234
3628
  __export(visualization_icons_exports, {
3235
3629
  default: () => visualization_icons_default
3236
3630
  });
3237
- var defaultImport34 = __toESM(require("@splunk/visualization-icons"));
3631
+ var defaultImport35 = __toESM(require("@splunk/visualization-icons"));
3238
3632
  __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
3239
- var visualization_icons_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
3633
+ var visualization_icons_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3240
3634
 
3241
3635
  // esm-externals:@splunk/visualization-icons/placeholders
3242
3636
  var placeholders_exports = {};
3243
3637
  __export(placeholders_exports, {
3244
3638
  default: () => placeholders_default
3245
3639
  });
3246
- var defaultImport35 = __toESM(require("@splunk/visualization-icons/placeholders"));
3640
+ var defaultImport36 = __toESM(require("@splunk/visualization-icons/placeholders"));
3247
3641
  __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
3248
- var placeholders_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3249
-
3250
- // esm-externals:@splunk/visualization-schemas
3251
- var visualization_schemas_exports = {};
3252
- __export(visualization_schemas_exports, {
3253
- default: () => visualization_schemas_default
3254
- });
3255
- var defaultImport36 = __toESM(require("@splunk/visualization-schemas"));
3256
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
3257
- var visualization_schemas_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3642
+ var placeholders_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3258
3643
 
3259
3644
  // esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
3260
3645
  var PresetPalettes_exports = {};
@@ -3562,7 +3947,7 @@ var computeVizProps = ({
3562
3947
  themeColorVariables.forEach((variable) => {
3563
3948
  themeColors[variable] = themeFunc(variable);
3564
3949
  });
3565
- linkColors = (0, colorUtils_exports.sanitizeArrayOfColors)(linkColors);
3950
+ linkColors = (0, colorUtils_exports.sanitizeArrayOfColors)(linkColors != null ? linkColors : []);
3566
3951
  seriesColors = (0, colorUtils_exports.isArrayOfColors)(seriesColors) ? seriesColors : void 0;
3567
3952
  const { columns, fields } = dataSources.primary.data;
3568
3953
  let columnsFromDataSource = [];