@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/Scatter.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
  }
@@ -1116,7 +1129,7 @@ var TrellisBackgroundColorEditor = {
1116
1129
  showEditor: isTrellisEnabled
1117
1130
  };
1118
1131
 
1119
- // src/common/editorConfig/AxesChartDataDisplay.ts
1132
+ // src/common/editorConfig/AxesChartDataConfig.ts
1120
1133
  var isTrellisFeatureFlagOn2 = ({ featureFlags }) => {
1121
1134
  return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1122
1135
  };
@@ -1124,146 +1137,8 @@ var isTrellisEnabled2 = ({ options, featureFlags }) => {
1124
1137
  const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1125
1138
  return isTrellisFeatureFlagOn2({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1126
1139
  };
1127
- var AxesChartDataDisplayBase = {
1128
- label: (0, i18n_exports._)("Data display"),
1129
- layout: [
1130
- [
1131
- {
1132
- label: (0, i18n_exports._)("Stack mode"),
1133
- option: "stackMode",
1134
- editor: "editor.select",
1135
- editorProps: {
1136
- values: [
1137
- { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1138
- { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1139
- { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1140
- ]
1141
- }
1142
- }
1143
- ],
1144
- [
1145
- {
1146
- label: (0, i18n_exports._)("Null value display"),
1147
- option: "nullValueDisplay",
1148
- editor: "editor.radioBar",
1149
- editorProps: {
1150
- values: [
1151
- { label: (0, i18n_exports._)("Gaps"), value: "gaps" },
1152
- { label: (0, i18n_exports._)("Zero"), value: "zero" },
1153
- { label: (0, i18n_exports._)("Connect"), value: "connect" }
1154
- ]
1155
- }
1156
- }
1157
- ],
1158
- [
1159
- {
1160
- label: (0, i18n_exports._)("Data value display"),
1161
- option: "dataValuesDisplay",
1162
- editor: "editor.radioBar",
1163
- editorProps: {
1164
- values: [
1165
- { label: (0, i18n_exports._)("Off"), value: "off" },
1166
- { label: (0, i18n_exports._)("All"), value: "all" },
1167
- { label: (0, i18n_exports._)("Min/Max"), value: "minmax" }
1168
- ]
1169
- }
1170
- }
1171
- ],
1172
- [
1173
- {
1174
- label: (0, i18n_exports._)("Overlay fields"),
1175
- option: "overlayFields",
1176
- editor: "editor.columnMultiSelectionByFieldNameEditor",
1177
- editorProps: {
1178
- filterByTypes: ["number"]
1179
- },
1180
- isDisabled: isTrellisEnabled2
1181
- }
1182
- ],
1183
- [
1184
- {
1185
- label: (0, i18n_exports._)("Split series"),
1186
- option: "showSplitSeries",
1187
- editor: "editor.toggle"
1188
- }
1189
- ],
1190
- [
1191
- {
1192
- label: (0, i18n_exports._)("Independent y-axis for split series"),
1193
- option: "showIndependentYRanges",
1194
- editor: "editor.checkbox",
1195
- showEditor: ({ options }) => options.showSplitSeries
1196
- }
1197
- ],
1198
- ...TimechartTrellisEditorConfig
1199
- ]
1200
- };
1201
- var AxesChartDataDisplayBar = {
1202
- label: AxesChartDataDisplayBase.label,
1203
- layout: [
1204
- AxesChartDataDisplayBase.layout[0],
1205
- // remove null value display editor at index 1
1206
- ...AxesChartDataDisplayBase.layout.slice(2)
1207
- ]
1208
- };
1209
- var AxesChartDataDisplayScatter = {
1210
- label: AxesChartDataDisplayBase.label,
1211
- layout: [
1212
- ...TrellisEditorConfig,
1213
- [
1214
- {
1215
- label: (0, i18n_exports._)("Shared y-axis scale"),
1216
- option: "trellisSharedScale",
1217
- editor: "editor.checkbox",
1218
- showEditor: isTrellisEnabled2
1219
- }
1220
- ]
1221
- ]
1222
- };
1223
- var AxesChartDataDisplayColumn = {
1224
- label: AxesChartDataDisplayBase.label,
1225
- layout: [
1226
- AxesChartDataDisplayBase.layout[0],
1227
- // remove null value display and add data value display
1228
- AxesChartDataDisplayBase.layout[2],
1229
- [
1230
- {
1231
- label: (0, i18n_exports._)("Show tooltip on hover"),
1232
- option: "showTooltip",
1233
- editor: "editor.checkbox"
1234
- }
1235
- ],
1236
- ...AxesChartDataDisplayBase.layout.slice(3),
1237
- [
1238
- {
1239
- label: (0, i18n_exports._)("Column grouping mode"),
1240
- option: "columnGrouping",
1241
- editor: "editor.radioBar",
1242
- editorProps: {
1243
- values: [
1244
- { label: (0, i18n_exports._)("Auto"), value: "auto" },
1245
- { label: (0, i18n_exports._)("Overlay"), value: "overlay" }
1246
- ]
1247
- }
1248
- }
1249
- ]
1250
- ]
1251
- };
1252
- var AxesChartDataDisplayLine = {
1253
- label: AxesChartDataDisplayBase.label,
1254
- layout: [
1255
- // remove stacked mode editor
1256
- ...AxesChartDataDisplayBase.layout.slice(1)
1257
- ]
1258
- };
1259
-
1260
- // src/common/editorConfig/AxesChartDataConfig.ts
1261
- var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
1262
- return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1263
- };
1264
- var isTrellisEnabled3 = ({ options, featureFlags }) => {
1265
- const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1266
- return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1140
+ var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
1141
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
1267
1142
  };
1268
1143
  var AxesChartDataConfig = {
1269
1144
  label: (0, i18n_exports._)("Data configurations"),
@@ -1326,7 +1201,7 @@ var AxesChartDataConfigBar = {
1326
1201
  supportsDSL: true,
1327
1202
  expectedDataPrimitive: ["series", "frame"]
1328
1203
  },
1329
- isDisabled: isTrellisEnabled3
1204
+ isDisabled: isTrellisEnabled2
1330
1205
  }
1331
1206
  ])
1332
1207
  };
@@ -1398,9 +1273,6 @@ var AxesChartDataConfigBubble = {
1398
1273
  }
1399
1274
  ])
1400
1275
  };
1401
- var isAcceleratedRenderFeatureFlagOn = ({ featureFlags }) => {
1402
- return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableAcceleratedRender);
1403
- };
1404
1276
  var AcceleratedRenderEditorLayout = [
1405
1277
  [
1406
1278
  {
@@ -1410,10 +1282,9 @@ var AcceleratedRenderEditorLayout = [
1410
1282
  showEditor: isAcceleratedRenderFeatureFlagOn,
1411
1283
  editorProps: {
1412
1284
  help: (0, i18n_exports._)(
1413
- "Render visualizations faster for large datasets. Some functionalities might not be available in this mode."
1285
+ "Render visualizations faster for large datasets. Split series is not available in this mode."
1414
1286
  ),
1415
1287
  helpFormat: "under"
1416
- // TODO: uncomment and replace link with real link (SCP-75907)
1417
1288
  // helpTextLink: {
1418
1289
  // href: 'https://splunkui.splunk.com/Packages/visualizations/Overview',
1419
1290
  // label: 'Learn More.',
@@ -1456,6 +1327,168 @@ var AxesChartDataConfigLine = __spreadProps(__spreadValues({}, AxesChartDataConf
1456
1327
  layout: [...AcceleratedRenderEditorLayout, ...AxesChartDataConfigAreaColumnLine.layout]
1457
1328
  });
1458
1329
 
1330
+ // src/common/editorConfig/AxesChartDataDisplay.ts
1331
+ var isTrellisFeatureFlagOn3 = ({ featureFlags }) => {
1332
+ return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
1333
+ };
1334
+ var isTrellisEnabled3 = ({ options, featureFlags }) => {
1335
+ const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
1336
+ return isTrellisFeatureFlagOn3({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1337
+ };
1338
+ var isAcceleratedRenderEnabled = ({ options, featureFlags }) => {
1339
+ const { acceleratedRender } = options;
1340
+ return isAcceleratedRenderFeatureFlagOn({ featureFlags }) && acceleratedRender;
1341
+ };
1342
+ var AxesChartDataDisplayBase = {
1343
+ label: (0, i18n_exports._)("Data display"),
1344
+ layout: [
1345
+ [
1346
+ {
1347
+ label: (0, i18n_exports._)("Stack mode"),
1348
+ option: "stackMode",
1349
+ editor: "editor.select",
1350
+ editorProps: {
1351
+ values: [
1352
+ { label: (0, i18n_exports._)("Not stacked"), value: "auto" },
1353
+ { label: (0, i18n_exports._)("Stacked"), value: "stacked" },
1354
+ { label: (0, i18n_exports._)("Stacked 100%"), value: "stacked100" }
1355
+ ]
1356
+ }
1357
+ }
1358
+ ],
1359
+ [
1360
+ {
1361
+ label: (0, i18n_exports._)("Null value display"),
1362
+ option: "nullValueDisplay",
1363
+ editor: "editor.radioBar",
1364
+ editorProps: {
1365
+ values: [
1366
+ { label: (0, i18n_exports._)("Gaps"), value: "gaps" },
1367
+ { label: (0, i18n_exports._)("Zero"), value: "zero" },
1368
+ { label: (0, i18n_exports._)("Connect"), value: "connect" }
1369
+ ]
1370
+ }
1371
+ }
1372
+ ],
1373
+ [
1374
+ {
1375
+ label: (0, i18n_exports._)("Data value display"),
1376
+ option: "dataValuesDisplay",
1377
+ editor: "editor.radioBar",
1378
+ editorProps: {
1379
+ values: [
1380
+ { label: (0, i18n_exports._)("Off"), value: "off" },
1381
+ { label: (0, i18n_exports._)("All"), value: "all" },
1382
+ { label: (0, i18n_exports._)("Min/Max"), value: "minmax" }
1383
+ ]
1384
+ }
1385
+ }
1386
+ ],
1387
+ [
1388
+ {
1389
+ label: (0, i18n_exports._)("Overlay fields"),
1390
+ option: "overlayFields",
1391
+ editor: "editor.columnMultiSelectionByFieldNameEditor",
1392
+ editorProps: {
1393
+ filterByTypes: ["number"]
1394
+ },
1395
+ isDisabled: isTrellisEnabled3
1396
+ }
1397
+ ],
1398
+ [
1399
+ {
1400
+ label: (0, i18n_exports._)("Split series"),
1401
+ option: "showSplitSeries",
1402
+ editor: "editor.toggle",
1403
+ isDisabled: isAcceleratedRenderEnabled
1404
+ }
1405
+ ],
1406
+ [
1407
+ {
1408
+ label: (0, i18n_exports._)("Independent y-axis for split series"),
1409
+ option: "showIndependentYRanges",
1410
+ editor: "editor.checkbox",
1411
+ showEditor: ({ options, featureFlags }) => options.showSplitSeries && !isAcceleratedRenderEnabled({ options, featureFlags })
1412
+ }
1413
+ ],
1414
+ [
1415
+ {
1416
+ label: (0, i18n_exports._)("Step position"),
1417
+ option: "stepPosition",
1418
+ editor: "editor.radioBar",
1419
+ editorProps: {
1420
+ values: [
1421
+ { label: (0, i18n_exports._)("Off"), value: "off" },
1422
+ { label: (0, i18n_exports._)("Before"), value: "before" },
1423
+ { label: (0, i18n_exports._)("After"), value: "after" }
1424
+ ]
1425
+ },
1426
+ showEditor: ({ options, featureFlags }) => isAcceleratedRenderEnabled({ options, featureFlags })
1427
+ // step position is only supported when accelerated render is enabled
1428
+ }
1429
+ ],
1430
+ ...TimechartTrellisEditorConfig
1431
+ ]
1432
+ };
1433
+ var AxesChartDataDisplayBar = {
1434
+ label: AxesChartDataDisplayBase.label,
1435
+ layout: [
1436
+ AxesChartDataDisplayBase.layout[0],
1437
+ // remove null value display editor at index 1
1438
+ ...AxesChartDataDisplayBase.layout.slice(2)
1439
+ ]
1440
+ };
1441
+ var AxesChartDataDisplayScatter = {
1442
+ label: AxesChartDataDisplayBase.label,
1443
+ layout: [
1444
+ ...TrellisEditorConfig,
1445
+ [
1446
+ {
1447
+ label: (0, i18n_exports._)("Shared y-axis scale"),
1448
+ option: "trellisSharedScale",
1449
+ editor: "editor.checkbox",
1450
+ showEditor: isTrellisEnabled3
1451
+ }
1452
+ ]
1453
+ ]
1454
+ };
1455
+ var AxesChartDataDisplayColumn = {
1456
+ label: AxesChartDataDisplayBase.label,
1457
+ layout: [
1458
+ AxesChartDataDisplayBase.layout[0],
1459
+ // remove null value display and add data value display
1460
+ AxesChartDataDisplayBase.layout[2],
1461
+ [
1462
+ {
1463
+ label: (0, i18n_exports._)("Show tooltip on hover"),
1464
+ option: "showTooltip",
1465
+ editor: "editor.checkbox"
1466
+ }
1467
+ ],
1468
+ ...AxesChartDataDisplayBase.layout.slice(3),
1469
+ [
1470
+ {
1471
+ label: (0, i18n_exports._)("Column grouping mode"),
1472
+ option: "columnGrouping",
1473
+ editor: "editor.radioBar",
1474
+ editorProps: {
1475
+ values: [
1476
+ { label: (0, i18n_exports._)("Auto"), value: "auto" },
1477
+ { label: (0, i18n_exports._)("Overlay"), value: "overlay" }
1478
+ ]
1479
+ }
1480
+ }
1481
+ ]
1482
+ ]
1483
+ };
1484
+ var AxesChartDataDisplayLine = {
1485
+ label: AxesChartDataDisplayBase.label,
1486
+ layout: [
1487
+ // remove stacked mode editor
1488
+ ...AxesChartDataDisplayBase.layout.slice(1)
1489
+ ]
1490
+ };
1491
+
1459
1492
  // src/common/editorConfig/AxesChartXGridAndLabels.ts
1460
1493
  var AxesChartXGridAndLabelsCommon = {
1461
1494
  label: (0, i18n_exports._)("X-axis grid and labels"),
@@ -1851,7 +1884,7 @@ var AxesChartLegendWithTrellisAndMode = ({
1851
1884
  { label: (0, i18n_exports._)("Bottom"), value: "bottom" },
1852
1885
  { label: (0, i18n_exports._)("Off"), value: "off" }
1853
1886
  ],
1854
- tooltip: showLegendTooltip && (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display')
1887
+ tooltip: showLegendTooltip ? (0, i18n_exports._)('Legend mode must be "Standard" to configure legend display') : void 0
1855
1888
  },
1856
1889
  isDisabled: showLegendTooltip ? ({ options }) => options.legendMode === "seriesCompare" : void 0,
1857
1890
  overrideDefaultValue: ({ options }) => (options == null ? void 0 : options.splitByLayout) === "trellis" ? "off" : "right"
@@ -2488,7 +2521,7 @@ var Cover = styled_components_default.div`
2488
2521
  bottom: 0;
2489
2522
  `;
2490
2523
  var Blocker = styled_components_default.div.attrs({
2491
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
2524
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
2492
2525
  })`
2493
2526
  position: relative;
2494
2527
  width: 100%;
@@ -2569,7 +2602,7 @@ var withFixedSizeContainer = (Viz) => {
2569
2602
  FixSizeItem,
2570
2603
  {
2571
2604
  "data-test": "fix-size-item",
2572
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
2605
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
2573
2606
  width,
2574
2607
  height,
2575
2608
  backgroundColor
@@ -2845,7 +2878,7 @@ var trellisUtils_default = "default" in defaultImport34 ? defaultImport34.defaul
2845
2878
  var AGGREGATIONS = "aggregations";
2846
2879
  var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
2847
2880
  var _a, _b, _c, _d;
2848
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2881
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2849
2882
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2850
2883
  let splitDataSources = null;
2851
2884
  let errorCode = null;
@@ -2866,7 +2899,7 @@ var dataSourcesSplitByAggregationsUnknown = (dataSource) => {
2866
2899
  }
2867
2900
  return { splitDataSources, errorCode };
2868
2901
  };
2869
- var toFieldEntries = (fields) => {
2902
+ var toFieldEntries = (fields = []) => {
2870
2903
  return fields.map((field) => {
2871
2904
  if (typeof field === "string") {
2872
2905
  return { name: field };
@@ -2881,7 +2914,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
2881
2914
  let splitDataSources = null;
2882
2915
  let splitByFields = [];
2883
2916
  let errorCode = null;
2884
- if (typeof fields[0] !== "string") {
2917
+ if (fields.length > 0) {
2885
2918
  splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysChart)(fields);
2886
2919
  }
2887
2920
  if (splitByFields && splitByFields.length > 0) {
@@ -2919,12 +2952,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = (dataSource) => {
2919
2952
  };
2920
2953
  var dataSourcesSplitByAggregationsStats = (dataSource) => {
2921
2954
  var _a, _b, _c, _d;
2922
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2955
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2923
2956
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2924
2957
  let splitDataSources = null;
2925
2958
  let splitByFields = [];
2926
2959
  let errorCode = null;
2927
- if (typeof fields[0] !== "string") {
2960
+ if (fields.length > 0) {
2928
2961
  splitByFields = (0, trellisUtils_exports.extractDataSourceAggregationKeysStats)(fields);
2929
2962
  }
2930
2963
  if (splitByFields && splitByFields.length > 0) {
@@ -2948,12 +2981,12 @@ var dataSourcesSplitByAggregationsStats = (dataSource) => {
2948
2981
  };
2949
2982
  var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2950
2983
  var _a, _b, _c, _d, _e;
2951
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
2984
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2952
2985
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2953
2986
  let splitDataSources = null;
2954
2987
  let splitByFields = [];
2955
2988
  let errorCode = null;
2956
- if (typeof fields[0] !== "string") {
2989
+ if (fields.length > 0) {
2957
2990
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
2958
2991
  }
2959
2992
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
@@ -2969,16 +3002,14 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2969
3002
  splitDataSources[val] = (0, lodash_exports.cloneDeep)(
2970
3003
  (0, lodash_exports.omit)(dataSource, ["primary.data.fields", "primary.data.columns"])
2971
3004
  );
2972
- splitDataSources[val].primary.data.fields = [
2973
- { name: fields[0].name },
2974
- ...dataSourceKeys.map((k) => ({
2975
- name: k
2976
- }))
2977
- ];
3005
+ splitDataSources[val].primary.data.fields = [{ name: fields[0].name }];
2978
3006
  splitDataSources[val].primary.data.columns = [[...columns[0]]];
2979
3007
  dataSourceKeys.forEach((dsKey) => {
2980
3008
  fields.forEach((field, idx) => {
2981
3009
  if (field.data_source === dsKey && (field.splitby_value === val || field.name === val)) {
3010
+ splitDataSources[val].primary.data.fields.push({
3011
+ name: dsKey
3012
+ });
2982
3013
  splitDataSources[val].primary.data.columns.push([...columns[idx]]);
2983
3014
  }
2984
3015
  });
@@ -2991,12 +3022,12 @@ var dataSourcesSplitByModeTimechart = (dataSource, splitBy) => {
2991
3022
  };
2992
3023
  var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
2993
3024
  var _a, _b, _c, _d;
2994
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3025
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
2995
3026
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
2996
3027
  let splitDataSources = null;
2997
3028
  let splitByFields = [];
2998
3029
  let errorCode = null;
2999
- if (typeof fields[0] !== "string") {
3030
+ if (fields.length > 0) {
3000
3031
  splitByFields = (0, trellisUtils_exports.extractSplitByFieldsChartFields)(fields);
3001
3032
  }
3002
3033
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
@@ -3084,17 +3115,15 @@ var dataSourcesSplitByModeChart = (dataSource, splitBy) => {
3084
3115
  };
3085
3116
  var dataSourcesSplitByModeStatsorUnknown = (dataSource, splitBy, splitMode) => {
3086
3117
  var _a, _b, _c, _d, _e, _f;
3087
- const fields = (_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields;
3118
+ const fields = toFieldEntries((_b = (_a = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _a.data) == null ? void 0 : _b.fields);
3088
3119
  const columns = (_d = (_c = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _c.data) == null ? void 0 : _d.columns;
3089
3120
  let splitDataSources = null;
3090
3121
  let splitByFields = [];
3091
3122
  let errorCode = null;
3092
- if (typeof fields[0] !== "string") {
3123
+ if (fields.length > 0) {
3093
3124
  splitByFields = splitMode !== trellisUtils_exports.UNKNOWN ? (0, trellisUtils_exports.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_exports.extractSplitByFieldsForUnknown)(fields);
3094
3125
  }
3095
- const splitByIndex = fields == null ? void 0 : fields.findIndex(
3096
- (field) => field === splitBy || field.name === splitBy
3097
- );
3126
+ const splitByIndex = fields.findIndex((field) => field.name === splitBy);
3098
3127
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
3099
3128
  const splitByColumn = (_f = (_e = dataSource == null ? void 0 : dataSource.primary) == null ? void 0 : _e.data) == null ? void 0 : _f.columns[splitByIndex];
3100
3129
  splitDataSources = {};
@@ -3270,6 +3299,16 @@ var mapToValues = (optionValuesSCMapping) => (options) => {
3270
3299
  });
3271
3300
  return convertedOptions;
3272
3301
  };
3302
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
3303
+ const rangeSelectEventHandler = eventHandlers.find(
3304
+ (eventHandler) => {
3305
+ var _a;
3306
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
3307
+ }
3308
+ );
3309
+ const xAxisIsTime = xField === "_time";
3310
+ return !!rangeSelectEventHandler && xAxisIsTime;
3311
+ };
3273
3312
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
3274
3313
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
3275
3314
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -3290,17 +3329,34 @@ var filterChartDataFromInternalFields = (chartData) => {
3290
3329
  var convert2DArrayToNumbers = (arr) => {
3291
3330
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
3292
3331
  };
3293
- var SideLegendWidth = 75;
3294
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
3332
+ var parseAxisValue = (val) => {
3333
+ if (val === void 0 || val === null || val === "auto" || val === "") {
3334
+ return void 0;
3335
+ }
3336
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
3337
+ return Number.isNaN(num) ? void 0 : num;
3338
+ };
3339
+ var parseXAxisLineVisibility = (visibility) => {
3340
+ if (visibility === "hide") return false;
3341
+ if (visibility === "show") return true;
3342
+ return void 0;
3343
+ };
3295
3344
  var getLegend = (props) => {
3296
3345
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
3346
+ const { isSeriesCompare, legendTruncation } = props;
3347
+ const commonLegendProps = {
3348
+ center: true,
3349
+ fontSize: 12,
3350
+ largerTiles: true,
3351
+ hideSeriesValue: !isSeriesCompare,
3352
+ // Show values if in seriesCompare mode
3353
+ legendTruncation
3354
+ };
3297
3355
  switch (legendPlacement) {
3298
3356
  case "off":
3299
3357
  return false;
3300
3358
  case "left":
3301
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
3302
- width: SideLegendWidth
3303
- }, commonLegendProps));
3359
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
3304
3360
  case "bottom":
3305
3361
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
3306
3362
  wrap: true
@@ -3310,9 +3366,7 @@ var getLegend = (props) => {
3310
3366
  wrap: true
3311
3367
  }, commonLegendProps));
3312
3368
  default:
3313
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
3314
- width: SideLegendWidth
3315
- }, commonLegendProps));
3369
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
3316
3370
  }
3317
3371
  };
3318
3372
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -3347,22 +3401,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
3347
3401
  const end = axisTitle.slice(-halfChars);
3348
3402
  return `${start}...${end}`;
3349
3403
  };
3350
- var getFieldName = (field) => {
3404
+ var getFieldName2 = (field) => {
3351
3405
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
3352
3406
  return fieldName;
3353
3407
  };
3354
3408
  var getFieldNames = (fields) => {
3355
- return fields.map((field) => getFieldName(field));
3409
+ return fields.map((field) => getFieldName2(field));
3356
3410
  };
3357
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
3411
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
3358
3412
  const xConfig = { x: {} };
3359
3413
  xConfig.x.label = label;
3360
3414
  if (xAxisLabelVisibility === "hide") {
3361
3415
  xConfig.x.hideLabels = true;
3362
3416
  }
3417
+ if (xAxisLabelRotation !== void 0) {
3418
+ xConfig.x.labelRotation = xAxisLabelRotation;
3419
+ }
3363
3420
  return xConfig;
3364
3421
  };
3365
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
3422
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
3366
3423
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
3367
3424
  const yConfig = { y: {} };
3368
3425
  yConfig.y.label = label;
@@ -3370,34 +3427,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
3370
3427
  if (yAxisAbbreviation !== "none") {
3371
3428
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
3372
3429
  }
3373
- if (yAxisAbbreviation === "none") {
3374
- yConfig.y.width = 55;
3375
- } else {
3430
+ if (yAxisAbbreviation !== "none") {
3376
3431
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
3377
3432
  }
3378
3433
  if (yAxisLabelVisibility === "hide") {
3379
3434
  yConfig.y.hideLabels = true;
3380
3435
  }
3436
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
3437
+ yConfig.y.range = (u, dataMin, dataMax) => {
3438
+ const min = yAxisMin != null ? yAxisMin : dataMin;
3439
+ const max = yAxisMax != null ? yAxisMax : dataMax;
3440
+ return [min, max];
3441
+ };
3442
+ }
3381
3443
  return yConfig;
3382
3444
  };
3383
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
3445
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
3384
3446
  const y2Config = { y2: {} };
3385
3447
  const scaleType = axisScale != null ? axisScale : "linear";
3386
3448
  y2Config.y2.label = label;
3387
3449
  y2Config.y2.side = "right";
3388
- y2Config.y2.showGrid = false;
3389
3450
  y2Config.y2.type = scaleType;
3390
3451
  if (axisAbbreviation !== "none") {
3391
3452
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
3453
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
3392
3454
  } else if (roundAxisLabelsToInteger) {
3393
3455
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
3394
3456
  }
3395
3457
  if (y2AxisLabelVisibility === "hide") {
3396
3458
  y2Config.y2.hideLabels = true;
3397
3459
  }
3460
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
3461
+ y2Config.y2.range = (u, dataMin, dataMax) => {
3462
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
3463
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
3464
+ return [min, max];
3465
+ };
3466
+ }
3398
3467
  return y2Config;
3399
3468
  };
3400
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
3469
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
3401
3470
  const seriesConfig = {};
3402
3471
  let spanGaps;
3403
3472
  let replaceNullsWithZero;
@@ -3424,6 +3493,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
3424
3493
  );
3425
3494
  if (shouldAssignToY2) {
3426
3495
  seriesConfig[field].overrides.scale = "y2";
3496
+ } else {
3497
+ seriesConfig[field].overrides.scale = "y";
3427
3498
  }
3428
3499
  }
3429
3500
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -3432,12 +3503,50 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
3432
3503
  if (markerDisplay !== void 0) {
3433
3504
  seriesConfig[field].markerDisplay = markerDisplay;
3434
3505
  }
3506
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
3507
+ if (fieldDashStyle) {
3508
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
3509
+ }
3510
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
3511
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
3512
+ if (fieldStepPosition && fieldStepPosition !== "off") {
3513
+ seriesConfig[field].stepPosition = fieldStepPosition;
3514
+ }
3435
3515
  if (replaceNullsWithZero !== void 0) {
3436
3516
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
3437
3517
  }
3438
3518
  });
3439
3519
  return seriesConfig;
3440
3520
  };
3521
+ var findRangeIndices = (xData, startValue, endValue) => {
3522
+ let startXIndex = -1;
3523
+ let endXIndex = -1;
3524
+ const xDataEpoch = xData.map((val) => {
3525
+ if (typeof val === "string") {
3526
+ return new Date(val).getTime() / 1e3;
3527
+ }
3528
+ return val;
3529
+ });
3530
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
3531
+ if (xDataEpoch[i] >= startValue) {
3532
+ startXIndex = i;
3533
+ break;
3534
+ }
3535
+ }
3536
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
3537
+ startXIndex = xDataEpoch.length - 1;
3538
+ }
3539
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
3540
+ if (xDataEpoch[i] <= endValue) {
3541
+ endXIndex = i;
3542
+ break;
3543
+ }
3544
+ }
3545
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
3546
+ endXIndex = 0;
3547
+ }
3548
+ return { startXIndex, endXIndex };
3549
+ };
3441
3550
 
3442
3551
  // src/common/TimeSeriesChartWrapper.tsx
3443
3552
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -3448,38 +3557,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
3448
3557
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
3449
3558
  }
3450
3559
  `;
3451
- var handleClick = (chartEvent, onClick) => {
3560
+ var appendTrellisToPayload2 = (payload, trellisKey, trellisSplitBy) => {
3561
+ const result = __spreadValues({}, payload);
3562
+ if (trellisSplitBy) {
3563
+ result["trellis.name"] = trellisSplitBy;
3564
+ }
3565
+ if (trellisKey) {
3566
+ result["trellis.value"] = trellisKey;
3567
+ }
3568
+ return result;
3569
+ };
3570
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
3571
+ if (!previousPayload) {
3572
+ return true;
3573
+ }
3574
+ if (currentPayload.index !== previousPayload.index) {
3575
+ return true;
3576
+ }
3577
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
3578
+ return true;
3579
+ }
3580
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
3581
+ return true;
3582
+ }
3583
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
3584
+ return true;
3585
+ }
3586
+ return false;
3587
+ };
3588
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
3452
3589
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
3453
3590
  name: chartEvent.seriesKey
3454
3591
  });
3455
3592
  delete payload.seriesKey;
3456
3593
  if (chartEvent.rowContext) {
3457
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
3458
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
3459
- });
3594
+ Object.assign(
3595
+ payload,
3596
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
3597
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
3598
+ return acc;
3599
+ }, {})
3600
+ );
3460
3601
  }
3602
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3461
3603
  if (onClick) {
3462
3604
  onClick({
3463
3605
  type: "point.click",
3464
3606
  originalEvent: chartEvent,
3465
- payload
3607
+ payload: updatedPayload
3466
3608
  });
3467
3609
  }
3468
3610
  };
3469
- var handleLegendClick = (chartEvent, onClick) => {
3611
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
3470
3612
  const payload = {
3471
3613
  name: chartEvent
3472
3614
  };
3615
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3473
3616
  if (onClick) {
3474
3617
  onClick({
3475
3618
  type: "legend.click",
3476
3619
  originalEvent: chartEvent,
3477
- payload
3620
+ payload: updatedPayload
3621
+ });
3622
+ }
3623
+ };
3624
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3625
+ var _a;
3626
+ if (!rangeEvent) {
3627
+ return;
3628
+ }
3629
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3630
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3631
+ const payload = {
3632
+ startXIndex,
3633
+ startXValue: rangeEvent.start,
3634
+ endXIndex,
3635
+ endXValue: rangeEvent.end
3636
+ };
3637
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3638
+ if (onSelect) {
3639
+ onSelect({
3640
+ type: "range.selectBeforeZoom",
3641
+ originalEvent: rangeEvent,
3642
+ payload: updatedPayload
3643
+ });
3644
+ }
3645
+ };
3646
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
3647
+ var _a;
3648
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
3649
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
3650
+ const payload = {
3651
+ startXIndex,
3652
+ startXValue: rangeEvent.start,
3653
+ endXIndex,
3654
+ endXValue: rangeEvent.end
3655
+ };
3656
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
3657
+ if (onSelect) {
3658
+ onSelect({
3659
+ type: "range.select",
3660
+ originalEvent: rangeEvent,
3661
+ payload: updatedPayload
3478
3662
  });
3479
3663
  }
3480
3664
  };
3665
+ var parseArrayOption = (value) => {
3666
+ if (Array.isArray(value)) {
3667
+ return value;
3668
+ }
3669
+ if (value) {
3670
+ return JSON.parse(value);
3671
+ }
3672
+ return void 0;
3673
+ };
3481
3674
  var TimeSeriesChartWrapper = (props) => {
3482
- const {
3675
+ var _b, _c, _d;
3676
+ const _a = props, {
3483
3677
  width,
3484
3678
  height,
3485
3679
  chartData,
@@ -3492,12 +3686,57 @@ var TimeSeriesChartWrapper = (props) => {
3492
3686
  markerDisplay,
3493
3687
  onClick,
3494
3688
  onPointMouseOver,
3495
- onPointMouseOut
3496
- } = props;
3497
- const {
3689
+ onPointMouseOut,
3690
+ onSelect,
3691
+ splitByLayout,
3692
+ trellisKey,
3693
+ trellisSplitBy,
3498
3694
  backgroundColor,
3695
+ defaultFontColor,
3696
+ additionalTooltipValues,
3697
+ xAxisLineVisibility: xAxisLineVisibility,
3698
+ yAxisLineVisibility,
3699
+ y2AxisLineVisibility,
3700
+ showYAxisWithZero: showYAxisWithZeroFromProps,
3701
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
3702
+ } = _a, otherOptions = __objRest(_a, [
3703
+ "width",
3704
+ "height",
3705
+ "chartData",
3706
+ "options",
3707
+ "userLocale",
3708
+ "annotationX",
3709
+ "annotationLabel",
3710
+ "annotationColor",
3711
+ "legendDisplay",
3712
+ "markerDisplay",
3713
+ "onClick",
3714
+ "onPointMouseOver",
3715
+ "onPointMouseOut",
3716
+ "onSelect",
3717
+ "splitByLayout",
3718
+ "trellisKey",
3719
+ "trellisSplitBy",
3720
+ "backgroundColor",
3721
+ "defaultFontColor",
3722
+ "additionalTooltipValues",
3723
+ // Extract axis line visibility options from props
3724
+ "xAxisLineVisibility",
3725
+ "yAxisLineVisibility",
3726
+ "y2AxisLineVisibility",
3727
+ // Extract showYAxisWithZero directly from props for accelerated render mode
3728
+ "showYAxisWithZero",
3729
+ "showY2AxisWithZero"
3730
+ ]);
3731
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
3732
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
3733
+ const {
3734
+ backgroundColor: bgColorFromOptions,
3499
3735
  seriesColors: seriesColorsStr,
3500
3736
  fieldColors,
3737
+ legendLabels: legendLabelsStr,
3738
+ legendMode,
3739
+ legendTruncation,
3501
3740
  "axisTitleX.text": xAxisTitleText,
3502
3741
  "axisTitleY.text": yAxisTitleText,
3503
3742
  "axisTitleY2.text": y2AxisTitleText,
@@ -3505,8 +3744,12 @@ var TimeSeriesChartWrapper = (props) => {
3505
3744
  "axisTitleY.visibility": yAxisTitleVisibility,
3506
3745
  "axisTitleY2.visibility": y2AxisTitleVisibility,
3507
3746
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
3747
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
3748
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
3508
3749
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
3750
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
3509
3751
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
3752
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
3510
3753
  "axisY.abbreviation": yAxisAbbreviation,
3511
3754
  "axisY.scale": yAxisScale,
3512
3755
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -3516,10 +3759,73 @@ var TimeSeriesChartWrapper = (props) => {
3516
3759
  "axisLabelsY2.integerUnits": y2IntegerUnits,
3517
3760
  "chart.overlayFields": overlayFieldsStr,
3518
3761
  "chart.nullValueMode": nullValueMode,
3519
- lineWidth
3762
+ "chart.showDataLabels": showDataLabels,
3763
+ lineWidth,
3764
+ lineDashStyle,
3765
+ fieldDashStyles: lineDashStylesByFieldStr,
3766
+ stepPosition,
3767
+ fieldStepPositions: stepPositionsByFieldStr,
3768
+ yAxisMin: yAxisMinRaw,
3769
+ yAxisMax: yAxisMaxRaw,
3770
+ y2AxisMin: y2AxisMinRaw,
3771
+ y2AxisMax: y2AxisMaxRaw,
3772
+ showXMajorGridLines,
3773
+ showYMajorGridLines,
3774
+ showY2MajorGridLines,
3775
+ showYMinorGridLines,
3776
+ showY2MinorGridLines,
3777
+ showLineSmoothing,
3778
+ xAxisMajorTickVisibility,
3779
+ xAxisMajorTickSize,
3780
+ yAxisMajorTickVisibility,
3781
+ y2AxisMajorTickVisibility,
3782
+ yAxisMajorTickSize,
3783
+ y2AxisMajorTickSize,
3784
+ yAxisMajorTickInterval,
3785
+ y2AxisMajorTickInterval,
3786
+ yAxisMinorTickVisibility,
3787
+ y2AxisMinorTickVisibility,
3788
+ yAxisMinorTickSize,
3789
+ y2AxisMinorTickSize,
3790
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
3791
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
3520
3792
  } = options;
3793
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
3794
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
3795
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
3796
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
3797
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
3798
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
3799
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
3800
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
3801
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
3802
+ const showYAxisLine = yAxisLineVisibility === "show";
3803
+ const showY2AxisLine = y2AxisLineVisibility === "show";
3804
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
3805
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
3806
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
3807
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
3808
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
3809
+ if (simpleXMLValue) return Number(simpleXMLValue);
3810
+ if (canvasValue) return Number(canvasValue);
3811
+ return void 0;
3812
+ };
3813
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
3814
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
3815
+ y2AxisMajorUnitFromSimpleXML,
3816
+ y2AxisMajorTickInterval
3817
+ );
3818
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
3819
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
3820
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
3821
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
3822
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
3521
3823
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
3522
3824
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
3825
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
3826
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
3827
+ const legendLabels = parseArrayOption(legendLabelsStr);
3828
+ const bgColor = backgroundColor || bgColorFromOptions;
3523
3829
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
3524
3830
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
3525
3831
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -3530,31 +3836,64 @@ var TimeSeriesChartWrapper = (props) => {
3530
3836
  fields: chartData.fields,
3531
3837
  columns: chartData.seriesList
3532
3838
  });
3533
- const xField = getFieldName(filteredChartData.fields[0]);
3839
+ const xField = getFieldName2(filteredChartData.fields[0]);
3534
3840
  const yFields = getFieldNames(
3535
3841
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
3536
3842
  );
3537
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
3538
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
3843
+ const y2Fields = (0, react_exports.useMemo)(
3844
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
3845
+ [y2FieldsStr]
3846
+ );
3847
+ const overlayFields = (0, react_exports.useMemo)(
3848
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
3849
+ [overlayFieldsStr]
3850
+ );
3539
3851
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
3540
3852
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
3541
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
3853
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
3854
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
3542
3855
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
3543
3856
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
3544
3857
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
3545
3858
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
3546
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
3547
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
3548
- let y2ScaleConfig = {};
3549
- if (y2Enabled) {
3550
- y2ScaleConfig = getY2ScaleConfig(
3551
- y2AxisTitle,
3552
- y2AxisAbbreviation,
3553
- y2AxisScale,
3554
- y2IntegerUnits,
3555
- y2AxisLabelVisibility
3556
- );
3557
- }
3859
+ const xScaleConfig = (0, react_exports.useMemo)(
3860
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
3861
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
3862
+ );
3863
+ const yScaleConfig = (0, react_exports.useMemo)(
3864
+ () => getYScaleConfig(
3865
+ yAxisTitle,
3866
+ yAxisAbbreviation,
3867
+ yAxisScale,
3868
+ yAxisLabelVisibility,
3869
+ yAxisMin,
3870
+ yAxisMax
3871
+ ),
3872
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
3873
+ );
3874
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
3875
+ if (y2Enabled) {
3876
+ return getY2ScaleConfig(
3877
+ y2AxisTitle,
3878
+ y2AxisAbbreviation,
3879
+ y2AxisScale,
3880
+ y2IntegerUnits,
3881
+ y2AxisLabelVisibility,
3882
+ y2AxisMin,
3883
+ y2AxisMax
3884
+ );
3885
+ }
3886
+ return {};
3887
+ }, [
3888
+ y2Enabled,
3889
+ y2AxisTitle,
3890
+ y2AxisAbbreviation,
3891
+ y2AxisScale,
3892
+ y2IntegerUnits,
3893
+ y2AxisLabelVisibility,
3894
+ y2AxisMin,
3895
+ y2AxisMax
3896
+ ]);
3558
3897
  const uplotContainerElement = (0, react_exports.useRef)(null);
3559
3898
  const seriesDataFormatted = [
3560
3899
  filteredChartData.columns[0],
@@ -3570,9 +3909,25 @@ var TimeSeriesChartWrapper = (props) => {
3570
3909
  overlayFields,
3571
3910
  y2Enabled,
3572
3911
  nullValueMode,
3573
- markerDisplay
3912
+ markerDisplay,
3913
+ lineDashStyle,
3914
+ lineDashStylesByField,
3915
+ stepPosition,
3916
+ stepPositionsByField
3574
3917
  ),
3575
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
3918
+ [
3919
+ yFields,
3920
+ y2Fields,
3921
+ lineWidth,
3922
+ overlayFields,
3923
+ y2Enabled,
3924
+ nullValueMode,
3925
+ markerDisplay,
3926
+ lineDashStyle,
3927
+ lineDashStylesByField,
3928
+ stepPosition,
3929
+ stepPositionsByField
3930
+ ]
3576
3931
  );
3577
3932
  const chartingEventAnnotations = (0, react_exports.useMemo)(
3578
3933
  () => getAnnotationsForCanvas({
@@ -3586,25 +3941,59 @@ var TimeSeriesChartWrapper = (props) => {
3586
3941
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
3587
3942
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
3588
3943
  );
3589
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
3944
+ const isSeriesCompare = legendMode === "seriesCompare";
3945
+ const legend = (0, react_exports.useMemo)(
3946
+ () => getLegend({
3947
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
3948
+ isSeriesCompare,
3949
+ legendTruncation
3950
+ }),
3951
+ [legendDisplay, isSeriesCompare, legendTruncation]
3952
+ );
3590
3953
  const handleChartClick = react_exports.useCallback(
3591
3954
  (event) => {
3592
3955
  if (onClick) {
3593
- handleClick(event, onClick);
3956
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
3594
3957
  }
3595
3958
  },
3596
- [onClick]
3959
+ [onClick, trellisKey, trellisSplitBy]
3597
3960
  );
3598
3961
  const handleChartLegendClick = react_exports.useCallback(
3599
3962
  (event) => {
3600
3963
  if (onClick) {
3601
- handleLegendClick(event, onClick);
3964
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
3602
3965
  }
3603
3966
  },
3604
- [onClick]
3967
+ [onClick, trellisKey, trellisSplitBy]
3968
+ );
3969
+ const handleChartRangeSelection = react_exports.useCallback(
3970
+ (range2) => {
3971
+ if (onSelect) {
3972
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3973
+ }
3974
+ },
3975
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3976
+ );
3977
+ const handleChartRangeZoom = react_exports.useCallback(
3978
+ (range2) => {
3979
+ if (onSelect) {
3980
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
3981
+ }
3982
+ },
3983
+ [onSelect, chartData, trellisKey, trellisSplitBy]
3984
+ );
3985
+ const xFieldToUse = xFieldFromProps || xField;
3986
+ const enableSearchZoom = react_exports.useMemo(
3987
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
3988
+ [eventHandlers, xFieldToUse]
3605
3989
  );
3606
3990
  const lastPayloadRef = react_exports.useRef(null);
3607
3991
  const lastOriginalEventRef = react_exports.useRef(null);
3992
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
3993
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
3994
+ react_exports.useEffect(() => {
3995
+ additionalTooltipValuesRef.current = additionalTooltipValues;
3996
+ }, [additionalTooltipValues]);
3608
3997
  const handleChartCrosshairChange = react_exports.useCallback(
3609
3998
  (event) => {
3610
3999
  if (onPointMouseOver || onPointMouseOut) {
@@ -3616,6 +4005,7 @@ var TimeSeriesChartWrapper = (props) => {
3616
4005
  payload: lastPayloadRef.current
3617
4006
  });
3618
4007
  }
4008
+ previousMouseoverPayloadRef.current = null;
3619
4009
  return;
3620
4010
  }
3621
4011
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -3623,25 +4013,36 @@ var TimeSeriesChartWrapper = (props) => {
3623
4013
  });
3624
4014
  delete payload.seriesKey;
3625
4015
  if (event.rowContext) {
3626
- Object.keys(event.rowContext).forEach((fieldName) => {
3627
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
3628
- });
4016
+ Object.assign(
4017
+ payload,
4018
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
4019
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
4020
+ return acc;
4021
+ }, {})
4022
+ );
3629
4023
  }
3630
- lastPayloadRef.current = payload;
4024
+ const updatedPayload = appendTrellisToPayload2(payload, trellisKey, trellisSplitBy);
4025
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
4026
+ return;
4027
+ }
4028
+ lastPayloadRef.current = updatedPayload;
3631
4029
  lastOriginalEventRef.current = event;
4030
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
3632
4031
  if (onPointMouseOver) {
3633
4032
  onPointMouseOver({
3634
4033
  type: "point.mouseover",
3635
4034
  originalEvent: event,
3636
- payload
4035
+ payload: updatedPayload
3637
4036
  });
3638
4037
  }
3639
4038
  }
3640
4039
  },
3641
- [onPointMouseOver, onPointMouseOut]
4040
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
3642
4041
  );
3643
- const memoizedChart = (0, react_exports.useMemo)(
3644
- () => /* @__PURE__ */ react_exports.createElement(
4042
+ 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}`;
4043
+ const memoizedChart = (0, react_exports.useMemo)(() => {
4044
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
4045
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
3645
4046
  visualization_canvas_exports.TimeSeriesChart,
3646
4047
  {
3647
4048
  data: chartData,
@@ -3651,49 +4052,121 @@ var TimeSeriesChartWrapper = (props) => {
3651
4052
  seriesColorsByField,
3652
4053
  seriesConfig: seriesOverrides,
3653
4054
  legend,
4055
+ legendLabels,
4056
+ legendTruncation,
4057
+ isSeriesCompare: legendMode === "seriesCompare",
4058
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
3654
4059
  scaleConfig,
3655
4060
  timestampFormat: "expanded",
3656
4061
  onCrosshairClick: onClick ? handleChartClick : void 0,
3657
4062
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
3658
4063
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
4064
+ onRangeSelection: handleChartRangeSelection,
4065
+ onRangeZoom: computedOnRangeZoom,
4066
+ serverSideZoom: enableSearchZoom,
3659
4067
  userLocale,
3660
4068
  events: chartingEventAnnotations,
3661
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
4069
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
4070
+ additionalTooltipValuesRef,
4071
+ showXMajorGridLines,
4072
+ showYMajorGridLines,
4073
+ showY2MajorGridLines,
4074
+ showYMinorGridLines,
4075
+ showY2MinorGridLines,
4076
+ showLineSmoothing,
4077
+ dataValuesDisplay,
4078
+ showXMajorTicks,
4079
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
4080
+ showYMajorTicks,
4081
+ showY2MajorTicks,
4082
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
4083
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
4084
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
4085
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
4086
+ showYMinorTicks,
4087
+ showY2MinorTicks,
4088
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
4089
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
4090
+ showYAxisWithZero,
4091
+ showY2AxisWithZero,
4092
+ showXAxisLine,
4093
+ showYAxisLine,
4094
+ showY2AxisLine,
4095
+ xAxisMaxLabelParts
3662
4096
  }
3663
- ),
3664
- [
3665
- chartData,
3666
- containerWidth,
3667
- containerHeight,
3668
- seriesColors,
3669
- seriesColorsByField,
3670
- seriesOverrides,
3671
- legend,
3672
- scaleConfig,
3673
- userLocale,
3674
- chartingEventAnnotations,
3675
- onClick,
3676
- handleChartClick,
3677
- onPointMouseOver,
3678
- onPointMouseOut,
3679
- handleChartCrosshairChange,
3680
- handleChartLegendClick
3681
- ]
3682
- );
4097
+ ));
4098
+ }, [
4099
+ onSelect,
4100
+ handleChartRangeZoom,
4101
+ dataKey,
4102
+ chartData,
4103
+ containerWidth,
4104
+ containerHeight,
4105
+ seriesColors,
4106
+ seriesColorsByField,
4107
+ seriesOverrides,
4108
+ legend,
4109
+ legendLabels,
4110
+ legendTruncation,
4111
+ scaleConfig,
4112
+ onClick,
4113
+ handleChartClick,
4114
+ onPointMouseOver,
4115
+ onPointMouseOut,
4116
+ handleChartCrosshairChange,
4117
+ handleChartLegendClick,
4118
+ handleChartRangeSelection,
4119
+ enableSearchZoom,
4120
+ userLocale,
4121
+ chartingEventAnnotations,
4122
+ showXMajorGridLines,
4123
+ showYMajorGridLines,
4124
+ showY2MajorGridLines,
4125
+ showYMinorGridLines,
4126
+ showY2MinorGridLines,
4127
+ showLineSmoothing,
4128
+ dataValuesDisplay,
4129
+ showXMajorTicks,
4130
+ xAxisMajorTickSizeNum,
4131
+ showYMajorTicks,
4132
+ showY2MajorTicks,
4133
+ yAxisMajorTickSizeNum,
4134
+ y2AxisMajorTickSizeNum,
4135
+ yAxisMajorTickIntervalNum,
4136
+ y2AxisMajorTickIntervalNum,
4137
+ showYMinorTicks,
4138
+ showY2MinorTicks,
4139
+ yAxisMinorTickSizeNum,
4140
+ y2AxisMinorTickSizeNum,
4141
+ showYAxisWithZero,
4142
+ showY2AxisWithZero,
4143
+ showXAxisLine,
4144
+ showYAxisLine,
4145
+ showY2AxisLine,
4146
+ legendMode,
4147
+ xAxisMaxLabelParts
4148
+ ]);
3683
4149
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
3684
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
3685
- }, [backgroundColor, memoizedChart]);
3686
- return /* @__PURE__ */ react_exports.createElement(
4150
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
4151
+ }, [bgColor, memoizedChart]);
4152
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
4153
+ TrellisTitle,
4154
+ {
4155
+ trellisKey,
4156
+ backgroundColor: bgColor,
4157
+ fontColor: defaultFontColor
4158
+ }
4159
+ ), /* @__PURE__ */ react_exports.createElement(
3687
4160
  TimeSeriesChartContainer,
3688
4161
  {
3689
- height,
4162
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
3690
4163
  width,
3691
4164
  ref: uplotContainerElement,
3692
4165
  "data-test": "timeseries-chart-wrapper"
3693
4166
  },
3694
4167
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
3695
4168
  memoizedVisualization
3696
- );
4169
+ ));
3697
4170
  };
3698
4171
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
3699
4172