@splunk/visualizations 28.4.0 → 28.5.1

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 (165) hide show
  1. package/Area.config.js +28 -7
  2. package/Area.config.js.map +2 -2
  3. package/Area.js +109 -39
  4. package/Area.js.map +2 -2
  5. package/Bar.config.js +28 -7
  6. package/Bar.config.js.map +2 -2
  7. package/Bar.js +109 -39
  8. package/Bar.js.map +2 -2
  9. package/Bubble.config.js +4 -4
  10. package/Bubble.config.js.map +2 -2
  11. package/Bubble.js +81 -30
  12. package/Bubble.js.map +2 -2
  13. package/CHANGELOG.external.md +98 -0
  14. package/ChoroplethSvg.js +74 -26
  15. package/ChoroplethSvg.js.map +2 -2
  16. package/Column.config.js +28 -7
  17. package/Column.config.js.map +2 -2
  18. package/Column.js +109 -39
  19. package/Column.js.map +2 -2
  20. package/Ellipse/config.d.ts.map +1 -1
  21. package/Ellipse.config.js +14 -5
  22. package/Ellipse.config.js.map +4 -4
  23. package/Ellipse.js +130 -73
  24. package/Ellipse.js.map +4 -4
  25. package/Events.js +74 -26
  26. package/Events.js.map +2 -2
  27. package/FillerGauge.js +234 -47
  28. package/FillerGauge.js.map +2 -2
  29. package/Image.js +74 -26
  30. package/Image.js.map +2 -2
  31. package/Line/lineUtils.d.ts.map +1 -1
  32. package/Line/mockdata/LineData.d.ts +95 -0
  33. package/Line/mockdata/LineData.d.ts.map +1 -1
  34. package/Line.config.js +28 -7
  35. package/Line.config.js.map +2 -2
  36. package/Line.js +125 -41
  37. package/Line.js.map +2 -2
  38. package/LinkGraph.js +74 -26
  39. package/LinkGraph.js.map +2 -2
  40. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  41. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  42. package/Map/PureMap/MapUtils.d.ts +2 -2
  43. package/Map/PureMap/MapUtils.d.ts.map +1 -1
  44. package/Map/PureMap/PureMap.d.ts.map +1 -1
  45. package/Map.js +111 -37
  46. package/Map.js.map +2 -2
  47. package/Markdown/config.d.ts.map +1 -1
  48. package/Markdown.config.js +14 -5
  49. package/Markdown.config.js.map +4 -4
  50. package/Markdown.js +91 -34
  51. package/Markdown.js.map +4 -4
  52. package/MarkerGauge.js +243 -56
  53. package/MarkerGauge.js.map +4 -4
  54. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -1
  55. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -1
  56. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -1
  57. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts +78 -0
  58. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts.map +1 -0
  59. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +1 -2
  60. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -1
  61. package/NetworkGraph/config.d.ts.map +1 -1
  62. package/NetworkGraph.config.js +1 -0
  63. package/NetworkGraph.config.js.map +2 -2
  64. package/NetworkGraph.js +366 -105
  65. package/NetworkGraph.js.map +4 -4
  66. package/PERFORMANCE.md +23 -0
  67. package/ParallelCoordinates/ParallelCoordinates.d.ts +1 -46
  68. package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
  69. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +12 -58
  70. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -1
  71. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +1 -0
  72. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -1
  73. package/ParallelCoordinates.js +150 -153
  74. package/ParallelCoordinates.js.map +4 -4
  75. package/Pie/Pie.d.ts.map +1 -1
  76. package/Pie/config.d.ts.map +1 -1
  77. package/Pie/pieUtils.d.ts +4 -0
  78. package/Pie/pieUtils.d.ts.map +1 -1
  79. package/Pie.config.js +16 -0
  80. package/Pie.config.js.map +2 -2
  81. package/Pie.js +121 -35
  82. package/Pie.js.map +2 -2
  83. package/Punchcard.js +74 -26
  84. package/Punchcard.js.map +2 -2
  85. package/Rectangle/config.d.ts.map +1 -1
  86. package/Rectangle.config.js +14 -5
  87. package/Rectangle.config.js.map +4 -4
  88. package/Rectangle.js +92 -35
  89. package/Rectangle.js.map +4 -4
  90. package/Sankey/PureSankey/PureSankey.d.ts +26 -72
  91. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  92. package/Sankey/PureSankey/SankeyLink.d.ts +3 -19
  93. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  94. package/Sankey/PureSankey/SankeyNode.d.ts +3 -20
  95. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  96. package/Sankey/PureSankey/SankeyTooltip.d.ts +3 -24
  97. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  98. package/Sankey.js +270 -336
  99. package/Sankey.js.map +2 -2
  100. package/Scatter.config.js +168 -147
  101. package/Scatter.config.js.map +4 -4
  102. package/Scatter.js +249 -179
  103. package/Scatter.js.map +4 -4
  104. package/SingleValue.js +96 -75
  105. package/SingleValue.js.map +2 -2
  106. package/SingleValueIcon/config.d.ts.map +1 -1
  107. package/SingleValueIcon.config.js +14 -5
  108. package/SingleValueIcon.config.js.map +4 -4
  109. package/SingleValueIcon.js +118 -76
  110. package/SingleValueIcon.js.map +4 -4
  111. package/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -1
  112. package/SingleValueRadial.js +95 -76
  113. package/SingleValueRadial.js.map +2 -2
  114. package/Table/Table.d.ts.map +1 -1
  115. package/Table/hooks.d.ts +2 -0
  116. package/Table/hooks.d.ts.map +1 -1
  117. package/Table.js +95 -49
  118. package/Table.js.map +2 -2
  119. package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
  120. package/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -1
  121. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  122. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +2 -1
  123. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  124. package/Timeline.js +154 -54
  125. package/Timeline.js.map +2 -2
  126. package/common/Charting.d.ts.map +1 -1
  127. package/common/Charting.js +3 -0
  128. package/common/Charting.js.map +2 -2
  129. package/common/GaugeMajorTicks.js +150 -13
  130. package/common/GaugeMajorTicks.js.map +4 -4
  131. package/common/GaugeValueMarker.js +84 -17
  132. package/common/GaugeValueMarker.js.map +4 -4
  133. package/common/OptionsDoc.js.map +1 -1
  134. package/common/OverviewDoc.d.ts.map +1 -1
  135. package/common/OverviewDoc.js +2 -2
  136. package/common/OverviewDoc.js.map +2 -2
  137. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  138. package/common/TimeSeriesChartWrapper.js +72 -24
  139. package/common/TimeSeriesChartWrapper.js.map +2 -2
  140. package/common/chartingUtils.d.ts +9 -3
  141. package/common/chartingUtils.d.ts.map +1 -1
  142. package/common/chartingUtils.js +21 -16
  143. package/common/chartingUtils.js.map +2 -2
  144. package/common/editorConfig/AxesChartDataConfig.d.ts +3 -3
  145. package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
  146. package/common/editorConfig/AxesChartDataDisplay.d.ts +4 -0
  147. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  148. package/common/editorConfig/AxesChartLegend.d.ts.map +1 -1
  149. package/common/gaugeUtils.d.ts +37 -0
  150. package/common/gaugeUtils.d.ts.map +1 -1
  151. package/common/gaugeUtils.js +152 -2
  152. package/common/gaugeUtils.js.map +4 -4
  153. package/common/hocs/mockdata/trellisData.d.ts +119 -0
  154. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  155. package/common/interfaces/Overview.d.ts +1 -0
  156. package/common/interfaces/Overview.d.ts.map +1 -1
  157. package/common/interfaces/VizConfig.d.ts +2 -1
  158. package/common/interfaces/VizConfig.d.ts.map +1 -1
  159. package/common/utils/mapUtils.js.map +1 -1
  160. package/common/utils/trellisUtils.d.ts.map +1 -1
  161. package/common/utils/trellisUtils.js +4 -6
  162. package/common/utils/trellisUtils.js.map +2 -2
  163. package/common/withDashboardViz.js +74 -26
  164. package/common/withDashboardViz.js.map +2 -2
  165. package/package.json +36 -36
package/Sankey.js CHANGED
@@ -497,7 +497,7 @@ var Cover = styled_components_default.div`
497
497
  bottom: 0;
498
498
  `;
499
499
  var Blocker = styled_components_default.div.attrs({
500
- "data-splunk-visualization-version": "28.4.0 - 002bd482f"
500
+ "data-splunk-visualization-version": "28.5.1 - 617766eb3"
501
501
  })`
502
502
  position: relative;
503
503
  width: 100%;
@@ -587,7 +587,7 @@ var withFixedSizeContainer = (Viz) => {
587
587
  FixSizeItem,
588
588
  {
589
589
  "data-test": "fix-size-item",
590
- "data-splunk-visualization-version": "28.4.0 - 002bd482f",
590
+ "data-splunk-visualization-version": "28.5.1 - 617766eb3",
591
591
  width,
592
592
  height,
593
593
  backgroundColor
@@ -1192,25 +1192,27 @@ var parseAxisValue = (val) => {
1192
1192
  const num = typeof val === "number" ? val : Number.parseFloat(val);
1193
1193
  return Number.isNaN(num) ? void 0 : num;
1194
1194
  };
1195
- var SideLegendWidth = 75;
1196
- var SeriesCompareLegendWidth = 200;
1195
+ var parseXAxisLineVisibility = (visibility) => {
1196
+ if (visibility === "hide") return false;
1197
+ if (visibility === "show") return true;
1198
+ return void 0;
1199
+ };
1197
1200
  var getLegend = (props) => {
1198
1201
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1199
- const { isSeriesCompare } = props;
1202
+ const { isSeriesCompare, legendTruncation } = props;
1200
1203
  const commonLegendProps = {
1201
1204
  center: true,
1202
1205
  fontSize: 12,
1203
1206
  largerTiles: true,
1204
- hideSeriesValue: !isSeriesCompare
1207
+ hideSeriesValue: !isSeriesCompare,
1205
1208
  // Show values if in seriesCompare mode
1209
+ legendTruncation
1206
1210
  };
1207
1211
  switch (legendPlacement) {
1208
1212
  case "off":
1209
1213
  return false;
1210
1214
  case "left":
1211
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1212
- width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1213
- }, commonLegendProps));
1215
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
1214
1216
  case "bottom":
1215
1217
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
1216
1218
  wrap: true
@@ -1220,9 +1222,7 @@ var getLegend = (props) => {
1220
1222
  wrap: true
1221
1223
  }, commonLegendProps));
1222
1224
  default:
1223
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1224
- width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1225
- }, commonLegendProps));
1225
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
1226
1226
  }
1227
1227
  };
1228
1228
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -1283,9 +1283,7 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1283
1283
  if (yAxisAbbreviation !== "none") {
1284
1284
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
1285
1285
  }
1286
- if (yAxisAbbreviation === "none") {
1287
- yConfig.y.width = 55;
1288
- } else {
1286
+ if (yAxisAbbreviation !== "none") {
1289
1287
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
1290
1288
  }
1291
1289
  if (yAxisLabelVisibility === "hide") {
@@ -1308,6 +1306,7 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1308
1306
  y2Config.y2.type = scaleType;
1309
1307
  if (axisAbbreviation !== "none") {
1310
1308
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
1309
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
1311
1310
  } else if (roundAxisLabelsToInteger) {
1312
1311
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
1313
1312
  }
@@ -1323,7 +1322,7 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1323
1322
  }
1324
1323
  return y2Config;
1325
1324
  };
1326
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1325
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
1327
1326
  const seriesConfig = {};
1328
1327
  let spanGaps;
1329
1328
  let replaceNullsWithZero;
@@ -1350,6 +1349,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1350
1349
  );
1351
1350
  if (shouldAssignToY2) {
1352
1351
  seriesConfig[field].overrides.scale = "y2";
1352
+ } else {
1353
+ seriesConfig[field].overrides.scale = "y";
1353
1354
  }
1354
1355
  }
1355
1356
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -1362,6 +1363,11 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1362
1363
  if (fieldDashStyle) {
1363
1364
  seriesConfig[field].lineDashStyle = fieldDashStyle;
1364
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
+ }
1365
1371
  if (replaceNullsWithZero !== void 0) {
1366
1372
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1367
1373
  }
@@ -1595,6 +1601,9 @@ var TimeSeriesChartWrapper = (props) => {
1595
1601
  backgroundColor,
1596
1602
  defaultFontColor,
1597
1603
  additionalTooltipValues,
1604
+ xAxisLineVisibility: xAxisLineVisibility,
1605
+ yAxisLineVisibility,
1606
+ y2AxisLineVisibility,
1598
1607
  showYAxisWithZero: showYAxisWithZeroFromProps,
1599
1608
  showY2AxisWithZero: showY2AxisWithZeroFromProps
1600
1609
  } = _a, otherOptions = __objRest(_a, [
@@ -1618,6 +1627,10 @@ var TimeSeriesChartWrapper = (props) => {
1618
1627
  "backgroundColor",
1619
1628
  "defaultFontColor",
1620
1629
  "additionalTooltipValues",
1630
+ // Extract axis line visibility options from props
1631
+ "xAxisLineVisibility",
1632
+ "yAxisLineVisibility",
1633
+ "y2AxisLineVisibility",
1621
1634
  // Extract showYAxisWithZero directly from props for accelerated render mode
1622
1635
  "showYAxisWithZero",
1623
1636
  "showY2AxisWithZero"
@@ -1630,6 +1643,7 @@ var TimeSeriesChartWrapper = (props) => {
1630
1643
  fieldColors,
1631
1644
  legendLabels: legendLabelsStr,
1632
1645
  legendMode,
1646
+ legendTruncation,
1633
1647
  "axisTitleX.text": xAxisTitleText,
1634
1648
  "axisTitleY.text": yAxisTitleText,
1635
1649
  "axisTitleY2.text": y2AxisTitleText,
@@ -1638,6 +1652,7 @@ var TimeSeriesChartWrapper = (props) => {
1638
1652
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1639
1653
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1640
1654
  "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1655
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
1641
1656
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1642
1657
  "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1643
1658
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
@@ -1655,6 +1670,8 @@ var TimeSeriesChartWrapper = (props) => {
1655
1670
  lineWidth,
1656
1671
  lineDashStyle,
1657
1672
  fieldDashStyles: lineDashStylesByFieldStr,
1673
+ stepPosition,
1674
+ fieldStepPositions: stepPositionsByFieldStr,
1658
1675
  yAxisMin: yAxisMinRaw,
1659
1676
  yAxisMax: yAxisMaxRaw,
1660
1677
  y2AxisMin: y2AxisMinRaw,
@@ -1665,6 +1682,8 @@ var TimeSeriesChartWrapper = (props) => {
1665
1682
  showYMinorGridLines,
1666
1683
  showY2MinorGridLines,
1667
1684
  showLineSmoothing,
1685
+ xAxisMajorTickVisibility,
1686
+ xAxisMajorTickSize,
1668
1687
  yAxisMajorTickVisibility,
1669
1688
  y2AxisMajorTickVisibility,
1670
1689
  yAxisMajorTickSize,
@@ -1681,10 +1700,14 @@ var TimeSeriesChartWrapper = (props) => {
1681
1700
  const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1682
1701
  const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1683
1702
  const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1703
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
1684
1704
  const showYMajorTicks = yAxisMajorTickVisibility === "show";
1685
1705
  const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1686
1706
  const showYMinorTicks = yAxisMinorTickVisibility === "show";
1687
1707
  const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1708
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
1709
+ const showYAxisLine = yAxisLineVisibility === "show";
1710
+ const showY2AxisLine = y2AxisLineVisibility === "show";
1688
1711
  const yAxisMin = parseAxisValue(yAxisMinRaw);
1689
1712
  const yAxisMax = parseAxisValue(yAxisMaxRaw);
1690
1713
  const y2AxisMin = parseAxisValue(y2AxisMinRaw);
@@ -1699,13 +1722,15 @@ var TimeSeriesChartWrapper = (props) => {
1699
1722
  y2AxisMajorUnitFromSimpleXML,
1700
1723
  y2AxisMajorTickInterval
1701
1724
  );
1702
- const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
1703
- const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
1704
- const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
1705
- const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
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;
1706
1730
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1707
1731
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1708
1732
  const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1733
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
1709
1734
  const legendLabels = parseArrayOption(legendLabelsStr);
1710
1735
  const bgColor = backgroundColor || bgColorFromOptions;
1711
1736
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
@@ -1793,7 +1818,9 @@ var TimeSeriesChartWrapper = (props) => {
1793
1818
  nullValueMode,
1794
1819
  markerDisplay,
1795
1820
  lineDashStyle,
1796
- lineDashStylesByField
1821
+ lineDashStylesByField,
1822
+ stepPosition,
1823
+ stepPositionsByField
1797
1824
  ),
1798
1825
  [
1799
1826
  yFields,
@@ -1804,7 +1831,9 @@ var TimeSeriesChartWrapper = (props) => {
1804
1831
  nullValueMode,
1805
1832
  markerDisplay,
1806
1833
  lineDashStyle,
1807
- lineDashStylesByField
1834
+ lineDashStylesByField,
1835
+ stepPosition,
1836
+ stepPositionsByField
1808
1837
  ]
1809
1838
  );
1810
1839
  const chartingEventAnnotations = (0, react_exports.useMemo)(
@@ -1819,9 +1848,14 @@ var TimeSeriesChartWrapper = (props) => {
1819
1848
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1820
1849
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1821
1850
  );
1851
+ const isSeriesCompare = legendMode === "seriesCompare";
1822
1852
  const legend = (0, react_exports.useMemo)(
1823
- () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
1824
- [legendDisplay, legendMode]
1853
+ () => getLegend({
1854
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
1855
+ isSeriesCompare,
1856
+ legendTruncation
1857
+ }),
1858
+ [legendDisplay, isSeriesCompare, legendTruncation]
1825
1859
  );
1826
1860
  const handleChartClick = react_exports.useCallback(
1827
1861
  (event) => {
@@ -1926,6 +1960,7 @@ var TimeSeriesChartWrapper = (props) => {
1926
1960
  seriesConfig: seriesOverrides,
1927
1961
  legend,
1928
1962
  legendLabels,
1963
+ legendTruncation,
1929
1964
  isSeriesCompare: legendMode === "seriesCompare",
1930
1965
  maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1931
1966
  scaleConfig,
@@ -1947,6 +1982,8 @@ var TimeSeriesChartWrapper = (props) => {
1947
1982
  showY2MinorGridLines,
1948
1983
  showLineSmoothing,
1949
1984
  dataValuesDisplay,
1985
+ showXMajorTicks,
1986
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
1950
1987
  showYMajorTicks,
1951
1988
  showY2MajorTicks,
1952
1989
  yAxisMajorTickSize: yAxisMajorTickSizeNum,
@@ -1958,7 +1995,11 @@ var TimeSeriesChartWrapper = (props) => {
1958
1995
  yAxisMinorTickSize: yAxisMinorTickSizeNum,
1959
1996
  y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
1960
1997
  showYAxisWithZero,
1961
- showY2AxisWithZero
1998
+ showY2AxisWithZero,
1999
+ showXAxisLine,
2000
+ showYAxisLine,
2001
+ showY2AxisLine,
2002
+ xAxisMaxLabelParts
1962
2003
  }
1963
2004
  ));
1964
2005
  }, [
@@ -1973,6 +2014,7 @@ var TimeSeriesChartWrapper = (props) => {
1973
2014
  seriesOverrides,
1974
2015
  legend,
1975
2016
  legendLabels,
2017
+ legendTruncation,
1976
2018
  scaleConfig,
1977
2019
  onClick,
1978
2020
  handleChartClick,
@@ -1991,6 +2033,8 @@ var TimeSeriesChartWrapper = (props) => {
1991
2033
  showY2MinorGridLines,
1992
2034
  showLineSmoothing,
1993
2035
  dataValuesDisplay,
2036
+ showXMajorTicks,
2037
+ xAxisMajorTickSizeNum,
1994
2038
  showYMajorTicks,
1995
2039
  showY2MajorTicks,
1996
2040
  yAxisMajorTickSizeNum,
@@ -2003,7 +2047,11 @@ var TimeSeriesChartWrapper = (props) => {
2003
2047
  y2AxisMinorTickSizeNum,
2004
2048
  showYAxisWithZero,
2005
2049
  showY2AxisWithZero,
2006
- legendMode
2050
+ showXAxisLine,
2051
+ showYAxisLine,
2052
+ showY2AxisLine,
2053
+ legendMode,
2054
+ xAxisMaxLabelParts
2007
2055
  ]);
2008
2056
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
2009
2057
  return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
@@ -2971,23 +3019,24 @@ var NodeText = styled_components_default.text`
2971
3019
  fill: ${(props) => props.isNodeValue && props.nodeValueColor ? props.nodeValueColor : props.nodeTextColor};
2972
3020
  opacity: ${(props) => props.isNodeValue ? "82%" : "100%"};
2973
3021
  `;
2974
- var SankeyNode = (props) => {
2975
- const {
2976
- node,
2977
- maxNode,
2978
- activeNodes,
2979
- nodeWidth,
2980
- chartWidth,
2981
- handleMouseOver,
2982
- handleMouseLeave,
2983
- handleNodeClick,
2984
- colorCategoryMapping,
2985
- nodeTextColor,
2986
- nodeValueColor,
2987
- labelDisplay: labelDisplayInput,
2988
- unit
2989
- } = props;
2990
- 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";
2991
3040
  const nodeTextRef = (0, react_exports.useRef)();
2992
3041
  const nodeValuePercentRef = (0, react_exports.useRef)();
2993
3042
  let nodeValueFormatted = "";
@@ -3002,7 +3051,7 @@ var SankeyNode = (props) => {
3002
3051
  (0, react_exports.useEffect)(() => {
3003
3052
  truncateSVGTextWithEllipsis(nodeTextRef.current, node.name, MAX_NODE_TEXT_WIDTH);
3004
3053
  });
3005
- const nodeClickHandler = (0, react_exports.useCallback)(() => handleNodeClick(node), [node]);
3054
+ const nodeClickHandler = (0, react_exports.useCallback)(() => handleNodeClick(node), [node, handleNodeClick]);
3006
3055
  const nodeHeight = getNodeHeight(node);
3007
3056
  return /* @__PURE__ */ react_exports.createElement(
3008
3057
  NodeGroup,
@@ -3023,8 +3072,8 @@ var SankeyNode = (props) => {
3023
3072
  height: nodeHeight,
3024
3073
  width: nodeWidth,
3025
3074
  colorCategoryMapping,
3026
- onMouseOver: (ev) => handleMouseOver(ev),
3027
- onMouseLeave: (ev) => handleMouseLeave(ev)
3075
+ onMouseOver: handleMouseOver,
3076
+ onMouseLeave: handleMouseLeave
3028
3077
  }
3029
3078
  ), /* @__PURE__ */ react_exports.createElement(
3030
3079
  NodeText,
@@ -3059,22 +3108,6 @@ var SankeyNode = (props) => {
3059
3108
  ))
3060
3109
  );
3061
3110
  };
3062
- SankeyNode.propTypes = {
3063
- node: prop_types_exports.object,
3064
- activeNodes: prop_types_exports.arrayOf(prop_types_exports.object),
3065
- nodeWidth: prop_types_exports.number,
3066
- chartWidth: prop_types_exports.number,
3067
- handleMouseOver: prop_types_exports.func,
3068
- handleMouseLeave: prop_types_exports.func,
3069
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)]),
3070
- nodeTextColor: prop_types_exports.string
3071
- };
3072
- SankeyNode.defaultProps = {
3073
- handleMouseOver: () => {
3074
- },
3075
- handleMouseLeave: () => {
3076
- }
3077
- };
3078
3111
  var SankeyNode_default = SankeyNode;
3079
3112
 
3080
3113
  // src/Sankey/PureSankey/SankeyLink.tsx
@@ -3096,18 +3129,19 @@ var StyledSankeyLink = styled_components_default.g`
3096
3129
  cursor: pointer;
3097
3130
  }
3098
3131
  `;
3099
- var SankeyLink = (props) => {
3100
- const {
3101
- link,
3102
- colorCategoryMapping,
3103
- activeLinks,
3104
- linkOpacity,
3105
- colorMode,
3106
- path,
3107
- handleMouseOver,
3108
- handleMouseLeave,
3109
- handleLinkClick
3110
- } = 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
+ }) => {
3111
3145
  const circlePoints = extractLinkMidPoint(path(1)(link));
3112
3146
  const linkClickHandler = (0, react_exports.useCallback)(() => handleLinkClick(link), [handleLinkClick, link]);
3113
3147
  return /* @__PURE__ */ react_exports.createElement(
@@ -3120,9 +3154,7 @@ var SankeyLink = (props) => {
3120
3154
  fill: getLinkFill(link, colorCategoryMapping, colorMode),
3121
3155
  opacity: getLinkOpacity(link, activeLinks, linkOpacity),
3122
3156
  onClick: linkClickHandler,
3123
- onMouseOver: (ev) => {
3124
- handleMouseOver(ev);
3125
- },
3157
+ onMouseOver: handleMouseOver,
3126
3158
  onMouseLeave: (ev) => {
3127
3159
  const relatedTarget = ev.relatedTarget;
3128
3160
  let isRelatedTargetPopover = false;
@@ -3145,21 +3177,6 @@ var SankeyLink = (props) => {
3145
3177
  circlePoints && /* @__PURE__ */ react_exports.createElement("circle", { cx: circlePoints.x, cy: circlePoints.y, r: 5, fill: "transparent" })
3146
3178
  );
3147
3179
  };
3148
- SankeyLink.propTypes = {
3149
- link: prop_types_exports.object,
3150
- activeLinks: prop_types_exports.arrayOf(prop_types_exports.object),
3151
- linkOpacity: prop_types_exports.number,
3152
- path: prop_types_exports.func,
3153
- handleMouseOver: prop_types_exports.func,
3154
- handleMouseLeave: prop_types_exports.func,
3155
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)])
3156
- };
3157
- SankeyLink.defaultProps = {
3158
- handleMouseOver: () => {
3159
- },
3160
- handleMouseLeave: () => {
3161
- }
3162
- };
3163
3180
  var SankeyLink_default = SankeyLink;
3164
3181
 
3165
3182
  // esm-externals:@splunk/react-ui/Popover
@@ -3234,22 +3251,22 @@ var NodeValue = styled_components_default.div`
3234
3251
  overflow: hidden;
3235
3252
  white-space: nowrap;
3236
3253
  `;
3237
- var SankeyTooltip = (props) => {
3238
- const {
3239
- mode,
3240
- node,
3241
- link,
3242
- open,
3243
- connectionsMap,
3244
- anchor,
3245
- linkValue,
3246
- colorCategoryMapping,
3247
- width,
3248
- tooltipRowColor,
3249
- tooltipLinkHeaderColor,
3250
- tooltipHeaderColor,
3251
- handleTooltipRequestClose
3252
- } = 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
+ }) => {
3253
3270
  const showSection = (connection, nodeData, section) => {
3254
3271
  if (!connection) {
3255
3272
  return false;
@@ -3348,25 +3365,6 @@ var SankeyTooltip = (props) => {
3348
3365
  };
3349
3366
  return mode === "node" ? renderNodeToolTip() : renderLinkToolTip();
3350
3367
  };
3351
- SankeyTooltip.propTypes = {
3352
- mode: prop_types_exports.string,
3353
- node: prop_types_exports.object,
3354
- linkValue: prop_types_exports.string,
3355
- open: prop_types_exports.bool,
3356
- connectionsMap: prop_types_exports.object,
3357
- anchor: prop_types_exports.object,
3358
- colorCategoryMapping: prop_types_exports.oneOfType([prop_types_exports.func, prop_types_exports.arrayOf(prop_types_exports.string)]),
3359
- tooltipRowColor: prop_types_exports.string,
3360
- tooltipLinkHeaderColor: prop_types_exports.string,
3361
- tooltipHeaderColor: prop_types_exports.string,
3362
- width: prop_types_exports.number,
3363
- height: prop_types_exports.number,
3364
- handleTooltipRequestClose: prop_types_exports.func
3365
- };
3366
- SankeyTooltip.defaultProps = {
3367
- handleTooltipRequestClose: () => {
3368
- }
3369
- };
3370
3368
  var SankeyTooltip_default = SankeyTooltip;
3371
3369
 
3372
3370
  // src/Sankey/PureSankey/PureSankey.tsx
@@ -3384,49 +3382,43 @@ var DEFAULT_CHART_HEIGHT = 300;
3384
3382
  var DEFAULT_SOURCE_INDEX = 0;
3385
3383
  var DEFAULT_TARGET_INDEX = 1;
3386
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 };
3387
3387
  var SankeyContainer = styled_components_default.div`
3388
3388
  overflow: hidden;
3389
3389
  ${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
3390
3390
  `;
3391
- var PureSankey = (props) => {
3392
- const {
3393
- width,
3394
- height,
3395
- columns,
3396
- columnsFromDataSource,
3397
- fields,
3398
- colorMode,
3399
- nodeWidth,
3400
- nodePadding,
3401
- resultLimit,
3402
- seriesColors,
3403
- labelDisplay,
3404
- linkColors,
3405
- linkOpacity,
3406
- linkValueField,
3407
- backgroundColor,
3408
- nodeTextColor,
3409
- nodeValueColor,
3410
- tooltipRowColor,
3411
- tooltipLinkHeaderColor,
3412
- tooltipHeaderColor,
3413
- unit,
3414
- onNodeClick,
3415
- onLinkClick
3416
- } = props;
3417
- const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
3418
- 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));
3419
3418
  const cachedHandleResize = react_exports.useCallback((w, h) => {
3420
3419
  setContainerWidth(w);
3421
3420
  setContainerHeight(h);
3422
3421
  }, []);
3423
- const margin = {
3424
- top: 17,
3425
- right: 25,
3426
- bottom: 17,
3427
- left: 30
3428
- };
3429
- const translatePos = { x: 28, y: 17 };
3430
3422
  const [activeLinks, setActiveLinks] = (0, react_exports.useState)([]);
3431
3423
  const [activeNodes, setActiveNodes] = (0, react_exports.useState)([]);
3432
3424
  const [nodeHovered, setNodeHovered] = (0, react_exports.useState)(null);
@@ -3435,8 +3427,8 @@ var PureSankey = (props) => {
3435
3427
  const [hoveredLinkElement, setHoveredLinkElement] = (0, react_exports.useState)(null);
3436
3428
  const [openLinkToolTip, setOpenLinkToolTip] = (0, react_exports.useState)(false);
3437
3429
  const sankeyContainerElement = (0, react_exports.useRef)(null);
3438
- const [sankeyWidth, setSankeyWidth] = (0, react_exports.useState)(DEFAULT_CHART_WIDTH - margin.left - margin.right);
3439
- 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);
3440
3432
  const handleNodeClick = (0, react_exports.useCallback)(
3441
3433
  (node) => {
3442
3434
  if (node) {
@@ -3456,8 +3448,9 @@ var PureSankey = (props) => {
3456
3448
  if (link) {
3457
3449
  const payload = { name: linkValueField, value: link.value };
3458
3450
  fields.forEach((field, idx) => {
3451
+ var _a;
3459
3452
  const rowToken = `row.${field}.value`;
3460
- payload[rowToken] = columns[idx][link.index];
3453
+ payload[rowToken] = (_a = columns == null ? void 0 : columns[idx]) == null ? void 0 : _a[link.index];
3461
3454
  });
3462
3455
  onLinkClick({
3463
3456
  type: "link.click",
@@ -3473,10 +3466,10 @@ var PureSankey = (props) => {
3473
3466
  const h = sankeyContainerElement.current.getBoundingClientRect().height;
3474
3467
  const sWidth = checkDigitsOnly(width) ? parseInt(width, 10) : w;
3475
3468
  const sHeight = checkDigitsOnly(height) ? parseInt(height, 10) : h;
3476
- setSankeyWidth(sWidth - margin.left - margin.right);
3477
- setSankeyHeight(sHeight - margin.top - margin.bottom);
3469
+ setSankeyWidth(sWidth - MARGIN.left - MARGIN.right);
3470
+ setSankeyHeight(sHeight - MARGIN.top - MARGIN.bottom);
3478
3471
  }
3479
- }, [width, height, margin.left, margin.right, margin.top, margin.bottom]);
3472
+ }, [width, height]);
3480
3473
  const sankeyData = convertInputToSankeyDataFormat(
3481
3474
  columnsFromDataSource,
3482
3475
  DEFAULT_SOURCE_INDEX,
@@ -3517,175 +3510,116 @@ var PureSankey = (props) => {
3517
3510
  setOpenLinkToolTip(false);
3518
3511
  setOpenNodeToolTip(false);
3519
3512
  };
3520
- const renderVisualization = () => {
3521
- if (containerWidth < CHART_MIN_WIDTH || containerHeight < CHART_MIN_HEIGHT) {
3522
- return /* @__PURE__ */ react_exports.createElement(
3523
- Message_default,
3524
- {
3525
- width: containerWidth,
3526
- height: containerHeight,
3527
- message: (0, i18n_exports._)("Too small to render content"),
3528
- level: "info"
3529
- }
3530
- );
3531
- }
3532
- const renderLinks = (links) => {
3533
- return links.map((link) => {
3534
- return /* @__PURE__ */ react_exports.createElement(
3535
- SankeyLink_default,
3536
- {
3537
- link,
3538
- activeLinks,
3539
- linkOpacity,
3540
- path,
3541
- key: getLinkId(link),
3542
- "data-test": getLinkId(link),
3543
- colorCategoryMapping,
3544
- colorMode,
3545
- handleMouseOver: (ev) => {
3546
- setActiveLinks([link]);
3547
- setActiveNodes([link.source, link.target]);
3548
- setHoveredLinkElement(ev.currentTarget.querySelector("circle"));
3549
- setOpenNodeToolTip(false);
3550
- setOpenLinkToolTip(true);
3551
- },
3552
- handleMouseLeave: () => {
3553
- resetStates();
3554
- },
3555
- handleLinkClick
3556
- }
3557
- );
3558
- });
3559
- };
3560
- const maxNode = getMaxNode(sankeyData.nodes);
3561
- const renderNodes = (nodes) => {
3562
- const chartWidth = typeof width === "number" ? width : Number.parseInt(width, 10);
3563
- return nodes.map((node) => {
3564
- return /* @__PURE__ */ react_exports.createElement(
3565
- SankeyNode_default,
3566
- {
3567
- node,
3568
- maxNode,
3569
- key: getNodeId(node),
3570
- "data-test": getNodeId(node),
3571
- activeNodes,
3572
- nodeWidth,
3573
- chartWidth,
3574
- colorCategoryMapping,
3575
- labelDisplay,
3576
- unit,
3577
- nodeTextColor,
3578
- nodeValueColor,
3579
- handleMouseOver: (ev) => {
3580
- const connections = nodeConnectionsMap[node.index];
3581
- setActiveLinks(connections.links);
3582
- setNodeHovered(node);
3583
- setActiveNodes([...connections.sourceNodes, ...connections.targetNodes]);
3584
- setHoveredNodeElement(ev.currentTarget);
3585
- setOpenLinkToolTip(false);
3586
- setOpenNodeToolTip(true);
3587
- },
3588
- handleMouseLeave: () => resetStates(),
3589
- handleNodeClick
3590
- }
3591
- );
3592
- });
3593
- };
3594
- return /* @__PURE__ */ react_exports.createElement(
3595
- 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,
3596
3518
  {
3597
- backgroundColor,
3598
- dataTestKey: "SankeyWrapper",
3599
- onMouseLeave: () => resetStates()
3600
- },
3601
- /* @__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(
3602
- SankeyTooltip_default,
3603
- {
3604
- mode: "link",
3605
- open: openLinkToolTip,
3606
- handleTooltipRequestClose: () => resetStates(),
3607
- linkValue: linkValueField,
3608
- connectionsMap: nodeConnectionsMap,
3609
- anchor: hoveredLinkElement,
3610
- link: activeLinks[0],
3611
- height: sankeyHeight,
3612
- width: sankeyWidth,
3613
- colorCategoryMapping,
3614
- tooltipRowColor,
3615
- tooltipLinkHeaderColor,
3616
- tooltipHeaderColor
3617
- }
3618
- )), /* @__PURE__ */ react_exports.createElement("g", { className: "node-group", "data-test": "node-group" }, renderNodes(sankeyData.nodes), openNodeToolTip && /* @__PURE__ */ react_exports.createElement(
3619
- SankeyTooltip_default,
3620
- {
3621
- mode: "node",
3622
- open: openNodeToolTip,
3623
- handleTooltipRequestClose: () => resetStates(),
3624
- linkValue: linkValueField,
3625
- connectionsMap: nodeConnectionsMap,
3626
- anchor: hoveredNodeElement,
3627
- node: nodeHovered,
3628
- height: sankeyHeight,
3629
- width: sankeyWidth,
3630
- colorCategoryMapping,
3631
- tooltipRowColor,
3632
- tooltipLinkHeaderColor,
3633
- tooltipHeaderColor
3634
- }
3635
- ))))
3636
- );
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
+ ));
3637
3538
  };
3638
- return /* @__PURE__ */ react_exports.createElement(SankeyContainer, { height, width, ref: sankeyContainerElement }, /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }), renderVisualization());
3639
- };
3640
- PureSankey.propTypes = {
3641
- columns: prop_types_exports.array,
3642
- columnsFromDataSource: prop_types_exports.array,
3643
- fields: prop_types_exports.array,
3644
- width: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
3645
- height: prop_types_exports.oneOfType([prop_types_exports.string, prop_types_exports.number]),
3646
- // need this to satisfy props interface
3647
- // eslint-disable-next-line react/no-unused-prop-types
3648
- mode: prop_types_exports.string,
3649
- colorMode: prop_types_exports.string,
3650
- nodeWidth: prop_types_exports.number,
3651
- nodePadding: prop_types_exports.number,
3652
- resultLimit: prop_types_exports.number,
3653
- seriesColors: prop_types_exports.arrayOf(prop_types_exports.string),
3654
- linkColors: prop_types_exports.arrayOf(prop_types_exports.string),
3655
- linkOpacity: prop_types_exports.number,
3656
- linkValueField: prop_types_exports.string,
3657
- backgroundColor: prop_types_exports.string,
3658
- nodeTextColor: prop_types_exports.string,
3659
- nodeValueColor: prop_types_exports.string,
3660
- tooltipRowColor: prop_types_exports.string,
3661
- tooltipLinkHeaderColor: prop_types_exports.string,
3662
- tooltipHeaderColor: prop_types_exports.string,
3663
- unit: prop_types_exports.string
3664
- };
3665
- PureSankey.defaultProps = {
3666
- columnsFromDataSource: [],
3667
- columns: [],
3668
- fields: [],
3669
- width: DEFAULT_CHART_WIDTH,
3670
- height: DEFAULT_CHART_HEIGHT,
3671
- mode: "view",
3672
- colorMode: "categorical",
3673
- nodeWidth: 12,
3674
- nodePadding: 18,
3675
- resultLimit: 1e3,
3676
- seriesColors: DEFAULT_SERIES_COLOR,
3677
- linkColors: [],
3678
- linkOpacity: DEFAULT_LINK_OPACITY,
3679
- linkValueField: "value",
3680
- backgroundColor: "#0b0c0e",
3681
- nodeTextColor: "rgba(255, 255, 255, 0.98)",
3682
- nodeValueColor: "rgba(255, 255, 255, 0.98)",
3683
- tooltipRowColor: "rgba(255, 255, 255, 0.98)",
3684
- tooltipLinkHeaderColor: "rgba(255, 255, 255, 0.98)",
3685
- tooltipHeaderColor: "rgba(255, 255, 255, 0.5)",
3686
- onNodeClick: lodash_exports.noop,
3687
- onLinkClick: lodash_exports.noop,
3688
- 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
+ ));
3689
3623
  };
3690
3624
  var PureSankey_default = PureSankey;
3691
3625
 
@@ -4013,7 +3947,7 @@ var computeVizProps = ({
4013
3947
  themeColorVariables.forEach((variable) => {
4014
3948
  themeColors[variable] = themeFunc(variable);
4015
3949
  });
4016
- linkColors = (0, colorUtils_exports.sanitizeArrayOfColors)(linkColors);
3950
+ linkColors = (0, colorUtils_exports.sanitizeArrayOfColors)(linkColors != null ? linkColors : []);
4017
3951
  seriesColors = (0, colorUtils_exports.isArrayOfColors)(seriesColors) ? seriesColors : void 0;
4018
3952
  const { columns, fields } = dataSources.primary.data;
4019
3953
  let columnsFromDataSource = [];