@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/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 = 241);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 242);
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
@@ -258,13 +258,13 @@ var charting_bundle_1 = __webpack_require__(47);
258
258
 
259
259
  var simpleXMLOptions_1 = __webpack_require__(58);
260
260
 
261
- var config_1 = __webpack_require__(242);
261
+ var config_1 = __webpack_require__(243);
262
262
 
263
263
  exports.config = config_1.default;
264
264
 
265
- var withDashboardViz_1 = __webpack_require__(27);
265
+ var withDashboardViz_1 = __webpack_require__(28);
266
266
 
267
- var scatterUtils_1 = __webpack_require__(243);
267
+ var scatterUtils_1 = __webpack_require__(244);
268
268
 
269
269
  var chartingUtils_1 = __webpack_require__(46);
270
270
 
@@ -415,7 +415,7 @@ var T = __webpack_require__(0);
415
415
 
416
416
  var lodash_1 = __webpack_require__(2);
417
417
 
418
- var DataSource_1 = __webpack_require__(33);
418
+ var DataSource_1 = __webpack_require__(34);
419
419
 
420
420
  exports.SortParamsPropTypes = T.shape({
421
421
  currentSortKey: T.string,
@@ -534,7 +534,7 @@ exports.getPaginationParams = getPaginationParams;
534
534
 
535
535
  /***/ }),
536
536
 
537
- /***/ 241:
537
+ /***/ 242:
538
538
  /***/ (function(module, exports, __webpack_require__) {
539
539
 
540
540
  "use strict";
@@ -577,7 +577,7 @@ Object.defineProperty(exports, "default", {
577
577
 
578
578
  /***/ }),
579
579
 
580
- /***/ 242:
580
+ /***/ 243:
581
581
  /***/ (function(module, exports, __webpack_require__) {
582
582
 
583
583
  "use strict";
@@ -602,7 +602,7 @@ var i18n_1 = __webpack_require__(3);
602
602
 
603
603
  var VizBehavior_1 = __webpack_require__(5);
604
604
 
605
- var VizCategory_1 = __webpack_require__(26);
605
+ var VizCategory_1 = __webpack_require__(27);
606
606
 
607
607
  var configUtils_1 = __webpack_require__(6);
608
608
 
@@ -971,7 +971,7 @@ exports.default = configUtils_1.enhanceConfig(config);
971
971
 
972
972
  /***/ }),
973
973
 
974
- /***/ 243:
974
+ /***/ 244:
975
975
  /***/ (function(module, exports, __webpack_require__) {
976
976
 
977
977
  "use strict";
@@ -1086,6 +1086,40 @@ exports.convertToScatterSCProperties = convertToScatterSCProperties;
1086
1086
  "use strict";
1087
1087
 
1088
1088
 
1089
+ Object.defineProperty(exports, "__esModule", {
1090
+ value: true
1091
+ });
1092
+ exports.pickFieldFromJSONSchema = void 0;
1093
+
1094
+ var lodash_1 = __webpack_require__(2);
1095
+
1096
+ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
1097
+ var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1098
+ return Object.keys(optionsSchema).reduce(function (accum, k) {
1099
+ if (lodash_1.has(optionsSchema[k], fieldName)) {
1100
+ accum[k] = optionsSchema[k][fieldName];
1101
+ } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
1102
+ var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
1103
+
1104
+ if (!lodash_1.isEmpty(nestedSchema)) {
1105
+ accum[k] = nestedSchema;
1106
+ }
1107
+ }
1108
+
1109
+ return accum;
1110
+ }, {});
1111
+ };
1112
+
1113
+ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
1114
+
1115
+ /***/ }),
1116
+
1117
+ /***/ 26:
1118
+ /***/ (function(module, exports, __webpack_require__) {
1119
+
1120
+ "use strict";
1121
+
1122
+
1089
1123
  Object.defineProperty(exports, "__esModule", {
1090
1124
  value: true
1091
1125
  });
@@ -1169,7 +1203,7 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1169
1203
 
1170
1204
  /***/ }),
1171
1205
 
1172
- /***/ 26:
1206
+ /***/ 27:
1173
1207
  /***/ (function(module, exports, __webpack_require__) {
1174
1208
 
1175
1209
  "use strict";
@@ -1198,7 +1232,7 @@ var VizCategory;
1198
1232
 
1199
1233
  /***/ }),
1200
1234
 
1201
- /***/ 27:
1235
+ /***/ 28:
1202
1236
  /***/ (function(module, exports, __webpack_require__) {
1203
1237
 
1204
1238
  "use strict";
@@ -1212,15 +1246,15 @@ var React = __webpack_require__(1);
1212
1246
 
1213
1247
  var lodash_1 = __webpack_require__(2);
1214
1248
 
1215
- var getSettingsFromThemedProps_1 = __webpack_require__(28);
1249
+ var getSettingsFromThemedProps_1 = __webpack_require__(29);
1216
1250
 
1217
- var Options_1 = __webpack_require__(29);
1251
+ var Options_1 = __webpack_require__(30);
1218
1252
 
1219
- var SanitizeProps_1 = __webpack_require__(30);
1253
+ var SanitizeProps_1 = __webpack_require__(31);
1220
1254
 
1221
1255
  var styled_components_1 = __webpack_require__(4);
1222
1256
 
1223
- var SplunkVisualization_1 = __webpack_require__(31);
1257
+ var SplunkVisualization_1 = __webpack_require__(32);
1224
1258
 
1225
1259
  var VizBehavior_1 = __webpack_require__(5);
1226
1260
 
@@ -1228,9 +1262,9 @@ var getSorting_1 = __webpack_require__(23);
1228
1262
 
1229
1263
  var getPagination_1 = __webpack_require__(24);
1230
1264
 
1231
- var useDeepMemo_1 = __webpack_require__(34);
1265
+ var useDeepMemo_1 = __webpack_require__(35);
1232
1266
 
1233
- var JSONSchemaUtils_1 = __webpack_require__(35);
1267
+ var JSONSchemaUtils_1 = __webpack_require__(25);
1234
1268
 
1235
1269
  var MissingPropsMessage_1 = __webpack_require__(36);
1236
1270
 
@@ -1292,7 +1326,7 @@ var withDashboardViz = function withDashboardViz(opts) {
1292
1326
  try {
1293
1327
  return Options_1.Options.evaluate({
1294
1328
  context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1295
- options: hocUtils_1.deepMergeWithArrayOverrides({}, options, defaultOptions)
1329
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1296
1330
  }, dataSources, themeFunc);
1297
1331
  } catch (e) {
1298
1332
  // eslint-disable-next-line no-console
@@ -1423,35 +1457,35 @@ exports.default = withDashboardViz;
1423
1457
 
1424
1458
  /***/ }),
1425
1459
 
1426
- /***/ 28:
1460
+ /***/ 29:
1427
1461
  /***/ (function(module, exports) {
1428
1462
 
1429
1463
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1430
1464
 
1431
1465
  /***/ }),
1432
1466
 
1433
- /***/ 29:
1467
+ /***/ 3:
1434
1468
  /***/ (function(module, exports) {
1435
1469
 
1436
- module.exports = require("@splunk/visualization-encoding/Options");
1470
+ module.exports = require("@splunk/ui-utils/i18n");
1437
1471
 
1438
1472
  /***/ }),
1439
1473
 
1440
- /***/ 3:
1474
+ /***/ 30:
1441
1475
  /***/ (function(module, exports) {
1442
1476
 
1443
- module.exports = require("@splunk/ui-utils/i18n");
1477
+ module.exports = require("@splunk/visualization-encoding/Options");
1444
1478
 
1445
1479
  /***/ }),
1446
1480
 
1447
- /***/ 30:
1481
+ /***/ 31:
1448
1482
  /***/ (function(module, exports) {
1449
1483
 
1450
1484
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1451
1485
 
1452
1486
  /***/ }),
1453
1487
 
1454
- /***/ 31:
1488
+ /***/ 32:
1455
1489
  /***/ (function(module, exports, __webpack_require__) {
1456
1490
 
1457
1491
  "use strict";
@@ -1469,7 +1503,7 @@ var T = __webpack_require__(0);
1469
1503
 
1470
1504
  var lodash_1 = __webpack_require__(2);
1471
1505
 
1472
- var VizActionHandler_1 = __webpack_require__(32); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1506
+ var VizActionHandler_1 = __webpack_require__(33); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1473
1507
 
1474
1508
 
1475
1509
  exports.INITIAL_WIDTH = 250;
@@ -1603,7 +1637,7 @@ exports.default = SplunkVisualization;
1603
1637
 
1604
1638
  /***/ }),
1605
1639
 
1606
- /***/ 32:
1640
+ /***/ 33:
1607
1641
  /***/ (function(module, exports, __webpack_require__) {
1608
1642
 
1609
1643
  "use strict";
@@ -1641,7 +1675,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1641
1675
 
1642
1676
  /***/ }),
1643
1677
 
1644
- /***/ 33:
1678
+ /***/ 34:
1645
1679
  /***/ (function(module, exports, __webpack_require__) {
1646
1680
 
1647
1681
  "use strict";
@@ -1655,7 +1689,7 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
1655
1689
 
1656
1690
  /***/ }),
1657
1691
 
1658
- /***/ 34:
1692
+ /***/ 35:
1659
1693
  /***/ (function(module, exports, __webpack_require__) {
1660
1694
 
1661
1695
  "use strict";
@@ -1701,40 +1735,6 @@ exports.useDeepMemo = useDeepMemo;
1701
1735
 
1702
1736
  /***/ }),
1703
1737
 
1704
- /***/ 35:
1705
- /***/ (function(module, exports, __webpack_require__) {
1706
-
1707
- "use strict";
1708
-
1709
-
1710
- Object.defineProperty(exports, "__esModule", {
1711
- value: true
1712
- });
1713
- exports.pickFieldFromJSONSchema = void 0;
1714
-
1715
- var lodash_1 = __webpack_require__(2);
1716
-
1717
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
1718
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1719
- return Object.keys(optionsSchema).reduce(function (accum, k) {
1720
- if (lodash_1.has(optionsSchema[k], fieldName)) {
1721
- accum[k] = optionsSchema[k][fieldName];
1722
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
1723
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
1724
-
1725
- if (!lodash_1.isEmpty(nestedSchema)) {
1726
- accum[k] = nestedSchema;
1727
- }
1728
- }
1729
-
1730
- return accum;
1731
- }, {});
1732
- };
1733
-
1734
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
1735
-
1736
- /***/ }),
1737
-
1738
1738
  /***/ 36:
1739
1739
  /***/ (function(module, exports, __webpack_require__) {
1740
1740
 
@@ -1837,7 +1837,7 @@ var Cover = styled_components_1.default.div.withConfig({
1837
1837
  componentId: "sc-1gsbnxb-0"
1838
1838
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1839
1839
  var Blocker = styled_components_1.default.div.attrs({
1840
- 'data-splunk-visualization-version': "24.3.2 - 1cf892b72"
1840
+ 'data-splunk-visualization-version': "24.3.3 - 8d441d88c"
1841
1841
  }).withConfig({
1842
1842
  displayName: "withEditModeCover__Blocker",
1843
1843
  componentId: "sc-1gsbnxb-1"
@@ -1883,7 +1883,7 @@ var React = __webpack_require__(1);
1883
1883
 
1884
1884
  var colorUtils_1 = __webpack_require__(11);
1885
1885
 
1886
- var IconPlaceholder_1 = __webpack_require__(25);
1886
+ var IconPlaceholder_1 = __webpack_require__(26);
1887
1887
 
1888
1888
  var VizBehavior_1 = __webpack_require__(5);
1889
1889
 
@@ -3081,7 +3081,7 @@ var _typeof = __webpack_require__(20);
3081
3081
  Object.defineProperty(exports, "__esModule", {
3082
3082
  value: true
3083
3083
  });
3084
- exports.deepMergeWithArrayOverrides = exports.extendStaticWrapperProps = void 0;
3084
+ exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
3085
3085
 
3086
3086
  var lodash_1 = __webpack_require__(2);
3087
3087
  /**
@@ -3107,17 +3107,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
3107
3107
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
3108
3108
  /**
3109
3109
  * helper to deeply merge objects while preserving arrays in earlier source objects
3110
- * 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
3111
- * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
3110
+ * 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
3111
+ * 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).
3112
+ * 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
3113
+ * 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.
3112
3114
  *
3113
- * @method deepMergeWithArrayOverrides
3115
+ * @method deepMergeWithArrayPrimitiveOverrides
3114
3116
  * @param {Object} initial - target object to merge values into
3115
3117
  * @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
3116
3118
  *
3117
3119
  * @returns {Object}
3118
3120
  */
3119
3121
 
3120
- var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial) {
3122
+ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
3121
3123
  var clone = lodash_1.cloneDeep(initial);
3122
3124
 
3123
3125
  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -3128,18 +3130,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
3128
3130
  Object.keys(sourceToApply).forEach(function (sourceKey) {
3129
3131
  if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
3130
3132
  clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
3131
- } // object merging excluding arrays
3132
-
3133
+ }
3133
3134
 
3134
3135
  if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
3135
- clone[sourceKey] = exports.deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);
3136
+ clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
3137
+ } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
3138
+ // If option is an array of objects
3139
+ for (var i = 0; i < clone[sourceKey].length; i += 1) {
3140
+ if (_typeof(clone[sourceKey][i]) === 'object') {
3141
+ var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
3142
+
3143
+ if (closestMatchIdx > -1) {
3144
+ clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
3145
+ }
3146
+ }
3147
+ }
3136
3148
  }
3137
3149
  });
3138
3150
  });
3139
3151
  return clone;
3140
3152
  };
3141
3153
 
3142
- exports.deepMergeWithArrayOverrides = deepMergeWithArrayOverrides;
3154
+ exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
3155
+ /**
3156
+ * Finds the closest matching object from the list, which has the max same key value pairs.
3157
+ * Returns the index of match if found, or -1
3158
+ * For eg :-
3159
+ const list = [{
3160
+ type: "marker",
3161
+ lat: "value1"
3162
+ }, {
3163
+ type: "bubble",
3164
+ size: "value2"
3165
+ }];
3166
+
3167
+ const obj = {
3168
+ type: 'bubble'
3169
+ };
3170
+
3171
+ findClosestMatch(list, obj) -> returns index 1.
3172
+ */
3173
+
3174
+ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
3175
+ if (!Array.isArray(searchList) || searchList.length === 0) {
3176
+ return -1;
3177
+ }
3178
+
3179
+ var keys = Object.keys(inputObj);
3180
+ var maxMatchCnt = 0;
3181
+ var maxMatchIdx = 0;
3182
+ searchList.forEach(function (item, idx) {
3183
+ var matchCnt = 0;
3184
+ keys.forEach(function (key) {
3185
+ if (item[key] === inputObj[key]) {
3186
+ matchCnt += 1;
3187
+ }
3188
+ });
3189
+
3190
+ if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
3191
+ maxMatchCnt = matchCnt;
3192
+ maxMatchIdx = idx;
3193
+ }
3194
+ });
3195
+ return maxMatchIdx;
3196
+ };
3197
+
3198
+ exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
3143
3199
 
3144
3200
  /***/ }),
3145
3201