@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/ChoroplethSvg.js CHANGED
@@ -505,7 +505,7 @@ var Cover = styled_components_default.div`
505
505
  bottom: 0;
506
506
  `;
507
507
  var Blocker = styled_components_default.div.attrs({
508
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
508
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
509
509
  })`
510
510
  position: relative;
511
511
  width: 100%;
@@ -604,7 +604,7 @@ var withFixedSizeContainer = (Viz) => {
604
604
  FixSizeItem,
605
605
  {
606
606
  "data-test": "fix-size-item",
607
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
607
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
608
608
  width,
609
609
  height,
610
610
  backgroundColor
@@ -700,6 +700,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
700
700
  var numberUtils_default = "default" in defaultImport24 ? defaultImport24.default : defaultImport24;
701
701
 
702
702
  // src/common/utils/dataUtils.ts
703
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
703
704
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
704
705
  const dataLength = data.length;
705
706
  const downsampledIndices = [];
@@ -816,9 +817,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
816
817
  let xColumn = [];
817
818
  const yColumns = [];
818
819
  const canDownsample = !ds.data.fields.some((field, index) => {
819
- var _a, _b;
820
- const fieldName = (_a = field.name) != null ? _a : field;
821
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
820
+ var _a;
821
+ const fieldName = getFieldName(field);
822
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
822
823
  const column = ds.data.columns[index];
823
824
  let hasDisplayedColumnThatCantBeDownsampled = false;
824
825
  if (fieldName === xField) {
@@ -1171,6 +1172,16 @@ var triangleEventAnnotationRenderer = ({
1171
1172
  eventColor: eventWithColor.color
1172
1173
  });
1173
1174
  };
1175
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1176
+ const rangeSelectEventHandler = eventHandlers.find(
1177
+ (eventHandler) => {
1178
+ var _a;
1179
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1180
+ }
1181
+ );
1182
+ const xAxisIsTime = xField === "_time";
1183
+ return !!rangeSelectEventHandler && xAxisIsTime;
1184
+ };
1174
1185
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1175
1186
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1176
1187
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1191,17 +1202,34 @@ var filterChartDataFromInternalFields = (chartData) => {
1191
1202
  var convert2DArrayToNumbers = (arr) => {
1192
1203
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1193
1204
  };
1194
- var SideLegendWidth = 75;
1195
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1205
+ var parseAxisValue = (val) => {
1206
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1207
+ return void 0;
1208
+ }
1209
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1210
+ return Number.isNaN(num) ? void 0 : num;
1211
+ };
1212
+ var parseXAxisLineVisibility = (visibility) => {
1213
+ if (visibility === "hide") return false;
1214
+ if (visibility === "show") return true;
1215
+ return void 0;
1216
+ };
1196
1217
  var getLegend = (props) => {
1197
1218
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1219
+ const { isSeriesCompare, legendTruncation } = props;
1220
+ const commonLegendProps = {
1221
+ center: true,
1222
+ fontSize: 12,
1223
+ largerTiles: true,
1224
+ hideSeriesValue: !isSeriesCompare,
1225
+ // Show values if in seriesCompare mode
1226
+ legendTruncation
1227
+ };
1198
1228
  switch (legendPlacement) {
1199
1229
  case "off":
1200
1230
  return false;
1201
1231
  case "left":
1202
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1203
- width: SideLegendWidth
1204
- }, commonLegendProps));
1232
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
1205
1233
  case "bottom":
1206
1234
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
1207
1235
  wrap: true
@@ -1211,9 +1239,7 @@ var getLegend = (props) => {
1211
1239
  wrap: true
1212
1240
  }, commonLegendProps));
1213
1241
  default:
1214
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1215
- width: SideLegendWidth
1216
- }, commonLegendProps));
1242
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
1217
1243
  }
1218
1244
  };
1219
1245
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -1248,22 +1274,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1248
1274
  const end = axisTitle.slice(-halfChars);
1249
1275
  return `${start}...${end}`;
1250
1276
  };
1251
- var getFieldName = (field) => {
1277
+ var getFieldName2 = (field) => {
1252
1278
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1253
1279
  return fieldName;
1254
1280
  };
1255
1281
  var getFieldNames = (fields) => {
1256
- return fields.map((field) => getFieldName(field));
1282
+ return fields.map((field) => getFieldName2(field));
1257
1283
  };
1258
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1284
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1259
1285
  const xConfig = { x: {} };
1260
1286
  xConfig.x.label = label;
1261
1287
  if (xAxisLabelVisibility === "hide") {
1262
1288
  xConfig.x.hideLabels = true;
1263
1289
  }
1290
+ if (xAxisLabelRotation !== void 0) {
1291
+ xConfig.x.labelRotation = xAxisLabelRotation;
1292
+ }
1264
1293
  return xConfig;
1265
1294
  };
1266
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1295
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1267
1296
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1268
1297
  const yConfig = { y: {} };
1269
1298
  yConfig.y.label = label;
@@ -1271,34 +1300,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1271
1300
  if (yAxisAbbreviation !== "none") {
1272
1301
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
1273
1302
  }
1274
- if (yAxisAbbreviation === "none") {
1275
- yConfig.y.width = 55;
1276
- } else {
1303
+ if (yAxisAbbreviation !== "none") {
1277
1304
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
1278
1305
  }
1279
1306
  if (yAxisLabelVisibility === "hide") {
1280
1307
  yConfig.y.hideLabels = true;
1281
1308
  }
1309
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1310
+ yConfig.y.range = (u, dataMin, dataMax) => {
1311
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1312
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1313
+ return [min, max];
1314
+ };
1315
+ }
1282
1316
  return yConfig;
1283
1317
  };
1284
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1318
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1285
1319
  const y2Config = { y2: {} };
1286
1320
  const scaleType = axisScale != null ? axisScale : "linear";
1287
1321
  y2Config.y2.label = label;
1288
1322
  y2Config.y2.side = "right";
1289
- y2Config.y2.showGrid = false;
1290
1323
  y2Config.y2.type = scaleType;
1291
1324
  if (axisAbbreviation !== "none") {
1292
1325
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
1326
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
1293
1327
  } else if (roundAxisLabelsToInteger) {
1294
1328
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
1295
1329
  }
1296
1330
  if (y2AxisLabelVisibility === "hide") {
1297
1331
  y2Config.y2.hideLabels = true;
1298
1332
  }
1333
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1334
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1335
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1336
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1337
+ return [min, max];
1338
+ };
1339
+ }
1299
1340
  return y2Config;
1300
1341
  };
1301
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1342
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
1302
1343
  const seriesConfig = {};
1303
1344
  let spanGaps;
1304
1345
  let replaceNullsWithZero;
@@ -1325,6 +1366,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1325
1366
  );
1326
1367
  if (shouldAssignToY2) {
1327
1368
  seriesConfig[field].overrides.scale = "y2";
1369
+ } else {
1370
+ seriesConfig[field].overrides.scale = "y";
1328
1371
  }
1329
1372
  }
1330
1373
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -1333,12 +1376,101 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1333
1376
  if (markerDisplay !== void 0) {
1334
1377
  seriesConfig[field].markerDisplay = markerDisplay;
1335
1378
  }
1379
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1380
+ if (fieldDashStyle) {
1381
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1382
+ }
1383
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
1384
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
1385
+ if (fieldStepPosition && fieldStepPosition !== "off") {
1386
+ seriesConfig[field].stepPosition = fieldStepPosition;
1387
+ }
1336
1388
  if (replaceNullsWithZero !== void 0) {
1337
1389
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1338
1390
  }
1339
1391
  });
1340
1392
  return seriesConfig;
1341
1393
  };
1394
+ var findRangeIndices = (xData, startValue, endValue) => {
1395
+ let startXIndex = -1;
1396
+ let endXIndex = -1;
1397
+ const xDataEpoch = xData.map((val) => {
1398
+ if (typeof val === "string") {
1399
+ return new Date(val).getTime() / 1e3;
1400
+ }
1401
+ return val;
1402
+ });
1403
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1404
+ if (xDataEpoch[i] >= startValue) {
1405
+ startXIndex = i;
1406
+ break;
1407
+ }
1408
+ }
1409
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1410
+ startXIndex = xDataEpoch.length - 1;
1411
+ }
1412
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1413
+ if (xDataEpoch[i] <= endValue) {
1414
+ endXIndex = i;
1415
+ break;
1416
+ }
1417
+ }
1418
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1419
+ endXIndex = 0;
1420
+ }
1421
+ return { startXIndex, endXIndex };
1422
+ };
1423
+
1424
+ // esm-externals:@splunk/visualization-schemas
1425
+ var visualization_schemas_exports = {};
1426
+ __export(visualization_schemas_exports, {
1427
+ default: () => visualization_schemas_default
1428
+ });
1429
+ var defaultImport29 = __toESM(require("@splunk/visualization-schemas"));
1430
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1431
+ var visualization_schemas_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
1432
+
1433
+ // src/common/hooks/useTrellisEnabled.ts
1434
+ var useTrellisFeatureFlagOn = () => {
1435
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1436
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1437
+ };
1438
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1439
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1440
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1441
+ };
1442
+
1443
+ // src/common/components/TrellisTitle.tsx
1444
+ var TRELLIS_TITLE_HEIGHT = 28;
1445
+ var TrellisTitleText = styled_components_default.div`
1446
+ margin-left: 10px;
1447
+ margin-right: 10px;
1448
+ padding-top: 8px;
1449
+ text-overflow: ellipsis;
1450
+ white-space: nowrap;
1451
+ overflow: hidden;
1452
+ `;
1453
+ var TrellisTitleDiv = styled_components_default.div`
1454
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1455
+ font-size: 14px;
1456
+ font-weight: 700;
1457
+ color: ${(props) => props.fontColor};
1458
+ background-color: ${(props) => props.backgroundColor};
1459
+ box-shadow: 0 1px ${(props) => props.backgroundColor}; // this is added to avoid a 1px gap between title and viz divs that showed up intermittently because of pixel rounding error in chrome.
1460
+ `;
1461
+ var TrellisTitle = (props) => {
1462
+ const titleText = String(props.trellisKey).toString();
1463
+ return /* @__PURE__ */ react_exports.createElement(
1464
+ TrellisTitleDiv,
1465
+ {
1466
+ fontColor: props.fontColor,
1467
+ backgroundColor: props.backgroundColor,
1468
+ "data-test": "trellis-title",
1469
+ title: titleText
1470
+ },
1471
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1472
+ );
1473
+ };
1342
1474
 
1343
1475
  // src/common/TimeSeriesChartWrapper.tsx
1344
1476
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1349,38 +1481,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1349
1481
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1350
1482
  }
1351
1483
  `;
1352
- var handleClick = (chartEvent, onClick) => {
1484
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1485
+ const result = __spreadValues({}, payload);
1486
+ if (trellisSplitBy) {
1487
+ result["trellis.name"] = trellisSplitBy;
1488
+ }
1489
+ if (trellisKey) {
1490
+ result["trellis.value"] = trellisKey;
1491
+ }
1492
+ return result;
1493
+ };
1494
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1495
+ if (!previousPayload) {
1496
+ return true;
1497
+ }
1498
+ if (currentPayload.index !== previousPayload.index) {
1499
+ return true;
1500
+ }
1501
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1502
+ return true;
1503
+ }
1504
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1505
+ return true;
1506
+ }
1507
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1508
+ return true;
1509
+ }
1510
+ return false;
1511
+ };
1512
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1353
1513
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1354
1514
  name: chartEvent.seriesKey
1355
1515
  });
1356
1516
  delete payload.seriesKey;
1357
1517
  if (chartEvent.rowContext) {
1358
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1359
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1360
- });
1518
+ Object.assign(
1519
+ payload,
1520
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1521
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1522
+ return acc;
1523
+ }, {})
1524
+ );
1361
1525
  }
1526
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1362
1527
  if (onClick) {
1363
1528
  onClick({
1364
1529
  type: "point.click",
1365
1530
  originalEvent: chartEvent,
1366
- payload
1531
+ payload: updatedPayload
1367
1532
  });
1368
1533
  }
1369
1534
  };
1370
- var handleLegendClick = (chartEvent, onClick) => {
1535
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1371
1536
  const payload = {
1372
1537
  name: chartEvent
1373
1538
  };
1539
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1374
1540
  if (onClick) {
1375
1541
  onClick({
1376
1542
  type: "legend.click",
1377
1543
  originalEvent: chartEvent,
1378
- payload
1544
+ payload: updatedPayload
1379
1545
  });
1380
1546
  }
1381
1547
  };
1548
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1549
+ var _a;
1550
+ if (!rangeEvent) {
1551
+ return;
1552
+ }
1553
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1554
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1555
+ const payload = {
1556
+ startXIndex,
1557
+ startXValue: rangeEvent.start,
1558
+ endXIndex,
1559
+ endXValue: rangeEvent.end
1560
+ };
1561
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1562
+ if (onSelect) {
1563
+ onSelect({
1564
+ type: "range.selectBeforeZoom",
1565
+ originalEvent: rangeEvent,
1566
+ payload: updatedPayload
1567
+ });
1568
+ }
1569
+ };
1570
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1571
+ var _a;
1572
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1573
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1574
+ const payload = {
1575
+ startXIndex,
1576
+ startXValue: rangeEvent.start,
1577
+ endXIndex,
1578
+ endXValue: rangeEvent.end
1579
+ };
1580
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1581
+ if (onSelect) {
1582
+ onSelect({
1583
+ type: "range.select",
1584
+ originalEvent: rangeEvent,
1585
+ payload: updatedPayload
1586
+ });
1587
+ }
1588
+ };
1589
+ var parseArrayOption = (value) => {
1590
+ if (Array.isArray(value)) {
1591
+ return value;
1592
+ }
1593
+ if (value) {
1594
+ return JSON.parse(value);
1595
+ }
1596
+ return void 0;
1597
+ };
1382
1598
  var TimeSeriesChartWrapper = (props) => {
1383
- const {
1599
+ var _b, _c, _d;
1600
+ const _a = props, {
1384
1601
  width,
1385
1602
  height,
1386
1603
  chartData,
@@ -1393,12 +1610,57 @@ var TimeSeriesChartWrapper = (props) => {
1393
1610
  markerDisplay,
1394
1611
  onClick,
1395
1612
  onPointMouseOver,
1396
- onPointMouseOut
1397
- } = props;
1398
- const {
1613
+ onPointMouseOut,
1614
+ onSelect,
1615
+ splitByLayout,
1616
+ trellisKey,
1617
+ trellisSplitBy,
1399
1618
  backgroundColor,
1619
+ defaultFontColor,
1620
+ additionalTooltipValues,
1621
+ xAxisLineVisibility: xAxisLineVisibility,
1622
+ yAxisLineVisibility,
1623
+ y2AxisLineVisibility,
1624
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1625
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1626
+ } = _a, otherOptions = __objRest(_a, [
1627
+ "width",
1628
+ "height",
1629
+ "chartData",
1630
+ "options",
1631
+ "userLocale",
1632
+ "annotationX",
1633
+ "annotationLabel",
1634
+ "annotationColor",
1635
+ "legendDisplay",
1636
+ "markerDisplay",
1637
+ "onClick",
1638
+ "onPointMouseOver",
1639
+ "onPointMouseOut",
1640
+ "onSelect",
1641
+ "splitByLayout",
1642
+ "trellisKey",
1643
+ "trellisSplitBy",
1644
+ "backgroundColor",
1645
+ "defaultFontColor",
1646
+ "additionalTooltipValues",
1647
+ // Extract axis line visibility options from props
1648
+ "xAxisLineVisibility",
1649
+ "yAxisLineVisibility",
1650
+ "y2AxisLineVisibility",
1651
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1652
+ "showYAxisWithZero",
1653
+ "showY2AxisWithZero"
1654
+ ]);
1655
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1656
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1657
+ const {
1658
+ backgroundColor: bgColorFromOptions,
1400
1659
  seriesColors: seriesColorsStr,
1401
1660
  fieldColors,
1661
+ legendLabels: legendLabelsStr,
1662
+ legendMode,
1663
+ legendTruncation,
1402
1664
  "axisTitleX.text": xAxisTitleText,
1403
1665
  "axisTitleY.text": yAxisTitleText,
1404
1666
  "axisTitleY2.text": y2AxisTitleText,
@@ -1406,8 +1668,12 @@ var TimeSeriesChartWrapper = (props) => {
1406
1668
  "axisTitleY.visibility": yAxisTitleVisibility,
1407
1669
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1408
1670
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1671
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1672
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
1409
1673
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1674
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1410
1675
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1676
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1411
1677
  "axisY.abbreviation": yAxisAbbreviation,
1412
1678
  "axisY.scale": yAxisScale,
1413
1679
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1417,10 +1683,73 @@ var TimeSeriesChartWrapper = (props) => {
1417
1683
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1418
1684
  "chart.overlayFields": overlayFieldsStr,
1419
1685
  "chart.nullValueMode": nullValueMode,
1420
- lineWidth
1686
+ "chart.showDataLabels": showDataLabels,
1687
+ lineWidth,
1688
+ lineDashStyle,
1689
+ fieldDashStyles: lineDashStylesByFieldStr,
1690
+ stepPosition,
1691
+ fieldStepPositions: stepPositionsByFieldStr,
1692
+ yAxisMin: yAxisMinRaw,
1693
+ yAxisMax: yAxisMaxRaw,
1694
+ y2AxisMin: y2AxisMinRaw,
1695
+ y2AxisMax: y2AxisMaxRaw,
1696
+ showXMajorGridLines,
1697
+ showYMajorGridLines,
1698
+ showY2MajorGridLines,
1699
+ showYMinorGridLines,
1700
+ showY2MinorGridLines,
1701
+ showLineSmoothing,
1702
+ xAxisMajorTickVisibility,
1703
+ xAxisMajorTickSize,
1704
+ yAxisMajorTickVisibility,
1705
+ y2AxisMajorTickVisibility,
1706
+ yAxisMajorTickSize,
1707
+ y2AxisMajorTickSize,
1708
+ yAxisMajorTickInterval,
1709
+ y2AxisMajorTickInterval,
1710
+ yAxisMinorTickVisibility,
1711
+ y2AxisMinorTickVisibility,
1712
+ yAxisMinorTickSize,
1713
+ y2AxisMinorTickSize,
1714
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1715
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1421
1716
  } = options;
1717
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1718
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1719
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1720
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
1721
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1722
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1723
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1724
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1725
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
1726
+ const showYAxisLine = yAxisLineVisibility === "show";
1727
+ const showY2AxisLine = y2AxisLineVisibility === "show";
1728
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1729
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1730
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1731
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1732
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1733
+ if (simpleXMLValue) return Number(simpleXMLValue);
1734
+ if (canvasValue) return Number(canvasValue);
1735
+ return void 0;
1736
+ };
1737
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1738
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1739
+ y2AxisMajorUnitFromSimpleXML,
1740
+ y2AxisMajorTickInterval
1741
+ );
1742
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
1743
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
1744
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
1745
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
1746
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
1422
1747
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1423
1748
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1749
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1750
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
1751
+ const legendLabels = parseArrayOption(legendLabelsStr);
1752
+ const bgColor = backgroundColor || bgColorFromOptions;
1424
1753
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1425
1754
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1426
1755
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1431,31 +1760,64 @@ var TimeSeriesChartWrapper = (props) => {
1431
1760
  fields: chartData.fields,
1432
1761
  columns: chartData.seriesList
1433
1762
  });
1434
- const xField = getFieldName(filteredChartData.fields[0]);
1763
+ const xField = getFieldName2(filteredChartData.fields[0]);
1435
1764
  const yFields = getFieldNames(
1436
1765
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1437
1766
  );
1438
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1439
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1767
+ const y2Fields = (0, react_exports.useMemo)(
1768
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1769
+ [y2FieldsStr]
1770
+ );
1771
+ const overlayFields = (0, react_exports.useMemo)(
1772
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1773
+ [overlayFieldsStr]
1774
+ );
1440
1775
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1441
1776
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1442
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1777
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1778
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1443
1779
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1444
1780
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1445
1781
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1446
1782
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1447
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1448
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1449
- let y2ScaleConfig = {};
1450
- if (y2Enabled) {
1451
- y2ScaleConfig = getY2ScaleConfig(
1452
- y2AxisTitle,
1453
- y2AxisAbbreviation,
1454
- y2AxisScale,
1455
- y2IntegerUnits,
1456
- y2AxisLabelVisibility
1457
- );
1458
- }
1783
+ const xScaleConfig = (0, react_exports.useMemo)(
1784
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1785
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1786
+ );
1787
+ const yScaleConfig = (0, react_exports.useMemo)(
1788
+ () => getYScaleConfig(
1789
+ yAxisTitle,
1790
+ yAxisAbbreviation,
1791
+ yAxisScale,
1792
+ yAxisLabelVisibility,
1793
+ yAxisMin,
1794
+ yAxisMax
1795
+ ),
1796
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1797
+ );
1798
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1799
+ if (y2Enabled) {
1800
+ return getY2ScaleConfig(
1801
+ y2AxisTitle,
1802
+ y2AxisAbbreviation,
1803
+ y2AxisScale,
1804
+ y2IntegerUnits,
1805
+ y2AxisLabelVisibility,
1806
+ y2AxisMin,
1807
+ y2AxisMax
1808
+ );
1809
+ }
1810
+ return {};
1811
+ }, [
1812
+ y2Enabled,
1813
+ y2AxisTitle,
1814
+ y2AxisAbbreviation,
1815
+ y2AxisScale,
1816
+ y2IntegerUnits,
1817
+ y2AxisLabelVisibility,
1818
+ y2AxisMin,
1819
+ y2AxisMax
1820
+ ]);
1459
1821
  const uplotContainerElement = (0, react_exports.useRef)(null);
1460
1822
  const seriesDataFormatted = [
1461
1823
  filteredChartData.columns[0],
@@ -1471,9 +1833,25 @@ var TimeSeriesChartWrapper = (props) => {
1471
1833
  overlayFields,
1472
1834
  y2Enabled,
1473
1835
  nullValueMode,
1474
- markerDisplay
1836
+ markerDisplay,
1837
+ lineDashStyle,
1838
+ lineDashStylesByField,
1839
+ stepPosition,
1840
+ stepPositionsByField
1475
1841
  ),
1476
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1842
+ [
1843
+ yFields,
1844
+ y2Fields,
1845
+ lineWidth,
1846
+ overlayFields,
1847
+ y2Enabled,
1848
+ nullValueMode,
1849
+ markerDisplay,
1850
+ lineDashStyle,
1851
+ lineDashStylesByField,
1852
+ stepPosition,
1853
+ stepPositionsByField
1854
+ ]
1477
1855
  );
1478
1856
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1479
1857
  () => getAnnotationsForCanvas({
@@ -1487,25 +1865,59 @@ var TimeSeriesChartWrapper = (props) => {
1487
1865
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1488
1866
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1489
1867
  );
1490
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1868
+ const isSeriesCompare = legendMode === "seriesCompare";
1869
+ const legend = (0, react_exports.useMemo)(
1870
+ () => getLegend({
1871
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
1872
+ isSeriesCompare,
1873
+ legendTruncation
1874
+ }),
1875
+ [legendDisplay, isSeriesCompare, legendTruncation]
1876
+ );
1491
1877
  const handleChartClick = react_exports.useCallback(
1492
1878
  (event) => {
1493
1879
  if (onClick) {
1494
- handleClick(event, onClick);
1880
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1495
1881
  }
1496
1882
  },
1497
- [onClick]
1883
+ [onClick, trellisKey, trellisSplitBy]
1498
1884
  );
1499
1885
  const handleChartLegendClick = react_exports.useCallback(
1500
1886
  (event) => {
1501
1887
  if (onClick) {
1502
- handleLegendClick(event, onClick);
1888
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1889
+ }
1890
+ },
1891
+ [onClick, trellisKey, trellisSplitBy]
1892
+ );
1893
+ const handleChartRangeSelection = react_exports.useCallback(
1894
+ (range2) => {
1895
+ if (onSelect) {
1896
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1897
+ }
1898
+ },
1899
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1900
+ );
1901
+ const handleChartRangeZoom = react_exports.useCallback(
1902
+ (range2) => {
1903
+ if (onSelect) {
1904
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1503
1905
  }
1504
1906
  },
1505
- [onClick]
1907
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1908
+ );
1909
+ const xFieldToUse = xFieldFromProps || xField;
1910
+ const enableSearchZoom = react_exports.useMemo(
1911
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1912
+ [eventHandlers, xFieldToUse]
1506
1913
  );
1507
1914
  const lastPayloadRef = react_exports.useRef(null);
1508
1915
  const lastOriginalEventRef = react_exports.useRef(null);
1916
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1917
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1918
+ react_exports.useEffect(() => {
1919
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1920
+ }, [additionalTooltipValues]);
1509
1921
  const handleChartCrosshairChange = react_exports.useCallback(
1510
1922
  (event) => {
1511
1923
  if (onPointMouseOver || onPointMouseOut) {
@@ -1517,6 +1929,7 @@ var TimeSeriesChartWrapper = (props) => {
1517
1929
  payload: lastPayloadRef.current
1518
1930
  });
1519
1931
  }
1932
+ previousMouseoverPayloadRef.current = null;
1520
1933
  return;
1521
1934
  }
1522
1935
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1524,25 +1937,36 @@ var TimeSeriesChartWrapper = (props) => {
1524
1937
  });
1525
1938
  delete payload.seriesKey;
1526
1939
  if (event.rowContext) {
1527
- Object.keys(event.rowContext).forEach((fieldName) => {
1528
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1529
- });
1940
+ Object.assign(
1941
+ payload,
1942
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1943
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1944
+ return acc;
1945
+ }, {})
1946
+ );
1530
1947
  }
1531
- lastPayloadRef.current = payload;
1948
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1949
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1950
+ return;
1951
+ }
1952
+ lastPayloadRef.current = updatedPayload;
1532
1953
  lastOriginalEventRef.current = event;
1954
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1533
1955
  if (onPointMouseOver) {
1534
1956
  onPointMouseOver({
1535
1957
  type: "point.mouseover",
1536
1958
  originalEvent: event,
1537
- payload
1959
+ payload: updatedPayload
1538
1960
  });
1539
1961
  }
1540
1962
  }
1541
1963
  },
1542
- [onPointMouseOver, onPointMouseOut]
1964
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1543
1965
  );
1544
- const memoizedChart = (0, react_exports.useMemo)(
1545
- () => /* @__PURE__ */ react_exports.createElement(
1966
+ 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}`;
1967
+ const memoizedChart = (0, react_exports.useMemo)(() => {
1968
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
1969
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1546
1970
  visualization_canvas_exports.TimeSeriesChart,
1547
1971
  {
1548
1972
  data: chartData,
@@ -1552,49 +1976,121 @@ var TimeSeriesChartWrapper = (props) => {
1552
1976
  seriesColorsByField,
1553
1977
  seriesConfig: seriesOverrides,
1554
1978
  legend,
1979
+ legendLabels,
1980
+ legendTruncation,
1981
+ isSeriesCompare: legendMode === "seriesCompare",
1982
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1555
1983
  scaleConfig,
1556
1984
  timestampFormat: "expanded",
1557
1985
  onCrosshairClick: onClick ? handleChartClick : void 0,
1558
1986
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1559
1987
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
1988
+ onRangeSelection: handleChartRangeSelection,
1989
+ onRangeZoom: computedOnRangeZoom,
1990
+ serverSideZoom: enableSearchZoom,
1560
1991
  userLocale,
1561
1992
  events: chartingEventAnnotations,
1562
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
1993
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
1994
+ additionalTooltipValuesRef,
1995
+ showXMajorGridLines,
1996
+ showYMajorGridLines,
1997
+ showY2MajorGridLines,
1998
+ showYMinorGridLines,
1999
+ showY2MinorGridLines,
2000
+ showLineSmoothing,
2001
+ dataValuesDisplay,
2002
+ showXMajorTicks,
2003
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
2004
+ showYMajorTicks,
2005
+ showY2MajorTicks,
2006
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2007
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2008
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2009
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2010
+ showYMinorTicks,
2011
+ showY2MinorTicks,
2012
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2013
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2014
+ showYAxisWithZero,
2015
+ showY2AxisWithZero,
2016
+ showXAxisLine,
2017
+ showYAxisLine,
2018
+ showY2AxisLine,
2019
+ xAxisMaxLabelParts
1563
2020
  }
1564
- ),
1565
- [
1566
- chartData,
1567
- containerWidth,
1568
- containerHeight,
1569
- seriesColors,
1570
- seriesColorsByField,
1571
- seriesOverrides,
1572
- legend,
1573
- scaleConfig,
1574
- userLocale,
1575
- chartingEventAnnotations,
1576
- onClick,
1577
- handleChartClick,
1578
- onPointMouseOver,
1579
- onPointMouseOut,
1580
- handleChartCrosshairChange,
1581
- handleChartLegendClick
1582
- ]
1583
- );
2021
+ ));
2022
+ }, [
2023
+ onSelect,
2024
+ handleChartRangeZoom,
2025
+ dataKey,
2026
+ chartData,
2027
+ containerWidth,
2028
+ containerHeight,
2029
+ seriesColors,
2030
+ seriesColorsByField,
2031
+ seriesOverrides,
2032
+ legend,
2033
+ legendLabels,
2034
+ legendTruncation,
2035
+ scaleConfig,
2036
+ onClick,
2037
+ handleChartClick,
2038
+ onPointMouseOver,
2039
+ onPointMouseOut,
2040
+ handleChartCrosshairChange,
2041
+ handleChartLegendClick,
2042
+ handleChartRangeSelection,
2043
+ enableSearchZoom,
2044
+ userLocale,
2045
+ chartingEventAnnotations,
2046
+ showXMajorGridLines,
2047
+ showYMajorGridLines,
2048
+ showY2MajorGridLines,
2049
+ showYMinorGridLines,
2050
+ showY2MinorGridLines,
2051
+ showLineSmoothing,
2052
+ dataValuesDisplay,
2053
+ showXMajorTicks,
2054
+ xAxisMajorTickSizeNum,
2055
+ showYMajorTicks,
2056
+ showY2MajorTicks,
2057
+ yAxisMajorTickSizeNum,
2058
+ y2AxisMajorTickSizeNum,
2059
+ yAxisMajorTickIntervalNum,
2060
+ y2AxisMajorTickIntervalNum,
2061
+ showYMinorTicks,
2062
+ showY2MinorTicks,
2063
+ yAxisMinorTickSizeNum,
2064
+ y2AxisMinorTickSizeNum,
2065
+ showYAxisWithZero,
2066
+ showY2AxisWithZero,
2067
+ showXAxisLine,
2068
+ showYAxisLine,
2069
+ showY2AxisLine,
2070
+ legendMode,
2071
+ xAxisMaxLabelParts
2072
+ ]);
1584
2073
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1585
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1586
- }, [backgroundColor, memoizedChart]);
1587
- return /* @__PURE__ */ react_exports.createElement(
2074
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2075
+ }, [bgColor, memoizedChart]);
2076
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2077
+ TrellisTitle,
2078
+ {
2079
+ trellisKey,
2080
+ backgroundColor: bgColor,
2081
+ fontColor: defaultFontColor
2082
+ }
2083
+ ), /* @__PURE__ */ react_exports.createElement(
1588
2084
  TimeSeriesChartContainer,
1589
2085
  {
1590
- height,
2086
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1591
2087
  width,
1592
2088
  ref: uplotContainerElement,
1593
2089
  "data-test": "timeseries-chart-wrapper"
1594
2090
  },
1595
2091
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1596
2092
  memoizedVisualization
1597
- );
2093
+ ));
1598
2094
  };
1599
2095
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1600
2096
 
@@ -1889,27 +2385,27 @@ var xpath_exports = {};
1889
2385
  __export(xpath_exports, {
1890
2386
  default: () => xpath_default
1891
2387
  });
1892
- var defaultImport29 = __toESM(require("xpath"));
2388
+ var defaultImport30 = __toESM(require("xpath"));
1893
2389
  __reExport(xpath_exports, require("xpath"));
1894
- var xpath_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
2390
+ var xpath_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
1895
2391
 
1896
2392
  // esm-externals:@xmldom/xmldom
1897
2393
  var xmldom_exports = {};
1898
2394
  __export(xmldom_exports, {
1899
2395
  default: () => xmldom_default
1900
2396
  });
1901
- var defaultImport30 = __toESM(require("@xmldom/xmldom"));
2397
+ var defaultImport31 = __toESM(require("@xmldom/xmldom"));
1902
2398
  __reExport(xmldom_exports, require("@xmldom/xmldom"));
1903
- var xmldom_default = "default" in defaultImport30 ? defaultImport30.default : defaultImport30;
2399
+ var xmldom_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
1904
2400
 
1905
2401
  // esm-externals:jexl
1906
2402
  var jexl_exports = {};
1907
2403
  __export(jexl_exports, {
1908
2404
  default: () => jexl_default
1909
2405
  });
1910
- var defaultImport31 = __toESM(require("jexl"));
2406
+ var defaultImport32 = __toESM(require("jexl"));
1911
2407
  __reExport(jexl_exports, require("jexl"));
1912
- var jexl_default = "default" in defaultImport31 ? defaultImport31.default : defaultImport31;
2408
+ var jexl_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
1913
2409
 
1914
2410
  // src/ChoroplethSvg/PureChoroplethSvg/SvgMutator.ts
1915
2411
  var ERROR_NON_ATTRIBUTE_MUTATION = "mutations only allowed on attribute nodes";
@@ -2412,7 +2908,6 @@ var computeSvgDynamicProps = (_a) => {
2412
2908
  const dataBinding = [
2413
2909
  {
2414
2910
  xPath: `'//*[@id="'+featureIDs[$i]+'"]/@fill'`,
2415
- // fixme todo move to DO as "xPath: areadIds | prepefix(`//*[@id="`)| suffix(`"/@fill`) > "
2416
2911
  value: "fill[$i]"
2417
2912
  }
2418
2913
  ];
@@ -2444,15 +2939,6 @@ var PureChoroplethSvg = (_a) => {
2444
2939
  };
2445
2940
  var PureChoroplethSvg_default = PureChoroplethSvg;
2446
2941
 
2447
- // esm-externals:@splunk/visualization-schemas
2448
- var visualization_schemas_exports = {};
2449
- __export(visualization_schemas_exports, {
2450
- default: () => visualization_schemas_default
2451
- });
2452
- var defaultImport32 = __toESM(require("@splunk/visualization-schemas"));
2453
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
2454
- var visualization_schemas_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
2455
-
2456
2942
  // esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
2457
2943
  var PresetPalettes_exports = {};
2458
2944
  __export(PresetPalettes_exports, {
@@ -2568,7 +3054,6 @@ var editorConfig = [
2568
3054
  editor: "editor.columnSelector",
2569
3055
  option: "areaIds",
2570
3056
  context: "areaIdContext",
2571
- // todo: need refactor this
2572
3057
  editorProps: {
2573
3058
  dataSourceKey: "primary"
2574
3059
  }
@@ -2579,8 +3064,7 @@ var editorConfig = [
2579
3064
  label: "Area values",
2580
3065
  editor: "editor.columnSelector",
2581
3066
  option: "areaValues",
2582
- context: "areaValuesContext",
2583
- // todo: need refactor this
3067
+ context: "areaIdContext",
2584
3068
  editorProps: {
2585
3069
  dataSourceKey: "primary"
2586
3070
  }