@splunk/visualizations 27.4.0 → 27.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 (71) hide show
  1. package/Area.config.js +7 -0
  2. package/Area.config.js.map +2 -2
  3. package/Area.js +36 -6
  4. package/Area.js.map +2 -2
  5. package/Bar.config.js +7 -0
  6. package/Bar.config.js.map +2 -2
  7. package/Bar.js +37 -8
  8. package/Bar.js.map +2 -2
  9. package/Bubble.config.js +7 -0
  10. package/Bubble.config.js.map +2 -2
  11. package/Bubble.js +16 -5
  12. package/Bubble.js.map +2 -2
  13. package/CHANGELOG.external.md +20 -1
  14. package/ChoroplethSvg.js +2 -2
  15. package/Column.config.js +7 -0
  16. package/Column.config.js.map +2 -2
  17. package/Column.js +36 -6
  18. package/Column.js.map +2 -2
  19. package/Ellipse.js +65 -7
  20. package/Ellipse.js.map +4 -4
  21. package/Events.js +11 -6
  22. package/Events.js.map +2 -2
  23. package/FEATUREFLAGS.md +2 -0
  24. package/FillerGauge.js +2 -2
  25. package/Image.js +2 -2
  26. package/Line.config.js +7 -0
  27. package/Line.config.js.map +2 -2
  28. package/Line.js +36 -6
  29. package/Line.js.map +2 -2
  30. package/LinkGraph.js +2 -2
  31. package/Map.config.js +11 -0
  32. package/Map.config.js.map +2 -2
  33. package/Map.js +227 -101
  34. package/Map.js.map +4 -4
  35. package/Markdown.js +2 -2
  36. package/MarkerGauge.js +2 -2
  37. package/ParallelCoordinates.js +2 -2
  38. package/ParallelCoordinates.js.map +1 -1
  39. package/Pie.js +9 -5
  40. package/Pie.js.map +2 -2
  41. package/Punchcard.js +2 -2
  42. package/Punchcard.js.map +1 -1
  43. package/Rectangle.js +64 -7
  44. package/Rectangle.js.map +4 -4
  45. package/Sankey.js +36 -35
  46. package/Sankey.js.map +3 -3
  47. package/Scatter.config.js +7 -0
  48. package/Scatter.config.js.map +2 -2
  49. package/Scatter.js +16 -5
  50. package/Scatter.js.map +2 -2
  51. package/SingleValue.js +3 -3
  52. package/SingleValue.js.map +2 -2
  53. package/SingleValueBasic.js.map +1 -1
  54. package/SingleValueIcon.js +3 -3
  55. package/SingleValueIcon.js.map +2 -2
  56. package/SingleValueRadial.js +3 -3
  57. package/SingleValueRadial.js.map +2 -2
  58. package/Table.js +2 -2
  59. package/Timeline.js +2 -2
  60. package/common/Charting.js +7 -3
  61. package/common/Charting.js.map +2 -2
  62. package/common/chartingUtils.js +11 -0
  63. package/common/chartingUtils.js.map +2 -2
  64. package/common/shapeUtils.js +85 -3
  65. package/common/shapeUtils.js.map +4 -4
  66. package/common/utils/mapUtils.js +156 -43
  67. package/common/utils/mapUtils.js.map +4 -4
  68. package/common/utils/singleValueUtils.js +1 -1
  69. package/common/utils/singleValueUtils.js.map +2 -2
  70. package/common/withDashboardViz.js +2 -2
  71. package/package.json +15 -15
package/Ellipse.js CHANGED
@@ -924,7 +924,7 @@ var withFixedSizeContainer = (Viz) => {
924
924
  FixSizeItem,
925
925
  {
926
926
  "data-test": "fix-size-item",
927
- "data-splunk-visualization-version": "27.4.0 - 92ef39d5c",
927
+ "data-splunk-visualization-version": "27.5.0 - 5cfbc7064",
928
928
  width,
929
929
  height,
930
930
  backgroundColor
@@ -990,7 +990,7 @@ var Cover = styled_components_default.div`
990
990
  bottom: 0;
991
991
  `;
992
992
  var Blocker = styled_components_default.div.attrs({
993
- "data-splunk-visualization-version": "27.4.0 - 92ef39d5c"
993
+ "data-splunk-visualization-version": "27.5.0 - 5cfbc7064"
994
994
  })`
995
995
  position: relative;
996
996
  width: 100%;
@@ -1769,7 +1769,16 @@ var defaultImport28 = __toESM(require("@splunk/visualizations-shared/propUtils")
1769
1769
  __reExport(propUtils_exports, require("@splunk/visualizations-shared/propUtils"));
1770
1770
  var propUtils_default = "default" in defaultImport28 ? defaultImport28.default : defaultImport28;
1771
1771
 
1772
- // src/common/shapeUtils.ts
1772
+ // esm-externals:@splunk/react-ui/ScreenReaderContent
1773
+ var ScreenReaderContent_exports = {};
1774
+ __export(ScreenReaderContent_exports, {
1775
+ default: () => ScreenReaderContent_default
1776
+ });
1777
+ var defaultImport29 = __toESM(require("@splunk/react-ui/ScreenReaderContent"));
1778
+ __reExport(ScreenReaderContent_exports, require("@splunk/react-ui/ScreenReaderContent"));
1779
+ var ScreenReaderContent_default = "default" in defaultImport29 ? defaultImport29.default : defaultImport29;
1780
+
1781
+ // src/common/shapeUtils.tsx
1773
1782
  var shapeOptionsMapping = {
1774
1783
  fillColor: "fill",
1775
1784
  strokeColor: "stroke",
@@ -1792,7 +1801,52 @@ var getStyledShape = (shape4) => styled_components_default(shape4)`
1792
1801
  },
1793
1802
  prisma: variables_default.neutral500
1794
1803
  })(props)};
1795
- cursor: ${(props) => props.onClick ? "pointer" : "inherit"};
1804
+ `;
1805
+ function ClickableShape({ children, onClick, shape: shape4 }) {
1806
+ const descriptionId = (0, react_exports.useMemo)(() => (0, id_exports.createDOMID)("clickable-svg-description"), []);
1807
+ return /* @__PURE__ */ react_default.createElement(StyledDiv, null, /* @__PURE__ */ react_default.createElement(ScreenReaderContent_default, { id: descriptionId }, (0, i18n_exports._)("Click to trigger interaction")), children, /* @__PURE__ */ react_default.createElement(
1808
+ StyledButton,
1809
+ {
1810
+ onClick,
1811
+ "aria-label": shape4 === "rect" ? (0, i18n_exports._)("Rectangle visualization") : (0, i18n_exports._)("Ellipse visualization"),
1812
+ "aria-describedby": descriptionId,
1813
+ shape: shape4
1814
+ }
1815
+ ));
1816
+ }
1817
+ var StyledDiv = styled_components_default.div`
1818
+ display: inline-grid;
1819
+ grid-template: 1fr / 1fr;
1820
+
1821
+ & > * {
1822
+ grid-row-start: 1;
1823
+ grid-column-start: 1;
1824
+ }
1825
+ `;
1826
+ var StyledButton = styled_components_default.button`
1827
+ padding: 0;
1828
+ border: none;
1829
+ background: none;
1830
+ cursor: pointer;
1831
+ &:focus {
1832
+ outline: none;
1833
+ ${(props) => props.shape === "rect" ? styled_components_exports.css`
1834
+ box-shadow: ${variables_default.focusShadow};
1835
+ ` : (
1836
+ // clip-path would clip the shadow for ellipse, so we use drop-shadow filters to simulate it
1837
+ styled_components_exports.css`
1838
+ svg:has(+ &) > ellipse {
1839
+ filter: drop-shadow(2px 0px 1px ${variables_default.focusColor})
1840
+ drop-shadow(-2px 0px 1px ${variables_default.focusColor})
1841
+ drop-shadow(0px 2px 1px ${variables_default.focusColor})
1842
+ drop-shadow(0px -2px 1px ${variables_default.focusColor});
1843
+ }
1844
+ `
1845
+ )}
1846
+ }
1847
+ ${(props) => props.shape === "ellipse" && `
1848
+ clip-path: ellipse(50% 50% at 50% 50%);
1849
+ `}
1796
1850
  `;
1797
1851
 
1798
1852
  // src/Ellipse/Ellipse.tsx
@@ -1808,18 +1862,22 @@ var EllipseVisualization = ({
1808
1862
  onEllipseClick,
1809
1863
  options
1810
1864
  }) => {
1811
- return /* @__PURE__ */ react_exports.createElement(SVGContainer, { width, height }, /* @__PURE__ */ react_exports.createElement(
1865
+ const svgContent = /* @__PURE__ */ react_exports.createElement(SVGContainer, { width, height }, /* @__PURE__ */ react_exports.createElement(
1812
1866
  EllipseShape,
1813
1867
  __spreadProps(__spreadValues({
1868
+ id: "ellipse-shape",
1814
1869
  cx: "50%",
1815
1870
  cy: "50%",
1816
1871
  rx: `${Number(width) / 2 - options.strokeWidth / 2}px`,
1817
1872
  ry: `${Number(height) / 2 - options.strokeWidth / 2}px`
1818
1873
  }, options), {
1819
- vectorEffect: "non-scaling-stroke",
1820
- onClick: onEllipseClick
1874
+ vectorEffect: "non-scaling-stroke"
1821
1875
  })
1822
1876
  ));
1877
+ if (typeof onEllipseClick === "function" && onEllipseClick !== lodash_exports.noop) {
1878
+ return /* @__PURE__ */ react_exports.createElement(ClickableShape, { shape: "ellipse", onClick: onEllipseClick }, svgContent);
1879
+ }
1880
+ return svgContent;
1823
1881
  };
1824
1882
  var computeVizProps = (_a) => {
1825
1883
  var _b = _a, { width, height } = _b, options = __objRest(_b, ["width", "height"]);