@splunk/visualizations 28.3.0 → 28.4.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 (225) hide show
  1. package/Area/Area.d.ts.map +1 -1
  2. package/Area.config.js +0 -1
  3. package/Area.config.js.map +2 -2
  4. package/Area.js +495 -99
  5. package/Area.js.map +3 -3
  6. package/Bar/Bar.d.ts.map +1 -1
  7. package/Bar.config.js +0 -1
  8. package/Bar.config.js.map +2 -2
  9. package/Bar.js +505 -99
  10. package/Bar.js.map +3 -3
  11. package/Bubble.config.js +0 -1
  12. package/Bubble.config.js.map +2 -2
  13. package/Bubble.js +494 -86
  14. package/Bubble.js.map +3 -3
  15. package/CHANGELOG.external.md +76 -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 +539 -103
  21. package/ChoroplethSvg.js.map +4 -4
  22. package/Column/Column.d.ts.map +1 -1
  23. package/Column.config.js +0 -1
  24. package/Column.config.js.map +2 -2
  25. package/Column.js +495 -99
  26. package/Column.js.map +3 -3
  27. package/Ellipse.js +528 -104
  28. package/Ellipse.js.map +4 -4
  29. package/Events/PureEvents/PureEvents.d.ts.map +1 -1
  30. package/Events.js +612 -149
  31. package/Events.js.map +4 -4
  32. package/FillerGauge/FillerGauge.d.ts.map +1 -1
  33. package/FillerGauge/PureFillerGauge/FillerGauge.d.ts.map +1 -1
  34. package/FillerGauge.js +535 -140
  35. package/FillerGauge.js.map +4 -4
  36. package/Image/Image.d.ts.map +1 -1
  37. package/Image.js +564 -108
  38. package/Image.js.map +4 -4
  39. package/Line/Line.d.ts.map +1 -1
  40. package/Line/lineUtils.d.ts.map +1 -1
  41. package/Line/mockdata/LineData.d.ts +59 -0
  42. package/Line/mockdata/LineData.d.ts.map +1 -1
  43. package/Line.config.js +0 -1
  44. package/Line.config.js.map +2 -2
  45. package/Line.js +601 -100
  46. package/Line.js.map +3 -3
  47. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +5 -0
  48. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
  49. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
  50. package/LinkGraph/PureLinkGraph/components/Graph.d.ts +9 -1
  51. package/LinkGraph/PureLinkGraph/components/Graph.d.ts.map +1 -1
  52. package/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts.map +1 -1
  53. package/LinkGraph/PureLinkGraph/components/Node.d.ts +1 -0
  54. package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
  55. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +1 -0
  56. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts.map +1 -1
  57. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts +16 -0
  58. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts.map +1 -0
  59. package/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts.map +1 -1
  60. package/LinkGraph/config.d.ts.map +1 -1
  61. package/LinkGraph.config.js +15 -1
  62. package/LinkGraph.config.js.map +2 -2
  63. package/LinkGraph.js +1355 -654
  64. package/LinkGraph.js.map +4 -4
  65. package/Map/Map.d.ts +2 -2
  66. package/Map/Map.d.ts.map +1 -1
  67. package/Map/PureMap/BubbleLayer.d.ts +5 -0
  68. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  69. package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
  70. package/Map/PureMap/PureMap.d.ts.map +1 -1
  71. package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
  72. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  73. package/Map/config.d.ts.map +1 -1
  74. package/Map.config.js +0 -1
  75. package/Map.config.js.map +2 -2
  76. package/Map.js +738 -228
  77. package/Map.js.map +4 -4
  78. package/Markdown/Markdown.d.ts.map +1 -1
  79. package/Markdown.js +548 -95
  80. package/Markdown.js.map +4 -4
  81. package/MarkerGauge/MarkerGauge.d.ts +5 -1
  82. package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
  83. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +4 -0
  84. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
  85. package/MarkerGauge/config.d.ts.map +1 -1
  86. package/MarkerGauge.config.js +121 -3
  87. package/MarkerGauge.config.js.map +3 -3
  88. package/MarkerGauge.js +1318 -142
  89. package/MarkerGauge.js.map +4 -4
  90. package/NetworkGraph/NetworkGraph.d.ts +22 -0
  91. package/NetworkGraph/NetworkGraph.d.ts.map +1 -0
  92. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts +60 -0
  93. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -0
  94. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts +19 -0
  95. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts.map +1 -0
  96. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +29 -0
  97. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -0
  98. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +27 -0
  99. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -0
  100. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +12 -0
  101. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -0
  102. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +13 -0
  103. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -0
  104. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts +140 -0
  105. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts.map +1 -0
  106. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts +89 -0
  107. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts.map +1 -0
  108. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts +47 -0
  109. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts.map +1 -0
  110. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts +78 -0
  111. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts.map +1 -0
  112. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts +111 -0
  113. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts.map +1 -0
  114. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +123 -0
  115. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -0
  116. package/NetworkGraph/config.d.ts +4 -0
  117. package/NetworkGraph/config.d.ts.map +1 -0
  118. package/NetworkGraph/index.d.ts +3 -0
  119. package/NetworkGraph/index.d.ts.map +1 -0
  120. package/NetworkGraph.config.js +938 -0
  121. package/NetworkGraph.config.js.map +7 -0
  122. package/NetworkGraph.js +6793 -0
  123. package/NetworkGraph.js.map +7 -0
  124. package/ParallelCoordinates.js +532 -93
  125. package/ParallelCoordinates.js.map +4 -4
  126. package/Pie/Pie.d.ts.map +1 -1
  127. package/Pie/pieUtils.d.ts.map +1 -1
  128. package/Pie.js +510 -101
  129. package/Pie.js.map +3 -3
  130. package/Punchcard.js +523 -84
  131. package/Punchcard.js.map +4 -4
  132. package/Rectangle.js +537 -113
  133. package/Rectangle.js.map +4 -4
  134. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  135. package/Sankey.js +562 -111
  136. package/Sankey.js.map +4 -4
  137. package/Scatter/Scatter.d.ts.map +1 -1
  138. package/Scatter.config.js +0 -1
  139. package/Scatter.config.js.map +2 -2
  140. package/Scatter.js +505 -99
  141. package/Scatter.js.map +3 -3
  142. package/SingleValue/SingleValue.d.ts.map +1 -1
  143. package/SingleValue/config.d.ts.map +1 -1
  144. package/SingleValue.config.js +15 -2
  145. package/SingleValue.config.js.map +2 -2
  146. package/SingleValue.js +656 -173
  147. package/SingleValue.js.map +3 -3
  148. package/SingleValueBasic.js.map +1 -1
  149. package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
  150. package/SingleValueIcon/config.d.ts.map +1 -1
  151. package/SingleValueIcon.config.js +0 -1
  152. package/SingleValueIcon.config.js.map +2 -2
  153. package/SingleValueIcon.js +512 -124
  154. package/SingleValueIcon.js.map +3 -3
  155. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
  156. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
  157. package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
  158. package/SingleValueRadial.config.js +0 -1
  159. package/SingleValueRadial.config.js.map +2 -2
  160. package/SingleValueRadial.js +517 -124
  161. package/SingleValueRadial.js.map +4 -4
  162. package/SparkLine.js +46 -8
  163. package/SparkLine.js.map +2 -2
  164. package/Table/PureTable.d.ts +10 -0
  165. package/Table/PureTable.d.ts.map +1 -1
  166. package/Table/cells/SparklineCell.d.ts.map +1 -1
  167. package/Table/config.d.ts.map +1 -1
  168. package/Table/hooks.d.ts +4 -0
  169. package/Table/hooks.d.ts.map +1 -1
  170. package/Table.config.js +1 -1
  171. package/Table.config.js.map +2 -2
  172. package/Table.js +760 -223
  173. package/Table.js.map +4 -4
  174. package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
  175. package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
  176. package/Timeline/config.d.ts.map +1 -1
  177. package/Timeline.config.js +31 -12
  178. package/Timeline.config.js.map +4 -4
  179. package/Timeline.js +649 -211
  180. package/Timeline.js.map +4 -4
  181. package/common/Charting.d.ts +5 -0
  182. package/common/Charting.d.ts.map +1 -1
  183. package/common/Charting.js +12 -0
  184. package/common/Charting.js.map +2 -2
  185. package/common/OptionsDoc.js.map +1 -1
  186. package/common/ThemesDoc.js +0 -1
  187. package/common/ThemesDoc.js.map +2 -2
  188. package/common/TimeSeriesChartWrapper.d.ts +24 -11
  189. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  190. package/common/TimeSeriesChartWrapper.js +561 -83
  191. package/common/TimeSeriesChartWrapper.js.map +4 -4
  192. package/common/chartingUtils.d.ts +45 -5
  193. package/common/chartingUtils.d.ts.map +1 -1
  194. package/common/chartingUtils.js +102 -8
  195. package/common/chartingUtils.js.map +3 -3
  196. package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
  197. package/common/hocs/withTrellis.d.ts.map +1 -1
  198. package/common/interfaces/DashboardVizProps.d.ts +0 -3
  199. package/common/interfaces/DashboardVizProps.d.ts.map +1 -1
  200. package/common/interfaces/DataSource.d.ts +1 -1
  201. package/common/interfaces/DataSource.d.ts.map +1 -1
  202. package/common/shapeUtils.js +5 -20
  203. package/common/shapeUtils.js.map +2 -2
  204. package/common/utils/dataUtils.d.ts.map +1 -1
  205. package/common/utils/dataUtils.js +5 -4
  206. package/common/utils/dataUtils.js.map +2 -2
  207. package/common/utils/mapUtils.js +16 -9
  208. package/common/utils/mapUtils.js.map +2 -2
  209. package/common/utils/singleValueUtils.js +17 -18
  210. package/common/utils/singleValueUtils.js.map +2 -2
  211. package/common/utils/textUtils.d.ts +20 -0
  212. package/common/utils/textUtils.d.ts.map +1 -0
  213. package/common/utils/textUtils.js +76 -0
  214. package/common/utils/textUtils.js.map +7 -0
  215. package/common/utils/trellisUtils.d.ts.map +1 -1
  216. package/common/utils/trellisUtils.js +12 -14
  217. package/common/utils/trellisUtils.js.map +2 -2
  218. package/common/withDashboardViz.d.ts.map +1 -1
  219. package/common/withDashboardViz.js +544 -84
  220. package/common/withDashboardViz.js.map +4 -4
  221. package/package.json +33 -26
  222. package/common/utils/styleUtils.d.ts +0 -2
  223. package/common/utils/styleUtils.d.ts.map +0 -1
  224. package/common/utils/styleUtils.js +0 -30
  225. package/common/utils/styleUtils.js.map +0 -7
@@ -1157,7 +1157,7 @@ var Cover = styled_components_default.div`
1157
1157
  bottom: 0;
1158
1158
  `;
1159
1159
  var Blocker = styled_components_default.div.attrs({
1160
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
1160
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
1161
1161
  })`
1162
1162
  position: relative;
1163
1163
  width: 100%;
@@ -1247,7 +1247,7 @@ var withFixedSizeContainer = (Viz) => {
1247
1247
  FixSizeItem,
1248
1248
  {
1249
1249
  "data-test": "fix-size-item",
1250
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
1250
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
1251
1251
  width,
1252
1252
  height,
1253
1253
  backgroundColor
@@ -1343,6 +1343,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
1343
1343
  var numberUtils_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
1344
1344
 
1345
1345
  // src/common/utils/dataUtils.ts
1346
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
1346
1347
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
1347
1348
  const dataLength = data.length;
1348
1349
  const downsampledIndices = [];
@@ -1459,9 +1460,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
1459
1460
  let xColumn = [];
1460
1461
  const yColumns = [];
1461
1462
  const canDownsample = !ds.data.fields.some((field, index) => {
1462
- var _a, _b;
1463
- const fieldName = (_a = field.name) != null ? _a : field;
1464
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
1463
+ var _a;
1464
+ const fieldName = getFieldName(field);
1465
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
1465
1466
  const column = ds.data.columns[index];
1466
1467
  let hasDisplayedColumnThatCantBeDownsampled = false;
1467
1468
  if (fieldName === xField) {
@@ -1814,6 +1815,16 @@ var triangleEventAnnotationRenderer = ({
1814
1815
  eventColor: eventWithColor.color
1815
1816
  });
1816
1817
  };
1818
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1819
+ const rangeSelectEventHandler = eventHandlers.find(
1820
+ (eventHandler) => {
1821
+ var _a;
1822
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1823
+ }
1824
+ );
1825
+ const xAxisIsTime = xField === "_time";
1826
+ return !!rangeSelectEventHandler && xAxisIsTime;
1827
+ };
1817
1828
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1818
1829
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1819
1830
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1834,16 +1845,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1834
1845
  var convert2DArrayToNumbers = (arr) => {
1835
1846
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1836
1847
  };
1848
+ var parseAxisValue = (val) => {
1849
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1850
+ return void 0;
1851
+ }
1852
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1853
+ return Number.isNaN(num) ? void 0 : num;
1854
+ };
1837
1855
  var SideLegendWidth = 75;
1838
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1856
+ var SeriesCompareLegendWidth = 200;
1839
1857
  var getLegend = (props) => {
1840
1858
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1859
+ const { isSeriesCompare } = props;
1860
+ const commonLegendProps = {
1861
+ center: true,
1862
+ fontSize: 12,
1863
+ largerTiles: true,
1864
+ hideSeriesValue: !isSeriesCompare
1865
+ // Show values if in seriesCompare mode
1866
+ };
1841
1867
  switch (legendPlacement) {
1842
1868
  case "off":
1843
1869
  return false;
1844
1870
  case "left":
1845
1871
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1846
- width: SideLegendWidth
1872
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1847
1873
  }, commonLegendProps));
1848
1874
  case "bottom":
1849
1875
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1855,7 +1881,7 @@ var getLegend = (props) => {
1855
1881
  }, commonLegendProps));
1856
1882
  default:
1857
1883
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1858
- width: SideLegendWidth
1884
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1859
1885
  }, commonLegendProps));
1860
1886
  }
1861
1887
  };
@@ -1891,22 +1917,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1891
1917
  const end = axisTitle.slice(-halfChars);
1892
1918
  return `${start}...${end}`;
1893
1919
  };
1894
- var getFieldName = (field) => {
1920
+ var getFieldName2 = (field) => {
1895
1921
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1896
1922
  return fieldName;
1897
1923
  };
1898
1924
  var getFieldNames = (fields) => {
1899
- return fields.map((field) => getFieldName(field));
1925
+ return fields.map((field) => getFieldName2(field));
1900
1926
  };
1901
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1927
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1902
1928
  const xConfig = { x: {} };
1903
1929
  xConfig.x.label = label;
1904
1930
  if (xAxisLabelVisibility === "hide") {
1905
1931
  xConfig.x.hideLabels = true;
1906
1932
  }
1933
+ if (xAxisLabelRotation !== void 0) {
1934
+ xConfig.x.labelRotation = xAxisLabelRotation;
1935
+ }
1907
1936
  return xConfig;
1908
1937
  };
1909
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1938
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1910
1939
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1911
1940
  const yConfig = { y: {} };
1912
1941
  yConfig.y.label = label;
@@ -1922,14 +1951,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1922
1951
  if (yAxisLabelVisibility === "hide") {
1923
1952
  yConfig.y.hideLabels = true;
1924
1953
  }
1954
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1955
+ yConfig.y.range = (u, dataMin, dataMax) => {
1956
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1957
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1958
+ return [min, max];
1959
+ };
1960
+ }
1925
1961
  return yConfig;
1926
1962
  };
1927
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1963
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1928
1964
  const y2Config = { y2: {} };
1929
1965
  const scaleType = axisScale != null ? axisScale : "linear";
1930
1966
  y2Config.y2.label = label;
1931
1967
  y2Config.y2.side = "right";
1932
- y2Config.y2.showGrid = false;
1933
1968
  y2Config.y2.type = scaleType;
1934
1969
  if (axisAbbreviation !== "none") {
1935
1970
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1939,9 +1974,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1939
1974
  if (y2AxisLabelVisibility === "hide") {
1940
1975
  y2Config.y2.hideLabels = true;
1941
1976
  }
1977
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1978
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1979
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1980
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1981
+ return [min, max];
1982
+ };
1983
+ }
1942
1984
  return y2Config;
1943
1985
  };
1944
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1986
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1945
1987
  const seriesConfig = {};
1946
1988
  let spanGaps;
1947
1989
  let replaceNullsWithZero;
@@ -1976,12 +2018,96 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1976
2018
  if (markerDisplay !== void 0) {
1977
2019
  seriesConfig[field].markerDisplay = markerDisplay;
1978
2020
  }
2021
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2022
+ if (fieldDashStyle) {
2023
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
2024
+ }
1979
2025
  if (replaceNullsWithZero !== void 0) {
1980
2026
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1981
2027
  }
1982
2028
  });
1983
2029
  return seriesConfig;
1984
2030
  };
2031
+ var findRangeIndices = (xData, startValue, endValue) => {
2032
+ let startXIndex = -1;
2033
+ let endXIndex = -1;
2034
+ const xDataEpoch = xData.map((val) => {
2035
+ if (typeof val === "string") {
2036
+ return new Date(val).getTime() / 1e3;
2037
+ }
2038
+ return val;
2039
+ });
2040
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
2041
+ if (xDataEpoch[i] >= startValue) {
2042
+ startXIndex = i;
2043
+ break;
2044
+ }
2045
+ }
2046
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
2047
+ startXIndex = xDataEpoch.length - 1;
2048
+ }
2049
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
2050
+ if (xDataEpoch[i] <= endValue) {
2051
+ endXIndex = i;
2052
+ break;
2053
+ }
2054
+ }
2055
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
2056
+ endXIndex = 0;
2057
+ }
2058
+ return { startXIndex, endXIndex };
2059
+ };
2060
+
2061
+ // esm-externals:@splunk/visualization-schemas
2062
+ var visualization_schemas_exports = {};
2063
+ __export(visualization_schemas_exports, {
2064
+ default: () => visualization_schemas_default
2065
+ });
2066
+ var defaultImport33 = __toESM(require("@splunk/visualization-schemas"));
2067
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
2068
+ var visualization_schemas_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
2069
+
2070
+ // src/common/hooks/useTrellisEnabled.ts
2071
+ var useTrellisFeatureFlagOn = () => {
2072
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
2073
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
2074
+ };
2075
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
2076
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
2077
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
2078
+ };
2079
+
2080
+ // src/common/components/TrellisTitle.tsx
2081
+ var TRELLIS_TITLE_HEIGHT = 28;
2082
+ var TrellisTitleText = styled_components_default.div`
2083
+ margin-left: 10px;
2084
+ margin-right: 10px;
2085
+ padding-top: 8px;
2086
+ text-overflow: ellipsis;
2087
+ white-space: nowrap;
2088
+ overflow: hidden;
2089
+ `;
2090
+ var TrellisTitleDiv = styled_components_default.div`
2091
+ height: ${TRELLIS_TITLE_HEIGHT}px;
2092
+ font-size: 14px;
2093
+ font-weight: 700;
2094
+ color: ${(props) => props.fontColor};
2095
+ background-color: ${(props) => props.backgroundColor};
2096
+ 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.
2097
+ `;
2098
+ var TrellisTitle = (props) => {
2099
+ const titleText = String(props.trellisKey).toString();
2100
+ return /* @__PURE__ */ react_exports.createElement(
2101
+ TrellisTitleDiv,
2102
+ {
2103
+ fontColor: props.fontColor,
2104
+ backgroundColor: props.backgroundColor,
2105
+ "data-test": "trellis-title",
2106
+ title: titleText
2107
+ },
2108
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
2109
+ );
2110
+ };
1985
2111
 
1986
2112
  // src/common/TimeSeriesChartWrapper.tsx
1987
2113
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1992,38 +2118,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1992
2118
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1993
2119
  }
1994
2120
  `;
1995
- var handleClick = (chartEvent, onClick) => {
2121
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
2122
+ const result = __spreadValues({}, payload);
2123
+ if (trellisSplitBy) {
2124
+ result["trellis.name"] = trellisSplitBy;
2125
+ }
2126
+ if (trellisKey) {
2127
+ result["trellis.value"] = trellisKey;
2128
+ }
2129
+ return result;
2130
+ };
2131
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
2132
+ if (!previousPayload) {
2133
+ return true;
2134
+ }
2135
+ if (currentPayload.index !== previousPayload.index) {
2136
+ return true;
2137
+ }
2138
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
2139
+ return true;
2140
+ }
2141
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
2142
+ return true;
2143
+ }
2144
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
2145
+ return true;
2146
+ }
2147
+ return false;
2148
+ };
2149
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1996
2150
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1997
2151
  name: chartEvent.seriesKey
1998
2152
  });
1999
2153
  delete payload.seriesKey;
2000
2154
  if (chartEvent.rowContext) {
2001
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
2002
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
2003
- });
2155
+ Object.assign(
2156
+ payload,
2157
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
2158
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
2159
+ return acc;
2160
+ }, {})
2161
+ );
2004
2162
  }
2163
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2005
2164
  if (onClick) {
2006
2165
  onClick({
2007
2166
  type: "point.click",
2008
2167
  originalEvent: chartEvent,
2009
- payload
2168
+ payload: updatedPayload
2010
2169
  });
2011
2170
  }
2012
2171
  };
2013
- var handleLegendClick = (chartEvent, onClick) => {
2172
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
2014
2173
  const payload = {
2015
2174
  name: chartEvent
2016
2175
  };
2176
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2017
2177
  if (onClick) {
2018
2178
  onClick({
2019
2179
  type: "legend.click",
2020
2180
  originalEvent: chartEvent,
2021
- payload
2181
+ payload: updatedPayload
2182
+ });
2183
+ }
2184
+ };
2185
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
2186
+ var _a;
2187
+ if (!rangeEvent) {
2188
+ return;
2189
+ }
2190
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
2191
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
2192
+ const payload = {
2193
+ startXIndex,
2194
+ startXValue: rangeEvent.start,
2195
+ endXIndex,
2196
+ endXValue: rangeEvent.end
2197
+ };
2198
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2199
+ if (onSelect) {
2200
+ onSelect({
2201
+ type: "range.selectBeforeZoom",
2202
+ originalEvent: rangeEvent,
2203
+ payload: updatedPayload
2204
+ });
2205
+ }
2206
+ };
2207
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
2208
+ var _a;
2209
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
2210
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
2211
+ const payload = {
2212
+ startXIndex,
2213
+ startXValue: rangeEvent.start,
2214
+ endXIndex,
2215
+ endXValue: rangeEvent.end
2216
+ };
2217
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2218
+ if (onSelect) {
2219
+ onSelect({
2220
+ type: "range.select",
2221
+ originalEvent: rangeEvent,
2222
+ payload: updatedPayload
2022
2223
  });
2023
2224
  }
2024
2225
  };
2226
+ var parseArrayOption = (value) => {
2227
+ if (Array.isArray(value)) {
2228
+ return value;
2229
+ }
2230
+ if (value) {
2231
+ return JSON.parse(value);
2232
+ }
2233
+ return void 0;
2234
+ };
2025
2235
  var TimeSeriesChartWrapper = (props) => {
2026
- const {
2236
+ var _b, _c, _d;
2237
+ const _a = props, {
2027
2238
  width,
2028
2239
  height,
2029
2240
  chartData,
@@ -2036,12 +2247,49 @@ var TimeSeriesChartWrapper = (props) => {
2036
2247
  markerDisplay,
2037
2248
  onClick,
2038
2249
  onPointMouseOver,
2039
- onPointMouseOut
2040
- } = props;
2041
- const {
2250
+ onPointMouseOut,
2251
+ onSelect,
2252
+ splitByLayout,
2253
+ trellisKey,
2254
+ trellisSplitBy,
2042
2255
  backgroundColor,
2256
+ defaultFontColor,
2257
+ additionalTooltipValues,
2258
+ showYAxisWithZero: showYAxisWithZeroFromProps,
2259
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
2260
+ } = _a, otherOptions = __objRest(_a, [
2261
+ "width",
2262
+ "height",
2263
+ "chartData",
2264
+ "options",
2265
+ "userLocale",
2266
+ "annotationX",
2267
+ "annotationLabel",
2268
+ "annotationColor",
2269
+ "legendDisplay",
2270
+ "markerDisplay",
2271
+ "onClick",
2272
+ "onPointMouseOver",
2273
+ "onPointMouseOut",
2274
+ "onSelect",
2275
+ "splitByLayout",
2276
+ "trellisKey",
2277
+ "trellisSplitBy",
2278
+ "backgroundColor",
2279
+ "defaultFontColor",
2280
+ "additionalTooltipValues",
2281
+ // Extract showYAxisWithZero directly from props for accelerated render mode
2282
+ "showYAxisWithZero",
2283
+ "showY2AxisWithZero"
2284
+ ]);
2285
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
2286
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
2287
+ const {
2288
+ backgroundColor: bgColorFromOptions,
2043
2289
  seriesColors: seriesColorsStr,
2044
2290
  fieldColors,
2291
+ legendLabels: legendLabelsStr,
2292
+ legendMode,
2045
2293
  "axisTitleX.text": xAxisTitleText,
2046
2294
  "axisTitleY.text": yAxisTitleText,
2047
2295
  "axisTitleY2.text": y2AxisTitleText,
@@ -2049,8 +2297,11 @@ var TimeSeriesChartWrapper = (props) => {
2049
2297
  "axisTitleY.visibility": yAxisTitleVisibility,
2050
2298
  "axisTitleY2.visibility": y2AxisTitleVisibility,
2051
2299
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
2300
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
2052
2301
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
2302
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
2053
2303
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
2304
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
2054
2305
  "axisY.abbreviation": yAxisAbbreviation,
2055
2306
  "axisY.scale": yAxisScale,
2056
2307
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -2060,10 +2311,63 @@ var TimeSeriesChartWrapper = (props) => {
2060
2311
  "axisLabelsY2.integerUnits": y2IntegerUnits,
2061
2312
  "chart.overlayFields": overlayFieldsStr,
2062
2313
  "chart.nullValueMode": nullValueMode,
2063
- lineWidth
2314
+ "chart.showDataLabels": showDataLabels,
2315
+ lineWidth,
2316
+ lineDashStyle,
2317
+ fieldDashStyles: lineDashStylesByFieldStr,
2318
+ yAxisMin: yAxisMinRaw,
2319
+ yAxisMax: yAxisMaxRaw,
2320
+ y2AxisMin: y2AxisMinRaw,
2321
+ y2AxisMax: y2AxisMaxRaw,
2322
+ showXMajorGridLines,
2323
+ showYMajorGridLines,
2324
+ showY2MajorGridLines,
2325
+ showYMinorGridLines,
2326
+ showY2MinorGridLines,
2327
+ showLineSmoothing,
2328
+ yAxisMajorTickVisibility,
2329
+ y2AxisMajorTickVisibility,
2330
+ yAxisMajorTickSize,
2331
+ y2AxisMajorTickSize,
2332
+ yAxisMajorTickInterval,
2333
+ y2AxisMajorTickInterval,
2334
+ yAxisMinorTickVisibility,
2335
+ y2AxisMinorTickVisibility,
2336
+ yAxisMinorTickSize,
2337
+ y2AxisMinorTickSize,
2338
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
2339
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
2064
2340
  } = options;
2341
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
2342
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
2343
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
2344
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
2345
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
2346
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
2347
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
2348
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
2349
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
2350
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
2351
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
2352
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
2353
+ if (simpleXMLValue) return Number(simpleXMLValue);
2354
+ if (canvasValue) return Number(canvasValue);
2355
+ return void 0;
2356
+ };
2357
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
2358
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
2359
+ y2AxisMajorUnitFromSimpleXML,
2360
+ y2AxisMajorTickInterval
2361
+ );
2362
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
2363
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
2364
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
2365
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
2065
2366
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
2066
2367
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
2368
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
2369
+ const legendLabels = parseArrayOption(legendLabelsStr);
2370
+ const bgColor = backgroundColor || bgColorFromOptions;
2067
2371
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
2068
2372
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
2069
2373
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -2074,31 +2378,64 @@ var TimeSeriesChartWrapper = (props) => {
2074
2378
  fields: chartData.fields,
2075
2379
  columns: chartData.seriesList
2076
2380
  });
2077
- const xField = getFieldName(filteredChartData.fields[0]);
2381
+ const xField = getFieldName2(filteredChartData.fields[0]);
2078
2382
  const yFields = getFieldNames(
2079
2383
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
2080
2384
  );
2081
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
2082
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
2385
+ const y2Fields = (0, react_exports.useMemo)(
2386
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
2387
+ [y2FieldsStr]
2388
+ );
2389
+ const overlayFields = (0, react_exports.useMemo)(
2390
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
2391
+ [overlayFieldsStr]
2392
+ );
2083
2393
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
2084
2394
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
2085
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
2395
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2396
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
2086
2397
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
2087
2398
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
2088
2399
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
2089
2400
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
2090
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
2091
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
2092
- let y2ScaleConfig = {};
2093
- if (y2Enabled) {
2094
- y2ScaleConfig = getY2ScaleConfig(
2095
- y2AxisTitle,
2096
- y2AxisAbbreviation,
2097
- y2AxisScale,
2098
- y2IntegerUnits,
2099
- y2AxisLabelVisibility
2100
- );
2101
- }
2401
+ const xScaleConfig = (0, react_exports.useMemo)(
2402
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
2403
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
2404
+ );
2405
+ const yScaleConfig = (0, react_exports.useMemo)(
2406
+ () => getYScaleConfig(
2407
+ yAxisTitle,
2408
+ yAxisAbbreviation,
2409
+ yAxisScale,
2410
+ yAxisLabelVisibility,
2411
+ yAxisMin,
2412
+ yAxisMax
2413
+ ),
2414
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
2415
+ );
2416
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
2417
+ if (y2Enabled) {
2418
+ return getY2ScaleConfig(
2419
+ y2AxisTitle,
2420
+ y2AxisAbbreviation,
2421
+ y2AxisScale,
2422
+ y2IntegerUnits,
2423
+ y2AxisLabelVisibility,
2424
+ y2AxisMin,
2425
+ y2AxisMax
2426
+ );
2427
+ }
2428
+ return {};
2429
+ }, [
2430
+ y2Enabled,
2431
+ y2AxisTitle,
2432
+ y2AxisAbbreviation,
2433
+ y2AxisScale,
2434
+ y2IntegerUnits,
2435
+ y2AxisLabelVisibility,
2436
+ y2AxisMin,
2437
+ y2AxisMax
2438
+ ]);
2102
2439
  const uplotContainerElement = (0, react_exports.useRef)(null);
2103
2440
  const seriesDataFormatted = [
2104
2441
  filteredChartData.columns[0],
@@ -2114,9 +2451,21 @@ var TimeSeriesChartWrapper = (props) => {
2114
2451
  overlayFields,
2115
2452
  y2Enabled,
2116
2453
  nullValueMode,
2117
- markerDisplay
2454
+ markerDisplay,
2455
+ lineDashStyle,
2456
+ lineDashStylesByField
2118
2457
  ),
2119
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
2458
+ [
2459
+ yFields,
2460
+ y2Fields,
2461
+ lineWidth,
2462
+ overlayFields,
2463
+ y2Enabled,
2464
+ nullValueMode,
2465
+ markerDisplay,
2466
+ lineDashStyle,
2467
+ lineDashStylesByField
2468
+ ]
2120
2469
  );
2121
2470
  const chartingEventAnnotations = (0, react_exports.useMemo)(
2122
2471
  () => getAnnotationsForCanvas({
@@ -2130,25 +2479,54 @@ var TimeSeriesChartWrapper = (props) => {
2130
2479
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
2131
2480
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
2132
2481
  );
2133
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
2482
+ const legend = (0, react_exports.useMemo)(
2483
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
2484
+ [legendDisplay, legendMode]
2485
+ );
2134
2486
  const handleChartClick = react_exports.useCallback(
2135
2487
  (event) => {
2136
2488
  if (onClick) {
2137
- handleClick(event, onClick);
2489
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
2138
2490
  }
2139
2491
  },
2140
- [onClick]
2492
+ [onClick, trellisKey, trellisSplitBy]
2141
2493
  );
2142
2494
  const handleChartLegendClick = react_exports.useCallback(
2143
2495
  (event) => {
2144
2496
  if (onClick) {
2145
- handleLegendClick(event, onClick);
2497
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
2498
+ }
2499
+ },
2500
+ [onClick, trellisKey, trellisSplitBy]
2501
+ );
2502
+ const handleChartRangeSelection = react_exports.useCallback(
2503
+ (range2) => {
2504
+ if (onSelect) {
2505
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
2506
+ }
2507
+ },
2508
+ [onSelect, chartData, trellisKey, trellisSplitBy]
2509
+ );
2510
+ const handleChartRangeZoom = react_exports.useCallback(
2511
+ (range2) => {
2512
+ if (onSelect) {
2513
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
2146
2514
  }
2147
2515
  },
2148
- [onClick]
2516
+ [onSelect, chartData, trellisKey, trellisSplitBy]
2517
+ );
2518
+ const xFieldToUse = xFieldFromProps || xField;
2519
+ const enableSearchZoom = react_exports.useMemo(
2520
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
2521
+ [eventHandlers, xFieldToUse]
2149
2522
  );
2150
2523
  const lastPayloadRef = react_exports.useRef(null);
2151
2524
  const lastOriginalEventRef = react_exports.useRef(null);
2525
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
2526
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
2527
+ react_exports.useEffect(() => {
2528
+ additionalTooltipValuesRef.current = additionalTooltipValues;
2529
+ }, [additionalTooltipValues]);
2152
2530
  const handleChartCrosshairChange = react_exports.useCallback(
2153
2531
  (event) => {
2154
2532
  if (onPointMouseOver || onPointMouseOut) {
@@ -2160,6 +2538,7 @@ var TimeSeriesChartWrapper = (props) => {
2160
2538
  payload: lastPayloadRef.current
2161
2539
  });
2162
2540
  }
2541
+ previousMouseoverPayloadRef.current = null;
2163
2542
  return;
2164
2543
  }
2165
2544
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -2167,25 +2546,36 @@ var TimeSeriesChartWrapper = (props) => {
2167
2546
  });
2168
2547
  delete payload.seriesKey;
2169
2548
  if (event.rowContext) {
2170
- Object.keys(event.rowContext).forEach((fieldName) => {
2171
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
2172
- });
2549
+ Object.assign(
2550
+ payload,
2551
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
2552
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2553
+ return acc;
2554
+ }, {})
2555
+ );
2556
+ }
2557
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2558
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2559
+ return;
2173
2560
  }
2174
- lastPayloadRef.current = payload;
2561
+ lastPayloadRef.current = updatedPayload;
2175
2562
  lastOriginalEventRef.current = event;
2563
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
2176
2564
  if (onPointMouseOver) {
2177
2565
  onPointMouseOver({
2178
2566
  type: "point.mouseover",
2179
2567
  originalEvent: event,
2180
- payload
2568
+ payload: updatedPayload
2181
2569
  });
2182
2570
  }
2183
2571
  }
2184
2572
  },
2185
- [onPointMouseOver, onPointMouseOut]
2573
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
2186
2574
  );
2187
- const memoizedChart = (0, react_exports.useMemo)(
2188
- () => /* @__PURE__ */ react_exports.createElement(
2575
+ 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}`;
2576
+ const memoizedChart = (0, react_exports.useMemo)(() => {
2577
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
2578
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
2189
2579
  visualization_canvas_exports.TimeSeriesChart,
2190
2580
  {
2191
2581
  data: chartData,
@@ -2195,49 +2585,107 @@ var TimeSeriesChartWrapper = (props) => {
2195
2585
  seriesColorsByField,
2196
2586
  seriesConfig: seriesOverrides,
2197
2587
  legend,
2588
+ legendLabels,
2589
+ isSeriesCompare: legendMode === "seriesCompare",
2590
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
2198
2591
  scaleConfig,
2199
2592
  timestampFormat: "expanded",
2200
2593
  onCrosshairClick: onClick ? handleChartClick : void 0,
2201
2594
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
2202
2595
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
2596
+ onRangeSelection: handleChartRangeSelection,
2597
+ onRangeZoom: computedOnRangeZoom,
2598
+ serverSideZoom: enableSearchZoom,
2203
2599
  userLocale,
2204
2600
  events: chartingEventAnnotations,
2205
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
2601
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
2602
+ additionalTooltipValuesRef,
2603
+ showXMajorGridLines,
2604
+ showYMajorGridLines,
2605
+ showY2MajorGridLines,
2606
+ showYMinorGridLines,
2607
+ showY2MinorGridLines,
2608
+ showLineSmoothing,
2609
+ dataValuesDisplay,
2610
+ showYMajorTicks,
2611
+ showY2MajorTicks,
2612
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2613
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2614
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2615
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2616
+ showYMinorTicks,
2617
+ showY2MinorTicks,
2618
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2619
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2620
+ showYAxisWithZero,
2621
+ showY2AxisWithZero
2206
2622
  }
2207
- ),
2208
- [
2209
- chartData,
2210
- containerWidth,
2211
- containerHeight,
2212
- seriesColors,
2213
- seriesColorsByField,
2214
- seriesOverrides,
2215
- legend,
2216
- scaleConfig,
2217
- userLocale,
2218
- chartingEventAnnotations,
2219
- onClick,
2220
- handleChartClick,
2221
- onPointMouseOver,
2222
- onPointMouseOut,
2223
- handleChartCrosshairChange,
2224
- handleChartLegendClick
2225
- ]
2226
- );
2623
+ ));
2624
+ }, [
2625
+ onSelect,
2626
+ handleChartRangeZoom,
2627
+ dataKey,
2628
+ chartData,
2629
+ containerWidth,
2630
+ containerHeight,
2631
+ seriesColors,
2632
+ seriesColorsByField,
2633
+ seriesOverrides,
2634
+ legend,
2635
+ legendLabels,
2636
+ scaleConfig,
2637
+ onClick,
2638
+ handleChartClick,
2639
+ onPointMouseOver,
2640
+ onPointMouseOut,
2641
+ handleChartCrosshairChange,
2642
+ handleChartLegendClick,
2643
+ handleChartRangeSelection,
2644
+ enableSearchZoom,
2645
+ userLocale,
2646
+ chartingEventAnnotations,
2647
+ showXMajorGridLines,
2648
+ showYMajorGridLines,
2649
+ showY2MajorGridLines,
2650
+ showYMinorGridLines,
2651
+ showY2MinorGridLines,
2652
+ showLineSmoothing,
2653
+ dataValuesDisplay,
2654
+ showYMajorTicks,
2655
+ showY2MajorTicks,
2656
+ yAxisMajorTickSizeNum,
2657
+ y2AxisMajorTickSizeNum,
2658
+ yAxisMajorTickIntervalNum,
2659
+ y2AxisMajorTickIntervalNum,
2660
+ showYMinorTicks,
2661
+ showY2MinorTicks,
2662
+ yAxisMinorTickSizeNum,
2663
+ y2AxisMinorTickSizeNum,
2664
+ showYAxisWithZero,
2665
+ showY2AxisWithZero,
2666
+ legendMode
2667
+ ]);
2227
2668
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
2228
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
2229
- }, [backgroundColor, memoizedChart]);
2230
- return /* @__PURE__ */ react_exports.createElement(
2669
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2670
+ }, [bgColor, memoizedChart]);
2671
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2672
+ TrellisTitle,
2673
+ {
2674
+ trellisKey,
2675
+ backgroundColor: bgColor,
2676
+ fontColor: defaultFontColor
2677
+ }
2678
+ ), /* @__PURE__ */ react_exports.createElement(
2231
2679
  TimeSeriesChartContainer,
2232
2680
  {
2233
- height,
2681
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
2234
2682
  width,
2235
2683
  ref: uplotContainerElement,
2236
2684
  "data-test": "timeseries-chart-wrapper"
2237
2685
  },
2238
2686
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
2239
2687
  memoizedVisualization
2240
- );
2688
+ ));
2241
2689
  };
2242
2690
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
2243
2691
 
@@ -2527,15 +2975,6 @@ var withDashboardViz = (opts) => {
2527
2975
  };
2528
2976
  var withDashboardViz_default = withDashboardViz;
2529
2977
 
2530
- // esm-externals:@splunk/visualization-schemas
2531
- var visualization_schemas_exports = {};
2532
- __export(visualization_schemas_exports, {
2533
- default: () => visualization_schemas_default
2534
- });
2535
- var defaultImport33 = __toESM(require("@splunk/visualization-schemas"));
2536
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
2537
- var visualization_schemas_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
2538
-
2539
2978
  // esm-externals:@splunk/themes/pick
2540
2979
  var pick_exports = {};
2541
2980
  __export(pick_exports, {