@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/Sankey.js CHANGED
@@ -25,6 +25,18 @@ var __spreadValues = (a, b) => {
25
25
  return a;
26
26
  };
27
27
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
28
40
  var __export = (target, all) => {
29
41
  for (var name in all)
30
42
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -485,7 +497,7 @@ var Cover = styled_components_default.div`
485
497
  bottom: 0;
486
498
  `;
487
499
  var Blocker = styled_components_default.div.attrs({
488
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
500
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
489
501
  })`
490
502
  position: relative;
491
503
  width: 100%;
@@ -575,7 +587,7 @@ var withFixedSizeContainer = (Viz) => {
575
587
  FixSizeItem,
576
588
  {
577
589
  "data-test": "fix-size-item",
578
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
590
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
579
591
  width,
580
592
  height,
581
593
  backgroundColor
@@ -671,6 +683,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
671
683
  var numberUtils_default = "default" in defaultImport22 ? defaultImport22.default : defaultImport22;
672
684
 
673
685
  // src/common/utils/dataUtils.ts
686
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
674
687
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
675
688
  const dataLength = data.length;
676
689
  const downsampledIndices = [];
@@ -787,9 +800,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
787
800
  let xColumn = [];
788
801
  const yColumns = [];
789
802
  const canDownsample = !ds.data.fields.some((field, index) => {
790
- var _a, _b;
791
- const fieldName = (_a = field.name) != null ? _a : field;
792
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
803
+ var _a;
804
+ const fieldName = getFieldName(field);
805
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
793
806
  const column = ds.data.columns[index];
794
807
  let hasDisplayedColumnThatCantBeDownsampled = false;
795
808
  if (fieldName === xField) {
@@ -1142,6 +1155,16 @@ var triangleEventAnnotationRenderer = ({
1142
1155
  eventColor: eventWithColor.color
1143
1156
  });
1144
1157
  };
1158
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1159
+ const rangeSelectEventHandler = eventHandlers.find(
1160
+ (eventHandler) => {
1161
+ var _a;
1162
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1163
+ }
1164
+ );
1165
+ const xAxisIsTime = xField === "_time";
1166
+ return !!rangeSelectEventHandler && xAxisIsTime;
1167
+ };
1145
1168
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1146
1169
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1147
1170
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1162,16 +1185,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1162
1185
  var convert2DArrayToNumbers = (arr) => {
1163
1186
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1164
1187
  };
1188
+ var parseAxisValue = (val) => {
1189
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1190
+ return void 0;
1191
+ }
1192
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1193
+ return Number.isNaN(num) ? void 0 : num;
1194
+ };
1165
1195
  var SideLegendWidth = 75;
1166
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1196
+ var SeriesCompareLegendWidth = 200;
1167
1197
  var getLegend = (props) => {
1168
1198
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1199
+ const { isSeriesCompare } = props;
1200
+ const commonLegendProps = {
1201
+ center: true,
1202
+ fontSize: 12,
1203
+ largerTiles: true,
1204
+ hideSeriesValue: !isSeriesCompare
1205
+ // Show values if in seriesCompare mode
1206
+ };
1169
1207
  switch (legendPlacement) {
1170
1208
  case "off":
1171
1209
  return false;
1172
1210
  case "left":
1173
1211
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1174
- width: SideLegendWidth
1212
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1175
1213
  }, commonLegendProps));
1176
1214
  case "bottom":
1177
1215
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1183,7 +1221,7 @@ var getLegend = (props) => {
1183
1221
  }, commonLegendProps));
1184
1222
  default:
1185
1223
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1186
- width: SideLegendWidth
1224
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1187
1225
  }, commonLegendProps));
1188
1226
  }
1189
1227
  };
@@ -1219,22 +1257,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1219
1257
  const end = axisTitle.slice(-halfChars);
1220
1258
  return `${start}...${end}`;
1221
1259
  };
1222
- var getFieldName = (field) => {
1260
+ var getFieldName2 = (field) => {
1223
1261
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1224
1262
  return fieldName;
1225
1263
  };
1226
1264
  var getFieldNames = (fields) => {
1227
- return fields.map((field) => getFieldName(field));
1265
+ return fields.map((field) => getFieldName2(field));
1228
1266
  };
1229
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1267
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1230
1268
  const xConfig = { x: {} };
1231
1269
  xConfig.x.label = label;
1232
1270
  if (xAxisLabelVisibility === "hide") {
1233
1271
  xConfig.x.hideLabels = true;
1234
1272
  }
1273
+ if (xAxisLabelRotation !== void 0) {
1274
+ xConfig.x.labelRotation = xAxisLabelRotation;
1275
+ }
1235
1276
  return xConfig;
1236
1277
  };
1237
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1278
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1238
1279
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1239
1280
  const yConfig = { y: {} };
1240
1281
  yConfig.y.label = label;
@@ -1250,14 +1291,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1250
1291
  if (yAxisLabelVisibility === "hide") {
1251
1292
  yConfig.y.hideLabels = true;
1252
1293
  }
1294
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1295
+ yConfig.y.range = (u, dataMin, dataMax) => {
1296
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1297
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1298
+ return [min, max];
1299
+ };
1300
+ }
1253
1301
  return yConfig;
1254
1302
  };
1255
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1303
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1256
1304
  const y2Config = { y2: {} };
1257
1305
  const scaleType = axisScale != null ? axisScale : "linear";
1258
1306
  y2Config.y2.label = label;
1259
1307
  y2Config.y2.side = "right";
1260
- y2Config.y2.showGrid = false;
1261
1308
  y2Config.y2.type = scaleType;
1262
1309
  if (axisAbbreviation !== "none") {
1263
1310
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1267,9 +1314,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1267
1314
  if (y2AxisLabelVisibility === "hide") {
1268
1315
  y2Config.y2.hideLabels = true;
1269
1316
  }
1317
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1318
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1319
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1320
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1321
+ return [min, max];
1322
+ };
1323
+ }
1270
1324
  return y2Config;
1271
1325
  };
1272
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1326
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1273
1327
  const seriesConfig = {};
1274
1328
  let spanGaps;
1275
1329
  let replaceNullsWithZero;
@@ -1304,12 +1358,96 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1304
1358
  if (markerDisplay !== void 0) {
1305
1359
  seriesConfig[field].markerDisplay = markerDisplay;
1306
1360
  }
1361
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1362
+ if (fieldDashStyle) {
1363
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1364
+ }
1307
1365
  if (replaceNullsWithZero !== void 0) {
1308
1366
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1309
1367
  }
1310
1368
  });
1311
1369
  return seriesConfig;
1312
1370
  };
1371
+ var findRangeIndices = (xData, startValue, endValue) => {
1372
+ let startXIndex = -1;
1373
+ let endXIndex = -1;
1374
+ const xDataEpoch = xData.map((val) => {
1375
+ if (typeof val === "string") {
1376
+ return new Date(val).getTime() / 1e3;
1377
+ }
1378
+ return val;
1379
+ });
1380
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1381
+ if (xDataEpoch[i] >= startValue) {
1382
+ startXIndex = i;
1383
+ break;
1384
+ }
1385
+ }
1386
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1387
+ startXIndex = xDataEpoch.length - 1;
1388
+ }
1389
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1390
+ if (xDataEpoch[i] <= endValue) {
1391
+ endXIndex = i;
1392
+ break;
1393
+ }
1394
+ }
1395
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1396
+ endXIndex = 0;
1397
+ }
1398
+ return { startXIndex, endXIndex };
1399
+ };
1400
+
1401
+ // esm-externals:@splunk/visualization-schemas
1402
+ var visualization_schemas_exports = {};
1403
+ __export(visualization_schemas_exports, {
1404
+ default: () => visualization_schemas_default
1405
+ });
1406
+ var defaultImport27 = __toESM(require("@splunk/visualization-schemas"));
1407
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1408
+ var visualization_schemas_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
1409
+
1410
+ // src/common/hooks/useTrellisEnabled.ts
1411
+ var useTrellisFeatureFlagOn = () => {
1412
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1413
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1414
+ };
1415
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1416
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1417
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1418
+ };
1419
+
1420
+ // src/common/components/TrellisTitle.tsx
1421
+ var TRELLIS_TITLE_HEIGHT = 28;
1422
+ var TrellisTitleText = styled_components_default.div`
1423
+ margin-left: 10px;
1424
+ margin-right: 10px;
1425
+ padding-top: 8px;
1426
+ text-overflow: ellipsis;
1427
+ white-space: nowrap;
1428
+ overflow: hidden;
1429
+ `;
1430
+ var TrellisTitleDiv = styled_components_default.div`
1431
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1432
+ font-size: 14px;
1433
+ font-weight: 700;
1434
+ color: ${(props) => props.fontColor};
1435
+ background-color: ${(props) => props.backgroundColor};
1436
+ 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.
1437
+ `;
1438
+ var TrellisTitle = (props) => {
1439
+ const titleText = String(props.trellisKey).toString();
1440
+ return /* @__PURE__ */ react_exports.createElement(
1441
+ TrellisTitleDiv,
1442
+ {
1443
+ fontColor: props.fontColor,
1444
+ backgroundColor: props.backgroundColor,
1445
+ "data-test": "trellis-title",
1446
+ title: titleText
1447
+ },
1448
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1449
+ );
1450
+ };
1313
1451
 
1314
1452
  // src/common/TimeSeriesChartWrapper.tsx
1315
1453
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1320,38 +1458,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1320
1458
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1321
1459
  }
1322
1460
  `;
1323
- var handleClick = (chartEvent, onClick) => {
1461
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1462
+ const result = __spreadValues({}, payload);
1463
+ if (trellisSplitBy) {
1464
+ result["trellis.name"] = trellisSplitBy;
1465
+ }
1466
+ if (trellisKey) {
1467
+ result["trellis.value"] = trellisKey;
1468
+ }
1469
+ return result;
1470
+ };
1471
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1472
+ if (!previousPayload) {
1473
+ return true;
1474
+ }
1475
+ if (currentPayload.index !== previousPayload.index) {
1476
+ return true;
1477
+ }
1478
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1479
+ return true;
1480
+ }
1481
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1482
+ return true;
1483
+ }
1484
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1485
+ return true;
1486
+ }
1487
+ return false;
1488
+ };
1489
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1324
1490
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1325
1491
  name: chartEvent.seriesKey
1326
1492
  });
1327
1493
  delete payload.seriesKey;
1328
1494
  if (chartEvent.rowContext) {
1329
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1330
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1331
- });
1495
+ Object.assign(
1496
+ payload,
1497
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1498
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1499
+ return acc;
1500
+ }, {})
1501
+ );
1332
1502
  }
1503
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1333
1504
  if (onClick) {
1334
1505
  onClick({
1335
1506
  type: "point.click",
1336
1507
  originalEvent: chartEvent,
1337
- payload
1508
+ payload: updatedPayload
1338
1509
  });
1339
1510
  }
1340
1511
  };
1341
- var handleLegendClick = (chartEvent, onClick) => {
1512
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1342
1513
  const payload = {
1343
1514
  name: chartEvent
1344
1515
  };
1516
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1345
1517
  if (onClick) {
1346
1518
  onClick({
1347
1519
  type: "legend.click",
1348
1520
  originalEvent: chartEvent,
1349
- payload
1521
+ payload: updatedPayload
1350
1522
  });
1351
1523
  }
1352
1524
  };
1525
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1526
+ var _a;
1527
+ if (!rangeEvent) {
1528
+ return;
1529
+ }
1530
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1531
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1532
+ const payload = {
1533
+ startXIndex,
1534
+ startXValue: rangeEvent.start,
1535
+ endXIndex,
1536
+ endXValue: rangeEvent.end
1537
+ };
1538
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1539
+ if (onSelect) {
1540
+ onSelect({
1541
+ type: "range.selectBeforeZoom",
1542
+ originalEvent: rangeEvent,
1543
+ payload: updatedPayload
1544
+ });
1545
+ }
1546
+ };
1547
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1548
+ var _a;
1549
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1550
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1551
+ const payload = {
1552
+ startXIndex,
1553
+ startXValue: rangeEvent.start,
1554
+ endXIndex,
1555
+ endXValue: rangeEvent.end
1556
+ };
1557
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1558
+ if (onSelect) {
1559
+ onSelect({
1560
+ type: "range.select",
1561
+ originalEvent: rangeEvent,
1562
+ payload: updatedPayload
1563
+ });
1564
+ }
1565
+ };
1566
+ var parseArrayOption = (value) => {
1567
+ if (Array.isArray(value)) {
1568
+ return value;
1569
+ }
1570
+ if (value) {
1571
+ return JSON.parse(value);
1572
+ }
1573
+ return void 0;
1574
+ };
1353
1575
  var TimeSeriesChartWrapper = (props) => {
1354
- const {
1576
+ var _b, _c, _d;
1577
+ const _a = props, {
1355
1578
  width,
1356
1579
  height,
1357
1580
  chartData,
@@ -1364,12 +1587,49 @@ var TimeSeriesChartWrapper = (props) => {
1364
1587
  markerDisplay,
1365
1588
  onClick,
1366
1589
  onPointMouseOver,
1367
- onPointMouseOut
1368
- } = props;
1369
- const {
1590
+ onPointMouseOut,
1591
+ onSelect,
1592
+ splitByLayout,
1593
+ trellisKey,
1594
+ trellisSplitBy,
1370
1595
  backgroundColor,
1596
+ defaultFontColor,
1597
+ additionalTooltipValues,
1598
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1599
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1600
+ } = _a, otherOptions = __objRest(_a, [
1601
+ "width",
1602
+ "height",
1603
+ "chartData",
1604
+ "options",
1605
+ "userLocale",
1606
+ "annotationX",
1607
+ "annotationLabel",
1608
+ "annotationColor",
1609
+ "legendDisplay",
1610
+ "markerDisplay",
1611
+ "onClick",
1612
+ "onPointMouseOver",
1613
+ "onPointMouseOut",
1614
+ "onSelect",
1615
+ "splitByLayout",
1616
+ "trellisKey",
1617
+ "trellisSplitBy",
1618
+ "backgroundColor",
1619
+ "defaultFontColor",
1620
+ "additionalTooltipValues",
1621
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1622
+ "showYAxisWithZero",
1623
+ "showY2AxisWithZero"
1624
+ ]);
1625
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1626
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1627
+ const {
1628
+ backgroundColor: bgColorFromOptions,
1371
1629
  seriesColors: seriesColorsStr,
1372
1630
  fieldColors,
1631
+ legendLabels: legendLabelsStr,
1632
+ legendMode,
1373
1633
  "axisTitleX.text": xAxisTitleText,
1374
1634
  "axisTitleY.text": yAxisTitleText,
1375
1635
  "axisTitleY2.text": y2AxisTitleText,
@@ -1377,8 +1637,11 @@ var TimeSeriesChartWrapper = (props) => {
1377
1637
  "axisTitleY.visibility": yAxisTitleVisibility,
1378
1638
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1379
1639
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1640
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1380
1641
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1642
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1381
1643
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1644
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1382
1645
  "axisY.abbreviation": yAxisAbbreviation,
1383
1646
  "axisY.scale": yAxisScale,
1384
1647
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1388,10 +1651,63 @@ var TimeSeriesChartWrapper = (props) => {
1388
1651
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1389
1652
  "chart.overlayFields": overlayFieldsStr,
1390
1653
  "chart.nullValueMode": nullValueMode,
1391
- lineWidth
1654
+ "chart.showDataLabels": showDataLabels,
1655
+ lineWidth,
1656
+ lineDashStyle,
1657
+ fieldDashStyles: lineDashStylesByFieldStr,
1658
+ yAxisMin: yAxisMinRaw,
1659
+ yAxisMax: yAxisMaxRaw,
1660
+ y2AxisMin: y2AxisMinRaw,
1661
+ y2AxisMax: y2AxisMaxRaw,
1662
+ showXMajorGridLines,
1663
+ showYMajorGridLines,
1664
+ showY2MajorGridLines,
1665
+ showYMinorGridLines,
1666
+ showY2MinorGridLines,
1667
+ showLineSmoothing,
1668
+ yAxisMajorTickVisibility,
1669
+ y2AxisMajorTickVisibility,
1670
+ yAxisMajorTickSize,
1671
+ y2AxisMajorTickSize,
1672
+ yAxisMajorTickInterval,
1673
+ y2AxisMajorTickInterval,
1674
+ yAxisMinorTickVisibility,
1675
+ y2AxisMinorTickVisibility,
1676
+ yAxisMinorTickSize,
1677
+ y2AxisMinorTickSize,
1678
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1679
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1392
1680
  } = options;
1681
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1682
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1683
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1684
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1685
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1686
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1687
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1688
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1689
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1690
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1691
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1692
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1693
+ if (simpleXMLValue) return Number(simpleXMLValue);
1694
+ if (canvasValue) return Number(canvasValue);
1695
+ return void 0;
1696
+ };
1697
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1698
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1699
+ y2AxisMajorUnitFromSimpleXML,
1700
+ y2AxisMajorTickInterval
1701
+ );
1702
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
1703
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
1704
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
1705
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
1393
1706
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1394
1707
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1708
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1709
+ const legendLabels = parseArrayOption(legendLabelsStr);
1710
+ const bgColor = backgroundColor || bgColorFromOptions;
1395
1711
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1396
1712
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1397
1713
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1402,31 +1718,64 @@ var TimeSeriesChartWrapper = (props) => {
1402
1718
  fields: chartData.fields,
1403
1719
  columns: chartData.seriesList
1404
1720
  });
1405
- const xField = getFieldName(filteredChartData.fields[0]);
1721
+ const xField = getFieldName2(filteredChartData.fields[0]);
1406
1722
  const yFields = getFieldNames(
1407
1723
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1408
1724
  );
1409
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1410
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1725
+ const y2Fields = (0, react_exports.useMemo)(
1726
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1727
+ [y2FieldsStr]
1728
+ );
1729
+ const overlayFields = (0, react_exports.useMemo)(
1730
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1731
+ [overlayFieldsStr]
1732
+ );
1411
1733
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1412
1734
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1413
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1735
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1736
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1414
1737
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1415
1738
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1416
1739
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1417
1740
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1418
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1419
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1420
- let y2ScaleConfig = {};
1421
- if (y2Enabled) {
1422
- y2ScaleConfig = getY2ScaleConfig(
1423
- y2AxisTitle,
1424
- y2AxisAbbreviation,
1425
- y2AxisScale,
1426
- y2IntegerUnits,
1427
- y2AxisLabelVisibility
1428
- );
1429
- }
1741
+ const xScaleConfig = (0, react_exports.useMemo)(
1742
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1743
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1744
+ );
1745
+ const yScaleConfig = (0, react_exports.useMemo)(
1746
+ () => getYScaleConfig(
1747
+ yAxisTitle,
1748
+ yAxisAbbreviation,
1749
+ yAxisScale,
1750
+ yAxisLabelVisibility,
1751
+ yAxisMin,
1752
+ yAxisMax
1753
+ ),
1754
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1755
+ );
1756
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1757
+ if (y2Enabled) {
1758
+ return getY2ScaleConfig(
1759
+ y2AxisTitle,
1760
+ y2AxisAbbreviation,
1761
+ y2AxisScale,
1762
+ y2IntegerUnits,
1763
+ y2AxisLabelVisibility,
1764
+ y2AxisMin,
1765
+ y2AxisMax
1766
+ );
1767
+ }
1768
+ return {};
1769
+ }, [
1770
+ y2Enabled,
1771
+ y2AxisTitle,
1772
+ y2AxisAbbreviation,
1773
+ y2AxisScale,
1774
+ y2IntegerUnits,
1775
+ y2AxisLabelVisibility,
1776
+ y2AxisMin,
1777
+ y2AxisMax
1778
+ ]);
1430
1779
  const uplotContainerElement = (0, react_exports.useRef)(null);
1431
1780
  const seriesDataFormatted = [
1432
1781
  filteredChartData.columns[0],
@@ -1442,9 +1791,21 @@ var TimeSeriesChartWrapper = (props) => {
1442
1791
  overlayFields,
1443
1792
  y2Enabled,
1444
1793
  nullValueMode,
1445
- markerDisplay
1794
+ markerDisplay,
1795
+ lineDashStyle,
1796
+ lineDashStylesByField
1446
1797
  ),
1447
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1798
+ [
1799
+ yFields,
1800
+ y2Fields,
1801
+ lineWidth,
1802
+ overlayFields,
1803
+ y2Enabled,
1804
+ nullValueMode,
1805
+ markerDisplay,
1806
+ lineDashStyle,
1807
+ lineDashStylesByField
1808
+ ]
1448
1809
  );
1449
1810
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1450
1811
  () => getAnnotationsForCanvas({
@@ -1458,25 +1819,54 @@ var TimeSeriesChartWrapper = (props) => {
1458
1819
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1459
1820
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1460
1821
  );
1461
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1822
+ const legend = (0, react_exports.useMemo)(
1823
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
1824
+ [legendDisplay, legendMode]
1825
+ );
1462
1826
  const handleChartClick = react_exports.useCallback(
1463
1827
  (event) => {
1464
1828
  if (onClick) {
1465
- handleClick(event, onClick);
1829
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1466
1830
  }
1467
1831
  },
1468
- [onClick]
1832
+ [onClick, trellisKey, trellisSplitBy]
1469
1833
  );
1470
1834
  const handleChartLegendClick = react_exports.useCallback(
1471
1835
  (event) => {
1472
1836
  if (onClick) {
1473
- handleLegendClick(event, onClick);
1837
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1838
+ }
1839
+ },
1840
+ [onClick, trellisKey, trellisSplitBy]
1841
+ );
1842
+ const handleChartRangeSelection = react_exports.useCallback(
1843
+ (range2) => {
1844
+ if (onSelect) {
1845
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1846
+ }
1847
+ },
1848
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1849
+ );
1850
+ const handleChartRangeZoom = react_exports.useCallback(
1851
+ (range2) => {
1852
+ if (onSelect) {
1853
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1474
1854
  }
1475
1855
  },
1476
- [onClick]
1856
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1857
+ );
1858
+ const xFieldToUse = xFieldFromProps || xField;
1859
+ const enableSearchZoom = react_exports.useMemo(
1860
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1861
+ [eventHandlers, xFieldToUse]
1477
1862
  );
1478
1863
  const lastPayloadRef = react_exports.useRef(null);
1479
1864
  const lastOriginalEventRef = react_exports.useRef(null);
1865
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1866
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1867
+ react_exports.useEffect(() => {
1868
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1869
+ }, [additionalTooltipValues]);
1480
1870
  const handleChartCrosshairChange = react_exports.useCallback(
1481
1871
  (event) => {
1482
1872
  if (onPointMouseOver || onPointMouseOut) {
@@ -1488,6 +1878,7 @@ var TimeSeriesChartWrapper = (props) => {
1488
1878
  payload: lastPayloadRef.current
1489
1879
  });
1490
1880
  }
1881
+ previousMouseoverPayloadRef.current = null;
1491
1882
  return;
1492
1883
  }
1493
1884
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1495,25 +1886,36 @@ var TimeSeriesChartWrapper = (props) => {
1495
1886
  });
1496
1887
  delete payload.seriesKey;
1497
1888
  if (event.rowContext) {
1498
- Object.keys(event.rowContext).forEach((fieldName) => {
1499
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1500
- });
1889
+ Object.assign(
1890
+ payload,
1891
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1892
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1893
+ return acc;
1894
+ }, {})
1895
+ );
1501
1896
  }
1502
- lastPayloadRef.current = payload;
1897
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1898
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1899
+ return;
1900
+ }
1901
+ lastPayloadRef.current = updatedPayload;
1503
1902
  lastOriginalEventRef.current = event;
1903
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1504
1904
  if (onPointMouseOver) {
1505
1905
  onPointMouseOver({
1506
1906
  type: "point.mouseover",
1507
1907
  originalEvent: event,
1508
- payload
1908
+ payload: updatedPayload
1509
1909
  });
1510
1910
  }
1511
1911
  }
1512
1912
  },
1513
- [onPointMouseOver, onPointMouseOut]
1913
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1514
1914
  );
1515
- const memoizedChart = (0, react_exports.useMemo)(
1516
- () => /* @__PURE__ */ react_exports.createElement(
1915
+ 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}`;
1916
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1917
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1918
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1517
1919
  visualization_canvas_exports.TimeSeriesChart,
1518
1920
  {
1519
1921
  data: chartData,
@@ -1523,49 +1925,107 @@ var TimeSeriesChartWrapper = (props) => {
1523
1925
  seriesColorsByField,
1524
1926
  seriesConfig: seriesOverrides,
1525
1927
  legend,
1928
+ legendLabels,
1929
+ isSeriesCompare: legendMode === "seriesCompare",
1930
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1526
1931
  scaleConfig,
1527
1932
  timestampFormat: "expanded",
1528
1933
  onCrosshairClick: onClick ? handleChartClick : void 0,
1529
1934
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1530
1935
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1936
+ onRangeSelection: handleChartRangeSelection,
1937
+ onRangeZoom: computedOnRangeZoom,
1938
+ serverSideZoom: enableSearchZoom,
1531
1939
  userLocale,
1532
1940
  events: chartingEventAnnotations,
1533
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
1941
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
1942
+ additionalTooltipValuesRef,
1943
+ showXMajorGridLines,
1944
+ showYMajorGridLines,
1945
+ showY2MajorGridLines,
1946
+ showYMinorGridLines,
1947
+ showY2MinorGridLines,
1948
+ showLineSmoothing,
1949
+ dataValuesDisplay,
1950
+ showYMajorTicks,
1951
+ showY2MajorTicks,
1952
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
1953
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
1954
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
1955
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
1956
+ showYMinorTicks,
1957
+ showY2MinorTicks,
1958
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
1959
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
1960
+ showYAxisWithZero,
1961
+ showY2AxisWithZero
1534
1962
  }
1535
- ),
1536
- [
1537
- chartData,
1538
- containerWidth,
1539
- containerHeight,
1540
- seriesColors,
1541
- seriesColorsByField,
1542
- seriesOverrides,
1543
- legend,
1544
- scaleConfig,
1545
- userLocale,
1546
- chartingEventAnnotations,
1547
- onClick,
1548
- handleChartClick,
1549
- onPointMouseOver,
1550
- onPointMouseOut,
1551
- handleChartCrosshairChange,
1552
- handleChartLegendClick
1553
- ]
1554
- );
1963
+ ));
1964
+ }, [
1965
+ onSelect,
1966
+ handleChartRangeZoom,
1967
+ dataKey,
1968
+ chartData,
1969
+ containerWidth,
1970
+ containerHeight,
1971
+ seriesColors,
1972
+ seriesColorsByField,
1973
+ seriesOverrides,
1974
+ legend,
1975
+ legendLabels,
1976
+ scaleConfig,
1977
+ onClick,
1978
+ handleChartClick,
1979
+ onPointMouseOver,
1980
+ onPointMouseOut,
1981
+ handleChartCrosshairChange,
1982
+ handleChartLegendClick,
1983
+ handleChartRangeSelection,
1984
+ enableSearchZoom,
1985
+ userLocale,
1986
+ chartingEventAnnotations,
1987
+ showXMajorGridLines,
1988
+ showYMajorGridLines,
1989
+ showY2MajorGridLines,
1990
+ showYMinorGridLines,
1991
+ showY2MinorGridLines,
1992
+ showLineSmoothing,
1993
+ dataValuesDisplay,
1994
+ showYMajorTicks,
1995
+ showY2MajorTicks,
1996
+ yAxisMajorTickSizeNum,
1997
+ y2AxisMajorTickSizeNum,
1998
+ yAxisMajorTickIntervalNum,
1999
+ y2AxisMajorTickIntervalNum,
2000
+ showYMinorTicks,
2001
+ showY2MinorTicks,
2002
+ yAxisMinorTickSizeNum,
2003
+ y2AxisMinorTickSizeNum,
2004
+ showYAxisWithZero,
2005
+ showY2AxisWithZero,
2006
+ legendMode
2007
+ ]);
1555
2008
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1556
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1557
- }, [backgroundColor, memoizedChart]);
1558
- return /* @__PURE__ */ react_exports.createElement(
2009
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2010
+ }, [bgColor, memoizedChart]);
2011
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2012
+ TrellisTitle,
2013
+ {
2014
+ trellisKey,
2015
+ backgroundColor: bgColor,
2016
+ fontColor: defaultFontColor
2017
+ }
2018
+ ), /* @__PURE__ */ react_exports.createElement(
1559
2019
  TimeSeriesChartContainer,
1560
2020
  {
1561
- height,
2021
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1562
2022
  width,
1563
2023
  ref: uplotContainerElement,
1564
2024
  "data-test": "timeseries-chart-wrapper"
1565
2025
  },
1566
2026
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1567
2027
  memoizedVisualization
1568
- );
2028
+ ));
1569
2029
  };
1570
2030
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1571
2031
 
@@ -1860,36 +2320,36 @@ var visualization_color_palettes_exports = {};
1860
2320
  __export(visualization_color_palettes_exports, {
1861
2321
  default: () => visualization_color_palettes_default
1862
2322
  });
1863
- var defaultImport27 = __toESM(require("@splunk/visualization-color-palettes"));
2323
+ var defaultImport28 = __toESM(require("@splunk/visualization-color-palettes"));
1864
2324
  __reExport(visualization_color_palettes_exports, require("@splunk/visualization-color-palettes"));
1865
- var visualization_color_palettes_default = "default" in defaultImport27 ? defaultImport27.default : defaultImport27;
2325
+ var visualization_color_palettes_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
1866
2326
 
1867
2327
  // esm-externals:d3-interpolate
1868
2328
  var d3_interpolate_exports = {};
1869
2329
  __export(d3_interpolate_exports, {
1870
2330
  default: () => d3_interpolate_default
1871
2331
  });
1872
- var defaultImport28 = __toESM(require("d3-interpolate"));
2332
+ var defaultImport29 = __toESM(require("d3-interpolate"));
1873
2333
  __reExport(d3_interpolate_exports, require("d3-interpolate"));
1874
- var d3_interpolate_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
2334
+ var d3_interpolate_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
1875
2335
 
1876
2336
  // esm-externals:d3-array
1877
2337
  var d3_array_exports = {};
1878
2338
  __export(d3_array_exports, {
1879
2339
  default: () => d3_array_default
1880
2340
  });
1881
- var defaultImport29 = __toESM(require("d3-array"));
2341
+ var defaultImport30 = __toESM(require("d3-array"));
1882
2342
  __reExport(d3_array_exports, require("d3-array"));
1883
- var d3_array_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
2343
+ var d3_array_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
1884
2344
 
1885
2345
  // esm-externals:d3-collection
1886
2346
  var d3_collection_exports = {};
1887
2347
  __export(d3_collection_exports, {
1888
2348
  default: () => d3_collection_default
1889
2349
  });
1890
- var defaultImport30 = __toESM(require("d3-collection"));
2350
+ var defaultImport31 = __toESM(require("d3-collection"));
1891
2351
  __reExport(d3_collection_exports, require("d3-collection"));
1892
- var d3_collection_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
2352
+ var d3_collection_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
1893
2353
 
1894
2354
  // src/Sankey/PureSankey/lib/sankey.js
1895
2355
  var d3_sankey = function() {
@@ -2275,18 +2735,18 @@ var d3_scale_exports = {};
2275
2735
  __export(d3_scale_exports, {
2276
2736
  default: () => d3_scale_default
2277
2737
  });
2278
- var defaultImport31 = __toESM(require("d3-scale"));
2738
+ var defaultImport32 = __toESM(require("d3-scale"));
2279
2739
  __reExport(d3_scale_exports, require("d3-scale"));
2280
- var d3_scale_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
2740
+ var d3_scale_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
2281
2741
 
2282
2742
  // esm-externals:@splunk/visualization-encoding/utils/types
2283
2743
  var types_exports = {};
2284
2744
  __export(types_exports, {
2285
2745
  default: () => types_default
2286
2746
  });
2287
- var defaultImport32 = __toESM(require("@splunk/visualization-encoding/utils/types"));
2747
+ var defaultImport33 = __toESM(require("@splunk/visualization-encoding/utils/types"));
2288
2748
  __reExport(types_exports, require("@splunk/visualization-encoding/utils/types"));
2289
- var types_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
2749
+ var types_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
2290
2750
 
2291
2751
  // src/Sankey/PureSankey/SankeyUtils.ts
2292
2752
  var insertNodeIfNotExist = (sankeyData, nodeName) => {
@@ -2707,9 +3167,9 @@ var Popover_exports = {};
2707
3167
  __export(Popover_exports, {
2708
3168
  default: () => Popover_default
2709
3169
  });
2710
- var defaultImport33 = __toESM(require("@splunk/react-ui/Popover"));
3170
+ var defaultImport34 = __toESM(require("@splunk/react-ui/Popover"));
2711
3171
  __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
2712
- var Popover_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
3172
+ var Popover_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
2713
3173
 
2714
3174
  // src/Sankey/PureSankey/SankeyTooltip.tsx
2715
3175
  var DEFAULT_PLACEMENT = "below";
@@ -3234,27 +3694,18 @@ var visualization_icons_exports = {};
3234
3694
  __export(visualization_icons_exports, {
3235
3695
  default: () => visualization_icons_default
3236
3696
  });
3237
- var defaultImport34 = __toESM(require("@splunk/visualization-icons"));
3697
+ var defaultImport35 = __toESM(require("@splunk/visualization-icons"));
3238
3698
  __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
3239
- var visualization_icons_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
3699
+ var visualization_icons_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3240
3700
 
3241
3701
  // esm-externals:@splunk/visualization-icons/placeholders
3242
3702
  var placeholders_exports = {};
3243
3703
  __export(placeholders_exports, {
3244
3704
  default: () => placeholders_default
3245
3705
  });
3246
- var defaultImport35 = __toESM(require("@splunk/visualization-icons/placeholders"));
3706
+ var defaultImport36 = __toESM(require("@splunk/visualization-icons/placeholders"));
3247
3707
  __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
3248
- var placeholders_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
3249
-
3250
- // esm-externals:@splunk/visualization-schemas
3251
- var visualization_schemas_exports = {};
3252
- __export(visualization_schemas_exports, {
3253
- default: () => visualization_schemas_default
3254
- });
3255
- var defaultImport36 = __toESM(require("@splunk/visualization-schemas"));
3256
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
3257
- var visualization_schemas_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3708
+ var placeholders_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
3258
3709
 
3259
3710
  // esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
3260
3711
  var PresetPalettes_exports = {};