@splunk/visualizations 24.3.1 → 24.3.4

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 (65) 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/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
  13. package/Area.js +121 -65
  14. package/Area.js.map +1 -1
  15. package/Bar.js +121 -65
  16. package/Bar.js.map +1 -1
  17. package/Bubble.js +121 -65
  18. package/Bubble.js.map +1 -1
  19. package/ChoroplethSvg.js +142 -73
  20. package/ChoroplethSvg.js.map +1 -1
  21. package/Column.js +121 -65
  22. package/Column.js.map +1 -1
  23. package/Ellipse.js +121 -65
  24. package/Ellipse.js.map +1 -1
  25. package/FillerGauge.js +121 -65
  26. package/FillerGauge.js.map +1 -1
  27. package/Image.js +125 -69
  28. package/Image.js.map +1 -1
  29. package/Line.js +121 -65
  30. package/Line.js.map +1 -1
  31. package/LinkGraph.js +121 -65
  32. package/LinkGraph.js.map +1 -1
  33. package/Map.config.js +16 -6
  34. package/Map.config.js.map +1 -1
  35. package/Map.js +430 -126
  36. package/Map.js.map +1 -1
  37. package/Markdown.js +136 -78
  38. package/Markdown.js.map +1 -1
  39. package/MarkerGauge.js +135 -79
  40. package/MarkerGauge.js.map +1 -1
  41. package/ParallelCoordinates.js +140 -83
  42. package/ParallelCoordinates.js.map +1 -1
  43. package/Pie.js +133 -77
  44. package/Pie.js.map +1 -1
  45. package/Punchcard.js +144 -87
  46. package/Punchcard.js.map +1 -1
  47. package/Rectangle.js +129 -73
  48. package/Rectangle.js.map +1 -1
  49. package/Sankey.js +204 -148
  50. package/Sankey.js.map +1 -1
  51. package/Scatter.js +131 -75
  52. package/Scatter.js.map +1 -1
  53. package/SingleValue.js +160 -104
  54. package/SingleValue.js.map +1 -1
  55. package/SingleValueIcon.js +135 -78
  56. package/SingleValueIcon.js.map +1 -1
  57. package/SingleValueRadial.js +202 -146
  58. package/SingleValueRadial.js.map +1 -1
  59. package/Table.js +236 -180
  60. package/Table.js.map +1 -1
  61. package/common/utils/hocUtils.js +65 -9
  62. package/common/utils/hocUtils.js.map +1 -1
  63. package/common/withDashboardViz.js +68 -12
  64. package/common/withDashboardViz.js.map +1 -1
  65. package/package.json +10 -10
package/Image.js CHANGED
@@ -162,7 +162,7 @@ var config_1 = __webpack_require__(170);
162
162
 
163
163
  exports.config = config_1.default;
164
164
 
165
- var withDashboardViz_1 = __webpack_require__(27);
165
+ var withDashboardViz_1 = __webpack_require__(28);
166
166
 
167
167
  var ImageApi_1 = __webpack_require__(171);
168
168
 
@@ -383,7 +383,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
383
383
 
384
384
  return React.createElement(FixSizeItem, {
385
385
  "data-test": "fix-size-item",
386
- "data-splunk-visualization-version": "24.3.1 - da5652d2c",
386
+ "data-splunk-visualization-version": "24.3.4 - fa50e80e6",
387
387
  width: width,
388
388
  height: height,
389
389
  backgroundColor: backgroundColor
@@ -492,7 +492,7 @@ var visualization_icons_1 = __webpack_require__(42);
492
492
 
493
493
  var VizBehavior_1 = __webpack_require__(5);
494
494
 
495
- var VizCategory_1 = __webpack_require__(26);
495
+ var VizCategory_1 = __webpack_require__(27);
496
496
 
497
497
  var configUtils_1 = __webpack_require__(6);
498
498
 
@@ -670,7 +670,7 @@ var T = __webpack_require__(0);
670
670
 
671
671
  var lodash_1 = __webpack_require__(2);
672
672
 
673
- var DataSource_1 = __webpack_require__(33);
673
+ var DataSource_1 = __webpack_require__(34);
674
674
 
675
675
  exports.SortParamsPropTypes = T.shape({
676
676
  currentSortKey: T.string,
@@ -795,6 +795,40 @@ exports.getPaginationParams = getPaginationParams;
795
795
  "use strict";
796
796
 
797
797
 
798
+ Object.defineProperty(exports, "__esModule", {
799
+ value: true
800
+ });
801
+ exports.pickFieldFromJSONSchema = void 0;
802
+
803
+ var lodash_1 = __webpack_require__(2);
804
+
805
+ var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
806
+ var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
807
+ return Object.keys(optionsSchema).reduce(function (accum, k) {
808
+ if (lodash_1.has(optionsSchema[k], fieldName)) {
809
+ accum[k] = optionsSchema[k][fieldName];
810
+ } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
811
+ var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
812
+
813
+ if (!lodash_1.isEmpty(nestedSchema)) {
814
+ accum[k] = nestedSchema;
815
+ }
816
+ }
817
+
818
+ return accum;
819
+ }, {});
820
+ };
821
+
822
+ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
823
+
824
+ /***/ }),
825
+
826
+ /***/ 26:
827
+ /***/ (function(module, exports, __webpack_require__) {
828
+
829
+ "use strict";
830
+
831
+
798
832
  Object.defineProperty(exports, "__esModule", {
799
833
  value: true
800
834
  });
@@ -878,7 +912,7 @@ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
878
912
 
879
913
  /***/ }),
880
914
 
881
- /***/ 26:
915
+ /***/ 27:
882
916
  /***/ (function(module, exports, __webpack_require__) {
883
917
 
884
918
  "use strict";
@@ -907,7 +941,7 @@ var VizCategory;
907
941
 
908
942
  /***/ }),
909
943
 
910
- /***/ 27:
944
+ /***/ 28:
911
945
  /***/ (function(module, exports, __webpack_require__) {
912
946
 
913
947
  "use strict";
@@ -921,15 +955,15 @@ var React = __webpack_require__(1);
921
955
 
922
956
  var lodash_1 = __webpack_require__(2);
923
957
 
924
- var getSettingsFromThemedProps_1 = __webpack_require__(28);
958
+ var getSettingsFromThemedProps_1 = __webpack_require__(29);
925
959
 
926
- var Options_1 = __webpack_require__(29);
960
+ var Options_1 = __webpack_require__(30);
927
961
 
928
- var SanitizeProps_1 = __webpack_require__(30);
962
+ var SanitizeProps_1 = __webpack_require__(31);
929
963
 
930
964
  var styled_components_1 = __webpack_require__(4);
931
965
 
932
- var SplunkVisualization_1 = __webpack_require__(31);
966
+ var SplunkVisualization_1 = __webpack_require__(32);
933
967
 
934
968
  var VizBehavior_1 = __webpack_require__(5);
935
969
 
@@ -937,9 +971,9 @@ var getSorting_1 = __webpack_require__(23);
937
971
 
938
972
  var getPagination_1 = __webpack_require__(24);
939
973
 
940
- var useDeepMemo_1 = __webpack_require__(34);
974
+ var useDeepMemo_1 = __webpack_require__(35);
941
975
 
942
- var JSONSchemaUtils_1 = __webpack_require__(35);
976
+ var JSONSchemaUtils_1 = __webpack_require__(25);
943
977
 
944
978
  var MissingPropsMessage_1 = __webpack_require__(36);
945
979
 
@@ -1001,7 +1035,7 @@ var withDashboardViz = function withDashboardViz(opts) {
1001
1035
  try {
1002
1036
  return Options_1.Options.evaluate({
1003
1037
  context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1004
- options: hocUtils_1.deepMergeWithArrayOverrides({}, options, defaultOptions)
1038
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1005
1039
  }, dataSources, themeFunc);
1006
1040
  } catch (e) {
1007
1041
  // eslint-disable-next-line no-console
@@ -1132,35 +1166,35 @@ exports.default = withDashboardViz;
1132
1166
 
1133
1167
  /***/ }),
1134
1168
 
1135
- /***/ 28:
1169
+ /***/ 29:
1136
1170
  /***/ (function(module, exports) {
1137
1171
 
1138
1172
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1139
1173
 
1140
1174
  /***/ }),
1141
1175
 
1142
- /***/ 29:
1176
+ /***/ 3:
1143
1177
  /***/ (function(module, exports) {
1144
1178
 
1145
- module.exports = require("@splunk/visualization-encoding/Options");
1179
+ module.exports = require("@splunk/ui-utils/i18n");
1146
1180
 
1147
1181
  /***/ }),
1148
1182
 
1149
- /***/ 3:
1183
+ /***/ 30:
1150
1184
  /***/ (function(module, exports) {
1151
1185
 
1152
- module.exports = require("@splunk/ui-utils/i18n");
1186
+ module.exports = require("@splunk/visualization-encoding/Options");
1153
1187
 
1154
1188
  /***/ }),
1155
1189
 
1156
- /***/ 30:
1190
+ /***/ 31:
1157
1191
  /***/ (function(module, exports) {
1158
1192
 
1159
1193
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1160
1194
 
1161
1195
  /***/ }),
1162
1196
 
1163
- /***/ 31:
1197
+ /***/ 32:
1164
1198
  /***/ (function(module, exports, __webpack_require__) {
1165
1199
 
1166
1200
  "use strict";
@@ -1178,7 +1212,7 @@ var T = __webpack_require__(0);
1178
1212
 
1179
1213
  var lodash_1 = __webpack_require__(2);
1180
1214
 
1181
- var VizActionHandler_1 = __webpack_require__(32); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1215
+ var VizActionHandler_1 = __webpack_require__(33); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1182
1216
 
1183
1217
 
1184
1218
  exports.INITIAL_WIDTH = 250;
@@ -1312,7 +1346,7 @@ exports.default = SplunkVisualization;
1312
1346
 
1313
1347
  /***/ }),
1314
1348
 
1315
- /***/ 32:
1349
+ /***/ 33:
1316
1350
  /***/ (function(module, exports, __webpack_require__) {
1317
1351
 
1318
1352
  "use strict";
@@ -1350,7 +1384,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1350
1384
 
1351
1385
  /***/ }),
1352
1386
 
1353
- /***/ 33:
1387
+ /***/ 34:
1354
1388
  /***/ (function(module, exports, __webpack_require__) {
1355
1389
 
1356
1390
  "use strict";
@@ -1364,7 +1398,7 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
1364
1398
 
1365
1399
  /***/ }),
1366
1400
 
1367
- /***/ 34:
1401
+ /***/ 35:
1368
1402
  /***/ (function(module, exports, __webpack_require__) {
1369
1403
 
1370
1404
  "use strict";
@@ -1410,40 +1444,6 @@ exports.useDeepMemo = useDeepMemo;
1410
1444
 
1411
1445
  /***/ }),
1412
1446
 
1413
- /***/ 35:
1414
- /***/ (function(module, exports, __webpack_require__) {
1415
-
1416
- "use strict";
1417
-
1418
-
1419
- Object.defineProperty(exports, "__esModule", {
1420
- value: true
1421
- });
1422
- exports.pickFieldFromJSONSchema = void 0;
1423
-
1424
- var lodash_1 = __webpack_require__(2);
1425
-
1426
- var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
1427
- var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
1428
- return Object.keys(optionsSchema).reduce(function (accum, k) {
1429
- if (lodash_1.has(optionsSchema[k], fieldName)) {
1430
- accum[k] = optionsSchema[k][fieldName];
1431
- } else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
1432
- var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
1433
-
1434
- if (!lodash_1.isEmpty(nestedSchema)) {
1435
- accum[k] = nestedSchema;
1436
- }
1437
- }
1438
-
1439
- return accum;
1440
- }, {});
1441
- };
1442
-
1443
- exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
1444
-
1445
- /***/ }),
1446
-
1447
1447
  /***/ 36:
1448
1448
  /***/ (function(module, exports, __webpack_require__) {
1449
1449
 
@@ -1546,7 +1546,7 @@ var Cover = styled_components_1.default.div.withConfig({
1546
1546
  componentId: "sc-1gsbnxb-0"
1547
1547
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1548
1548
  var Blocker = styled_components_1.default.div.attrs({
1549
- 'data-splunk-visualization-version': "24.3.1 - da5652d2c"
1549
+ 'data-splunk-visualization-version': "24.3.4 - fa50e80e6"
1550
1550
  }).withConfig({
1551
1551
  displayName: "withEditModeCover__Blocker",
1552
1552
  componentId: "sc-1gsbnxb-1"
@@ -1592,7 +1592,7 @@ var React = __webpack_require__(1);
1592
1592
 
1593
1593
  var colorUtils_1 = __webpack_require__(11);
1594
1594
 
1595
- var IconPlaceholder_1 = __webpack_require__(25);
1595
+ var IconPlaceholder_1 = __webpack_require__(26);
1596
1596
 
1597
1597
  var VizBehavior_1 = __webpack_require__(5);
1598
1598
 
@@ -1893,7 +1893,7 @@ var _typeof = __webpack_require__(20);
1893
1893
  Object.defineProperty(exports, "__esModule", {
1894
1894
  value: true
1895
1895
  });
1896
- exports.deepMergeWithArrayOverrides = exports.extendStaticWrapperProps = void 0;
1896
+ exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
1897
1897
 
1898
1898
  var lodash_1 = __webpack_require__(2);
1899
1899
  /**
@@ -1919,17 +1919,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
1919
1919
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
1920
1920
  /**
1921
1921
  * helper to deeply merge objects while preserving arrays in earlier source objects
1922
- * 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
1923
- * this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
1922
+ * 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
1923
+ * 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).
1924
+ * 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
1925
+ * 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.
1924
1926
  *
1925
- * @method deepMergeWithArrayOverrides
1927
+ * @method deepMergeWithArrayPrimitiveOverrides
1926
1928
  * @param {Object} initial - target object to merge values into
1927
1929
  * @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
1928
1930
  *
1929
1931
  * @returns {Object}
1930
1932
  */
1931
1933
 
1932
- var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial) {
1934
+ var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
1933
1935
  var clone = lodash_1.cloneDeep(initial);
1934
1936
 
1935
1937
  for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
@@ -1940,18 +1942,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
1940
1942
  Object.keys(sourceToApply).forEach(function (sourceKey) {
1941
1943
  if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
1942
1944
  clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
1943
- } // object merging excluding arrays
1944
-
1945
+ }
1945
1946
 
1946
1947
  if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
1947
- clone[sourceKey] = exports.deepMergeWithArrayOverrides(clone[sourceKey], sourceToApply[sourceKey]);
1948
+ clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
1949
+ } else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
1950
+ // If option is an array of objects
1951
+ for (var i = 0; i < clone[sourceKey].length; i += 1) {
1952
+ if (_typeof(clone[sourceKey][i]) === 'object') {
1953
+ var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
1954
+
1955
+ if (closestMatchIdx > -1) {
1956
+ clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
1957
+ }
1958
+ }
1959
+ }
1948
1960
  }
1949
1961
  });
1950
1962
  });
1951
1963
  return clone;
1952
1964
  };
1953
1965
 
1954
- exports.deepMergeWithArrayOverrides = deepMergeWithArrayOverrides;
1966
+ exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
1967
+ /**
1968
+ * Finds the closest matching object from the list, which has the max same key value pairs.
1969
+ * Returns the index of match if found, or -1
1970
+ * For eg :-
1971
+ const list = [{
1972
+ type: "marker",
1973
+ lat: "value1"
1974
+ }, {
1975
+ type: "bubble",
1976
+ size: "value2"
1977
+ }];
1978
+
1979
+ const obj = {
1980
+ type: 'bubble'
1981
+ };
1982
+
1983
+ findClosestMatch(list, obj) -> returns index 1.
1984
+ */
1985
+
1986
+ var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
1987
+ if (!Array.isArray(searchList) || searchList.length === 0) {
1988
+ return -1;
1989
+ }
1990
+
1991
+ var keys = Object.keys(inputObj);
1992
+ var maxMatchCnt = 0;
1993
+ var maxMatchIdx = 0;
1994
+ searchList.forEach(function (item, idx) {
1995
+ var matchCnt = 0;
1996
+ keys.forEach(function (key) {
1997
+ if (item[key] === inputObj[key]) {
1998
+ matchCnt += 1;
1999
+ }
2000
+ });
2001
+
2002
+ if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
2003
+ maxMatchCnt = matchCnt;
2004
+ maxMatchIdx = idx;
2005
+ }
2006
+ });
2007
+ return maxMatchIdx;
2008
+ };
2009
+
2010
+ exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
1955
2011
 
1956
2012
  /***/ }),
1957
2013