@splunk/visualizations 24.3.2 → 24.3.3

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 (64) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_Tooltip_Dark.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_bubble_layer_geostats_by.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
  6. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  7. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Additional_Cases.png +0 -0
  8. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
  9. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
  10. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
  11. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
  12. package/Area.js +121 -65
  13. package/Area.js.map +1 -1
  14. package/Bar.js +121 -65
  15. package/Bar.js.map +1 -1
  16. package/Bubble.js +121 -65
  17. package/Bubble.js.map +1 -1
  18. package/ChoroplethSvg.js +142 -73
  19. package/ChoroplethSvg.js.map +1 -1
  20. package/Column.js +121 -65
  21. package/Column.js.map +1 -1
  22. package/Ellipse.js +121 -65
  23. package/Ellipse.js.map +1 -1
  24. package/FillerGauge.js +121 -65
  25. package/FillerGauge.js.map +1 -1
  26. package/Image.js +125 -69
  27. package/Image.js.map +1 -1
  28. package/Line.js +121 -65
  29. package/Line.js.map +1 -1
  30. package/LinkGraph.js +121 -65
  31. package/LinkGraph.js.map +1 -1
  32. package/Map.config.js +16 -6
  33. package/Map.config.js.map +1 -1
  34. package/Map.js +430 -126
  35. package/Map.js.map +1 -1
  36. package/Markdown.js +131 -75
  37. package/Markdown.js.map +1 -1
  38. package/MarkerGauge.js +135 -79
  39. package/MarkerGauge.js.map +1 -1
  40. package/ParallelCoordinates.js +140 -83
  41. package/ParallelCoordinates.js.map +1 -1
  42. package/Pie.js +133 -77
  43. package/Pie.js.map +1 -1
  44. package/Punchcard.js +144 -87
  45. package/Punchcard.js.map +1 -1
  46. package/Rectangle.js +129 -73
  47. package/Rectangle.js.map +1 -1
  48. package/Sankey.js +204 -148
  49. package/Sankey.js.map +1 -1
  50. package/Scatter.js +131 -75
  51. package/Scatter.js.map +1 -1
  52. package/SingleValue.js +160 -104
  53. package/SingleValue.js.map +1 -1
  54. package/SingleValueIcon.js +135 -78
  55. package/SingleValueIcon.js.map +1 -1
  56. package/SingleValueRadial.js +202 -146
  57. package/SingleValueRadial.js.map +1 -1
  58. package/Table.js +236 -180
  59. package/Table.js.map +1 -1
  60. package/common/utils/hocUtils.js +65 -9
  61. package/common/utils/hocUtils.js.map +1 -1
  62. package/common/withDashboardViz.js +68 -12
  63. package/common/withDashboardViz.js.map +1 -1
  64. package/package.json +9 -9
package/Markdown.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 = 200);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 201);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -195,7 +195,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
195
195
 
196
196
  return React.createElement(FixSizeItem, {
197
197
  "data-test": "fix-size-item",
198
- "data-splunk-visualization-version": "24.3.2 - 1cf892b72",
198
+ "data-splunk-visualization-version": "24.3.3 - 8d441d88c",
199
199
  width: width,
200
200
  height: height,
201
201
  backgroundColor: backgroundColor
@@ -234,17 +234,17 @@ var React = __webpack_require__(1);
234
234
 
235
235
  var style_1 = __webpack_require__(13);
236
236
 
237
- var Markdown_1 = __webpack_require__(201);
237
+ var Markdown_1 = __webpack_require__(202);
238
238
 
239
239
  var styled_components_1 = __webpack_require__(4);
240
240
 
241
241
  var T = __webpack_require__(0);
242
242
 
243
- var config_1 = __webpack_require__(202);
243
+ var config_1 = __webpack_require__(203);
244
244
 
245
245
  exports.config = config_1.default;
246
246
 
247
- var withDashboardViz_1 = __webpack_require__(27); // startsWithHeader is a prop that can be
247
+ var withDashboardViz_1 = __webpack_require__(28); // startsWithHeader is a prop that can be
248
248
  // falsy if the markdown text begins with text
249
249
  // or the number of heading level;
250
250
  // casting heading level below 4 to 4
@@ -359,7 +359,7 @@ module.exports = require("@babel/runtime/helpers/typeof");
359
359
 
360
360
  /***/ }),
361
361
 
362
- /***/ 200:
362
+ /***/ 201:
363
363
  /***/ (function(module, exports, __webpack_require__) {
364
364
 
365
365
  "use strict";
@@ -402,14 +402,14 @@ Object.defineProperty(exports, "default", {
402
402
 
403
403
  /***/ }),
404
404
 
405
- /***/ 201:
405
+ /***/ 202:
406
406
  /***/ (function(module, exports) {
407
407
 
408
408
  module.exports = require("@splunk/react-ui/Markdown");
409
409
 
410
410
  /***/ }),
411
411
 
412
- /***/ 202:
412
+ /***/ 203:
413
413
  /***/ (function(module, exports, __webpack_require__) {
414
414
 
415
415
  "use strict";
@@ -429,7 +429,7 @@ var schemaUtils_1 = __webpack_require__(14);
429
429
 
430
430
  var VizBehavior_1 = __webpack_require__(5);
431
431
 
432
- var VizCategory_1 = __webpack_require__(26);
432
+ var VizCategory_1 = __webpack_require__(27);
433
433
 
434
434
  var configUtils_1 = __webpack_require__(6);
435
435
 
@@ -557,7 +557,7 @@ var T = __webpack_require__(0);
557
557
 
558
558
  var lodash_1 = __webpack_require__(2);
559
559
 
560
- var DataSource_1 = __webpack_require__(33);
560
+ var DataSource_1 = __webpack_require__(34);
561
561
 
562
562
  exports.SortParamsPropTypes = T.shape({
563
563
  currentSortKey: T.string,
@@ -682,6 +682,40 @@ exports.getPaginationParams = getPaginationParams;
682
682
  "use strict";
683
683
 
684
684
 
685
+ Object.defineProperty(exports, "__esModule", {
686
+ value: true
687
+ });
688
+ exports.pickFieldFromJSONSchema = void 0;
689
+
690
+ var lodash_1 = __webpack_require__(2);
691
+
692
+ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
693
+ var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
694
+ return Object.keys(optionsSchema).reduce(function (accum, k) {
695
+ if (lodash_1.has(optionsSchema[k], fieldName)) {
696
+ accum[k] = optionsSchema[k][fieldName];
697
+ } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
698
+ var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
699
+
700
+ if (!lodash_1.isEmpty(nestedSchema)) {
701
+ accum[k] = nestedSchema;
702
+ }
703
+ }
704
+
705
+ return accum;
706
+ }, {});
707
+ };
708
+
709
+ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
710
+
711
+ /***/ }),
712
+
713
+ /***/ 26:
714
+ /***/ (function(module, exports, __webpack_require__) {
715
+
716
+ "use strict";
717
+
718
+
685
719
  Object.defineProperty(exports, "__esModule", {
686
720
  value: true
687
721
  });
@@ -765,7 +799,7 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
765
799
 
766
800
  /***/ }),
767
801
 
768
- /***/ 26:
802
+ /***/ 27:
769
803
  /***/ (function(module, exports, __webpack_require__) {
770
804
 
771
805
  "use strict";
@@ -794,7 +828,7 @@ var VizCategory;
794
828
 
795
829
  /***/ }),
796
830
 
797
- /***/ 27:
831
+ /***/ 28:
798
832
  /***/ (function(module, exports, __webpack_require__) {
799
833
 
800
834
  "use strict";
@@ -808,15 +842,15 @@ var React = __webpack_require__(1);
808
842
 
809
843
  var lodash_1 = __webpack_require__(2);
810
844
 
811
- var getSettingsFromThemedProps_1 = __webpack_require__(28);
845
+ var getSettingsFromThemedProps_1 = __webpack_require__(29);
812
846
 
813
- var Options_1 = __webpack_require__(29);
847
+ var Options_1 = __webpack_require__(30);
814
848
 
815
- var SanitizeProps_1 = __webpack_require__(30);
849
+ var SanitizeProps_1 = __webpack_require__(31);
816
850
 
817
851
  var styled_components_1 = __webpack_require__(4);
818
852
 
819
- var SplunkVisualization_1 = __webpack_require__(31);
853
+ var SplunkVisualization_1 = __webpack_require__(32);
820
854
 
821
855
  var VizBehavior_1 = __webpack_require__(5);
822
856
 
@@ -824,9 +858,9 @@ var getSorting_1 = __webpack_require__(23);
824
858
 
825
859
  var getPagination_1 = __webpack_require__(24);
826
860
 
827
- var useDeepMemo_1 = __webpack_require__(34);
861
+ var useDeepMemo_1 = __webpack_require__(35);
828
862
 
829
- var JSONSchemaUtils_1 = __webpack_require__(35);
863
+ var JSONSchemaUtils_1 = __webpack_require__(25);
830
864
 
831
865
  var MissingPropsMessage_1 = __webpack_require__(36);
832
866
 
@@ -888,7 +922,7 @@ var withDashboardViz = function withDashboardViz(opts) {
888
922
  try {
889
923
  return Options_1.Options.evaluate({
890
924
  context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
891
- options: hocUtils_1.deepMergeWithArrayOverrides({}, options, defaultOptions)
925
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
892
926
  }, dataSources, themeFunc);
893
927
  } catch (e) {
894
928
  // eslint-disable-next-line no-console
@@ -1019,35 +1053,35 @@ exports.default = withDashboardViz;
1019
1053
 
1020
1054
  /***/ }),
1021
1055
 
1022
- /***/ 28:
1056
+ /***/ 29:
1023
1057
  /***/ (function(module, exports) {
1024
1058
 
1025
1059
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1026
1060
 
1027
1061
  /***/ }),
1028
1062
 
1029
- /***/ 29:
1063
+ /***/ 3:
1030
1064
  /***/ (function(module, exports) {
1031
1065
 
1032
- module.exports = require("@splunk/visualization-encoding/Options");
1066
+ module.exports = require("@splunk/ui-utils/i18n");
1033
1067
 
1034
1068
  /***/ }),
1035
1069
 
1036
- /***/ 3:
1070
+ /***/ 30:
1037
1071
  /***/ (function(module, exports) {
1038
1072
 
1039
- module.exports = require("@splunk/ui-utils/i18n");
1073
+ module.exports = require("@splunk/visualization-encoding/Options");
1040
1074
 
1041
1075
  /***/ }),
1042
1076
 
1043
- /***/ 30:
1077
+ /***/ 31:
1044
1078
  /***/ (function(module, exports) {
1045
1079
 
1046
1080
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1047
1081
 
1048
1082
  /***/ }),
1049
1083
 
1050
- /***/ 31:
1084
+ /***/ 32:
1051
1085
  /***/ (function(module, exports, __webpack_require__) {
1052
1086
 
1053
1087
  "use strict";
@@ -1065,7 +1099,7 @@ var T = __webpack_require__(0);
1065
1099
 
1066
1100
  var lodash_1 = __webpack_require__(2);
1067
1101
 
1068
- var VizActionHandler_1 = __webpack_require__(32); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1102
+ var VizActionHandler_1 = __webpack_require__(33); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1069
1103
 
1070
1104
 
1071
1105
  exports.INITIAL_WIDTH = 250;
@@ -1199,7 +1233,7 @@ exports.default = SplunkVisualization;
1199
1233
 
1200
1234
  /***/ }),
1201
1235
 
1202
- /***/ 32:
1236
+ /***/ 33:
1203
1237
  /***/ (function(module, exports, __webpack_require__) {
1204
1238
 
1205
1239
  "use strict";
@@ -1237,7 +1271,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1237
1271
 
1238
1272
  /***/ }),
1239
1273
 
1240
- /***/ 33:
1274
+ /***/ 34:
1241
1275
  /***/ (function(module, exports, __webpack_require__) {
1242
1276
 
1243
1277
  "use strict";
@@ -1251,7 +1285,7 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
1251
1285
 
1252
1286
  /***/ }),
1253
1287
 
1254
- /***/ 34:
1288
+ /***/ 35:
1255
1289
  /***/ (function(module, exports, __webpack_require__) {
1256
1290
 
1257
1291
  "use strict";
@@ -1297,40 +1331,6 @@ exports.useDeepMemo = useDeepMemo;
1297
1331
 
1298
1332
  /***/ }),
1299
1333
 
1300
- /***/ 35:
1301
- /***/ (function(module, exports, __webpack_require__) {
1302
-
1303
- "use strict";
1304
-
1305
-
1306
- Object.defineProperty(exports, "__esModule", {
1307
- value: true
1308
- });
1309
- exports.pickFieldFromJSONSchema = void 0;
1310
-
1311
- var lodash_1 = __webpack_require__(2);
1312
-
1313
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
1314
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1315
- return Object.keys(optionsSchema).reduce(function (accum, k) {
1316
- if (lodash_1.has(optionsSchema[k], fieldName)) {
1317
- accum[k] = optionsSchema[k][fieldName];
1318
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
1319
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
1320
-
1321
- if (!lodash_1.isEmpty(nestedSchema)) {
1322
- accum[k] = nestedSchema;
1323
- }
1324
- }
1325
-
1326
- return accum;
1327
- }, {});
1328
- };
1329
-
1330
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
1331
-
1332
- /***/ }),
1333
-
1334
1334
  /***/ 36:
1335
1335
  /***/ (function(module, exports, __webpack_require__) {
1336
1336
 
@@ -1433,7 +1433,7 @@ var Cover = styled_components_1.default.div.withConfig({
1433
1433
  componentId: "sc-1gsbnxb-0"
1434
1434
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1435
1435
  var Blocker = styled_components_1.default.div.attrs({
1436
- 'data-splunk-visualization-version': "24.3.2 - 1cf892b72"
1436
+ 'data-splunk-visualization-version': "24.3.3 - 8d441d88c"
1437
1437
  }).withConfig({
1438
1438
  displayName: "withEditModeCover__Blocker",
1439
1439
  componentId: "sc-1gsbnxb-1"
@@ -1479,7 +1479,7 @@ var React = __webpack_require__(1);
1479
1479
 
1480
1480
  var colorUtils_1 = __webpack_require__(11);
1481
1481
 
1482
- var IconPlaceholder_1 = __webpack_require__(25);
1482
+ var IconPlaceholder_1 = __webpack_require__(26);
1483
1483
 
1484
1484
  var VizBehavior_1 = __webpack_require__(5);
1485
1485
 
@@ -1811,7 +1811,7 @@ var _typeof = __webpack_require__(20);
1811
1811
  Object.defineProperty(exports, "__esModule", {
1812
1812
  value: true
1813
1813
  });
1814
- exports.deepMergeWithArrayOverrides = exports.extendStaticWrapperProps = void 0;
1814
+ exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
1815
1815
 
1816
1816
  var lodash_1 = __webpack_require__(2);
1817
1817
  /**
@@ -1837,17 +1837,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
1837
1837
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
1838
1838
  /**
1839
1839
  * helper to deeply merge objects while preserving arrays in earlier source objects
1840
- * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays will be preserved if already present in the resultant merged object
1841
- * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
1840
+ * deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
1841
+ * this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
1842
+ * Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
1843
+ * will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
1842
1844
  *
1843
- * @method deepMergeWithArrayOverrides
1845
+ * @method deepMergeWithArrayPrimitiveOverrides
1844
1846
  * @param {Object} initial - target object to merge values into
1845
1847
  * @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
1846
1848
  *
1847
1849
  * @returns {Object}
1848
1850
  */
1849
1851
 
1850
- var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial) {
1852
+ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
1851
1853
  var clone = lodash_1.cloneDeep(initial);
1852
1854
 
1853
1855
  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -1858,18 +1860,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
1858
1860
  Object.keys(sourceToApply).forEach(function (sourceKey) {
1859
1861
  if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
1860
1862
  clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
1861
- } // object merging excluding arrays
1862
-
1863
+ }
1863
1864
 
1864
1865
  if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
1865
- clone[sourceKey] = exports.deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);
1866
+ clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
1867
+ } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
1868
+ // If option is an array of objects
1869
+ for (var i = 0; i < clone[sourceKey].length; i += 1) {
1870
+ if (_typeof(clone[sourceKey][i]) === 'object') {
1871
+ var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
1872
+
1873
+ if (closestMatchIdx > -1) {
1874
+ clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
1875
+ }
1876
+ }
1877
+ }
1866
1878
  }
1867
1879
  });
1868
1880
  });
1869
1881
  return clone;
1870
1882
  };
1871
1883
 
1872
- exports.deepMergeWithArrayOverrides = deepMergeWithArrayOverrides;
1884
+ exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
1885
+ /**
1886
+ * Finds the closest matching object from the list, which has the max same key value pairs.
1887
+ * Returns the index of match if found, or -1
1888
+ * For eg :-
1889
+ const list = [{
1890
+ type: "marker",
1891
+ lat: "value1"
1892
+ }, {
1893
+ type: "bubble",
1894
+ size: "value2"
1895
+ }];
1896
+
1897
+ const obj = {
1898
+ type: 'bubble'
1899
+ };
1900
+
1901
+ findClosestMatch(list, obj) -> returns index 1.
1902
+ */
1903
+
1904
+ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
1905
+ if (!Array.isArray(searchList) || searchList.length === 0) {
1906
+ return -1;
1907
+ }
1908
+
1909
+ var keys = Object.keys(inputObj);
1910
+ var maxMatchCnt = 0;
1911
+ var maxMatchIdx = 0;
1912
+ searchList.forEach(function (item, idx) {
1913
+ var matchCnt = 0;
1914
+ keys.forEach(function (key) {
1915
+ if (item[key] === inputObj[key]) {
1916
+ matchCnt += 1;
1917
+ }
1918
+ });
1919
+
1920
+ if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
1921
+ maxMatchCnt = matchCnt;
1922
+ maxMatchIdx = idx;
1923
+ }
1924
+ });
1925
+ return maxMatchIdx;
1926
+ };
1927
+
1928
+ exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
1873
1929
 
1874
1930
  /***/ }),
1875
1931