@splunk/visualizations 25.8.1 → 25.9.1

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 (85) hide show
  1. package/Area.config.js +2 -2
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +25 -9
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +3 -3
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +26 -10
  8. package/Bar.js.map +1 -1
  9. package/Bubble.js +23 -7
  10. package/Bubble.js.map +1 -1
  11. package/ChoroplethSvg.js +20 -6
  12. package/ChoroplethSvg.js.map +1 -1
  13. package/Column.config.js +4 -4
  14. package/Column.config.js.map +1 -1
  15. package/Column.js +27 -11
  16. package/Column.js.map +1 -1
  17. package/Ellipse.js +20 -6
  18. package/Ellipse.js.map +1 -1
  19. package/Events.js +20 -6
  20. package/Events.js.map +1 -1
  21. package/FillerGauge.config.js +1 -1
  22. package/FillerGauge.config.js.map +1 -1
  23. package/FillerGauge.js +21 -7
  24. package/FillerGauge.js.map +1 -1
  25. package/Image.js +20 -6
  26. package/Image.js.map +1 -1
  27. package/Line.config.js +13 -4
  28. package/Line.config.js.map +1 -1
  29. package/Line.js +38 -12
  30. package/Line.js.map +1 -1
  31. package/LinkGraph.js +2117 -2472
  32. package/LinkGraph.js.map +1 -1
  33. package/Map.js +114 -93
  34. package/Map.js.map +1 -1
  35. package/Markdown.config.js +1 -0
  36. package/Markdown.config.js.map +1 -1
  37. package/Markdown.js +40 -25
  38. package/Markdown.js.map +1 -1
  39. package/MarkerGauge.config.js +1 -1
  40. package/MarkerGauge.config.js.map +1 -1
  41. package/MarkerGauge.js +29 -15
  42. package/MarkerGauge.js.map +1 -1
  43. package/ParallelCoordinates.js +49 -35
  44. package/ParallelCoordinates.js.map +1 -1
  45. package/Pie.config.js +1 -1
  46. package/Pie.config.js.map +1 -1
  47. package/Pie.js +32 -16
  48. package/Pie.js.map +1 -1
  49. package/Punchcard.js +143 -129
  50. package/Punchcard.js.map +1 -1
  51. package/README.internal.md +15 -5
  52. package/README.md +3 -1
  53. package/Rectangle.js +61 -47
  54. package/Rectangle.js.map +1 -1
  55. package/Sankey.js +34 -20
  56. package/Sankey.js.map +1 -1
  57. package/Scatter.js +74 -58
  58. package/Scatter.js.map +1 -1
  59. package/SingleValue.config.js +6 -6
  60. package/SingleValue.config.js.map +1 -1
  61. package/SingleValue.js +41 -25
  62. package/SingleValue.js.map +1 -1
  63. package/SingleValueBasic.js +4 -4
  64. package/SingleValueBasic.js.map +1 -1
  65. package/SingleValueIcon.config.js +10 -8
  66. package/SingleValueIcon.config.js.map +1 -1
  67. package/SingleValueIcon.js +86 -70
  68. package/SingleValueIcon.js.map +1 -1
  69. package/SingleValueRadial.config.js +10 -8
  70. package/SingleValueRadial.config.js.map +1 -1
  71. package/SingleValueRadial.js +85 -69
  72. package/SingleValueRadial.js.map +1 -1
  73. package/Table.config.js +1 -1
  74. package/Table.config.js.map +1 -1
  75. package/Table.js +54 -36
  76. package/Table.js.map +1 -1
  77. package/common/Charting.js +3 -1
  78. package/common/Charting.js.map +1 -1
  79. package/common/OptionsDoc.js +9 -6
  80. package/common/OptionsDoc.js.map +1 -1
  81. package/common/OverviewDoc.js +5 -5
  82. package/common/OverviewDoc.js.map +1 -1
  83. package/common/withDashboardViz.js +20 -6
  84. package/common/withDashboardViz.js.map +1 -1
  85. package/package.json +23 -23
package/Scatter.js CHANGED
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 460);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 458);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -193,7 +193,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
193
193
  }
194
194
  return React.createElement(FixSizeItem, {
195
195
  "data-test": "fix-size-item",
196
- "data-splunk-visualization-version": "25.8.1 - 742d5fb96",
196
+ "data-splunk-visualization-version": "25.9.1 - 5ba41e723",
197
197
  width: width,
198
198
  height: height,
199
199
  backgroundColor: backgroundColor
@@ -284,10 +284,10 @@ var lodash_1 = __webpack_require__(3);
284
284
  var Charting_1 = __webpack_require__(62);
285
285
  var charting_bundle_1 = __webpack_require__(56);
286
286
  var simpleXMLOptions_1 = __webpack_require__(67);
287
- var config_1 = __webpack_require__(461);
287
+ var config_1 = __webpack_require__(459);
288
288
  exports.config = config_1.default;
289
289
  var withDashboardViz_1 = __webpack_require__(36);
290
- var scatterUtils_1 = __webpack_require__(462);
290
+ var scatterUtils_1 = __webpack_require__(460);
291
291
  var chartingUtils_1 = __webpack_require__(55);
292
292
  var validOptions = Object.keys(config_1.default.optionsSchema);
293
293
  var computeVizProps = function computeVizProps(_a) {
@@ -963,10 +963,18 @@ var withDashboardViz = function withDashboardViz(opts) {
963
963
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
964
964
  _React$useState4 = _slicedToArray(_React$useState3, 1),
965
965
  visualizationID = _React$useState4[0];
966
- var _React$useState5 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
966
+ var _React$useState5 = React.useState({}),
967
967
  _React$useState6 = _slicedToArray(_React$useState5, 2),
968
- useAsyncEvaluatedOptions = _React$useState6[0],
969
- setUseAsyncEvaluatedOptions = _React$useState6[1];
968
+ dataSourcesInState = _React$useState6[0],
969
+ setDataSourcesInState = _React$useState6[1];
970
+ var _React$useState7 = React.useState(),
971
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
972
+ dataFramesInState = _React$useState8[0],
973
+ setDataFramesInState = _React$useState8[1];
974
+ var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
975
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
976
+ useAsyncEvaluatedOptions = _React$useState10[0],
977
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
970
978
  evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
971
979
  try {
972
980
  if (useAsyncEvaluatedOptions) {
@@ -989,10 +997,16 @@ var withDashboardViz = function withDashboardViz(opts) {
989
997
  setUseAsyncEvaluatedOptions(false);
990
998
  });
991
999
  } else {
1000
+ var dataFrames = dataFramesInState;
1001
+ if (dataSources !== dataSourcesInState) {
1002
+ setDataSourcesInState(dataSources);
1003
+ dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1004
+ setDataFramesInState(dataFrames);
1005
+ }
992
1006
  return Options_1.Options.evaluate({
993
1007
  context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
994
1008
  options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
995
- }, dataSources, themeFunc);
1009
+ }, dataSources, themeFunc, dataFrames);
996
1010
  }
997
1011
  } catch (e) {
998
1012
  // eslint-disable-next-line no-console
@@ -1454,53 +1468,7 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
1454
1468
 
1455
1469
  /***/ }),
1456
1470
 
1457
- /***/ 46:
1458
- /***/ (function(module, exports, __webpack_require__) {
1459
-
1460
- "use strict";
1461
-
1462
-
1463
- Object.defineProperty(exports, "__esModule", {
1464
- value: true
1465
- });
1466
- var React = __webpack_require__(0);
1467
- var styled_components_1 = __webpack_require__(4);
1468
- var hocUtils_1 = __webpack_require__(15);
1469
- var Cover = styled_components_1.default.div.withConfig({
1470
- displayName: "withEditModeCover__Cover",
1471
- componentId: "sc-1gsbnxb-0"
1472
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1473
- var Blocker = styled_components_1.default.div.attrs({
1474
- 'data-splunk-visualization-version': "25.8.1 - 742d5fb96"
1475
- }).withConfig({
1476
- displayName: "withEditModeCover__Blocker",
1477
- componentId: "sc-1gsbnxb-1"
1478
- })(["position:relative;width:100%;height:100%;"]);
1479
- /**
1480
- * HOC that renders a cover layer in edit mode
1481
- * @method withEditModeCover
1482
- * @param {ExtendedDashViz} Visualization
1483
- * @returns {ExtendedDashViz} Wrapper
1484
- */
1485
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1486
- var Wrapper = function Wrapper(props) {
1487
- var mode = props.mode;
1488
- var showEditCover = mode === 'edit' && !disableEditModeCover;
1489
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1490
- "data-test": "edit-mode-cover"
1491
- }));
1492
- };
1493
- hocUtils_1.extendStaticWrapperProps({
1494
- Wrapper: Wrapper,
1495
- Visualization: Visualization
1496
- });
1497
- return Wrapper;
1498
- };
1499
- exports.default = withEditModeCover;
1500
-
1501
- /***/ }),
1502
-
1503
- /***/ 460:
1471
+ /***/ 458:
1504
1472
  /***/ (function(module, exports, __webpack_require__) {
1505
1473
 
1506
1474
  "use strict";
@@ -1538,7 +1506,7 @@ Object.defineProperty(exports, "default", {
1538
1506
 
1539
1507
  /***/ }),
1540
1508
 
1541
- /***/ 461:
1509
+ /***/ 459:
1542
1510
  /***/ (function(module, exports, __webpack_require__) {
1543
1511
 
1544
1512
  "use strict";
@@ -1942,7 +1910,53 @@ exports.default = configUtils_1.enhanceConfig(config);
1942
1910
 
1943
1911
  /***/ }),
1944
1912
 
1945
- /***/ 462:
1913
+ /***/ 46:
1914
+ /***/ (function(module, exports, __webpack_require__) {
1915
+
1916
+ "use strict";
1917
+
1918
+
1919
+ Object.defineProperty(exports, "__esModule", {
1920
+ value: true
1921
+ });
1922
+ var React = __webpack_require__(0);
1923
+ var styled_components_1 = __webpack_require__(4);
1924
+ var hocUtils_1 = __webpack_require__(15);
1925
+ var Cover = styled_components_1.default.div.withConfig({
1926
+ displayName: "withEditModeCover__Cover",
1927
+ componentId: "sc-1gsbnxb-0"
1928
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1929
+ var Blocker = styled_components_1.default.div.attrs({
1930
+ 'data-splunk-visualization-version': "25.9.1 - 5ba41e723"
1931
+ }).withConfig({
1932
+ displayName: "withEditModeCover__Blocker",
1933
+ componentId: "sc-1gsbnxb-1"
1934
+ })(["position:relative;width:100%;height:100%;"]);
1935
+ /**
1936
+ * HOC that renders a cover layer in edit mode
1937
+ * @method withEditModeCover
1938
+ * @param {ExtendedDashViz} Visualization
1939
+ * @returns {ExtendedDashViz} Wrapper
1940
+ */
1941
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1942
+ var Wrapper = function Wrapper(props) {
1943
+ var mode = props.mode;
1944
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
1945
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
1946
+ "data-test": "edit-mode-cover"
1947
+ }));
1948
+ };
1949
+ hocUtils_1.extendStaticWrapperProps({
1950
+ Wrapper: Wrapper,
1951
+ Visualization: Visualization
1952
+ });
1953
+ return Wrapper;
1954
+ };
1955
+ exports.default = withEditModeCover;
1956
+
1957
+ /***/ }),
1958
+
1959
+ /***/ 460:
1946
1960
  /***/ (function(module, exports, __webpack_require__) {
1947
1961
 
1948
1962
  "use strict";
@@ -2653,7 +2667,9 @@ var Charting = function Charting(props) {
2653
2667
  chart.current.prepareAndDraw(chartData, updatedOptions, function () {});
2654
2668
  }
2655
2669
  if (chart.current) {
2656
- chart.current.resize(computedWidth, computedHeight);
2670
+ if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
2671
+ chart.current.resize(computedWidth, computedHeight);
2672
+ }
2657
2673
  }
2658
2674
  needsInit.current = false;
2659
2675
  needsRedraw.current = false;