@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/Markdown.js CHANGED
@@ -25,6 +25,18 @@ var __spreadValues = (a, b) => {
25
25
  return a;
26
26
  };
27
27
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
28
+ var __objRest = (source, exclude) => {
29
+ var target = {};
30
+ for (var prop in source)
31
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
32
+ target[prop] = source[prop];
33
+ if (source != null && __getOwnPropSymbols)
34
+ for (var prop of __getOwnPropSymbols(source)) {
35
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
36
+ target[prop] = source[prop];
37
+ }
38
+ return target;
39
+ };
28
40
  var __export = (target, all) => {
29
41
  for (var name in all)
30
42
  __defProp(target, name, { get: all[name], enumerable: true });
@@ -49,16 +61,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
49
61
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
62
 
51
63
  // src/Markdown/index.ts
52
- var Markdown_exports2 = {};
53
- __export(Markdown_exports2, {
64
+ var Markdown_exports3 = {};
65
+ __export(Markdown_exports3, {
54
66
  FONT_SIZES: () => FONT_SIZES,
55
67
  computeVizProps: () => computeVizProps,
56
68
  config: () => config_default,
57
- default: () => Markdown_default2,
69
+ default: () => Markdown_default3,
58
70
  getFontMap: () => getFontMap,
59
71
  themes: () => themes2
60
72
  });
61
- module.exports = __toCommonJS(Markdown_exports2);
73
+ module.exports = __toCommonJS(Markdown_exports3);
62
74
 
63
75
  // esm-externals:lodash
64
76
  var lodash_exports = {};
@@ -548,7 +560,7 @@ var Cover = styled_components_default.div`
548
560
  bottom: 0;
549
561
  `;
550
562
  var Blocker = styled_components_default.div.attrs({
551
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b"
563
+ "data-splunk-visualization-version": "28.5.0 - b192418b7"
552
564
  })`
553
565
  position: relative;
554
566
  width: 100%;
@@ -638,7 +650,7 @@ var withFixedSizeContainer = (Viz) => {
638
650
  FixSizeItem,
639
651
  {
640
652
  "data-test": "fix-size-item",
641
- "data-splunk-visualization-version": "28.3.0 - 843e0f60b",
653
+ "data-splunk-visualization-version": "28.5.0 - b192418b7",
642
654
  width,
643
655
  height,
644
656
  backgroundColor
@@ -734,6 +746,7 @@ __reExport(numberUtils_exports, require("@splunk/visualizations-shared/numberUti
734
746
  var numberUtils_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
735
747
 
736
748
  // src/common/utils/dataUtils.ts
749
+ var getFieldName = (field) => typeof field === "string" ? field : field.name;
737
750
  var largestTriangleThreeBuckets = (data, threshold, preferredDownsampleIndices) => {
738
751
  const dataLength = data.length;
739
752
  const downsampledIndices = [];
@@ -850,9 +863,9 @@ var tryToCoerceAllDisplayedFields = (ds, xField, yFields, fieldTypes, options) =
850
863
  let xColumn = [];
851
864
  const yColumns = [];
852
865
  const canDownsample = !ds.data.fields.some((field, index) => {
853
- var _a, _b;
854
- const fieldName = (_a = field.name) != null ? _a : field;
855
- const fieldType = (_b = fieldTypes[index]) != null ? _b : "unknown";
866
+ var _a;
867
+ const fieldName = getFieldName(field);
868
+ const fieldType = (_a = fieldTypes[index]) != null ? _a : "unknown";
856
869
  const column = ds.data.columns[index];
857
870
  let hasDisplayedColumnThatCantBeDownsampled = false;
858
871
  if (fieldName === xField) {
@@ -1205,6 +1218,16 @@ var triangleEventAnnotationRenderer = ({
1205
1218
  eventColor: eventWithColor.color
1206
1219
  });
1207
1220
  };
1221
+ var shouldEnableSearchZoom = (eventHandlers = [], xField = "") => {
1222
+ const rangeSelectEventHandler = eventHandlers.find(
1223
+ (eventHandler) => {
1224
+ var _a;
1225
+ return (_a = eventHandler.options.events) == null ? void 0 : _a.includes("range.select");
1226
+ }
1227
+ );
1228
+ const xAxisIsTime = xField === "_time";
1229
+ return !!rangeSelectEventHandler && xAxisIsTime;
1230
+ };
1208
1231
  var canvasSupportedTimeSeriesCharts = ["splunk.line"];
1209
1232
  var isTimeSeriesCanvasRenderSupported = (vizConfigKey) => {
1210
1233
  return canvasSupportedTimeSeriesCharts.indexOf(vizConfigKey) > -1;
@@ -1225,17 +1248,34 @@ var filterChartDataFromInternalFields = (chartData) => {
1225
1248
  var convert2DArrayToNumbers = (arr) => {
1226
1249
  return arr.map((subArray) => subArray.map((element) => parseFloat(element)));
1227
1250
  };
1228
- var SideLegendWidth = 75;
1229
- var commonLegendProps = { center: true, fontSize: 12, largerTiles: true, hideSeriesValue: true };
1251
+ var parseAxisValue = (val) => {
1252
+ if (val === void 0 || val === null || val === "auto" || val === "") {
1253
+ return void 0;
1254
+ }
1255
+ const num = typeof val === "number" ? val : Number.parseFloat(val);
1256
+ return Number.isNaN(num) ? void 0 : num;
1257
+ };
1258
+ var parseXAxisLineVisibility = (visibility) => {
1259
+ if (visibility === "hide") return false;
1260
+ if (visibility === "show") return true;
1261
+ return void 0;
1262
+ };
1230
1263
  var getLegend = (props) => {
1231
1264
  const legendPlacement = props == null ? void 0 : props.legendDisplay;
1265
+ const { isSeriesCompare, legendTruncation } = props;
1266
+ const commonLegendProps = {
1267
+ center: true,
1268
+ fontSize: 12,
1269
+ largerTiles: true,
1270
+ hideSeriesValue: !isSeriesCompare,
1271
+ // Show values if in seriesCompare mode
1272
+ legendTruncation
1273
+ };
1232
1274
  switch (legendPlacement) {
1233
1275
  case "off":
1234
1276
  return false;
1235
1277
  case "left":
1236
- return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({
1237
- width: SideLegendWidth
1238
- }, commonLegendProps));
1278
+ return (0, visualization_canvas_exports.LeftLegendFactory)(__spreadValues({}, commonLegendProps));
1239
1279
  case "bottom":
1240
1280
  return (0, visualization_canvas_exports.BottomLegendFactory)(__spreadValues({
1241
1281
  wrap: true
@@ -1245,9 +1285,7 @@ var getLegend = (props) => {
1245
1285
  wrap: true
1246
1286
  }, commonLegendProps));
1247
1287
  default:
1248
- return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({
1249
- width: SideLegendWidth
1250
- }, commonLegendProps));
1288
+ return (0, visualization_canvas_exports.SideLegendFactory)(__spreadValues({}, commonLegendProps));
1251
1289
  }
1252
1290
  };
1253
1291
  var getComputedAxisTitles = (inputAxisTitle, fields, axisTitleVisibility) => {
@@ -1282,22 +1320,25 @@ var ellipsisAxisTitle = (axisTitle, containerSpacing, fontSize = 12) => {
1282
1320
  const end = axisTitle.slice(-halfChars);
1283
1321
  return `${start}...${end}`;
1284
1322
  };
1285
- var getFieldName = (field) => {
1323
+ var getFieldName2 = (field) => {
1286
1324
  const fieldName = typeof field === "object" ? field == null ? void 0 : field.name : field;
1287
1325
  return fieldName;
1288
1326
  };
1289
1327
  var getFieldNames = (fields) => {
1290
- return fields.map((field) => getFieldName(field));
1328
+ return fields.map((field) => getFieldName2(field));
1291
1329
  };
1292
- var getXScaleConfig = (label, xAxisLabelVisibility) => {
1330
+ var getXScaleConfig = (label, xAxisLabelVisibility, xAxisLabelRotation) => {
1293
1331
  const xConfig = { x: {} };
1294
1332
  xConfig.x.label = label;
1295
1333
  if (xAxisLabelVisibility === "hide") {
1296
1334
  xConfig.x.hideLabels = true;
1297
1335
  }
1336
+ if (xAxisLabelRotation !== void 0) {
1337
+ xConfig.x.labelRotation = xAxisLabelRotation;
1338
+ }
1298
1339
  return xConfig;
1299
1340
  };
1300
- var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility) => {
1341
+ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax) => {
1301
1342
  const scaleType = yAxisScale != null ? yAxisScale : "linear";
1302
1343
  const yConfig = { y: {} };
1303
1344
  yConfig.y.label = label;
@@ -1305,34 +1346,46 @@ var getYScaleConfig = (label, yAxisAbbreviation, yAxisScale, yAxisLabelVisibilit
1305
1346
  if (yAxisAbbreviation !== "none") {
1306
1347
  yConfig.y.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1);
1307
1348
  }
1308
- if (yAxisAbbreviation === "none") {
1309
- yConfig.y.width = 55;
1310
- } else {
1349
+ if (yAxisAbbreviation !== "none") {
1311
1350
  yConfig.y.width = label && label.length > 0 ? 30 : 10;
1312
1351
  }
1313
1352
  if (yAxisLabelVisibility === "hide") {
1314
1353
  yConfig.y.hideLabels = true;
1315
1354
  }
1355
+ if (yAxisMin !== void 0 || yAxisMax !== void 0) {
1356
+ yConfig.y.range = (u, dataMin, dataMax) => {
1357
+ const min = yAxisMin != null ? yAxisMin : dataMin;
1358
+ const max = yAxisMax != null ? yAxisMax : dataMax;
1359
+ return [min, max];
1360
+ };
1361
+ }
1316
1362
  return yConfig;
1317
1363
  };
1318
- var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility) => {
1364
+ var getY2ScaleConfig = (label, axisAbbreviation, axisScale, roundAxisLabelsToInteger, y2AxisLabelVisibility, y2AxisMin, y2AxisMax) => {
1319
1365
  const y2Config = { y2: {} };
1320
1366
  const scaleType = axisScale != null ? axisScale : "linear";
1321
1367
  y2Config.y2.label = label;
1322
1368
  y2Config.y2.side = "right";
1323
- y2Config.y2.showGrid = false;
1324
1369
  y2Config.y2.type = scaleType;
1325
1370
  if (axisAbbreviation !== "none") {
1326
1371
  y2Config.y2.tickFmt = (v) => (0, visualization_canvas_exports.shortenNumber)(v, 1, roundAxisLabelsToInteger);
1372
+ y2Config.y2.width = label && label.length > 0 ? 50 : 10;
1327
1373
  } else if (roundAxisLabelsToInteger) {
1328
1374
  y2Config.y2.tickFmt = (v) => roundAxisLabelsToInteger ? Math.round(v).toString() : v.toString();
1329
1375
  }
1330
1376
  if (y2AxisLabelVisibility === "hide") {
1331
1377
  y2Config.y2.hideLabels = true;
1332
1378
  }
1379
+ if (y2AxisMin !== void 0 || y2AxisMax !== void 0) {
1380
+ y2Config.y2.range = (u, dataMin, dataMax) => {
1381
+ const min = y2AxisMin != null ? y2AxisMin : dataMin;
1382
+ const max = y2AxisMax != null ? y2AxisMax : dataMax;
1383
+ return [min, max];
1384
+ };
1385
+ }
1333
1386
  return y2Config;
1334
1387
  };
1335
- var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay) => {
1388
+ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay, lineDashStyle, lineDashStylesByField, stepPosition, stepPositionsByField) => {
1336
1389
  const seriesConfig = {};
1337
1390
  let spanGaps;
1338
1391
  let replaceNullsWithZero;
@@ -1359,6 +1412,8 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1359
1412
  );
1360
1413
  if (shouldAssignToY2) {
1361
1414
  seriesConfig[field].overrides.scale = "y2";
1415
+ } else {
1416
+ seriesConfig[field].overrides.scale = "y";
1362
1417
  }
1363
1418
  }
1364
1419
  if (overlayFields == null ? void 0 : overlayFields.includes(field)) {
@@ -1367,12 +1422,101 @@ var getSeriesOverrides = (yfields, y2fields, lineWidth, overlayFields, y2Enabled
1367
1422
  if (markerDisplay !== void 0) {
1368
1423
  seriesConfig[field].markerDisplay = markerDisplay;
1369
1424
  }
1425
+ const fieldDashStyle = (lineDashStylesByField == null ? void 0 : lineDashStylesByField[field]) || lineDashStyle;
1426
+ if (fieldDashStyle) {
1427
+ seriesConfig[field].lineDashStyle = fieldDashStyle;
1428
+ }
1429
+ const hasFieldStepPosition = Object.hasOwn(stepPositionsByField || {}, field);
1430
+ const fieldStepPosition = hasFieldStepPosition ? stepPositionsByField == null ? void 0 : stepPositionsByField[field] : stepPosition;
1431
+ if (fieldStepPosition && fieldStepPosition !== "off") {
1432
+ seriesConfig[field].stepPosition = fieldStepPosition;
1433
+ }
1370
1434
  if (replaceNullsWithZero !== void 0) {
1371
1435
  seriesConfig[field].replaceNullsWithZero = replaceNullsWithZero;
1372
1436
  }
1373
1437
  });
1374
1438
  return seriesConfig;
1375
1439
  };
1440
+ var findRangeIndices = (xData, startValue, endValue) => {
1441
+ let startXIndex = -1;
1442
+ let endXIndex = -1;
1443
+ const xDataEpoch = xData.map((val) => {
1444
+ if (typeof val === "string") {
1445
+ return new Date(val).getTime() / 1e3;
1446
+ }
1447
+ return val;
1448
+ });
1449
+ for (let i = 0; i < xDataEpoch.length; i += 1) {
1450
+ if (xDataEpoch[i] >= startValue) {
1451
+ startXIndex = i;
1452
+ break;
1453
+ }
1454
+ }
1455
+ if (startXIndex === -1 && xDataEpoch.length > 0) {
1456
+ startXIndex = xDataEpoch.length - 1;
1457
+ }
1458
+ for (let i = xDataEpoch.length - 1; i >= 0; i -= 1) {
1459
+ if (xDataEpoch[i] <= endValue) {
1460
+ endXIndex = i;
1461
+ break;
1462
+ }
1463
+ }
1464
+ if (endXIndex === -1 && xDataEpoch.length > 0) {
1465
+ endXIndex = 0;
1466
+ }
1467
+ return { startXIndex, endXIndex };
1468
+ };
1469
+
1470
+ // esm-externals:@splunk/visualization-schemas
1471
+ var visualization_schemas_exports = {};
1472
+ __export(visualization_schemas_exports, {
1473
+ default: () => visualization_schemas_default
1474
+ });
1475
+ var defaultImport34 = __toESM(require("@splunk/visualization-schemas"));
1476
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1477
+ var visualization_schemas_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
1478
+
1479
+ // src/common/hooks/useTrellisEnabled.ts
1480
+ var useTrellisFeatureFlagOn = () => {
1481
+ const context = (0, react_exports.useContext)(FeatureFlagContext_default);
1482
+ return Boolean(context == null ? void 0 : context.visualizations_enableTrellis);
1483
+ };
1484
+ var useTrellisEnabled = (layoutType = visualization_schemas_exports.LAYOUT_TYPE.Off) => {
1485
+ const trellisFeatureEnabled = useTrellisFeatureFlagOn();
1486
+ return trellisFeatureEnabled && layoutType === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
1487
+ };
1488
+
1489
+ // src/common/components/TrellisTitle.tsx
1490
+ var TRELLIS_TITLE_HEIGHT = 28;
1491
+ var TrellisTitleText = styled_components_default.div`
1492
+ margin-left: 10px;
1493
+ margin-right: 10px;
1494
+ padding-top: 8px;
1495
+ text-overflow: ellipsis;
1496
+ white-space: nowrap;
1497
+ overflow: hidden;
1498
+ `;
1499
+ var TrellisTitleDiv = styled_components_default.div`
1500
+ height: ${TRELLIS_TITLE_HEIGHT}px;
1501
+ font-size: 14px;
1502
+ font-weight: 700;
1503
+ color: ${(props) => props.fontColor};
1504
+ background-color: ${(props) => props.backgroundColor};
1505
+ 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.
1506
+ `;
1507
+ var TrellisTitle = (props) => {
1508
+ const titleText = String(props.trellisKey).toString();
1509
+ return /* @__PURE__ */ react_exports.createElement(
1510
+ TrellisTitleDiv,
1511
+ {
1512
+ fontColor: props.fontColor,
1513
+ backgroundColor: props.backgroundColor,
1514
+ "data-test": "trellis-title",
1515
+ title: titleText
1516
+ },
1517
+ /* @__PURE__ */ react_exports.createElement(TrellisTitleText, null, titleText)
1518
+ );
1519
+ };
1376
1520
 
1377
1521
  // src/common/TimeSeriesChartWrapper.tsx
1378
1522
  var TimeSeriesChartContainer = styled_components_default.div`
@@ -1383,38 +1527,123 @@ var TimeSeriesChartContainer = styled_components_default.div`
1383
1527
  position: absolute !important; // This is needed for canvas element export pdf/png to work correctly
1384
1528
  }
1385
1529
  `;
1386
- var handleClick = (chartEvent, onClick) => {
1530
+ var appendTrellisToPayload = (payload, trellisKey, trellisSplitBy) => {
1531
+ const result = __spreadValues({}, payload);
1532
+ if (trellisSplitBy) {
1533
+ result["trellis.name"] = trellisSplitBy;
1534
+ }
1535
+ if (trellisKey) {
1536
+ result["trellis.value"] = trellisKey;
1537
+ }
1538
+ return result;
1539
+ };
1540
+ var hasMouseoverPayloadChanged = (currentPayload, previousPayload) => {
1541
+ if (!previousPayload) {
1542
+ return true;
1543
+ }
1544
+ if (currentPayload.index !== previousPayload.index) {
1545
+ return true;
1546
+ }
1547
+ if (currentPayload.seriesIndex !== previousPayload.seriesIndex) {
1548
+ return true;
1549
+ }
1550
+ if (currentPayload["trellis.name"] !== previousPayload["trellis.name"]) {
1551
+ return true;
1552
+ }
1553
+ if (currentPayload["trellis.value"] !== previousPayload["trellis.value"]) {
1554
+ return true;
1555
+ }
1556
+ return false;
1557
+ };
1558
+ var handleClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1387
1559
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(chartEvent, "value", "seriesKey")), {
1388
1560
  name: chartEvent.seriesKey
1389
1561
  });
1390
1562
  delete payload.seriesKey;
1391
1563
  if (chartEvent.rowContext) {
1392
- Object.keys(chartEvent.rowContext).forEach((fieldName) => {
1393
- payload[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1394
- });
1564
+ Object.assign(
1565
+ payload,
1566
+ Object.keys(chartEvent.rowContext).reduce((acc, fieldName) => {
1567
+ acc[`row.${fieldName}.value`] = chartEvent.rowContext[fieldName];
1568
+ return acc;
1569
+ }, {})
1570
+ );
1395
1571
  }
1572
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1396
1573
  if (onClick) {
1397
1574
  onClick({
1398
1575
  type: "point.click",
1399
1576
  originalEvent: chartEvent,
1400
- payload
1577
+ payload: updatedPayload
1401
1578
  });
1402
1579
  }
1403
1580
  };
1404
- var handleLegendClick = (chartEvent, onClick) => {
1581
+ var handleLegendClick = (chartEvent, onClick, trellisKey, trellisSplitBy) => {
1405
1582
  const payload = {
1406
1583
  name: chartEvent
1407
1584
  };
1585
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1408
1586
  if (onClick) {
1409
1587
  onClick({
1410
1588
  type: "legend.click",
1411
1589
  originalEvent: chartEvent,
1412
- payload
1590
+ payload: updatedPayload
1591
+ });
1592
+ }
1593
+ };
1594
+ var handleRangeSelection = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1595
+ var _a;
1596
+ if (!rangeEvent) {
1597
+ return;
1598
+ }
1599
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1600
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1601
+ const payload = {
1602
+ startXIndex,
1603
+ startXValue: rangeEvent.start,
1604
+ endXIndex,
1605
+ endXValue: rangeEvent.end
1606
+ };
1607
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1608
+ if (onSelect) {
1609
+ onSelect({
1610
+ type: "range.selectBeforeZoom",
1611
+ originalEvent: rangeEvent,
1612
+ payload: updatedPayload
1613
+ });
1614
+ }
1615
+ };
1616
+ var handleRangeZoom = (rangeEvent, onSelect, chartData, trellisKey, trellisSplitBy) => {
1617
+ var _a;
1618
+ const xData = ((_a = chartData == null ? void 0 : chartData.columns) == null ? void 0 : _a[0]) || [];
1619
+ const { startXIndex, endXIndex } = findRangeIndices(xData, rangeEvent.start, rangeEvent.end);
1620
+ const payload = {
1621
+ startXIndex,
1622
+ startXValue: rangeEvent.start,
1623
+ endXIndex,
1624
+ endXValue: rangeEvent.end
1625
+ };
1626
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1627
+ if (onSelect) {
1628
+ onSelect({
1629
+ type: "range.select",
1630
+ originalEvent: rangeEvent,
1631
+ payload: updatedPayload
1413
1632
  });
1414
1633
  }
1415
1634
  };
1635
+ var parseArrayOption = (value) => {
1636
+ if (Array.isArray(value)) {
1637
+ return value;
1638
+ }
1639
+ if (value) {
1640
+ return JSON.parse(value);
1641
+ }
1642
+ return void 0;
1643
+ };
1416
1644
  var TimeSeriesChartWrapper = (props) => {
1417
- const {
1645
+ var _b, _c, _d;
1646
+ const _a = props, {
1418
1647
  width,
1419
1648
  height,
1420
1649
  chartData,
@@ -1427,12 +1656,57 @@ var TimeSeriesChartWrapper = (props) => {
1427
1656
  markerDisplay,
1428
1657
  onClick,
1429
1658
  onPointMouseOver,
1430
- onPointMouseOut
1431
- } = props;
1432
- const {
1659
+ onPointMouseOut,
1660
+ onSelect,
1661
+ splitByLayout,
1662
+ trellisKey,
1663
+ trellisSplitBy,
1433
1664
  backgroundColor,
1665
+ defaultFontColor,
1666
+ additionalTooltipValues,
1667
+ xAxisLineVisibility: xAxisLineVisibility,
1668
+ yAxisLineVisibility,
1669
+ y2AxisLineVisibility,
1670
+ showYAxisWithZero: showYAxisWithZeroFromProps,
1671
+ showY2AxisWithZero: showY2AxisWithZeroFromProps
1672
+ } = _a, otherOptions = __objRest(_a, [
1673
+ "width",
1674
+ "height",
1675
+ "chartData",
1676
+ "options",
1677
+ "userLocale",
1678
+ "annotationX",
1679
+ "annotationLabel",
1680
+ "annotationColor",
1681
+ "legendDisplay",
1682
+ "markerDisplay",
1683
+ "onClick",
1684
+ "onPointMouseOver",
1685
+ "onPointMouseOut",
1686
+ "onSelect",
1687
+ "splitByLayout",
1688
+ "trellisKey",
1689
+ "trellisSplitBy",
1690
+ "backgroundColor",
1691
+ "defaultFontColor",
1692
+ "additionalTooltipValues",
1693
+ // Extract axis line visibility options from props
1694
+ "xAxisLineVisibility",
1695
+ "yAxisLineVisibility",
1696
+ "y2AxisLineVisibility",
1697
+ // Extract showYAxisWithZero directly from props for accelerated render mode
1698
+ "showYAxisWithZero",
1699
+ "showY2AxisWithZero"
1700
+ ]);
1701
+ const { eventHandlers, xField: xFieldFromProps } = otherOptions;
1702
+ const trellisEnabled = useTrellisEnabled(splitByLayout);
1703
+ const {
1704
+ backgroundColor: bgColorFromOptions,
1434
1705
  seriesColors: seriesColorsStr,
1435
1706
  fieldColors,
1707
+ legendLabels: legendLabelsStr,
1708
+ legendMode,
1709
+ legendTruncation,
1436
1710
  "axisTitleX.text": xAxisTitleText,
1437
1711
  "axisTitleY.text": yAxisTitleText,
1438
1712
  "axisTitleY2.text": y2AxisTitleText,
@@ -1440,8 +1714,12 @@ var TimeSeriesChartWrapper = (props) => {
1440
1714
  "axisTitleY.visibility": yAxisTitleVisibility,
1441
1715
  "axisTitleY2.visibility": y2AxisTitleVisibility,
1442
1716
  "axisLabelsX.majorLabelVisibility": xAxisLabelVisibility,
1717
+ "axisLabelsX.majorLabelStyle.rotation": xAxisLabelRotation,
1718
+ "axisLabelsX.maxLabelParts": xAxisMaxLabelParts,
1443
1719
  "axisLabelsY.majorLabelVisibility": yAxisLabelVisibility,
1720
+ "axisLabelsY.majorUnit": yAxisMajorUnitFromSimpleXML,
1444
1721
  "axisLabelsY2.majorLabelVisibility": y2AxisLabelVisibility,
1722
+ "axisLabelsY2.majorUnit": y2AxisMajorUnitFromSimpleXML,
1445
1723
  "axisY.abbreviation": yAxisAbbreviation,
1446
1724
  "axisY.scale": yAxisScale,
1447
1725
  "axisY2.abbreviation": y2AxisAbbreviation,
@@ -1451,10 +1729,73 @@ var TimeSeriesChartWrapper = (props) => {
1451
1729
  "axisLabelsY2.integerUnits": y2IntegerUnits,
1452
1730
  "chart.overlayFields": overlayFieldsStr,
1453
1731
  "chart.nullValueMode": nullValueMode,
1454
- lineWidth
1732
+ "chart.showDataLabels": showDataLabels,
1733
+ lineWidth,
1734
+ lineDashStyle,
1735
+ fieldDashStyles: lineDashStylesByFieldStr,
1736
+ stepPosition,
1737
+ fieldStepPositions: stepPositionsByFieldStr,
1738
+ yAxisMin: yAxisMinRaw,
1739
+ yAxisMax: yAxisMaxRaw,
1740
+ y2AxisMin: y2AxisMinRaw,
1741
+ y2AxisMax: y2AxisMaxRaw,
1742
+ showXMajorGridLines,
1743
+ showYMajorGridLines,
1744
+ showY2MajorGridLines,
1745
+ showYMinorGridLines,
1746
+ showY2MinorGridLines,
1747
+ showLineSmoothing,
1748
+ xAxisMajorTickVisibility,
1749
+ xAxisMajorTickSize,
1750
+ yAxisMajorTickVisibility,
1751
+ y2AxisMajorTickVisibility,
1752
+ yAxisMajorTickSize,
1753
+ y2AxisMajorTickSize,
1754
+ yAxisMajorTickInterval,
1755
+ y2AxisMajorTickInterval,
1756
+ yAxisMinorTickVisibility,
1757
+ y2AxisMinorTickVisibility,
1758
+ yAxisMinorTickSize,
1759
+ y2AxisMinorTickSize,
1760
+ showYAxisWithZero: showYAxisWithZeroFromOptions,
1761
+ showY2AxisWithZero: showY2AxisWithZeroFromOptions
1455
1762
  } = options;
1763
+ const dataValuesDisplay = showDataLabels === "none" ? "off" : showDataLabels;
1764
+ const showYAxisWithZero = showYAxisWithZeroFromProps != null ? showYAxisWithZeroFromProps : showYAxisWithZeroFromOptions;
1765
+ const showY2AxisWithZero = showY2AxisWithZeroFromProps != null ? showY2AxisWithZeroFromProps : showY2AxisWithZeroFromOptions;
1766
+ const showXMajorTicks = xAxisMajorTickVisibility !== "hide";
1767
+ const showYMajorTicks = yAxisMajorTickVisibility === "show";
1768
+ const showY2MajorTicks = y2AxisMajorTickVisibility === "show";
1769
+ const showYMinorTicks = yAxisMinorTickVisibility === "show";
1770
+ const showY2MinorTicks = y2AxisMinorTickVisibility === "show";
1771
+ const showXAxisLine = parseXAxisLineVisibility(xAxisLineVisibility);
1772
+ const showYAxisLine = yAxisLineVisibility === "show";
1773
+ const showY2AxisLine = y2AxisLineVisibility === "show";
1774
+ const yAxisMin = parseAxisValue(yAxisMinRaw);
1775
+ const yAxisMax = parseAxisValue(yAxisMaxRaw);
1776
+ const y2AxisMin = parseAxisValue(y2AxisMinRaw);
1777
+ const y2AxisMax = parseAxisValue(y2AxisMaxRaw);
1778
+ const parseTickInterval = (simpleXMLValue, canvasValue) => {
1779
+ if (simpleXMLValue) return Number(simpleXMLValue);
1780
+ if (canvasValue) return Number(canvasValue);
1781
+ return void 0;
1782
+ };
1783
+ const yAxisMajorTickIntervalNum = parseTickInterval(yAxisMajorUnitFromSimpleXML, yAxisMajorTickInterval);
1784
+ const y2AxisMajorTickIntervalNum = parseTickInterval(
1785
+ y2AxisMajorUnitFromSimpleXML,
1786
+ y2AxisMajorTickInterval
1787
+ );
1788
+ const xAxisMajorTickSizeNum = xAxisMajorTickSize != null ? Number(xAxisMajorTickSize) : void 0;
1789
+ const yAxisMajorTickSizeNum = yAxisMajorTickSize != null ? Number(yAxisMajorTickSize) : void 0;
1790
+ const y2AxisMajorTickSizeNum = y2AxisMajorTickSize != null ? Number(y2AxisMajorTickSize) : void 0;
1791
+ const yAxisMinorTickSizeNum = yAxisMinorTickSize != null ? Number(yAxisMinorTickSize) : void 0;
1792
+ const y2AxisMinorTickSizeNum = y2AxisMinorTickSize != null ? Number(y2AxisMinorTickSize) : void 0;
1456
1793
  const seriesColors = seriesColorsStr ? JSON.parse(seriesColorsStr) : void 0;
1457
1794
  const seriesColorsByField = fieldColors ? JSON.parse(fieldColors) : void 0;
1795
+ const lineDashStylesByField = lineDashStylesByFieldStr ? JSON.parse(lineDashStylesByFieldStr) : void 0;
1796
+ const stepPositionsByField = stepPositionsByFieldStr ? JSON.parse(stepPositionsByFieldStr) : void 0;
1797
+ const legendLabels = parseArrayOption(legendLabelsStr);
1798
+ const bgColor = backgroundColor || bgColorFromOptions;
1458
1799
  const [containerWidth, setContainerWidth] = react_exports.useState(Number(props.width));
1459
1800
  const [containerHeight, setContainerHeight] = react_exports.useState(Number(props.height));
1460
1801
  const cachedHandleResize = react_exports.useCallback((w, h) => {
@@ -1465,31 +1806,64 @@ var TimeSeriesChartWrapper = (props) => {
1465
1806
  fields: chartData.fields,
1466
1807
  columns: chartData.seriesList
1467
1808
  });
1468
- const xField = getFieldName(filteredChartData.fields[0]);
1809
+ const xField = getFieldName2(filteredChartData.fields[0]);
1469
1810
  const yFields = getFieldNames(
1470
1811
  filteredChartData.fields.length > 1 ? filteredChartData.fields.slice(1) : []
1471
1812
  );
1472
- const y2Fields = y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [];
1473
- const overlayFields = overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [];
1813
+ const y2Fields = (0, react_exports.useMemo)(
1814
+ () => y2FieldsStr ? y2FieldsStr.split(",").map((f) => f.trim()) : [],
1815
+ [y2FieldsStr]
1816
+ );
1817
+ const overlayFields = (0, react_exports.useMemo)(
1818
+ () => overlayFieldsStr ? overlayFieldsStr.split(",").map((f) => f.trim()) : [],
1819
+ [overlayFieldsStr]
1820
+ );
1474
1821
  let xAxisTitle = getComputedAxisTitles(xAxisTitleText, [xField], xAxisTitleVisibility);
1475
1822
  xAxisTitle = ellipsisAxisTitle(xAxisTitle, containerWidth);
1476
- let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFields, yAxisTitleVisibility);
1823
+ const yFieldsForTitle = y2Enabled ? yFields.filter((field) => !y2Fields.includes(field)) : yFields;
1824
+ let yAxisTitle = getComputedAxisTitles(yAxisTitleText, yFieldsForTitle, yAxisTitleVisibility);
1477
1825
  yAxisTitle = ellipsisAxisTitle(yAxisTitle, containerHeight);
1478
1826
  const fieldsForY2Axis = y2Fields.length > 0 ? y2Fields : overlayFields;
1479
1827
  let y2AxisTitle = getComputedAxisTitles(y2AxisTitleText, fieldsForY2Axis, y2AxisTitleVisibility);
1480
1828
  y2AxisTitle = ellipsisAxisTitle(y2AxisTitle, containerHeight);
1481
- const xScaleConfig = getXScaleConfig(xAxisTitle, xAxisLabelVisibility);
1482
- const yScaleConfig = getYScaleConfig(yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility);
1483
- let y2ScaleConfig = {};
1484
- if (y2Enabled) {
1485
- y2ScaleConfig = getY2ScaleConfig(
1486
- y2AxisTitle,
1487
- y2AxisAbbreviation,
1488
- y2AxisScale,
1489
- y2IntegerUnits,
1490
- y2AxisLabelVisibility
1491
- );
1492
- }
1829
+ const xScaleConfig = (0, react_exports.useMemo)(
1830
+ () => getXScaleConfig(xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation),
1831
+ [xAxisTitle, xAxisLabelVisibility, xAxisLabelRotation]
1832
+ );
1833
+ const yScaleConfig = (0, react_exports.useMemo)(
1834
+ () => getYScaleConfig(
1835
+ yAxisTitle,
1836
+ yAxisAbbreviation,
1837
+ yAxisScale,
1838
+ yAxisLabelVisibility,
1839
+ yAxisMin,
1840
+ yAxisMax
1841
+ ),
1842
+ [yAxisTitle, yAxisAbbreviation, yAxisScale, yAxisLabelVisibility, yAxisMin, yAxisMax]
1843
+ );
1844
+ const y2ScaleConfig = (0, react_exports.useMemo)(() => {
1845
+ if (y2Enabled) {
1846
+ return getY2ScaleConfig(
1847
+ y2AxisTitle,
1848
+ y2AxisAbbreviation,
1849
+ y2AxisScale,
1850
+ y2IntegerUnits,
1851
+ y2AxisLabelVisibility,
1852
+ y2AxisMin,
1853
+ y2AxisMax
1854
+ );
1855
+ }
1856
+ return {};
1857
+ }, [
1858
+ y2Enabled,
1859
+ y2AxisTitle,
1860
+ y2AxisAbbreviation,
1861
+ y2AxisScale,
1862
+ y2IntegerUnits,
1863
+ y2AxisLabelVisibility,
1864
+ y2AxisMin,
1865
+ y2AxisMax
1866
+ ]);
1493
1867
  const uplotContainerElement = (0, react_exports.useRef)(null);
1494
1868
  const seriesDataFormatted = [
1495
1869
  filteredChartData.columns[0],
@@ -1505,9 +1879,25 @@ var TimeSeriesChartWrapper = (props) => {
1505
1879
  overlayFields,
1506
1880
  y2Enabled,
1507
1881
  nullValueMode,
1508
- markerDisplay
1882
+ markerDisplay,
1883
+ lineDashStyle,
1884
+ lineDashStylesByField,
1885
+ stepPosition,
1886
+ stepPositionsByField
1509
1887
  ),
1510
- [yFields, y2Fields, lineWidth, overlayFields, y2Enabled, nullValueMode, markerDisplay]
1888
+ [
1889
+ yFields,
1890
+ y2Fields,
1891
+ lineWidth,
1892
+ overlayFields,
1893
+ y2Enabled,
1894
+ nullValueMode,
1895
+ markerDisplay,
1896
+ lineDashStyle,
1897
+ lineDashStylesByField,
1898
+ stepPosition,
1899
+ stepPositionsByField
1900
+ ]
1511
1901
  );
1512
1902
  const chartingEventAnnotations = (0, react_exports.useMemo)(
1513
1903
  () => getAnnotationsForCanvas({
@@ -1521,25 +1911,59 @@ var TimeSeriesChartWrapper = (props) => {
1521
1911
  () => __spreadValues(__spreadValues(__spreadValues({}, xScaleConfig), yScaleConfig), y2ScaleConfig),
1522
1912
  [xScaleConfig, yScaleConfig, y2ScaleConfig]
1523
1913
  );
1524
- const legend = (0, react_exports.useMemo)(() => getLegend({ legendDisplay }), [legendDisplay]);
1914
+ const isSeriesCompare = legendMode === "seriesCompare";
1915
+ const legend = (0, react_exports.useMemo)(
1916
+ () => getLegend({
1917
+ legendDisplay: isSeriesCompare && legendDisplay !== "off" ? "right" : legendDisplay,
1918
+ isSeriesCompare,
1919
+ legendTruncation
1920
+ }),
1921
+ [legendDisplay, isSeriesCompare, legendTruncation]
1922
+ );
1525
1923
  const handleChartClick = react_exports.useCallback(
1526
1924
  (event) => {
1527
1925
  if (onClick) {
1528
- handleClick(event, onClick);
1926
+ handleClick(event, onClick, trellisKey, trellisSplitBy);
1529
1927
  }
1530
1928
  },
1531
- [onClick]
1929
+ [onClick, trellisKey, trellisSplitBy]
1532
1930
  );
1533
1931
  const handleChartLegendClick = react_exports.useCallback(
1534
1932
  (event) => {
1535
1933
  if (onClick) {
1536
- handleLegendClick(event, onClick);
1934
+ handleLegendClick(event, onClick, trellisKey, trellisSplitBy);
1537
1935
  }
1538
1936
  },
1539
- [onClick]
1937
+ [onClick, trellisKey, trellisSplitBy]
1938
+ );
1939
+ const handleChartRangeSelection = react_exports.useCallback(
1940
+ (range2) => {
1941
+ if (onSelect) {
1942
+ handleRangeSelection(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1943
+ }
1944
+ },
1945
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1946
+ );
1947
+ const handleChartRangeZoom = react_exports.useCallback(
1948
+ (range2) => {
1949
+ if (onSelect) {
1950
+ handleRangeZoom(range2, onSelect, chartData, trellisKey, trellisSplitBy);
1951
+ }
1952
+ },
1953
+ [onSelect, chartData, trellisKey, trellisSplitBy]
1954
+ );
1955
+ const xFieldToUse = xFieldFromProps || xField;
1956
+ const enableSearchZoom = react_exports.useMemo(
1957
+ () => shouldEnableSearchZoom(eventHandlers, xFieldToUse),
1958
+ [eventHandlers, xFieldToUse]
1540
1959
  );
1541
1960
  const lastPayloadRef = react_exports.useRef(null);
1542
1961
  const lastOriginalEventRef = react_exports.useRef(null);
1962
+ const previousMouseoverPayloadRef = react_exports.useRef(null);
1963
+ const additionalTooltipValuesRef = react_exports.useRef(additionalTooltipValues);
1964
+ react_exports.useEffect(() => {
1965
+ additionalTooltipValuesRef.current = additionalTooltipValues;
1966
+ }, [additionalTooltipValues]);
1543
1967
  const handleChartCrosshairChange = react_exports.useCallback(
1544
1968
  (event) => {
1545
1969
  if (onPointMouseOver || onPointMouseOut) {
@@ -1551,6 +1975,7 @@ var TimeSeriesChartWrapper = (props) => {
1551
1975
  payload: lastPayloadRef.current
1552
1976
  });
1553
1977
  }
1978
+ previousMouseoverPayloadRef.current = null;
1554
1979
  return;
1555
1980
  }
1556
1981
  const payload = __spreadProps(__spreadValues({}, (0, lodash_exports.pick)(event, "value", "seriesKey", "time", "index", "seriesIndex")), {
@@ -1558,25 +1983,36 @@ var TimeSeriesChartWrapper = (props) => {
1558
1983
  });
1559
1984
  delete payload.seriesKey;
1560
1985
  if (event.rowContext) {
1561
- Object.keys(event.rowContext).forEach((fieldName) => {
1562
- payload[`row.${fieldName}.value`] = event.rowContext[fieldName];
1563
- });
1986
+ Object.assign(
1987
+ payload,
1988
+ Object.keys(event.rowContext).reduce((acc, fieldName) => {
1989
+ acc[`row.${fieldName}.value`] = event.rowContext[fieldName];
1990
+ return acc;
1991
+ }, {})
1992
+ );
1564
1993
  }
1565
- lastPayloadRef.current = payload;
1994
+ const updatedPayload = appendTrellisToPayload(payload, trellisKey, trellisSplitBy);
1995
+ if (!hasMouseoverPayloadChanged(updatedPayload, previousMouseoverPayloadRef.current)) {
1996
+ return;
1997
+ }
1998
+ lastPayloadRef.current = updatedPayload;
1566
1999
  lastOriginalEventRef.current = event;
2000
+ previousMouseoverPayloadRef.current = __spreadValues({}, updatedPayload);
1567
2001
  if (onPointMouseOver) {
1568
2002
  onPointMouseOver({
1569
2003
  type: "point.mouseover",
1570
2004
  originalEvent: event,
1571
- payload
2005
+ payload: updatedPayload
1572
2006
  });
1573
2007
  }
1574
2008
  }
1575
2009
  },
1576
- [onPointMouseOver, onPointMouseOut]
2010
+ [onPointMouseOver, onPointMouseOut, trellisKey, trellisSplitBy]
1577
2011
  );
1578
- const memoizedChart = (0, react_exports.useMemo)(
1579
- () => /* @__PURE__ */ react_exports.createElement(
2012
+ 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}`;
2013
+ const memoizedChart = (0, react_exports.useMemo)(() => {
2014
+ const computedOnRangeZoom = onSelect ? handleChartRangeZoom : void 0;
2015
+ return /* @__PURE__ */ react_exports.createElement(visualization_canvas_exports.RangeSelectionProvider, { key: dataKey }, /* @__PURE__ */ react_exports.createElement(
1580
2016
  visualization_canvas_exports.TimeSeriesChart,
1581
2017
  {
1582
2018
  data: chartData,
@@ -1586,49 +2022,121 @@ var TimeSeriesChartWrapper = (props) => {
1586
2022
  seriesColorsByField,
1587
2023
  seriesConfig: seriesOverrides,
1588
2024
  legend,
2025
+ legendLabels,
2026
+ legendTruncation,
2027
+ isSeriesCompare: legendMode === "seriesCompare",
2028
+ maxSeriesFocus: legendMode === "seriesCompare" ? 0 : void 0,
1589
2029
  scaleConfig,
1590
2030
  timestampFormat: "expanded",
1591
2031
  onCrosshairClick: onClick ? handleChartClick : void 0,
1592
2032
  onCrosshairChange: onPointMouseOver || onPointMouseOut ? handleChartCrosshairChange : void 0,
1593
2033
  onSeriesClick: onClick ? handleChartLegendClick : void 0,
2034
+ onRangeSelection: handleChartRangeSelection,
2035
+ onRangeZoom: computedOnRangeZoom,
2036
+ serverSideZoom: enableSearchZoom,
1594
2037
  userLocale,
1595
2038
  events: chartingEventAnnotations,
1596
- eventsConfig: { renderer: triangleEventAnnotationRenderer }
2039
+ eventsConfig: { renderer: triangleEventAnnotationRenderer },
2040
+ additionalTooltipValuesRef,
2041
+ showXMajorGridLines,
2042
+ showYMajorGridLines,
2043
+ showY2MajorGridLines,
2044
+ showYMinorGridLines,
2045
+ showY2MinorGridLines,
2046
+ showLineSmoothing,
2047
+ dataValuesDisplay,
2048
+ showXMajorTicks,
2049
+ xAxisMajorTickSize: xAxisMajorTickSizeNum,
2050
+ showYMajorTicks,
2051
+ showY2MajorTicks,
2052
+ yAxisMajorTickSize: yAxisMajorTickSizeNum,
2053
+ y2AxisMajorTickSize: y2AxisMajorTickSizeNum,
2054
+ yAxisMajorTickInterval: yAxisMajorTickIntervalNum,
2055
+ y2AxisMajorTickInterval: y2AxisMajorTickIntervalNum,
2056
+ showYMinorTicks,
2057
+ showY2MinorTicks,
2058
+ yAxisMinorTickSize: yAxisMinorTickSizeNum,
2059
+ y2AxisMinorTickSize: y2AxisMinorTickSizeNum,
2060
+ showYAxisWithZero,
2061
+ showY2AxisWithZero,
2062
+ showXAxisLine,
2063
+ showYAxisLine,
2064
+ showY2AxisLine,
2065
+ xAxisMaxLabelParts
1597
2066
  }
1598
- ),
1599
- [
1600
- chartData,
1601
- containerWidth,
1602
- containerHeight,
1603
- seriesColors,
1604
- seriesColorsByField,
1605
- seriesOverrides,
1606
- legend,
1607
- scaleConfig,
1608
- userLocale,
1609
- chartingEventAnnotations,
1610
- onClick,
1611
- handleChartClick,
1612
- onPointMouseOver,
1613
- onPointMouseOut,
1614
- handleChartCrosshairChange,
1615
- handleChartLegendClick
1616
- ]
1617
- );
2067
+ ));
2068
+ }, [
2069
+ onSelect,
2070
+ handleChartRangeZoom,
2071
+ dataKey,
2072
+ chartData,
2073
+ containerWidth,
2074
+ containerHeight,
2075
+ seriesColors,
2076
+ seriesColorsByField,
2077
+ seriesOverrides,
2078
+ legend,
2079
+ legendLabels,
2080
+ legendTruncation,
2081
+ scaleConfig,
2082
+ onClick,
2083
+ handleChartClick,
2084
+ onPointMouseOver,
2085
+ onPointMouseOut,
2086
+ handleChartCrosshairChange,
2087
+ handleChartLegendClick,
2088
+ handleChartRangeSelection,
2089
+ enableSearchZoom,
2090
+ userLocale,
2091
+ chartingEventAnnotations,
2092
+ showXMajorGridLines,
2093
+ showYMajorGridLines,
2094
+ showY2MajorGridLines,
2095
+ showYMinorGridLines,
2096
+ showY2MinorGridLines,
2097
+ showLineSmoothing,
2098
+ dataValuesDisplay,
2099
+ showXMajorTicks,
2100
+ xAxisMajorTickSizeNum,
2101
+ showYMajorTicks,
2102
+ showY2MajorTicks,
2103
+ yAxisMajorTickSizeNum,
2104
+ y2AxisMajorTickSizeNum,
2105
+ yAxisMajorTickIntervalNum,
2106
+ y2AxisMajorTickIntervalNum,
2107
+ showYMinorTicks,
2108
+ showY2MinorTicks,
2109
+ yAxisMinorTickSizeNum,
2110
+ y2AxisMinorTickSizeNum,
2111
+ showYAxisWithZero,
2112
+ showY2AxisWithZero,
2113
+ showXAxisLine,
2114
+ showYAxisLine,
2115
+ showY2AxisLine,
2116
+ legendMode,
2117
+ xAxisMaxLabelParts
2118
+ ]);
1618
2119
  const memoizedVisualization = (0, react_exports.useMemo)(() => {
1619
- return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor }, memoizedChart);
1620
- }, [backgroundColor, memoizedChart]);
1621
- return /* @__PURE__ */ react_exports.createElement(
2120
+ return /* @__PURE__ */ react_exports.createElement(VizStyleWrapper_default, { backgroundColor: bgColor }, memoizedChart);
2121
+ }, [bgColor, memoizedChart]);
2122
+ return /* @__PURE__ */ react_exports.createElement(react_exports.Fragment, null, trellisEnabled && /* @__PURE__ */ react_exports.createElement(
2123
+ TrellisTitle,
2124
+ {
2125
+ trellisKey,
2126
+ backgroundColor: bgColor,
2127
+ fontColor: defaultFontColor
2128
+ }
2129
+ ), /* @__PURE__ */ react_exports.createElement(
1622
2130
  TimeSeriesChartContainer,
1623
2131
  {
1624
- height,
2132
+ height: trellisEnabled ? Number(height) - TRELLIS_TITLE_HEIGHT : height,
1625
2133
  width,
1626
2134
  ref: uplotContainerElement,
1627
2135
  "data-test": "timeseries-chart-wrapper"
1628
2136
  },
1629
2137
  /* @__PURE__ */ react_exports.createElement(SizeAwareWrapper_default, { width, height, onResize: cachedHandleResize }),
1630
2138
  memoizedVisualization
1631
- );
2139
+ ));
1632
2140
  };
1633
2141
  var TimeSeriesChartWrapper_default = TimeSeriesChartWrapper;
1634
2142
 
@@ -1918,23 +2426,23 @@ var withDashboardViz = (opts) => {
1918
2426
  };
1919
2427
  var withDashboardViz_default = withDashboardViz;
1920
2428
 
1921
- // esm-externals:@splunk/visualization-schemas
1922
- var visualization_schemas_exports = {};
1923
- __export(visualization_schemas_exports, {
1924
- default: () => visualization_schemas_default
2429
+ // esm-externals:@splunk/react-icons/Markdown
2430
+ var Markdown_exports2 = {};
2431
+ __export(Markdown_exports2, {
2432
+ default: () => Markdown_default2
1925
2433
  });
1926
- var defaultImport34 = __toESM(require("@splunk/visualization-schemas"));
1927
- __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
1928
- var visualization_schemas_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
2434
+ var defaultImport35 = __toESM(require("@splunk/react-icons/Markdown"));
2435
+ __reExport(Markdown_exports2, require("@splunk/react-icons/Markdown"));
2436
+ var Markdown_default2 = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
1929
2437
 
1930
2438
  // esm-externals:@splunk/visualizations-shared/configUtils
1931
2439
  var configUtils_exports = {};
1932
2440
  __export(configUtils_exports, {
1933
2441
  default: () => configUtils_default
1934
2442
  });
1935
- var defaultImport35 = __toESM(require("@splunk/visualizations-shared/configUtils"));
2443
+ var defaultImport36 = __toESM(require("@splunk/visualizations-shared/configUtils"));
1936
2444
  __reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
1937
- var configUtils_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
2445
+ var configUtils_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
1938
2446
 
1939
2447
  // src/common/utils/configUtils.ts
1940
2448
  function enhanceConfig(vizConfig) {
@@ -2093,7 +2601,7 @@ var config = {
2093
2601
  /**
2094
2602
  * viz icon
2095
2603
  */
2096
- icon: null,
2604
+ icon: Markdown_default2,
2097
2605
  dataContract,
2098
2606
  size,
2099
2607
  defaultContext,
@@ -2313,7 +2821,6 @@ var MarkdownVisualization = ({
2313
2821
  hasEventHandlers = false,
2314
2822
  onMarkdownClick = lodash_exports.noop
2315
2823
  }) => {
2316
- var _a;
2317
2824
  const { fontFamily: defaultFontFamily } = (0, themes_exports.useSplunkTheme)();
2318
2825
  const markdownContentFontFamilyStyle = {
2319
2826
  fontFamily: `${fontFamily}, ${defaultFontFamily}`
@@ -2324,6 +2831,9 @@ var MarkdownVisualization = ({
2324
2831
  fontSize,
2325
2832
  customFontSize
2326
2833
  );
2834
+ const trimmedMarkdown = stringifiedMarkdown.trim();
2835
+ const headerMatch = /^#+/.exec(trimmedMarkdown);
2836
+ const headerLength = headerMatch ? headerMatch[0].length : void 0;
2327
2837
  return /* @__PURE__ */ react_exports.createElement(
2328
2838
  MarkdownContainer,
2329
2839
  {
@@ -2334,7 +2844,7 @@ var MarkdownVisualization = ({
2334
2844
  rotation,
2335
2845
  backgroundColor,
2336
2846
  fontColor,
2337
- startsWithHeader: (_a = stringifiedMarkdown.trim().match(/^#+/)) == null ? void 0 : _a[0].length
2847
+ startsWithHeader: headerLength
2338
2848
  },
2339
2849
  hasEventHandlers && /* @__PURE__ */ react_exports.createElement(StyledButton, { onClick: onMarkdownClick, appearance: "secondary" }, "Drilldown"),
2340
2850
  /* @__PURE__ */ react_exports.createElement(
@@ -2365,5 +2875,5 @@ var Markdown = withDashboardViz_default({
2365
2875
  computeVizProps
2366
2876
  });
2367
2877
  var { themes: themes2 } = config_default;
2368
- var Markdown_default2 = Markdown;
2878
+ var Markdown_default3 = Markdown;
2369
2879
  //# sourceMappingURL=Markdown.js.map