@splunk/visualizations 27.5.0 → 28.1.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 (167) hide show
  1. package/Area.config.js +19 -21
  2. package/Area.config.js.map +3 -3
  3. package/Area.js +55 -33
  4. package/Area.js.map +3 -3
  5. package/Bar.config.js +18 -21
  6. package/Bar.config.js.map +3 -3
  7. package/Bar.js +49 -32
  8. package/Bar.js.map +3 -3
  9. package/Bubble.config.js +39 -44
  10. package/Bubble.config.js.map +4 -4
  11. package/Bubble.js +70 -52
  12. package/Bubble.js.map +4 -4
  13. package/CHANGELOG.external.md +63 -7
  14. package/ChoroplethSvg.config.js +47 -43
  15. package/ChoroplethSvg.config.js.map +4 -4
  16. package/ChoroplethSvg.js +85 -54
  17. package/ChoroplethSvg.js.map +4 -4
  18. package/Column.config.js +15 -20
  19. package/Column.config.js.map +3 -3
  20. package/Column.js +43 -30
  21. package/Column.js.map +3 -3
  22. package/Ellipse.config.js +16 -7
  23. package/Ellipse.config.js.map +2 -2
  24. package/Ellipse.js +46 -20
  25. package/Ellipse.js.map +2 -2
  26. package/Events.config.js +38 -27
  27. package/Events.config.js.map +4 -4
  28. package/Events.js +114 -98
  29. package/Events.js.map +4 -4
  30. package/FEATUREFLAGS.md +9 -9
  31. package/FillerGauge.config.js +144 -16
  32. package/FillerGauge.config.js.map +3 -3
  33. package/FillerGauge.js +891 -101
  34. package/FillerGauge.js.map +4 -4
  35. package/Image.config.js +5 -6
  36. package/Image.config.js.map +2 -2
  37. package/Image.js +30 -15
  38. package/Image.js.map +2 -2
  39. package/Line.config.js +15 -20
  40. package/Line.config.js.map +3 -3
  41. package/Line.js +51 -32
  42. package/Line.js.map +3 -3
  43. package/LinkGraph.config.js +39 -46
  44. package/LinkGraph.config.js.map +3 -3
  45. package/LinkGraph.js +72 -52
  46. package/LinkGraph.js.map +3 -3
  47. package/MIGRATION.md +169 -40
  48. package/Map.config.js +83 -16
  49. package/Map.config.js.map +4 -4
  50. package/Map.js +218 -109
  51. package/Map.js.map +4 -4
  52. package/Markdown.config.js +4 -5
  53. package/Markdown.config.js.map +2 -2
  54. package/Markdown.js +122 -74
  55. package/Markdown.js.map +3 -3
  56. package/MarkerGauge.config.js +14 -12
  57. package/MarkerGauge.config.js.map +3 -3
  58. package/MarkerGauge.js +108 -70
  59. package/MarkerGauge.js.map +4 -4
  60. package/ParallelCoordinates.config.js +14 -12
  61. package/ParallelCoordinates.config.js.map +3 -3
  62. package/ParallelCoordinates.js +114 -60
  63. package/ParallelCoordinates.js.map +3 -3
  64. package/Pie.config.js +51 -38
  65. package/Pie.config.js.map +4 -4
  66. package/Pie.js +110 -86
  67. package/Pie.js.map +4 -4
  68. package/Punchcard.config.js +36 -34
  69. package/Punchcard.config.js.map +4 -4
  70. package/Punchcard.js +154 -88
  71. package/Punchcard.js.map +4 -4
  72. package/README.internal.md +15 -15
  73. package/README.md +10 -10
  74. package/Rectangle.config.js +16 -7
  75. package/Rectangle.config.js.map +2 -2
  76. package/Rectangle.js +46 -20
  77. package/Rectangle.js.map +2 -2
  78. package/Sankey.config.js +69 -17
  79. package/Sankey.config.js.map +4 -4
  80. package/Sankey.js +179 -50
  81. package/Sankey.js.map +4 -4
  82. package/Scatter.config.js +37 -42
  83. package/Scatter.config.js.map +3 -3
  84. package/Scatter.js +71 -54
  85. package/Scatter.js.map +3 -3
  86. package/SingleValue.config.js +32 -18
  87. package/SingleValue.config.js.map +4 -4
  88. package/SingleValue.js +240 -94
  89. package/SingleValue.js.map +4 -4
  90. package/SingleValueBasic.js +1 -0
  91. package/SingleValueBasic.js.map +2 -2
  92. package/SingleValueIcon.config.js +22 -11
  93. package/SingleValueIcon.config.js.map +2 -2
  94. package/SingleValueIcon.js +85 -29
  95. package/SingleValueIcon.js.map +2 -2
  96. package/SingleValueRadial.config.js +34 -23
  97. package/SingleValueRadial.config.js.map +3 -3
  98. package/SingleValueRadial.js +90 -49
  99. package/SingleValueRadial.js.map +4 -4
  100. package/SparkLine.js +153 -49
  101. package/SparkLine.js.map +2 -2
  102. package/TRELLIS.md +2 -2
  103. package/Table.config.js +93 -52
  104. package/Table.config.js.map +3 -3
  105. package/Table.js +513 -202
  106. package/Table.js.map +4 -4
  107. package/Timeline.config.js +36 -34
  108. package/Timeline.config.js.map +4 -4
  109. package/Timeline.js +131 -83
  110. package/Timeline.js.map +4 -4
  111. package/common/Charting.js +1 -0
  112. package/common/Charting.js.map +2 -2
  113. package/common/ChartingApi.js +1 -0
  114. package/common/ChartingApi.js.map +1 -1
  115. package/common/DocExampleWithVizSandbox.js +7 -2
  116. package/common/DocExampleWithVizSandbox.js.map +2 -2
  117. package/common/EventsDoc.js +31 -5
  118. package/common/EventsDoc.js.map +4 -4
  119. package/common/GaugeMajorTicks.js +4 -1
  120. package/common/GaugeMajorTicks.js.map +2 -2
  121. package/common/GaugeValueMarker.js +31 -3
  122. package/common/GaugeValueMarker.js.map +4 -4
  123. package/common/OptionsDoc.js +4 -1
  124. package/common/OptionsDoc.js.map +2 -2
  125. package/common/OverviewDoc.js +66 -50
  126. package/common/OverviewDoc.js.map +4 -4
  127. package/common/SplunkVisualization.js +1 -0
  128. package/common/SplunkVisualization.js.map +1 -1
  129. package/common/SplunkVisualizationApi.js +1 -0
  130. package/common/SplunkVisualizationApi.js.map +1 -1
  131. package/common/ThemedDefaults.js +67 -0
  132. package/common/ThemedDefaults.js.map +7 -0
  133. package/common/ThemesDoc.js +6 -9
  134. package/common/ThemesDoc.js.map +2 -2
  135. package/common/chartingUtils.js +1 -0
  136. package/common/chartingUtils.js.map +2 -2
  137. package/common/docUtils.js +6 -1
  138. package/common/docUtils.js.map +2 -2
  139. package/common/gaugeUtils.js +6 -1
  140. package/common/gaugeUtils.js.map +2 -2
  141. package/common/shapeUtils.js +6 -4
  142. package/common/shapeUtils.js.map +2 -2
  143. package/common/utils/configUtils.js +4 -5
  144. package/common/utils/configUtils.js.map +2 -2
  145. package/common/utils/dataUtils.js +1 -0
  146. package/common/utils/dataUtils.js.map +2 -2
  147. package/common/utils/featureFlagUtils.js +1 -0
  148. package/common/utils/featureFlagUtils.js.map +1 -1
  149. package/common/utils/hocUtils.js +1 -0
  150. package/common/utils/hocUtils.js.map +1 -1
  151. package/common/utils/mapUtils.js +35 -22
  152. package/common/utils/mapUtils.js.map +4 -4
  153. package/common/utils/singleValueUtils.js +8 -2
  154. package/common/utils/singleValueUtils.js.map +2 -2
  155. package/common/utils/styleUtils.js +1 -0
  156. package/common/utils/styleUtils.js.map +1 -1
  157. package/common/utils/tableUtils.js +59 -0
  158. package/common/utils/tableUtils.js.map +7 -0
  159. package/common/utils/testHelper.js +1 -0
  160. package/common/utils/testHelper.js.map +1 -1
  161. package/common/utils/trellisUtils.js +1 -0
  162. package/common/utils/trellisUtils.js.map +1 -1
  163. package/common/utils/urlUtils.js +1 -0
  164. package/common/utils/urlUtils.js.map +1 -1
  165. package/common/withDashboardViz.js +26 -9
  166. package/common/withDashboardViz.js.map +2 -2
  167. package/package.json +41 -39
package/SingleValue.js CHANGED
@@ -1,6 +1,7 @@
1
1
  /* Copyright © 2020 Splunk Inc.
2
2
  SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
3
3
  in part without a valid written license from Splunk Inc. is PROHIBITED. */
4
+ "use strict";
4
5
  var __create = Object.create;
5
6
  var __defProp = Object.defineProperty;
6
7
  var __defProps = Object.defineProperties;
@@ -299,8 +300,8 @@ var getTrendColor = ({
299
300
  if (Number.isNaN(Number(trendValue))) {
300
301
  return void 0;
301
302
  }
302
- const { defaultFontColor, defaultBlockFontColor, defaultBackgroundColor } = defaultColors;
303
- if (hasBackground(customizedBgColor) && !isIdenticalColor(customizedBgColor, defaultBackgroundColor) && !isIdenticalColor(customizedBgColor, defaultBlockFontColor)) {
303
+ const { defaultFontColor, defaultBlockFontColor, defaultBackgroundColor: defaultBackgroundColor2 } = defaultColors;
304
+ if (hasBackground(customizedBgColor) && !isIdenticalColor(customizedBgColor, defaultBackgroundColor2) && !isIdenticalColor(customizedBgColor, defaultBlockFontColor)) {
304
305
  return defaultBlockFontColor;
305
306
  }
306
307
  const isInvalidTrend = trendDisplay === "percent" && trendValue === parseFloat(majorValue);
@@ -657,11 +658,16 @@ var handleValueClickCallback = (ev, majorValue, majorValueField, trendValue, onV
657
658
  trendValue,
658
659
  value: majorValue,
659
660
  name: majorValueField
660
- }, trellisEnabled && { "trellis.name": trellisSplitBy, "trellis.value": trellisKey })
661
+ }, trellisEnabled && {
662
+ "trellis.name": trellisSplitBy,
663
+ "trellis.value": trellisKey
664
+ })
661
665
  }));
662
666
  var getTrendColorWithPercent = (options) => {
663
667
  const shouldUsePercentTrendColor = options.trendColor === "> trendValue | rangeValue(trendColorEditorConfig)" && options.trendDisplay === "percent";
664
- return shouldUsePercentTrendColor ? { trendColor: "> trendValuePercent | rangeValue(trendColorEditorConfig)" } : {};
668
+ return shouldUsePercentTrendColor ? {
669
+ trendColor: "> trendValuePercent | rangeValue(trendColorEditorConfig)"
670
+ } : {};
665
671
  };
666
672
 
667
673
  // esm-externals:@splunk/react-icons/enterprise/ArrowUp
@@ -962,6 +968,7 @@ var StyledTooltip = styled_components_default.div`
962
968
  padding: 3px 8px;
963
969
  font-size: 12px;
964
970
  `;
971
+ var preventDefault = (e) => e.preventDefault();
965
972
  var _SparkLine = class _SparkLine extends react_exports.Component {
966
973
  constructor(props, ...rest) {
967
974
  super(props, ...rest);
@@ -972,21 +979,99 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
972
979
  });
973
980
  this.state = {
974
981
  anchor: null,
975
- currentPointX: null,
976
- open: false,
977
- rectArea: null,
978
- tooltip: null
982
+ activeIndex: 0,
983
+ hoveredIndex: null,
984
+ componentIsFocused: false
979
985
  };
980
- this.titleId = (0, id_exports.createDOMID)();
986
+ this.titleId = (0, id_exports.createDOMID)("sparkline-title");
987
+ this.pointRefs = [];
988
+ this.containerRef = react_default.createRef();
989
+ this.handleKeyDown = this.handleKeyDown.bind(this);
990
+ this.handleMouseOver = this.handleMouseOver.bind(this);
991
+ this.handleMouseLeave = this.handleMouseLeave.bind(this);
992
+ this.handleFocus = this.handleFocus.bind(this);
993
+ this.handleBlur = this.handleBlur.bind(this);
994
+ }
995
+ handleFocus(event) {
996
+ const { target } = event;
997
+ const { pointIndex: pointIndexStr } = target.dataset || {};
998
+ const { activeIndex, componentIsFocused, hoveredIndex } = this.state;
999
+ if (pointIndexStr !== void 0) {
1000
+ const pointIndex = parseInt(pointIndexStr, 10);
1001
+ if (activeIndex !== pointIndex || !componentIsFocused || hoveredIndex !== null) {
1002
+ this.setState({
1003
+ activeIndex: pointIndex,
1004
+ hoveredIndex: null,
1005
+ componentIsFocused: true
1006
+ });
1007
+ }
1008
+ } else if (this.pointRefs.length > 0) {
1009
+ const indexToFocus = activeIndex ? Math.min(this.pointRefs.length - 1, activeIndex) : 0;
1010
+ this.pointRefs[indexToFocus].focus();
1011
+ }
1012
+ }
1013
+ handleBlur(event) {
1014
+ if (this.containerRef.current && !this.containerRef.current.contains(event.relatedTarget)) {
1015
+ this.setState({ componentIsFocused: false });
1016
+ }
1017
+ }
1018
+ handleKeyDown(event) {
1019
+ const { data } = this.props;
1020
+ const { activeIndex } = this.state;
1021
+ const numPoints = data.length;
1022
+ if (numPoints === 0) {
1023
+ return;
1024
+ }
1025
+ const allowedKeys = ["ArrowLeft", "ArrowRight", "Home", "End"];
1026
+ if (!allowedKeys.includes(event.key)) {
1027
+ return;
1028
+ }
1029
+ let newIndex = activeIndex;
1030
+ switch (event.key) {
1031
+ case "Home":
1032
+ newIndex = 0;
1033
+ break;
1034
+ case "End":
1035
+ newIndex = numPoints - 1;
1036
+ break;
1037
+ case "ArrowLeft":
1038
+ newIndex = Math.max(0, activeIndex - 1);
1039
+ break;
1040
+ case "ArrowRight":
1041
+ newIndex = Math.min(numPoints - 1, activeIndex + 1);
1042
+ break;
1043
+ default:
1044
+ return;
1045
+ }
1046
+ if (newIndex !== activeIndex) {
1047
+ event.preventDefault();
1048
+ if (this.pointRefs[newIndex]) {
1049
+ this.pointRefs[newIndex].focus();
1050
+ }
1051
+ }
1052
+ }
1053
+ handleMouseOver(event) {
1054
+ const pointIndexStr = event.target.dataset && event.target.dataset.pointIndex;
1055
+ if (pointIndexStr !== void 0) {
1056
+ const pointIndex = parseInt(pointIndexStr, 10);
1057
+ if (this.state.hoveredIndex !== pointIndex) {
1058
+ this.setState({ hoveredIndex: pointIndex });
1059
+ }
1060
+ }
1061
+ }
1062
+ handleMouseLeave() {
1063
+ if (this.state.hoveredIndex !== null) {
1064
+ this.setState({ hoveredIndex: null });
1065
+ }
981
1066
  }
982
1067
  getMax() {
983
1068
  const { data, acceptNull, yMax } = this.props;
984
- const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull(data)) : (0, lodash_exports.max)(data);
1069
+ const dataMax = () => acceptNull ? (0, lodash_exports.max)(this.fillNull()) : (0, lodash_exports.max)(data);
985
1070
  return yMax !== void 0 ? yMax : dataMax();
986
1071
  }
987
1072
  getMin() {
988
1073
  const { data, acceptNull, yMin } = this.props;
989
- const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull(data)) : (0, lodash_exports.min)(data);
1074
+ const dataMin = () => acceptNull ? (0, lodash_exports.min)(this.fillNull()) : (0, lodash_exports.min)(data);
990
1075
  return yMin !== void 0 ? yMin : dataMin();
991
1076
  }
992
1077
  /**
@@ -1066,15 +1151,14 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
1066
1151
  })).map((p) => [p.x, p.y]);
1067
1152
  }
1068
1153
  /**
1069
- * Renders rect area for helping figure out which is the nearest point so that
1070
- * render related cursor and tooltip.
1154
+ * Renders rect area for each datapoint for interactions and screen reader support
1071
1155
  * @param {Array} points - array of points coordination.
1072
1156
  * @param {Number} xMargin - margin of x axis.
1073
1157
  * @return {Array} array of svg rect objects
1074
1158
  * @private
1075
1159
  */
1076
1160
  renderRect(points, xMargin) {
1077
- const { data, height } = this.props;
1161
+ const { data, height, showTooltip } = this.props;
1078
1162
  const xUnit = this.getXUnit(xMargin);
1079
1163
  return points.map((p, i) => (
1080
1164
  /* eslint-disable react/no-array-index-key */
@@ -1082,20 +1166,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
1082
1166
  "rect",
1083
1167
  {
1084
1168
  key: `${i}_${p[0]}`,
1169
+ role: "img",
1170
+ "aria-label": `Value: ${data[i] === null ? "N/A" : data[i]}, point ${i + 1} of ${data.length}`,
1085
1171
  "data-test": `rect-${i}`,
1172
+ "data-point-index": i,
1173
+ tabIndex: showTooltip && this.state.activeIndex === i ? 0 : -1,
1174
+ ref: (el) => {
1175
+ this.pointRefs[i] = el;
1176
+ },
1086
1177
  x: p[0] - xUnit / 2 <= 0 ? 0 : p[0] - xUnit / 2,
1087
1178
  y: 0,
1088
1179
  width: i === 0 && data.length !== 1 ? xUnit / 2 : xUnit,
1089
1180
  height,
1090
1181
  style: { fillOpacity: 0 },
1091
- onMouseOver: (e) => {
1092
- this.setState({
1093
- open: data[i] !== null,
1094
- rectArea: data[i] === null ? null : e.target,
1095
- tooltip: data[i],
1096
- currentPointX: p[0]
1097
- });
1098
- }
1182
+ onMouseDown: preventDefault
1099
1183
  }
1100
1184
  )
1101
1185
  ));
@@ -1131,22 +1215,16 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
1131
1215
  }
1132
1216
  )));
1133
1217
  }
1134
- renderCursor() {
1135
- const {
1136
- cursorStroke,
1137
- cursorStrokeWidth,
1138
- cursorStrokeLinecap,
1139
- cursorStrokeDasharray,
1140
- height
1141
- } = this.props;
1142
- return this.state.rectArea !== null && /* @__PURE__ */ react_default.createElement(
1218
+ renderCursor(currentPointX, shouldRender) {
1219
+ const { cursorStroke, cursorStrokeWidth, cursorStrokeLinecap, cursorStrokeDasharray, height } = this.props;
1220
+ return shouldRender && /* @__PURE__ */ react_default.createElement(
1143
1221
  "line",
1144
1222
  {
1145
1223
  "data-test": "cursor",
1146
1224
  ref: this.handleCursorMount,
1147
- x1: this.state.currentPointX,
1225
+ x1: currentPointX,
1148
1226
  y1: 0,
1149
- x2: this.state.currentPointX,
1227
+ x2: currentPointX,
1150
1228
  y2: height,
1151
1229
  style: {
1152
1230
  stroke: cursorStroke,
@@ -1157,19 +1235,20 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
1157
1235
  }
1158
1236
  );
1159
1237
  }
1160
- renderTooltip() {
1161
- return this.state.anchor !== null && /* @__PURE__ */ react_default.createElement(
1238
+ renderTooltip(tooltipValue, isOpen) {
1239
+ const { anchor } = this.state;
1240
+ return /* @__PURE__ */ react_default.createElement(
1162
1241
  Popover_default,
1163
1242
  {
1164
1243
  "data-test": "tooltip",
1165
- open: this.state.open,
1166
- anchor: this.state.anchor,
1167
- "data-test-value": this.state.tooltip,
1244
+ open: isOpen,
1245
+ anchor,
1246
+ "data-test-value": tooltipValue,
1168
1247
  appearance: "inverted",
1169
1248
  defaultPlacement: "above",
1170
1249
  animation: false
1171
1250
  },
1172
- /* @__PURE__ */ react_default.createElement(StyledTooltip, null, this.state.anchor !== null ? this.state.tooltip : void 0)
1251
+ /* @__PURE__ */ react_default.createElement(StyledTooltip, null, tooltipValue)
1173
1252
  );
1174
1253
  }
1175
1254
  /**
@@ -1240,39 +1319,69 @@ var _SparkLine = class _SparkLine extends react_exports.Component {
1240
1319
  width,
1241
1320
  title
1242
1321
  } = this.props;
1322
+ const { activeIndex, hoveredIndex, componentIsFocused } = this.state;
1243
1323
  if (data.length === 0) {
1244
1324
  return null;
1245
1325
  }
1326
+ if (this.pointRefs.length !== data.length) {
1327
+ this.pointRefs.length = data.length;
1328
+ }
1246
1329
  const xMargin = endDotRadius + endDotStrokeWidth / 2;
1247
1330
  const yMargin = Math.max(lineStrokeWidth / 2, endDotRadius + endDotStrokeWidth / 2);
1248
1331
  const points = this.dataToPoints(xMargin, yMargin);
1249
1332
  const dotsToShow = Math.max(showEndDot && 1, (0, lodash_exports.isFinite)(endDotCount) && endDotCount > 0 && endDotCount);
1333
+ let currentPointX = null;
1334
+ let tooltipValue = null;
1335
+ let showCursorAndTooltip = false;
1336
+ let interactiveProps = {};
1337
+ if (showTooltip) {
1338
+ const isHovered = hoveredIndex !== null;
1339
+ const shouldDisplayInteractiveElements = (isHovered || componentIsFocused) && data.length > 0;
1340
+ if (shouldDisplayInteractiveElements) {
1341
+ const displayIndex = isHovered ? hoveredIndex : activeIndex;
1342
+ if (displayIndex !== null && displayIndex >= 0 && data.length > displayIndex && points.length > displayIndex) {
1343
+ const displayPointCoords = points[displayIndex];
1344
+ if (displayPointCoords) {
1345
+ [currentPointX] = displayPointCoords;
1346
+ }
1347
+ tooltipValue = data[displayIndex];
1348
+ showCursorAndTooltip = currentPointX !== null;
1349
+ }
1350
+ }
1351
+ interactiveProps = {
1352
+ onKeyDown: this.handleKeyDown,
1353
+ onMouseOver: this.handleMouseOver,
1354
+ onMouseLeave: this.handleMouseLeave,
1355
+ onFocus: this.handleFocus,
1356
+ onBlur: this.handleBlur
1357
+ };
1358
+ }
1359
+ const ariaLabel = title || (0, i18n_exports._)("Source count over time sparkline trend");
1250
1360
  return /* @__PURE__ */ react_default.createElement(
1251
1361
  "div",
1252
- __spreadValues({
1362
+ __spreadValues(__spreadValues({
1253
1363
  "data-test": "line",
1254
1364
  "data-test-type": isArea ? "area" : "line",
1255
- onMouseOut: () => {
1256
- this.setState({
1257
- open: false,
1258
- anchor: null,
1259
- rectArea: null,
1260
- currentPointX: null
1261
- });
1262
- },
1263
- ref: elementRef
1264
- }, (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
1365
+ role: "group",
1366
+ ref: (el) => {
1367
+ this.containerRef.current = el;
1368
+ if (typeof elementRef === "function") {
1369
+ elementRef(el);
1370
+ } else if (elementRef && typeof elementRef === "object") {
1371
+ elementRef.current = el;
1372
+ }
1373
+ }
1374
+ }, interactiveProps), (0, lodash_exports.omit)(this.props, (0, lodash_exports.keys)(_SparkLine.propTypes))),
1265
1375
  /* @__PURE__ */ react_default.createElement(
1266
1376
  StyledSvg,
1267
1377
  {
1268
1378
  height,
1269
1379
  width,
1270
- role: "img",
1271
1380
  "aria-labelledby": this.titleId,
1272
1381
  "data-test": "sparkline-svg"
1273
1382
  },
1274
- /* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, title || (0, i18n_exports._)("Source count over time sparkline trend")),
1275
- /* @__PURE__ */ react_default.createElement("g", null, this.renderCursor(), this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, showTooltip ? this.renderRect(points, xMargin) : null, showTooltip ? this.renderTooltip() : null)
1383
+ /* @__PURE__ */ react_default.createElement("title", { id: this.titleId, "data-test": "sparkline-title" }, ariaLabel),
1384
+ /* @__PURE__ */ react_default.createElement("g", null, showTooltip ? this.renderCursor(currentPointX, showCursorAndTooltip) : null, this.renderPolyline(points), this.renderArea(points), dotsToShow ? this.renderEndDots(points, dotsToShow, xMargin) : null, this.renderRect(points, xMargin), showTooltip ? this.renderTooltip(tooltipValue, showCursorAndTooltip) : null)
1276
1385
  )
1277
1386
  );
1278
1387
  }
@@ -1403,7 +1512,12 @@ var SingleValueSparkline = ({
1403
1512
  endDotStroke: (0, propUtils_exports.formatColor)(stroke),
1404
1513
  endDotFillColor: (0, propUtils_exports.formatColor)(stroke),
1405
1514
  acceptNull,
1406
- style: { flex: "0 0 auto", justifyContent: "center", display: "flex", alignItems: "flex-end" }
1515
+ style: {
1516
+ flex: "0 0 auto",
1517
+ justifyContent: "center",
1518
+ display: "flex",
1519
+ alignItems: "flex-end"
1520
+ }
1407
1521
  }
1408
1522
  );
1409
1523
  SingleValueSparkline.propTypes = {
@@ -1504,7 +1618,10 @@ var getSparklines = ({
1504
1618
  contentHeight,
1505
1619
  isSparklinePositionBelow
1506
1620
  });
1507
- const sparklineSegments = getSparklineSegments({ hasSparkline, sparklineHighlightSegments });
1621
+ const sparklineSegments = getSparklineSegments({
1622
+ hasSparkline,
1623
+ sparklineHighlightSegments
1624
+ });
1508
1625
  const endDots = getEndDots({ hasSparkline, sparklineHighlightDots });
1509
1626
  return {
1510
1627
  sparklineWidth,
@@ -1549,6 +1666,7 @@ var OverflowWrapper = styled_components_default.div.attrs(() => ({
1549
1666
  }
1550
1667
  &:after {
1551
1668
  right: 0;
1669
+ pointer-events: none;
1552
1670
  background: linear-gradient(
1553
1671
  90deg,
1554
1672
  ${(props) => props.overflowBackgroundColor}00,
@@ -1557,6 +1675,7 @@ var OverflowWrapper = styled_components_default.div.attrs(() => ({
1557
1675
  }
1558
1676
  &:before {
1559
1677
  left: 0;
1678
+ pointer-events: none;
1560
1679
  background: linear-gradient(
1561
1680
  -90deg,
1562
1681
  ${(props) => props.overflowBackgroundColor}00,
@@ -1727,7 +1846,7 @@ var SingleValue = (_a) => {
1727
1846
  shouldSparklineAcceptNullData,
1728
1847
  onValueClick,
1729
1848
  defaultFontColor,
1730
- defaultBackgroundColor,
1849
+ defaultBackgroundColor: defaultBackgroundColor2,
1731
1850
  defaultBlockFontColor,
1732
1851
  sparklineSeverityColors = DEFAULT_SPARKLINE_SEVERITY_COLORS,
1733
1852
  sparklineAreaColor,
@@ -1739,7 +1858,7 @@ var SingleValue = (_a) => {
1739
1858
  } = props;
1740
1859
  const defaultColors = {
1741
1860
  defaultFontColor,
1742
- defaultBackgroundColor,
1861
+ defaultBackgroundColor: defaultBackgroundColor2,
1743
1862
  defaultBlockFontColor,
1744
1863
  sparklineSeverityColors
1745
1864
  };
@@ -1800,14 +1919,7 @@ var SingleValue = (_a) => {
1800
1919
  { key: "trendDisplay", value: "off" },
1801
1920
  { key: "unit", value: "" }
1802
1921
  ];
1803
- const {
1804
- majorText,
1805
- trendText,
1806
- majorTextFontSize,
1807
- trendTextFontSize,
1808
- majorValueTitle,
1809
- smallVizProps
1810
- } = computeSingleValueContent({
1922
+ const { majorText, trendText, majorTextFontSize, trendTextFontSize, majorValueTitle, smallVizProps } = computeSingleValueContent({
1811
1923
  majorValue,
1812
1924
  majorValueDisplay,
1813
1925
  trendValue,
@@ -1837,7 +1949,10 @@ var SingleValue = (_a) => {
1837
1949
  hasSparkline,
1838
1950
  isSparklinePositionBelow,
1839
1951
  majorTextFontSize,
1840
- underLabelHeight: getUnderLabelHeight({ underLabel, underLabelFontSize })
1952
+ underLabelHeight: getUnderLabelHeight({
1953
+ underLabel,
1954
+ underLabelFontSize
1955
+ })
1841
1956
  });
1842
1957
  const { sparklineWidth, sparklineHeight, sparklineSegments, endDots } = getSparklines({
1843
1958
  width: containerWidth,
@@ -2266,9 +2381,14 @@ var Item = styled_components_default.div.attrs(({ width }) => ({
2266
2381
  position: relative;
2267
2382
  background-color: ${(props) => (0, colorUtils_exports.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor}};
2268
2383
  `;
2269
- var FixSizeItem = styled_components_default.div.attrs(({ width, height }) => ({
2270
- style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
2271
- }))`
2384
+ var FixSizeItem = styled_components_default.div.attrs(
2385
+ ({
2386
+ width,
2387
+ height
2388
+ }) => ({
2389
+ style: __spreadValues(__spreadValues({}, width && { width: (0, style_exports.toPx)(width) }), height && { height: (0, style_exports.toPx)(height) })
2390
+ })
2391
+ )`
2272
2392
  position: relative;
2273
2393
  flex-direction: column;
2274
2394
  flex: 1;
@@ -2302,7 +2422,7 @@ var withFixedSizeContainer = (Viz) => {
2302
2422
  FixSizeItem,
2303
2423
  {
2304
2424
  "data-test": "fix-size-item",
2305
- "data-splunk-visualization-version": "27.5.0 - 5cfbc7064",
2425
+ "data-splunk-visualization-version": "28.1.0 - 4a1bff08b",
2306
2426
  width,
2307
2427
  height,
2308
2428
  backgroundColor
@@ -2368,7 +2488,7 @@ var Cover = styled_components_default.div`
2368
2488
  bottom: 0;
2369
2489
  `;
2370
2490
  var Blocker = styled_components_default.div.attrs({
2371
- "data-splunk-visualization-version": "27.5.0 - 5cfbc7064"
2491
+ "data-splunk-visualization-version": "28.1.0 - 4a1bff08b"
2372
2492
  })`
2373
2493
  position: relative;
2374
2494
  width: 100%;
@@ -2737,7 +2857,12 @@ var useGetXAndYFields = ({
2737
2857
  y2Fields: options.y2 ? "> y2 | getField()" : void 0,
2738
2858
  fieldTypes: "> primary | getType()"
2739
2859
  };
2740
- const { xField = "", yFields = [], y2Fields = [], fieldTypes } = Options_exports.Options.evaluate(
2860
+ const {
2861
+ xField = "",
2862
+ yFields = [],
2863
+ y2Fields = [],
2864
+ fieldTypes
2865
+ } = Options_exports.Options.evaluate(
2741
2866
  { options: optionsToEvaluate, context },
2742
2867
  dataSourcesWithOnlyOnePoint,
2743
2868
  () => {
@@ -3351,7 +3476,9 @@ var withDashboardViz = (opts) => {
3351
3476
  return result;
3352
3477
  }
3353
3478
  } catch (e) {
3354
- console.error(`unexpected error evaluating options: ${e.message}`);
3479
+ if (e instanceof Error) {
3480
+ console.error(`unexpected error evaluating options: ${e.message}`);
3481
+ }
3355
3482
  return {};
3356
3483
  }
3357
3484
  return {};
@@ -3408,9 +3535,13 @@ var withDashboardViz = (opts) => {
3408
3535
  }
3409
3536
  eventCallbackProps[eventCallbackPropName] = (ev) => {
3410
3537
  if (ev && ev.payload) {
3411
- payload = ev.payload;
3538
+ payload = __spreadValues({}, ev.payload);
3412
3539
  }
3413
- return onEventTrigger({ originalEvent: ev, payload, type: eventName });
3540
+ return onEventTrigger({
3541
+ originalEvent: ev,
3542
+ payload,
3543
+ type: eventName
3544
+ });
3414
3545
  };
3415
3546
  if (parentKeys) {
3416
3547
  for (let i = parentKeys.length - 1; i >= 0; i -= 1) {
@@ -3725,11 +3856,9 @@ var StaticBackgroundColorEditor_default = StaticBackgroundColorEditor;
3725
3856
  // src/common/utils/configUtils.ts
3726
3857
  function enhanceConfig(vizConfig) {
3727
3858
  const enhancedConfig = __spreadValues({}, vizConfig);
3728
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(
3729
- (config3) => {
3730
- return __spreadProps(__spreadValues({}, config3), { open: config3.open || false });
3731
- }
3732
- );
3859
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map((config3) => {
3860
+ return __spreadProps(__spreadValues({}, config3), { open: config3.open || false });
3861
+ });
3733
3862
  return enhancedConfig;
3734
3863
  }
3735
3864
  function hasCompatibleContexts(vizContext, presetContext) {
@@ -3791,7 +3920,6 @@ var TrellisEditorConfig = [
3791
3920
  editorProps: {
3792
3921
  min: 1
3793
3922
  },
3794
- placeholder: (0, i18n_exports._)("Auto"),
3795
3923
  showEditor: isTrellisEnabled
3796
3924
  }
3797
3925
  ],
@@ -3860,6 +3988,15 @@ var TrellisBackgroundColorEditor = {
3860
3988
  showEditor: isTrellisEnabled
3861
3989
  };
3862
3990
 
3991
+ // src/common/ThemedDefaults.tsx
3992
+ var defaultBackgroundColor = (props) => pick_default2({
3993
+ enterprise: {
3994
+ dark: variables_default.black(props),
3995
+ light: variables_default.white(props)
3996
+ },
3997
+ prisma: variables_default.backgroundColorSection(props)
3998
+ })(props);
3999
+
3863
4000
  // src/SingleValue/config.ts
3864
4001
  var dataContract = {
3865
4002
  requiredDataSources: [
@@ -3960,13 +4097,7 @@ var themes = {
3960
4097
  enterprise: variables_default.white(props),
3961
4098
  prisma: variables_default.contentColorActive(props)
3962
4099
  })(props),
3963
- defaultBackgroundColor: (props) => pick_default2({
3964
- enterprise: {
3965
- dark: variables_default.black(props),
3966
- light: variables_default.backgroundColor(props)
3967
- },
3968
- prisma: variables_default.backgroundColorSidebar(props)
3969
- })(props),
4100
+ defaultBackgroundColor,
3970
4101
  defaultSparklineStrokeColor: (props) => pick_default2({
3971
4102
  enterprise: variables_default.textColor(props),
3972
4103
  prisma: variables_default.contentColorActive(props)
@@ -4146,7 +4277,12 @@ var editorConfig = [
4146
4277
  }
4147
4278
  })
4148
4279
  ],
4149
- [getDynamicMajorColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
4280
+ [
4281
+ getDynamicMajorColorEditor({
4282
+ defaultContext,
4283
+ defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig
4284
+ })
4285
+ ],
4150
4286
  [
4151
4287
  __spreadProps(__spreadValues({}, StaticTrendColorEditor_default), {
4152
4288
  editorProps: {
@@ -4154,7 +4290,12 @@ var editorConfig = [
4154
4290
  }
4155
4291
  })
4156
4292
  ],
4157
- [getDynamicTrendColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
4293
+ [
4294
+ getDynamicTrendColorEditor({
4295
+ defaultContext,
4296
+ defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig
4297
+ })
4298
+ ],
4158
4299
  [
4159
4300
  __spreadProps(__spreadValues({}, StaticBackgroundColorEditor_default), {
4160
4301
  editorProps: {
@@ -4169,7 +4310,12 @@ var editorConfig = [
4169
4310
  }
4170
4311
  })
4171
4312
  ],
4172
- [getDynamicBackgroundColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
4313
+ [
4314
+ getDynamicBackgroundColorEditor({
4315
+ defaultContext,
4316
+ defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig
4317
+ })
4318
+ ],
4173
4319
  [
4174
4320
  {
4175
4321
  label: (0, i18n_exports._)("Major value size (px)"),
@@ -4178,7 +4324,6 @@ var editorConfig = [
4178
4324
  editorProps: {
4179
4325
  min: 1
4180
4326
  },
4181
- placeholder: (0, i18n_exports._)("Auto"),
4182
4327
  showEditor: ({ options }) => options.showValue || options.showValue === void 0
4183
4328
  },
4184
4329
  {
@@ -4188,7 +4333,6 @@ var editorConfig = [
4188
4333
  editorProps: {
4189
4334
  min: 1
4190
4335
  },
4191
- placeholder: (0, i18n_exports._)("Auto"),
4192
4336
  showEditor: ({ options }) => options.showValue || options.showValue === void 0,
4193
4337
  isDisabled: ({ options }) => options.trendDisplay === "off"
4194
4338
  }
@@ -4381,7 +4525,9 @@ var withTrellis = (Viz) => {
4381
4525
  const evaluated = Options_exports.Options.evaluate(
4382
4526
  {
4383
4527
  context: Viz.config.context,
4384
- options: { trellisBackgroundColor: mergedOptions.trellisBackgroundColor }
4528
+ options: {
4529
+ trellisBackgroundColor: mergedOptions.trellisBackgroundColor
4530
+ }
4385
4531
  },
4386
4532
  {},
4387
4533
  themeFunc