@splunk/visualizations 28.3.0 → 28.5.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 (285) hide show
  1. package/Area/Area.d.ts.map +1 -1
  2. package/Area.config.js +28 -8
  3. package/Area.config.js.map +2 -2
  4. package/Area.js +583 -120
  5. package/Area.js.map +3 -3
  6. package/Bar/Bar.d.ts.map +1 -1
  7. package/Bar.config.js +28 -8
  8. package/Bar.config.js.map +2 -2
  9. package/Bar.js +593 -120
  10. package/Bar.js.map +3 -3
  11. package/Bubble.config.js +4 -5
  12. package/Bubble.config.js.map +2 -2
  13. package/Bubble.js +554 -98
  14. package/Bubble.js.map +3 -3
  15. package/CHANGELOG.external.md +165 -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 +595 -111
  21. package/ChoroplethSvg.js.map +4 -4
  22. package/Column/Column.d.ts.map +1 -1
  23. package/Column.config.js +28 -8
  24. package/Column.config.js.map +2 -2
  25. package/Column.js +583 -120
  26. package/Column.js.map +3 -3
  27. package/Ellipse/config.d.ts.map +1 -1
  28. package/Ellipse.config.js +14 -5
  29. package/Ellipse.config.js.map +4 -4
  30. package/Ellipse.js +640 -159
  31. package/Ellipse.js.map +4 -4
  32. package/Events/PureEvents/PureEvents.d.ts.map +1 -1
  33. package/Events.js +668 -157
  34. package/Events.js.map +4 -4
  35. package/FillerGauge/FillerGauge.d.ts.map +1 -1
  36. package/FillerGauge/PureFillerGauge/FillerGauge.d.ts.map +1 -1
  37. package/FillerGauge.js +751 -169
  38. package/FillerGauge.js.map +4 -4
  39. package/Image/Image.d.ts.map +1 -1
  40. package/Image.js +620 -116
  41. package/Image.js.map +4 -4
  42. package/Line/Line.d.ts.map +1 -1
  43. package/Line/lineUtils.d.ts.map +1 -1
  44. package/Line/mockdata/LineData.d.ts +154 -0
  45. package/Line/mockdata/LineData.d.ts.map +1 -1
  46. package/Line.config.js +28 -8
  47. package/Line.config.js.map +2 -2
  48. package/Line.js +704 -122
  49. package/Line.js.map +3 -3
  50. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts +5 -0
  51. package/LinkGraph/PureLinkGraph/PureLinkGraph.d.ts.map +1 -1
  52. package/LinkGraph/PureLinkGraph/PureLinkGraphUtils.d.ts.map +1 -1
  53. package/LinkGraph/PureLinkGraph/components/Graph.d.ts +9 -1
  54. package/LinkGraph/PureLinkGraph/components/Graph.d.ts.map +1 -1
  55. package/LinkGraph/PureLinkGraph/components/GraphStyles.d.ts.map +1 -1
  56. package/LinkGraph/PureLinkGraph/components/Node.d.ts +1 -0
  57. package/LinkGraph/PureLinkGraph/components/Node.d.ts.map +1 -1
  58. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts +1 -0
  59. package/LinkGraph/PureLinkGraph/components/Nodes.d.ts.map +1 -1
  60. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts +16 -0
  61. package/LinkGraph/PureLinkGraph/measurementUtils.d.ts.map +1 -0
  62. package/LinkGraph/PureLinkGraph/utils/iconLoader.d.ts.map +1 -1
  63. package/LinkGraph/config.d.ts.map +1 -1
  64. package/LinkGraph.config.js +15 -1
  65. package/LinkGraph.config.js.map +2 -2
  66. package/LinkGraph.js +1411 -662
  67. package/LinkGraph.js.map +4 -4
  68. package/Map/Map.d.ts +2 -2
  69. package/Map/Map.d.ts.map +1 -1
  70. package/Map/PureMap/BubbleLayer.d.ts +5 -0
  71. package/Map/PureMap/BubbleLayer.d.ts.map +1 -1
  72. package/Map/PureMap/ClusterLayer.d.ts.map +1 -1
  73. package/Map/PureMap/LocalChoroplethLayer.d.ts.map +1 -1
  74. package/Map/PureMap/MapUtils.d.ts +2 -2
  75. package/Map/PureMap/MapUtils.d.ts.map +1 -1
  76. package/Map/PureMap/PureMap.d.ts.map +1 -1
  77. package/Map/PureMap/PureMapContainer.d.ts.map +1 -1
  78. package/Map/PureMap/Tooltip.d.ts.map +1 -1
  79. package/Map/config.d.ts.map +1 -1
  80. package/Map.config.js +0 -1
  81. package/Map.config.js.map +2 -2
  82. package/Map.js +831 -247
  83. package/Map.js.map +4 -4
  84. package/Markdown/Markdown.d.ts.map +1 -1
  85. package/Markdown/config.d.ts.map +1 -1
  86. package/Markdown.config.js +14 -5
  87. package/Markdown.config.js.map +4 -4
  88. package/Markdown.js +619 -109
  89. package/Markdown.js.map +4 -4
  90. package/MarkerGauge/MarkerGauge.d.ts +5 -1
  91. package/MarkerGauge/MarkerGauge.d.ts.map +1 -1
  92. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts +4 -0
  93. package/MarkerGauge/PureMarkerGauge/MarkerGauge.d.ts.map +1 -1
  94. package/MarkerGauge/config.d.ts.map +1 -1
  95. package/MarkerGauge.config.js +121 -3
  96. package/MarkerGauge.config.js.map +3 -3
  97. package/MarkerGauge.js +1535 -172
  98. package/MarkerGauge.js.map +4 -4
  99. package/NetworkGraph/NetworkGraph.d.ts +22 -0
  100. package/NetworkGraph/NetworkGraph.d.ts.map +1 -0
  101. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts +60 -0
  102. package/NetworkGraph/PureNetworkGraph/PureNetworkGraph.d.ts.map +1 -0
  103. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts +19 -0
  104. package/NetworkGraph/PureNetworkGraph/components/Link.d.ts.map +1 -0
  105. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts +29 -0
  106. package/NetworkGraph/PureNetworkGraph/components/NetworkGraphSvg.d.ts.map +1 -0
  107. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts +27 -0
  108. package/NetworkGraph/PureNetworkGraph/components/Node.d.ts.map +1 -0
  109. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts +12 -0
  110. package/NetworkGraph/PureNetworkGraph/components/Tooltip.d.ts.map +1 -0
  111. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts +13 -0
  112. package/NetworkGraph/PureNetworkGraph/components/ZoomControls.d.ts.map +1 -0
  113. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts +140 -0
  114. package/NetworkGraph/PureNetworkGraph/mockdata/data.d.ts.map +1 -0
  115. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts +89 -0
  116. package/NetworkGraph/PureNetworkGraph/mockdata/datasource.d.ts.map +1 -0
  117. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts +78 -0
  118. package/NetworkGraph/PureNetworkGraph/utils/dragUtils.d.ts.map +1 -0
  119. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts +47 -0
  120. package/NetworkGraph/PureNetworkGraph/utils/forceLayout.d.ts.map +1 -0
  121. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts +78 -0
  122. package/NetworkGraph/PureNetworkGraph/utils/iconLoader.d.ts.map +1 -0
  123. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts +111 -0
  124. package/NetworkGraph/PureNetworkGraph/utils/networkGraphShared.d.ts.map +1 -0
  125. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts +122 -0
  126. package/NetworkGraph/PureNetworkGraph/utils/networkGraphUtils.d.ts.map +1 -0
  127. package/NetworkGraph/config.d.ts +4 -0
  128. package/NetworkGraph/config.d.ts.map +1 -0
  129. package/NetworkGraph/index.d.ts +3 -0
  130. package/NetworkGraph/index.d.ts.map +1 -0
  131. package/NetworkGraph.config.js +938 -0
  132. package/NetworkGraph.config.js.map +7 -0
  133. package/NetworkGraph.js +7053 -0
  134. package/NetworkGraph.js.map +7 -0
  135. package/PERFORMANCE.md +23 -0
  136. package/ParallelCoordinates/ParallelCoordinates.d.ts +1 -46
  137. package/ParallelCoordinates/ParallelCoordinates.d.ts.map +1 -1
  138. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts +12 -58
  139. package/ParallelCoordinates/PureParallelCoordinates/PureParallelCoordinates.d.ts.map +1 -1
  140. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts +1 -0
  141. package/ParallelCoordinates/PureParallelCoordinates/src/ParallelCoordinatesChart.d.ts.map +1 -1
  142. package/ParallelCoordinates.js +664 -228
  143. package/ParallelCoordinates.js.map +4 -4
  144. package/Pie/Pie.d.ts.map +1 -1
  145. package/Pie/config.d.ts.map +1 -1
  146. package/Pie/pieUtils.d.ts +4 -0
  147. package/Pie/pieUtils.d.ts.map +1 -1
  148. package/Pie.config.js +16 -0
  149. package/Pie.config.js.map +2 -2
  150. package/Pie.js +610 -118
  151. package/Pie.js.map +3 -3
  152. package/Punchcard.js +579 -92
  153. package/Punchcard.js.map +4 -4
  154. package/Rectangle/config.d.ts.map +1 -1
  155. package/Rectangle.config.js +14 -5
  156. package/Rectangle.config.js.map +4 -4
  157. package/Rectangle.js +611 -130
  158. package/Rectangle.js.map +4 -4
  159. package/Sankey/PureSankey/PureSankey.d.ts +26 -72
  160. package/Sankey/PureSankey/PureSankey.d.ts.map +1 -1
  161. package/Sankey/PureSankey/SankeyLink.d.ts +3 -19
  162. package/Sankey/PureSankey/SankeyLink.d.ts.map +1 -1
  163. package/Sankey/PureSankey/SankeyNode.d.ts +3 -20
  164. package/Sankey/PureSankey/SankeyNode.d.ts.map +1 -1
  165. package/Sankey/PureSankey/SankeyTooltip.d.ts +3 -24
  166. package/Sankey/PureSankey/SankeyTooltip.d.ts.map +1 -1
  167. package/Sankey.js +814 -429
  168. package/Sankey.js.map +4 -4
  169. package/Scatter/Scatter.d.ts.map +1 -1
  170. package/Scatter.config.js +168 -148
  171. package/Scatter.config.js.map +4 -4
  172. package/Scatter.js +733 -260
  173. package/Scatter.js.map +4 -4
  174. package/SingleValue/SingleValue.d.ts.map +1 -1
  175. package/SingleValue/config.d.ts.map +1 -1
  176. package/SingleValue.config.js +15 -2
  177. package/SingleValue.config.js.map +2 -2
  178. package/SingleValue.js +733 -229
  179. package/SingleValue.js.map +3 -3
  180. package/SingleValueBasic.js.map +1 -1
  181. package/SingleValueIcon/SingleValueIcon.d.ts.map +1 -1
  182. package/SingleValueIcon/config.d.ts.map +1 -1
  183. package/SingleValueIcon.config.js +14 -6
  184. package/SingleValueIcon.config.js.map +4 -4
  185. package/SingleValueIcon.js +612 -182
  186. package/SingleValueIcon.js.map +4 -4
  187. package/SingleValueRadial/PureSingleValueRadial/GaugeGraph.d.ts.map +1 -1
  188. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts +0 -8
  189. package/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.d.ts.map +1 -1
  190. package/SingleValueRadial/SingleValueRadial.d.ts.map +1 -1
  191. package/SingleValueRadial.config.js +0 -1
  192. package/SingleValueRadial.config.js.map +2 -2
  193. package/SingleValueRadial.js +594 -182
  194. package/SingleValueRadial.js.map +4 -4
  195. package/SparkLine.js +46 -8
  196. package/SparkLine.js.map +2 -2
  197. package/Table/PureTable.d.ts +10 -0
  198. package/Table/PureTable.d.ts.map +1 -1
  199. package/Table/Table.d.ts.map +1 -1
  200. package/Table/cells/SparklineCell.d.ts.map +1 -1
  201. package/Table/config.d.ts.map +1 -1
  202. package/Table/hooks.d.ts +6 -0
  203. package/Table/hooks.d.ts.map +1 -1
  204. package/Table.config.js +1 -1
  205. package/Table.config.js.map +2 -2
  206. package/Table.js +836 -253
  207. package/Table.js.map +4 -4
  208. package/Timeline/PureTimeline/PureTimeline.d.ts.map +1 -1
  209. package/Timeline/PureTimeline/src/CursorPlugin.d.ts.map +1 -1
  210. package/Timeline/PureTimeline/src/TimelineLegend.d.ts.map +1 -1
  211. package/Timeline/PureTimeline/src/TimelinePlugin.d.ts.map +1 -1
  212. package/Timeline/PureTimeline/src/TimelineYAxis.d.ts.map +1 -1
  213. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts +2 -1
  214. package/Timeline/PureTimeline/src/utils/timelineUtils.d.ts.map +1 -1
  215. package/Timeline/config.d.ts.map +1 -1
  216. package/Timeline.config.js +31 -12
  217. package/Timeline.config.js.map +4 -4
  218. package/Timeline.js +785 -247
  219. package/Timeline.js.map +4 -4
  220. package/common/Charting.d.ts +5 -0
  221. package/common/Charting.d.ts.map +1 -1
  222. package/common/Charting.js +12 -0
  223. package/common/Charting.js.map +2 -2
  224. package/common/GaugeMajorTicks.js +150 -13
  225. package/common/GaugeMajorTicks.js.map +4 -4
  226. package/common/GaugeValueMarker.js +84 -17
  227. package/common/GaugeValueMarker.js.map +4 -4
  228. package/common/OptionsDoc.js.map +1 -1
  229. package/common/OverviewDoc.d.ts.map +1 -1
  230. package/common/OverviewDoc.js +2 -2
  231. package/common/OverviewDoc.js.map +2 -2
  232. package/common/ThemesDoc.js +0 -1
  233. package/common/ThemesDoc.js.map +2 -2
  234. package/common/TimeSeriesChartWrapper.d.ts +24 -11
  235. package/common/TimeSeriesChartWrapper.d.ts.map +1 -1
  236. package/common/TimeSeriesChartWrapper.js +617 -91
  237. package/common/TimeSeriesChartWrapper.js.map +4 -4
  238. package/common/chartingUtils.d.ts +52 -6
  239. package/common/chartingUtils.d.ts.map +1 -1
  240. package/common/chartingUtils.js +116 -17
  241. package/common/chartingUtils.js.map +3 -3
  242. package/common/editorConfig/AxesChartDataConfig.d.ts +3 -3
  243. package/common/editorConfig/AxesChartDataConfig.d.ts.map +1 -1
  244. package/common/editorConfig/AxesChartDataDisplay.d.ts +4 -0
  245. package/common/editorConfig/AxesChartDataDisplay.d.ts.map +1 -1
  246. package/common/editorConfig/AxesChartLegend.d.ts.map +1 -1
  247. package/common/gaugeUtils.d.ts +37 -0
  248. package/common/gaugeUtils.d.ts.map +1 -1
  249. package/common/gaugeUtils.js +152 -2
  250. package/common/gaugeUtils.js.map +4 -4
  251. package/common/hocs/mockdata/trellisData.d.ts +119 -0
  252. package/common/hocs/mockdata/trellisData.d.ts.map +1 -1
  253. package/common/hocs/withTrellis.d.ts.map +1 -1
  254. package/common/interfaces/DashboardVizProps.d.ts +0 -3
  255. package/common/interfaces/DashboardVizProps.d.ts.map +1 -1
  256. package/common/interfaces/DataSource.d.ts +1 -1
  257. package/common/interfaces/DataSource.d.ts.map +1 -1
  258. package/common/interfaces/Overview.d.ts +1 -0
  259. package/common/interfaces/Overview.d.ts.map +1 -1
  260. package/common/interfaces/VizConfig.d.ts +2 -1
  261. package/common/interfaces/VizConfig.d.ts.map +1 -1
  262. package/common/shapeUtils.js +5 -20
  263. package/common/shapeUtils.js.map +2 -2
  264. package/common/utils/dataUtils.d.ts.map +1 -1
  265. package/common/utils/dataUtils.js +5 -4
  266. package/common/utils/dataUtils.js.map +2 -2
  267. package/common/utils/mapUtils.js +16 -9
  268. package/common/utils/mapUtils.js.map +2 -2
  269. package/common/utils/singleValueUtils.js +17 -18
  270. package/common/utils/singleValueUtils.js.map +2 -2
  271. package/common/utils/textUtils.d.ts +20 -0
  272. package/common/utils/textUtils.d.ts.map +1 -0
  273. package/common/utils/textUtils.js +76 -0
  274. package/common/utils/textUtils.js.map +7 -0
  275. package/common/utils/trellisUtils.d.ts.map +1 -1
  276. package/common/utils/trellisUtils.js +16 -20
  277. package/common/utils/trellisUtils.js.map +2 -2
  278. package/common/withDashboardViz.d.ts.map +1 -1
  279. package/common/withDashboardViz.js +600 -92
  280. package/common/withDashboardViz.js.map +4 -4
  281. package/package.json +46 -39
  282. package/common/utils/styleUtils.d.ts +0 -2
  283. package/common/utils/styleUtils.d.ts.map +0 -1
  284. package/common/utils/styleUtils.js +0 -30
  285. package/common/utils/styleUtils.js.map +0 -7
@@ -25,6 +25,18 @@ var __spreadValues = (a, b) => {
25
25
  return a;
26
26
  };
27
27
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
28
40
  var __export = (target, all) => {
29
41
  for (var name in all)
30
42
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -462,7 +474,7 @@ var Cover = styled_components_default.div`
462
474
  bottom: 0;
463
475
  `;
464
476
  var Blocker = styled_components_default.div.attrs({
465
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
477
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
466
478
  })`
467
479
  position: relative;
468
480
  width: 100%;
@@ -561,7 +573,7 @@ var withFixedSizeContainer = (Viz) => {
561
573
  FixSizeItem,
562
574
  {
563
575
  "data-test": "fix-size-item",
564
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
576
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
565
577
  width,
566
578
  height,
567
579
  backgroundColor
@@ -657,6 +669,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
657
669
  var numberUtils_default = "default" in defaultImport21 ? defaultImport21.default : defaultImport21;
658
670
 
659
671
  // src/common/utils/dataUtils.ts
672
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
660
673
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
661
674
  const dataLength = data.length;
662
675
  const downsampledIndices = [];
@@ -773,9 +786,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
773
786
  let xColumn = [];
774
787
  const yColumns = [];
775
788
  const canDownsample = !ds.data.fields.some((field, index) => {
776
- var _a, _b;
777
- const fieldName = (_a = field.name) != null ? _a : field;
778
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
789
+ var _a;
790
+ const fieldName = getFieldName(field);
791
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
779
792
  const column = ds.data.columns[index];
780
793
  let hasDisplayedColumnThatCantBeDownsampled = false;
781
794
  if (fieldName === xField) {
@@ -1128,6 +1141,16 @@ var triangleEventAnnotationRenderer = ({
1128
1141
  eventColor: eventWithColor.color
1129
1142
  });
1130
1143
  };
1144
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1145
+ const rangeSelectEventHandler = eventHandlers.find(
1146
+ (eventHandler) => {
1147
+ var _a;
1148
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1149
+ }
1150
+ );
1151
+ const xAxisIsTime = xField === "_time";
1152
+ return !!rangeSelectEventHandler && xAxisIsTime;
1153
+ };
1131
1154
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1132
1155
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1133
1156
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1148,17 +1171,34 @@ var filterChartDataFromInternalFields = (chartData) => {
1148
1171
  var convert2DArrayToNumbers = (arr) => {
1149
1172
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1150
1173
  };
1151
- var SideLegendWidth = 75;
1152
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1174
+ var parseAxisValue = (val) => {
1175
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1176
+ return void 0;
1177
+ }
1178
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1179
+ return Number.isNaN(num) ? void 0 : num;
1180
+ };
1181
+ var parseXAxisLineVisibility = (visibility) => {
1182
+ if (visibility === "hide") return false;
1183
+ if (visibility === "show") return true;
1184
+ return void 0;
1185
+ };
1153
1186
  var getLegend = (props) => {
1154
1187
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1188
+ const { isSeriesCompare, legendTruncation } = props;
1189
+ const commonLegendProps = {
1190
+ center: true,
1191
+ fontSize: 12,
1192
+ largerTiles: true,
1193
+ hideSeriesValue: !isSeriesCompare,
1194
+ // Show values if in seriesCompare mode
1195
+ legendTruncation
1196
+ };
1155
1197
  switch (legendPlacement) {
1156
1198
  case "off":
1157
1199
  return false;
1158
1200
  case "left":
1159
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1160
- width: SideLegendWidth
1161
- }, commonLegendProps));
1201
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
1162
1202
  case "bottom":
1163
1203
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
1164
1204
  wrap: true
@@ -1168,9 +1208,7 @@ var getLegend = (props) => {
1168
1208
  wrap: true
1169
1209
  }, commonLegendProps));
1170
1210
  default:
1171
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1172
- width: SideLegendWidth
1173
- }, commonLegendProps));
1211
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
1174
1212
  }
1175
1213
  };
1176
1214
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -1205,22 +1243,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1205
1243
  const end = axisTitle.slice(-halfChars);
1206
1244
  return `${start}...${end}`;
1207
1245
  };
1208
- var getFieldName = (field) => {
1246
+ var getFieldName2 = (field) => {
1209
1247
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1210
1248
  return fieldName;
1211
1249
  };
1212
1250
  var getFieldNames = (fields) => {
1213
- return fields.map((field) => getFieldName(field));
1251
+ return fields.map((field) => getFieldName2(field));
1214
1252
  };
1215
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1253
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1216
1254
  const xConfig = { x: {} };
1217
1255
  xConfig.x.label = label;
1218
1256
  if (xAxisLabelVisibility === "hide") {
1219
1257
  xConfig.x.hideLabels = true;
1220
1258
  }
1259
+ if (xAxisLabelRotation !== void 0) {
1260
+ xConfig.x.labelRotation = xAxisLabelRotation;
1261
+ }
1221
1262
  return xConfig;
1222
1263
  };
1223
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1264
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1224
1265
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1225
1266
  const yConfig = { y: {} };
1226
1267
  yConfig.y.label = label;
@@ -1228,34 +1269,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1228
1269
  if (yAxisAbbreviation !== "none") {
1229
1270
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
1230
1271
  }
1231
- if (yAxisAbbreviation === "none") {
1232
- yConfig.y.width = 55;
1233
- } else {
1272
+ if (yAxisAbbreviation !== "none") {
1234
1273
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
1235
1274
  }
1236
1275
  if (yAxisLabelVisibility === "hide") {
1237
1276
  yConfig.y.hideLabels = true;
1238
1277
  }
1278
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1279
+ yConfig.y.range = (u, dataMin, dataMax) => {
1280
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1281
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1282
+ return [min, max];
1283
+ };
1284
+ }
1239
1285
  return yConfig;
1240
1286
  };
1241
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1287
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1242
1288
  const y2Config = { y2: {} };
1243
1289
  const scaleType = axisScale != null ? axisScale : "linear";
1244
1290
  y2Config.y2.label = label;
1245
1291
  y2Config.y2.side = "right";
1246
- y2Config.y2.showGrid = false;
1247
1292
  y2Config.y2.type = scaleType;
1248
1293
  if (axisAbbreviation !== "none") {
1249
1294
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
1295
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
1250
1296
  } else if (roundAxisLabelsToInteger) {
1251
1297
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
1252
1298
  }
1253
1299
  if (y2AxisLabelVisibility === "hide") {
1254
1300
  y2Config.y2.hideLabels = true;
1255
1301
  }
1302
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1303
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1304
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1305
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1306
+ return [min, max];
1307
+ };
1308
+ }
1256
1309
  return y2Config;
1257
1310
  };
1258
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1311
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
1259
1312
  const seriesConfig = {};
1260
1313
  let spanGaps;
1261
1314
  let replaceNullsWithZero;
@@ -1282,6 +1335,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1282
1335
  );
1283
1336
  if (shouldAssignToY2) {
1284
1337
  seriesConfig[field].overrides.scale = "y2";
1338
+ } else {
1339
+ seriesConfig[field].overrides.scale = "y";
1285
1340
  }
1286
1341
  }
1287
1342
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -1290,12 +1345,101 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1290
1345
  if (markerDisplay !== void 0) {
1291
1346
  seriesConfig[field].markerDisplay = markerDisplay;
1292
1347
  }
1348
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1349
+ if (fieldDashStyle) {
1350
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1351
+ }
1352
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
1353
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
1354
+ if (fieldStepPosition && fieldStepPosition !== "off") {
1355
+ seriesConfig[field].stepPosition = fieldStepPosition;
1356
+ }
1293
1357
  if (replaceNullsWithZero !== void 0) {
1294
1358
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1295
1359
  }
1296
1360
  });
1297
1361
  return seriesConfig;
1298
1362
  };
1363
+ var findRangeIndices = (xData, startValue, endValue) => {
1364
+ let startXIndex = -1;
1365
+ let endXIndex = -1;
1366
+ const xDataEpoch = xData.map((val) => {
1367
+ if (typeof val === "string") {
1368
+ return new Date(val).getTime() / 1e3;
1369
+ }
1370
+ return val;
1371
+ });
1372
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1373
+ if (xDataEpoch[i] >= startValue) {
1374
+ startXIndex = i;
1375
+ break;
1376
+ }
1377
+ }
1378
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1379
+ startXIndex = xDataEpoch.length - 1;
1380
+ }
1381
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1382
+ if (xDataEpoch[i] <= endValue) {
1383
+ endXIndex = i;
1384
+ break;
1385
+ }
1386
+ }
1387
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1388
+ endXIndex = 0;
1389
+ }
1390
+ return { startXIndex, endXIndex };
1391
+ };
1392
+
1393
+ // esm-externals:@splunk/visualization-schemas
1394
+ var visualization_schemas_exports = {};
1395
+ __export(visualization_schemas_exports, {
1396
+ default: () => visualization_schemas_default
1397
+ });
1398
+ var defaultImport26 = __toESM(require("@splunk/visualization-schemas"));
1399
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1400
+ var visualization_schemas_default = "default" in defaultImport26 ? defaultImport26.default : defaultImport26;
1401
+
1402
+ // src/common/hooks/useTrellisEnabled.ts
1403
+ var useTrellisFeatureFlagOn = () => {
1404
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1405
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1406
+ };
1407
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1408
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1409
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1410
+ };
1411
+
1412
+ // src/common/components/TrellisTitle.tsx
1413
+ var TRELLIS_TITLE_HEIGHT = 28;
1414
+ var TrellisTitleText = styled_components_default.div`
1415
+ margin-left: 10px;
1416
+ margin-right: 10px;
1417
+ padding-top: 8px;
1418
+ text-overflow: ellipsis;
1419
+ white-space: nowrap;
1420
+ overflow: hidden;
1421
+ `;
1422
+ var TrellisTitleDiv = styled_components_default.div`
1423
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1424
+ font-size: 14px;
1425
+ font-weight: 700;
1426
+ color: ${(props) => props.fontColor};
1427
+ background-color: ${(props) => props.backgroundColor};
1428
+ 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.
1429
+ `;
1430
+ var TrellisTitle = (props) => {
1431
+ const titleText = String(props.trellisKey).toString();
1432
+ return /* @__PURE__ */ react_exports.createElement(
1433
+ TrellisTitleDiv,
1434
+ {
1435
+ fontColor: props.fontColor,
1436
+ backgroundColor: props.backgroundColor,
1437
+ "data-test": "trellis-title",
1438
+ title: titleText
1439
+ },
1440
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1441
+ );
1442
+ };
1299
1443
 
1300
1444
  // src/common/TimeSeriesChartWrapper.tsx
1301
1445
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1306,38 +1450,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1306
1450
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1307
1451
  }
1308
1452
  `;
1309
- var handleClick = (chartEvent, onClick) => {
1453
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1454
+ const result = __spreadValues({}, payload);
1455
+ if (trellisSplitBy) {
1456
+ result["trellis.name"] = trellisSplitBy;
1457
+ }
1458
+ if (trellisKey) {
1459
+ result["trellis.value"] = trellisKey;
1460
+ }
1461
+ return result;
1462
+ };
1463
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1464
+ if (!previousPayload) {
1465
+ return true;
1466
+ }
1467
+ if (currentPayload.index !== previousPayload.index) {
1468
+ return true;
1469
+ }
1470
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1471
+ return true;
1472
+ }
1473
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1474
+ return true;
1475
+ }
1476
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1477
+ return true;
1478
+ }
1479
+ return false;
1480
+ };
1481
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1310
1482
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1311
1483
  name: chartEvent.seriesKey
1312
1484
  });
1313
1485
  delete payload.seriesKey;
1314
1486
  if (chartEvent.rowContext) {
1315
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1316
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1317
- });
1487
+ Object.assign(
1488
+ payload,
1489
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1490
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1491
+ return acc;
1492
+ }, {})
1493
+ );
1318
1494
  }
1495
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1319
1496
  if (onClick) {
1320
1497
  onClick({
1321
1498
  type: "point.click",
1322
1499
  originalEvent: chartEvent,
1323
- payload
1500
+ payload: updatedPayload
1324
1501
  });
1325
1502
  }
1326
1503
  };
1327
- var handleLegendClick = (chartEvent, onClick) => {
1504
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1328
1505
  const payload = {
1329
1506
  name: chartEvent
1330
1507
  };
1508
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1331
1509
  if (onClick) {
1332
1510
  onClick({
1333
1511
  type: "legend.click",
1334
1512
  originalEvent: chartEvent,
1335
- payload
1513
+ payload: updatedPayload
1336
1514
  });
1337
1515
  }
1338
1516
  };
1517
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1518
+ var _a;
1519
+ if (!rangeEvent) {
1520
+ return;
1521
+ }
1522
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1523
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1524
+ const payload = {
1525
+ startXIndex,
1526
+ startXValue: rangeEvent.start,
1527
+ endXIndex,
1528
+ endXValue: rangeEvent.end
1529
+ };
1530
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1531
+ if (onSelect) {
1532
+ onSelect({
1533
+ type: "range.selectBeforeZoom",
1534
+ originalEvent: rangeEvent,
1535
+ payload: updatedPayload
1536
+ });
1537
+ }
1538
+ };
1539
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1540
+ var _a;
1541
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1542
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1543
+ const payload = {
1544
+ startXIndex,
1545
+ startXValue: rangeEvent.start,
1546
+ endXIndex,
1547
+ endXValue: rangeEvent.end
1548
+ };
1549
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1550
+ if (onSelect) {
1551
+ onSelect({
1552
+ type: "range.select",
1553
+ originalEvent: rangeEvent,
1554
+ payload: updatedPayload
1555
+ });
1556
+ }
1557
+ };
1558
+ var parseArrayOption = (value) => {
1559
+ if (Array.isArray(value)) {
1560
+ return value;
1561
+ }
1562
+ if (value) {
1563
+ return JSON.parse(value);
1564
+ }
1565
+ return void 0;
1566
+ };
1339
1567
  var TimeSeriesChartWrapper = (props) => {
1340
- const {
1568
+ var _b, _c, _d;
1569
+ const _a = props, {
1341
1570
  width,
1342
1571
  height,
1343
1572
  chartData,
@@ -1350,12 +1579,57 @@ var TimeSeriesChartWrapper = (props) => {
1350
1579
  markerDisplay,
1351
1580
  onClick,
1352
1581
  onPointMouseOver,
1353
- onPointMouseOut
1354
- } = props;
1355
- const {
1582
+ onPointMouseOut,
1583
+ onSelect,
1584
+ splitByLayout,
1585
+ trellisKey,
1586
+ trellisSplitBy,
1356
1587
  backgroundColor,
1588
+ defaultFontColor,
1589
+ additionalTooltipValues,
1590
+ xAxisLineVisibility: xAxisLineVisibility,
1591
+ yAxisLineVisibility,
1592
+ y2AxisLineVisibility,
1593
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1594
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1595
+ } = _a, otherOptions = __objRest(_a, [
1596
+ "width",
1597
+ "height",
1598
+ "chartData",
1599
+ "options",
1600
+ "userLocale",
1601
+ "annotationX",
1602
+ "annotationLabel",
1603
+ "annotationColor",
1604
+ "legendDisplay",
1605
+ "markerDisplay",
1606
+ "onClick",
1607
+ "onPointMouseOver",
1608
+ "onPointMouseOut",
1609
+ "onSelect",
1610
+ "splitByLayout",
1611
+ "trellisKey",
1612
+ "trellisSplitBy",
1613
+ "backgroundColor",
1614
+ "defaultFontColor",
1615
+ "additionalTooltipValues",
1616
+ // Extract axis line visibility options from props
1617
+ "xAxisLineVisibility",
1618
+ "yAxisLineVisibility",
1619
+ "y2AxisLineVisibility",
1620
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1621
+ "showYAxisWithZero",
1622
+ "showY2AxisWithZero"
1623
+ ]);
1624
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1625
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1626
+ const {
1627
+ backgroundColor: bgColorFromOptions,
1357
1628
  seriesColors: seriesColorsStr,
1358
1629
  fieldColors,
1630
+ legendLabels: legendLabelsStr,
1631
+ legendMode,
1632
+ legendTruncation,
1359
1633
  "axisTitleX.text": xAxisTitleText,
1360
1634
  "axisTitleY.text": yAxisTitleText,
1361
1635
  "axisTitleY2.text": y2AxisTitleText,
@@ -1363,8 +1637,12 @@ var TimeSeriesChartWrapper = (props) => {
1363
1637
  "axisTitleY.visibility": yAxisTitleVisibility,
1364
1638
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1365
1639
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1640
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1641
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
1366
1642
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1643
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1367
1644
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1645
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1368
1646
  "axisY.abbreviation": yAxisAbbreviation,
1369
1647
  "axisY.scale": yAxisScale,
1370
1648
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1374,10 +1652,73 @@ var TimeSeriesChartWrapper = (props) => {
1374
1652
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1375
1653
  "chart.overlayFields": overlayFieldsStr,
1376
1654
  "chart.nullValueMode": nullValueMode,
1377
- lineWidth
1655
+ "chart.showDataLabels": showDataLabels,
1656
+ lineWidth,
1657
+ lineDashStyle,
1658
+ fieldDashStyles: lineDashStylesByFieldStr,
1659
+ stepPosition,
1660
+ fieldStepPositions: stepPositionsByFieldStr,
1661
+ yAxisMin: yAxisMinRaw,
1662
+ yAxisMax: yAxisMaxRaw,
1663
+ y2AxisMin: y2AxisMinRaw,
1664
+ y2AxisMax: y2AxisMaxRaw,
1665
+ showXMajorGridLines,
1666
+ showYMajorGridLines,
1667
+ showY2MajorGridLines,
1668
+ showYMinorGridLines,
1669
+ showY2MinorGridLines,
1670
+ showLineSmoothing,
1671
+ xAxisMajorTickVisibility,
1672
+ xAxisMajorTickSize,
1673
+ yAxisMajorTickVisibility,
1674
+ y2AxisMajorTickVisibility,
1675
+ yAxisMajorTickSize,
1676
+ y2AxisMajorTickSize,
1677
+ yAxisMajorTickInterval,
1678
+ y2AxisMajorTickInterval,
1679
+ yAxisMinorTickVisibility,
1680
+ y2AxisMinorTickVisibility,
1681
+ yAxisMinorTickSize,
1682
+ y2AxisMinorTickSize,
1683
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1684
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1378
1685
  } = options;
1686
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1687
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1688
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1689
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
1690
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1691
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1692
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1693
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1694
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
1695
+ const showYAxisLine = yAxisLineVisibility === "show";
1696
+ const showY2AxisLine = y2AxisLineVisibility === "show";
1697
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1698
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1699
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1700
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1701
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1702
+ if (simpleXMLValue) return Number(simpleXMLValue);
1703
+ if (canvasValue) return Number(canvasValue);
1704
+ return void 0;
1705
+ };
1706
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1707
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1708
+ y2AxisMajorUnitFromSimpleXML,
1709
+ y2AxisMajorTickInterval
1710
+ );
1711
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
1712
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
1713
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
1714
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
1715
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
1379
1716
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1380
1717
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1718
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1719
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
1720
+ const legendLabels = parseArrayOption(legendLabelsStr);
1721
+ const bgColor = backgroundColor || bgColorFromOptions;
1381
1722
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1382
1723
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1383
1724
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1388,31 +1729,64 @@ var TimeSeriesChartWrapper = (props) => {
1388
1729
  fields: chartData.fields,
1389
1730
  columns: chartData.seriesList
1390
1731
  });
1391
- const xField = getFieldName(filteredChartData.fields[0]);
1732
+ const xField = getFieldName2(filteredChartData.fields[0]);
1392
1733
  const yFields = getFieldNames(
1393
1734
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1394
1735
  );
1395
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1396
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1736
+ const y2Fields = (0, react_exports.useMemo)(
1737
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1738
+ [y2FieldsStr]
1739
+ );
1740
+ const overlayFields = (0, react_exports.useMemo)(
1741
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1742
+ [overlayFieldsStr]
1743
+ );
1397
1744
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1398
1745
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1399
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1746
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1747
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1400
1748
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1401
1749
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1402
1750
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1403
1751
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1404
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1405
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1406
- let y2ScaleConfig = {};
1407
- if (y2Enabled) {
1408
- y2ScaleConfig = getY2ScaleConfig(
1409
- y2AxisTitle,
1410
- y2AxisAbbreviation,
1411
- y2AxisScale,
1412
- y2IntegerUnits,
1413
- y2AxisLabelVisibility
1414
- );
1415
- }
1752
+ const xScaleConfig = (0, react_exports.useMemo)(
1753
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1754
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1755
+ );
1756
+ const yScaleConfig = (0, react_exports.useMemo)(
1757
+ () => getYScaleConfig(
1758
+ yAxisTitle,
1759
+ yAxisAbbreviation,
1760
+ yAxisScale,
1761
+ yAxisLabelVisibility,
1762
+ yAxisMin,
1763
+ yAxisMax
1764
+ ),
1765
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1766
+ );
1767
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1768
+ if (y2Enabled) {
1769
+ return getY2ScaleConfig(
1770
+ y2AxisTitle,
1771
+ y2AxisAbbreviation,
1772
+ y2AxisScale,
1773
+ y2IntegerUnits,
1774
+ y2AxisLabelVisibility,
1775
+ y2AxisMin,
1776
+ y2AxisMax
1777
+ );
1778
+ }
1779
+ return {};
1780
+ }, [
1781
+ y2Enabled,
1782
+ y2AxisTitle,
1783
+ y2AxisAbbreviation,
1784
+ y2AxisScale,
1785
+ y2IntegerUnits,
1786
+ y2AxisLabelVisibility,
1787
+ y2AxisMin,
1788
+ y2AxisMax
1789
+ ]);
1416
1790
  const uplotContainerElement = (0, react_exports.useRef)(null);
1417
1791
  const seriesDataFormatted = [
1418
1792
  filteredChartData.columns[0],
@@ -1428,9 +1802,25 @@ var TimeSeriesChartWrapper = (props) => {
1428
1802
  overlayFields,
1429
1803
  y2Enabled,
1430
1804
  nullValueMode,
1431
- markerDisplay
1805
+ markerDisplay,
1806
+ lineDashStyle,
1807
+ lineDashStylesByField,
1808
+ stepPosition,
1809
+ stepPositionsByField
1432
1810
  ),
1433
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1811
+ [
1812
+ yFields,
1813
+ y2Fields,
1814
+ lineWidth,
1815
+ overlayFields,
1816
+ y2Enabled,
1817
+ nullValueMode,
1818
+ markerDisplay,
1819
+ lineDashStyle,
1820
+ lineDashStylesByField,
1821
+ stepPosition,
1822
+ stepPositionsByField
1823
+ ]
1434
1824
  );
1435
1825
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1436
1826
  () => getAnnotationsForCanvas({
@@ -1444,25 +1834,59 @@ var TimeSeriesChartWrapper = (props) => {
1444
1834
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1445
1835
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1446
1836
  );
1447
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1837
+ const isSeriesCompare = legendMode === "seriesCompare";
1838
+ const legend = (0, react_exports.useMemo)(
1839
+ () => getLegend({
1840
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
1841
+ isSeriesCompare,
1842
+ legendTruncation
1843
+ }),
1844
+ [legendDisplay, isSeriesCompare, legendTruncation]
1845
+ );
1448
1846
  const handleChartClick = react_exports.useCallback(
1449
1847
  (event) => {
1450
1848
  if (onClick) {
1451
- handleClick(event, onClick);
1849
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1452
1850
  }
1453
1851
  },
1454
- [onClick]
1852
+ [onClick, trellisKey, trellisSplitBy]
1455
1853
  );
1456
1854
  const handleChartLegendClick = react_exports.useCallback(
1457
1855
  (event) => {
1458
1856
  if (onClick) {
1459
- handleLegendClick(event, onClick);
1857
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1858
+ }
1859
+ },
1860
+ [onClick, trellisKey, trellisSplitBy]
1861
+ );
1862
+ const handleChartRangeSelection = react_exports.useCallback(
1863
+ (range) => {
1864
+ if (onSelect) {
1865
+ handleRangeSelection(range, onSelect, chartData, trellisKey, trellisSplitBy);
1866
+ }
1867
+ },
1868
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1869
+ );
1870
+ const handleChartRangeZoom = react_exports.useCallback(
1871
+ (range) => {
1872
+ if (onSelect) {
1873
+ handleRangeZoom(range, onSelect, chartData, trellisKey, trellisSplitBy);
1460
1874
  }
1461
1875
  },
1462
- [onClick]
1876
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1877
+ );
1878
+ const xFieldToUse = xFieldFromProps || xField;
1879
+ const enableSearchZoom = react_exports.useMemo(
1880
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1881
+ [eventHandlers, xFieldToUse]
1463
1882
  );
1464
1883
  const lastPayloadRef = react_exports.useRef(null);
1465
1884
  const lastOriginalEventRef = react_exports.useRef(null);
1885
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1886
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1887
+ react_exports.useEffect(() => {
1888
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1889
+ }, [additionalTooltipValues]);
1466
1890
  const handleChartCrosshairChange = react_exports.useCallback(
1467
1891
  (event) => {
1468
1892
  if (onPointMouseOver || onPointMouseOut) {
@@ -1474,6 +1898,7 @@ var TimeSeriesChartWrapper = (props) => {
1474
1898
  payload: lastPayloadRef.current
1475
1899
  });
1476
1900
  }
1901
+ previousMouseoverPayloadRef.current = null;
1477
1902
  return;
1478
1903
  }
1479
1904
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1481,25 +1906,36 @@ var TimeSeriesChartWrapper = (props) => {
1481
1906
  });
1482
1907
  delete payload.seriesKey;
1483
1908
  if (event.rowContext) {
1484
- Object.keys(event.rowContext).forEach((fieldName) => {
1485
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1486
- });
1909
+ Object.assign(
1910
+ payload,
1911
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1912
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1913
+ return acc;
1914
+ }, {})
1915
+ );
1916
+ }
1917
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1918
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1919
+ return;
1487
1920
  }
1488
- lastPayloadRef.current = payload;
1921
+ lastPayloadRef.current = updatedPayload;
1489
1922
  lastOriginalEventRef.current = event;
1923
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1490
1924
  if (onPointMouseOver) {
1491
1925
  onPointMouseOver({
1492
1926
  type: "point.mouseover",
1493
1927
  originalEvent: event,
1494
- payload
1928
+ payload: updatedPayload
1495
1929
  });
1496
1930
  }
1497
1931
  }
1498
1932
  },
1499
- [onPointMouseOver, onPointMouseOut]
1933
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1500
1934
  );
1501
- const memoizedChart = (0, react_exports.useMemo)(
1502
- () => /* @__PURE__ */ react_exports.createElement(
1935
+ 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}`;
1936
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1937
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1938
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1503
1939
  visualization_canvas_exports.TimeSeriesChart,
1504
1940
  {
1505
1941
  data: chartData,
@@ -1509,49 +1945,121 @@ var TimeSeriesChartWrapper = (props) => {
1509
1945
  seriesColorsByField,
1510
1946
  seriesConfig: seriesOverrides,
1511
1947
  legend,
1948
+ legendLabels,
1949
+ legendTruncation,
1950
+ isSeriesCompare: legendMode === "seriesCompare",
1951
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1512
1952
  scaleConfig,
1513
1953
  timestampFormat: "expanded",
1514
1954
  onCrosshairClick: onClick ? handleChartClick : void 0,
1515
1955
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1516
1956
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1957
+ onRangeSelection: handleChartRangeSelection,
1958
+ onRangeZoom: computedOnRangeZoom,
1959
+ serverSideZoom: enableSearchZoom,
1517
1960
  userLocale,
1518
1961
  events: chartingEventAnnotations,
1519
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
1962
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
1963
+ additionalTooltipValuesRef,
1964
+ showXMajorGridLines,
1965
+ showYMajorGridLines,
1966
+ showY2MajorGridLines,
1967
+ showYMinorGridLines,
1968
+ showY2MinorGridLines,
1969
+ showLineSmoothing,
1970
+ dataValuesDisplay,
1971
+ showXMajorTicks,
1972
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
1973
+ showYMajorTicks,
1974
+ showY2MajorTicks,
1975
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
1976
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
1977
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
1978
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
1979
+ showYMinorTicks,
1980
+ showY2MinorTicks,
1981
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
1982
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
1983
+ showYAxisWithZero,
1984
+ showY2AxisWithZero,
1985
+ showXAxisLine,
1986
+ showYAxisLine,
1987
+ showY2AxisLine,
1988
+ xAxisMaxLabelParts
1520
1989
  }
1521
- ),
1522
- [
1523
- chartData,
1524
- containerWidth,
1525
- containerHeight,
1526
- seriesColors,
1527
- seriesColorsByField,
1528
- seriesOverrides,
1529
- legend,
1530
- scaleConfig,
1531
- userLocale,
1532
- chartingEventAnnotations,
1533
- onClick,
1534
- handleChartClick,
1535
- onPointMouseOver,
1536
- onPointMouseOut,
1537
- handleChartCrosshairChange,
1538
- handleChartLegendClick
1539
- ]
1540
- );
1990
+ ));
1991
+ }, [
1992
+ onSelect,
1993
+ handleChartRangeZoom,
1994
+ dataKey,
1995
+ chartData,
1996
+ containerWidth,
1997
+ containerHeight,
1998
+ seriesColors,
1999
+ seriesColorsByField,
2000
+ seriesOverrides,
2001
+ legend,
2002
+ legendLabels,
2003
+ legendTruncation,
2004
+ scaleConfig,
2005
+ onClick,
2006
+ handleChartClick,
2007
+ onPointMouseOver,
2008
+ onPointMouseOut,
2009
+ handleChartCrosshairChange,
2010
+ handleChartLegendClick,
2011
+ handleChartRangeSelection,
2012
+ enableSearchZoom,
2013
+ userLocale,
2014
+ chartingEventAnnotations,
2015
+ showXMajorGridLines,
2016
+ showYMajorGridLines,
2017
+ showY2MajorGridLines,
2018
+ showYMinorGridLines,
2019
+ showY2MinorGridLines,
2020
+ showLineSmoothing,
2021
+ dataValuesDisplay,
2022
+ showXMajorTicks,
2023
+ xAxisMajorTickSizeNum,
2024
+ showYMajorTicks,
2025
+ showY2MajorTicks,
2026
+ yAxisMajorTickSizeNum,
2027
+ y2AxisMajorTickSizeNum,
2028
+ yAxisMajorTickIntervalNum,
2029
+ y2AxisMajorTickIntervalNum,
2030
+ showYMinorTicks,
2031
+ showY2MinorTicks,
2032
+ yAxisMinorTickSizeNum,
2033
+ y2AxisMinorTickSizeNum,
2034
+ showYAxisWithZero,
2035
+ showY2AxisWithZero,
2036
+ showXAxisLine,
2037
+ showYAxisLine,
2038
+ showY2AxisLine,
2039
+ legendMode,
2040
+ xAxisMaxLabelParts
2041
+ ]);
1541
2042
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1542
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1543
- }, [backgroundColor, memoizedChart]);
1544
- return /* @__PURE__ */ react_exports.createElement(
2043
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2044
+ }, [bgColor, memoizedChart]);
2045
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2046
+ TrellisTitle,
2047
+ {
2048
+ trellisKey,
2049
+ backgroundColor: bgColor,
2050
+ fontColor: defaultFontColor
2051
+ }
2052
+ ), /* @__PURE__ */ react_exports.createElement(
1545
2053
  TimeSeriesChartContainer,
1546
2054
  {
1547
- height,
2055
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1548
2056
  width,
1549
2057
  ref: uplotContainerElement,
1550
2058
  "data-test": "timeseries-chart-wrapper"
1551
2059
  },
1552
2060
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1553
2061
  memoizedVisualization
1554
- );
2062
+ ));
1555
2063
  };
1556
2064
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1557
2065