@splunk/visualizations 24.3.0 → 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.
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_Tooltip_Dark.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_bubble_layer_geostats_by.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Additional_Cases.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_By_Type_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Default.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Kitchen_Sink.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Right.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Align_Single_Column.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_Color_light_blue.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_No_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Background_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Basic_Table.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Basic_Table_With_No_Click.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Cell_Types.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Column_Gradient.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Column_Override.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Count_2.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Header_Colors.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Row_Colors.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Custom_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_No_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Dark_Background_Stripe.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Format_Number.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Format_Number_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_fixed.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_none.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Height_Percentage_100_no_paginator.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Invalid_Background_Color.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Multi_Value_Field.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_No_Stripes.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_No_Stripes_Row_Numbers.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Show_Row_Numbers_true.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Width.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Table_Formatting.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Table_Gradient.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Time_Formatting.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Height.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Percentage.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Width_Px.png +0 -0
- package/Area.js +121 -65
- package/Area.js.map +1 -1
- package/Bar.js +121 -65
- package/Bar.js.map +1 -1
- package/Bubble.js +121 -65
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.js +145 -76
- package/ChoroplethSvg.js.map +1 -1
- package/Column.js +121 -65
- package/Column.js.map +1 -1
- package/Ellipse.js +124 -68
- package/Ellipse.js.map +1 -1
- package/FillerGauge.js +124 -68
- package/FillerGauge.js.map +1 -1
- package/Image.js +125 -69
- package/Image.js.map +1 -1
- package/Line.js +121 -65
- package/Line.js.map +1 -1
- package/LinkGraph.js +124 -68
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +16 -6
- package/Map.config.js.map +1 -1
- package/Map.js +480 -172
- package/Map.js.map +1 -1
- package/Markdown.js +136 -78
- package/Markdown.js.map +1 -1
- package/MarkerGauge.js +135 -79
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.js +143 -86
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.js +133 -77
- package/Pie.js.map +1 -1
- package/Punchcard.js +149 -92
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +131 -75
- package/Rectangle.js.map +1 -1
- package/Sankey.js +208 -152
- package/Sankey.js.map +1 -1
- package/Scatter.js +131 -75
- package/Scatter.js.map +1 -1
- package/SingleValue.js +162 -106
- package/SingleValue.js.map +1 -1
- package/SingleValueIcon.js +138 -81
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.js +204 -148
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +1 -2
- package/Table.config.js.map +1 -1
- package/Table.js +301 -347
- package/Table.js.map +1 -1
- package/common/utils/hocUtils.js +65 -9
- package/common/utils/hocUtils.js.map +1 -1
- package/common/withDashboardViz.js +68 -12
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +10 -10
package/Map.js
CHANGED
|
@@ -360,7 +360,7 @@ var _typeof = __webpack_require__(20);
|
|
|
360
360
|
Object.defineProperty(exports, "__esModule", {
|
|
361
361
|
value: true
|
|
362
362
|
});
|
|
363
|
-
exports.
|
|
363
|
+
exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
|
|
364
364
|
|
|
365
365
|
var lodash_1 = __webpack_require__(2);
|
|
366
366
|
/**
|
|
@@ -386,17 +386,19 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
386
386
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
387
387
|
/**
|
|
388
388
|
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
389
|
-
* 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
|
|
390
|
-
* this prevents default arrays from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one)
|
|
389
|
+
* 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
|
|
390
|
+
* 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).
|
|
391
|
+
* 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
|
|
392
|
+
* 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.
|
|
391
393
|
*
|
|
392
|
-
* @method
|
|
394
|
+
* @method deepMergeWithArrayPrimitiveOverrides
|
|
393
395
|
* @param {Object} initial - target object to merge values into
|
|
394
396
|
* @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
|
|
395
397
|
*
|
|
396
398
|
* @returns {Object}
|
|
397
399
|
*/
|
|
398
400
|
|
|
399
|
-
var
|
|
401
|
+
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
400
402
|
var clone = lodash_1.cloneDeep(initial);
|
|
401
403
|
|
|
402
404
|
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
@@ -407,18 +409,72 @@ var deepMergeWithArrayOverrides = function deepMergeWithArrayOverrides(initial)
|
|
|
407
409
|
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
408
410
|
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
409
411
|
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
410
|
-
}
|
|
411
|
-
|
|
412
|
+
}
|
|
412
413
|
|
|
413
414
|
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
414
|
-
clone[sourceKey] = exports.
|
|
415
|
+
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
416
|
+
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
417
|
+
// If option is an array of objects
|
|
418
|
+
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
419
|
+
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
420
|
+
var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
421
|
+
|
|
422
|
+
if (closestMatchIdx > -1) {
|
|
423
|
+
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
}
|
|
415
427
|
}
|
|
416
428
|
});
|
|
417
429
|
});
|
|
418
430
|
return clone;
|
|
419
431
|
};
|
|
420
432
|
|
|
421
|
-
exports.
|
|
433
|
+
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
434
|
+
/**
|
|
435
|
+
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
436
|
+
* Returns the index of match if found, or -1
|
|
437
|
+
* For eg :-
|
|
438
|
+
const list = [{
|
|
439
|
+
type: "marker",
|
|
440
|
+
lat: "value1"
|
|
441
|
+
}, {
|
|
442
|
+
type: "bubble",
|
|
443
|
+
size: "value2"
|
|
444
|
+
}];
|
|
445
|
+
|
|
446
|
+
const obj = {
|
|
447
|
+
type: 'bubble'
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
findClosestMatch(list, obj) -> returns index 1.
|
|
451
|
+
*/
|
|
452
|
+
|
|
453
|
+
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
454
|
+
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
455
|
+
return -1;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
var keys = Object.keys(inputObj);
|
|
459
|
+
var maxMatchCnt = 0;
|
|
460
|
+
var maxMatchIdx = 0;
|
|
461
|
+
searchList.forEach(function (item, idx) {
|
|
462
|
+
var matchCnt = 0;
|
|
463
|
+
keys.forEach(function (key) {
|
|
464
|
+
if (item[key] === inputObj[key]) {
|
|
465
|
+
matchCnt += 1;
|
|
466
|
+
}
|
|
467
|
+
});
|
|
468
|
+
|
|
469
|
+
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
470
|
+
maxMatchCnt = matchCnt;
|
|
471
|
+
maxMatchIdx = idx;
|
|
472
|
+
}
|
|
473
|
+
});
|
|
474
|
+
return maxMatchIdx;
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
422
478
|
|
|
423
479
|
/***/ }),
|
|
424
480
|
/* 8 */
|
|
@@ -520,7 +576,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
520
576
|
|
|
521
577
|
return React.createElement(FixSizeItem, {
|
|
522
578
|
"data-test": "fix-size-item",
|
|
523
|
-
"data-splunk-visualization-version": "24.3.
|
|
579
|
+
"data-splunk-visualization-version": "24.3.3 - 8d441d88c",
|
|
524
580
|
width: width,
|
|
525
581
|
height: height,
|
|
526
582
|
backgroundColor: backgroundColor
|
|
@@ -593,7 +649,7 @@ var T = __webpack_require__(0);
|
|
|
593
649
|
|
|
594
650
|
var lodash_1 = __webpack_require__(2);
|
|
595
651
|
|
|
596
|
-
var DataSource_1 = __webpack_require__(
|
|
652
|
+
var DataSource_1 = __webpack_require__(34);
|
|
597
653
|
|
|
598
654
|
exports.SortParamsPropTypes = T.shape({
|
|
599
655
|
currentSortKey: T.string,
|
|
@@ -716,6 +772,39 @@ exports.getPaginationParams = getPaginationParams;
|
|
|
716
772
|
"use strict";
|
|
717
773
|
|
|
718
774
|
|
|
775
|
+
Object.defineProperty(exports, "__esModule", {
|
|
776
|
+
value: true
|
|
777
|
+
});
|
|
778
|
+
exports.pickFieldFromJSONSchema = void 0;
|
|
779
|
+
|
|
780
|
+
var lodash_1 = __webpack_require__(2);
|
|
781
|
+
|
|
782
|
+
var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
|
|
783
|
+
var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
784
|
+
return Object.keys(optionsSchema).reduce(function (accum, k) {
|
|
785
|
+
if (lodash_1.has(optionsSchema[k], fieldName)) {
|
|
786
|
+
accum[k] = optionsSchema[k][fieldName];
|
|
787
|
+
} else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
|
|
788
|
+
var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
|
|
789
|
+
|
|
790
|
+
if (!lodash_1.isEmpty(nestedSchema)) {
|
|
791
|
+
accum[k] = nestedSchema;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
return accum;
|
|
796
|
+
}, {});
|
|
797
|
+
};
|
|
798
|
+
|
|
799
|
+
exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
|
|
800
|
+
|
|
801
|
+
/***/ }),
|
|
802
|
+
/* 26 */
|
|
803
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
804
|
+
|
|
805
|
+
"use strict";
|
|
806
|
+
|
|
807
|
+
|
|
719
808
|
Object.defineProperty(exports, "__esModule", {
|
|
720
809
|
value: true
|
|
721
810
|
});
|
|
@@ -798,7 +887,7 @@ IconPlaceholder.defaultProps = {
|
|
|
798
887
|
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
799
888
|
|
|
800
889
|
/***/ }),
|
|
801
|
-
/*
|
|
890
|
+
/* 27 */
|
|
802
891
|
/***/ (function(module, exports, __webpack_require__) {
|
|
803
892
|
|
|
804
893
|
"use strict";
|
|
@@ -826,7 +915,7 @@ var VizCategory;
|
|
|
826
915
|
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
827
916
|
|
|
828
917
|
/***/ }),
|
|
829
|
-
/*
|
|
918
|
+
/* 28 */
|
|
830
919
|
/***/ (function(module, exports, __webpack_require__) {
|
|
831
920
|
|
|
832
921
|
"use strict";
|
|
@@ -840,15 +929,15 @@ var React = __webpack_require__(1);
|
|
|
840
929
|
|
|
841
930
|
var lodash_1 = __webpack_require__(2);
|
|
842
931
|
|
|
843
|
-
var getSettingsFromThemedProps_1 = __webpack_require__(
|
|
932
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(29);
|
|
844
933
|
|
|
845
|
-
var Options_1 = __webpack_require__(
|
|
934
|
+
var Options_1 = __webpack_require__(30);
|
|
846
935
|
|
|
847
|
-
var SanitizeProps_1 = __webpack_require__(
|
|
936
|
+
var SanitizeProps_1 = __webpack_require__(31);
|
|
848
937
|
|
|
849
938
|
var styled_components_1 = __webpack_require__(4);
|
|
850
939
|
|
|
851
|
-
var SplunkVisualization_1 = __webpack_require__(
|
|
940
|
+
var SplunkVisualization_1 = __webpack_require__(32);
|
|
852
941
|
|
|
853
942
|
var VizBehavior_1 = __webpack_require__(5);
|
|
854
943
|
|
|
@@ -856,9 +945,9 @@ var getSorting_1 = __webpack_require__(23);
|
|
|
856
945
|
|
|
857
946
|
var getPagination_1 = __webpack_require__(24);
|
|
858
947
|
|
|
859
|
-
var useDeepMemo_1 = __webpack_require__(
|
|
948
|
+
var useDeepMemo_1 = __webpack_require__(35);
|
|
860
949
|
|
|
861
|
-
var JSONSchemaUtils_1 = __webpack_require__(
|
|
950
|
+
var JSONSchemaUtils_1 = __webpack_require__(25);
|
|
862
951
|
|
|
863
952
|
var MissingPropsMessage_1 = __webpack_require__(36);
|
|
864
953
|
|
|
@@ -920,7 +1009,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
920
1009
|
try {
|
|
921
1010
|
return Options_1.Options.evaluate({
|
|
922
1011
|
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
923
|
-
options: hocUtils_1.
|
|
1012
|
+
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
924
1013
|
}, dataSources, themeFunc);
|
|
925
1014
|
} catch (e) {
|
|
926
1015
|
// eslint-disable-next-line no-console
|
|
@@ -1050,25 +1139,25 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1050
1139
|
exports.default = withDashboardViz;
|
|
1051
1140
|
|
|
1052
1141
|
/***/ }),
|
|
1053
|
-
/*
|
|
1142
|
+
/* 29 */
|
|
1054
1143
|
/***/ (function(module, exports) {
|
|
1055
1144
|
|
|
1056
1145
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1057
1146
|
|
|
1058
1147
|
/***/ }),
|
|
1059
|
-
/*
|
|
1148
|
+
/* 30 */
|
|
1060
1149
|
/***/ (function(module, exports) {
|
|
1061
1150
|
|
|
1062
1151
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
1063
1152
|
|
|
1064
1153
|
/***/ }),
|
|
1065
|
-
/*
|
|
1154
|
+
/* 31 */
|
|
1066
1155
|
/***/ (function(module, exports) {
|
|
1067
1156
|
|
|
1068
1157
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1069
1158
|
|
|
1070
1159
|
/***/ }),
|
|
1071
|
-
/*
|
|
1160
|
+
/* 32 */
|
|
1072
1161
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1073
1162
|
|
|
1074
1163
|
"use strict";
|
|
@@ -1086,7 +1175,7 @@ var T = __webpack_require__(0);
|
|
|
1086
1175
|
|
|
1087
1176
|
var lodash_1 = __webpack_require__(2);
|
|
1088
1177
|
|
|
1089
|
-
var VizActionHandler_1 = __webpack_require__(
|
|
1178
|
+
var VizActionHandler_1 = __webpack_require__(33); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1090
1179
|
|
|
1091
1180
|
|
|
1092
1181
|
exports.INITIAL_WIDTH = 250;
|
|
@@ -1219,7 +1308,7 @@ SplunkVisualization.defaultProps = {
|
|
|
1219
1308
|
exports.default = SplunkVisualization;
|
|
1220
1309
|
|
|
1221
1310
|
/***/ }),
|
|
1222
|
-
/*
|
|
1311
|
+
/* 33 */
|
|
1223
1312
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1224
1313
|
|
|
1225
1314
|
"use strict";
|
|
@@ -1256,7 +1345,7 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1256
1345
|
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1257
1346
|
|
|
1258
1347
|
/***/ }),
|
|
1259
|
-
/*
|
|
1348
|
+
/* 34 */
|
|
1260
1349
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1261
1350
|
|
|
1262
1351
|
"use strict";
|
|
@@ -1269,7 +1358,7 @@ exports.validSortDirs = void 0;
|
|
|
1269
1358
|
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1270
1359
|
|
|
1271
1360
|
/***/ }),
|
|
1272
|
-
/*
|
|
1361
|
+
/* 35 */
|
|
1273
1362
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1274
1363
|
|
|
1275
1364
|
"use strict";
|
|
@@ -1313,39 +1402,6 @@ var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
|
1313
1402
|
|
|
1314
1403
|
exports.useDeepMemo = useDeepMemo;
|
|
1315
1404
|
|
|
1316
|
-
/***/ }),
|
|
1317
|
-
/* 35 */
|
|
1318
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1319
|
-
|
|
1320
|
-
"use strict";
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1324
|
-
value: true
|
|
1325
|
-
});
|
|
1326
|
-
exports.pickFieldFromJSONSchema = void 0;
|
|
1327
|
-
|
|
1328
|
-
var lodash_1 = __webpack_require__(2);
|
|
1329
|
-
|
|
1330
|
-
var pickFieldFromJSONSchema = function pickFieldFromJSONSchema(optionsSchema) {
|
|
1331
|
-
var fieldName = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
|
1332
|
-
return Object.keys(optionsSchema).reduce(function (accum, k) {
|
|
1333
|
-
if (lodash_1.has(optionsSchema[k], fieldName)) {
|
|
1334
|
-
accum[k] = optionsSchema[k][fieldName];
|
|
1335
|
-
} else if (lodash_1.get(optionsSchema, [k, 'type']) === 'object' && lodash_1.has(optionsSchema[k], 'properties')) {
|
|
1336
|
-
var nestedSchema = exports.pickFieldFromJSONSchema(optionsSchema[k].properties, fieldName);
|
|
1337
|
-
|
|
1338
|
-
if (!lodash_1.isEmpty(nestedSchema)) {
|
|
1339
|
-
accum[k] = nestedSchema;
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
return accum;
|
|
1344
|
-
}, {});
|
|
1345
|
-
};
|
|
1346
|
-
|
|
1347
|
-
exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
|
|
1348
|
-
|
|
1349
1405
|
/***/ }),
|
|
1350
1406
|
/* 36 */
|
|
1351
1407
|
/***/ (function(module, exports, __webpack_require__) {
|
|
@@ -1448,7 +1504,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
1448
1504
|
componentId: "sc-1gsbnxb-0"
|
|
1449
1505
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1450
1506
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1451
|
-
'data-splunk-visualization-version': "24.3.
|
|
1507
|
+
'data-splunk-visualization-version': "24.3.3 - 8d441d88c"
|
|
1452
1508
|
}).withConfig({
|
|
1453
1509
|
displayName: "withEditModeCover__Blocker",
|
|
1454
1510
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1493,7 +1549,7 @@ var React = __webpack_require__(1);
|
|
|
1493
1549
|
|
|
1494
1550
|
var colorUtils_1 = __webpack_require__(11);
|
|
1495
1551
|
|
|
1496
|
-
var IconPlaceholder_1 = __webpack_require__(
|
|
1552
|
+
var IconPlaceholder_1 = __webpack_require__(26);
|
|
1497
1553
|
|
|
1498
1554
|
var VizBehavior_1 = __webpack_require__(5);
|
|
1499
1555
|
|
|
@@ -1562,13 +1618,13 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
1562
1618
|
/* 45 */,
|
|
1563
1619
|
/* 46 */,
|
|
1564
1620
|
/* 47 */,
|
|
1565
|
-
/* 48
|
|
1621
|
+
/* 48 */,
|
|
1622
|
+
/* 49 */
|
|
1566
1623
|
/***/ (function(module, exports) {
|
|
1567
1624
|
|
|
1568
1625
|
module.exports = require("@babel/runtime/helpers/slicedToArray");
|
|
1569
1626
|
|
|
1570
1627
|
/***/ }),
|
|
1571
|
-
/* 49 */,
|
|
1572
1628
|
/* 50 */,
|
|
1573
1629
|
/* 51 */,
|
|
1574
1630
|
/* 52 */,
|
|
@@ -1734,24 +1790,46 @@ module.exports = require("maplibre-gl");
|
|
|
1734
1790
|
"use strict";
|
|
1735
1791
|
|
|
1736
1792
|
|
|
1793
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
1794
|
+
var t = {};
|
|
1795
|
+
|
|
1796
|
+
for (var p in s) {
|
|
1797
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1798
|
+
}
|
|
1799
|
+
|
|
1800
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1801
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1802
|
+
}
|
|
1803
|
+
return t;
|
|
1804
|
+
};
|
|
1805
|
+
|
|
1737
1806
|
Object.defineProperty(exports, "__esModule", {
|
|
1738
1807
|
value: true
|
|
1739
1808
|
});
|
|
1740
1809
|
exports.PureMap = exports.config = exports.themes = exports.computeVizProps = void 0;
|
|
1810
|
+
/* eslint-disable no-sequences */
|
|
1811
|
+
|
|
1812
|
+
var React = __webpack_require__(1);
|
|
1741
1813
|
|
|
1742
1814
|
var colorUtils_1 = __webpack_require__(11);
|
|
1743
1815
|
|
|
1744
1816
|
var types_1 = __webpack_require__(190);
|
|
1745
1817
|
|
|
1746
|
-
var
|
|
1818
|
+
var dsl_1 = __webpack_require__(191);
|
|
1819
|
+
|
|
1820
|
+
var JSONSchemaUtils_1 = __webpack_require__(25);
|
|
1821
|
+
|
|
1822
|
+
var hocUtils_1 = __webpack_require__(7);
|
|
1823
|
+
|
|
1824
|
+
var PureMap_1 = __webpack_require__(192);
|
|
1747
1825
|
|
|
1748
1826
|
exports.PureMap = PureMap_1.default;
|
|
1749
1827
|
|
|
1750
|
-
var config_1 = __webpack_require__(
|
|
1828
|
+
var config_1 = __webpack_require__(200);
|
|
1751
1829
|
|
|
1752
1830
|
exports.config = config_1.default;
|
|
1753
1831
|
|
|
1754
|
-
var withDashboardViz_1 = __webpack_require__(
|
|
1832
|
+
var withDashboardViz_1 = __webpack_require__(28);
|
|
1755
1833
|
|
|
1756
1834
|
var computeVizProps = function computeVizProps(_ref) {
|
|
1757
1835
|
var themeFunc = _ref.themeFunc,
|
|
@@ -1797,8 +1875,121 @@ var computeVizProps = function computeVizProps(_ref) {
|
|
|
1797
1875
|
}), layers);
|
|
1798
1876
|
};
|
|
1799
1877
|
|
|
1800
|
-
exports.computeVizProps = computeVizProps;
|
|
1801
|
-
|
|
1878
|
+
exports.computeVizProps = computeVizProps; // HOC for stripping the internal fields for Maps
|
|
1879
|
+
|
|
1880
|
+
var withoutInternalFields = function withoutInternalFields(Viz) {
|
|
1881
|
+
// eslint-disable-next-line react/display-name
|
|
1882
|
+
var VizWithoutInternalFields = function VizWithoutInternalFields(_a) {
|
|
1883
|
+
var dataSources = _a.dataSources,
|
|
1884
|
+
otherProps = __rest(_a, ["dataSources"]);
|
|
1885
|
+
|
|
1886
|
+
if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
|
|
1887
|
+
return React.createElement(Viz, Object.assign({}, otherProps));
|
|
1888
|
+
}
|
|
1889
|
+
|
|
1890
|
+
var primary = dataSources.primary;
|
|
1891
|
+
var _primary$data = primary.data,
|
|
1892
|
+
columns = _primary$data.columns,
|
|
1893
|
+
fields = _primary$data.fields;
|
|
1894
|
+
var newColumns = [];
|
|
1895
|
+
var newFields = [];
|
|
1896
|
+
|
|
1897
|
+
if (fields && columns && fields.length === columns.length) {
|
|
1898
|
+
// computed sorted index for removal
|
|
1899
|
+
var indicesToRemove = new Set(fields.reduce(function (arr, e, i) {
|
|
1900
|
+
return (typeof e === 'string' ? e.startsWith('_') : e.name.toString().startsWith('_')) && arr.push(i), arr;
|
|
1901
|
+
}, []));
|
|
1902
|
+
newFields = fields.filter(function (d, i) {
|
|
1903
|
+
return !indicesToRemove.has(i);
|
|
1904
|
+
});
|
|
1905
|
+
newColumns = columns.filter(function (d, i) {
|
|
1906
|
+
return !indicesToRemove.has(i);
|
|
1907
|
+
});
|
|
1908
|
+
}
|
|
1909
|
+
|
|
1910
|
+
var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
|
|
1911
|
+
primary: Object.assign(Object.assign({}, primary), {
|
|
1912
|
+
data: Object.assign(Object.assign({}, primary.data), {
|
|
1913
|
+
columns: newColumns,
|
|
1914
|
+
fields: newFields
|
|
1915
|
+
})
|
|
1916
|
+
})
|
|
1917
|
+
});
|
|
1918
|
+
return React.createElement(Viz, Object.assign({
|
|
1919
|
+
dataSources: modifiedDatasources
|
|
1920
|
+
}, otherProps));
|
|
1921
|
+
};
|
|
1922
|
+
|
|
1923
|
+
VizWithoutInternalFields.propTypes = Viz.propTypes;
|
|
1924
|
+
VizWithoutInternalFields.defaultProps = Viz.defaultProps;
|
|
1925
|
+
VizWithoutInternalFields.config = Viz.config;
|
|
1926
|
+
return VizWithoutInternalFields;
|
|
1927
|
+
}; // HOC for updating all null values in data columns to zeros
|
|
1928
|
+
// excluding 'latitude', 'longitude' and 'geobin'
|
|
1929
|
+
|
|
1930
|
+
|
|
1931
|
+
var withNullToZeros = function withNullToZeros(Viz) {
|
|
1932
|
+
// eslint-disable-next-line react/display-name
|
|
1933
|
+
var VizWithColumnsNullToZeros = function VizWithColumnsNullToZeros(_a) {
|
|
1934
|
+
var dataSources = _a.dataSources,
|
|
1935
|
+
options = _a.options,
|
|
1936
|
+
otherProps = __rest(_a, ["dataSources", "options"]);
|
|
1937
|
+
|
|
1938
|
+
if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
|
|
1939
|
+
return React.createElement(Viz, Object.assign({}, otherProps));
|
|
1940
|
+
}
|
|
1941
|
+
|
|
1942
|
+
var primary = dataSources.primary;
|
|
1943
|
+
var _primary$data2 = primary.data,
|
|
1944
|
+
columns = _primary$data2.columns,
|
|
1945
|
+
fields = _primary$data2.fields;
|
|
1946
|
+
var newColumns = columns;
|
|
1947
|
+
var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
|
|
1948
|
+
|
|
1949
|
+
if (mergedOptions.layers && mergedOptions.layers.length && mergedOptions.layers[0].type === 'bubble') {
|
|
1950
|
+
var latitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].latitude, dataSources)[0] || '';
|
|
1951
|
+
var longitudeField = dsl_1.getFieldsFromDSL(mergedOptions.layers[0].longitude, dataSources)[0] || '';
|
|
1952
|
+
var excludedFields = [latitudeField, longitudeField, 'geobin'];
|
|
1953
|
+
var indicesToEvaluate = new Set(fields.reduce(function (arr, e, i) {
|
|
1954
|
+
var field = typeof e === 'string' ? e : e.name.toString();
|
|
1955
|
+
|
|
1956
|
+
if (!excludedFields.includes(field)) {
|
|
1957
|
+
arr.push(i);
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1960
|
+
return arr;
|
|
1961
|
+
}, []));
|
|
1962
|
+
newColumns = columns.map(function (column, i) {
|
|
1963
|
+
if (indicesToEvaluate.has(i)) {
|
|
1964
|
+
return column.map(function (value) {
|
|
1965
|
+
return !value ? 0 : value;
|
|
1966
|
+
});
|
|
1967
|
+
}
|
|
1968
|
+
|
|
1969
|
+
return column;
|
|
1970
|
+
});
|
|
1971
|
+
}
|
|
1972
|
+
|
|
1973
|
+
var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
|
|
1974
|
+
primary: Object.assign(Object.assign({}, primary), {
|
|
1975
|
+
data: Object.assign(Object.assign({}, primary.data), {
|
|
1976
|
+
columns: newColumns
|
|
1977
|
+
})
|
|
1978
|
+
})
|
|
1979
|
+
});
|
|
1980
|
+
return React.createElement(Viz, Object.assign({
|
|
1981
|
+
dataSources: modifiedDatasources,
|
|
1982
|
+
options: options
|
|
1983
|
+
}, otherProps));
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1986
|
+
VizWithColumnsNullToZeros.propTypes = Viz.propTypes;
|
|
1987
|
+
VizWithColumnsNullToZeros.defaultProps = Viz.defaultProps;
|
|
1988
|
+
VizWithColumnsNullToZeros.config = Viz.config;
|
|
1989
|
+
return VizWithColumnsNullToZeros;
|
|
1990
|
+
};
|
|
1991
|
+
|
|
1992
|
+
var Map = withoutInternalFields(withNullToZeros(withDashboardViz_1.default({
|
|
1802
1993
|
ReactViz: PureMap_1.default,
|
|
1803
1994
|
vizConfig: config_1.default,
|
|
1804
1995
|
computeVizProps: exports.computeVizProps,
|
|
@@ -1806,7 +1997,7 @@ var Map = withDashboardViz_1.default({
|
|
|
1806
1997
|
useIconPlaceholder: function useIconPlaceholder() {
|
|
1807
1998
|
return false;
|
|
1808
1999
|
}
|
|
1809
|
-
});
|
|
2000
|
+
})));
|
|
1810
2001
|
var themes = config_1.default.themes;
|
|
1811
2002
|
exports.themes = themes;
|
|
1812
2003
|
exports.default = Map;
|
|
@@ -1819,12 +2010,18 @@ module.exports = require("@splunk/visualization-encoding/utils/types");
|
|
|
1819
2010
|
|
|
1820
2011
|
/***/ }),
|
|
1821
2012
|
/* 191 */
|
|
2013
|
+
/***/ (function(module, exports) {
|
|
2014
|
+
|
|
2015
|
+
module.exports = require("@splunk/visualization-encoding/utils/dsl");
|
|
2016
|
+
|
|
2017
|
+
/***/ }),
|
|
2018
|
+
/* 192 */
|
|
1822
2019
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1823
2020
|
|
|
1824
2021
|
"use strict";
|
|
1825
2022
|
|
|
1826
2023
|
|
|
1827
|
-
var _slicedToArray = __webpack_require__(
|
|
2024
|
+
var _slicedToArray = __webpack_require__(49);
|
|
1828
2025
|
|
|
1829
2026
|
Object.defineProperty(exports, "__esModule", {
|
|
1830
2027
|
value: true
|
|
@@ -1839,19 +2036,19 @@ var react_1 = __webpack_require__(1);
|
|
|
1839
2036
|
|
|
1840
2037
|
var T = __webpack_require__(0);
|
|
1841
2038
|
|
|
1842
|
-
var chroma = __webpack_require__(
|
|
2039
|
+
var chroma = __webpack_require__(193);
|
|
1843
2040
|
|
|
1844
2041
|
var maplibre_gl_1 = __webpack_require__(123);
|
|
1845
2042
|
|
|
1846
|
-
var MapContext_1 = __webpack_require__(
|
|
2043
|
+
var MapContext_1 = __webpack_require__(194);
|
|
1847
2044
|
|
|
1848
|
-
var PureMapContainer_1 = __webpack_require__(
|
|
2045
|
+
var PureMapContainer_1 = __webpack_require__(195);
|
|
1849
2046
|
|
|
1850
|
-
__webpack_require__(
|
|
2047
|
+
__webpack_require__(196);
|
|
1851
2048
|
|
|
1852
|
-
var MapUtils_1 = __webpack_require__(
|
|
2049
|
+
var MapUtils_1 = __webpack_require__(197);
|
|
1853
2050
|
|
|
1854
|
-
var Tooltip_1 = __webpack_require__(
|
|
2051
|
+
var Tooltip_1 = __webpack_require__(199);
|
|
1855
2052
|
|
|
1856
2053
|
exports.DEFAULT_CENTER = [0, 0];
|
|
1857
2054
|
exports.DEFAULT_CONTROL_BACKGROUND_COLOR = '#2b3033';
|
|
@@ -1915,12 +2112,12 @@ var PureMap = function PureMap(props) {
|
|
|
1915
2112
|
return [center[1], center[0]];
|
|
1916
2113
|
}, [center]);
|
|
1917
2114
|
var initializeMap = react_1.useCallback(function (mapStyle) {
|
|
1918
|
-
map.current = new maplibre_gl_1.Map({
|
|
2115
|
+
map.current = new maplibre_gl_1.Map(Object.assign({
|
|
1919
2116
|
container: basemapContainer.current,
|
|
1920
2117
|
style: mapStyle,
|
|
1921
2118
|
center: lngLatCenter,
|
|
1922
2119
|
zoom: zoom
|
|
1923
|
-
}); // Fired immediately after all necessary resources have been downloaded
|
|
2120
|
+
}, MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle))); // Fired immediately after all necessary resources have been downloaded
|
|
1924
2121
|
// and the first visually complete rendering of the map has occurred.
|
|
1925
2122
|
|
|
1926
2123
|
map.current.on('load', function () {
|
|
@@ -1972,6 +2169,13 @@ var PureMap = function PureMap(props) {
|
|
|
1972
2169
|
if (map.current) {
|
|
1973
2170
|
// Refer to https://maplibre.org/maplibre-gl-js-docs/api/map/#setstyle-example for options.diff (default is true)
|
|
1974
2171
|
map.current.setStyle(lodash_1.omit(mapStyle, ['theme', 'name', 'key']));
|
|
2172
|
+
|
|
2173
|
+
var _MapUtils_1$getZoomCo = MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle),
|
|
2174
|
+
minZoom = _MapUtils_1$getZoomCo.minZoom,
|
|
2175
|
+
maxZoom = _MapUtils_1$getZoomCo.maxZoom;
|
|
2176
|
+
|
|
2177
|
+
map.current.setMinZoom(minZoom);
|
|
2178
|
+
map.current.setMaxZoom(maxZoom);
|
|
1975
2179
|
updateScale();
|
|
1976
2180
|
} else {
|
|
1977
2181
|
// initialize the map only once with a constructed style from user configured options
|
|
@@ -2003,58 +2207,63 @@ var PureMap = function PureMap(props) {
|
|
|
2003
2207
|
var bubbles = [];
|
|
2004
2208
|
|
|
2005
2209
|
if (map.current && layers && layers.length && map.current.isStyleLoaded) {
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2210
|
+
try {
|
|
2211
|
+
if (layers[0].type === 'marker' && !('geobin' in layers[0])) {
|
|
2212
|
+
// support for only single layer
|
|
2213
|
+
var markerLayer = layers[0];
|
|
2214
|
+
markerLayer.seriesColors = markerLayer.seriesColors ? markerLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS;
|
|
2215
|
+
|
|
2216
|
+
cleanupLayer = function cleanupLayer() {
|
|
2217
|
+
if (markers) {
|
|
2218
|
+
markers.forEach(function (marker) {
|
|
2219
|
+
return marker === null || marker === void 0 ? void 0 : marker.remove();
|
|
2220
|
+
});
|
|
2221
|
+
markers = [];
|
|
2222
|
+
}
|
|
2223
|
+
};
|
|
2019
2224
|
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2225
|
+
if (markerLayer) {
|
|
2226
|
+
// Remove any existing markers
|
|
2227
|
+
cleanupLayer();
|
|
2228
|
+
var renderedMarkerLayer = MapUtils_1.renderMarkerLayer(markerLayer, themeColorScheme, map, setTooltipProps);
|
|
2229
|
+
markers = renderedMarkerLayer && renderedMarkerLayer.markers;
|
|
2230
|
+
}
|
|
2025
2231
|
}
|
|
2026
|
-
}
|
|
2027
2232
|
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2233
|
+
if (layers[0].type === 'bubble') {
|
|
2234
|
+
// support for only single layer
|
|
2235
|
+
var bubbleLayer = layers[0];
|
|
2236
|
+
bubbleLayer.seriesColors = bubbleLayer.seriesColors ? bubbleLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS; // update bubbles on events
|
|
2237
|
+
|
|
2238
|
+
cleanupLayer = function cleanupLayer() {
|
|
2239
|
+
if (bubbles && bubbles.length) {
|
|
2240
|
+
bubbles.forEach(function (bubble) {
|
|
2241
|
+
return bubble.remove();
|
|
2242
|
+
});
|
|
2243
|
+
bubbles = [];
|
|
2244
|
+
}
|
|
2245
|
+
}; // render bubbles with data returned from geostats cmds
|
|
2246
|
+
|
|
2041
2247
|
|
|
2248
|
+
if (bubbleLayer.geobin && bubbleLayer.bubbleSize) {
|
|
2249
|
+
bubbleLayer.seriesColors = bubbleLayer.seriesColors ? bubbleLayer.seriesColors : MapUtils_1.DEFAULT_SERIES_COLORS;
|
|
2250
|
+
var data = MapUtils_1.bakeBubbleData(bubbleLayer);
|
|
2251
|
+
var staticColors = MapUtils_1.getStaticColors(bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors);
|
|
2042
2252
|
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
var data = MapUtils_1.bakeBubbleData(bubbleLayer);
|
|
2046
|
-
var staticColors = MapUtils_1.getStaticColors(bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors);
|
|
2253
|
+
if (data && staticColors && staticColors.length) {
|
|
2254
|
+
cleanupLayer(); // render bubbles when layers options get update
|
|
2047
2255
|
|
|
2048
|
-
|
|
2049
|
-
// render bubbles when layers options get update
|
|
2050
|
-
bubbles = MapUtils_1.updateBubbles(data, zoom, staticColors, bubbleLayer.dataColors, themeColorScheme, map, setTooltipProps); // render bubbles on zoom
|
|
2256
|
+
bubbles = MapUtils_1.updateBubbles(data, zoom, staticColors, bubbleLayer.dataColors, themeColorScheme, map, setTooltipProps); // render bubbles on zoom
|
|
2051
2257
|
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2258
|
+
map.current.on('zoomend', function () {
|
|
2259
|
+
cleanupLayer();
|
|
2260
|
+
bubbles = MapUtils_1.updateBubbles(data, map.current.getZoom(), staticColors, bubbleLayer.dataColors, themeColorScheme, map, setTooltipProps);
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2056
2263
|
}
|
|
2057
2264
|
}
|
|
2265
|
+
} catch (err) {
|
|
2266
|
+
console.error(err);
|
|
2058
2267
|
}
|
|
2059
2268
|
}
|
|
2060
2269
|
|
|
@@ -2135,19 +2344,19 @@ PureMap.defaultProps = {
|
|
|
2135
2344
|
exports.default = PureMap;
|
|
2136
2345
|
|
|
2137
2346
|
/***/ }),
|
|
2138
|
-
/*
|
|
2347
|
+
/* 193 */
|
|
2139
2348
|
/***/ (function(module, exports) {
|
|
2140
2349
|
|
|
2141
2350
|
module.exports = require("chroma-js");
|
|
2142
2351
|
|
|
2143
2352
|
/***/ }),
|
|
2144
|
-
/*
|
|
2353
|
+
/* 194 */
|
|
2145
2354
|
/***/ (function(module, exports) {
|
|
2146
2355
|
|
|
2147
2356
|
module.exports = require("@splunk/visualization-context/MapContext");
|
|
2148
2357
|
|
|
2149
2358
|
/***/ }),
|
|
2150
|
-
/*
|
|
2359
|
+
/* 195 */
|
|
2151
2360
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2152
2361
|
|
|
2153
2362
|
"use strict";
|
|
@@ -2194,26 +2403,26 @@ var PureMapContainer = styled_components_1.default.div.withConfig({
|
|
|
2194
2403
|
exports.default = PureMapContainer;
|
|
2195
2404
|
|
|
2196
2405
|
/***/ }),
|
|
2197
|
-
/*
|
|
2406
|
+
/* 196 */
|
|
2198
2407
|
/***/ (function(module, exports) {
|
|
2199
2408
|
|
|
2200
2409
|
module.exports = require("maplibre-gl/dist/maplibre-gl.css");
|
|
2201
2410
|
|
|
2202
2411
|
/***/ }),
|
|
2203
|
-
/*
|
|
2412
|
+
/* 197 */
|
|
2204
2413
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2205
2414
|
|
|
2206
2415
|
"use strict";
|
|
2207
2416
|
|
|
2208
2417
|
|
|
2209
|
-
var _slicedToArray = __webpack_require__(
|
|
2418
|
+
var _slicedToArray = __webpack_require__(49);
|
|
2210
2419
|
|
|
2211
2420
|
var _toConsumableArray = __webpack_require__(39);
|
|
2212
2421
|
|
|
2213
2422
|
Object.defineProperty(exports, "__esModule", {
|
|
2214
2423
|
value: true
|
|
2215
2424
|
});
|
|
2216
|
-
exports.pieSegment = exports.createPieChart = exports.updateBubbles = exports.bakeBubbleData = exports.transposeArray = exports.matchSize = exports.getStaticColors = exports.getZoomLevelFromGeobin = exports.getMapStyle = exports.getTilePreset = exports.renderMarkerLayer = exports.getMarkerSVGBackgroundImg = exports.MAX_BUBBLE_RADIUS = exports.MIN_BUBBLE_RADIUS = exports.MAP_STYLE_VERSION_NUMBER = exports.DEFAULT_SERIES_COLORS = exports.DEFAULT_CLUSTER_COLOR = exports.DEFAULT_RESULT_LIMIT = void 0;
|
|
2425
|
+
exports.pieSegment = exports.createPieChart = exports.updateBubbles = exports.bakeBubbleData = exports.sanitizeValues = exports.transposeArray = exports.matchSize = exports.getStaticColors = exports.getZoomLevelFromGeobin = exports.getZoomConstraintsFromTileConfig = exports.getMapStyle = exports.getTilePreset = exports.renderMarkerLayer = exports.getMarkerSVGBackgroundImg = exports.MAX_BUBBLE_RADIUS = exports.MIN_BUBBLE_RADIUS = exports.MAP_STYLE_VERSION_NUMBER = exports.DEFAULT_SERIES_COLORS = exports.DEFAULT_CLUSTER_COLOR = exports.DEFAULT_RESULT_LIMIT = void 0;
|
|
2217
2426
|
|
|
2218
2427
|
var maplibre_gl_1 = __webpack_require__(123);
|
|
2219
2428
|
|
|
@@ -2225,16 +2434,17 @@ var colorUtils_1 = __webpack_require__(11);
|
|
|
2225
2434
|
|
|
2226
2435
|
var visualization_color_palettes_1 = __webpack_require__(41);
|
|
2227
2436
|
|
|
2228
|
-
var MarkerIcons_1 = __webpack_require__(
|
|
2437
|
+
var MarkerIcons_1 = __webpack_require__(198);
|
|
2229
2438
|
|
|
2230
2439
|
exports.DEFAULT_RESULT_LIMIT = 1000;
|
|
2231
2440
|
exports.DEFAULT_CLUSTER_COLOR = '#909090';
|
|
2232
2441
|
exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL; // MapLibre requires a map style specification number which is always 8
|
|
2233
2442
|
|
|
2234
|
-
exports.MAP_STYLE_VERSION_NUMBER = 8;
|
|
2443
|
+
exports.MAP_STYLE_VERSION_NUMBER = 8; // currently using one [min, max] value set for bubbles across all zoom levels
|
|
2444
|
+
// TODO: design choices on [min, max] bubble size for different zoom levels
|
|
2445
|
+
|
|
2235
2446
|
exports.MIN_BUBBLE_RADIUS = 4;
|
|
2236
|
-
exports.MAX_BUBBLE_RADIUS = 50; //
|
|
2237
|
-
// Returns marker background img with the requiref fillColor based on the theme
|
|
2447
|
+
exports.MAX_BUBBLE_RADIUS = 50; // Returns marker background img with the requiref fillColor based on the theme
|
|
2238
2448
|
|
|
2239
2449
|
var getMarkerSVGBackgroundImg = function getMarkerSVGBackgroundImg(color, theme) {
|
|
2240
2450
|
var fillColor = color.replace('#', '%23');
|
|
@@ -2424,15 +2634,59 @@ var getMapStyle = function getMapStyle(_ref2) {
|
|
|
2424
2634
|
|
|
2425
2635
|
exports.getMapStyle = getMapStyle;
|
|
2426
2636
|
|
|
2637
|
+
var getZoomConstraintsFromTileConfig = function getZoomConstraintsFromTileConfig(tileConfig) {
|
|
2638
|
+
var sources = tileConfig.sources,
|
|
2639
|
+
layers = tileConfig.layers; // check sources for minzoom maxzoom first
|
|
2640
|
+
|
|
2641
|
+
var sourceKeys = Object.keys(sources);
|
|
2642
|
+
|
|
2643
|
+
for (var i = 0; i < sourceKeys.length; i += 1) {
|
|
2644
|
+
var _sources$sourceKeys$i = sources[sourceKeys[i]],
|
|
2645
|
+
minzoom = _sources$sourceKeys$i.minzoom,
|
|
2646
|
+
maxzoom = _sources$sourceKeys$i.maxzoom;
|
|
2647
|
+
|
|
2648
|
+
if (lodash_1.isNumber(minzoom) && lodash_1.isNumber(maxzoom)) {
|
|
2649
|
+
return {
|
|
2650
|
+
minZoom: minzoom,
|
|
2651
|
+
maxZoom: maxzoom
|
|
2652
|
+
};
|
|
2653
|
+
}
|
|
2654
|
+
} // then check layers
|
|
2655
|
+
|
|
2656
|
+
|
|
2657
|
+
for (var _i = 0; _i < layers.length; _i += 1) {
|
|
2658
|
+
var _layers$_i = layers[_i],
|
|
2659
|
+
_minzoom = _layers$_i.minzoom,
|
|
2660
|
+
_maxzoom = _layers$_i.maxzoom;
|
|
2661
|
+
|
|
2662
|
+
if (lodash_1.isNumber(_minzoom) && lodash_1.isNumber(_maxzoom)) {
|
|
2663
|
+
return {
|
|
2664
|
+
minZoom: _minzoom,
|
|
2665
|
+
maxZoom: _maxzoom
|
|
2666
|
+
};
|
|
2667
|
+
}
|
|
2668
|
+
} // Maplibre default - would reset previous min/maxZoom
|
|
2669
|
+
|
|
2670
|
+
|
|
2671
|
+
return {
|
|
2672
|
+
minZoom: 0,
|
|
2673
|
+
maxZoom: 22
|
|
2674
|
+
};
|
|
2675
|
+
};
|
|
2676
|
+
|
|
2677
|
+
exports.getZoomConstraintsFromTileConfig = getZoomConstraintsFromTileConfig;
|
|
2678
|
+
|
|
2427
2679
|
var getZoomLevelFromGeobin = function getZoomLevelFromGeobin(geobinStr) {
|
|
2680
|
+
var _a;
|
|
2681
|
+
|
|
2428
2682
|
if (!geobinStr) {
|
|
2429
2683
|
return null;
|
|
2430
2684
|
} // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
|
|
2431
2685
|
|
|
2432
2686
|
|
|
2433
|
-
var geobinPattern = /
|
|
2434
|
-
var match =
|
|
2435
|
-
return match && parseInt(match[
|
|
2687
|
+
var geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;
|
|
2688
|
+
var match = geobinPattern.exec(geobinStr);
|
|
2689
|
+
return (_a = (match === null || match === void 0 ? void 0 : match.length) && parseInt(match[1], 10)) !== null && _a !== void 0 ? _a : null;
|
|
2436
2690
|
};
|
|
2437
2691
|
|
|
2438
2692
|
exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin; // Bubble colors - static
|
|
@@ -2485,7 +2739,26 @@ var transposeArray = function transposeArray(array) {
|
|
|
2485
2739
|
});
|
|
2486
2740
|
};
|
|
2487
2741
|
|
|
2488
|
-
exports.transposeArray = transposeArray;
|
|
2742
|
+
exports.transposeArray = transposeArray; // sanitize values: update all null, undefined, or negative values to 0
|
|
2743
|
+
|
|
2744
|
+
var sanitizeValues = function sanitizeValues(values) {
|
|
2745
|
+
// null / undefined
|
|
2746
|
+
if (!values) {
|
|
2747
|
+
return 0;
|
|
2748
|
+
} // number
|
|
2749
|
+
|
|
2750
|
+
|
|
2751
|
+
if (!Array.isArray(values)) {
|
|
2752
|
+
return values > 0 ? values : 0;
|
|
2753
|
+
} // array
|
|
2754
|
+
|
|
2755
|
+
|
|
2756
|
+
return values.map(function (arr) {
|
|
2757
|
+
return exports.sanitizeValues(arr);
|
|
2758
|
+
});
|
|
2759
|
+
};
|
|
2760
|
+
|
|
2761
|
+
exports.sanitizeValues = sanitizeValues;
|
|
2489
2762
|
|
|
2490
2763
|
var bakeBubbleData = function bakeBubbleData(layer) {
|
|
2491
2764
|
var _a;
|
|
@@ -2497,9 +2770,13 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
2497
2770
|
// format each value as an array to unify data operations for data series and frames
|
|
2498
2771
|
|
|
2499
2772
|
|
|
2773
|
+
var sanitizedBubbleSize = exports.sanitizeValues(layer.bubbleSize);
|
|
2500
2774
|
var transposedBubbleSize = layer.bubbleSize.map(function (n) {
|
|
2501
2775
|
return [n];
|
|
2502
2776
|
});
|
|
2777
|
+
var transposedSanitizedBubbleSize = sanitizedBubbleSize.map(function (n) {
|
|
2778
|
+
return [n];
|
|
2779
|
+
});
|
|
2503
2780
|
var isPie = false; // format array if bubbleSize is passed as an array of array (data frame)
|
|
2504
2781
|
|
|
2505
2782
|
if (typeof layer.bubbleSize[0] !== 'number') {
|
|
@@ -2510,7 +2787,8 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
2510
2787
|
// to [[column0data]]
|
|
2511
2788
|
// for easy access of values at each geo location,
|
|
2512
2789
|
// and min max pie size computation
|
|
2513
|
-
transposedBubbleSize = exports.transposeArray(layer.bubbleSize);
|
|
2790
|
+
transposedBubbleSize = exports.transposeArray(layer.bubbleSize);
|
|
2791
|
+
transposedSanitizedBubbleSize = exports.transposeArray(sanitizedBubbleSize); // if multiple series in the dataframe, set isPie to true
|
|
2514
2792
|
|
|
2515
2793
|
if (layer.bubbleSize.length > 1) {
|
|
2516
2794
|
isPie = true;
|
|
@@ -2525,13 +2803,16 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
2525
2803
|
return {
|
|
2526
2804
|
zoom: exports.getZoomLevelFromGeobin(layer.geobin[i]),
|
|
2527
2805
|
values: transposedBubbleSize[i],
|
|
2806
|
+
sanitizedValues: transposedSanitizedBubbleSize[i],
|
|
2528
2807
|
coordinates: [layer.longitude[i], lat]
|
|
2529
2808
|
};
|
|
2809
|
+
}).filter(function (d) {
|
|
2810
|
+
return Boolean(d.values);
|
|
2530
2811
|
}); // compute the min/max value to encode min/max pie or bubble size
|
|
2531
2812
|
|
|
2532
|
-
var min = lodash_1.sum(
|
|
2533
|
-
var max = lodash_1.sum(
|
|
2534
|
-
|
|
2813
|
+
var min = lodash_1.sum(transposedSanitizedBubbleSize[0]);
|
|
2814
|
+
var max = lodash_1.sum(transposedSanitizedBubbleSize[1]);
|
|
2815
|
+
transposedSanitizedBubbleSize.forEach(function (row) {
|
|
2535
2816
|
var bubbleSize = lodash_1.sum(row);
|
|
2536
2817
|
max = bubbleSize > max ? bubbleSize : max;
|
|
2537
2818
|
min = bubbleSize < min ? bubbleSize : min;
|
|
@@ -2541,7 +2822,6 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
2541
2822
|
dataRange: [min, max],
|
|
2542
2823
|
isPie: isPie,
|
|
2543
2824
|
resultLimit: layer.resultLimit,
|
|
2544
|
-
transposedBubbleSize: transposedBubbleSize,
|
|
2545
2825
|
bubbleSizeFields: layer.bubbleSizeFields
|
|
2546
2826
|
};
|
|
2547
2827
|
};
|
|
@@ -2556,7 +2836,6 @@ var updateBubbles = function updateBubbles(dataObj, zoomLevel, staticColors, dyn
|
|
|
2556
2836
|
var data = dataObj.data,
|
|
2557
2837
|
dataRange = dataObj.dataRange,
|
|
2558
2838
|
resultLimit = dataObj.resultLimit,
|
|
2559
|
-
transposedBubbleSize = dataObj.transposedBubbleSize,
|
|
2560
2839
|
bubbleSizeFields = dataObj.bubbleSizeFields,
|
|
2561
2840
|
isPie = dataObj.isPie;
|
|
2562
2841
|
|
|
@@ -2584,13 +2863,13 @@ var updateBubbles = function updateBubbles(dataObj, zoomLevel, staticColors, dyn
|
|
|
2584
2863
|
var colors = dynamicColors ? [dataToRender.map(function (obj) {
|
|
2585
2864
|
return colorUtils_1.isColor(dynamicColors[obj.idx]) ? dynamicColors[obj.idx] : exports.DEFAULT_CLUSTER_COLOR;
|
|
2586
2865
|
})[i]] : staticColors;
|
|
2587
|
-
var el = exports.createPieChart(datum.data.
|
|
2866
|
+
var el = exports.createPieChart(datum.data.sanitizedValues, dataRange, colors, themeColor, isPie);
|
|
2588
2867
|
|
|
2589
2868
|
var _datum$data$coordinat = _slicedToArray(datum.data.coordinates, 2),
|
|
2590
2869
|
longitude = _datum$data$coordinat[0],
|
|
2591
2870
|
latitude = _datum$data$coordinat[1];
|
|
2592
2871
|
|
|
2593
|
-
var bubbleSize =
|
|
2872
|
+
var bubbleSize = datum.data.values.map(function (count, index) {
|
|
2594
2873
|
return {
|
|
2595
2874
|
name: bubbleSizeFields[index],
|
|
2596
2875
|
count: count,
|
|
@@ -2620,7 +2899,25 @@ var updateBubbles = function updateBubbles(dataObj, zoomLevel, staticColors, dyn
|
|
|
2620
2899
|
|
|
2621
2900
|
exports.updateBubbles = updateBubbles; // Create an SVG pie from column values
|
|
2622
2901
|
|
|
2623
|
-
var createPieChart = function createPieChart(
|
|
2902
|
+
var createPieChart = function createPieChart(orginalValues, valueRange, colors, themeColor, isPie) {
|
|
2903
|
+
// create a div for pie (bubble)
|
|
2904
|
+
var el = document.createElement('div');
|
|
2905
|
+
var allZeros = true;
|
|
2906
|
+
orginalValues.forEach(function (v) {
|
|
2907
|
+
if (v !== 0) {
|
|
2908
|
+
allZeros = false;
|
|
2909
|
+
}
|
|
2910
|
+
});
|
|
2911
|
+
|
|
2912
|
+
if (allZeros || !orginalValues || !orginalValues.length) {
|
|
2913
|
+
return el;
|
|
2914
|
+
} // sanitize values
|
|
2915
|
+
|
|
2916
|
+
|
|
2917
|
+
var values = orginalValues.map(function (v) {
|
|
2918
|
+
return v > 0 ? v : 0;
|
|
2919
|
+
}); // compute offsets for pie segments
|
|
2920
|
+
|
|
2624
2921
|
var offsets = [];
|
|
2625
2922
|
var total = 0;
|
|
2626
2923
|
values.forEach(function (count) {
|
|
@@ -2641,7 +2938,6 @@ var createPieChart = function createPieChart(values, valueRange, colors, themeCo
|
|
|
2641
2938
|
html += exports.pieSegment(offsets[i] / total, (offsets[i] + v) / total, radius, colors[i], themeColor);
|
|
2642
2939
|
});
|
|
2643
2940
|
html += "</svg>\n </div>";
|
|
2644
|
-
var el = document.createElement('div');
|
|
2645
2941
|
el.className = 'custom-bubble';
|
|
2646
2942
|
el.innerHTML = html;
|
|
2647
2943
|
return el;
|
|
@@ -2667,7 +2963,7 @@ var pieSegment = function pieSegment(start, end, radius, color, themeColor) {
|
|
|
2667
2963
|
exports.pieSegment = pieSegment;
|
|
2668
2964
|
|
|
2669
2965
|
/***/ }),
|
|
2670
|
-
/*
|
|
2966
|
+
/* 198 */
|
|
2671
2967
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2672
2968
|
|
|
2673
2969
|
"use strict";
|
|
@@ -2691,7 +2987,7 @@ var defaultMarkerDarkTheme = function defaultMarkerDarkTheme(fillColor) {
|
|
|
2691
2987
|
exports.defaultMarkerDarkTheme = defaultMarkerDarkTheme;
|
|
2692
2988
|
|
|
2693
2989
|
/***/ }),
|
|
2694
|
-
/*
|
|
2990
|
+
/* 199 */
|
|
2695
2991
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2696
2992
|
|
|
2697
2993
|
"use strict";
|
|
@@ -2733,21 +3029,15 @@ var BubbleSizeColorBlock = styled_components_1.default.div.withConfig({
|
|
|
2733
3029
|
return props.color;
|
|
2734
3030
|
});
|
|
2735
3031
|
|
|
2736
|
-
var convertDegToDMS = function convertDegToDMS(
|
|
2737
|
-
var
|
|
2738
|
-
|
|
2739
|
-
|
|
2740
|
-
direction = deg < 0 ? 'W' : 'E';
|
|
2741
|
-
} else if (type === 'latitude') {
|
|
2742
|
-
direction = deg < 0 ? 'S' : 'N';
|
|
2743
|
-
}
|
|
3032
|
+
var convertDegToDMS = function convertDegToDMS(decimalDegree, type) {
|
|
3033
|
+
var truncate = function truncate(n) {
|
|
3034
|
+
return n > 0 ? Math.floor(n) : Math.ceil(n);
|
|
3035
|
+
};
|
|
2744
3036
|
|
|
2745
|
-
var
|
|
2746
|
-
var
|
|
2747
|
-
var minutes =
|
|
2748
|
-
var
|
|
2749
|
-
var seconds = Math.round(secfloat);
|
|
2750
|
-
degrees = Math.abs(degrees);
|
|
3037
|
+
var absoluteDegree = Math.abs(decimalDegree);
|
|
3038
|
+
var degrees = truncate(absoluteDegree);
|
|
3039
|
+
var minutes = truncate((absoluteDegree - degrees) * 60);
|
|
3040
|
+
var seconds = Math.round((absoluteDegree - degrees - minutes / 60) * 3600);
|
|
2751
3041
|
|
|
2752
3042
|
if (seconds === 60) {
|
|
2753
3043
|
minutes += 1;
|
|
@@ -2759,6 +3049,14 @@ var convertDegToDMS = function convertDegToDMS(deg, type) {
|
|
|
2759
3049
|
minutes = 0;
|
|
2760
3050
|
}
|
|
2761
3051
|
|
|
3052
|
+
var direction;
|
|
3053
|
+
|
|
3054
|
+
if (type === 'longitude') {
|
|
3055
|
+
direction = decimalDegree < 0 ? 'W' : 'E';
|
|
3056
|
+
} else if (type === 'latitude') {
|
|
3057
|
+
direction = decimalDegree < 0 ? 'S' : 'N';
|
|
3058
|
+
}
|
|
3059
|
+
|
|
2762
3060
|
return "".concat(degrees, "\xB0 ").concat(minutes, "' ").concat(seconds, "\" ").concat(direction);
|
|
2763
3061
|
};
|
|
2764
3062
|
|
|
@@ -2798,7 +3096,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
2798
3096
|
exports.default = Tooltip;
|
|
2799
3097
|
|
|
2800
3098
|
/***/ }),
|
|
2801
|
-
/*
|
|
3099
|
+
/* 200 */
|
|
2802
3100
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2803
3101
|
|
|
2804
3102
|
"use strict";
|
|
@@ -2820,7 +3118,7 @@ var i18n_1 = __webpack_require__(3);
|
|
|
2820
3118
|
|
|
2821
3119
|
var VizBehavior_1 = __webpack_require__(5);
|
|
2822
3120
|
|
|
2823
|
-
var VizCategory_1 = __webpack_require__(
|
|
3121
|
+
var VizCategory_1 = __webpack_require__(27);
|
|
2824
3122
|
|
|
2825
3123
|
var configUtils_1 = __webpack_require__(6);
|
|
2826
3124
|
|
|
@@ -2878,13 +3176,23 @@ var optionsSchema = {
|
|
|
2878
3176
|
}
|
|
2879
3177
|
},
|
|
2880
3178
|
layers: {
|
|
3179
|
+
// The option merging of defaults and data binding with editing UI happens with the default defined below.
|
|
3180
|
+
// The inner defaults for properties within anyOf objects is used only for code intellisense in UDF to populate options.
|
|
2881
3181
|
default: [{
|
|
2882
3182
|
type: 'bubble',
|
|
2883
3183
|
latitude: '> primary | seriesByName("latitude")',
|
|
2884
3184
|
longitude: '> primary | seriesByName("longitude")',
|
|
2885
3185
|
seriesColors: visualization_color_palettes_1.VIZ_CATEGORICAL,
|
|
2886
3186
|
bubbleSize: '> primary | frameWithoutSeriesNames("geobin", "latitude", "longitude") | frameBySeriesTypes("number")',
|
|
2887
|
-
tooltipFields: []
|
|
3187
|
+
tooltipFields: [],
|
|
3188
|
+
resultLimit: 1000
|
|
3189
|
+
}, {
|
|
3190
|
+
type: 'marker',
|
|
3191
|
+
latitude: '> primary | seriesByName("latitude")',
|
|
3192
|
+
longitude: '> primary | seriesByName("longitude")',
|
|
3193
|
+
seriesColors: visualization_color_palettes_1.VIZ_CATEGORICAL,
|
|
3194
|
+
tooltipFields: [],
|
|
3195
|
+
resultLimit: 1000
|
|
2888
3196
|
}],
|
|
2889
3197
|
type: 'array',
|
|
2890
3198
|
description: 'Specify the data visualization layers on top of the base map. Can be empty to only show the base map.',
|
|
@@ -2913,13 +3221,13 @@ var optionsSchema = {
|
|
|
2913
3221
|
type: ['string', 'array']
|
|
2914
3222
|
},
|
|
2915
3223
|
seriesColors: {
|
|
2916
|
-
default: visualization_color_palettes_1.VIZ_CATEGORICAL,
|
|
2917
3224
|
description: 'Specify the colors used for data points.',
|
|
2918
3225
|
type: 'array',
|
|
2919
3226
|
items: {
|
|
2920
3227
|
type: 'string',
|
|
2921
3228
|
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
|
|
2922
|
-
}
|
|
3229
|
+
},
|
|
3230
|
+
default: visualization_color_palettes_1.VIZ_CATEGORICAL
|
|
2923
3231
|
},
|
|
2924
3232
|
tooltipFields: {
|
|
2925
3233
|
description: 'Specify the fields to add to tooltips shown while hovering over data points. These fields and their corresponding values will be shown in addition to the ones displayed by default.',
|
|
@@ -2970,13 +3278,13 @@ var optionsSchema = {
|
|
|
2970
3278
|
type: ['string', 'array']
|
|
2971
3279
|
},
|
|
2972
3280
|
seriesColors: {
|
|
2973
|
-
default: visualization_color_palettes_1.VIZ_CATEGORICAL,
|
|
2974
3281
|
description: "Specify the colors used for data points. For example, [\"#FF0000\", \"#0000FF\", \"#008000\"].",
|
|
2975
3282
|
type: 'array',
|
|
2976
3283
|
items: {
|
|
2977
3284
|
type: 'string',
|
|
2978
3285
|
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
|
|
2979
|
-
}
|
|
3286
|
+
},
|
|
3287
|
+
default: visualization_color_palettes_1.VIZ_CATEGORICAL
|
|
2980
3288
|
},
|
|
2981
3289
|
tooltipFields: {
|
|
2982
3290
|
description: 'Specify the fields to add to tooltips shown while hovering over data points. These fields and their corresponding values will be shown in addition to the ones displayed by default.',
|
|
@@ -3088,7 +3396,7 @@ var editorConfig = [{
|
|
|
3088
3396
|
editor: 'editor.columnSelector',
|
|
3089
3397
|
showEditor: function showEditor(_ref) {
|
|
3090
3398
|
var options = _ref.options;
|
|
3091
|
-
return options.layers && options.layers.length && options.layers[0].type === '
|
|
3399
|
+
return !(options.layers && options.layers.length && options.layers[0].type === 'marker');
|
|
3092
3400
|
},
|
|
3093
3401
|
editorProps: {
|
|
3094
3402
|
dataSourceKey: 'primary'
|