@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
package/Ellipse.js CHANGED
@@ -923,7 +923,7 @@ var Cover = styled_components_default.div`
923
923
  bottom: 0;
924
924
  `;
925
925
  var Blocker = styled_components_default.div.attrs({
926
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
926
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
927
927
  })`
928
928
  position: relative;
929
929
  width: 100%;
@@ -1013,7 +1013,7 @@ var withFixedSizeContainer = (Viz) => {
1013
1013
  FixSizeItem,
1014
1014
  {
1015
1015
  "data-test": "fix-size-item",
1016
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
1016
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
1017
1017
  width,
1018
1018
  height,
1019
1019
  backgroundColor
@@ -1109,6 +1109,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
1109
1109
  var numberUtils_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
1110
1110
 
1111
1111
  // src/common/utils/dataUtils.ts
1112
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
1112
1113
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
1113
1114
  const dataLength = data.length;
1114
1115
  const downsampledIndices = [];
@@ -1225,9 +1226,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
1225
1226
  let xColumn = [];
1226
1227
  const yColumns = [];
1227
1228
  const canDownsample = !ds.data.fields.some((field, index) => {
1228
- var _a, _b;
1229
- const fieldName = (_a = field.name) != null ? _a : field;
1230
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
1229
+ var _a;
1230
+ const fieldName = getFieldName(field);
1231
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
1231
1232
  const column = ds.data.columns[index];
1232
1233
  let hasDisplayedColumnThatCantBeDownsampled = false;
1233
1234
  if (fieldName === xField) {
@@ -1580,6 +1581,16 @@ var triangleEventAnnotationRenderer = ({
1580
1581
  eventColor: eventWithColor.color
1581
1582
  });
1582
1583
  };
1584
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1585
+ const rangeSelectEventHandler = eventHandlers.find(
1586
+ (eventHandler) => {
1587
+ var _a;
1588
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1589
+ }
1590
+ );
1591
+ const xAxisIsTime = xField === "_time";
1592
+ return !!rangeSelectEventHandler && xAxisIsTime;
1593
+ };
1583
1594
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1584
1595
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1585
1596
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1600,16 +1611,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1600
1611
  var convert2DArrayToNumbers = (arr) => {
1601
1612
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1602
1613
  };
1614
+ var parseAxisValue = (val) => {
1615
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1616
+ return void 0;
1617
+ }
1618
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1619
+ return Number.isNaN(num) ? void 0 : num;
1620
+ };
1603
1621
  var SideLegendWidth = 75;
1604
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1622
+ var SeriesCompareLegendWidth = 200;
1605
1623
  var getLegend = (props) => {
1606
1624
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1625
+ const { isSeriesCompare } = props;
1626
+ const commonLegendProps = {
1627
+ center: true,
1628
+ fontSize: 12,
1629
+ largerTiles: true,
1630
+ hideSeriesValue: !isSeriesCompare
1631
+ // Show values if in seriesCompare mode
1632
+ };
1607
1633
  switch (legendPlacement) {
1608
1634
  case "off":
1609
1635
  return false;
1610
1636
  case "left":
1611
1637
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1612
- width: SideLegendWidth
1638
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1613
1639
  }, commonLegendProps));
1614
1640
  case "bottom":
1615
1641
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1621,7 +1647,7 @@ var getLegend = (props) => {
1621
1647
  }, commonLegendProps));
1622
1648
  default:
1623
1649
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1624
- width: SideLegendWidth
1650
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1625
1651
  }, commonLegendProps));
1626
1652
  }
1627
1653
  };
@@ -1657,22 +1683,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1657
1683
  const end = axisTitle.slice(-halfChars);
1658
1684
  return `${start}...${end}`;
1659
1685
  };
1660
- var getFieldName = (field) => {
1686
+ var getFieldName2 = (field) => {
1661
1687
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1662
1688
  return fieldName;
1663
1689
  };
1664
1690
  var getFieldNames = (fields) => {
1665
- return fields.map((field) => getFieldName(field));
1691
+ return fields.map((field) => getFieldName2(field));
1666
1692
  };
1667
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1693
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1668
1694
  const xConfig = { x: {} };
1669
1695
  xConfig.x.label = label;
1670
1696
  if (xAxisLabelVisibility === "hide") {
1671
1697
  xConfig.x.hideLabels = true;
1672
1698
  }
1699
+ if (xAxisLabelRotation !== void 0) {
1700
+ xConfig.x.labelRotation = xAxisLabelRotation;
1701
+ }
1673
1702
  return xConfig;
1674
1703
  };
1675
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1704
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1676
1705
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1677
1706
  const yConfig = { y: {} };
1678
1707
  yConfig.y.label = label;
@@ -1688,14 +1717,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1688
1717
  if (yAxisLabelVisibility === "hide") {
1689
1718
  yConfig.y.hideLabels = true;
1690
1719
  }
1720
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1721
+ yConfig.y.range = (u, dataMin, dataMax) => {
1722
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1723
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1724
+ return [min, max];
1725
+ };
1726
+ }
1691
1727
  return yConfig;
1692
1728
  };
1693
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1729
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1694
1730
  const y2Config = { y2: {} };
1695
1731
  const scaleType = axisScale != null ? axisScale : "linear";
1696
1732
  y2Config.y2.label = label;
1697
1733
  y2Config.y2.side = "right";
1698
- y2Config.y2.showGrid = false;
1699
1734
  y2Config.y2.type = scaleType;
1700
1735
  if (axisAbbreviation !== "none") {
1701
1736
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1705,9 +1740,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1705
1740
  if (y2AxisLabelVisibility === "hide") {
1706
1741
  y2Config.y2.hideLabels = true;
1707
1742
  }
1743
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1744
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1745
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1746
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1747
+ return [min, max];
1748
+ };
1749
+ }
1708
1750
  return y2Config;
1709
1751
  };
1710
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1752
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1711
1753
  const seriesConfig = {};
1712
1754
  let spanGaps;
1713
1755
  let replaceNullsWithZero;
@@ -1742,12 +1784,87 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1742
1784
  if (markerDisplay !== void 0) {
1743
1785
  seriesConfig[field].markerDisplay = markerDisplay;
1744
1786
  }
1787
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1788
+ if (fieldDashStyle) {
1789
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1790
+ }
1745
1791
  if (replaceNullsWithZero !== void 0) {
1746
1792
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1747
1793
  }
1748
1794
  });
1749
1795
  return seriesConfig;
1750
1796
  };
1797
+ var findRangeIndices = (xData, startValue, endValue) => {
1798
+ let startXIndex = -1;
1799
+ let endXIndex = -1;
1800
+ const xDataEpoch = xData.map((val) => {
1801
+ if (typeof val === "string") {
1802
+ return new Date(val).getTime() / 1e3;
1803
+ }
1804
+ return val;
1805
+ });
1806
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1807
+ if (xDataEpoch[i] >= startValue) {
1808
+ startXIndex = i;
1809
+ break;
1810
+ }
1811
+ }
1812
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1813
+ startXIndex = xDataEpoch.length - 1;
1814
+ }
1815
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1816
+ if (xDataEpoch[i] <= endValue) {
1817
+ endXIndex = i;
1818
+ break;
1819
+ }
1820
+ }
1821
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1822
+ endXIndex = 0;
1823
+ }
1824
+ return { startXIndex, endXIndex };
1825
+ };
1826
+
1827
+ // src/common/hooks/useTrellisEnabled.ts
1828
+ var useTrellisFeatureFlagOn = () => {
1829
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1830
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1831
+ };
1832
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1833
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1834
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1835
+ };
1836
+
1837
+ // src/common/components/TrellisTitle.tsx
1838
+ var TRELLIS_TITLE_HEIGHT = 28;
1839
+ var TrellisTitleText = styled_components_default.div`
1840
+ margin-left: 10px;
1841
+ margin-right: 10px;
1842
+ padding-top: 8px;
1843
+ text-overflow: ellipsis;
1844
+ white-space: nowrap;
1845
+ overflow: hidden;
1846
+ `;
1847
+ var TrellisTitleDiv = styled_components_default.div`
1848
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1849
+ font-size: 14px;
1850
+ font-weight: 700;
1851
+ color: ${(props) => props.fontColor};
1852
+ background-color: ${(props) => props.backgroundColor};
1853
+ 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.
1854
+ `;
1855
+ var TrellisTitle = (props) => {
1856
+ const titleText = String(props.trellisKey).toString();
1857
+ return /* @__PURE__ */ react_exports.createElement(
1858
+ TrellisTitleDiv,
1859
+ {
1860
+ fontColor: props.fontColor,
1861
+ backgroundColor: props.backgroundColor,
1862
+ "data-test": "trellis-title",
1863
+ title: titleText
1864
+ },
1865
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1866
+ );
1867
+ };
1751
1868
 
1752
1869
  // src/common/TimeSeriesChartWrapper.tsx
1753
1870
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1758,38 +1875,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1758
1875
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1759
1876
  }
1760
1877
  `;
1761
- var handleClick = (chartEvent, onClick) => {
1878
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1879
+ const result = __spreadValues({}, payload);
1880
+ if (trellisSplitBy) {
1881
+ result["trellis.name"] = trellisSplitBy;
1882
+ }
1883
+ if (trellisKey) {
1884
+ result["trellis.value"] = trellisKey;
1885
+ }
1886
+ return result;
1887
+ };
1888
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1889
+ if (!previousPayload) {
1890
+ return true;
1891
+ }
1892
+ if (currentPayload.index !== previousPayload.index) {
1893
+ return true;
1894
+ }
1895
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1896
+ return true;
1897
+ }
1898
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1899
+ return true;
1900
+ }
1901
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1902
+ return true;
1903
+ }
1904
+ return false;
1905
+ };
1906
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1762
1907
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1763
1908
  name: chartEvent.seriesKey
1764
1909
  });
1765
1910
  delete payload.seriesKey;
1766
1911
  if (chartEvent.rowContext) {
1767
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1768
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1769
- });
1912
+ Object.assign(
1913
+ payload,
1914
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1915
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1916
+ return acc;
1917
+ }, {})
1918
+ );
1770
1919
  }
1920
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1771
1921
  if (onClick) {
1772
1922
  onClick({
1773
1923
  type: "point.click",
1774
1924
  originalEvent: chartEvent,
1775
- payload
1925
+ payload: updatedPayload
1776
1926
  });
1777
1927
  }
1778
1928
  };
1779
- var handleLegendClick = (chartEvent, onClick) => {
1929
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1780
1930
  const payload = {
1781
1931
  name: chartEvent
1782
1932
  };
1933
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1783
1934
  if (onClick) {
1784
1935
  onClick({
1785
1936
  type: "legend.click",
1786
1937
  originalEvent: chartEvent,
1787
- payload
1938
+ payload: updatedPayload
1939
+ });
1940
+ }
1941
+ };
1942
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1943
+ var _a;
1944
+ if (!rangeEvent) {
1945
+ return;
1946
+ }
1947
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1948
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1949
+ const payload = {
1950
+ startXIndex,
1951
+ startXValue: rangeEvent.start,
1952
+ endXIndex,
1953
+ endXValue: rangeEvent.end
1954
+ };
1955
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1956
+ if (onSelect) {
1957
+ onSelect({
1958
+ type: "range.selectBeforeZoom",
1959
+ originalEvent: rangeEvent,
1960
+ payload: updatedPayload
1788
1961
  });
1789
1962
  }
1790
1963
  };
1964
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1965
+ var _a;
1966
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1967
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1968
+ const payload = {
1969
+ startXIndex,
1970
+ startXValue: rangeEvent.start,
1971
+ endXIndex,
1972
+ endXValue: rangeEvent.end
1973
+ };
1974
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1975
+ if (onSelect) {
1976
+ onSelect({
1977
+ type: "range.select",
1978
+ originalEvent: rangeEvent,
1979
+ payload: updatedPayload
1980
+ });
1981
+ }
1982
+ };
1983
+ var parseArrayOption = (value) => {
1984
+ if (Array.isArray(value)) {
1985
+ return value;
1986
+ }
1987
+ if (value) {
1988
+ return JSON.parse(value);
1989
+ }
1990
+ return void 0;
1991
+ };
1791
1992
  var TimeSeriesChartWrapper = (props) => {
1792
- const {
1993
+ var _b, _c, _d;
1994
+ const _a = props, {
1793
1995
  width,
1794
1996
  height,
1795
1997
  chartData,
@@ -1802,12 +2004,49 @@ var TimeSeriesChartWrapper = (props) => {
1802
2004
  markerDisplay,
1803
2005
  onClick,
1804
2006
  onPointMouseOver,
1805
- onPointMouseOut
1806
- } = props;
1807
- const {
2007
+ onPointMouseOut,
2008
+ onSelect,
2009
+ splitByLayout,
2010
+ trellisKey,
2011
+ trellisSplitBy,
1808
2012
  backgroundColor,
2013
+ defaultFontColor,
2014
+ additionalTooltipValues,
2015
+ showYAxisWithZero: showYAxisWithZeroFromProps,
2016
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
2017
+ } = _a, otherOptions = __objRest(_a, [
2018
+ "width",
2019
+ "height",
2020
+ "chartData",
2021
+ "options",
2022
+ "userLocale",
2023
+ "annotationX",
2024
+ "annotationLabel",
2025
+ "annotationColor",
2026
+ "legendDisplay",
2027
+ "markerDisplay",
2028
+ "onClick",
2029
+ "onPointMouseOver",
2030
+ "onPointMouseOut",
2031
+ "onSelect",
2032
+ "splitByLayout",
2033
+ "trellisKey",
2034
+ "trellisSplitBy",
2035
+ "backgroundColor",
2036
+ "defaultFontColor",
2037
+ "additionalTooltipValues",
2038
+ // Extract showYAxisWithZero directly from props for accelerated render mode
2039
+ "showYAxisWithZero",
2040
+ "showY2AxisWithZero"
2041
+ ]);
2042
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
2043
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
2044
+ const {
2045
+ backgroundColor: bgColorFromOptions,
1809
2046
  seriesColors: seriesColorsStr,
1810
2047
  fieldColors,
2048
+ legendLabels: legendLabelsStr,
2049
+ legendMode,
1811
2050
  "axisTitleX.text": xAxisTitleText,
1812
2051
  "axisTitleY.text": yAxisTitleText,
1813
2052
  "axisTitleY2.text": y2AxisTitleText,
@@ -1815,8 +2054,11 @@ var TimeSeriesChartWrapper = (props) => {
1815
2054
  "axisTitleY.visibility": yAxisTitleVisibility,
1816
2055
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1817
2056
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
2057
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1818
2058
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
2059
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1819
2060
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
2061
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1820
2062
  "axisY.abbreviation": yAxisAbbreviation,
1821
2063
  "axisY.scale": yAxisScale,
1822
2064
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1826,10 +2068,63 @@ var TimeSeriesChartWrapper = (props) => {
1826
2068
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1827
2069
  "chart.overlayFields": overlayFieldsStr,
1828
2070
  "chart.nullValueMode": nullValueMode,
1829
- lineWidth
2071
+ "chart.showDataLabels": showDataLabels,
2072
+ lineWidth,
2073
+ lineDashStyle,
2074
+ fieldDashStyles: lineDashStylesByFieldStr,
2075
+ yAxisMin: yAxisMinRaw,
2076
+ yAxisMax: yAxisMaxRaw,
2077
+ y2AxisMin: y2AxisMinRaw,
2078
+ y2AxisMax: y2AxisMaxRaw,
2079
+ showXMajorGridLines,
2080
+ showYMajorGridLines,
2081
+ showY2MajorGridLines,
2082
+ showYMinorGridLines,
2083
+ showY2MinorGridLines,
2084
+ showLineSmoothing,
2085
+ yAxisMajorTickVisibility,
2086
+ y2AxisMajorTickVisibility,
2087
+ yAxisMajorTickSize,
2088
+ y2AxisMajorTickSize,
2089
+ yAxisMajorTickInterval,
2090
+ y2AxisMajorTickInterval,
2091
+ yAxisMinorTickVisibility,
2092
+ y2AxisMinorTickVisibility,
2093
+ yAxisMinorTickSize,
2094
+ y2AxisMinorTickSize,
2095
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
2096
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1830
2097
  } = options;
2098
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
2099
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
2100
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
2101
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
2102
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
2103
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
2104
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
2105
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
2106
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
2107
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
2108
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
2109
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
2110
+ if (simpleXMLValue) return Number(simpleXMLValue);
2111
+ if (canvasValue) return Number(canvasValue);
2112
+ return void 0;
2113
+ };
2114
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
2115
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
2116
+ y2AxisMajorUnitFromSimpleXML,
2117
+ y2AxisMajorTickInterval
2118
+ );
2119
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
2120
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
2121
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
2122
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
1831
2123
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1832
2124
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
2125
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
2126
+ const legendLabels = parseArrayOption(legendLabelsStr);
2127
+ const bgColor = backgroundColor || bgColorFromOptions;
1833
2128
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1834
2129
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1835
2130
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1840,31 +2135,64 @@ var TimeSeriesChartWrapper = (props) => {
1840
2135
  fields: chartData.fields,
1841
2136
  columns: chartData.seriesList
1842
2137
  });
1843
- const xField = getFieldName(filteredChartData.fields[0]);
2138
+ const xField = getFieldName2(filteredChartData.fields[0]);
1844
2139
  const yFields = getFieldNames(
1845
2140
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1846
2141
  );
1847
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1848
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
2142
+ const y2Fields = (0, react_exports.useMemo)(
2143
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
2144
+ [y2FieldsStr]
2145
+ );
2146
+ const overlayFields = (0, react_exports.useMemo)(
2147
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
2148
+ [overlayFieldsStr]
2149
+ );
1849
2150
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1850
2151
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1851
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
2152
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
2153
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1852
2154
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1853
2155
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1854
2156
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1855
2157
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1856
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1857
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1858
- let y2ScaleConfig = {};
1859
- if (y2Enabled) {
1860
- y2ScaleConfig = getY2ScaleConfig(
1861
- y2AxisTitle,
1862
- y2AxisAbbreviation,
1863
- y2AxisScale,
1864
- y2IntegerUnits,
1865
- y2AxisLabelVisibility
1866
- );
1867
- }
2158
+ const xScaleConfig = (0, react_exports.useMemo)(
2159
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
2160
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
2161
+ );
2162
+ const yScaleConfig = (0, react_exports.useMemo)(
2163
+ () => getYScaleConfig(
2164
+ yAxisTitle,
2165
+ yAxisAbbreviation,
2166
+ yAxisScale,
2167
+ yAxisLabelVisibility,
2168
+ yAxisMin,
2169
+ yAxisMax
2170
+ ),
2171
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
2172
+ );
2173
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
2174
+ if (y2Enabled) {
2175
+ return getY2ScaleConfig(
2176
+ y2AxisTitle,
2177
+ y2AxisAbbreviation,
2178
+ y2AxisScale,
2179
+ y2IntegerUnits,
2180
+ y2AxisLabelVisibility,
2181
+ y2AxisMin,
2182
+ y2AxisMax
2183
+ );
2184
+ }
2185
+ return {};
2186
+ }, [
2187
+ y2Enabled,
2188
+ y2AxisTitle,
2189
+ y2AxisAbbreviation,
2190
+ y2AxisScale,
2191
+ y2IntegerUnits,
2192
+ y2AxisLabelVisibility,
2193
+ y2AxisMin,
2194
+ y2AxisMax
2195
+ ]);
1868
2196
  const uplotContainerElement = (0, react_exports.useRef)(null);
1869
2197
  const seriesDataFormatted = [
1870
2198
  filteredChartData.columns[0],
@@ -1880,9 +2208,21 @@ var TimeSeriesChartWrapper = (props) => {
1880
2208
  overlayFields,
1881
2209
  y2Enabled,
1882
2210
  nullValueMode,
1883
- markerDisplay
2211
+ markerDisplay,
2212
+ lineDashStyle,
2213
+ lineDashStylesByField
1884
2214
  ),
1885
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
2215
+ [
2216
+ yFields,
2217
+ y2Fields,
2218
+ lineWidth,
2219
+ overlayFields,
2220
+ y2Enabled,
2221
+ nullValueMode,
2222
+ markerDisplay,
2223
+ lineDashStyle,
2224
+ lineDashStylesByField
2225
+ ]
1886
2226
  );
1887
2227
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1888
2228
  () => getAnnotationsForCanvas({
@@ -1896,25 +2236,54 @@ var TimeSeriesChartWrapper = (props) => {
1896
2236
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1897
2237
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1898
2238
  );
1899
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
2239
+ const legend = (0, react_exports.useMemo)(
2240
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
2241
+ [legendDisplay, legendMode]
2242
+ );
1900
2243
  const handleChartClick = react_exports.useCallback(
1901
2244
  (event) => {
1902
2245
  if (onClick) {
1903
- handleClick(event, onClick);
2246
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1904
2247
  }
1905
2248
  },
1906
- [onClick]
2249
+ [onClick, trellisKey, trellisSplitBy]
1907
2250
  );
1908
2251
  const handleChartLegendClick = react_exports.useCallback(
1909
2252
  (event) => {
1910
2253
  if (onClick) {
1911
- handleLegendClick(event, onClick);
2254
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
2255
+ }
2256
+ },
2257
+ [onClick, trellisKey, trellisSplitBy]
2258
+ );
2259
+ const handleChartRangeSelection = react_exports.useCallback(
2260
+ (range2) => {
2261
+ if (onSelect) {
2262
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
2263
+ }
2264
+ },
2265
+ [onSelect, chartData, trellisKey, trellisSplitBy]
2266
+ );
2267
+ const handleChartRangeZoom = react_exports.useCallback(
2268
+ (range2) => {
2269
+ if (onSelect) {
2270
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1912
2271
  }
1913
2272
  },
1914
- [onClick]
2273
+ [onSelect, chartData, trellisKey, trellisSplitBy]
2274
+ );
2275
+ const xFieldToUse = xFieldFromProps || xField;
2276
+ const enableSearchZoom = react_exports.useMemo(
2277
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
2278
+ [eventHandlers, xFieldToUse]
1915
2279
  );
1916
2280
  const lastPayloadRef = react_exports.useRef(null);
1917
2281
  const lastOriginalEventRef = react_exports.useRef(null);
2282
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
2283
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
2284
+ react_exports.useEffect(() => {
2285
+ additionalTooltipValuesRef.current = additionalTooltipValues;
2286
+ }, [additionalTooltipValues]);
1918
2287
  const handleChartCrosshairChange = react_exports.useCallback(
1919
2288
  (event) => {
1920
2289
  if (onPointMouseOver || onPointMouseOut) {
@@ -1926,6 +2295,7 @@ var TimeSeriesChartWrapper = (props) => {
1926
2295
  payload: lastPayloadRef.current
1927
2296
  });
1928
2297
  }
2298
+ previousMouseoverPayloadRef.current = null;
1929
2299
  return;
1930
2300
  }
1931
2301
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1933,25 +2303,36 @@ var TimeSeriesChartWrapper = (props) => {
1933
2303
  });
1934
2304
  delete payload.seriesKey;
1935
2305
  if (event.rowContext) {
1936
- Object.keys(event.rowContext).forEach((fieldName) => {
1937
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1938
- });
2306
+ Object.assign(
2307
+ payload,
2308
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
2309
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
2310
+ return acc;
2311
+ }, {})
2312
+ );
2313
+ }
2314
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
2315
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
2316
+ return;
1939
2317
  }
1940
- lastPayloadRef.current = payload;
2318
+ lastPayloadRef.current = updatedPayload;
1941
2319
  lastOriginalEventRef.current = event;
2320
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1942
2321
  if (onPointMouseOver) {
1943
2322
  onPointMouseOver({
1944
2323
  type: "point.mouseover",
1945
2324
  originalEvent: event,
1946
- payload
2325
+ payload: updatedPayload
1947
2326
  });
1948
2327
  }
1949
2328
  }
1950
2329
  },
1951
- [onPointMouseOver, onPointMouseOut]
2330
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1952
2331
  );
1953
- const memoizedChart = (0, react_exports.useMemo)(
1954
- () => /* @__PURE__ */ react_exports.createElement(
2332
+ 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}`;
2333
+ const memoizedChart = (0, react_exports.useMemo)(() => {
2334
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
2335
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1955
2336
  visualization_canvas_exports.TimeSeriesChart,
1956
2337
  {
1957
2338
  data: chartData,
@@ -1961,49 +2342,107 @@ var TimeSeriesChartWrapper = (props) => {
1961
2342
  seriesColorsByField,
1962
2343
  seriesConfig: seriesOverrides,
1963
2344
  legend,
2345
+ legendLabels,
2346
+ isSeriesCompare: legendMode === "seriesCompare",
2347
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1964
2348
  scaleConfig,
1965
2349
  timestampFormat: "expanded",
1966
2350
  onCrosshairClick: onClick ? handleChartClick : void 0,
1967
2351
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1968
2352
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
2353
+ onRangeSelection: handleChartRangeSelection,
2354
+ onRangeZoom: computedOnRangeZoom,
2355
+ serverSideZoom: enableSearchZoom,
1969
2356
  userLocale,
1970
2357
  events: chartingEventAnnotations,
1971
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
2358
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
2359
+ additionalTooltipValuesRef,
2360
+ showXMajorGridLines,
2361
+ showYMajorGridLines,
2362
+ showY2MajorGridLines,
2363
+ showYMinorGridLines,
2364
+ showY2MinorGridLines,
2365
+ showLineSmoothing,
2366
+ dataValuesDisplay,
2367
+ showYMajorTicks,
2368
+ showY2MajorTicks,
2369
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2370
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2371
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2372
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2373
+ showYMinorTicks,
2374
+ showY2MinorTicks,
2375
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2376
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2377
+ showYAxisWithZero,
2378
+ showY2AxisWithZero
1972
2379
  }
1973
- ),
1974
- [
1975
- chartData,
1976
- containerWidth,
1977
- containerHeight,
1978
- seriesColors,
1979
- seriesColorsByField,
1980
- seriesOverrides,
1981
- legend,
1982
- scaleConfig,
1983
- userLocale,
1984
- chartingEventAnnotations,
1985
- onClick,
1986
- handleChartClick,
1987
- onPointMouseOver,
1988
- onPointMouseOut,
1989
- handleChartCrosshairChange,
1990
- handleChartLegendClick
1991
- ]
1992
- );
2380
+ ));
2381
+ }, [
2382
+ onSelect,
2383
+ handleChartRangeZoom,
2384
+ dataKey,
2385
+ chartData,
2386
+ containerWidth,
2387
+ containerHeight,
2388
+ seriesColors,
2389
+ seriesColorsByField,
2390
+ seriesOverrides,
2391
+ legend,
2392
+ legendLabels,
2393
+ scaleConfig,
2394
+ onClick,
2395
+ handleChartClick,
2396
+ onPointMouseOver,
2397
+ onPointMouseOut,
2398
+ handleChartCrosshairChange,
2399
+ handleChartLegendClick,
2400
+ handleChartRangeSelection,
2401
+ enableSearchZoom,
2402
+ userLocale,
2403
+ chartingEventAnnotations,
2404
+ showXMajorGridLines,
2405
+ showYMajorGridLines,
2406
+ showY2MajorGridLines,
2407
+ showYMinorGridLines,
2408
+ showY2MinorGridLines,
2409
+ showLineSmoothing,
2410
+ dataValuesDisplay,
2411
+ showYMajorTicks,
2412
+ showY2MajorTicks,
2413
+ yAxisMajorTickSizeNum,
2414
+ y2AxisMajorTickSizeNum,
2415
+ yAxisMajorTickIntervalNum,
2416
+ y2AxisMajorTickIntervalNum,
2417
+ showYMinorTicks,
2418
+ showY2MinorTicks,
2419
+ yAxisMinorTickSizeNum,
2420
+ y2AxisMinorTickSizeNum,
2421
+ showYAxisWithZero,
2422
+ showY2AxisWithZero,
2423
+ legendMode
2424
+ ]);
1993
2425
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1994
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1995
- }, [backgroundColor, memoizedChart]);
1996
- return /* @__PURE__ */ react_exports.createElement(
2426
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2427
+ }, [bgColor, memoizedChart]);
2428
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2429
+ TrellisTitle,
2430
+ {
2431
+ trellisKey,
2432
+ backgroundColor: bgColor,
2433
+ fontColor: defaultFontColor
2434
+ }
2435
+ ), /* @__PURE__ */ react_exports.createElement(
1997
2436
  TimeSeriesChartContainer,
1998
2437
  {
1999
- height,
2438
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
2000
2439
  width,
2001
2440
  ref: uplotContainerElement,
2002
2441
  "data-test": "timeseries-chart-wrapper"
2003
2442
  },
2004
2443
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
2005
2444
  memoizedVisualization
2006
- );
2445
+ ));
2007
2446
  };
2008
2447
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
2009
2448
 
@@ -2337,7 +2776,7 @@ var getStyledShape = (shape4) => styled_components_default(shape4)`
2337
2776
  `;
2338
2777
  function ClickableShape({ children, onClick, shape: shape4 }) {
2339
2778
  const descriptionId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("clickable-svg-description"), []);
2340
- return /* @__PURE__ */ react_default.createElement(StyledDiv, null, /* @__PURE__ */ react_default.createElement(ScreenReaderContent_default, { id: descriptionId }, (0, i18n_exports._)("Click to trigger interaction")), /* @__PURE__ */ react_default.createElement(
2779
+ return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(ScreenReaderContent_default, { id: descriptionId }, (0, i18n_exports._)("Click to trigger interaction")), /* @__PURE__ */ react_default.createElement(
2341
2780
  StyledButton,
2342
2781
  {
2343
2782
  onClick,
@@ -2348,16 +2787,7 @@ function ClickableShape({ children, onClick, shape: shape4 }) {
2348
2787
  children
2349
2788
  ));
2350
2789
  }
2351
- var StyledDiv = styled_components_default.div`
2352
- display: inline-grid;
2353
- grid-template: 1fr / 1fr;
2354
-
2355
- & > * {
2356
- grid-row-start: 1;
2357
- grid-column-start: 1;
2358
- }
2359
- `;
2360
- var StyledButton = styled_components_default.button`
2790
+ var StyledButton = styled_components_default.button.attrs({ type: "button" })`
2361
2791
  padding: 0;
2362
2792
  border: 0;
2363
2793
  background: transparent;
@@ -2366,21 +2796,15 @@ var StyledButton = styled_components_default.button`
2366
2796
  outline: none;
2367
2797
  ${(props) => props.shape === "rect" ? styled_components_exports.css`
2368
2798
  box-shadow: ${variables_default.focusShadow};
2369
- ` : (
2370
- // clip-path would clip the shadow for ellipse, so we use drop-shadow filters to simulate it
2371
- styled_components_exports.css`
2372
- svg:has(+ &) > ellipse {
2799
+ ` : styled_components_exports.css`
2800
+ & > svg > ellipse {
2373
2801
  filter: drop-shadow(2px 0px 1px ${variables_default.focusColor})
2374
2802
  drop-shadow(-2px 0px 1px ${variables_default.focusColor})
2375
2803
  drop-shadow(0px 2px 1px ${variables_default.focusColor})
2376
2804
  drop-shadow(0px -2px 1px ${variables_default.focusColor});
2377
2805
  }
2378
- `
2379
- )}
2806
+ `}
2380
2807
  }
2381
- ${(props) => props.shape === "ellipse" && `
2382
- clip-path: ellipse(50% 50% at 50% 50%);
2383
- `}
2384
2808
  `;
2385
2809
 
2386
2810
  // src/Ellipse/Ellipse.tsx