@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
@@ -331,7 +331,6 @@ var computeText = ({
331
331
  }) => {
332
332
  let text = (0, numberUtils_exports.isNumerial)(value) ? (0, numberUtils_exports.formatNumber)(value, numberPrecision, {
333
333
  useThousandSeparators: shouldUseThousandSeparators,
334
- // todo: need update formatNumber
335
334
  useTrendUnits: shouldAbbreviateValue
336
335
  }) : value;
337
336
  text = text || "";
@@ -610,16 +609,19 @@ var changeColor = (color, ratio) => {
610
609
  };
611
610
  var lighten = (color) => changeColor(color, 1.3);
612
611
  var darken = (color) => changeColor(color, 0.5);
613
- var handleValueClickCallback = (ev, majorValue, majorValueField, trendValue, onValueClick, trellisEnabled = false, trellisSplitBy = "", trellisKey = "") => onValueClick(__spreadProps(__spreadValues({}, ev), {
614
- payload: __spreadValues({
615
- trendValue,
616
- value: majorValue,
617
- name: majorValueField
618
- }, trellisEnabled && {
619
- "trellis.name": trellisSplitBy,
620
- "trellis.value": trellisKey
621
- })
622
- }));
612
+ var handleValueClickCallback = (ev, majorValue, majorValueField, trendValue, onValueClick, trellisContext = {}) => {
613
+ const { trellisEnabled = false, trellisSplitBy = "", trellisKey = "" } = trellisContext;
614
+ return onValueClick(__spreadProps(__spreadValues({}, ev), {
615
+ payload: __spreadValues({
616
+ trendValue,
617
+ value: majorValue,
618
+ name: majorValueField
619
+ }, trellisEnabled && {
620
+ "trellis.name": trellisSplitBy,
621
+ "trellis.value": trellisKey
622
+ })
623
+ }));
624
+ };
623
625
  var getTrendColorWithPercent = (options) => {
624
626
  const shouldUsePercentTrendColor = options.trendColor === "> trendValue | rangeValue(trendColorEditorConfig)" && options.trendDisplay === "percent";
625
627
  return shouldUsePercentTrendColor ? {
@@ -1039,13 +1041,6 @@ var getProgressWidth = (value, minValue, maxValue, circumference) => {
1039
1041
  const progressWidth = progress50 / 100 * circumference;
1040
1042
  return progressWidth;
1041
1043
  };
1042
- var computeTextWidth = (text, font) => {
1043
- const canvas = document.createElement("canvas");
1044
- const context = canvas.getContext("2d");
1045
- context.font = font;
1046
- const measure = context.measureText(text);
1047
- return measure.width;
1048
- };
1049
1044
  var getVerticalLabelOffset = (theta, textHeight, maxOffset) => {
1050
1045
  if (theta > 90) {
1051
1046
  return (-(maxOffset / 90) * (180 - theta) + maxOffset) * textHeight;
@@ -1113,6 +1108,15 @@ var getFormattedGaugeRanges = (gaugeRanges, minValue, maxValue) => {
1113
1108
  return formattedGaugeRanges;
1114
1109
  };
1115
1110
 
1111
+ // src/common/utils/textUtils.ts
1112
+ var computeTextWidth = (text, font) => {
1113
+ const canvas = document.createElement("canvas");
1114
+ const context = canvas.getContext("2d");
1115
+ context.font = font;
1116
+ const measure = context.measureText(text);
1117
+ return measure.width;
1118
+ };
1119
+
1116
1120
  // src/SingleValueRadial/PureSingleValueRadial/GaugeGraph.tsx
1117
1121
  var GaugeGraph = ({
1118
1122
  width = 200,
@@ -1630,16 +1634,11 @@ var SingleValueRadial = (_a) => {
1630
1634
  const radialStrokeColor = props.radialStrokeColor || radialColors.stroke;
1631
1635
  const trellisEnabled = useTrellisEnabled(splitByLayout);
1632
1636
  const handleValueClick = (0, react_exports.useCallback)(
1633
- (ev) => handleValueClickCallback(
1634
- ev,
1635
- majorValue,
1636
- majorValueField,
1637
- trendValue,
1638
- onValueClick,
1637
+ (ev) => handleValueClickCallback(ev, majorValue, majorValueField, trendValue, onValueClick, {
1639
1638
  trellisEnabled,
1640
1639
  trellisSplitBy,
1641
1640
  trellisKey
1642
- ),
1641
+ }),
1643
1642
  [onValueClick, majorValue, majorValueField, trendValue, trellisEnabled, trellisSplitBy, trellisKey]
1644
1643
  );
1645
1644
  const sortedGaugeRanges = gaugeRanges && getSortedGaugeRanges(gaugeRanges);
@@ -2144,7 +2143,7 @@ var Cover = styled_components_default.div`
2144
2143
  bottom: 0;
2145
2144
  `;
2146
2145
  var Blocker = styled_components_default.div.attrs({
2147
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
2146
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
2148
2147
  })`
2149
2148
  position: relative;
2150
2149
  width: 100%;
@@ -2225,7 +2224,7 @@ var withFixedSizeContainer = (Viz) => {
2225
2224
  FixSizeItem,
2226
2225
  {
2227
2226
  "data-test": "fix-size-item",
2228
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
2227
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
2229
2228
  width,
2230
2229
  height,
2231
2230
  backgroundColor
@@ -2312,6 +2311,7 @@ var withPlaceholder = (Visualization, useIconPlaceholder = shouldShowIconPlaceho
2312
2311
  var withPlaceholder_default = withPlaceholder;
2313
2312
 
2314
2313
  // src/common/utils/dataUtils.ts
2314
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
2315
2315
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
2316
2316
  const dataLength = data.length;
2317
2317
  const downsampledIndices = [];
@@ -2428,9 +2428,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
2428
2428
  let xColumn = [];
2429
2429
  const yColumns = [];
2430
2430
  const canDownsample = !ds.data.fields.some((field, index) => {
2431
- var _a, _b;
2432
- const fieldName = (_a = field.name) != null ? _a : field;
2433
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
2431
+ var _a;
2432
+ const fieldName = getFieldName(field);
2433
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
2434
2434
  const column = ds.data.columns[index];
2435
2435
  let hasDisplayedColumnThatCantBeDownsampled = false;
2436
2436
  if (fieldName === xField) {
@@ -2717,7 +2717,7 @@ var trellisUtils_default = "default" in defaultImport33 ? defaultImport33.defaul
2717
2717
  var AGGREGATIONS = "aggregations";
2718
2718
  var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
2719
2719
  var _a, _b, _c, _d;
2720
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2720
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2721
2721
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2722
2722
  let splitDataSources = null;
2723
2723
  let errorCode = null;
@@ -2738,7 +2738,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
2738
2738
  }
2739
2739
  return { splitDataSources, errorCode };
2740
2740
  };
2741
- var toFieldEntries = (fields) => {
2741
+ var toFieldEntries = (fields = []) => {
2742
2742
  return fields.map((field) => {
2743
2743
  if (typeof field === "string") {
2744
2744
  return { name: field };
@@ -2753,7 +2753,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
2753
2753
  let splitDataSources = null;
2754
2754
  let splitByFields = [];
2755
2755
  let errorCode = null;
2756
- if (typeof fields[0] !== "string") {
2756
+ if (fields.length > 0) {
2757
2757
  splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
2758
2758
  }
2759
2759
  if (splitByFields && splitByFields.length > 0) {
@@ -2791,12 +2791,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
2791
2791
  };
2792
2792
  var dataSourcesSplitByAggregationsStats = (dataSource) => {
2793
2793
  var _a, _b, _c, _d;
2794
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2794
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2795
2795
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2796
2796
  let splitDataSources = null;
2797
2797
  let splitByFields = [];
2798
2798
  let errorCode = null;
2799
- if (typeof fields[0] !== "string") {
2799
+ if (fields.length > 0) {
2800
2800
  splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
2801
2801
  }
2802
2802
  if (splitByFields && splitByFields.length > 0) {
@@ -2820,12 +2820,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
2820
2820
  };
2821
2821
  var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2822
2822
  var _a, _b, _c, _d, _e;
2823
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2823
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2824
2824
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2825
2825
  let splitDataSources = null;
2826
2826
  let splitByFields = [];
2827
2827
  let errorCode = null;
2828
- if (typeof fields[0] !== "string") {
2828
+ if (fields.length > 0) {
2829
2829
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
2830
2830
  }
2831
2831
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
@@ -2863,12 +2863,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2863
2863
  };
2864
2864
  var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
2865
2865
  var _a, _b, _c, _d;
2866
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2866
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2867
2867
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2868
2868
  let splitDataSources = null;
2869
2869
  let splitByFields = [];
2870
2870
  let errorCode = null;
2871
- if (typeof fields[0] !== "string") {
2871
+ if (fields.length > 0) {
2872
2872
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
2873
2873
  }
2874
2874
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
@@ -2956,17 +2956,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
2956
2956
  };
2957
2957
  var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
2958
2958
  var _a, _b, _c, _d, _e, _f;
2959
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2959
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2960
2960
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2961
2961
  let splitDataSources = null;
2962
2962
  let splitByFields = [];
2963
2963
  let errorCode = null;
2964
- if (typeof fields[0] !== "string") {
2964
+ if (fields.length > 0) {
2965
2965
  splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
2966
2966
  }
2967
- const splitByIndex = fields == null ? void 0 : fields.findIndex(
2968
- (field) => field === splitBy || field.name === splitBy
2969
- );
2967
+ const splitByIndex = fields.findIndex((field) => field.name === splitBy);
2970
2968
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
2971
2969
  const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
2972
2970
  splitDataSources = {};
@@ -3101,6 +3099,16 @@ var triangleEventAnnotationRenderer = ({
3101
3099
  eventColor: eventWithColor.color
3102
3100
  });
3103
3101
  };
3102
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
3103
+ const rangeSelectEventHandler = eventHandlers.find(
3104
+ (eventHandler) => {
3105
+ var _a;
3106
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
3107
+ }
3108
+ );
3109
+ const xAxisIsTime = xField === "_time";
3110
+ return !!rangeSelectEventHandler && xAxisIsTime;
3111
+ };
3104
3112
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
3105
3113
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
3106
3114
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -3121,16 +3129,31 @@ var filterChartDataFromInternalFields = (chartData) => {
3121
3129
  var convert2DArrayToNumbers = (arr) => {
3122
3130
  return arr.map((subArray) => subArray.map((element2) => parseFloat(element2)));
3123
3131
  };
3132
+ var parseAxisValue = (val) => {
3133
+ if (val === void 0 || val === null || val === "auto" || val === "") {
3134
+ return void 0;
3135
+ }
3136
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
3137
+ return Number.isNaN(num) ? void 0 : num;
3138
+ };
3124
3139
  var SideLegendWidth = 75;
3125
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
3140
+ var SeriesCompareLegendWidth = 200;
3126
3141
  var getLegend = (props) => {
3127
3142
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
3143
+ const { isSeriesCompare } = props;
3144
+ const commonLegendProps = {
3145
+ center: true,
3146
+ fontSize: 12,
3147
+ largerTiles: true,
3148
+ hideSeriesValue: !isSeriesCompare
3149
+ // Show values if in seriesCompare mode
3150
+ };
3128
3151
  switch (legendPlacement) {
3129
3152
  case "off":
3130
3153
  return false;
3131
3154
  case "left":
3132
3155
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
3133
- width: SideLegendWidth
3156
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
3134
3157
  }, commonLegendProps));
3135
3158
  case "bottom":
3136
3159
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -3142,7 +3165,7 @@ var getLegend = (props) => {
3142
3165
  }, commonLegendProps));
3143
3166
  default:
3144
3167
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
3145
- width: SideLegendWidth
3168
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
3146
3169
  }, commonLegendProps));
3147
3170
  }
3148
3171
  };
@@ -3178,22 +3201,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
3178
3201
  const end = axisTitle.slice(-halfChars);
3179
3202
  return `${start}...${end}`;
3180
3203
  };
3181
- var getFieldName = (field) => {
3204
+ var getFieldName2 = (field) => {
3182
3205
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
3183
3206
  return fieldName;
3184
3207
  };
3185
3208
  var getFieldNames = (fields) => {
3186
- return fields.map((field) => getFieldName(field));
3209
+ return fields.map((field) => getFieldName2(field));
3187
3210
  };
3188
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
3211
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
3189
3212
  const xConfig = { x: {} };
3190
3213
  xConfig.x.label = label;
3191
3214
  if (xAxisLabelVisibility === "hide") {
3192
3215
  xConfig.x.hideLabels = true;
3193
3216
  }
3217
+ if (xAxisLabelRotation !== void 0) {
3218
+ xConfig.x.labelRotation = xAxisLabelRotation;
3219
+ }
3194
3220
  return xConfig;
3195
3221
  };
3196
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
3222
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
3197
3223
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
3198
3224
  const yConfig = { y: {} };
3199
3225
  yConfig.y.label = label;
@@ -3209,14 +3235,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
3209
3235
  if (yAxisLabelVisibility === "hide") {
3210
3236
  yConfig.y.hideLabels = true;
3211
3237
  }
3238
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
3239
+ yConfig.y.range = (u, dataMin, dataMax) => {
3240
+ const min = yAxisMin != null ? yAxisMin : dataMin;
3241
+ const max = yAxisMax != null ? yAxisMax : dataMax;
3242
+ return [min, max];
3243
+ };
3244
+ }
3212
3245
  return yConfig;
3213
3246
  };
3214
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
3247
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
3215
3248
  const y2Config = { y2: {} };
3216
3249
  const scaleType = axisScale != null ? axisScale : "linear";
3217
3250
  y2Config.y2.label = label;
3218
3251
  y2Config.y2.side = "right";
3219
- y2Config.y2.showGrid = false;
3220
3252
  y2Config.y2.type = scaleType;
3221
3253
  if (axisAbbreviation !== "none") {
3222
3254
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -3226,9 +3258,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
3226
3258
  if (y2AxisLabelVisibility === "hide") {
3227
3259
  y2Config.y2.hideLabels = true;
3228
3260
  }
3261
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
3262
+ y2Config.y2.range = (u, dataMin, dataMax) => {
3263
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
3264
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
3265
+ return [min, max];
3266
+ };
3267
+ }
3229
3268
  return y2Config;
3230
3269
  };
3231
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
3270
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
3232
3271
  const seriesConfig = {};
3233
3272
  let spanGaps;
3234
3273
  let replaceNullsWithZero;
@@ -3263,12 +3302,45 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
3263
3302
  if (markerDisplay !== void 0) {
3264
3303
  seriesConfig[field].markerDisplay = markerDisplay;
3265
3304
  }
3305
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
3306
+ if (fieldDashStyle) {
3307
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
3308
+ }
3266
3309
  if (replaceNullsWithZero !== void 0) {
3267
3310
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
3268
3311
  }
3269
3312
  });
3270
3313
  return seriesConfig;
3271
3314
  };
3315
+ var findRangeIndices = (xData, startValue, endValue) => {
3316
+ let startXIndex = -1;
3317
+ let endXIndex = -1;
3318
+ const xDataEpoch = xData.map((val) => {
3319
+ if (typeof val === "string") {
3320
+ return new Date(val).getTime() / 1e3;
3321
+ }
3322
+ return val;
3323
+ });
3324
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
3325
+ if (xDataEpoch[i] >= startValue) {
3326
+ startXIndex = i;
3327
+ break;
3328
+ }
3329
+ }
3330
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
3331
+ startXIndex = xDataEpoch.length - 1;
3332
+ }
3333
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
3334
+ if (xDataEpoch[i] <= endValue) {
3335
+ endXIndex = i;
3336
+ break;
3337
+ }
3338
+ }
3339
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
3340
+ endXIndex = 0;
3341
+ }
3342
+ return { startXIndex, endXIndex };
3343
+ };
3272
3344
 
3273
3345
  // src/common/TimeSeriesChartWrapper.tsx
3274
3346
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -3279,38 +3351,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
3279
3351
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
3280
3352
  }
3281
3353
  `;
3282
- var handleClick = (chartEvent, onClick) => {
3354
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
3355
+ const result = __spreadValues({}, payload);
3356
+ if (trellisSplitBy) {
3357
+ result["trellis.name"] = trellisSplitBy;
3358
+ }
3359
+ if (trellisKey) {
3360
+ result["trellis.value"] = trellisKey;
3361
+ }
3362
+ return result;
3363
+ };
3364
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
3365
+ if (!previousPayload) {
3366
+ return true;
3367
+ }
3368
+ if (currentPayload.index !== previousPayload.index) {
3369
+ return true;
3370
+ }
3371
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
3372
+ return true;
3373
+ }
3374
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
3375
+ return true;
3376
+ }
3377
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
3378
+ return true;
3379
+ }
3380
+ return false;
3381
+ };
3382
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
3283
3383
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
3284
3384
  name: chartEvent.seriesKey
3285
3385
  });
3286
3386
  delete payload.seriesKey;
3287
3387
  if (chartEvent.rowContext) {
3288
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
3289
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
3290
- });
3388
+ Object.assign(
3389
+ payload,
3390
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
3391
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
3392
+ return acc;
3393
+ }, {})
3394
+ );
3291
3395
  }
3396
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
3292
3397
  if (onClick) {
3293
3398
  onClick({
3294
3399
  type: "point.click",
3295
3400
  originalEvent: chartEvent,
3296
- payload
3401
+ payload: updatedPayload
3297
3402
  });
3298
3403
  }
3299
3404
  };
3300
- var handleLegendClick = (chartEvent, onClick) => {
3405
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
3301
3406
  const payload = {
3302
3407
  name: chartEvent
3303
3408
  };
3409
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
3304
3410
  if (onClick) {
3305
3411
  onClick({
3306
3412
  type: "legend.click",
3307
3413
  originalEvent: chartEvent,
3308
- payload
3414
+ payload: updatedPayload
3415
+ });
3416
+ }
3417
+ };
3418
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3419
+ var _a;
3420
+ if (!rangeEvent) {
3421
+ return;
3422
+ }
3423
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3424
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3425
+ const payload = {
3426
+ startXIndex,
3427
+ startXValue: rangeEvent.start,
3428
+ endXIndex,
3429
+ endXValue: rangeEvent.end
3430
+ };
3431
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
3432
+ if (onSelect) {
3433
+ onSelect({
3434
+ type: "range.selectBeforeZoom",
3435
+ originalEvent: rangeEvent,
3436
+ payload: updatedPayload
3309
3437
  });
3310
3438
  }
3311
3439
  };
3440
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3441
+ var _a;
3442
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3443
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3444
+ const payload = {
3445
+ startXIndex,
3446
+ startXValue: rangeEvent.start,
3447
+ endXIndex,
3448
+ endXValue: rangeEvent.end
3449
+ };
3450
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
3451
+ if (onSelect) {
3452
+ onSelect({
3453
+ type: "range.select",
3454
+ originalEvent: rangeEvent,
3455
+ payload: updatedPayload
3456
+ });
3457
+ }
3458
+ };
3459
+ var parseArrayOption = (value) => {
3460
+ if (Array.isArray(value)) {
3461
+ return value;
3462
+ }
3463
+ if (value) {
3464
+ return JSON.parse(value);
3465
+ }
3466
+ return void 0;
3467
+ };
3312
3468
  var TimeSeriesChartWrapper = (props) => {
3313
- const {
3469
+ var _b, _c, _d;
3470
+ const _a = props, {
3314
3471
  width,
3315
3472
  height,
3316
3473
  chartData,
@@ -3323,12 +3480,49 @@ var TimeSeriesChartWrapper = (props) => {
3323
3480
  markerDisplay,
3324
3481
  onClick,
3325
3482
  onPointMouseOver,
3326
- onPointMouseOut
3327
- } = props;
3328
- const {
3483
+ onPointMouseOut,
3484
+ onSelect,
3485
+ splitByLayout,
3486
+ trellisKey,
3487
+ trellisSplitBy,
3329
3488
  backgroundColor,
3489
+ defaultFontColor,
3490
+ additionalTooltipValues,
3491
+ showYAxisWithZero: showYAxisWithZeroFromProps,
3492
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
3493
+ } = _a, otherOptions = __objRest(_a, [
3494
+ "width",
3495
+ "height",
3496
+ "chartData",
3497
+ "options",
3498
+ "userLocale",
3499
+ "annotationX",
3500
+ "annotationLabel",
3501
+ "annotationColor",
3502
+ "legendDisplay",
3503
+ "markerDisplay",
3504
+ "onClick",
3505
+ "onPointMouseOver",
3506
+ "onPointMouseOut",
3507
+ "onSelect",
3508
+ "splitByLayout",
3509
+ "trellisKey",
3510
+ "trellisSplitBy",
3511
+ "backgroundColor",
3512
+ "defaultFontColor",
3513
+ "additionalTooltipValues",
3514
+ // Extract showYAxisWithZero directly from props for accelerated render mode
3515
+ "showYAxisWithZero",
3516
+ "showY2AxisWithZero"
3517
+ ]);
3518
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
3519
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
3520
+ const {
3521
+ backgroundColor: bgColorFromOptions,
3330
3522
  seriesColors: seriesColorsStr,
3331
3523
  fieldColors,
3524
+ legendLabels: legendLabelsStr,
3525
+ legendMode,
3332
3526
  "axisTitleX.text": xAxisTitleText,
3333
3527
  "axisTitleY.text": yAxisTitleText,
3334
3528
  "axisTitleY2.text": y2AxisTitleText,
@@ -3336,8 +3530,11 @@ var TimeSeriesChartWrapper = (props) => {
3336
3530
  "axisTitleY.visibility": yAxisTitleVisibility,
3337
3531
  "axisTitleY2.visibility": y2AxisTitleVisibility,
3338
3532
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
3533
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
3339
3534
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
3535
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
3340
3536
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
3537
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
3341
3538
  "axisY.abbreviation": yAxisAbbreviation,
3342
3539
  "axisY.scale": yAxisScale,
3343
3540
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -3347,10 +3544,63 @@ var TimeSeriesChartWrapper = (props) => {
3347
3544
  "axisLabelsY2.integerUnits": y2IntegerUnits,
3348
3545
  "chart.overlayFields": overlayFieldsStr,
3349
3546
  "chart.nullValueMode": nullValueMode,
3350
- lineWidth
3547
+ "chart.showDataLabels": showDataLabels,
3548
+ lineWidth,
3549
+ lineDashStyle,
3550
+ fieldDashStyles: lineDashStylesByFieldStr,
3551
+ yAxisMin: yAxisMinRaw,
3552
+ yAxisMax: yAxisMaxRaw,
3553
+ y2AxisMin: y2AxisMinRaw,
3554
+ y2AxisMax: y2AxisMaxRaw,
3555
+ showXMajorGridLines,
3556
+ showYMajorGridLines,
3557
+ showY2MajorGridLines,
3558
+ showYMinorGridLines,
3559
+ showY2MinorGridLines,
3560
+ showLineSmoothing,
3561
+ yAxisMajorTickVisibility,
3562
+ y2AxisMajorTickVisibility,
3563
+ yAxisMajorTickSize,
3564
+ y2AxisMajorTickSize,
3565
+ yAxisMajorTickInterval,
3566
+ y2AxisMajorTickInterval,
3567
+ yAxisMinorTickVisibility,
3568
+ y2AxisMinorTickVisibility,
3569
+ yAxisMinorTickSize,
3570
+ y2AxisMinorTickSize,
3571
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
3572
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
3351
3573
  } = options;
3574
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
3575
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
3576
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
3577
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
3578
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
3579
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
3580
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
3581
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
3582
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
3583
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
3584
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
3585
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
3586
+ if (simpleXMLValue) return Number(simpleXMLValue);
3587
+ if (canvasValue) return Number(canvasValue);
3588
+ return void 0;
3589
+ };
3590
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
3591
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
3592
+ y2AxisMajorUnitFromSimpleXML,
3593
+ y2AxisMajorTickInterval
3594
+ );
3595
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
3596
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
3597
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
3598
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
3352
3599
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
3353
3600
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
3601
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
3602
+ const legendLabels = parseArrayOption(legendLabelsStr);
3603
+ const bgColor = backgroundColor || bgColorFromOptions;
3354
3604
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
3355
3605
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
3356
3606
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -3361,31 +3611,64 @@ var TimeSeriesChartWrapper = (props) => {
3361
3611
  fields: chartData.fields,
3362
3612
  columns: chartData.seriesList
3363
3613
  });
3364
- const xField = getFieldName(filteredChartData.fields[0]);
3614
+ const xField = getFieldName2(filteredChartData.fields[0]);
3365
3615
  const yFields = getFieldNames(
3366
3616
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
3367
3617
  );
3368
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
3369
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
3618
+ const y2Fields = (0, react_exports.useMemo)(
3619
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
3620
+ [y2FieldsStr]
3621
+ );
3622
+ const overlayFields = (0, react_exports.useMemo)(
3623
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
3624
+ [overlayFieldsStr]
3625
+ );
3370
3626
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
3371
3627
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
3372
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
3628
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
3629
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
3373
3630
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
3374
3631
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
3375
3632
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
3376
3633
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
3377
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
3378
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
3379
- let y2ScaleConfig = {};
3380
- if (y2Enabled) {
3381
- y2ScaleConfig = getY2ScaleConfig(
3382
- y2AxisTitle,
3383
- y2AxisAbbreviation,
3384
- y2AxisScale,
3385
- y2IntegerUnits,
3386
- y2AxisLabelVisibility
3387
- );
3388
- }
3634
+ const xScaleConfig = (0, react_exports.useMemo)(
3635
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
3636
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
3637
+ );
3638
+ const yScaleConfig = (0, react_exports.useMemo)(
3639
+ () => getYScaleConfig(
3640
+ yAxisTitle,
3641
+ yAxisAbbreviation,
3642
+ yAxisScale,
3643
+ yAxisLabelVisibility,
3644
+ yAxisMin,
3645
+ yAxisMax
3646
+ ),
3647
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
3648
+ );
3649
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
3650
+ if (y2Enabled) {
3651
+ return getY2ScaleConfig(
3652
+ y2AxisTitle,
3653
+ y2AxisAbbreviation,
3654
+ y2AxisScale,
3655
+ y2IntegerUnits,
3656
+ y2AxisLabelVisibility,
3657
+ y2AxisMin,
3658
+ y2AxisMax
3659
+ );
3660
+ }
3661
+ return {};
3662
+ }, [
3663
+ y2Enabled,
3664
+ y2AxisTitle,
3665
+ y2AxisAbbreviation,
3666
+ y2AxisScale,
3667
+ y2IntegerUnits,
3668
+ y2AxisLabelVisibility,
3669
+ y2AxisMin,
3670
+ y2AxisMax
3671
+ ]);
3389
3672
  const uplotContainerElement = (0, react_exports.useRef)(null);
3390
3673
  const seriesDataFormatted = [
3391
3674
  filteredChartData.columns[0],
@@ -3401,9 +3684,21 @@ var TimeSeriesChartWrapper = (props) => {
3401
3684
  overlayFields,
3402
3685
  y2Enabled,
3403
3686
  nullValueMode,
3404
- markerDisplay
3687
+ markerDisplay,
3688
+ lineDashStyle,
3689
+ lineDashStylesByField
3405
3690
  ),
3406
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
3691
+ [
3692
+ yFields,
3693
+ y2Fields,
3694
+ lineWidth,
3695
+ overlayFields,
3696
+ y2Enabled,
3697
+ nullValueMode,
3698
+ markerDisplay,
3699
+ lineDashStyle,
3700
+ lineDashStylesByField
3701
+ ]
3407
3702
  );
3408
3703
  const chartingEventAnnotations = (0, react_exports.useMemo)(
3409
3704
  () => getAnnotationsForCanvas({
@@ -3417,25 +3712,54 @@ var TimeSeriesChartWrapper = (props) => {
3417
3712
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
3418
3713
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
3419
3714
  );
3420
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
3715
+ const legend = (0, react_exports.useMemo)(
3716
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
3717
+ [legendDisplay, legendMode]
3718
+ );
3421
3719
  const handleChartClick = react_exports.useCallback(
3422
3720
  (event) => {
3423
3721
  if (onClick) {
3424
- handleClick(event, onClick);
3722
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
3425
3723
  }
3426
3724
  },
3427
- [onClick]
3725
+ [onClick, trellisKey, trellisSplitBy]
3428
3726
  );
3429
3727
  const handleChartLegendClick = react_exports.useCallback(
3430
3728
  (event) => {
3431
3729
  if (onClick) {
3432
- handleLegendClick(event, onClick);
3730
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
3731
+ }
3732
+ },
3733
+ [onClick, trellisKey, trellisSplitBy]
3734
+ );
3735
+ const handleChartRangeSelection = react_exports.useCallback(
3736
+ (range2) => {
3737
+ if (onSelect) {
3738
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3739
+ }
3740
+ },
3741
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3742
+ );
3743
+ const handleChartRangeZoom = react_exports.useCallback(
3744
+ (range2) => {
3745
+ if (onSelect) {
3746
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3433
3747
  }
3434
3748
  },
3435
- [onClick]
3749
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3750
+ );
3751
+ const xFieldToUse = xFieldFromProps || xField;
3752
+ const enableSearchZoom = react_exports.useMemo(
3753
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
3754
+ [eventHandlers, xFieldToUse]
3436
3755
  );
3437
3756
  const lastPayloadRef = react_exports.useRef(null);
3438
3757
  const lastOriginalEventRef = react_exports.useRef(null);
3758
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
3759
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
3760
+ react_exports.useEffect(() => {
3761
+ additionalTooltipValuesRef.current = additionalTooltipValues;
3762
+ }, [additionalTooltipValues]);
3439
3763
  const handleChartCrosshairChange = react_exports.useCallback(
3440
3764
  (event) => {
3441
3765
  if (onPointMouseOver || onPointMouseOut) {
@@ -3447,6 +3771,7 @@ var TimeSeriesChartWrapper = (props) => {
3447
3771
  payload: lastPayloadRef.current
3448
3772
  });
3449
3773
  }
3774
+ previousMouseoverPayloadRef.current = null;
3450
3775
  return;
3451
3776
  }
3452
3777
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -3454,25 +3779,36 @@ var TimeSeriesChartWrapper = (props) => {
3454
3779
  });
3455
3780
  delete payload.seriesKey;
3456
3781
  if (event.rowContext) {
3457
- Object.keys(event.rowContext).forEach((fieldName) => {
3458
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
3459
- });
3782
+ Object.assign(
3783
+ payload,
3784
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
3785
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
3786
+ return acc;
3787
+ }, {})
3788
+ );
3460
3789
  }
3461
- lastPayloadRef.current = payload;
3790
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
3791
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
3792
+ return;
3793
+ }
3794
+ lastPayloadRef.current = updatedPayload;
3462
3795
  lastOriginalEventRef.current = event;
3796
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
3463
3797
  if (onPointMouseOver) {
3464
3798
  onPointMouseOver({
3465
3799
  type: "point.mouseover",
3466
3800
  originalEvent: event,
3467
- payload
3801
+ payload: updatedPayload
3468
3802
  });
3469
3803
  }
3470
3804
  }
3471
3805
  },
3472
- [onPointMouseOver, onPointMouseOut]
3806
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
3473
3807
  );
3474
- const memoizedChart = (0, react_exports.useMemo)(
3475
- () => /* @__PURE__ */ react_exports.createElement(
3808
+ 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}`;
3809
+ const memoizedChart = (0, react_exports.useMemo)(() => {
3810
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
3811
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
3476
3812
  visualization_canvas_exports.TimeSeriesChart,
3477
3813
  {
3478
3814
  data: chartData,
@@ -3482,49 +3818,107 @@ var TimeSeriesChartWrapper = (props) => {
3482
3818
  seriesColorsByField,
3483
3819
  seriesConfig: seriesOverrides,
3484
3820
  legend,
3821
+ legendLabels,
3822
+ isSeriesCompare: legendMode === "seriesCompare",
3823
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
3485
3824
  scaleConfig,
3486
3825
  timestampFormat: "expanded",
3487
3826
  onCrosshairClick: onClick ? handleChartClick : void 0,
3488
3827
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
3489
3828
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
3829
+ onRangeSelection: handleChartRangeSelection,
3830
+ onRangeZoom: computedOnRangeZoom,
3831
+ serverSideZoom: enableSearchZoom,
3490
3832
  userLocale,
3491
3833
  events: chartingEventAnnotations,
3492
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
3834
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
3835
+ additionalTooltipValuesRef,
3836
+ showXMajorGridLines,
3837
+ showYMajorGridLines,
3838
+ showY2MajorGridLines,
3839
+ showYMinorGridLines,
3840
+ showY2MinorGridLines,
3841
+ showLineSmoothing,
3842
+ dataValuesDisplay,
3843
+ showYMajorTicks,
3844
+ showY2MajorTicks,
3845
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
3846
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
3847
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
3848
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
3849
+ showYMinorTicks,
3850
+ showY2MinorTicks,
3851
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
3852
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
3853
+ showYAxisWithZero,
3854
+ showY2AxisWithZero
3493
3855
  }
3494
- ),
3495
- [
3496
- chartData,
3497
- containerWidth,
3498
- containerHeight,
3499
- seriesColors,
3500
- seriesColorsByField,
3501
- seriesOverrides,
3502
- legend,
3503
- scaleConfig,
3504
- userLocale,
3505
- chartingEventAnnotations,
3506
- onClick,
3507
- handleChartClick,
3508
- onPointMouseOver,
3509
- onPointMouseOut,
3510
- handleChartCrosshairChange,
3511
- handleChartLegendClick
3512
- ]
3513
- );
3856
+ ));
3857
+ }, [
3858
+ onSelect,
3859
+ handleChartRangeZoom,
3860
+ dataKey,
3861
+ chartData,
3862
+ containerWidth,
3863
+ containerHeight,
3864
+ seriesColors,
3865
+ seriesColorsByField,
3866
+ seriesOverrides,
3867
+ legend,
3868
+ legendLabels,
3869
+ scaleConfig,
3870
+ onClick,
3871
+ handleChartClick,
3872
+ onPointMouseOver,
3873
+ onPointMouseOut,
3874
+ handleChartCrosshairChange,
3875
+ handleChartLegendClick,
3876
+ handleChartRangeSelection,
3877
+ enableSearchZoom,
3878
+ userLocale,
3879
+ chartingEventAnnotations,
3880
+ showXMajorGridLines,
3881
+ showYMajorGridLines,
3882
+ showY2MajorGridLines,
3883
+ showYMinorGridLines,
3884
+ showY2MinorGridLines,
3885
+ showLineSmoothing,
3886
+ dataValuesDisplay,
3887
+ showYMajorTicks,
3888
+ showY2MajorTicks,
3889
+ yAxisMajorTickSizeNum,
3890
+ y2AxisMajorTickSizeNum,
3891
+ yAxisMajorTickIntervalNum,
3892
+ y2AxisMajorTickIntervalNum,
3893
+ showYMinorTicks,
3894
+ showY2MinorTicks,
3895
+ yAxisMinorTickSizeNum,
3896
+ y2AxisMinorTickSizeNum,
3897
+ showYAxisWithZero,
3898
+ showY2AxisWithZero,
3899
+ legendMode
3900
+ ]);
3514
3901
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
3515
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
3516
- }, [backgroundColor, memoizedChart]);
3517
- return /* @__PURE__ */ react_exports.createElement(
3902
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
3903
+ }, [bgColor, memoizedChart]);
3904
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
3905
+ TrellisTitle,
3906
+ {
3907
+ trellisKey,
3908
+ backgroundColor: bgColor,
3909
+ fontColor: defaultFontColor
3910
+ }
3911
+ ), /* @__PURE__ */ react_exports.createElement(
3518
3912
  TimeSeriesChartContainer,
3519
3913
  {
3520
- height,
3914
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
3521
3915
  width,
3522
3916
  ref: uplotContainerElement,
3523
3917
  "data-test": "timeseries-chart-wrapper"
3524
3918
  },
3525
3919
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
3526
3920
  memoizedVisualization
3527
- );
3921
+ ));
3528
3922
  };
3529
3923
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
3530
3924
 
@@ -3855,7 +4249,6 @@ var StaticMajorAndTrendLayout = [
3855
4249
  [
3856
4250
  {
3857
4251
  label: (0, i18n_exports._)("Unit position"),
3858
- // todo: we need a new editor combining unit and position
3859
4252
  option: "unitPosition",
3860
4253
  editor: "editor.select",
3861
4254
  editorProps: {