@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/Rectangle.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 = 232);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 233);
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
@@ -249,9 +249,9 @@ var lodash_1 = __webpack_require__(2);
249
249
 
250
250
  var T = __webpack_require__(0);
251
251
 
252
- var withDashboardViz_1 = __webpack_require__(27);
252
+ var withDashboardViz_1 = __webpack_require__(28);
253
253
 
254
- var config_1 = __webpack_require__(233);
254
+ var config_1 = __webpack_require__(234);
255
255
 
256
256
  exports.config = config_1.default;
257
257
 
@@ -409,7 +409,7 @@ var T = __webpack_require__(0);
409
409
 
410
410
  var lodash_1 = __webpack_require__(2);
411
411
 
412
- var DataSource_1 = __webpack_require__(33);
412
+ var DataSource_1 = __webpack_require__(34);
413
413
 
414
414
  exports.SortParamsPropTypes = T.shape({
415
415
  currentSortKey: T.string,
@@ -463,7 +463,7 @@ exports.getSortingParams = getSortingParams;
463
463
 
464
464
  /***/ }),
465
465
 
466
- /***/ 232:
466
+ /***/ 233:
467
467
  /***/ (function(module, exports, __webpack_require__) {
468
468
 
469
469
  "use strict";
@@ -506,7 +506,7 @@ Object.defineProperty(exports, "default", {
506
506
 
507
507
  /***/ }),
508
508
 
509
- /***/ 233:
509
+ /***/ 234:
510
510
  /***/ (function(module, exports, __webpack_require__) {
511
511
 
512
512
  "use strict";
@@ -529,7 +529,7 @@ var themes_1 = __webpack_require__(70);
529
529
 
530
530
  var VizBehavior_1 = __webpack_require__(5);
531
531
 
532
- var VizCategory_1 = __webpack_require__(26);
532
+ var VizCategory_1 = __webpack_require__(27);
533
533
 
534
534
  var configUtils_1 = __webpack_require__(6);
535
535
 
@@ -926,6 +926,40 @@ exports.getPaginationParams = getPaginationParams;
926
926
  "use strict";
927
927
 
928
928
 
929
+ Object.defineProperty(exports, "__esModule", {
930
+ value: true
931
+ });
932
+ exports.pickFieldFromJSONSchema = void 0;
933
+
934
+ var lodash_1 = __webpack_require__(2);
935
+
936
+ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
937
+ var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
938
+ return Object.keys(optionsSchema).reduce(function (accum, k) {
939
+ if (lodash_1.has(optionsSchema[k], fieldName)) {
940
+ accum[k] = optionsSchema[k][fieldName];
941
+ } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
942
+ var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
943
+
944
+ if (!lodash_1.isEmpty(nestedSchema)) {
945
+ accum[k] = nestedSchema;
946
+ }
947
+ }
948
+
949
+ return accum;
950
+ }, {});
951
+ };
952
+
953
+ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
954
+
955
+ /***/ }),
956
+
957
+ /***/ 26:
958
+ /***/ (function(module, exports, __webpack_require__) {
959
+
960
+ "use strict";
961
+
962
+
929
963
  Object.defineProperty(exports, "__esModule", {
930
964
  value: true
931
965
  });
@@ -1009,7 +1043,7 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1009
1043
 
1010
1044
  /***/ }),
1011
1045
 
1012
- /***/ 26:
1046
+ /***/ 27:
1013
1047
  /***/ (function(module, exports, __webpack_require__) {
1014
1048
 
1015
1049
  "use strict";
@@ -1038,7 +1072,7 @@ var VizCategory;
1038
1072
 
1039
1073
  /***/ }),
1040
1074
 
1041
- /***/ 27:
1075
+ /***/ 28:
1042
1076
  /***/ (function(module, exports, __webpack_require__) {
1043
1077
 
1044
1078
  "use strict";
@@ -1052,15 +1086,15 @@ var React = __webpack_require__(1);
1052
1086
 
1053
1087
  var lodash_1 = __webpack_require__(2);
1054
1088
 
1055
- var getSettingsFromThemedProps_1 = __webpack_require__(28);
1089
+ var getSettingsFromThemedProps_1 = __webpack_require__(29);
1056
1090
 
1057
- var Options_1 = __webpack_require__(29);
1091
+ var Options_1 = __webpack_require__(30);
1058
1092
 
1059
- var SanitizeProps_1 = __webpack_require__(30);
1093
+ var SanitizeProps_1 = __webpack_require__(31);
1060
1094
 
1061
1095
  var styled_components_1 = __webpack_require__(4);
1062
1096
 
1063
- var SplunkVisualization_1 = __webpack_require__(31);
1097
+ var SplunkVisualization_1 = __webpack_require__(32);
1064
1098
 
1065
1099
  var VizBehavior_1 = __webpack_require__(5);
1066
1100
 
@@ -1068,9 +1102,9 @@ var getSorting_1 = __webpack_require__(23);
1068
1102
 
1069
1103
  var getPagination_1 = __webpack_require__(24);
1070
1104
 
1071
- var useDeepMemo_1 = __webpack_require__(34);
1105
+ var useDeepMemo_1 = __webpack_require__(35);
1072
1106
 
1073
- var JSONSchemaUtils_1 = __webpack_require__(35);
1107
+ var JSONSchemaUtils_1 = __webpack_require__(25);
1074
1108
 
1075
1109
  var MissingPropsMessage_1 = __webpack_require__(36);
1076
1110
 
@@ -1132,7 +1166,7 @@ var withDashboardViz = function withDashboardViz(opts) {
1132
1166
  try {
1133
1167
  return Options_1.Options.evaluate({
1134
1168
  context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1135
- options: hocUtils_1.deepMergeWithArrayOverrides({}, options, defaultOptions)
1169
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1136
1170
  }, dataSources, themeFunc);
1137
1171
  } catch (e) {
1138
1172
  // eslint-disable-next-line no-console
@@ -1263,35 +1297,35 @@ exports.default = withDashboardViz;
1263
1297
 
1264
1298
  /***/ }),
1265
1299
 
1266
- /***/ 28:
1300
+ /***/ 29:
1267
1301
  /***/ (function(module, exports) {
1268
1302
 
1269
1303
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1270
1304
 
1271
1305
  /***/ }),
1272
1306
 
1273
- /***/ 29:
1307
+ /***/ 3:
1274
1308
  /***/ (function(module, exports) {
1275
1309
 
1276
- module.exports = require("@splunk/visualization-encoding/Options");
1310
+ module.exports = require("@splunk/ui-utils/i18n");
1277
1311
 
1278
1312
  /***/ }),
1279
1313
 
1280
- /***/ 3:
1314
+ /***/ 30:
1281
1315
  /***/ (function(module, exports) {
1282
1316
 
1283
- module.exports = require("@splunk/ui-utils/i18n");
1317
+ module.exports = require("@splunk/visualization-encoding/Options");
1284
1318
 
1285
1319
  /***/ }),
1286
1320
 
1287
- /***/ 30:
1321
+ /***/ 31:
1288
1322
  /***/ (function(module, exports) {
1289
1323
 
1290
1324
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1291
1325
 
1292
1326
  /***/ }),
1293
1327
 
1294
- /***/ 31:
1328
+ /***/ 32:
1295
1329
  /***/ (function(module, exports, __webpack_require__) {
1296
1330
 
1297
1331
  "use strict";
@@ -1309,7 +1343,7 @@ var T = __webpack_require__(0);
1309
1343
 
1310
1344
  var lodash_1 = __webpack_require__(2);
1311
1345
 
1312
- var VizActionHandler_1 = __webpack_require__(32); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1346
+ var VizActionHandler_1 = __webpack_require__(33); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1313
1347
 
1314
1348
 
1315
1349
  exports.INITIAL_WIDTH = 250;
@@ -1443,7 +1477,7 @@ exports.default = SplunkVisualization;
1443
1477
 
1444
1478
  /***/ }),
1445
1479
 
1446
- /***/ 32:
1480
+ /***/ 33:
1447
1481
  /***/ (function(module, exports, __webpack_require__) {
1448
1482
 
1449
1483
  "use strict";
@@ -1481,7 +1515,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1481
1515
 
1482
1516
  /***/ }),
1483
1517
 
1484
- /***/ 33:
1518
+ /***/ 34:
1485
1519
  /***/ (function(module, exports, __webpack_require__) {
1486
1520
 
1487
1521
  "use strict";
@@ -1495,7 +1529,7 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
1495
1529
 
1496
1530
  /***/ }),
1497
1531
 
1498
- /***/ 34:
1532
+ /***/ 35:
1499
1533
  /***/ (function(module, exports, __webpack_require__) {
1500
1534
 
1501
1535
  "use strict";
@@ -1541,40 +1575,6 @@ exports.useDeepMemo = useDeepMemo;
1541
1575
 
1542
1576
  /***/ }),
1543
1577
 
1544
- /***/ 35:
1545
- /***/ (function(module, exports, __webpack_require__) {
1546
-
1547
- "use strict";
1548
-
1549
-
1550
- Object.defineProperty(exports, "__esModule", {
1551
- value: true
1552
- });
1553
- exports.pickFieldFromJSONSchema = void 0;
1554
-
1555
- var lodash_1 = __webpack_require__(2);
1556
-
1557
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
1558
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1559
- return Object.keys(optionsSchema).reduce(function (accum, k) {
1560
- if (lodash_1.has(optionsSchema[k], fieldName)) {
1561
- accum[k] = optionsSchema[k][fieldName];
1562
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
1563
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
1564
-
1565
- if (!lodash_1.isEmpty(nestedSchema)) {
1566
- accum[k] = nestedSchema;
1567
- }
1568
- }
1569
-
1570
- return accum;
1571
- }, {});
1572
- };
1573
-
1574
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
1575
-
1576
- /***/ }),
1577
-
1578
1578
  /***/ 36:
1579
1579
  /***/ (function(module, exports, __webpack_require__) {
1580
1580
 
@@ -1677,7 +1677,7 @@ var Cover = styled_components_1.default.div.withConfig({
1677
1677
  componentId: "sc-1gsbnxb-0"
1678
1678
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1679
1679
  var Blocker = styled_components_1.default.div.attrs({
1680
- 'data-splunk-visualization-version': "24.3.2 - 1cf892b72"
1680
+ 'data-splunk-visualization-version': "24.3.3 - 8d441d88c"
1681
1681
  }).withConfig({
1682
1682
  displayName: "withEditModeCover__Blocker",
1683
1683
  componentId: "sc-1gsbnxb-1"
@@ -1723,7 +1723,7 @@ var React = __webpack_require__(1);
1723
1723
 
1724
1724
  var colorUtils_1 = __webpack_require__(11);
1725
1725
 
1726
- var IconPlaceholder_1 = __webpack_require__(25);
1726
+ var IconPlaceholder_1 = __webpack_require__(26);
1727
1727
 
1728
1728
  var VizBehavior_1 = __webpack_require__(5);
1729
1729
 
@@ -2031,7 +2031,7 @@ var _typeof = __webpack_require__(20);
2031
2031
  Object.defineProperty(exports, "__esModule", {
2032
2032
  value: true
2033
2033
  });
2034
- exports.deepMergeWithArrayOverrides = exports.extendStaticWrapperProps = void 0;
2034
+ exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
2035
2035
 
2036
2036
  var lodash_1 = __webpack_require__(2);
2037
2037
  /**
@@ -2057,17 +2057,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
2057
2057
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
2058
2058
  /**
2059
2059
  * helper to deeply merge objects while preserving arrays in earlier source objects
2060
- * 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
2061
- * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
2060
+ * 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
2061
+ * 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).
2062
+ * 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
2063
+ * 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.
2062
2064
  *
2063
- * @method deepMergeWithArrayOverrides
2065
+ * @method deepMergeWithArrayPrimitiveOverrides
2064
2066
  * @param {Object} initial - target object to merge values into
2065
2067
  * @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
2066
2068
  *
2067
2069
  * @returns {Object}
2068
2070
  */
2069
2071
 
2070
- var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial) {
2072
+ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
2071
2073
  var clone = lodash_1.cloneDeep(initial);
2072
2074
 
2073
2075
  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -2078,18 +2080,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
2078
2080
  Object.keys(sourceToApply).forEach(function (sourceKey) {
2079
2081
  if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
2080
2082
  clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
2081
- } // object merging excluding arrays
2082
-
2083
+ }
2083
2084
 
2084
2085
  if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
2085
- clone[sourceKey] = exports.deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);
2086
+ clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
2087
+ } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
2088
+ // If option is an array of objects
2089
+ for (var i = 0; i < clone[sourceKey].length; i += 1) {
2090
+ if (_typeof(clone[sourceKey][i]) === 'object') {
2091
+ var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
2092
+
2093
+ if (closestMatchIdx > -1) {
2094
+ clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
2095
+ }
2096
+ }
2097
+ }
2086
2098
  }
2087
2099
  });
2088
2100
  });
2089
2101
  return clone;
2090
2102
  };
2091
2103
 
2092
- exports.deepMergeWithArrayOverrides = deepMergeWithArrayOverrides;
2104
+ exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
2105
+ /**
2106
+ * Finds the closest matching object from the list, which has the max same key value pairs.
2107
+ * Returns the index of match if found, or -1
2108
+ * For eg :-
2109
+ const list = [{
2110
+ type: "marker",
2111
+ lat: "value1"
2112
+ }, {
2113
+ type: "bubble",
2114
+ size: "value2"
2115
+ }];
2116
+
2117
+ const obj = {
2118
+ type: 'bubble'
2119
+ };
2120
+
2121
+ findClosestMatch(list, obj) -> returns index 1.
2122
+ */
2123
+
2124
+ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
2125
+ if (!Array.isArray(searchList) || searchList.length === 0) {
2126
+ return -1;
2127
+ }
2128
+
2129
+ var keys = Object.keys(inputObj);
2130
+ var maxMatchCnt = 0;
2131
+ var maxMatchIdx = 0;
2132
+ searchList.forEach(function (item, idx) {
2133
+ var matchCnt = 0;
2134
+ keys.forEach(function (key) {
2135
+ if (item[key] === inputObj[key]) {
2136
+ matchCnt += 1;
2137
+ }
2138
+ });
2139
+
2140
+ if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
2141
+ maxMatchCnt = matchCnt;
2142
+ maxMatchIdx = idx;
2143
+ }
2144
+ });
2145
+ return maxMatchIdx;
2146
+ };
2147
+
2148
+ exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
2093
2149
 
2094
2150
  /***/ }),
2095
2151