@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/Image.js CHANGED
@@ -601,7 +601,7 @@ var Cover = styled_components_default.div`
601
601
  bottom: 0;
602
602
  `;
603
603
  var Blocker = styled_components_default.div.attrs({
604
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
604
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f"
605
605
  })`
606
606
  position: relative;
607
607
  width: 100%;
@@ -691,7 +691,7 @@ var withFixedSizeContainer = (Viz) => {
691
691
  FixSizeItem,
692
692
  {
693
693
  "data-test": "fix-size-item",
694
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
694
+ "data-splunk-visualization-version": "28.4.0 - 002bd482f",
695
695
  width,
696
696
  height,
697
697
  backgroundColor
@@ -787,6 +787,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
787
787
  var numberUtils_default = "default" in defaultImport25 ? defaultImport25.default : defaultImport25;
788
788
 
789
789
  // src/common/utils/dataUtils.ts
790
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
790
791
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
791
792
  const dataLength = data.length;
792
793
  const downsampledIndices = [];
@@ -903,9 +904,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
903
904
  let xColumn = [];
904
905
  const yColumns = [];
905
906
  const canDownsample = !ds.data.fields.some((field, index) => {
906
- var _a, _b;
907
- const fieldName = (_a = field.name) != null ? _a : field;
908
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
907
+ var _a;
908
+ const fieldName = getFieldName(field);
909
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
909
910
  const column = ds.data.columns[index];
910
911
  let hasDisplayedColumnThatCantBeDownsampled = false;
911
912
  if (fieldName === xField) {
@@ -1258,6 +1259,16 @@ var triangleEventAnnotationRenderer = ({
1258
1259
  eventColor: eventWithColor.color
1259
1260
  });
1260
1261
  };
1262
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1263
+ const rangeSelectEventHandler = eventHandlers.find(
1264
+ (eventHandler) => {
1265
+ var _a;
1266
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1267
+ }
1268
+ );
1269
+ const xAxisIsTime = xField === "_time";
1270
+ return !!rangeSelectEventHandler && xAxisIsTime;
1271
+ };
1261
1272
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1262
1273
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1263
1274
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1278,16 +1289,31 @@ var filterChartDataFromInternalFields = (chartData) => {
1278
1289
  var convert2DArrayToNumbers = (arr) => {
1279
1290
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1280
1291
  };
1292
+ var parseAxisValue = (val) => {
1293
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1294
+ return void 0;
1295
+ }
1296
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1297
+ return Number.isNaN(num) ? void 0 : num;
1298
+ };
1281
1299
  var SideLegendWidth = 75;
1282
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1300
+ var SeriesCompareLegendWidth = 200;
1283
1301
  var getLegend = (props) => {
1284
1302
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1303
+ const { isSeriesCompare } = props;
1304
+ const commonLegendProps = {
1305
+ center: true,
1306
+ fontSize: 12,
1307
+ largerTiles: true,
1308
+ hideSeriesValue: !isSeriesCompare
1309
+ // Show values if in seriesCompare mode
1310
+ };
1285
1311
  switch (legendPlacement) {
1286
1312
  case "off":
1287
1313
  return false;
1288
1314
  case "left":
1289
1315
  return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1290
- width: SideLegendWidth
1316
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1291
1317
  }, commonLegendProps));
1292
1318
  case "bottom":
1293
1319
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
@@ -1299,7 +1325,7 @@ var getLegend = (props) => {
1299
1325
  }, commonLegendProps));
1300
1326
  default:
1301
1327
  return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1302
- width: SideLegendWidth
1328
+ width: isSeriesCompare ? SeriesCompareLegendWidth : SideLegendWidth
1303
1329
  }, commonLegendProps));
1304
1330
  }
1305
1331
  };
@@ -1335,22 +1361,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1335
1361
  const end = axisTitle.slice(-halfChars);
1336
1362
  return `${start}...${end}`;
1337
1363
  };
1338
- var getFieldName = (field) => {
1364
+ var getFieldName2 = (field) => {
1339
1365
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1340
1366
  return fieldName;
1341
1367
  };
1342
1368
  var getFieldNames = (fields) => {
1343
- return fields.map((field) => getFieldName(field));
1369
+ return fields.map((field) => getFieldName2(field));
1344
1370
  };
1345
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1371
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1346
1372
  const xConfig = { x: {} };
1347
1373
  xConfig.x.label = label;
1348
1374
  if (xAxisLabelVisibility === "hide") {
1349
1375
  xConfig.x.hideLabels = true;
1350
1376
  }
1377
+ if (xAxisLabelRotation !== void 0) {
1378
+ xConfig.x.labelRotation = xAxisLabelRotation;
1379
+ }
1351
1380
  return xConfig;
1352
1381
  };
1353
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1382
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1354
1383
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1355
1384
  const yConfig = { y: {} };
1356
1385
  yConfig.y.label = label;
@@ -1366,14 +1395,20 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1366
1395
  if (yAxisLabelVisibility === "hide") {
1367
1396
  yConfig.y.hideLabels = true;
1368
1397
  }
1398
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1399
+ yConfig.y.range = (u, dataMin, dataMax) => {
1400
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1401
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1402
+ return [min, max];
1403
+ };
1404
+ }
1369
1405
  return yConfig;
1370
1406
  };
1371
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1407
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1372
1408
  const y2Config = { y2: {} };
1373
1409
  const scaleType = axisScale != null ? axisScale : "linear";
1374
1410
  y2Config.y2.label = label;
1375
1411
  y2Config.y2.side = "right";
1376
- y2Config.y2.showGrid = false;
1377
1412
  y2Config.y2.type = scaleType;
1378
1413
  if (axisAbbreviation !== "none") {
1379
1414
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
@@ -1383,9 +1418,16 @@ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInt
1383
1418
  if (y2AxisLabelVisibility === "hide") {
1384
1419
  y2Config.y2.hideLabels = true;
1385
1420
  }
1421
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1422
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1423
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1424
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1425
+ return [min, max];
1426
+ };
1427
+ }
1386
1428
  return y2Config;
1387
1429
  };
1388
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1430
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField) => {
1389
1431
  const seriesConfig = {};
1390
1432
  let spanGaps;
1391
1433
  let replaceNullsWithZero;
@@ -1420,12 +1462,87 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1420
1462
  if (markerDisplay !== void 0) {
1421
1463
  seriesConfig[field].markerDisplay = markerDisplay;
1422
1464
  }
1465
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1466
+ if (fieldDashStyle) {
1467
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1468
+ }
1423
1469
  if (replaceNullsWithZero !== void 0) {
1424
1470
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1425
1471
  }
1426
1472
  });
1427
1473
  return seriesConfig;
1428
1474
  };
1475
+ var findRangeIndices = (xData, startValue, endValue) => {
1476
+ let startXIndex = -1;
1477
+ let endXIndex = -1;
1478
+ const xDataEpoch = xData.map((val) => {
1479
+ if (typeof val === "string") {
1480
+ return new Date(val).getTime() / 1e3;
1481
+ }
1482
+ return val;
1483
+ });
1484
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1485
+ if (xDataEpoch[i] >= startValue) {
1486
+ startXIndex = i;
1487
+ break;
1488
+ }
1489
+ }
1490
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1491
+ startXIndex = xDataEpoch.length - 1;
1492
+ }
1493
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1494
+ if (xDataEpoch[i] <= endValue) {
1495
+ endXIndex = i;
1496
+ break;
1497
+ }
1498
+ }
1499
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1500
+ endXIndex = 0;
1501
+ }
1502
+ return { startXIndex, endXIndex };
1503
+ };
1504
+
1505
+ // src/common/hooks/useTrellisEnabled.ts
1506
+ var useTrellisFeatureFlagOn = () => {
1507
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1508
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1509
+ };
1510
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1511
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1512
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1513
+ };
1514
+
1515
+ // src/common/components/TrellisTitle.tsx
1516
+ var TRELLIS_TITLE_HEIGHT = 28;
1517
+ var TrellisTitleText = styled_components_default.div`
1518
+ margin-left: 10px;
1519
+ margin-right: 10px;
1520
+ padding-top: 8px;
1521
+ text-overflow: ellipsis;
1522
+ white-space: nowrap;
1523
+ overflow: hidden;
1524
+ `;
1525
+ var TrellisTitleDiv = styled_components_default.div`
1526
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1527
+ font-size: 14px;
1528
+ font-weight: 700;
1529
+ color: ${(props) => props.fontColor};
1530
+ background-color: ${(props) => props.backgroundColor};
1531
+ 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.
1532
+ `;
1533
+ var TrellisTitle = (props) => {
1534
+ const titleText = String(props.trellisKey).toString();
1535
+ return /* @__PURE__ */ react_exports.createElement(
1536
+ TrellisTitleDiv,
1537
+ {
1538
+ fontColor: props.fontColor,
1539
+ backgroundColor: props.backgroundColor,
1540
+ "data-test": "trellis-title",
1541
+ title: titleText
1542
+ },
1543
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1544
+ );
1545
+ };
1429
1546
 
1430
1547
  // src/common/TimeSeriesChartWrapper.tsx
1431
1548
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1436,38 +1553,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1436
1553
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1437
1554
  }
1438
1555
  `;
1439
- var handleClick = (chartEvent, onClick) => {
1556
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1557
+ const result = __spreadValues({}, payload);
1558
+ if (trellisSplitBy) {
1559
+ result["trellis.name"] = trellisSplitBy;
1560
+ }
1561
+ if (trellisKey) {
1562
+ result["trellis.value"] = trellisKey;
1563
+ }
1564
+ return result;
1565
+ };
1566
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1567
+ if (!previousPayload) {
1568
+ return true;
1569
+ }
1570
+ if (currentPayload.index !== previousPayload.index) {
1571
+ return true;
1572
+ }
1573
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1574
+ return true;
1575
+ }
1576
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1577
+ return true;
1578
+ }
1579
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1580
+ return true;
1581
+ }
1582
+ return false;
1583
+ };
1584
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1440
1585
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1441
1586
  name: chartEvent.seriesKey
1442
1587
  });
1443
1588
  delete payload.seriesKey;
1444
1589
  if (chartEvent.rowContext) {
1445
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1446
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1447
- });
1590
+ Object.assign(
1591
+ payload,
1592
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1593
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1594
+ return acc;
1595
+ }, {})
1596
+ );
1448
1597
  }
1598
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1449
1599
  if (onClick) {
1450
1600
  onClick({
1451
1601
  type: "point.click",
1452
1602
  originalEvent: chartEvent,
1453
- payload
1603
+ payload: updatedPayload
1454
1604
  });
1455
1605
  }
1456
1606
  };
1457
- var handleLegendClick = (chartEvent, onClick) => {
1607
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1458
1608
  const payload = {
1459
1609
  name: chartEvent
1460
1610
  };
1611
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1461
1612
  if (onClick) {
1462
1613
  onClick({
1463
1614
  type: "legend.click",
1464
1615
  originalEvent: chartEvent,
1465
- payload
1616
+ payload: updatedPayload
1466
1617
  });
1467
1618
  }
1468
1619
  };
1620
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1621
+ var _a;
1622
+ if (!rangeEvent) {
1623
+ return;
1624
+ }
1625
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1626
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1627
+ const payload = {
1628
+ startXIndex,
1629
+ startXValue: rangeEvent.start,
1630
+ endXIndex,
1631
+ endXValue: rangeEvent.end
1632
+ };
1633
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1634
+ if (onSelect) {
1635
+ onSelect({
1636
+ type: "range.selectBeforeZoom",
1637
+ originalEvent: rangeEvent,
1638
+ payload: updatedPayload
1639
+ });
1640
+ }
1641
+ };
1642
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1643
+ var _a;
1644
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1645
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1646
+ const payload = {
1647
+ startXIndex,
1648
+ startXValue: rangeEvent.start,
1649
+ endXIndex,
1650
+ endXValue: rangeEvent.end
1651
+ };
1652
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1653
+ if (onSelect) {
1654
+ onSelect({
1655
+ type: "range.select",
1656
+ originalEvent: rangeEvent,
1657
+ payload: updatedPayload
1658
+ });
1659
+ }
1660
+ };
1661
+ var parseArrayOption = (value) => {
1662
+ if (Array.isArray(value)) {
1663
+ return value;
1664
+ }
1665
+ if (value) {
1666
+ return JSON.parse(value);
1667
+ }
1668
+ return void 0;
1669
+ };
1469
1670
  var TimeSeriesChartWrapper = (props) => {
1470
- const {
1671
+ var _b, _c, _d;
1672
+ const _a = props, {
1471
1673
  width,
1472
1674
  height,
1473
1675
  chartData,
@@ -1480,12 +1682,49 @@ var TimeSeriesChartWrapper = (props) => {
1480
1682
  markerDisplay,
1481
1683
  onClick,
1482
1684
  onPointMouseOver,
1483
- onPointMouseOut
1484
- } = props;
1485
- const {
1685
+ onPointMouseOut,
1686
+ onSelect,
1687
+ splitByLayout,
1688
+ trellisKey,
1689
+ trellisSplitBy,
1486
1690
  backgroundColor,
1691
+ defaultFontColor,
1692
+ additionalTooltipValues,
1693
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1694
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1695
+ } = _a, otherOptions = __objRest(_a, [
1696
+ "width",
1697
+ "height",
1698
+ "chartData",
1699
+ "options",
1700
+ "userLocale",
1701
+ "annotationX",
1702
+ "annotationLabel",
1703
+ "annotationColor",
1704
+ "legendDisplay",
1705
+ "markerDisplay",
1706
+ "onClick",
1707
+ "onPointMouseOver",
1708
+ "onPointMouseOut",
1709
+ "onSelect",
1710
+ "splitByLayout",
1711
+ "trellisKey",
1712
+ "trellisSplitBy",
1713
+ "backgroundColor",
1714
+ "defaultFontColor",
1715
+ "additionalTooltipValues",
1716
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1717
+ "showYAxisWithZero",
1718
+ "showY2AxisWithZero"
1719
+ ]);
1720
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1721
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1722
+ const {
1723
+ backgroundColor: bgColorFromOptions,
1487
1724
  seriesColors: seriesColorsStr,
1488
1725
  fieldColors,
1726
+ legendLabels: legendLabelsStr,
1727
+ legendMode,
1489
1728
  "axisTitleX.text": xAxisTitleText,
1490
1729
  "axisTitleY.text": yAxisTitleText,
1491
1730
  "axisTitleY2.text": y2AxisTitleText,
@@ -1493,8 +1732,11 @@ var TimeSeriesChartWrapper = (props) => {
1493
1732
  "axisTitleY.visibility": yAxisTitleVisibility,
1494
1733
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1495
1734
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1735
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1496
1736
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1737
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1497
1738
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1739
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1498
1740
  "axisY.abbreviation": yAxisAbbreviation,
1499
1741
  "axisY.scale": yAxisScale,
1500
1742
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1504,10 +1746,63 @@ var TimeSeriesChartWrapper = (props) => {
1504
1746
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1505
1747
  "chart.overlayFields": overlayFieldsStr,
1506
1748
  "chart.nullValueMode": nullValueMode,
1507
- lineWidth
1749
+ "chart.showDataLabels": showDataLabels,
1750
+ lineWidth,
1751
+ lineDashStyle,
1752
+ fieldDashStyles: lineDashStylesByFieldStr,
1753
+ yAxisMin: yAxisMinRaw,
1754
+ yAxisMax: yAxisMaxRaw,
1755
+ y2AxisMin: y2AxisMinRaw,
1756
+ y2AxisMax: y2AxisMaxRaw,
1757
+ showXMajorGridLines,
1758
+ showYMajorGridLines,
1759
+ showY2MajorGridLines,
1760
+ showYMinorGridLines,
1761
+ showY2MinorGridLines,
1762
+ showLineSmoothing,
1763
+ yAxisMajorTickVisibility,
1764
+ y2AxisMajorTickVisibility,
1765
+ yAxisMajorTickSize,
1766
+ y2AxisMajorTickSize,
1767
+ yAxisMajorTickInterval,
1768
+ y2AxisMajorTickInterval,
1769
+ yAxisMinorTickVisibility,
1770
+ y2AxisMinorTickVisibility,
1771
+ yAxisMinorTickSize,
1772
+ y2AxisMinorTickSize,
1773
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1774
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1508
1775
  } = options;
1776
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1777
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1778
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1779
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1780
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1781
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1782
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1783
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1784
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1785
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1786
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1787
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1788
+ if (simpleXMLValue) return Number(simpleXMLValue);
1789
+ if (canvasValue) return Number(canvasValue);
1790
+ return void 0;
1791
+ };
1792
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1793
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1794
+ y2AxisMajorUnitFromSimpleXML,
1795
+ y2AxisMajorTickInterval
1796
+ );
1797
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize ? Number(yAxisMajorTickSize) : void 0;
1798
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize ? Number(y2AxisMajorTickSize) : void 0;
1799
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize ? Number(yAxisMinorTickSize) : void 0;
1800
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize ? Number(y2AxisMinorTickSize) : void 0;
1509
1801
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1510
1802
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1803
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1804
+ const legendLabels = parseArrayOption(legendLabelsStr);
1805
+ const bgColor = backgroundColor || bgColorFromOptions;
1511
1806
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1512
1807
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1513
1808
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1518,31 +1813,64 @@ var TimeSeriesChartWrapper = (props) => {
1518
1813
  fields: chartData.fields,
1519
1814
  columns: chartData.seriesList
1520
1815
  });
1521
- const xField = getFieldName(filteredChartData.fields[0]);
1816
+ const xField = getFieldName2(filteredChartData.fields[0]);
1522
1817
  const yFields = getFieldNames(
1523
1818
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1524
1819
  );
1525
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1526
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1820
+ const y2Fields = (0, react_exports.useMemo)(
1821
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1822
+ [y2FieldsStr]
1823
+ );
1824
+ const overlayFields = (0, react_exports.useMemo)(
1825
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1826
+ [overlayFieldsStr]
1827
+ );
1527
1828
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1528
1829
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1529
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1830
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1831
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1530
1832
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1531
1833
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1532
1834
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1533
1835
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1534
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1535
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1536
- let y2ScaleConfig = {};
1537
- if (y2Enabled) {
1538
- y2ScaleConfig = getY2ScaleConfig(
1539
- y2AxisTitle,
1540
- y2AxisAbbreviation,
1541
- y2AxisScale,
1542
- y2IntegerUnits,
1543
- y2AxisLabelVisibility
1544
- );
1545
- }
1836
+ const xScaleConfig = (0, react_exports.useMemo)(
1837
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1838
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1839
+ );
1840
+ const yScaleConfig = (0, react_exports.useMemo)(
1841
+ () => getYScaleConfig(
1842
+ yAxisTitle,
1843
+ yAxisAbbreviation,
1844
+ yAxisScale,
1845
+ yAxisLabelVisibility,
1846
+ yAxisMin,
1847
+ yAxisMax
1848
+ ),
1849
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1850
+ );
1851
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1852
+ if (y2Enabled) {
1853
+ return getY2ScaleConfig(
1854
+ y2AxisTitle,
1855
+ y2AxisAbbreviation,
1856
+ y2AxisScale,
1857
+ y2IntegerUnits,
1858
+ y2AxisLabelVisibility,
1859
+ y2AxisMin,
1860
+ y2AxisMax
1861
+ );
1862
+ }
1863
+ return {};
1864
+ }, [
1865
+ y2Enabled,
1866
+ y2AxisTitle,
1867
+ y2AxisAbbreviation,
1868
+ y2AxisScale,
1869
+ y2IntegerUnits,
1870
+ y2AxisLabelVisibility,
1871
+ y2AxisMin,
1872
+ y2AxisMax
1873
+ ]);
1546
1874
  const uplotContainerElement = (0, react_exports.useRef)(null);
1547
1875
  const seriesDataFormatted = [
1548
1876
  filteredChartData.columns[0],
@@ -1558,9 +1886,21 @@ var TimeSeriesChartWrapper = (props) => {
1558
1886
  overlayFields,
1559
1887
  y2Enabled,
1560
1888
  nullValueMode,
1561
- markerDisplay
1889
+ markerDisplay,
1890
+ lineDashStyle,
1891
+ lineDashStylesByField
1562
1892
  ),
1563
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1893
+ [
1894
+ yFields,
1895
+ y2Fields,
1896
+ lineWidth,
1897
+ overlayFields,
1898
+ y2Enabled,
1899
+ nullValueMode,
1900
+ markerDisplay,
1901
+ lineDashStyle,
1902
+ lineDashStylesByField
1903
+ ]
1564
1904
  );
1565
1905
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1566
1906
  () => getAnnotationsForCanvas({
@@ -1574,25 +1914,54 @@ var TimeSeriesChartWrapper = (props) => {
1574
1914
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1575
1915
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1576
1916
  );
1577
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1917
+ const legend = (0, react_exports.useMemo)(
1918
+ () => getLegend({ legendDisplay, isSeriesCompare: legendMode === "seriesCompare" }),
1919
+ [legendDisplay, legendMode]
1920
+ );
1578
1921
  const handleChartClick = react_exports.useCallback(
1579
1922
  (event) => {
1580
1923
  if (onClick) {
1581
- handleClick(event, onClick);
1924
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1582
1925
  }
1583
1926
  },
1584
- [onClick]
1927
+ [onClick, trellisKey, trellisSplitBy]
1585
1928
  );
1586
1929
  const handleChartLegendClick = react_exports.useCallback(
1587
1930
  (event) => {
1588
1931
  if (onClick) {
1589
- handleLegendClick(event, onClick);
1932
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1590
1933
  }
1591
1934
  },
1592
- [onClick]
1935
+ [onClick, trellisKey, trellisSplitBy]
1936
+ );
1937
+ const handleChartRangeSelection = react_exports.useCallback(
1938
+ (range2) => {
1939
+ if (onSelect) {
1940
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1941
+ }
1942
+ },
1943
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1944
+ );
1945
+ const handleChartRangeZoom = react_exports.useCallback(
1946
+ (range2) => {
1947
+ if (onSelect) {
1948
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1949
+ }
1950
+ },
1951
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1952
+ );
1953
+ const xFieldToUse = xFieldFromProps || xField;
1954
+ const enableSearchZoom = react_exports.useMemo(
1955
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1956
+ [eventHandlers, xFieldToUse]
1593
1957
  );
1594
1958
  const lastPayloadRef = react_exports.useRef(null);
1595
1959
  const lastOriginalEventRef = react_exports.useRef(null);
1960
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1961
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1962
+ react_exports.useEffect(() => {
1963
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1964
+ }, [additionalTooltipValues]);
1596
1965
  const handleChartCrosshairChange = react_exports.useCallback(
1597
1966
  (event) => {
1598
1967
  if (onPointMouseOver || onPointMouseOut) {
@@ -1604,6 +1973,7 @@ var TimeSeriesChartWrapper = (props) => {
1604
1973
  payload: lastPayloadRef.current
1605
1974
  });
1606
1975
  }
1976
+ previousMouseoverPayloadRef.current = null;
1607
1977
  return;
1608
1978
  }
1609
1979
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1611,25 +1981,36 @@ var TimeSeriesChartWrapper = (props) => {
1611
1981
  });
1612
1982
  delete payload.seriesKey;
1613
1983
  if (event.rowContext) {
1614
- Object.keys(event.rowContext).forEach((fieldName) => {
1615
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1616
- });
1984
+ Object.assign(
1985
+ payload,
1986
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1987
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1988
+ return acc;
1989
+ }, {})
1990
+ );
1991
+ }
1992
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1993
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1994
+ return;
1617
1995
  }
1618
- lastPayloadRef.current = payload;
1996
+ lastPayloadRef.current = updatedPayload;
1619
1997
  lastOriginalEventRef.current = event;
1998
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1620
1999
  if (onPointMouseOver) {
1621
2000
  onPointMouseOver({
1622
2001
  type: "point.mouseover",
1623
2002
  originalEvent: event,
1624
- payload
2003
+ payload: updatedPayload
1625
2004
  });
1626
2005
  }
1627
2006
  }
1628
2007
  },
1629
- [onPointMouseOver, onPointMouseOut]
2008
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1630
2009
  );
1631
- const memoizedChart = (0, react_exports.useMemo)(
1632
- () => /* @__PURE__ */ react_exports.createElement(
2010
+ 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}`;
2011
+ const memoizedChart = (0, react_exports.useMemo)(() => {
2012
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
2013
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1633
2014
  visualization_canvas_exports.TimeSeriesChart,
1634
2015
  {
1635
2016
  data: chartData,
@@ -1639,49 +2020,107 @@ var TimeSeriesChartWrapper = (props) => {
1639
2020
  seriesColorsByField,
1640
2021
  seriesConfig: seriesOverrides,
1641
2022
  legend,
2023
+ legendLabels,
2024
+ isSeriesCompare: legendMode === "seriesCompare",
2025
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1642
2026
  scaleConfig,
1643
2027
  timestampFormat: "expanded",
1644
2028
  onCrosshairClick: onClick ? handleChartClick : void 0,
1645
2029
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1646
2030
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
2031
+ onRangeSelection: handleChartRangeSelection,
2032
+ onRangeZoom: computedOnRangeZoom,
2033
+ serverSideZoom: enableSearchZoom,
1647
2034
  userLocale,
1648
2035
  events: chartingEventAnnotations,
1649
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
2036
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
2037
+ additionalTooltipValuesRef,
2038
+ showXMajorGridLines,
2039
+ showYMajorGridLines,
2040
+ showY2MajorGridLines,
2041
+ showYMinorGridLines,
2042
+ showY2MinorGridLines,
2043
+ showLineSmoothing,
2044
+ dataValuesDisplay,
2045
+ showYMajorTicks,
2046
+ showY2MajorTicks,
2047
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2048
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2049
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2050
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2051
+ showYMinorTicks,
2052
+ showY2MinorTicks,
2053
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2054
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2055
+ showYAxisWithZero,
2056
+ showY2AxisWithZero
1650
2057
  }
1651
- ),
1652
- [
1653
- chartData,
1654
- containerWidth,
1655
- containerHeight,
1656
- seriesColors,
1657
- seriesColorsByField,
1658
- seriesOverrides,
1659
- legend,
1660
- scaleConfig,
1661
- userLocale,
1662
- chartingEventAnnotations,
1663
- onClick,
1664
- handleChartClick,
1665
- onPointMouseOver,
1666
- onPointMouseOut,
1667
- handleChartCrosshairChange,
1668
- handleChartLegendClick
1669
- ]
1670
- );
2058
+ ));
2059
+ }, [
2060
+ onSelect,
2061
+ handleChartRangeZoom,
2062
+ dataKey,
2063
+ chartData,
2064
+ containerWidth,
2065
+ containerHeight,
2066
+ seriesColors,
2067
+ seriesColorsByField,
2068
+ seriesOverrides,
2069
+ legend,
2070
+ legendLabels,
2071
+ scaleConfig,
2072
+ onClick,
2073
+ handleChartClick,
2074
+ onPointMouseOver,
2075
+ onPointMouseOut,
2076
+ handleChartCrosshairChange,
2077
+ handleChartLegendClick,
2078
+ handleChartRangeSelection,
2079
+ enableSearchZoom,
2080
+ userLocale,
2081
+ chartingEventAnnotations,
2082
+ showXMajorGridLines,
2083
+ showYMajorGridLines,
2084
+ showY2MajorGridLines,
2085
+ showYMinorGridLines,
2086
+ showY2MinorGridLines,
2087
+ showLineSmoothing,
2088
+ dataValuesDisplay,
2089
+ showYMajorTicks,
2090
+ showY2MajorTicks,
2091
+ yAxisMajorTickSizeNum,
2092
+ y2AxisMajorTickSizeNum,
2093
+ yAxisMajorTickIntervalNum,
2094
+ y2AxisMajorTickIntervalNum,
2095
+ showYMinorTicks,
2096
+ showY2MinorTicks,
2097
+ yAxisMinorTickSizeNum,
2098
+ y2AxisMinorTickSizeNum,
2099
+ showYAxisWithZero,
2100
+ showY2AxisWithZero,
2101
+ legendMode
2102
+ ]);
1671
2103
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1672
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1673
- }, [backgroundColor, memoizedChart]);
1674
- return /* @__PURE__ */ react_exports.createElement(
2104
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2105
+ }, [bgColor, memoizedChart]);
2106
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2107
+ TrellisTitle,
2108
+ {
2109
+ trellisKey,
2110
+ backgroundColor: bgColor,
2111
+ fontColor: defaultFontColor
2112
+ }
2113
+ ), /* @__PURE__ */ react_exports.createElement(
1675
2114
  TimeSeriesChartContainer,
1676
2115
  {
1677
- height,
2116
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1678
2117
  width,
1679
2118
  ref: uplotContainerElement,
1680
2119
  "data-test": "timeseries-chart-wrapper"
1681
2120
  },
1682
2121
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1683
2122
  memoizedVisualization
1684
- );
2123
+ ));
1685
2124
  };
1686
2125
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1687
2126
 
@@ -1992,7 +2431,7 @@ var ImageApi = class {
1992
2431
  var ImageApi_default = ImageApi;
1993
2432
 
1994
2433
  // src/Image/Image.tsx
1995
- var { useEffect: useEffect4, useRef: useRef7 } = react_exports;
2434
+ var { useEffect: useEffect5, useRef: useRef7 } = react_exports;
1996
2435
  var validOptions = Object.keys(config_default.optionsSchema);
1997
2436
  var Container = styled_components_default.div.attrs(() => ({
1998
2437
  "data-test": "image-container"
@@ -2004,6 +2443,12 @@ var Container = styled_components_default.div.attrs(() => ({
2004
2443
  align-items: center;
2005
2444
  cursor: ${(props) => props.onClick ? "pointer" : "inherit"};
2006
2445
  ${(props) => (0, style_exports.toDimension)((0, lodash_exports.pick)(props, ["width", "height"]))};
2446
+ ${(props) => props.isButton ? `
2447
+ background: none;
2448
+ border: none;
2449
+ padding: 0;
2450
+ margin: 0;
2451
+ ` : ""}
2007
2452
  `;
2008
2453
  var shouldShowPlaceholder = (dataSources, loading, options = {}) => {
2009
2454
  if (options.src) {
@@ -2049,37 +2494,48 @@ var ImageVisualization = ({
2049
2494
  const remoteImage = useRef7(null);
2050
2495
  const api = useRef7(new ImageApi_default({ options: { src, preserveAspectRatio }, remoteImage }));
2051
2496
  const isRemote = (0, RemoteImage_exports.isRemoteImage)(src);
2052
- useEffect4(() => {
2497
+ useEffect5(() => {
2053
2498
  visualizationApiRef(api.current);
2054
2499
  return () => {
2055
2500
  visualizationApiRef(null);
2056
2501
  };
2057
2502
  }, []);
2058
- return /* @__PURE__ */ react_exports.createElement(Container, { width, height, onClick: onImageClick }, isRemote ? /* @__PURE__ */ react_exports.createElement(
2059
- RemoteImage_default,
2060
- {
2061
- imageURL: src,
2062
- title,
2063
- preserveAspectRatio,
2064
- width,
2065
- height,
2066
- ref: remoteImage
2067
- }
2068
- ) : /* @__PURE__ */ react_exports.createElement(
2069
- StyledImage,
2503
+ return /* @__PURE__ */ react_exports.createElement(
2504
+ Container,
2070
2505
  {
2071
- "data-test": "image",
2072
- src,
2073
- shouldPreserveAspectRatio: preserveAspectRatio,
2506
+ as: onImageClick !== lodash_exports.noop ? "button" : "div",
2507
+ isButton: onImageClick !== lodash_exports.noop,
2074
2508
  width,
2075
2509
  height,
2076
- alt: (0, i18n_exports._)(title),
2077
- onError: (e) => {
2078
- e.target.alt = (0, i18n_exports._)("Image not found");
2079
- },
2080
- referrerPolicy: "no-referrer"
2081
- }
2082
- ));
2510
+ onClick: onImageClick !== lodash_exports.noop ? onImageClick : void 0,
2511
+ "aria-label": title || (0, i18n_exports._)("Image visualization")
2512
+ },
2513
+ isRemote ? /* @__PURE__ */ react_exports.createElement(
2514
+ RemoteImage_default,
2515
+ {
2516
+ imageURL: src,
2517
+ title,
2518
+ preserveAspectRatio,
2519
+ width,
2520
+ height,
2521
+ ref: remoteImage
2522
+ }
2523
+ ) : /* @__PURE__ */ react_exports.createElement(
2524
+ StyledImage,
2525
+ {
2526
+ "data-test": "image",
2527
+ src,
2528
+ shouldPreserveAspectRatio: preserveAspectRatio,
2529
+ width,
2530
+ height,
2531
+ alt: (0, i18n_exports._)(title),
2532
+ onError: (e) => {
2533
+ e.target.alt = (0, i18n_exports._)("Image not found");
2534
+ },
2535
+ referrerPolicy: "no-referrer"
2536
+ }
2537
+ )
2538
+ );
2083
2539
  };
2084
2540
  var Image = withDashboardViz_default({
2085
2541
  ReactViz: ImageVisualization,