@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
package/Bubble.js CHANGED
@@ -248,6 +248,7 @@ var DefaultVizActionHandler = class {
248
248
  };
249
249
 
250
250
  // src/common/utils/dataUtils.ts
251
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
251
252
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
252
253
  const dataLength = data.length;
253
254
  const downsampledIndices = [];
@@ -421,9 +422,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
421
422
  let xColumn = [];
422
423
  const yColumns = [];
423
424
  const canDownsample = !ds.data.fields.some((field, index) => {
424
- var _a, _b;
425
- const fieldName = (_a = field.name) != null ? _a : field;
426
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
425
+ var _a;
426
+ const fieldName = getFieldName(field);
427
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
427
428
  const column = ds.data.columns[index];
428
429
  let hasDisplayedColumnThatCantBeDownsampled = false;
429
430
  if (fieldName === xField) {
@@ -627,6 +628,7 @@ var Charting = (props) => {
627
628
  const timezone = (0, react_exports.useContext)(TimezoneContext_default);
628
629
  const selectChartEvent = (0, react_exports.useRef)(null);
629
630
  const trellisEnabled = useTrellisEnabled(props.splitByLayout);
631
+ const isResizing = (0, react_exports.useRef)(false);
630
632
  const drawChartRef = (0, react_exports.useRef)(() => {
631
633
  });
632
634
  const debouncedDrawChart = (0, react_exports.useMemo)(
@@ -725,6 +727,9 @@ var Charting = (props) => {
725
727
  recalculateDownsamplingThreshold();
726
728
  }, [recalculateDownsamplingThreshold]);
727
729
  const handleSelect = useEventCallback_default((chartEvent) => {
730
+ if (isResizing.current) {
731
+ return;
732
+ }
728
733
  selectChartEvent.current = chartEvent;
729
734
  recalculateDownsamplingThreshold();
730
735
  const payload = appendTrellisToPayload(
@@ -859,6 +864,14 @@ var Charting = (props) => {
859
864
  }
860
865
  if (chart.current) {
861
866
  if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
867
+ isResizing.current = true;
868
+ queueMicrotask(() => {
869
+ try {
870
+ isResizing.current = false;
871
+ } catch (e) {
872
+ (0, lodash_exports.noop)(e);
873
+ }
874
+ });
862
875
  chart.current.resize(computedWidth, computedHeight);
863
876
  }
864
877
  }
@@ -1002,6 +1015,9 @@ var isTrellisEnabled = ({ options, featureFlags }) => {
1002
1015
  const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1003
1016
  return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1004
1017
  };
1018
+ var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
1019
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
1020
+ };
1005
1021
  var AxesChartDataConfig = {
1006
1022
  label: (0, i18n_exports._)("Data configurations"),
1007
1023
  layout: [
@@ -1135,9 +1151,6 @@ var AxesChartDataConfigBubble = {
1135
1151
  }
1136
1152
  ])
1137
1153
  };
1138
- var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
1139
- return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
1140
- };
1141
1154
  var AcceleratedRenderEditorLayout = [
1142
1155
  [
1143
1156
  {
@@ -1147,10 +1160,9 @@ var AcceleratedRenderEditorLayout = [
1147
1160
  showEditor: isAcceleratedRenderFeatureFlagOn,
1148
1161
  editorProps: {
1149
1162
  help: (0, i18n_exports._)(
1150
- "Render visualizations faster for large datasets. Some functionalities might not be available in this mode."
1163
+ "Render visualizations faster for large datasets. Split series is not available in this mode."
1151
1164
  ),
1152
1165
  helpFormat: "under"
1153
- // TODO: uncomment and replace link with real link (SCP-75907)
1154
1166
  // helpTextLink: {
1155
1167
  // href: 'https://splunkui.splunk.com/Packages/visualizations/Overview',
1156
1168
  // label: 'Learn More.',
@@ -2312,7 +2324,7 @@ var Cover = styled_components_default.div`
2312
2324
  bottom: 0;
2313
2325
  `;
2314
2326
  var Blocker = styled_components_default.div.attrs({
2315
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
2327
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
2316
2328
  })`
2317
2329
  position: relative;
2318
2330
  width: 100%;
@@ -2393,7 +2405,7 @@ var withFixedSizeContainer = (Viz) => {
2393
2405
  FixSizeItem,
2394
2406
  {
2395
2407
  "data-test": "fix-size-item",
2396
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
2408
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
2397
2409
  width,
2398
2410
  height,
2399
2411
  backgroundColor
@@ -2761,6 +2773,16 @@ var mapToValues = (optionValuesSCMapping) => (options) => {
2761
2773
  });
2762
2774
  return convertedOptions;
2763
2775
  };
2776
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
2777
+ const rangeSelectEventHandler = eventHandlers.find(
2778
+ (eventHandler) => {
2779
+ var _a;
2780
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
2781
+ }
2782
+ );
2783
+ const xAxisIsTime = xField === "_time";
2784
+ return !!rangeSelectEventHandler && xAxisIsTime;
2785
+ };
2764
2786
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
2765
2787
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
2766
2788
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -2781,17 +2803,34 @@ var filterChartDataFromInternalFields = (chartData) => {
2781
2803
  var convert2DArrayToNumbers = (arr) => {
2782
2804
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
2783
2805
  };
2784
- var SideLegendWidth = 75;
2785
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
2806
+ var parseAxisValue = (val) => {
2807
+ if (val === void 0 || val === null || val === "auto" || val === "") {
2808
+ return void 0;
2809
+ }
2810
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
2811
+ return Number.isNaN(num) ? void 0 : num;
2812
+ };
2813
+ var parseXAxisLineVisibility = (visibility) => {
2814
+ if (visibility === "hide") return false;
2815
+ if (visibility === "show") return true;
2816
+ return void 0;
2817
+ };
2786
2818
  var getLegend = (props) => {
2787
2819
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
2820
+ const { isSeriesCompare, legendTruncation } = props;
2821
+ const commonLegendProps = {
2822
+ center: true,
2823
+ fontSize: 12,
2824
+ largerTiles: true,
2825
+ hideSeriesValue: !isSeriesCompare,
2826
+ // Show values if in seriesCompare mode
2827
+ legendTruncation
2828
+ };
2788
2829
  switch (legendPlacement) {
2789
2830
  case "off":
2790
2831
  return false;
2791
2832
  case "left":
2792
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
2793
- width: SideLegendWidth
2794
- }, commonLegendProps));
2833
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
2795
2834
  case "bottom":
2796
2835
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
2797
2836
  wrap: true
@@ -2801,9 +2840,7 @@ var getLegend = (props) => {
2801
2840
  wrap: true
2802
2841
  }, commonLegendProps));
2803
2842
  default:
2804
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
2805
- width: SideLegendWidth
2806
- }, commonLegendProps));
2843
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
2807
2844
  }
2808
2845
  };
2809
2846
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -2838,22 +2875,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
2838
2875
  const end = axisTitle.slice(-halfChars);
2839
2876
  return `${start}...${end}`;
2840
2877
  };
2841
- var getFieldName = (field) => {
2878
+ var getFieldName2 = (field) => {
2842
2879
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
2843
2880
  return fieldName;
2844
2881
  };
2845
2882
  var getFieldNames = (fields) => {
2846
- return fields.map((field) => getFieldName(field));
2883
+ return fields.map((field) => getFieldName2(field));
2847
2884
  };
2848
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
2885
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
2849
2886
  const xConfig = { x: {} };
2850
2887
  xConfig.x.label = label;
2851
2888
  if (xAxisLabelVisibility === "hide") {
2852
2889
  xConfig.x.hideLabels = true;
2853
2890
  }
2891
+ if (xAxisLabelRotation !== void 0) {
2892
+ xConfig.x.labelRotation = xAxisLabelRotation;
2893
+ }
2854
2894
  return xConfig;
2855
2895
  };
2856
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
2896
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
2857
2897
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
2858
2898
  const yConfig = { y: {} };
2859
2899
  yConfig.y.label = label;
@@ -2861,34 +2901,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
2861
2901
  if (yAxisAbbreviation !== "none") {
2862
2902
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
2863
2903
  }
2864
- if (yAxisAbbreviation === "none") {
2865
- yConfig.y.width = 55;
2866
- } else {
2904
+ if (yAxisAbbreviation !== "none") {
2867
2905
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
2868
2906
  }
2869
2907
  if (yAxisLabelVisibility === "hide") {
2870
2908
  yConfig.y.hideLabels = true;
2871
2909
  }
2910
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
2911
+ yConfig.y.range = (u, dataMin, dataMax) => {
2912
+ const min = yAxisMin != null ? yAxisMin : dataMin;
2913
+ const max = yAxisMax != null ? yAxisMax : dataMax;
2914
+ return [min, max];
2915
+ };
2916
+ }
2872
2917
  return yConfig;
2873
2918
  };
2874
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
2919
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
2875
2920
  const y2Config = { y2: {} };
2876
2921
  const scaleType = axisScale != null ? axisScale : "linear";
2877
2922
  y2Config.y2.label = label;
2878
2923
  y2Config.y2.side = "right";
2879
- y2Config.y2.showGrid = false;
2880
2924
  y2Config.y2.type = scaleType;
2881
2925
  if (axisAbbreviation !== "none") {
2882
2926
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
2927
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
2883
2928
  } else if (roundAxisLabelsToInteger) {
2884
2929
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
2885
2930
  }
2886
2931
  if (y2AxisLabelVisibility === "hide") {
2887
2932
  y2Config.y2.hideLabels = true;
2888
2933
  }
2934
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
2935
+ y2Config.y2.range = (u, dataMin, dataMax) => {
2936
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
2937
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
2938
+ return [min, max];
2939
+ };
2940
+ }
2889
2941
  return y2Config;
2890
2942
  };
2891
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
2943
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
2892
2944
  const seriesConfig = {};
2893
2945
  let spanGaps;
2894
2946
  let replaceNullsWithZero;
@@ -2915,6 +2967,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
2915
2967
  );
2916
2968
  if (shouldAssignToY2) {
2917
2969
  seriesConfig[field].overrides.scale = "y2";
2970
+ } else {
2971
+ seriesConfig[field].overrides.scale = "y";
2918
2972
  }
2919
2973
  }
2920
2974
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -2923,12 +2977,50 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
2923
2977
  if (markerDisplay !== void 0) {
2924
2978
  seriesConfig[field].markerDisplay = markerDisplay;
2925
2979
  }
2980
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
2981
+ if (fieldDashStyle) {
2982
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
2983
+ }
2984
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
2985
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
2986
+ if (fieldStepPosition && fieldStepPosition !== "off") {
2987
+ seriesConfig[field].stepPosition = fieldStepPosition;
2988
+ }
2926
2989
  if (replaceNullsWithZero !== void 0) {
2927
2990
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
2928
2991
  }
2929
2992
  });
2930
2993
  return seriesConfig;
2931
2994
  };
2995
+ var findRangeIndices = (xData, startValue, endValue) => {
2996
+ let startXIndex = -1;
2997
+ let endXIndex = -1;
2998
+ const xDataEpoch = xData.map((val) => {
2999
+ if (typeof val === "string") {
3000
+ return new Date(val).getTime() / 1e3;
3001
+ }
3002
+ return val;
3003
+ });
3004
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
3005
+ if (xDataEpoch[i] >= startValue) {
3006
+ startXIndex = i;
3007
+ break;
3008
+ }
3009
+ }
3010
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
3011
+ startXIndex = xDataEpoch.length - 1;
3012
+ }
3013
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
3014
+ if (xDataEpoch[i] <= endValue) {
3015
+ endXIndex = i;
3016
+ break;
3017
+ }
3018
+ }
3019
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
3020
+ endXIndex = 0;
3021
+ }
3022
+ return { startXIndex, endXIndex };
3023
+ };
2932
3024
 
2933
3025
  // src/common/TimeSeriesChartWrapper.tsx
2934
3026
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -2939,38 +3031,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
2939
3031
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
2940
3032
  }
2941
3033
  `;
2942
- var handleClick = (chartEvent, onClick) => {
3034
+ var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
3035
+ const result = __spreadValues({}, payload);
3036
+ if (trellisSplitBy) {
3037
+ result["trellis.name"] = trellisSplitBy;
3038
+ }
3039
+ if (trellisKey) {
3040
+ result["trellis.value"] = trellisKey;
3041
+ }
3042
+ return result;
3043
+ };
3044
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
3045
+ if (!previousPayload) {
3046
+ return true;
3047
+ }
3048
+ if (currentPayload.index !== previousPayload.index) {
3049
+ return true;
3050
+ }
3051
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
3052
+ return true;
3053
+ }
3054
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
3055
+ return true;
3056
+ }
3057
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
3058
+ return true;
3059
+ }
3060
+ return false;
3061
+ };
3062
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
2943
3063
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
2944
3064
  name: chartEvent.seriesKey
2945
3065
  });
2946
3066
  delete payload.seriesKey;
2947
3067
  if (chartEvent.rowContext) {
2948
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
2949
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
2950
- });
3068
+ Object.assign(
3069
+ payload,
3070
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
3071
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
3072
+ return acc;
3073
+ }, {})
3074
+ );
2951
3075
  }
3076
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
2952
3077
  if (onClick) {
2953
3078
  onClick({
2954
3079
  type: "point.click",
2955
3080
  originalEvent: chartEvent,
2956
- payload
3081
+ payload: updatedPayload
2957
3082
  });
2958
3083
  }
2959
3084
  };
2960
- var handleLegendClick = (chartEvent, onClick) => {
3085
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
2961
3086
  const payload = {
2962
3087
  name: chartEvent
2963
3088
  };
3089
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
2964
3090
  if (onClick) {
2965
3091
  onClick({
2966
3092
  type: "legend.click",
2967
3093
  originalEvent: chartEvent,
2968
- payload
3094
+ payload: updatedPayload
2969
3095
  });
2970
3096
  }
2971
3097
  };
3098
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3099
+ var _a;
3100
+ if (!rangeEvent) {
3101
+ return;
3102
+ }
3103
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3104
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3105
+ const payload = {
3106
+ startXIndex,
3107
+ startXValue: rangeEvent.start,
3108
+ endXIndex,
3109
+ endXValue: rangeEvent.end
3110
+ };
3111
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3112
+ if (onSelect) {
3113
+ onSelect({
3114
+ type: "range.selectBeforeZoom",
3115
+ originalEvent: rangeEvent,
3116
+ payload: updatedPayload
3117
+ });
3118
+ }
3119
+ };
3120
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3121
+ var _a;
3122
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3123
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3124
+ const payload = {
3125
+ startXIndex,
3126
+ startXValue: rangeEvent.start,
3127
+ endXIndex,
3128
+ endXValue: rangeEvent.end
3129
+ };
3130
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3131
+ if (onSelect) {
3132
+ onSelect({
3133
+ type: "range.select",
3134
+ originalEvent: rangeEvent,
3135
+ payload: updatedPayload
3136
+ });
3137
+ }
3138
+ };
3139
+ var parseArrayOption = (value) => {
3140
+ if (Array.isArray(value)) {
3141
+ return value;
3142
+ }
3143
+ if (value) {
3144
+ return JSON.parse(value);
3145
+ }
3146
+ return void 0;
3147
+ };
2972
3148
  var TimeSeriesChartWrapper = (props) => {
2973
- const {
3149
+ var _b, _c, _d;
3150
+ const _a = props, {
2974
3151
  width,
2975
3152
  height,
2976
3153
  chartData,
@@ -2983,12 +3160,57 @@ var TimeSeriesChartWrapper = (props) => {
2983
3160
  markerDisplay,
2984
3161
  onClick,
2985
3162
  onPointMouseOver,
2986
- onPointMouseOut
2987
- } = props;
2988
- const {
3163
+ onPointMouseOut,
3164
+ onSelect,
3165
+ splitByLayout,
3166
+ trellisKey,
3167
+ trellisSplitBy,
2989
3168
  backgroundColor,
3169
+ defaultFontColor,
3170
+ additionalTooltipValues,
3171
+ xAxisLineVisibility: xAxisLineVisibility,
3172
+ yAxisLineVisibility,
3173
+ y2AxisLineVisibility,
3174
+ showYAxisWithZero: showYAxisWithZeroFromProps,
3175
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
3176
+ } = _a, otherOptions = __objRest(_a, [
3177
+ "width",
3178
+ "height",
3179
+ "chartData",
3180
+ "options",
3181
+ "userLocale",
3182
+ "annotationX",
3183
+ "annotationLabel",
3184
+ "annotationColor",
3185
+ "legendDisplay",
3186
+ "markerDisplay",
3187
+ "onClick",
3188
+ "onPointMouseOver",
3189
+ "onPointMouseOut",
3190
+ "onSelect",
3191
+ "splitByLayout",
3192
+ "trellisKey",
3193
+ "trellisSplitBy",
3194
+ "backgroundColor",
3195
+ "defaultFontColor",
3196
+ "additionalTooltipValues",
3197
+ // Extract axis line visibility options from props
3198
+ "xAxisLineVisibility",
3199
+ "yAxisLineVisibility",
3200
+ "y2AxisLineVisibility",
3201
+ // Extract showYAxisWithZero directly from props for accelerated render mode
3202
+ "showYAxisWithZero",
3203
+ "showY2AxisWithZero"
3204
+ ]);
3205
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
3206
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
3207
+ const {
3208
+ backgroundColor: bgColorFromOptions,
2990
3209
  seriesColors: seriesColorsStr,
2991
3210
  fieldColors,
3211
+ legendLabels: legendLabelsStr,
3212
+ legendMode,
3213
+ legendTruncation,
2992
3214
  "axisTitleX.text": xAxisTitleText,
2993
3215
  "axisTitleY.text": yAxisTitleText,
2994
3216
  "axisTitleY2.text": y2AxisTitleText,
@@ -2996,8 +3218,12 @@ var TimeSeriesChartWrapper = (props) => {
2996
3218
  "axisTitleY.visibility": yAxisTitleVisibility,
2997
3219
  "axisTitleY2.visibility": y2AxisTitleVisibility,
2998
3220
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
3221
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
3222
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
2999
3223
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
3224
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
3000
3225
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
3226
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
3001
3227
  "axisY.abbreviation": yAxisAbbreviation,
3002
3228
  "axisY.scale": yAxisScale,
3003
3229
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -3007,10 +3233,73 @@ var TimeSeriesChartWrapper = (props) => {
3007
3233
  "axisLabelsY2.integerUnits": y2IntegerUnits,
3008
3234
  "chart.overlayFields": overlayFieldsStr,
3009
3235
  "chart.nullValueMode": nullValueMode,
3010
- lineWidth
3236
+ "chart.showDataLabels": showDataLabels,
3237
+ lineWidth,
3238
+ lineDashStyle,
3239
+ fieldDashStyles: lineDashStylesByFieldStr,
3240
+ stepPosition,
3241
+ fieldStepPositions: stepPositionsByFieldStr,
3242
+ yAxisMin: yAxisMinRaw,
3243
+ yAxisMax: yAxisMaxRaw,
3244
+ y2AxisMin: y2AxisMinRaw,
3245
+ y2AxisMax: y2AxisMaxRaw,
3246
+ showXMajorGridLines,
3247
+ showYMajorGridLines,
3248
+ showY2MajorGridLines,
3249
+ showYMinorGridLines,
3250
+ showY2MinorGridLines,
3251
+ showLineSmoothing,
3252
+ xAxisMajorTickVisibility,
3253
+ xAxisMajorTickSize,
3254
+ yAxisMajorTickVisibility,
3255
+ y2AxisMajorTickVisibility,
3256
+ yAxisMajorTickSize,
3257
+ y2AxisMajorTickSize,
3258
+ yAxisMajorTickInterval,
3259
+ y2AxisMajorTickInterval,
3260
+ yAxisMinorTickVisibility,
3261
+ y2AxisMinorTickVisibility,
3262
+ yAxisMinorTickSize,
3263
+ y2AxisMinorTickSize,
3264
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
3265
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
3011
3266
  } = options;
3267
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
3268
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
3269
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
3270
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
3271
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
3272
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
3273
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
3274
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
3275
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
3276
+ const showYAxisLine = yAxisLineVisibility === "show";
3277
+ const showY2AxisLine = y2AxisLineVisibility === "show";
3278
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
3279
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
3280
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
3281
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
3282
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
3283
+ if (simpleXMLValue) return Number(simpleXMLValue);
3284
+ if (canvasValue) return Number(canvasValue);
3285
+ return void 0;
3286
+ };
3287
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
3288
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
3289
+ y2AxisMajorUnitFromSimpleXML,
3290
+ y2AxisMajorTickInterval
3291
+ );
3292
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
3293
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
3294
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
3295
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
3296
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
3012
3297
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
3013
3298
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
3299
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
3300
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
3301
+ const legendLabels = parseArrayOption(legendLabelsStr);
3302
+ const bgColor = backgroundColor || bgColorFromOptions;
3014
3303
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
3015
3304
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
3016
3305
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -3021,31 +3310,64 @@ var TimeSeriesChartWrapper = (props) => {
3021
3310
  fields: chartData.fields,
3022
3311
  columns: chartData.seriesList
3023
3312
  });
3024
- const xField = getFieldName(filteredChartData.fields[0]);
3313
+ const xField = getFieldName2(filteredChartData.fields[0]);
3025
3314
  const yFields = getFieldNames(
3026
3315
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
3027
3316
  );
3028
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
3029
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
3317
+ const y2Fields = (0, react_exports.useMemo)(
3318
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
3319
+ [y2FieldsStr]
3320
+ );
3321
+ const overlayFields = (0, react_exports.useMemo)(
3322
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
3323
+ [overlayFieldsStr]
3324
+ );
3030
3325
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
3031
3326
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
3032
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
3327
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
3328
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
3033
3329
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
3034
3330
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
3035
3331
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
3036
3332
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
3037
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
3038
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
3039
- let y2ScaleConfig = {};
3040
- if (y2Enabled) {
3041
- y2ScaleConfig = getY2ScaleConfig(
3042
- y2AxisTitle,
3043
- y2AxisAbbreviation,
3044
- y2AxisScale,
3045
- y2IntegerUnits,
3046
- y2AxisLabelVisibility
3047
- );
3048
- }
3333
+ const xScaleConfig = (0, react_exports.useMemo)(
3334
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
3335
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
3336
+ );
3337
+ const yScaleConfig = (0, react_exports.useMemo)(
3338
+ () => getYScaleConfig(
3339
+ yAxisTitle,
3340
+ yAxisAbbreviation,
3341
+ yAxisScale,
3342
+ yAxisLabelVisibility,
3343
+ yAxisMin,
3344
+ yAxisMax
3345
+ ),
3346
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
3347
+ );
3348
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
3349
+ if (y2Enabled) {
3350
+ return getY2ScaleConfig(
3351
+ y2AxisTitle,
3352
+ y2AxisAbbreviation,
3353
+ y2AxisScale,
3354
+ y2IntegerUnits,
3355
+ y2AxisLabelVisibility,
3356
+ y2AxisMin,
3357
+ y2AxisMax
3358
+ );
3359
+ }
3360
+ return {};
3361
+ }, [
3362
+ y2Enabled,
3363
+ y2AxisTitle,
3364
+ y2AxisAbbreviation,
3365
+ y2AxisScale,
3366
+ y2IntegerUnits,
3367
+ y2AxisLabelVisibility,
3368
+ y2AxisMin,
3369
+ y2AxisMax
3370
+ ]);
3049
3371
  const uplotContainerElement = (0, react_exports.useRef)(null);
3050
3372
  const seriesDataFormatted = [
3051
3373
  filteredChartData.columns[0],
@@ -3061,9 +3383,25 @@ var TimeSeriesChartWrapper = (props) => {
3061
3383
  overlayFields,
3062
3384
  y2Enabled,
3063
3385
  nullValueMode,
3064
- markerDisplay
3386
+ markerDisplay,
3387
+ lineDashStyle,
3388
+ lineDashStylesByField,
3389
+ stepPosition,
3390
+ stepPositionsByField
3065
3391
  ),
3066
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
3392
+ [
3393
+ yFields,
3394
+ y2Fields,
3395
+ lineWidth,
3396
+ overlayFields,
3397
+ y2Enabled,
3398
+ nullValueMode,
3399
+ markerDisplay,
3400
+ lineDashStyle,
3401
+ lineDashStylesByField,
3402
+ stepPosition,
3403
+ stepPositionsByField
3404
+ ]
3067
3405
  );
3068
3406
  const chartingEventAnnotations = (0, react_exports.useMemo)(
3069
3407
  () => getAnnotationsForCanvas({
@@ -3077,25 +3415,59 @@ var TimeSeriesChartWrapper = (props) => {
3077
3415
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
3078
3416
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
3079
3417
  );
3080
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
3418
+ const isSeriesCompare = legendMode === "seriesCompare";
3419
+ const legend = (0, react_exports.useMemo)(
3420
+ () => getLegend({
3421
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
3422
+ isSeriesCompare,
3423
+ legendTruncation
3424
+ }),
3425
+ [legendDisplay, isSeriesCompare, legendTruncation]
3426
+ );
3081
3427
  const handleChartClick = react_exports.useCallback(
3082
3428
  (event) => {
3083
3429
  if (onClick) {
3084
- handleClick(event, onClick);
3430
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
3085
3431
  }
3086
3432
  },
3087
- [onClick]
3433
+ [onClick, trellisKey, trellisSplitBy]
3088
3434
  );
3089
3435
  const handleChartLegendClick = react_exports.useCallback(
3090
3436
  (event) => {
3091
3437
  if (onClick) {
3092
- handleLegendClick(event, onClick);
3438
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
3439
+ }
3440
+ },
3441
+ [onClick, trellisKey, trellisSplitBy]
3442
+ );
3443
+ const handleChartRangeSelection = react_exports.useCallback(
3444
+ (range2) => {
3445
+ if (onSelect) {
3446
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3093
3447
  }
3094
3448
  },
3095
- [onClick]
3449
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3450
+ );
3451
+ const handleChartRangeZoom = react_exports.useCallback(
3452
+ (range2) => {
3453
+ if (onSelect) {
3454
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3455
+ }
3456
+ },
3457
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3458
+ );
3459
+ const xFieldToUse = xFieldFromProps || xField;
3460
+ const enableSearchZoom = react_exports.useMemo(
3461
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
3462
+ [eventHandlers, xFieldToUse]
3096
3463
  );
3097
3464
  const lastPayloadRef = react_exports.useRef(null);
3098
3465
  const lastOriginalEventRef = react_exports.useRef(null);
3466
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
3467
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
3468
+ react_exports.useEffect(() => {
3469
+ additionalTooltipValuesRef.current = additionalTooltipValues;
3470
+ }, [additionalTooltipValues]);
3099
3471
  const handleChartCrosshairChange = react_exports.useCallback(
3100
3472
  (event) => {
3101
3473
  if (onPointMouseOver || onPointMouseOut) {
@@ -3107,6 +3479,7 @@ var TimeSeriesChartWrapper = (props) => {
3107
3479
  payload: lastPayloadRef.current
3108
3480
  });
3109
3481
  }
3482
+ previousMouseoverPayloadRef.current = null;
3110
3483
  return;
3111
3484
  }
3112
3485
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -3114,25 +3487,36 @@ var TimeSeriesChartWrapper = (props) => {
3114
3487
  });
3115
3488
  delete payload.seriesKey;
3116
3489
  if (event.rowContext) {
3117
- Object.keys(event.rowContext).forEach((fieldName) => {
3118
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
3119
- });
3490
+ Object.assign(
3491
+ payload,
3492
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
3493
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
3494
+ return acc;
3495
+ }, {})
3496
+ );
3120
3497
  }
3121
- lastPayloadRef.current = payload;
3498
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3499
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
3500
+ return;
3501
+ }
3502
+ lastPayloadRef.current = updatedPayload;
3122
3503
  lastOriginalEventRef.current = event;
3504
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
3123
3505
  if (onPointMouseOver) {
3124
3506
  onPointMouseOver({
3125
3507
  type: "point.mouseover",
3126
3508
  originalEvent: event,
3127
- payload
3509
+ payload: updatedPayload
3128
3510
  });
3129
3511
  }
3130
3512
  }
3131
3513
  },
3132
- [onPointMouseOver, onPointMouseOut]
3514
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
3133
3515
  );
3134
- const memoizedChart = (0, react_exports.useMemo)(
3135
- () => /* @__PURE__ */ react_exports.createElement(
3516
+ 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}`;
3517
+ const memoizedChart = (0, react_exports.useMemo)(() => {
3518
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
3519
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
3136
3520
  visualization_canvas_exports.TimeSeriesChart,
3137
3521
  {
3138
3522
  data: chartData,
@@ -3142,49 +3526,121 @@ var TimeSeriesChartWrapper = (props) => {
3142
3526
  seriesColorsByField,
3143
3527
  seriesConfig: seriesOverrides,
3144
3528
  legend,
3529
+ legendLabels,
3530
+ legendTruncation,
3531
+ isSeriesCompare: legendMode === "seriesCompare",
3532
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
3145
3533
  scaleConfig,
3146
3534
  timestampFormat: "expanded",
3147
3535
  onCrosshairClick: onClick ? handleChartClick : void 0,
3148
3536
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
3149
3537
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
3538
+ onRangeSelection: handleChartRangeSelection,
3539
+ onRangeZoom: computedOnRangeZoom,
3540
+ serverSideZoom: enableSearchZoom,
3150
3541
  userLocale,
3151
3542
  events: chartingEventAnnotations,
3152
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
3153
- }
3154
- ),
3155
- [
3156
- chartData,
3157
- containerWidth,
3158
- containerHeight,
3159
- seriesColors,
3160
- seriesColorsByField,
3161
- seriesOverrides,
3162
- legend,
3163
- scaleConfig,
3164
- userLocale,
3165
- chartingEventAnnotations,
3166
- onClick,
3167
- handleChartClick,
3168
- onPointMouseOver,
3169
- onPointMouseOut,
3170
- handleChartCrosshairChange,
3171
- handleChartLegendClick
3172
- ]
3173
- );
3543
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
3544
+ additionalTooltipValuesRef,
3545
+ showXMajorGridLines,
3546
+ showYMajorGridLines,
3547
+ showY2MajorGridLines,
3548
+ showYMinorGridLines,
3549
+ showY2MinorGridLines,
3550
+ showLineSmoothing,
3551
+ dataValuesDisplay,
3552
+ showXMajorTicks,
3553
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
3554
+ showYMajorTicks,
3555
+ showY2MajorTicks,
3556
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
3557
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
3558
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
3559
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
3560
+ showYMinorTicks,
3561
+ showY2MinorTicks,
3562
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
3563
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
3564
+ showYAxisWithZero,
3565
+ showY2AxisWithZero,
3566
+ showXAxisLine,
3567
+ showYAxisLine,
3568
+ showY2AxisLine,
3569
+ xAxisMaxLabelParts
3570
+ }
3571
+ ));
3572
+ }, [
3573
+ onSelect,
3574
+ handleChartRangeZoom,
3575
+ dataKey,
3576
+ chartData,
3577
+ containerWidth,
3578
+ containerHeight,
3579
+ seriesColors,
3580
+ seriesColorsByField,
3581
+ seriesOverrides,
3582
+ legend,
3583
+ legendLabels,
3584
+ legendTruncation,
3585
+ scaleConfig,
3586
+ onClick,
3587
+ handleChartClick,
3588
+ onPointMouseOver,
3589
+ onPointMouseOut,
3590
+ handleChartCrosshairChange,
3591
+ handleChartLegendClick,
3592
+ handleChartRangeSelection,
3593
+ enableSearchZoom,
3594
+ userLocale,
3595
+ chartingEventAnnotations,
3596
+ showXMajorGridLines,
3597
+ showYMajorGridLines,
3598
+ showY2MajorGridLines,
3599
+ showYMinorGridLines,
3600
+ showY2MinorGridLines,
3601
+ showLineSmoothing,
3602
+ dataValuesDisplay,
3603
+ showXMajorTicks,
3604
+ xAxisMajorTickSizeNum,
3605
+ showYMajorTicks,
3606
+ showY2MajorTicks,
3607
+ yAxisMajorTickSizeNum,
3608
+ y2AxisMajorTickSizeNum,
3609
+ yAxisMajorTickIntervalNum,
3610
+ y2AxisMajorTickIntervalNum,
3611
+ showYMinorTicks,
3612
+ showY2MinorTicks,
3613
+ yAxisMinorTickSizeNum,
3614
+ y2AxisMinorTickSizeNum,
3615
+ showYAxisWithZero,
3616
+ showY2AxisWithZero,
3617
+ showXAxisLine,
3618
+ showYAxisLine,
3619
+ showY2AxisLine,
3620
+ legendMode,
3621
+ xAxisMaxLabelParts
3622
+ ]);
3174
3623
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
3175
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
3176
- }, [backgroundColor, memoizedChart]);
3177
- return /* @__PURE__ */ react_exports.createElement(
3624
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
3625
+ }, [bgColor, memoizedChart]);
3626
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
3627
+ TrellisTitle,
3628
+ {
3629
+ trellisKey,
3630
+ backgroundColor: bgColor,
3631
+ fontColor: defaultFontColor
3632
+ }
3633
+ ), /* @__PURE__ */ react_exports.createElement(
3178
3634
  TimeSeriesChartContainer,
3179
3635
  {
3180
- height,
3636
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
3181
3637
  width,
3182
3638
  ref: uplotContainerElement,
3183
3639
  "data-test": "timeseries-chart-wrapper"
3184
3640
  },
3185
3641
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
3186
3642
  memoizedVisualization
3187
- );
3643
+ ));
3188
3644
  };
3189
3645
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
3190
3646