@splunk/visualizations 27.0.0 → 27.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 (79) hide show
  1. package/Area.config.js +269 -122
  2. package/Area.config.js.map +4 -4
  3. package/Area.js +1065 -209
  4. package/Area.js.map +4 -4
  5. package/Bar.config.js +266 -82
  6. package/Bar.config.js.map +4 -4
  7. package/Bar.js +1065 -171
  8. package/Bar.js.map +4 -4
  9. package/Bubble.config.js +127 -1
  10. package/Bubble.config.js.map +4 -4
  11. package/Bubble.js +323 -80
  12. package/Bubble.js.map +4 -4
  13. package/ChoroplethSvg.js +60 -30
  14. package/ChoroplethSvg.js.map +4 -4
  15. package/Column.config.js +271 -82
  16. package/Column.config.js.map +4 -4
  17. package/Column.js +1070 -171
  18. package/Column.js.map +4 -4
  19. package/Ellipse.js +44 -14
  20. package/Ellipse.js.map +4 -4
  21. package/Events.js +82 -52
  22. package/Events.js.map +4 -4
  23. package/FillerGauge.js +44 -14
  24. package/FillerGauge.js.map +4 -4
  25. package/Image.js +42 -12
  26. package/Image.js.map +4 -4
  27. package/Line.config.js +271 -119
  28. package/Line.config.js.map +4 -4
  29. package/Line.js +1067 -206
  30. package/Line.js.map +4 -4
  31. package/LinkGraph.js +563 -529
  32. package/LinkGraph.js.map +4 -4
  33. package/Map.js +44 -14
  34. package/Map.js.map +4 -4
  35. package/Markdown.js +46 -16
  36. package/Markdown.js.map +4 -4
  37. package/MarkerGauge.js +42 -12
  38. package/MarkerGauge.js.map +4 -4
  39. package/ParallelCoordinates.js +122 -86
  40. package/ParallelCoordinates.js.map +4 -4
  41. package/Pie.js +198 -81
  42. package/Pie.js.map +4 -4
  43. package/Punchcard.js +54 -24
  44. package/Punchcard.js.map +4 -4
  45. package/Rectangle.js +56 -26
  46. package/Rectangle.js.map +4 -4
  47. package/Sankey.js +68 -38
  48. package/Sankey.js.map +4 -4
  49. package/Scatter.config.js +127 -1
  50. package/Scatter.config.js.map +4 -4
  51. package/Scatter.js +323 -80
  52. package/Scatter.js.map +4 -4
  53. package/SingleValue.config.js +43 -67
  54. package/SingleValue.config.js.map +4 -4
  55. package/SingleValue.js +1419 -1351
  56. package/SingleValue.js.map +4 -4
  57. package/SingleValueBasic.js.map +1 -1
  58. package/SingleValueIcon.config.js +45 -69
  59. package/SingleValueIcon.config.js.map +4 -4
  60. package/SingleValueIcon.js +1307 -1238
  61. package/SingleValueIcon.js.map +4 -4
  62. package/SingleValueRadial.config.js +43 -67
  63. package/SingleValueRadial.config.js.map +4 -4
  64. package/SingleValueRadial.js +1352 -1266
  65. package/SingleValueRadial.js.map +4 -4
  66. package/TRELLIS.md +16 -15
  67. package/Table.js +52 -22
  68. package/Table.js.map +4 -4
  69. package/common/Charting.js +133 -27
  70. package/common/Charting.js.map +4 -4
  71. package/common/OptionsDoc.js +6 -1
  72. package/common/OptionsDoc.js.map +2 -2
  73. package/common/utils/singleValueUtils.js +8 -7
  74. package/common/utils/singleValueUtils.js.map +2 -2
  75. package/common/utils/trellisUtils.js +41 -1
  76. package/common/utils/trellisUtils.js.map +2 -2
  77. package/common/withDashboardViz.js +42 -12
  78. package/common/withDashboardViz.js.map +4 -4
  79. package/package.json +17 -18
package/TRELLIS.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # Trellis layout
2
2
 
3
- > Trellis is only available for single value visualizations.
3
+ > Trellis is only available for Area, Bar, Column, Line and Single value visualizations.
4
4
 
5
5
  Organize your search results with the trellis layout for a holistic view of your data. Trellis layout visualizes your search results by separating each value field or aggregation.
6
6
 
7
- The search in the following example returns customer purchases by product category. Applying a trellis layout creates a view of each product category as its own single value visualization.
7
+ The search in the following example returns customer purchases by product category. Applying a trellis layout creates a view of each product category as its own visualization.
8
8
 
9
9
  `index="sample-data" | stats count by productName`
10
10
 
@@ -18,8 +18,8 @@ Configure your visualization for the trellis layout by adding the `splitByLayout
18
18
 
19
19
  Customers with access to a Unified Dashboard Framework (UDF) **Edit** mode can create the trellis layout using the following steps. If you’re not using UDF, skip to step 4.
20
20
 
21
- 1. Select a single value visualization using the visual editor by clicking the **Add Chart** dropdown menu in the editing toolbar.
22
- 2. Select the single value on your dashboard so that it's highlighted with the blue editing outline.
21
+ 1. Select a visualization that supports trellis (Area, Bar, Column, Line, Single value) using the visual editor by clicking the **Add Chart** dropdown menu in the editing toolbar.
22
+ 2. Select the visualization on your dashboard so that it's highlighted with the blue editing outline.
23
23
  3. Set up a new data source by adding selecting **+ Create Search** and adding a search to the **Search query** window. Or, select an existing data source under the **Search**, **Saved Search**, or **Chain Search** dropdown lists.
24
24
  4. Activate the trellis layout by toggling on **Trellis Layout** in the **Data display** section of the Configuration panel.
25
25
 
@@ -28,15 +28,16 @@ Customers with access to a Unified Dashboard Framework (UDF) **Edit** mode can c
28
28
  Additionally, you can add the following trellis configurations to the `options` stanza for further customization.
29
29
 
30
30
  ```markup
31
- | Option | Type | Default | Description |
32
- | ---------------------- | ------ | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
- | splitByLayout | string | off | Specify the layout method to display the visualization, which splits the data into individual visualizations based on a specific category. The available values are off and trellis. |
34
- | trellisBackgroundColor | string | > themes.defaultBackgroundColor | Specify the background color of the whole panel in the trellis layout display. For example, “#FF0000”. You can use a hexadecimal code to apply the color. The default for Enterprise light is #ffffff. The default for Enterprise dark is #000000. The default for Prisma dark is #0b0c0e. |
35
- | trellisColumns | number | n/a | Specify the number of columns in a trellis layout container. For example, six columns allow six visualizations per row. Rows populate to accommodate the total number of visualizations. If no column number is specified, the number of columns is automatically set based on the value specified for trellisMinColumnWidth. |
36
- | trellisMinColumnWidth | number | 100 | Specify the minimum width, in pixels, of each visualization in the trellis container. If you resize the window or panel, you can view the remaining visualizations by scrolling. |
37
- | trellisPageCount | number | 20 | Specify the maximum number of visualizations to display on a single page in the trellis container. The remaining visualizations paginate accordingly. |
38
- | trellisRowHeight | number | 70 | Specify each visualization's height, in pixels, in the trellis container. If you resize the window or panel, you can view the remaining visualizations by scrolling. |
39
- | trellisSplitBy | string | n/a | If applicable, specify the column's field name with categories used or aggregations to split the data into individual visualizations for trellis display. If you use an SPL `timechart` command, this might default to the SPL `by` clause field. If you use an SPL `chart` command, this might default to the first string field. |
31
+ | Option | Type | Default | Description |
32
+ | ---------------------- | ------- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
33
+ | splitByLayout | string | off | Specify the layout method to display the visualization, which splits the data into individual visualizations based on a specific category. The available values are off and trellis. |
34
+ | trellisBackgroundColor | string | > themes.defaultBackgroundColor | Specify the background color of the whole panel in the trellis layout display. For example, “#FF0000”. You can use a hexadecimal code to apply the color. The default for Enterprise light is #ffffff. The default for Enterprise dark is #000000. The default for Prisma dark is #0b0c0e. |
35
+ | trellisColumns | number | n/a | Specify the number of columns in a trellis layout container. For example, six columns allow six visualizations per row. Rows populate to accommodate the total number of visualizations. If no column number is specified, the number of columns is automatically set based on the value specified for trellisMinColumnWidth. |
36
+ | trellisMinColumnWidth | number | 100 | Specify the minimum width, in pixels, of each visualization in the trellis container. If you resize the window or panel, you can view the remaining visualizations by scrolling. |
37
+ | trellisPageCount | number | 20 | Specify the maximum number of visualizations to display on a single page in the trellis container. The remaining visualizations paginate accordingly. |
38
+ | trellisRowHeight | number | 70 | Specify each visualization's height, in pixels, in the trellis container. If you resize the window or panel, you can view the remaining visualizations by scrolling. |
39
+ | trellisSharedScale | boolean | true | If applicable, specify whether all visualizations will share the same scale in the trellis container. This only applies to Area, Bar, Column and Line chart. |
40
+ | trellisSplitBy | string | n/a | If applicable, specify the column's field name with categories used or aggregations to split the data into individual visualizations for trellis display. If you use an SPL `timechart` command, this might default to the SPL `by` clause field. If you use an SPL `chart` command, this might default to the first string field. |
40
41
  ```
41
42
 
42
43
  ## Overview of data-splitting logic
@@ -47,7 +48,7 @@ If your application has SPL support, the following are examples of how SPL searc
47
48
 
48
49
  ### Split data with the timechart command
49
50
 
50
- When using the SPL `timechart` command, the trellis layout defaults to an associated `by` clause. The following example shows how the trellis layout categorizes each single value visualization by product name as a result of the SPL search `index="sample-data" | timechart count by productName`.
51
+ When using the SPL `timechart` command, the trellis layout defaults to an associated `by` clause. The following example shows how the trellis layout categorizes each Single value visualization by product name as a result of the SPL search `index="sample-data" | timechart count by productName`.
51
52
 
52
53
  ![](./src/common/docs/images/trellis-timechart.png)
53
54
 
@@ -114,7 +115,7 @@ export default () => (
114
115
 
115
116
  ### Split data with the chart or stats commands
116
117
 
117
- The trellis layout defaults to the first string field when using the SPL `chart` or `stats` command with one `by` clause. The following example shows how the trellis layout categorizes each single value visualization by the `productName` column as a result of the SPL search `index="sample-data" | chart count by productName`.
118
+ The trellis layout defaults to the first string field when using the SPL `chart` or `stats` command with one `by` clause. The following example shows how the trellis layout categorizes each visualization, in this case Single value, by the `productName` column as a result of the SPL search `index="sample-data" | chart count by productName`.
118
119
 
119
120
  ![](./src/common/docs/images/trellis-chart-stats.png)
120
121
 
package/Table.js CHANGED
@@ -1062,7 +1062,7 @@ var withFixedSizeContainer = (Viz) => {
1062
1062
  FixSizeItem,
1063
1063
  {
1064
1064
  "data-test": "fix-size-item",
1065
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d",
1065
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df",
1066
1066
  width,
1067
1067
  height,
1068
1068
  backgroundColor
@@ -1128,7 +1128,7 @@ var Cover = styled_components_default.div`
1128
1128
  bottom: 0;
1129
1129
  `;
1130
1130
  var Blocker = styled_components_default.div.attrs({
1131
- "data-splunk-visualization-version": "27.0.0 - 9bf093b7d"
1131
+ "data-splunk-visualization-version": "27.1.0 - fe8b048df"
1132
1132
  })`
1133
1133
  position: relative;
1134
1134
  width: 100%;
@@ -1615,6 +1615,25 @@ var getFeatureFlag = (context, flagName) => {
1615
1615
  return false;
1616
1616
  };
1617
1617
 
1618
+ // esm-externals:@splunk/visualizations-shared/trellisUtils
1619
+ var trellisUtils_exports = {};
1620
+ __export(trellisUtils_exports, {
1621
+ default: () => trellisUtils_default
1622
+ });
1623
+ var defaultImport32 = __toESM(require("@splunk/visualizations-shared/trellisUtils"));
1624
+ __reExport(trellisUtils_exports, require("@splunk/visualizations-shared/trellisUtils"));
1625
+ var trellisUtils_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
1626
+
1627
+ // src/common/utils/trellisUtils.ts
1628
+ var turnOffLegendDisplayWhenTrellisIsOn = (isTrellisOn, options) => {
1629
+ if (isTrellisOn && !options.legendDisplay) {
1630
+ return {
1631
+ legendDisplay: "off"
1632
+ };
1633
+ }
1634
+ return {};
1635
+ };
1636
+
1618
1637
  // src/common/withDashboardViz.tsx
1619
1638
  var withDashboardViz = (opts) => {
1620
1639
  const {
@@ -1622,6 +1641,8 @@ var withDashboardViz = (opts) => {
1622
1641
  vizConfig,
1623
1642
  computeVizProps: computeVizProps2 = () => {
1624
1643
  },
1644
+ computeVizPropsBeforeEval = () => {
1645
+ },
1625
1646
  disableEditModeCover,
1626
1647
  useIconPlaceholder
1627
1648
  } = opts;
@@ -1671,14 +1692,26 @@ var withDashboardViz = (opts) => {
1671
1692
  const isDownsamplingEnabledByFeatureFlag = Boolean(
1672
1693
  featureFlagContext == null ? void 0 : featureFlagContext.visualizations_enableDownsampling
1673
1694
  );
1695
+ const isTrellisFeatureFlagOn = Boolean(
1696
+ featureFlagContext && featureFlagContext.visualizations_enableTrellis
1697
+ );
1698
+ const isTrellisOn = isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (options == null ? void 0 : options.splitByLayout) === "trellis" /* TRELLIS */;
1674
1699
  const isMounted = react_exports.useRef(true);
1675
- const optionsToEvaluate = react_exports.useMemo(
1676
- () => ({
1700
+ const optionsToEvaluate = react_exports.useMemo(() => {
1701
+ var _a2;
1702
+ const legendDisplay = turnOffLegendDisplayWhenTrellisIsOn(isTrellisOn, options);
1703
+ const computedOptions = (_a2 = computeVizPropsBeforeEval(options)) != null ? _a2 : {};
1704
+ return {
1677
1705
  context: (0, lodash_exports.defaultsDeep)({}, context, vizConfig.defaultContext),
1678
- options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1679
- }),
1680
- [options, context]
1681
- );
1706
+ options: (0, hocUtils_exports.deepMergeWithArrayPrimitiveOverrides)(
1707
+ {},
1708
+ legendDisplay,
1709
+ computedOptions,
1710
+ options,
1711
+ defaultOptions
1712
+ )
1713
+ };
1714
+ }, [isTrellisOn, options, context]);
1682
1715
  const [threshold, setThreshold] = react_exports.useState(Number(width));
1683
1716
  const onDownsamplingThresholdChange = react_exports.useCallback((newThreshold) => {
1684
1717
  setThreshold(newThreshold);
@@ -1759,11 +1792,8 @@ var withDashboardViz = (opts) => {
1759
1792
  useAsyncEvaluatedOptions
1760
1793
  ]);
1761
1794
  const evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1762
- const isTrellisFeatureFlagOn = Boolean(
1763
- featureFlagContext && featureFlagContext.visualizations_enableTrellis
1764
- );
1765
1795
  let clonedEvaluatedOptions = evaluatedOptionsToUse;
1766
- if (isTrellisFeatureFlagOn && ((_a = vizConfig == null ? void 0 : vizConfig.supports) == null ? void 0 : _a.includes("trellis" /* TRELLIS */)) && (clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.splitByLayout) === "trellis" /* TRELLIS */) {
1796
+ if (isTrellisOn) {
1767
1797
  clonedEvaluatedOptions = __spreadProps(__spreadValues({}, evaluatedOptionsToUse), {
1768
1798
  backgroundColor: clonedEvaluatedOptions == null ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1769
1799
  });
@@ -1874,36 +1904,36 @@ var debounce_exports = {};
1874
1904
  __export(debounce_exports, {
1875
1905
  default: () => debounce_default
1876
1906
  });
1877
- var defaultImport32 = __toESM(require("lodash/debounce"));
1907
+ var defaultImport33 = __toESM(require("lodash/debounce"));
1878
1908
  __reExport(debounce_exports, require("lodash/debounce"));
1879
- var debounce_default = "default" in defaultImport32 ? defaultImport32.default : defaultImport32;
1909
+ var debounce_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
1880
1910
 
1881
1911
  // esm-externals:@splunk/react-ui/Table
1882
1912
  var Table_exports = {};
1883
1913
  __export(Table_exports, {
1884
1914
  default: () => Table_default
1885
1915
  });
1886
- var defaultImport33 = __toESM(require("@splunk/react-ui/Table"));
1916
+ var defaultImport34 = __toESM(require("@splunk/react-ui/Table"));
1887
1917
  __reExport(Table_exports, require("@splunk/react-ui/Table"));
1888
- var Table_default = "default" in defaultImport33 ? defaultImport33.default : defaultImport33;
1918
+ var Table_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
1889
1919
 
1890
1920
  // esm-externals:@splunk/react-ui/Paginator
1891
1921
  var Paginator_exports = {};
1892
1922
  __export(Paginator_exports, {
1893
1923
  default: () => Paginator_default
1894
1924
  });
1895
- var defaultImport34 = __toESM(require("@splunk/react-ui/Paginator"));
1925
+ var defaultImport35 = __toESM(require("@splunk/react-ui/Paginator"));
1896
1926
  __reExport(Paginator_exports, require("@splunk/react-ui/Paginator"));
1897
- var Paginator_default = "default" in defaultImport34 ? defaultImport34.default : defaultImport34;
1927
+ var Paginator_default = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
1898
1928
 
1899
1929
  // esm-externals:@splunk/react-ui/Message
1900
1930
  var Message_exports2 = {};
1901
1931
  __export(Message_exports2, {
1902
1932
  default: () => Message_default2
1903
1933
  });
1904
- var defaultImport35 = __toESM(require("@splunk/react-ui/Message"));
1934
+ var defaultImport36 = __toESM(require("@splunk/react-ui/Message"));
1905
1935
  __reExport(Message_exports2, require("@splunk/react-ui/Message"));
1906
- var Message_default2 = "default" in defaultImport35 ? defaultImport35.default : defaultImport35;
1936
+ var Message_default2 = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
1907
1937
 
1908
1938
  // src/Table/hooks.tsx
1909
1939
  var isArray = (v) => Array.isArray(v);
@@ -2400,9 +2430,9 @@ var Popover_exports = {};
2400
2430
  __export(Popover_exports, {
2401
2431
  default: () => Popover_default
2402
2432
  });
2403
- var defaultImport36 = __toESM(require("@splunk/react-ui/Popover"));
2433
+ var defaultImport37 = __toESM(require("@splunk/react-ui/Popover"));
2404
2434
  __reExport(Popover_exports, require("@splunk/react-ui/Popover"));
2405
- var Popover_default = "default" in defaultImport36 ? defaultImport36.default : defaultImport36;
2435
+ var Popover_default = "default" in defaultImport37 ? defaultImport37.default : defaultImport37;
2406
2436
 
2407
2437
  // src/SparkLine/SparkLine.jsx
2408
2438
  var StyledSvg = styled_components_default.svg`