@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/Markdown.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 });
@@ -548,7 +560,7 @@ var Cover = styled_components_default.div`
548
560
  bottom: 0;
549
561
  `;
550
562
  var Blocker = styled_components_default.div.attrs({
551
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
563
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
552
564
  })`
553
565
  position: relative;
554
566
  width: 100%;
@@ -638,7 +650,7 @@ var withFixedSizeContainer = (Viz) => {
638
650
  FixSizeItem,
639
651
  {
640
652
  "data-test": "fix-size-item",
641
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
653
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
642
654
  width,
643
655
  height,
644
656
  backgroundColor
@@ -734,6 +746,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
734
746
  var numberUtils_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
735
747
 
736
748
  // src/common/utils/dataUtils.ts
749
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
737
750
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
738
751
  const dataLength = data.length;
739
752
  const downsampledIndices = [];
@@ -850,9 +863,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
850
863
  let xColumn = [];
851
864
  const yColumns = [];
852
865
  const canDownsample = !ds.data.fields.some((field, index) => {
853
- var _a, _b;
854
- const fieldName = (_a = field.name) != null ? _a : field;
855
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
866
+ var _a;
867
+ const fieldName = getFieldName(field);
868
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
856
869
  const column = ds.data.columns[index];
857
870
  let hasDisplayedColumnThatCantBeDownsampled = false;
858
871
  if (fieldName === xField) {
@@ -1205,6 +1218,16 @@ var triangleEventAnnotationRenderer = ({
1205
1218
  eventColor: eventWithColor.color
1206
1219
  });
1207
1220
  };
1221
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1222
+ const rangeSelectEventHandler = eventHandlers.find(
1223
+ (eventHandler) => {
1224
+ var _a;
1225
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1226
+ }
1227
+ );
1228
+ const xAxisIsTime = xField === "_time";
1229
+ return !!rangeSelectEventHandler && xAxisIsTime;
1230
+ };
1208
1231
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1209
1232
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1210
1233
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1225,16 +1248,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1225
1248
  var convert2DArrayToNumbers = (arr) => {
1226
1249
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1227
1250
  };
1251
+ var parseAxisValue = (val) => {
1252
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1253
+ return void 0;
1254
+ }
1255
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1256
+ return Number.isNaN(num) ? void 0 : num;
1257
+ };
1228
1258
  var SideLegendWidth = 75;
1229
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1259
+ var SeriesCompareLegendWidth = 200;
1230
1260
  var getLegend = (props) => {
1231
1261
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1262
+ const { isSeriesCompare } = props;
1263
+ const commonLegendProps = {
1264
+ center: true,
1265
+ fontSize: 12,
1266
+ largerTiles: true,
1267
+ hideSeriesValue: !isSeriesCompare
1268
+ // Show values if in seriesCompare mode
1269
+ };
1232
1270
  switch (legendPlacement) {
1233
1271
  case "off":
1234
1272
  return false;
1235
1273
  case "left":
1236
1274
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1237
- width: SideLegendWidth
1275
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1238
1276
  }, commonLegendProps));
1239
1277
  case "bottom":
1240
1278
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1246,7 +1284,7 @@ var getLegend = (props) => {
1246
1284
  }, commonLegendProps));
1247
1285
  default:
1248
1286
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1249
- width: SideLegendWidth
1287
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1250
1288
  }, commonLegendProps));
1251
1289
  }
1252
1290
  };
@@ -1282,22 +1320,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1282
1320
  const end = axisTitle.slice(-halfChars);
1283
1321
  return `${start}...${end}`;
1284
1322
  };
1285
- var getFieldName = (field) => {
1323
+ var getFieldName2 = (field) => {
1286
1324
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1287
1325
  return fieldName;
1288
1326
  };
1289
1327
  var getFieldNames = (fields) => {
1290
- return fields.map((field) => getFieldName(field));
1328
+ return fields.map((field) => getFieldName2(field));
1291
1329
  };
1292
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1330
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1293
1331
  const xConfig = { x: {} };
1294
1332
  xConfig.x.label = label;
1295
1333
  if (xAxisLabelVisibility === "hide") {
1296
1334
  xConfig.x.hideLabels = true;
1297
1335
  }
1336
+ if (xAxisLabelRotation !== void 0) {
1337
+ xConfig.x.labelRotation = xAxisLabelRotation;
1338
+ }
1298
1339
  return xConfig;
1299
1340
  };
1300
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1341
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1301
1342
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1302
1343
  const yConfig = { y: {} };
1303
1344
  yConfig.y.label = label;
@@ -1313,14 +1354,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1313
1354
  if (yAxisLabelVisibility === "hide") {
1314
1355
  yConfig.y.hideLabels = true;
1315
1356
  }
1357
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1358
+ yConfig.y.range = (u, dataMin, dataMax) => {
1359
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1360
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1361
+ return [min, max];
1362
+ };
1363
+ }
1316
1364
  return yConfig;
1317
1365
  };
1318
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1366
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1319
1367
  const y2Config = { y2: {} };
1320
1368
  const scaleType = axisScale != null ? axisScale : "linear";
1321
1369
  y2Config.y2.label = label;
1322
1370
  y2Config.y2.side = "right";
1323
- y2Config.y2.showGrid = false;
1324
1371
  y2Config.y2.type = scaleType;
1325
1372
  if (axisAbbreviation !== "none") {
1326
1373
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1330,9 +1377,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1330
1377
  if (y2AxisLabelVisibility === "hide") {
1331
1378
  y2Config.y2.hideLabels = true;
1332
1379
  }
1380
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1381
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1382
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1383
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1384
+ return [min, max];
1385
+ };
1386
+ }
1333
1387
  return y2Config;
1334
1388
  };
1335
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1389
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1336
1390
  const seriesConfig = {};
1337
1391
  let spanGaps;
1338
1392
  let replaceNullsWithZero;
@@ -1367,12 +1421,96 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1367
1421
  if (markerDisplay !== void 0) {
1368
1422
  seriesConfig[field].markerDisplay = markerDisplay;
1369
1423
  }
1424
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1425
+ if (fieldDashStyle) {
1426
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1427
+ }
1370
1428
  if (replaceNullsWithZero !== void 0) {
1371
1429
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1372
1430
  }
1373
1431
  });
1374
1432
  return seriesConfig;
1375
1433
  };
1434
+ var findRangeIndices = (xData, startValue, endValue) => {
1435
+ let startXIndex = -1;
1436
+ let endXIndex = -1;
1437
+ const xDataEpoch = xData.map((val) => {
1438
+ if (typeof val === "string") {
1439
+ return new Date(val).getTime() / 1e3;
1440
+ }
1441
+ return val;
1442
+ });
1443
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1444
+ if (xDataEpoch[i] >= startValue) {
1445
+ startXIndex = i;
1446
+ break;
1447
+ }
1448
+ }
1449
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1450
+ startXIndex = xDataEpoch.length - 1;
1451
+ }
1452
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1453
+ if (xDataEpoch[i] <= endValue) {
1454
+ endXIndex = i;
1455
+ break;
1456
+ }
1457
+ }
1458
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1459
+ endXIndex = 0;
1460
+ }
1461
+ return { startXIndex, endXIndex };
1462
+ };
1463
+
1464
+ // esm-externals:@splunk/visualization-schemas
1465
+ var visualization_schemas_exports = {};
1466
+ __export(visualization_schemas_exports, {
1467
+ default: () => visualization_schemas_default
1468
+ });
1469
+ var defaultImport34 = __toESM(require("@splunk/visualization-schemas"));
1470
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1471
+ var visualization_schemas_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
1472
+
1473
+ // src/common/hooks/useTrellisEnabled.ts
1474
+ var useTrellisFeatureFlagOn = () => {
1475
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1476
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1477
+ };
1478
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1479
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1480
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1481
+ };
1482
+
1483
+ // src/common/components/TrellisTitle.tsx
1484
+ var TRELLIS_TITLE_HEIGHT = 28;
1485
+ var TrellisTitleText = styled_components_default.div`
1486
+ margin-left: 10px;
1487
+ margin-right: 10px;
1488
+ padding-top: 8px;
1489
+ text-overflow: ellipsis;
1490
+ white-space: nowrap;
1491
+ overflow: hidden;
1492
+ `;
1493
+ var TrellisTitleDiv = styled_components_default.div`
1494
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1495
+ font-size: 14px;
1496
+ font-weight: 700;
1497
+ color: ${(props) => props.fontColor};
1498
+ background-color: ${(props) => props.backgroundColor};
1499
+ 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.
1500
+ `;
1501
+ var TrellisTitle = (props) => {
1502
+ const titleText = String(props.trellisKey).toString();
1503
+ return /* @__PURE__ */ react_exports.createElement(
1504
+ TrellisTitleDiv,
1505
+ {
1506
+ fontColor: props.fontColor,
1507
+ backgroundColor: props.backgroundColor,
1508
+ "data-test": "trellis-title",
1509
+ title: titleText
1510
+ },
1511
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1512
+ );
1513
+ };
1376
1514
 
1377
1515
  // src/common/TimeSeriesChartWrapper.tsx
1378
1516
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1383,38 +1521,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1383
1521
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1384
1522
  }
1385
1523
  `;
1386
- var handleClick = (chartEvent, onClick) => {
1524
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1525
+ const result = __spreadValues({}, payload);
1526
+ if (trellisSplitBy) {
1527
+ result["trellis.name"] = trellisSplitBy;
1528
+ }
1529
+ if (trellisKey) {
1530
+ result["trellis.value"] = trellisKey;
1531
+ }
1532
+ return result;
1533
+ };
1534
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1535
+ if (!previousPayload) {
1536
+ return true;
1537
+ }
1538
+ if (currentPayload.index !== previousPayload.index) {
1539
+ return true;
1540
+ }
1541
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1542
+ return true;
1543
+ }
1544
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1545
+ return true;
1546
+ }
1547
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1548
+ return true;
1549
+ }
1550
+ return false;
1551
+ };
1552
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1387
1553
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1388
1554
  name: chartEvent.seriesKey
1389
1555
  });
1390
1556
  delete payload.seriesKey;
1391
1557
  if (chartEvent.rowContext) {
1392
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1393
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1394
- });
1558
+ Object.assign(
1559
+ payload,
1560
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1561
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1562
+ return acc;
1563
+ }, {})
1564
+ );
1395
1565
  }
1566
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1396
1567
  if (onClick) {
1397
1568
  onClick({
1398
1569
  type: "point.click",
1399
1570
  originalEvent: chartEvent,
1400
- payload
1571
+ payload: updatedPayload
1401
1572
  });
1402
1573
  }
1403
1574
  };
1404
- var handleLegendClick = (chartEvent, onClick) => {
1575
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1405
1576
  const payload = {
1406
1577
  name: chartEvent
1407
1578
  };
1579
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1408
1580
  if (onClick) {
1409
1581
  onClick({
1410
1582
  type: "legend.click",
1411
1583
  originalEvent: chartEvent,
1412
- payload
1584
+ payload: updatedPayload
1413
1585
  });
1414
1586
  }
1415
1587
  };
1588
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1589
+ var _a;
1590
+ if (!rangeEvent) {
1591
+ return;
1592
+ }
1593
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1594
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1595
+ const payload = {
1596
+ startXIndex,
1597
+ startXValue: rangeEvent.start,
1598
+ endXIndex,
1599
+ endXValue: rangeEvent.end
1600
+ };
1601
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1602
+ if (onSelect) {
1603
+ onSelect({
1604
+ type: "range.selectBeforeZoom",
1605
+ originalEvent: rangeEvent,
1606
+ payload: updatedPayload
1607
+ });
1608
+ }
1609
+ };
1610
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1611
+ var _a;
1612
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1613
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1614
+ const payload = {
1615
+ startXIndex,
1616
+ startXValue: rangeEvent.start,
1617
+ endXIndex,
1618
+ endXValue: rangeEvent.end
1619
+ };
1620
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1621
+ if (onSelect) {
1622
+ onSelect({
1623
+ type: "range.select",
1624
+ originalEvent: rangeEvent,
1625
+ payload: updatedPayload
1626
+ });
1627
+ }
1628
+ };
1629
+ var parseArrayOption = (value) => {
1630
+ if (Array.isArray(value)) {
1631
+ return value;
1632
+ }
1633
+ if (value) {
1634
+ return JSON.parse(value);
1635
+ }
1636
+ return void 0;
1637
+ };
1416
1638
  var TimeSeriesChartWrapper = (props) => {
1417
- const {
1639
+ var _b, _c, _d;
1640
+ const _a = props, {
1418
1641
  width,
1419
1642
  height,
1420
1643
  chartData,
@@ -1427,12 +1650,49 @@ var TimeSeriesChartWrapper = (props) => {
1427
1650
  markerDisplay,
1428
1651
  onClick,
1429
1652
  onPointMouseOver,
1430
- onPointMouseOut
1431
- } = props;
1432
- const {
1653
+ onPointMouseOut,
1654
+ onSelect,
1655
+ splitByLayout,
1656
+ trellisKey,
1657
+ trellisSplitBy,
1433
1658
  backgroundColor,
1659
+ defaultFontColor,
1660
+ additionalTooltipValues,
1661
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1662
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1663
+ } = _a, otherOptions = __objRest(_a, [
1664
+ "width",
1665
+ "height",
1666
+ "chartData",
1667
+ "options",
1668
+ "userLocale",
1669
+ "annotationX",
1670
+ "annotationLabel",
1671
+ "annotationColor",
1672
+ "legendDisplay",
1673
+ "markerDisplay",
1674
+ "onClick",
1675
+ "onPointMouseOver",
1676
+ "onPointMouseOut",
1677
+ "onSelect",
1678
+ "splitByLayout",
1679
+ "trellisKey",
1680
+ "trellisSplitBy",
1681
+ "backgroundColor",
1682
+ "defaultFontColor",
1683
+ "additionalTooltipValues",
1684
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1685
+ "showYAxisWithZero",
1686
+ "showY2AxisWithZero"
1687
+ ]);
1688
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1689
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1690
+ const {
1691
+ backgroundColor: bgColorFromOptions,
1434
1692
  seriesColors: seriesColorsStr,
1435
1693
  fieldColors,
1694
+ legendLabels: legendLabelsStr,
1695
+ legendMode,
1436
1696
  "axisTitleX.text": xAxisTitleText,
1437
1697
  "axisTitleY.text": yAxisTitleText,
1438
1698
  "axisTitleY2.text": y2AxisTitleText,
@@ -1440,8 +1700,11 @@ var TimeSeriesChartWrapper = (props) => {
1440
1700
  "axisTitleY.visibility": yAxisTitleVisibility,
1441
1701
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1442
1702
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1703
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1443
1704
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1705
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1444
1706
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1707
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1445
1708
  "axisY.abbreviation": yAxisAbbreviation,
1446
1709
  "axisY.scale": yAxisScale,
1447
1710
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1451,10 +1714,63 @@ var TimeSeriesChartWrapper = (props) => {
1451
1714
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1452
1715
  "chart.overlayFields": overlayFieldsStr,
1453
1716
  "chart.nullValueMode": nullValueMode,
1454
- lineWidth
1717
+ "chart.showDataLabels": showDataLabels,
1718
+ lineWidth,
1719
+ lineDashStyle,
1720
+ fieldDashStyles: lineDashStylesByFieldStr,
1721
+ yAxisMin: yAxisMinRaw,
1722
+ yAxisMax: yAxisMaxRaw,
1723
+ y2AxisMin: y2AxisMinRaw,
1724
+ y2AxisMax: y2AxisMaxRaw,
1725
+ showXMajorGridLines,
1726
+ showYMajorGridLines,
1727
+ showY2MajorGridLines,
1728
+ showYMinorGridLines,
1729
+ showY2MinorGridLines,
1730
+ showLineSmoothing,
1731
+ yAxisMajorTickVisibility,
1732
+ y2AxisMajorTickVisibility,
1733
+ yAxisMajorTickSize,
1734
+ y2AxisMajorTickSize,
1735
+ yAxisMajorTickInterval,
1736
+ y2AxisMajorTickInterval,
1737
+ yAxisMinorTickVisibility,
1738
+ y2AxisMinorTickVisibility,
1739
+ yAxisMinorTickSize,
1740
+ y2AxisMinorTickSize,
1741
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1742
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1455
1743
  } = options;
1744
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1745
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1746
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1747
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1748
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1749
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1750
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1751
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1752
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1753
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1754
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1755
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1756
+ if (simpleXMLValue) return Number(simpleXMLValue);
1757
+ if (canvasValue) return Number(canvasValue);
1758
+ return void 0;
1759
+ };
1760
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1761
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1762
+ y2AxisMajorUnitFromSimpleXML,
1763
+ y2AxisMajorTickInterval
1764
+ );
1765
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
1766
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
1767
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
1768
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
1456
1769
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1457
1770
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1771
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1772
+ const legendLabels = parseArrayOption(legendLabelsStr);
1773
+ const bgColor = backgroundColor || bgColorFromOptions;
1458
1774
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1459
1775
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1460
1776
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1465,31 +1781,64 @@ var TimeSeriesChartWrapper = (props) => {
1465
1781
  fields: chartData.fields,
1466
1782
  columns: chartData.seriesList
1467
1783
  });
1468
- const xField = getFieldName(filteredChartData.fields[0]);
1784
+ const xField = getFieldName2(filteredChartData.fields[0]);
1469
1785
  const yFields = getFieldNames(
1470
1786
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1471
1787
  );
1472
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1473
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1788
+ const y2Fields = (0, react_exports.useMemo)(
1789
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1790
+ [y2FieldsStr]
1791
+ );
1792
+ const overlayFields = (0, react_exports.useMemo)(
1793
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1794
+ [overlayFieldsStr]
1795
+ );
1474
1796
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1475
1797
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1476
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1798
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1799
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1477
1800
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1478
1801
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1479
1802
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1480
1803
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1481
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1482
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1483
- let y2ScaleConfig = {};
1484
- if (y2Enabled) {
1485
- y2ScaleConfig = getY2ScaleConfig(
1486
- y2AxisTitle,
1487
- y2AxisAbbreviation,
1488
- y2AxisScale,
1489
- y2IntegerUnits,
1490
- y2AxisLabelVisibility
1491
- );
1492
- }
1804
+ const xScaleConfig = (0, react_exports.useMemo)(
1805
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1806
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1807
+ );
1808
+ const yScaleConfig = (0, react_exports.useMemo)(
1809
+ () => getYScaleConfig(
1810
+ yAxisTitle,
1811
+ yAxisAbbreviation,
1812
+ yAxisScale,
1813
+ yAxisLabelVisibility,
1814
+ yAxisMin,
1815
+ yAxisMax
1816
+ ),
1817
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1818
+ );
1819
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1820
+ if (y2Enabled) {
1821
+ return getY2ScaleConfig(
1822
+ y2AxisTitle,
1823
+ y2AxisAbbreviation,
1824
+ y2AxisScale,
1825
+ y2IntegerUnits,
1826
+ y2AxisLabelVisibility,
1827
+ y2AxisMin,
1828
+ y2AxisMax
1829
+ );
1830
+ }
1831
+ return {};
1832
+ }, [
1833
+ y2Enabled,
1834
+ y2AxisTitle,
1835
+ y2AxisAbbreviation,
1836
+ y2AxisScale,
1837
+ y2IntegerUnits,
1838
+ y2AxisLabelVisibility,
1839
+ y2AxisMin,
1840
+ y2AxisMax
1841
+ ]);
1493
1842
  const uplotContainerElement = (0, react_exports.useRef)(null);
1494
1843
  const seriesDataFormatted = [
1495
1844
  filteredChartData.columns[0],
@@ -1505,9 +1854,21 @@ var TimeSeriesChartWrapper = (props) => {
1505
1854
  overlayFields,
1506
1855
  y2Enabled,
1507
1856
  nullValueMode,
1508
- markerDisplay
1857
+ markerDisplay,
1858
+ lineDashStyle,
1859
+ lineDashStylesByField
1509
1860
  ),
1510
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1861
+ [
1862
+ yFields,
1863
+ y2Fields,
1864
+ lineWidth,
1865
+ overlayFields,
1866
+ y2Enabled,
1867
+ nullValueMode,
1868
+ markerDisplay,
1869
+ lineDashStyle,
1870
+ lineDashStylesByField
1871
+ ]
1511
1872
  );
1512
1873
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1513
1874
  () => getAnnotationsForCanvas({
@@ -1521,25 +1882,54 @@ var TimeSeriesChartWrapper = (props) => {
1521
1882
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1522
1883
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1523
1884
  );
1524
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1885
+ const legend = (0, react_exports.useMemo)(
1886
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
1887
+ [legendDisplay, legendMode]
1888
+ );
1525
1889
  const handleChartClick = react_exports.useCallback(
1526
1890
  (event) => {
1527
1891
  if (onClick) {
1528
- handleClick(event, onClick);
1892
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1529
1893
  }
1530
1894
  },
1531
- [onClick]
1895
+ [onClick, trellisKey, trellisSplitBy]
1532
1896
  );
1533
1897
  const handleChartLegendClick = react_exports.useCallback(
1534
1898
  (event) => {
1535
1899
  if (onClick) {
1536
- handleLegendClick(event, onClick);
1900
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1901
+ }
1902
+ },
1903
+ [onClick, trellisKey, trellisSplitBy]
1904
+ );
1905
+ const handleChartRangeSelection = react_exports.useCallback(
1906
+ (range2) => {
1907
+ if (onSelect) {
1908
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1537
1909
  }
1538
1910
  },
1539
- [onClick]
1911
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1912
+ );
1913
+ const handleChartRangeZoom = react_exports.useCallback(
1914
+ (range2) => {
1915
+ if (onSelect) {
1916
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1917
+ }
1918
+ },
1919
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1920
+ );
1921
+ const xFieldToUse = xFieldFromProps || xField;
1922
+ const enableSearchZoom = react_exports.useMemo(
1923
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1924
+ [eventHandlers, xFieldToUse]
1540
1925
  );
1541
1926
  const lastPayloadRef = react_exports.useRef(null);
1542
1927
  const lastOriginalEventRef = react_exports.useRef(null);
1928
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1929
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1930
+ react_exports.useEffect(() => {
1931
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1932
+ }, [additionalTooltipValues]);
1543
1933
  const handleChartCrosshairChange = react_exports.useCallback(
1544
1934
  (event) => {
1545
1935
  if (onPointMouseOver || onPointMouseOut) {
@@ -1551,6 +1941,7 @@ var TimeSeriesChartWrapper = (props) => {
1551
1941
  payload: lastPayloadRef.current
1552
1942
  });
1553
1943
  }
1944
+ previousMouseoverPayloadRef.current = null;
1554
1945
  return;
1555
1946
  }
1556
1947
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1558,25 +1949,36 @@ var TimeSeriesChartWrapper = (props) => {
1558
1949
  });
1559
1950
  delete payload.seriesKey;
1560
1951
  if (event.rowContext) {
1561
- Object.keys(event.rowContext).forEach((fieldName) => {
1562
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1563
- });
1952
+ Object.assign(
1953
+ payload,
1954
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1955
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1956
+ return acc;
1957
+ }, {})
1958
+ );
1959
+ }
1960
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1961
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1962
+ return;
1564
1963
  }
1565
- lastPayloadRef.current = payload;
1964
+ lastPayloadRef.current = updatedPayload;
1566
1965
  lastOriginalEventRef.current = event;
1966
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1567
1967
  if (onPointMouseOver) {
1568
1968
  onPointMouseOver({
1569
1969
  type: "point.mouseover",
1570
1970
  originalEvent: event,
1571
- payload
1971
+ payload: updatedPayload
1572
1972
  });
1573
1973
  }
1574
1974
  }
1575
1975
  },
1576
- [onPointMouseOver, onPointMouseOut]
1976
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1577
1977
  );
1578
- const memoizedChart = (0, react_exports.useMemo)(
1579
- () => /* @__PURE__ */ react_exports.createElement(
1978
+ 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}`;
1979
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1980
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1981
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1580
1982
  visualization_canvas_exports.TimeSeriesChart,
1581
1983
  {
1582
1984
  data: chartData,
@@ -1586,49 +1988,107 @@ var TimeSeriesChartWrapper = (props) => {
1586
1988
  seriesColorsByField,
1587
1989
  seriesConfig: seriesOverrides,
1588
1990
  legend,
1991
+ legendLabels,
1992
+ isSeriesCompare: legendMode === "seriesCompare",
1993
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1589
1994
  scaleConfig,
1590
1995
  timestampFormat: "expanded",
1591
1996
  onCrosshairClick: onClick ? handleChartClick : void 0,
1592
1997
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1593
1998
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1999
+ onRangeSelection: handleChartRangeSelection,
2000
+ onRangeZoom: computedOnRangeZoom,
2001
+ serverSideZoom: enableSearchZoom,
1594
2002
  userLocale,
1595
2003
  events: chartingEventAnnotations,
1596
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
2004
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
2005
+ additionalTooltipValuesRef,
2006
+ showXMajorGridLines,
2007
+ showYMajorGridLines,
2008
+ showY2MajorGridLines,
2009
+ showYMinorGridLines,
2010
+ showY2MinorGridLines,
2011
+ showLineSmoothing,
2012
+ dataValuesDisplay,
2013
+ showYMajorTicks,
2014
+ showY2MajorTicks,
2015
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2016
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2017
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2018
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2019
+ showYMinorTicks,
2020
+ showY2MinorTicks,
2021
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2022
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2023
+ showYAxisWithZero,
2024
+ showY2AxisWithZero
1597
2025
  }
1598
- ),
1599
- [
1600
- chartData,
1601
- containerWidth,
1602
- containerHeight,
1603
- seriesColors,
1604
- seriesColorsByField,
1605
- seriesOverrides,
1606
- legend,
1607
- scaleConfig,
1608
- userLocale,
1609
- chartingEventAnnotations,
1610
- onClick,
1611
- handleChartClick,
1612
- onPointMouseOver,
1613
- onPointMouseOut,
1614
- handleChartCrosshairChange,
1615
- handleChartLegendClick
1616
- ]
1617
- );
2026
+ ));
2027
+ }, [
2028
+ onSelect,
2029
+ handleChartRangeZoom,
2030
+ dataKey,
2031
+ chartData,
2032
+ containerWidth,
2033
+ containerHeight,
2034
+ seriesColors,
2035
+ seriesColorsByField,
2036
+ seriesOverrides,
2037
+ legend,
2038
+ legendLabels,
2039
+ scaleConfig,
2040
+ onClick,
2041
+ handleChartClick,
2042
+ onPointMouseOver,
2043
+ onPointMouseOut,
2044
+ handleChartCrosshairChange,
2045
+ handleChartLegendClick,
2046
+ handleChartRangeSelection,
2047
+ enableSearchZoom,
2048
+ userLocale,
2049
+ chartingEventAnnotations,
2050
+ showXMajorGridLines,
2051
+ showYMajorGridLines,
2052
+ showY2MajorGridLines,
2053
+ showYMinorGridLines,
2054
+ showY2MinorGridLines,
2055
+ showLineSmoothing,
2056
+ dataValuesDisplay,
2057
+ showYMajorTicks,
2058
+ showY2MajorTicks,
2059
+ yAxisMajorTickSizeNum,
2060
+ y2AxisMajorTickSizeNum,
2061
+ yAxisMajorTickIntervalNum,
2062
+ y2AxisMajorTickIntervalNum,
2063
+ showYMinorTicks,
2064
+ showY2MinorTicks,
2065
+ yAxisMinorTickSizeNum,
2066
+ y2AxisMinorTickSizeNum,
2067
+ showYAxisWithZero,
2068
+ showY2AxisWithZero,
2069
+ legendMode
2070
+ ]);
1618
2071
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1619
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1620
- }, [backgroundColor, memoizedChart]);
1621
- return /* @__PURE__ */ react_exports.createElement(
2072
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2073
+ }, [bgColor, memoizedChart]);
2074
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2075
+ TrellisTitle,
2076
+ {
2077
+ trellisKey,
2078
+ backgroundColor: bgColor,
2079
+ fontColor: defaultFontColor
2080
+ }
2081
+ ), /* @__PURE__ */ react_exports.createElement(
1622
2082
  TimeSeriesChartContainer,
1623
2083
  {
1624
- height,
2084
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1625
2085
  width,
1626
2086
  ref: uplotContainerElement,
1627
2087
  "data-test": "timeseries-chart-wrapper"
1628
2088
  },
1629
2089
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1630
2090
  memoizedVisualization
1631
- );
2091
+ ));
1632
2092
  };
1633
2093
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1634
2094
 
@@ -1918,15 +2378,6 @@ var withDashboardViz = (opts) => {
1918
2378
  };
1919
2379
  var withDashboardViz_default = withDashboardViz;
1920
2380
 
1921
- // esm-externals:@splunk/visualization-schemas
1922
- var visualization_schemas_exports = {};
1923
- __export(visualization_schemas_exports, {
1924
- default: () => visualization_schemas_default
1925
- });
1926
- var defaultImport34 = __toESM(require("@splunk/visualization-schemas"));
1927
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1928
- var visualization_schemas_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
1929
-
1930
2381
  // esm-externals:@splunk/visualizations-shared/configUtils
1931
2382
  var configUtils_exports = {};
1932
2383
  __export(configUtils_exports, {
@@ -2313,7 +2764,6 @@ var MarkdownVisualization = ({
2313
2764
  hasEventHandlers = false,
2314
2765
  onMarkdownClick = lodash_exports.noop
2315
2766
  }) => {
2316
- var _a;
2317
2767
  const { fontFamily: defaultFontFamily } = (0, themes_exports.useSplunkTheme)();
2318
2768
  const markdownContentFontFamilyStyle = {
2319
2769
  fontFamily: `${fontFamily}, ${defaultFontFamily}`
@@ -2324,6 +2774,9 @@ var MarkdownVisualization = ({
2324
2774
  fontSize,
2325
2775
  customFontSize
2326
2776
  );
2777
+ const trimmedMarkdown = stringifiedMarkdown.trim();
2778
+ const headerMatch = /^#+/.exec(trimmedMarkdown);
2779
+ const headerLength = headerMatch ? headerMatch[0].length : void 0;
2327
2780
  return /* @__PURE__ */ react_exports.createElement(
2328
2781
  MarkdownContainer,
2329
2782
  {
@@ -2334,7 +2787,7 @@ var MarkdownVisualization = ({
2334
2787
  rotation,
2335
2788
  backgroundColor,
2336
2789
  fontColor,
2337
- startsWithHeader: (_a = stringifiedMarkdown.trim().match(/^#+/)) == null ? void 0 : _a[0].length
2790
+ startsWithHeader: headerLength
2338
2791
  },
2339
2792
  hasEventHandlers && /* @__PURE__ */ react_exports.createElement(StyledButton, { onClick: onMarkdownClick, appearance: "secondary" }, "Drilldown"),
2340
2793
  /* @__PURE__ */ react_exports.createElement(