@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/Rectangle.js CHANGED
@@ -476,7 +476,7 @@ var Cover = styled_components_default.div`
476
476
  bottom: 0;
477
477
  `;
478
478
  var Blocker = styled_components_default.div.attrs({
479
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
479
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
480
480
  })`
481
481
  position: relative;
482
482
  width: 100%;
@@ -575,7 +575,7 @@ var withFixedSizeContainer = (Viz) => {
575
575
  FixSizeItem,
576
576
  {
577
577
  "data-test": "fix-size-item",
578
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
578
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
579
579
  width,
580
580
  height,
581
581
  backgroundColor
@@ -671,6 +671,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
671
671
  var numberUtils_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
672
672
 
673
673
  // src/common/utils/dataUtils.ts
674
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
674
675
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
675
676
  const dataLength = data.length;
676
677
  const downsampledIndices = [];
@@ -787,9 +788,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
787
788
  let xColumn = [];
788
789
  const yColumns = [];
789
790
  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";
791
+ var _a;
792
+ const fieldName = getFieldName(field);
793
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
793
794
  const column = ds.data.columns[index];
794
795
  let hasDisplayedColumnThatCantBeDownsampled = false;
795
796
  if (fieldName === xField) {
@@ -1142,6 +1143,16 @@ var triangleEventAnnotationRenderer = ({
1142
1143
  eventColor: eventWithColor.color
1143
1144
  });
1144
1145
  };
1146
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1147
+ const rangeSelectEventHandler = eventHandlers.find(
1148
+ (eventHandler) => {
1149
+ var _a;
1150
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1151
+ }
1152
+ );
1153
+ const xAxisIsTime = xField === "_time";
1154
+ return !!rangeSelectEventHandler && xAxisIsTime;
1155
+ };
1145
1156
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1146
1157
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1147
1158
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1162,16 +1173,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1162
1173
  var convert2DArrayToNumbers = (arr) => {
1163
1174
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1164
1175
  };
1176
+ var parseAxisValue = (val) => {
1177
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1178
+ return void 0;
1179
+ }
1180
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1181
+ return Number.isNaN(num) ? void 0 : num;
1182
+ };
1165
1183
  var SideLegendWidth = 75;
1166
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1184
+ var SeriesCompareLegendWidth = 200;
1167
1185
  var getLegend = (props) => {
1168
1186
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1187
+ const { isSeriesCompare } = props;
1188
+ const commonLegendProps = {
1189
+ center: true,
1190
+ fontSize: 12,
1191
+ largerTiles: true,
1192
+ hideSeriesValue: !isSeriesCompare
1193
+ // Show values if in seriesCompare mode
1194
+ };
1169
1195
  switch (legendPlacement) {
1170
1196
  case "off":
1171
1197
  return false;
1172
1198
  case "left":
1173
1199
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1174
- width: SideLegendWidth
1200
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1175
1201
  }, commonLegendProps));
1176
1202
  case "bottom":
1177
1203
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1183,7 +1209,7 @@ var getLegend = (props) => {
1183
1209
  }, commonLegendProps));
1184
1210
  default:
1185
1211
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1186
- width: SideLegendWidth
1212
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1187
1213
  }, commonLegendProps));
1188
1214
  }
1189
1215
  };
@@ -1219,22 +1245,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1219
1245
  const end = axisTitle.slice(-halfChars);
1220
1246
  return `${start}...${end}`;
1221
1247
  };
1222
- var getFieldName = (field) => {
1248
+ var getFieldName2 = (field) => {
1223
1249
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1224
1250
  return fieldName;
1225
1251
  };
1226
1252
  var getFieldNames = (fields) => {
1227
- return fields.map((field) => getFieldName(field));
1253
+ return fields.map((field) => getFieldName2(field));
1228
1254
  };
1229
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1255
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1230
1256
  const xConfig = { x: {} };
1231
1257
  xConfig.x.label = label;
1232
1258
  if (xAxisLabelVisibility === "hide") {
1233
1259
  xConfig.x.hideLabels = true;
1234
1260
  }
1261
+ if (xAxisLabelRotation !== void 0) {
1262
+ xConfig.x.labelRotation = xAxisLabelRotation;
1263
+ }
1235
1264
  return xConfig;
1236
1265
  };
1237
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1266
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1238
1267
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1239
1268
  const yConfig = { y: {} };
1240
1269
  yConfig.y.label = label;
@@ -1250,14 +1279,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1250
1279
  if (yAxisLabelVisibility === "hide") {
1251
1280
  yConfig.y.hideLabels = true;
1252
1281
  }
1282
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1283
+ yConfig.y.range = (u, dataMin, dataMax) => {
1284
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1285
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1286
+ return [min, max];
1287
+ };
1288
+ }
1253
1289
  return yConfig;
1254
1290
  };
1255
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1291
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1256
1292
  const y2Config = { y2: {} };
1257
1293
  const scaleType = axisScale != null ? axisScale : "linear";
1258
1294
  y2Config.y2.label = label;
1259
1295
  y2Config.y2.side = "right";
1260
- y2Config.y2.showGrid = false;
1261
1296
  y2Config.y2.type = scaleType;
1262
1297
  if (axisAbbreviation !== "none") {
1263
1298
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1267,9 +1302,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1267
1302
  if (y2AxisLabelVisibility === "hide") {
1268
1303
  y2Config.y2.hideLabels = true;
1269
1304
  }
1305
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1306
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1307
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1308
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1309
+ return [min, max];
1310
+ };
1311
+ }
1270
1312
  return y2Config;
1271
1313
  };
1272
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1314
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1273
1315
  const seriesConfig = {};
1274
1316
  let spanGaps;
1275
1317
  let replaceNullsWithZero;
@@ -1304,12 +1346,96 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1304
1346
  if (markerDisplay !== void 0) {
1305
1347
  seriesConfig[field].markerDisplay = markerDisplay;
1306
1348
  }
1349
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1350
+ if (fieldDashStyle) {
1351
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1352
+ }
1307
1353
  if (replaceNullsWithZero !== void 0) {
1308
1354
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1309
1355
  }
1310
1356
  });
1311
1357
  return seriesConfig;
1312
1358
  };
1359
+ var findRangeIndices = (xData, startValue, endValue) => {
1360
+ let startXIndex = -1;
1361
+ let endXIndex = -1;
1362
+ const xDataEpoch = xData.map((val) => {
1363
+ if (typeof val === "string") {
1364
+ return new Date(val).getTime() / 1e3;
1365
+ }
1366
+ return val;
1367
+ });
1368
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1369
+ if (xDataEpoch[i] >= startValue) {
1370
+ startXIndex = i;
1371
+ break;
1372
+ }
1373
+ }
1374
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1375
+ startXIndex = xDataEpoch.length - 1;
1376
+ }
1377
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1378
+ if (xDataEpoch[i] <= endValue) {
1379
+ endXIndex = i;
1380
+ break;
1381
+ }
1382
+ }
1383
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1384
+ endXIndex = 0;
1385
+ }
1386
+ return { startXIndex, endXIndex };
1387
+ };
1388
+
1389
+ // esm-externals:@splunk/visualization-schemas
1390
+ var visualization_schemas_exports = {};
1391
+ __export(visualization_schemas_exports, {
1392
+ default: () => visualization_schemas_default
1393
+ });
1394
+ var defaultImport26 = __toESM(require("@splunk/visualization-schemas"));
1395
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1396
+ var visualization_schemas_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
1397
+
1398
+ // src/common/hooks/useTrellisEnabled.ts
1399
+ var useTrellisFeatureFlagOn = () => {
1400
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1401
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1402
+ };
1403
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1404
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1405
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1406
+ };
1407
+
1408
+ // src/common/components/TrellisTitle.tsx
1409
+ var TRELLIS_TITLE_HEIGHT = 28;
1410
+ var TrellisTitleText = styled_components_default.div`
1411
+ margin-left: 10px;
1412
+ margin-right: 10px;
1413
+ padding-top: 8px;
1414
+ text-overflow: ellipsis;
1415
+ white-space: nowrap;
1416
+ overflow: hidden;
1417
+ `;
1418
+ var TrellisTitleDiv = styled_components_default.div`
1419
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1420
+ font-size: 14px;
1421
+ font-weight: 700;
1422
+ color: ${(props) => props.fontColor};
1423
+ background-color: ${(props) => props.backgroundColor};
1424
+ 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.
1425
+ `;
1426
+ var TrellisTitle = (props) => {
1427
+ const titleText = String(props.trellisKey).toString();
1428
+ return /* @__PURE__ */ react_exports.createElement(
1429
+ TrellisTitleDiv,
1430
+ {
1431
+ fontColor: props.fontColor,
1432
+ backgroundColor: props.backgroundColor,
1433
+ "data-test": "trellis-title",
1434
+ title: titleText
1435
+ },
1436
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1437
+ );
1438
+ };
1313
1439
 
1314
1440
  // src/common/TimeSeriesChartWrapper.tsx
1315
1441
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1320,38 +1446,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1320
1446
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1321
1447
  }
1322
1448
  `;
1323
- var handleClick = (chartEvent, onClick) => {
1449
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1450
+ const result = __spreadValues({}, payload);
1451
+ if (trellisSplitBy) {
1452
+ result["trellis.name"] = trellisSplitBy;
1453
+ }
1454
+ if (trellisKey) {
1455
+ result["trellis.value"] = trellisKey;
1456
+ }
1457
+ return result;
1458
+ };
1459
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1460
+ if (!previousPayload) {
1461
+ return true;
1462
+ }
1463
+ if (currentPayload.index !== previousPayload.index) {
1464
+ return true;
1465
+ }
1466
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1467
+ return true;
1468
+ }
1469
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1470
+ return true;
1471
+ }
1472
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1473
+ return true;
1474
+ }
1475
+ return false;
1476
+ };
1477
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1324
1478
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1325
1479
  name: chartEvent.seriesKey
1326
1480
  });
1327
1481
  delete payload.seriesKey;
1328
1482
  if (chartEvent.rowContext) {
1329
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1330
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1331
- });
1483
+ Object.assign(
1484
+ payload,
1485
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1486
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1487
+ return acc;
1488
+ }, {})
1489
+ );
1332
1490
  }
1491
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1333
1492
  if (onClick) {
1334
1493
  onClick({
1335
1494
  type: "point.click",
1336
1495
  originalEvent: chartEvent,
1337
- payload
1496
+ payload: updatedPayload
1338
1497
  });
1339
1498
  }
1340
1499
  };
1341
- var handleLegendClick = (chartEvent, onClick) => {
1500
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1342
1501
  const payload = {
1343
1502
  name: chartEvent
1344
1503
  };
1504
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1345
1505
  if (onClick) {
1346
1506
  onClick({
1347
1507
  type: "legend.click",
1348
1508
  originalEvent: chartEvent,
1349
- payload
1509
+ payload: updatedPayload
1350
1510
  });
1351
1511
  }
1352
1512
  };
1513
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1514
+ var _a;
1515
+ if (!rangeEvent) {
1516
+ return;
1517
+ }
1518
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1519
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1520
+ const payload = {
1521
+ startXIndex,
1522
+ startXValue: rangeEvent.start,
1523
+ endXIndex,
1524
+ endXValue: rangeEvent.end
1525
+ };
1526
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1527
+ if (onSelect) {
1528
+ onSelect({
1529
+ type: "range.selectBeforeZoom",
1530
+ originalEvent: rangeEvent,
1531
+ payload: updatedPayload
1532
+ });
1533
+ }
1534
+ };
1535
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1536
+ var _a;
1537
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1538
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1539
+ const payload = {
1540
+ startXIndex,
1541
+ startXValue: rangeEvent.start,
1542
+ endXIndex,
1543
+ endXValue: rangeEvent.end
1544
+ };
1545
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1546
+ if (onSelect) {
1547
+ onSelect({
1548
+ type: "range.select",
1549
+ originalEvent: rangeEvent,
1550
+ payload: updatedPayload
1551
+ });
1552
+ }
1553
+ };
1554
+ var parseArrayOption = (value) => {
1555
+ if (Array.isArray(value)) {
1556
+ return value;
1557
+ }
1558
+ if (value) {
1559
+ return JSON.parse(value);
1560
+ }
1561
+ return void 0;
1562
+ };
1353
1563
  var TimeSeriesChartWrapper = (props) => {
1354
- const {
1564
+ var _b, _c, _d;
1565
+ const _a = props, {
1355
1566
  width,
1356
1567
  height,
1357
1568
  chartData,
@@ -1364,12 +1575,49 @@ var TimeSeriesChartWrapper = (props) => {
1364
1575
  markerDisplay,
1365
1576
  onClick,
1366
1577
  onPointMouseOver,
1367
- onPointMouseOut
1368
- } = props;
1369
- const {
1578
+ onPointMouseOut,
1579
+ onSelect,
1580
+ splitByLayout,
1581
+ trellisKey,
1582
+ trellisSplitBy,
1370
1583
  backgroundColor,
1584
+ defaultFontColor,
1585
+ additionalTooltipValues,
1586
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1587
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1588
+ } = _a, otherOptions = __objRest(_a, [
1589
+ "width",
1590
+ "height",
1591
+ "chartData",
1592
+ "options",
1593
+ "userLocale",
1594
+ "annotationX",
1595
+ "annotationLabel",
1596
+ "annotationColor",
1597
+ "legendDisplay",
1598
+ "markerDisplay",
1599
+ "onClick",
1600
+ "onPointMouseOver",
1601
+ "onPointMouseOut",
1602
+ "onSelect",
1603
+ "splitByLayout",
1604
+ "trellisKey",
1605
+ "trellisSplitBy",
1606
+ "backgroundColor",
1607
+ "defaultFontColor",
1608
+ "additionalTooltipValues",
1609
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1610
+ "showYAxisWithZero",
1611
+ "showY2AxisWithZero"
1612
+ ]);
1613
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1614
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1615
+ const {
1616
+ backgroundColor: bgColorFromOptions,
1371
1617
  seriesColors: seriesColorsStr,
1372
1618
  fieldColors,
1619
+ legendLabels: legendLabelsStr,
1620
+ legendMode,
1373
1621
  "axisTitleX.text": xAxisTitleText,
1374
1622
  "axisTitleY.text": yAxisTitleText,
1375
1623
  "axisTitleY2.text": y2AxisTitleText,
@@ -1377,8 +1625,11 @@ var TimeSeriesChartWrapper = (props) => {
1377
1625
  "axisTitleY.visibility": yAxisTitleVisibility,
1378
1626
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1379
1627
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1628
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1380
1629
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1630
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1381
1631
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1632
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1382
1633
  "axisY.abbreviation": yAxisAbbreviation,
1383
1634
  "axisY.scale": yAxisScale,
1384
1635
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1388,10 +1639,63 @@ var TimeSeriesChartWrapper = (props) => {
1388
1639
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1389
1640
  "chart.overlayFields": overlayFieldsStr,
1390
1641
  "chart.nullValueMode": nullValueMode,
1391
- lineWidth
1642
+ "chart.showDataLabels": showDataLabels,
1643
+ lineWidth,
1644
+ lineDashStyle,
1645
+ fieldDashStyles: lineDashStylesByFieldStr,
1646
+ yAxisMin: yAxisMinRaw,
1647
+ yAxisMax: yAxisMaxRaw,
1648
+ y2AxisMin: y2AxisMinRaw,
1649
+ y2AxisMax: y2AxisMaxRaw,
1650
+ showXMajorGridLines,
1651
+ showYMajorGridLines,
1652
+ showY2MajorGridLines,
1653
+ showYMinorGridLines,
1654
+ showY2MinorGridLines,
1655
+ showLineSmoothing,
1656
+ yAxisMajorTickVisibility,
1657
+ y2AxisMajorTickVisibility,
1658
+ yAxisMajorTickSize,
1659
+ y2AxisMajorTickSize,
1660
+ yAxisMajorTickInterval,
1661
+ y2AxisMajorTickInterval,
1662
+ yAxisMinorTickVisibility,
1663
+ y2AxisMinorTickVisibility,
1664
+ yAxisMinorTickSize,
1665
+ y2AxisMinorTickSize,
1666
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1667
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1392
1668
  } = options;
1669
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1670
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1671
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1672
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1673
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1674
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1675
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1676
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1677
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1678
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1679
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1680
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1681
+ if (simpleXMLValue) return Number(simpleXMLValue);
1682
+ if (canvasValue) return Number(canvasValue);
1683
+ return void 0;
1684
+ };
1685
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1686
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1687
+ y2AxisMajorUnitFromSimpleXML,
1688
+ y2AxisMajorTickInterval
1689
+ );
1690
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
1691
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
1692
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
1693
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
1393
1694
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1394
1695
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1696
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1697
+ const legendLabels = parseArrayOption(legendLabelsStr);
1698
+ const bgColor = backgroundColor || bgColorFromOptions;
1395
1699
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1396
1700
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1397
1701
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1402,31 +1706,64 @@ var TimeSeriesChartWrapper = (props) => {
1402
1706
  fields: chartData.fields,
1403
1707
  columns: chartData.seriesList
1404
1708
  });
1405
- const xField = getFieldName(filteredChartData.fields[0]);
1709
+ const xField = getFieldName2(filteredChartData.fields[0]);
1406
1710
  const yFields = getFieldNames(
1407
1711
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1408
1712
  );
1409
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1410
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1713
+ const y2Fields = (0, react_exports.useMemo)(
1714
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1715
+ [y2FieldsStr]
1716
+ );
1717
+ const overlayFields = (0, react_exports.useMemo)(
1718
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1719
+ [overlayFieldsStr]
1720
+ );
1411
1721
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1412
1722
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1413
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1723
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1724
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1414
1725
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1415
1726
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1416
1727
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1417
1728
  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
- }
1729
+ const xScaleConfig = (0, react_exports.useMemo)(
1730
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1731
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1732
+ );
1733
+ const yScaleConfig = (0, react_exports.useMemo)(
1734
+ () => getYScaleConfig(
1735
+ yAxisTitle,
1736
+ yAxisAbbreviation,
1737
+ yAxisScale,
1738
+ yAxisLabelVisibility,
1739
+ yAxisMin,
1740
+ yAxisMax
1741
+ ),
1742
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1743
+ );
1744
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1745
+ if (y2Enabled) {
1746
+ return getY2ScaleConfig(
1747
+ y2AxisTitle,
1748
+ y2AxisAbbreviation,
1749
+ y2AxisScale,
1750
+ y2IntegerUnits,
1751
+ y2AxisLabelVisibility,
1752
+ y2AxisMin,
1753
+ y2AxisMax
1754
+ );
1755
+ }
1756
+ return {};
1757
+ }, [
1758
+ y2Enabled,
1759
+ y2AxisTitle,
1760
+ y2AxisAbbreviation,
1761
+ y2AxisScale,
1762
+ y2IntegerUnits,
1763
+ y2AxisLabelVisibility,
1764
+ y2AxisMin,
1765
+ y2AxisMax
1766
+ ]);
1430
1767
  const uplotContainerElement = (0, react_exports.useRef)(null);
1431
1768
  const seriesDataFormatted = [
1432
1769
  filteredChartData.columns[0],
@@ -1442,9 +1779,21 @@ var TimeSeriesChartWrapper = (props) => {
1442
1779
  overlayFields,
1443
1780
  y2Enabled,
1444
1781
  nullValueMode,
1445
- markerDisplay
1782
+ markerDisplay,
1783
+ lineDashStyle,
1784
+ lineDashStylesByField
1446
1785
  ),
1447
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1786
+ [
1787
+ yFields,
1788
+ y2Fields,
1789
+ lineWidth,
1790
+ overlayFields,
1791
+ y2Enabled,
1792
+ nullValueMode,
1793
+ markerDisplay,
1794
+ lineDashStyle,
1795
+ lineDashStylesByField
1796
+ ]
1448
1797
  );
1449
1798
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1450
1799
  () => getAnnotationsForCanvas({
@@ -1458,25 +1807,54 @@ var TimeSeriesChartWrapper = (props) => {
1458
1807
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1459
1808
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1460
1809
  );
1461
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1810
+ const legend = (0, react_exports.useMemo)(
1811
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
1812
+ [legendDisplay, legendMode]
1813
+ );
1462
1814
  const handleChartClick = react_exports.useCallback(
1463
1815
  (event) => {
1464
1816
  if (onClick) {
1465
- handleClick(event, onClick);
1817
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1466
1818
  }
1467
1819
  },
1468
- [onClick]
1820
+ [onClick, trellisKey, trellisSplitBy]
1469
1821
  );
1470
1822
  const handleChartLegendClick = react_exports.useCallback(
1471
1823
  (event) => {
1472
1824
  if (onClick) {
1473
- handleLegendClick(event, onClick);
1825
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1826
+ }
1827
+ },
1828
+ [onClick, trellisKey, trellisSplitBy]
1829
+ );
1830
+ const handleChartRangeSelection = react_exports.useCallback(
1831
+ (range2) => {
1832
+ if (onSelect) {
1833
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1834
+ }
1835
+ },
1836
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1837
+ );
1838
+ const handleChartRangeZoom = react_exports.useCallback(
1839
+ (range2) => {
1840
+ if (onSelect) {
1841
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1474
1842
  }
1475
1843
  },
1476
- [onClick]
1844
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1845
+ );
1846
+ const xFieldToUse = xFieldFromProps || xField;
1847
+ const enableSearchZoom = react_exports.useMemo(
1848
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1849
+ [eventHandlers, xFieldToUse]
1477
1850
  );
1478
1851
  const lastPayloadRef = react_exports.useRef(null);
1479
1852
  const lastOriginalEventRef = react_exports.useRef(null);
1853
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1854
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1855
+ react_exports.useEffect(() => {
1856
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1857
+ }, [additionalTooltipValues]);
1480
1858
  const handleChartCrosshairChange = react_exports.useCallback(
1481
1859
  (event) => {
1482
1860
  if (onPointMouseOver || onPointMouseOut) {
@@ -1488,6 +1866,7 @@ var TimeSeriesChartWrapper = (props) => {
1488
1866
  payload: lastPayloadRef.current
1489
1867
  });
1490
1868
  }
1869
+ previousMouseoverPayloadRef.current = null;
1491
1870
  return;
1492
1871
  }
1493
1872
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1495,25 +1874,36 @@ var TimeSeriesChartWrapper = (props) => {
1495
1874
  });
1496
1875
  delete payload.seriesKey;
1497
1876
  if (event.rowContext) {
1498
- Object.keys(event.rowContext).forEach((fieldName) => {
1499
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1500
- });
1877
+ Object.assign(
1878
+ payload,
1879
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1880
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1881
+ return acc;
1882
+ }, {})
1883
+ );
1501
1884
  }
1502
- lastPayloadRef.current = payload;
1885
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1886
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1887
+ return;
1888
+ }
1889
+ lastPayloadRef.current = updatedPayload;
1503
1890
  lastOriginalEventRef.current = event;
1891
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1504
1892
  if (onPointMouseOver) {
1505
1893
  onPointMouseOver({
1506
1894
  type: "point.mouseover",
1507
1895
  originalEvent: event,
1508
- payload
1896
+ payload: updatedPayload
1509
1897
  });
1510
1898
  }
1511
1899
  }
1512
1900
  },
1513
- [onPointMouseOver, onPointMouseOut]
1901
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1514
1902
  );
1515
- const memoizedChart = (0, react_exports.useMemo)(
1516
- () => /* @__PURE__ */ react_exports.createElement(
1903
+ 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}`;
1904
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1905
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1906
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1517
1907
  visualization_canvas_exports.TimeSeriesChart,
1518
1908
  {
1519
1909
  data: chartData,
@@ -1523,49 +1913,107 @@ var TimeSeriesChartWrapper = (props) => {
1523
1913
  seriesColorsByField,
1524
1914
  seriesConfig: seriesOverrides,
1525
1915
  legend,
1916
+ legendLabels,
1917
+ isSeriesCompare: legendMode === "seriesCompare",
1918
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1526
1919
  scaleConfig,
1527
1920
  timestampFormat: "expanded",
1528
1921
  onCrosshairClick: onClick ? handleChartClick : void 0,
1529
1922
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1530
1923
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1924
+ onRangeSelection: handleChartRangeSelection,
1925
+ onRangeZoom: computedOnRangeZoom,
1926
+ serverSideZoom: enableSearchZoom,
1531
1927
  userLocale,
1532
1928
  events: chartingEventAnnotations,
1533
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
1929
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
1930
+ additionalTooltipValuesRef,
1931
+ showXMajorGridLines,
1932
+ showYMajorGridLines,
1933
+ showY2MajorGridLines,
1934
+ showYMinorGridLines,
1935
+ showY2MinorGridLines,
1936
+ showLineSmoothing,
1937
+ dataValuesDisplay,
1938
+ showYMajorTicks,
1939
+ showY2MajorTicks,
1940
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
1941
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
1942
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
1943
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
1944
+ showYMinorTicks,
1945
+ showY2MinorTicks,
1946
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
1947
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
1948
+ showYAxisWithZero,
1949
+ showY2AxisWithZero
1534
1950
  }
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
- );
1951
+ ));
1952
+ }, [
1953
+ onSelect,
1954
+ handleChartRangeZoom,
1955
+ dataKey,
1956
+ chartData,
1957
+ containerWidth,
1958
+ containerHeight,
1959
+ seriesColors,
1960
+ seriesColorsByField,
1961
+ seriesOverrides,
1962
+ legend,
1963
+ legendLabels,
1964
+ scaleConfig,
1965
+ onClick,
1966
+ handleChartClick,
1967
+ onPointMouseOver,
1968
+ onPointMouseOut,
1969
+ handleChartCrosshairChange,
1970
+ handleChartLegendClick,
1971
+ handleChartRangeSelection,
1972
+ enableSearchZoom,
1973
+ userLocale,
1974
+ chartingEventAnnotations,
1975
+ showXMajorGridLines,
1976
+ showYMajorGridLines,
1977
+ showY2MajorGridLines,
1978
+ showYMinorGridLines,
1979
+ showY2MinorGridLines,
1980
+ showLineSmoothing,
1981
+ dataValuesDisplay,
1982
+ showYMajorTicks,
1983
+ showY2MajorTicks,
1984
+ yAxisMajorTickSizeNum,
1985
+ y2AxisMajorTickSizeNum,
1986
+ yAxisMajorTickIntervalNum,
1987
+ y2AxisMajorTickIntervalNum,
1988
+ showYMinorTicks,
1989
+ showY2MinorTicks,
1990
+ yAxisMinorTickSizeNum,
1991
+ y2AxisMinorTickSizeNum,
1992
+ showYAxisWithZero,
1993
+ showY2AxisWithZero,
1994
+ legendMode
1995
+ ]);
1555
1996
  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(
1997
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
1998
+ }, [bgColor, memoizedChart]);
1999
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2000
+ TrellisTitle,
2001
+ {
2002
+ trellisKey,
2003
+ backgroundColor: bgColor,
2004
+ fontColor: defaultFontColor
2005
+ }
2006
+ ), /* @__PURE__ */ react_exports.createElement(
1559
2007
  TimeSeriesChartContainer,
1560
2008
  {
1561
- height,
2009
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1562
2010
  width,
1563
2011
  ref: uplotContainerElement,
1564
2012
  "data-test": "timeseries-chart-wrapper"
1565
2013
  },
1566
2014
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1567
2015
  memoizedVisualization
1568
- );
2016
+ ));
1569
2017
  };
1570
2018
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1571
2019
 
@@ -1855,15 +2303,6 @@ var withDashboardViz = (opts) => {
1855
2303
  };
1856
2304
  var withDashboardViz_default = withDashboardViz;
1857
2305
 
1858
- // esm-externals:@splunk/visualization-schemas
1859
- var visualization_schemas_exports = {};
1860
- __export(visualization_schemas_exports, {
1861
- default: () => visualization_schemas_default
1862
- });
1863
- var defaultImport26 = __toESM(require("@splunk/visualization-schemas"));
1864
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1865
- var visualization_schemas_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
1866
-
1867
2306
  // esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
1868
2307
  var PresetPalettes_exports = {};
1869
2308
  __export(PresetPalettes_exports, {
@@ -2357,7 +2796,7 @@ var getStyledShape = (shape4) => styled_components_default(shape4)`
2357
2796
  `;
2358
2797
  function ClickableShape({ children, onClick, shape: shape4 }) {
2359
2798
  const descriptionId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("clickable-svg-description"), []);
2360
- return /* @__PURE__ */ react_default.createElement(StyledDiv, null, /* @__PURE__ */ react_default.createElement(ScreenReaderContent_default, { id: descriptionId }, (0, i18n_exports._)("Click to trigger interaction")), /* @__PURE__ */ react_default.createElement(
2799
+ return /* @__PURE__ */ react_default.createElement(react_default.Fragment, null, /* @__PURE__ */ react_default.createElement(ScreenReaderContent_default, { id: descriptionId }, (0, i18n_exports._)("Click to trigger interaction")), /* @__PURE__ */ react_default.createElement(
2361
2800
  StyledButton,
2362
2801
  {
2363
2802
  onClick,
@@ -2368,16 +2807,7 @@ function ClickableShape({ children, onClick, shape: shape4 }) {
2368
2807
  children
2369
2808
  ));
2370
2809
  }
2371
- var StyledDiv = styled_components_default.div`
2372
- display: inline-grid;
2373
- grid-template: 1fr / 1fr;
2374
-
2375
- & > * {
2376
- grid-row-start: 1;
2377
- grid-column-start: 1;
2378
- }
2379
- `;
2380
- var StyledButton = styled_components_default.button`
2810
+ var StyledButton = styled_components_default.button.attrs({ type: "button" })`
2381
2811
  padding: 0;
2382
2812
  border: 0;
2383
2813
  background: transparent;
@@ -2386,21 +2816,15 @@ var StyledButton = styled_components_default.button`
2386
2816
  outline: none;
2387
2817
  ${(props) => props.shape === "rect" ? styled_components_exports.css`
2388
2818
  box-shadow: ${variables_default.focusShadow};
2389
- ` : (
2390
- // clip-path would clip the shadow for ellipse, so we use drop-shadow filters to simulate it
2391
- styled_components_exports.css`
2392
- svg:has(+ &) > ellipse {
2819
+ ` : styled_components_exports.css`
2820
+ & > svg > ellipse {
2393
2821
  filter: drop-shadow(2px 0px 1px ${variables_default.focusColor})
2394
2822
  drop-shadow(-2px 0px 1px ${variables_default.focusColor})
2395
2823
  drop-shadow(0px 2px 1px ${variables_default.focusColor})
2396
2824
  drop-shadow(0px -2px 1px ${variables_default.focusColor});
2397
2825
  }
2398
- `
2399
- )}
2826
+ `}
2400
2827
  }
2401
- ${(props) => props.shape === "ellipse" && `
2402
- clip-path: ellipse(50% 50% at 50% 50%);
2403
- `}
2404
2828
  `;
2405
2829
 
2406
2830
  // src/Rectangle/Rectangle.tsx