@splunk/visualizations 25.1.0 → 25.3.0

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 (184) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Value_Highlighting.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Color_purple.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_custom.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_extraLarge.png +0 -0
  58. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
  59. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  60. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  61. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  62. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  63. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  64. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  65. package/Area.config.js +72 -22
  66. package/Area.config.js.map +1 -1
  67. package/Area.js +246 -185
  68. package/Area.js.map +1 -1
  69. package/Bar.config.js +17 -17
  70. package/Bar.config.js.map +1 -1
  71. package/Bar.js +191 -180
  72. package/Bar.js.map +1 -1
  73. package/Bubble.config.js +21 -14
  74. package/Bubble.config.js.map +1 -1
  75. package/Bubble.js +193 -175
  76. package/Bubble.js.map +1 -1
  77. package/ChoroplethSvg.config.js +6 -6
  78. package/ChoroplethSvg.config.js.map +1 -1
  79. package/ChoroplethSvg.js +180 -170
  80. package/ChoroplethSvg.js.map +1 -1
  81. package/Column.config.js +17 -17
  82. package/Column.config.js.map +1 -1
  83. package/Column.js +190 -180
  84. package/Column.js.map +1 -1
  85. package/Ellipse.config.js +3 -3
  86. package/Ellipse.config.js.map +1 -1
  87. package/Ellipse.js +144 -134
  88. package/Ellipse.js.map +1 -1
  89. package/Events.config.js +664 -0
  90. package/Events.config.js.map +1 -0
  91. package/Events.js +3114 -0
  92. package/Events.js.map +1 -0
  93. package/FillerGauge.config.js +20 -19
  94. package/FillerGauge.config.js.map +1 -1
  95. package/FillerGauge.js +183 -166
  96. package/FillerGauge.js.map +1 -1
  97. package/Image.config.js +5 -5
  98. package/Image.config.js.map +1 -1
  99. package/Image.js +128 -128
  100. package/Image.js.map +1 -1
  101. package/Line.config.js +73 -22
  102. package/Line.config.js.map +1 -1
  103. package/Line.js +253 -186
  104. package/Line.js.map +1 -1
  105. package/LinkGraph.config.js +15 -8
  106. package/LinkGraph.config.js.map +1 -1
  107. package/LinkGraph.js +25270 -434
  108. package/LinkGraph.js.map +1 -1
  109. package/Map.config.js +30 -29
  110. package/Map.config.js.map +1 -1
  111. package/Map.js +3064 -3125
  112. package/Map.js.map +1 -1
  113. package/Markdown.config.js +32 -10
  114. package/Markdown.config.js.map +1 -1
  115. package/Markdown.js +576 -529
  116. package/Markdown.js.map +1 -1
  117. package/MarkerGauge.config.js +16 -16
  118. package/MarkerGauge.config.js.map +1 -1
  119. package/MarkerGauge.js +1287 -1287
  120. package/MarkerGauge.js.map +1 -1
  121. package/ParallelCoordinates.config.js +14 -14
  122. package/ParallelCoordinates.config.js.map +1 -1
  123. package/ParallelCoordinates.js +532 -639
  124. package/ParallelCoordinates.js.map +1 -1
  125. package/Pie.config.js +16 -16
  126. package/Pie.config.js.map +1 -1
  127. package/Pie.js +1205 -1205
  128. package/Pie.js.map +1 -1
  129. package/Punchcard.config.js +14 -14
  130. package/Punchcard.config.js.map +1 -1
  131. package/Punchcard.js +2584 -2700
  132. package/Punchcard.js.map +1 -1
  133. package/Rectangle.config.js +7 -7
  134. package/Rectangle.config.js.map +1 -1
  135. package/Rectangle.js +726 -726
  136. package/Rectangle.js.map +1 -1
  137. package/Sankey.config.js +18 -18
  138. package/Sankey.config.js.map +1 -1
  139. package/Sankey.js +3132 -3253
  140. package/Sankey.js.map +1 -1
  141. package/Scatter.config.js +24 -16
  142. package/Scatter.config.js.map +1 -1
  143. package/Scatter.js +1402 -1395
  144. package/Scatter.js.map +1 -1
  145. package/SingleValue.config.js +11 -10
  146. package/SingleValue.config.js.map +1 -1
  147. package/SingleValue.js +2208 -2208
  148. package/SingleValue.js.map +1 -1
  149. package/SingleValueBasic.js +32 -32
  150. package/SingleValueBasic.js.map +1 -1
  151. package/SingleValueIcon.config.js +11 -10
  152. package/SingleValueIcon.config.js.map +1 -1
  153. package/SingleValueIcon.js +825 -966
  154. package/SingleValueIcon.js.map +1 -1
  155. package/SingleValueRadial.config.js +11 -10
  156. package/SingleValueRadial.config.js.map +1 -1
  157. package/SingleValueRadial.js +1897 -1897
  158. package/SingleValueRadial.js.map +1 -1
  159. package/Table.config.js +7 -7
  160. package/Table.config.js.map +1 -1
  161. package/Table.js +2158 -2155
  162. package/Table.js.map +1 -1
  163. package/common/EventsDoc.js +15 -8
  164. package/common/EventsDoc.js.map +1 -1
  165. package/common/GaugeMajorTicks.js +2 -2
  166. package/common/GaugeValueMarker.js +2 -2
  167. package/common/OptionsDoc.js +8 -8
  168. package/common/OptionsDoc.js.map +1 -1
  169. package/common/ThemesDoc.js +2 -2
  170. package/common/utils/configUtils.js +3 -3
  171. package/common/utils/configUtils.js.map +1 -1
  172. package/common/utils/dataUtils.js +136 -0
  173. package/common/utils/dataUtils.js.map +1 -0
  174. package/common/utils/hocUtils.js +2 -2
  175. package/common/utils/hocUtils.js.map +1 -1
  176. package/common/utils/mapUtils.js +11 -10
  177. package/common/utils/mapUtils.js.map +1 -1
  178. package/common/utils/singleValueUtils.js +3 -2
  179. package/common/utils/singleValueUtils.js.map +1 -1
  180. package/common/utils/testHelper.js +8 -8
  181. package/common/utils/testHelper.js.map +1 -1
  182. package/common/withDashboardViz.js +2 -2
  183. package/common/withDashboardViz.js.map +1 -1
  184. package/package.json +15 -13
package/Map.config.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 = 51);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 52);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -254,7 +254,7 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
254
254
  */
255
255
 
256
256
  function enhanceConfig(vizConfig) {
257
- var enhancedConfig = vizConfig;
257
+ var enhancedConfig = Object.assign({}, vizConfig);
258
258
 
259
259
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
260
260
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
@@ -262,7 +262,7 @@ function enhanceConfig(vizConfig) {
262
262
 
263
263
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
264
264
  return Object.assign(Object.assign({}, config), {
265
- open: false
265
+ open: config.open || false
266
266
  });
267
267
  });
268
268
  return enhancedConfig;
@@ -277,7 +277,7 @@ exports.enhanceConfig = enhanceConfig;
277
277
  */
278
278
 
279
279
  function uncollapseEditorConfig(vizConfig) {
280
- var editorPanelUncollapsedConfig = vizConfig;
280
+ var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
281
281
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
282
282
  return Object.assign(Object.assign({}, config), {
283
283
  open: true
@@ -437,28 +437,28 @@ module.exports = require("@splunk/visualization-icons/placeholders");
437
437
  module.exports = require("@splunk/visualization-icons");
438
438
 
439
439
  /***/ }),
440
- /* 13 */
440
+ /* 13 */,
441
+ /* 14 */
441
442
  /***/ (function(module, exports) {
442
443
 
443
444
  module.exports = require("@splunk/visualization-color-palettes");
444
445
 
445
446
  /***/ }),
446
- /* 14 */,
447
447
  /* 15 */,
448
448
  /* 16 */,
449
449
  /* 17 */,
450
450
  /* 18 */,
451
451
  /* 19 */,
452
452
  /* 20 */,
453
- /* 21 */,
454
- /* 22 */,
455
- /* 23 */,
456
- /* 24 */
453
+ /* 21 */
457
454
  /***/ (function(module, exports) {
458
455
 
459
456
  module.exports = require("@splunk/themes");
460
457
 
461
458
  /***/ }),
459
+ /* 22 */,
460
+ /* 23 */,
461
+ /* 24 */,
462
462
  /* 25 */,
463
463
  /* 26 */,
464
464
  /* 27 */,
@@ -485,7 +485,8 @@ module.exports = require("@splunk/themes");
485
485
  /* 48 */,
486
486
  /* 49 */,
487
487
  /* 50 */,
488
- /* 51 */
488
+ /* 51 */,
489
+ /* 52 */
489
490
  /***/ (function(module, exports, __webpack_require__) {
490
491
 
491
492
  "use strict";
@@ -501,9 +502,9 @@ var placeholders_1 = __webpack_require__(11);
501
502
 
502
503
  var schemaUtils_1 = __webpack_require__(3);
503
504
 
504
- var visualization_color_palettes_1 = __webpack_require__(13);
505
+ var visualization_color_palettes_1 = __webpack_require__(14);
505
506
 
506
- var themes_1 = __webpack_require__(24);
507
+ var themes_1 = __webpack_require__(21);
507
508
 
508
509
  var i18n_1 = __webpack_require__(0);
509
510
 
@@ -513,7 +514,7 @@ var VizCategory_1 = __webpack_require__(8);
513
514
 
514
515
  var configUtils_1 = __webpack_require__(4);
515
516
 
516
- var MapUtils_1 = __webpack_require__(52);
517
+ var MapUtils_1 = __webpack_require__(53);
517
518
 
518
519
  var defaultContext = {
519
520
  colorRangeConfig: [{
@@ -951,7 +952,7 @@ var config = {
951
952
  exports.default = configUtils_1.enhanceConfig(config);
952
953
 
953
954
  /***/ }),
954
- /* 52 */
955
+ /* 53 */
955
956
  /***/ (function(module, exports, __webpack_require__) {
956
957
 
957
958
  "use strict";
@@ -959,7 +960,7 @@ exports.default = configUtils_1.enhanceConfig(config);
959
960
 
960
961
  var _defineProperty = __webpack_require__(7);
961
962
 
962
- var _slicedToArray = __webpack_require__(53);
963
+ var _slicedToArray = __webpack_require__(54);
963
964
 
964
965
  var _toConsumableArray = __webpack_require__(1);
965
966
 
@@ -970,15 +971,15 @@ exports.formatMetadata = exports.compareBaseStyles = exports.getScaledOpacities
970
971
 
971
972
  var lodash_1 = __webpack_require__(6);
972
973
 
973
- var d3_scale_1 = __webpack_require__(54);
974
+ var d3_scale_1 = __webpack_require__(55);
974
975
 
975
- var chroma = __webpack_require__(55);
976
+ var chroma = __webpack_require__(56);
976
977
 
977
- var colorUtils_1 = __webpack_require__(56);
978
+ var colorUtils_1 = __webpack_require__(57);
978
979
 
979
- var visualization_color_palettes_1 = __webpack_require__(13);
980
+ var visualization_color_palettes_1 = __webpack_require__(14);
980
981
 
981
- var types_1 = __webpack_require__(57);
982
+ var types_1 = __webpack_require__(58);
982
983
 
983
984
  exports.MAX_LATITUDE = 90;
984
985
  exports.MIN_LATITUDE = -90;
@@ -1458,7 +1459,7 @@ var getScaledOpacities = function getScaledOpacities(colors) {
1458
1459
  exports.getScaledOpacities = getScaledOpacities;
1459
1460
 
1460
1461
  var compareBaseStyles = function compareBaseStyles(curr, next) {
1461
- var _a, _b, _c, _d, _e, _f;
1462
+ var _a, _b, _c, _d;
1462
1463
 
1463
1464
  var currBaseLayer = (_a = curr === null || curr === void 0 ? void 0 : curr.layers) === null || _a === void 0 ? void 0 : _a.find(function (layer) {
1464
1465
  return (layer === null || layer === void 0 ? void 0 : layer.id) === 'base-layer';
@@ -1466,8 +1467,8 @@ var compareBaseStyles = function compareBaseStyles(curr, next) {
1466
1467
  var nextBaseLayer = (_b = next === null || next === void 0 ? void 0 : next.layers) === null || _b === void 0 ? void 0 : _b.find(function (layer) {
1467
1468
  return (layer === null || layer === void 0 ? void 0 : layer.id) === 'base-layer';
1468
1469
  });
1469
- var currBaseSource = lodash_1.get(curr === null || curr === void 0 ? void 0 : curr.sources, (_d = (_c = currBaseLayer) === null || _c === void 0 ? void 0 : _c.source) !== null && _d !== void 0 ? _d : '');
1470
- var nextBaseSource = lodash_1.get(next === null || next === void 0 ? void 0 : next.sources, (_f = (_e = nextBaseLayer) === null || _e === void 0 ? void 0 : _e.source) !== null && _f !== void 0 ? _f : '');
1470
+ var currBaseSource = lodash_1.get(curr === null || curr === void 0 ? void 0 : curr.sources, (_c = currBaseLayer === null || currBaseLayer === void 0 ? void 0 : currBaseLayer.source) !== null && _c !== void 0 ? _c : '');
1471
+ var nextBaseSource = lodash_1.get(next === null || next === void 0 ? void 0 : next.sources, (_d = nextBaseLayer === null || nextBaseLayer === void 0 ? void 0 : nextBaseLayer.source) !== null && _d !== void 0 ? _d : '');
1471
1472
 
1472
1473
  if (!currBaseLayer || !nextBaseLayer || !currBaseSource || !nextBaseSource) {
1473
1474
  return false;
@@ -1498,31 +1499,31 @@ var formatMetadata = function formatMetadata(choroplethLayer, i) {
1498
1499
  exports.formatMetadata = formatMetadata;
1499
1500
 
1500
1501
  /***/ }),
1501
- /* 53 */
1502
+ /* 54 */
1502
1503
  /***/ (function(module, exports) {
1503
1504
 
1504
1505
  module.exports = require("@babel/runtime/helpers/slicedToArray");
1505
1506
 
1506
1507
  /***/ }),
1507
- /* 54 */
1508
+ /* 55 */
1508
1509
  /***/ (function(module, exports) {
1509
1510
 
1510
1511
  module.exports = require("d3-scale");
1511
1512
 
1512
1513
  /***/ }),
1513
- /* 55 */
1514
+ /* 56 */
1514
1515
  /***/ (function(module, exports) {
1515
1516
 
1516
1517
  module.exports = require("chroma-js");
1517
1518
 
1518
1519
  /***/ }),
1519
- /* 56 */
1520
+ /* 57 */
1520
1521
  /***/ (function(module, exports) {
1521
1522
 
1522
1523
  module.exports = require("@splunk/visualizations-shared/colorUtils");
1523
1524
 
1524
1525
  /***/ }),
1525
- /* 57 */
1526
+ /* 58 */
1526
1527
  /***/ (function(module, exports) {
1527
1528
 
1528
1529
  module.exports = require("@splunk/visualization-encoding/utils/types");
package/Map.config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/interfaces/VizCategory.ts","webpack:///external \"@splunk/visualization-icons/placeholders\"","webpack:///external \"@splunk/visualization-icons\"","webpack:///external \"@splunk/visualization-color-palettes\"","webpack:///external \"@splunk/themes\"","webpack:///./src/Map/config.ts","webpack:///./src/Map/PureMap/MapUtils.ts","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"d3-scale\"","webpack:///external \"chroma-js\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualization-encoding/utils/types\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;ACAA,qE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E;;;;;;ACAA,sE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;;AAGA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B;AAKA;;;;AAIG;;AACH,SAAS,sCAAT,CACI,aADJ,EACwD;AAEpD,MAAM,qBAAqB,GAAkB,EAA7C;AACA,QAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,OAA3B,CAAmC,UAAC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AAC,IAAD,CAAT,CAA9E;AACA,2CAAY,MAAZ,uBAAqB,GAArB,EAA2B,GAA3B;AACH,GAJM,EAIJ,IAJI,CAAP;AAKH,CAjBM;;AAAM,yBAAc,cAAd,C;;;;;;ACnfb,iE;;;;;;ACAA,qC;;;;;;ACAA,sC;;;;;;ACAA,qE;;;;;;ACAA,uE","file":"Map.config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 51);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = vizConfig;\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = vizConfig;\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n isDynamicOption,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","export enum VizCategory {\n SINGLE_VALUE = 'Single Value',\n TRENDS = 'Trends',\n COMPARISONS = 'Comparisons',\n TABLE = 'Table',\n GAUGE = 'Gauge',\n DISTRIBUTIONS = 'Distributions',\n CHOROPLETH = 'Choropleth Maps',\n SHAPES = 'Shapes',\n MISC = 'misc',\n FLOW = 'Flow',\n CORRELATION = 'Correlation',\n SPATIAL = 'Spatial',\n}\n","module.exports = require(\"@splunk/visualization-icons/placeholders\");","module.exports = require(\"@splunk/visualization-icons\");","module.exports = require(\"@splunk/visualization-color-palettes\");","module.exports = require(\"@splunk/themes\");","import { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { getPattern, COLOR_OR_TOKEN_PATTERN_WITH_RGBA } from '@splunk/visualizations-shared/schemaUtils';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { pick, variables } from '@splunk/themes';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { OptionsSchema } from '../common/interfaces/OptionsSchema';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport { LAYER_TYPE } from './PureMap/MapUtils';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst optionsSchema: OptionsSchema = {\n backgroundColor: {\n default: '> themes.defaultBackgroundColor',\n description:\n 'Specify a color for the background. You might use a dataSource to apply the color. The default for enterprise light is \"#FFFFFF\". The default for enterprise dark is \"#000000\". The default for prisma dark is \"#0B0C0E\".',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n type: 'string',\n },\n center: {\n type: 'array',\n description:\n 'Specify the center of the map in coordinates, in the form of [latitude, longitude]. If you don’t provide coordinates, the map automatically centers, based on available location data. If there is no available location data, the center of the map defaults to [37.7749, -122.4194].',\n items: { type: 'number' },\n },\n layers: {\n // The option merging of defaults and data binding with editing UI happens with the default defined below.\n // The inner defaults for properties within anyOf objects is used only for code intellisense in UDF to populate options.\n default: [\n {\n type: LAYER_TYPE.Bubble,\n latitude: '> primary | seriesByName(\"latitude\")',\n longitude: '> primary | seriesByName(\"longitude\")',\n seriesColors: VIZ_CATEGORICAL,\n bubbleSize:\n '> primary | frameWithoutSeriesNames(\"geobin\", \"latitude\", \"longitude\") | frameBySeriesTypes(\"number\")',\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n {\n type: LAYER_TYPE.Marker,\n latitude: '> primary | seriesByName(\"latitude\")',\n longitude: '> primary | seriesByName(\"longitude\")',\n seriesColors: VIZ_CATEGORICAL,\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n {\n type: LAYER_TYPE.Choropleth,\n areaIds: '> primary | seriesByType(\"string\")',\n areaValues: '> primary | seriesByType(\"number\")',\n dataColors: '> areaValues | gradient()',\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n ],\n type: 'array',\n description:\n 'Specify the optional data visualization layers over the base map. If empty, only the base map appears.',\n items: {\n anyOf: [\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Marker,\n },\n latitude: {\n description:\n 'Specify a dataSource series to apply latitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"latitude\")',\n },\n longitude: {\n description:\n 'Specify a dataSource series to apply longitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"longitude\")',\n },\n seriesColors: {\n description:\n 'Specify the colors to use for data points. If the dataColors option is specified, the seriesColors option is ignored. The seriesColors option applies to layers where type: \"bubble\" or type: \"marker\".',\n type: 'array',\n items: { type: 'string', pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA },\n default: VIZ_CATEGORICAL,\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Choropleth,\n },\n areaIds: {\n description:\n 'Specify a dataSource series to identify each area in the choropleth map layer. This applies to layers where type: \"choropleth\".',\n type: 'array',\n items: { type: 'string' },\n default: '> primary | seriesByType(\"string\")',\n },\n areaValues: {\n description:\n 'Specify a dataSource series that indicates the values for the choropleth map areas. This applies to layers where type: \"choropleth\".',\n type: 'array',\n items: { type: 'number' },\n default: '> primary | seriesByType(\"number\")',\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n default: '> areaValues | gradient()',\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Bubble,\n },\n bubbleSize: {\n description:\n 'Specify the data column to encode bubble size. This applies to layers where type: \"bubble\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default:\n '> primary | frameWithoutSeriesNames(\"geobin\", \"latitude\", \"longitude\") | frameBySeriesTypes(\"number\")',\n },\n latitude: {\n description:\n 'Specify a dataSource series to apply latitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"latitude\")',\n },\n longitude: {\n description:\n 'Specify a dataSource series to apply longitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"longitude\")',\n },\n seriesColors: {\n description:\n 'Specify the colors to use for data points. If the dataColors option is specified, the seriesColors option is ignored. The seriesColors option applies to layers where type: \"bubble\" or type: \"marker\".',\n type: 'array',\n items: { type: 'string', pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA },\n default: VIZ_CATEGORICAL,\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n ],\n },\n },\n scaleUnit: {\n default: 'metric',\n type: 'string',\n description: 'Specify the scale unit to use.',\n pattern: getPattern(['metric', 'imperial']),\n },\n // TODO: choropleth map retain old design\n // showBaseLayer: {\n // default: true,\n // type: 'boolean',\n // description: 'Specify if showing the base map.',\n // },\n showScale: {\n default: true,\n type: 'boolean',\n description: 'Specify whether to display the scale on the bottom left.',\n },\n baseLayerTileServer: {\n type: 'string',\n description: 'Specify the URL for the set of tiles that make up the base map.',\n },\n baseLayerTileServerType: {\n type: 'string',\n description: 'Specify the type of tile set for the base map.',\n pattern: getPattern(['vector', 'raster']),\n },\n zoom: {\n description: 'Specify the zoom level of the map.',\n type: 'number',\n },\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n};\n\nconst checkTypeIsChoropleth = options =>\n options.layers && options.layers.length && options.layers[0].type === LAYER_TYPE.Choropleth;\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data Layer Formatting'),\n layout: [\n [\n {\n label: _('Layer Type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Choropleth'), value: LAYER_TYPE.Choropleth },\n ],\n },\n },\n ],\n [\n {\n label: _('Region Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => checkTypeIsChoropleth(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => checkTypeIsChoropleth(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) =>\n !(options.layers && options.layers.length && options.layers[0].type === 'choropleth'),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) =>\n !(options.layers && options.layers.length && options.layers[0].type === 'choropleth'),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: 'Map',\n category: VizCategory.CHOROPLETH,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n","import { forEach, sum, isNumber, min as lodashMin, max as lodashMax, get, isEqual, isObject } from 'lodash';\nimport { LngLatBoundsLike } from 'maplibre-gl';\nimport type { Layer } from 'maplibre-gl';\nimport { scalePow } from 'd3-scale';\nimport * as chroma from 'chroma-js';\nimport type { MapContextInterface, BaseTileConfig } from '@splunk/visualization-context/MapContext';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { isNumber as isNumberUtil } from '@splunk/visualization-encoding/utils/types';\nimport type { GeoJsonDataType } from '@splunk/visualizations-shared/mapUtils';\n\nexport const MAX_LATITUDE = 90;\nexport const MIN_LATITUDE = -90;\nexport const MAX_LONGITUDE = 180;\nexport const MIN_LONGITUDE = -180;\nexport const DEFAULT_RESULT_LIMIT = 1000;\nexport const DEFAULT_CLUSTER_COLOR = '#909090';\nexport const DEFAULT_SERIES_COLORS = VIZ_CATEGORICAL;\n// MapLibre requires a map style specification number which is always 8\nexport const MAP_STYLE_VERSION_NUMBER = 8;\n// currently using one [min, max] value set for bubbles across all zoom levels\n// TODO: design choices on [min, max] bubble size for different zoom levels\nexport const MIN_BUBBLE_RADIUS = 7.11; // 10px\nexport const MAX_BUBBLE_RADIUS = 45.26; // 85px\nexport const DEFAULT_OPACITY = 0.8;\nconst LONGITUDE = 'longitude';\nconst LATITUDE = 'latitude';\n\nexport enum LAYER_TYPE {\n Marker = 'marker',\n Bubble = 'bubble',\n Choropleth = 'choropleth',\n}\n\ninterface GenericLayerType {\n type: string;\n latitude: number[];\n longitude: number[];\n dataColors?: string[];\n seriesColors: string[];\n additionalTooltipFields?: string[];\n resultLimit: number;\n metadata?: Array<{ [key: string]: number | string }>;\n}\n\nexport interface MarkerLayerType extends GenericLayerType {\n type: LAYER_TYPE.Marker;\n}\n\nexport interface BubbleLayerType extends GenericLayerType {\n type: LAYER_TYPE.Bubble;\n bubbleSize?: number[][] | number[];\n bubbleSizeFields: string[];\n geobin?: string[];\n}\n\ninterface BubbleLayerDatumType {\n zoom: number;\n values: number[];\n sanitizedValues: number[];\n coordinates: number[];\n}\n\nexport interface BubbleLayerDataType {\n data: BubbleLayerDatumType[];\n dataRange: number[];\n isPie: boolean;\n resultLimit: number;\n bubbleSizeFields: string[];\n}\n\nexport interface ChoroplethLayerType {\n type: LAYER_TYPE.Choropleth;\n areaIds: string[];\n areaValues: number[];\n dataColors: string[];\n additionalTooltipFields?: string[];\n geom: GeoJsonDataType[];\n resultLimit: number;\n metadata?: Array<{ [key: string]: number | string | GeoJsonDataType }>;\n}\n\n// todo(@ssahnoune) - look into this\nexport interface MapLayerClickPayloadType {\n name?: string;\n value?: string | number;\n /* cell values of all cells of clicked row with the field and value - in shape row.<field>.value */\n [key: string]: string | number;\n}\n\nexport type ClusterLayerType = BubbleLayerType | MarkerLayerType;\nexport type LayerType = ClusterLayerType | ChoroplethLayerType;\n/**\n * Construct a tile preset {key: config} by combining the default + custom tile configs\n * Also returns the default tile config for each theme - light/dark\n * @param {MapContextInterface} args\n * @param {BaseTileConfig[]} args.defaultTileConfig\n * @param {BaseTileConfig[]} args.customTileConfig\n * @returns {Object} tile preset\n */\nexport const getTilePreset = ({\n defaultTileConfig = [],\n customTileConfig = [],\n}: MapContextInterface): {\n tilePreset: Record<string, BaseTileConfig>;\n defaultTileLight: BaseTileConfig;\n defaultTileDark: BaseTileConfig;\n} => {\n const tilePreset = {};\n let defaultTileLight = {};\n let defaultTileDark = {};\n const tileConfigs = [].concat(defaultTileConfig).concat(customTileConfig);\n forEach(tileConfigs, tileConfig => {\n const key = tileConfig?.key;\n const updatedConfig = { theme: 'all', ...tileConfig, version: MAP_STYLE_VERSION_NUMBER };\n tilePreset[key] = updatedConfig;\n });\n\n if (defaultTileConfig.length > 0) {\n defaultTileLight =\n defaultTileConfig.find(config => config.theme === 'light') ??\n defaultTileConfig.find(config => config.theme === undefined);\n defaultTileDark =\n defaultTileConfig.find(config => config.theme === 'dark') ??\n defaultTileConfig.find(config => config.theme === undefined);\n }\n\n return { tilePreset, defaultTileLight, defaultTileDark };\n};\n\n/**\n * Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.\n * If no, construct a mapStyle with baseLayerTilerServer and baseLayerTileServerType\n * Else return default tile config based on current theme\n * @param {Object} args\n * @param {BaseTileConfig[]} args.tilePreset\n * @param {String} args.baseLayerTilerServer\n * @param {String} args.baseLayerTileServerType\n * @param {String} args.colorScheme\n * @param {BaseTileConfig} args.defaultTileDark\n * @param {BaseTileConfig} args.defaultTileLight\n * @returns {BaseTileConfig} mapStyle\n */\nexport const getMapStyle = ({\n baseLayerTileServer = '',\n baseLayerTileServerType = '',\n tilePreset = {},\n colorScheme = 'light',\n defaultTileLight = {},\n defaultTileDark = {},\n}: {\n baseLayerTileServer?: string;\n baseLayerTileServerType?: string;\n tilePreset?: Record<string, BaseTileConfig>;\n colorScheme?: string;\n defaultTileLight?: BaseTileConfig;\n defaultTileDark?: BaseTileConfig;\n}): BaseTileConfig => {\n if (\n baseLayerTileServer &&\n tilePreset[baseLayerTileServer] &&\n (tilePreset[baseLayerTileServer].theme === colorScheme ||\n tilePreset[baseLayerTileServer].theme === 'all')\n ) {\n return tilePreset[baseLayerTileServer];\n }\n\n if (baseLayerTileServer && baseLayerTileServerType) {\n let tiles = [];\n /**\n * Tile Server URLs (eg: http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png) can specify the variable {s} which refers to a subdomain\n * Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'\n * Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers\n */\n if (baseLayerTileServer.match(/^(https?):\\/\\/{(s|S)}\\../)) {\n /**\n * sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains\n * In order to preserve this behavior during conversion to splunk.map,\n * if the variable {s} or {S} is detected, replace it with 'a', 'b' and 'c' - default values for subdomains\n * TODO: in the future, add an additional prop - baseLayerTileServerSubdomains: ['x', 'y', 'z'], default being ['a', 'b', 'c']\n */\n tiles = [\n baseLayerTileServer.replace(/{(s|S)}/, 'a'),\n baseLayerTileServer.replace(/{(s|S)}/, 'b'),\n baseLayerTileServer.replace(/{(s|S)}/, 'c'),\n ];\n } else {\n tiles = [baseLayerTileServer];\n }\n // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options\n const mapStyle = {\n version: MAP_STYLE_VERSION_NUMBER,\n sources: {\n 'base-tiles': {\n type: baseLayerTileServerType,\n tiles,\n tileSize: 256,\n },\n },\n layers: [\n {\n id: 'base-layer',\n type: 'raster',\n source: 'base-tiles',\n minzoom: 0,\n maxzoom: 10,\n },\n ],\n };\n return mapStyle;\n }\n\n // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults\n return colorScheme === 'light' ? defaultTileLight : defaultTileDark;\n};\n\nexport interface ZoomConstraints {\n minZoom: number;\n maxZoom: number;\n}\n\nexport const getZoomConstraintsFromTileConfig = (\n tileConfig: BaseTileConfig,\n baseLayerTileServer?: string\n): ZoomConstraints => {\n const { sources, layers } = tileConfig;\n let matchedBaseLayerTileServer = false;\n // check sources for minzoom maxzoom first\n const sourceKeys = Object.keys(sources);\n for (let i = 0; i < sourceKeys.length; i += 1) {\n const { minzoom, maxzoom } = sources[sourceKeys[i]];\n if (baseLayerTileServer && sources[sourceKeys[i]].tiles.indexOf(baseLayerTileServer) !== -1) {\n matchedBaseLayerTileServer = true;\n }\n if (\n ((baseLayerTileServer && matchedBaseLayerTileServer) || !baseLayerTileServer) &&\n isNumber(minzoom) &&\n isNumber(maxzoom)\n ) {\n return {\n minZoom: minzoom,\n maxZoom: maxzoom,\n };\n }\n }\n // then check layers\n for (let i = 0; i < layers.length; i += 1) {\n const { minzoom, maxzoom } = layers[i];\n if (\n ((baseLayerTileServer && matchedBaseLayerTileServer) || !baseLayerTileServer) &&\n isNumber(minzoom) &&\n isNumber(maxzoom)\n ) {\n return {\n minZoom: minzoom,\n maxZoom: maxzoom,\n };\n }\n }\n // Maplibre default - would reset previous min/maxZoom\n return {\n minZoom: 0,\n maxZoom: 22,\n };\n};\n\nexport const getZoomLevelFromGeobin = (geobinStr: string): number => {\n if (!geobinStr) {\n return null;\n }\n // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range\n const geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;\n const match = geobinPattern.exec(geobinStr);\n return (match?.length && parseInt(match[1], 10)) ?? null;\n};\n\n// Bubble colors - static\nexport const getStaticColors = (colorCount: number, colorArray: string[]): string[] => {\n if (colorCount < 0 || !colorCount) {\n return [DEFAULT_CLUSTER_COLOR];\n }\n if (!colorArray || !colorArray.length) {\n return [...Array(colorCount).keys()].map(i => DEFAULT_SERIES_COLORS[i]);\n }\n // loop through colorArray to pick the first $colorCount colors\n // start from begining again if colorCount > colorArray.length\n return [...Array(colorCount).keys()].map(i =>\n isColor(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : DEFAULT_CLUSTER_COLOR\n );\n};\n\n// Bubble size\nexport const matchBubbleSize = (dataRange: number[], data: number): any => {\n const size = scalePow().exponent(0.2).domain(dataRange).range([MIN_BUBBLE_RADIUS, MAX_BUBBLE_RADIUS])(\n data\n );\n\n if (size > MAX_BUBBLE_RADIUS) {\n return MAX_BUBBLE_RADIUS;\n }\n if (size < MIN_BUBBLE_RADIUS) {\n return MIN_BUBBLE_RADIUS;\n }\n return size;\n};\n\nexport const transposeArray = (array: number[][]): number[][] => {\n if (!array || !array.length || !array[0] || !array[0].length) {\n return [];\n }\n return array[0].map((_, i) => array.map(row => row[i]));\n};\n\n// sanitize values: update all null, undefined, or negative values to 0\nexport const sanitizeValues = (values: number[] | number[][]) => {\n // null / undefined\n if (!values) {\n return 0;\n }\n // number\n if (!Array.isArray(values)) {\n return values > 0 ? values : 0;\n }\n // array\n return values.map(arr => sanitizeValues(arr));\n};\n\nexport const bakeBubbleData = (layer: BubbleLayerType): BubbleLayerDataType => {\n if (\n !layer ||\n !layer.bubbleSize?.length ||\n !layer.geobin ||\n !layer.geobin.length ||\n !layer.latitude ||\n !layer.latitude.length ||\n !layer.longitude ||\n !layer.longitude.length\n ) {\n return null;\n }\n // if bubbleSize is passed as an array of single number array (data series)\n // e.g. [value0, value1, ...]\n // format each value as an array to unify data operations for data series and frames\n const sanitizedBubbleSize = sanitizeValues(layer.bubbleSize);\n let transposedBubbleSize: number[][];\n let transposedSanitizedBubbleSize: number[][];\n let isPie = false;\n // format array if bubbleSize is passed as an array of array (data frame)\n if (Array.isArray(layer.bubbleSize[0])) {\n // one-time array transpose,\n // e.g. from [column0data, column0data] (multi series)\n // to [[column0datum0, column1datum0], [column0datum1, column1data1], ...]\n // or e.g. from [column0data] (single series)\n // to [[column0data]]\n // for easy access of values at each geo location,\n // and min max pie size computation\n transposedBubbleSize = transposeArray(layer.bubbleSize as number[][]);\n transposedSanitizedBubbleSize = transposeArray(sanitizedBubbleSize);\n // if multiple series in the dataframe, set isPie to true\n if (layer.bubbleSize.length > 1) {\n isPie = true;\n }\n } else {\n transposedBubbleSize = layer.bubbleSize.map(n => [n]);\n transposedSanitizedBubbleSize = sanitizedBubbleSize.map(n => [n]);\n }\n if (!transposedBubbleSize || !transposedBubbleSize.length) {\n return null;\n }\n const data = layer.latitude\n .map((lat, i) => ({\n zoom: getZoomLevelFromGeobin(layer.geobin[i]),\n values: transposedBubbleSize[i],\n sanitizedValues: transposedSanitizedBubbleSize[i],\n coordinates: [layer.longitude[i], lat],\n metadata: layer.metadata ? layer.metadata[i] : {},\n }))\n .filter(d => Boolean(d.values));\n\n // compute the min/max value to encode min/max pie or bubble size\n let min = sum(transposedSanitizedBubbleSize[0]);\n let max = sum(transposedSanitizedBubbleSize[1]);\n transposedSanitizedBubbleSize.forEach(row => {\n const bubbleSize = sum(row);\n max = bubbleSize > max ? bubbleSize : max;\n min = bubbleSize < min ? bubbleSize : min;\n });\n return {\n data,\n dataRange: [min, max],\n isPie,\n resultLimit: layer.resultLimit,\n bubbleSizeFields: layer.bubbleSizeFields,\n };\n};\n\nexport const isValidLatLon = (latlon: Array<number | string>): boolean => {\n if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {\n return false;\n }\n const [lat, lon] = latlon;\n if (!isNumberUtil(lat) || !(lat >= MIN_LATITUDE && lat <= MAX_LATITUDE)) {\n return false;\n }\n if (!isNumberUtil(lon) || !(lon >= MIN_LONGITUDE && lon <= MAX_LONGITUDE)) {\n return false;\n }\n return true;\n};\n\n/**\n * Returns a list of all lat or lon coordinates used in a specified layer\n * @param {LayerType[]} layer\n * @param {string} field\n * @returns {number[]} list of lat coordinates or lon coordinates\n */\nconst getLatOrLonCoordinates = (layer: LayerType, field: string): number[] => {\n const getClusterValues = (clusterLayer: ClusterLayerType): number[] =>\n get(clusterLayer, field, []).slice(\n 0,\n clusterLayer.type === LAYER_TYPE.Marker && clusterLayer.resultLimit\n ? clusterLayer.resultLimit\n : DEFAULT_RESULT_LIMIT\n );\n\n const getChoroplethValues = (choroplethLayer: ChoroplethLayerType): number[] => {\n const slicedGeomList = choroplethLayer.geom.slice(0, choroplethLayer.resultLimit);\n const flatCoordinates = slicedGeomList.flatMap(geomObject => geomObject.coordinates.flat(2));\n return flatCoordinates.map(coord => coord[field === LONGITUDE ? 0 : 1]);\n };\n\n return layer.type === LAYER_TYPE.Choropleth ? getChoroplethValues(layer) : getClusterValues(layer);\n};\n\n/**\n * Returns the min and max LongLat pairs to determine the layer boundaries to fit all markers/bubbles\n * @param {LayerType[]} layers\n * @returns {LngLatBoundsLike}\n */\nexport const getGlobalLayerBoundaries = (layers: LayerType[]): LngLatBoundsLike => {\n const isLayerValid = (field: string): boolean =>\n layers.every(layer => layer[field] || (layer as ChoroplethLayerType).geom);\n const getDefaultMax = (field: string) => (field === LONGITUDE ? MAX_LONGITUDE : MAX_LATITUDE);\n const getDefaultMin = (field: string) => (field === LONGITUDE ? MIN_LONGITUDE : MIN_LATITUDE);\n\n if (!layers || !Array.isArray(layers) || !layers.length) {\n return null;\n }\n\n const getMin = (field: string): number => {\n if (!isLayerValid(field)) {\n return getDefaultMin(field);\n }\n return layers.reduce((prevVal, layer) => {\n const coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(x => +x);\n return lodashMin([prevVal, ...coordinatesNumArr]);\n }, getDefaultMax(field));\n };\n\n const getMax = (field: string): number => {\n if (!isLayerValid(field)) {\n return getDefaultMax(field);\n }\n return layers.reduce((prevVal, layer) => {\n const coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(Number);\n return lodashMax([prevVal, ...coordinatesNumArr]);\n }, getDefaultMin(field));\n };\n\n return [\n [getMin(LONGITUDE), getMin(LATITUDE)],\n [getMax(LONGITUDE), getMax(LATITUDE)],\n ];\n};\n\nexport const getScaledOpacities = (colors: string[]): number[] => {\n // extract opacity information from 8 digit hex codes\n const opacities = colors?.map(color =>\n color?.length === 9 ? chroma(color).alpha() ?? DEFAULT_OPACITY : DEFAULT_OPACITY\n );\n // opacity cannot be greater than 0.8, otherwise it will block map labels\n return opacities?.filter(opacity => opacity > DEFAULT_OPACITY).length > 0\n ? opacities.map(opacity => opacity * DEFAULT_OPACITY)\n : opacities;\n};\n\nexport const compareBaseStyles = (curr, next): boolean => {\n const currBaseLayer = curr?.layers?.find(layer => layer?.id === 'base-layer');\n const nextBaseLayer = next?.layers?.find(layer => layer?.id === 'base-layer');\n const currBaseSource = get(curr?.sources, ((currBaseLayer as Layer)?.source as string) ?? '');\n const nextBaseSource = get(next?.sources, ((nextBaseLayer as Layer)?.source as string) ?? '');\n\n if (!currBaseLayer || !nextBaseLayer || !currBaseSource || !nextBaseSource) {\n return false;\n }\n\n return isEqual(currBaseLayer, nextBaseLayer) && isEqual(currBaseSource, nextBaseSource);\n};\n\nexport const formatMetadata = (\n choroplethLayer: ChoroplethLayerType,\n i: number\n): { [key: string]: string } => {\n if (!choroplethLayer || !choroplethLayer.areaIds || !choroplethLayer.areaValues) return {};\n if (i >= choroplethLayer.areaIds.length) return {};\n\n const metadata = choroplethLayer.metadata ? choroplethLayer.metadata[i] : {};\n const name = choroplethLayer.areaIds[i];\n const value = choroplethLayer.areaValues[i];\n const base = { name, value: String(value) };\n\n return Object.keys(metadata).reduce((result, curr) => {\n const key = `row.${curr}.value`;\n const val = isObject(metadata[curr]) ? JSON.stringify(metadata[curr]) : String(metadata[curr]);\n return { ...result, [key]: val };\n }, base);\n};\n","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"d3-scale\");","module.exports = require(\"chroma-js\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualization-encoding/utils/types\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"lodash\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/interfaces/VizCategory.ts","webpack:///external \"@splunk/visualization-icons/placeholders\"","webpack:///external \"@splunk/visualization-icons\"","webpack:///external \"@splunk/visualization-color-palettes\"","webpack:///external \"@splunk/themes\"","webpack:///./src/Map/config.ts","webpack:///./src/Map/PureMap/MapUtils.ts","webpack:///external \"@babel/runtime/helpers/slicedToArray\"","webpack:///external \"d3-scale\"","webpack:///external \"chroma-js\"","webpack:///external \"@splunk/visualizations-shared/colorUtils\"","webpack:///external \"@splunk/visualization-encoding/utils/types\""],"names":[],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;AClFA,kD;;;;;;ACAA,qE;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;;;;;;;;;;AAUG;AACH;AACA;AACA;;;;AAIG;;AACH;AACA;AACH,CArBD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E;;;;;;ACAA,sE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACAA;;AACA;;AAGA;;AAWA,IAAM,qBAAqB,GAAG;AAC1B,MAAI,EAAE,QADoB;AAE1B,SAAO,EAAE;AAFiB,CAA9B;AAKA;;;;AAIG;;AACH,SAAS,sCAAT,CACI,aADJ,EACwD;AAEpD,MAAM,qBAAqB,GAAkB,EAA7C;AACA,QAAM,CAAC,IAAP,CAAY,aAAZ,EAA2B,OAA3B,CAAmC,UAAC,GAAD,EAAc;AACvC,aAgBF,aAAa,CAhBX,GAgBW,CAhBX;AAAA,QAIF,KAJE,GAae,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3B;AACH,GAJM,EAIJ,IAJI,CAAP;AAKH,CAjBM;;AAAM,yBAAc,cAAd,C;;;;;;AClfb,iE;;;;;;ACAA,qC;;;;;;ACAA,sC;;;;;;ACAA,qE;;;;;;ACAA,uE","file":"Map.config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 52);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n}\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n isDynamicOption,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"lodash\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","export enum VizCategory {\n SINGLE_VALUE = 'Single Value',\n TRENDS = 'Trends',\n COMPARISONS = 'Comparisons',\n TABLE = 'Table',\n GAUGE = 'Gauge',\n DISTRIBUTIONS = 'Distributions',\n CHOROPLETH = 'Choropleth Maps',\n SHAPES = 'Shapes',\n MISC = 'misc',\n FLOW = 'Flow',\n CORRELATION = 'Correlation',\n SPATIAL = 'Spatial',\n}\n","module.exports = require(\"@splunk/visualization-icons/placeholders\");","module.exports = require(\"@splunk/visualization-icons\");","module.exports = require(\"@splunk/visualization-color-palettes\");","module.exports = require(\"@splunk/themes\");","import { Map as MapIcon } from '@splunk/visualization-icons';\nimport { Map as MapPlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { getPattern, COLOR_OR_TOKEN_PATTERN_WITH_RGBA } from '@splunk/visualizations-shared/schemaUtils';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { pick, variables } from '@splunk/themes';\nimport { _ } from '@splunk/ui-utils/i18n';\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { OptionsSchema } from '../common/interfaces/OptionsSchema';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport { LAYER_TYPE } from './PureMap/MapUtils';\n\nconst defaultContext: DefaultContext = {\n colorRangeConfig: [\n { to: 20, value: '#D41F1F' },\n { from: 20, to: 40, value: '#D94E17' },\n { from: 40, to: 60, value: '#CBA700' },\n { from: 60, to: 80, value: '#669922' },\n { from: 80, value: '#118832' },\n ],\n};\n\nconst dataContract: DataContract = {\n requiredDataSources: [],\n optionalDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization.',\n },\n ],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 800,\n initialHeight: 600,\n};\n\nconst optionsSchema: OptionsSchema = {\n backgroundColor: {\n default: '> themes.defaultBackgroundColor',\n description:\n 'Specify a color for the background. You might use a dataSource to apply the color. The default for enterprise light is \"#FFFFFF\". The default for enterprise dark is \"#000000\". The default for prisma dark is \"#0B0C0E\".',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n type: 'string',\n },\n center: {\n type: 'array',\n description:\n 'Specify the center of the map in coordinates, in the form of [latitude, longitude]. If you don’t provide coordinates, the map automatically centers, based on available location data. If there is no available location data, the center of the map defaults to [37.7749, -122.4194].',\n items: { type: 'number' },\n },\n layers: {\n // The option merging of defaults and data binding with editing UI happens with the default defined below.\n // The inner defaults for properties within anyOf objects is used only for code intellisense in UDF to populate options.\n default: [\n {\n type: LAYER_TYPE.Bubble,\n latitude: '> primary | seriesByName(\"latitude\")',\n longitude: '> primary | seriesByName(\"longitude\")',\n seriesColors: VIZ_CATEGORICAL,\n bubbleSize:\n '> primary | frameWithoutSeriesNames(\"geobin\", \"latitude\", \"longitude\") | frameBySeriesTypes(\"number\")',\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n {\n type: LAYER_TYPE.Marker,\n latitude: '> primary | seriesByName(\"latitude\")',\n longitude: '> primary | seriesByName(\"longitude\")',\n seriesColors: VIZ_CATEGORICAL,\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n {\n type: LAYER_TYPE.Choropleth,\n areaIds: '> primary | seriesByType(\"string\")',\n areaValues: '> primary | seriesByType(\"number\")',\n dataColors: '> areaValues | gradient()',\n additionalTooltipFields: [],\n resultLimit: 1000,\n },\n ],\n type: 'array',\n description:\n 'Specify the optional data visualization layers over the base map. If empty, only the base map appears.',\n items: {\n anyOf: [\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Marker,\n },\n latitude: {\n description:\n 'Specify a dataSource series to apply latitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"latitude\")',\n },\n longitude: {\n description:\n 'Specify a dataSource series to apply longitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"longitude\")',\n },\n seriesColors: {\n description:\n 'Specify the colors to use for data points. If the dataColors option is specified, the seriesColors option is ignored. The seriesColors option applies to layers where type: \"bubble\" or type: \"marker\".',\n type: 'array',\n items: { type: 'string', pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA },\n default: VIZ_CATEGORICAL,\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Choropleth,\n },\n areaIds: {\n description:\n 'Specify a dataSource series to identify each area in the choropleth map layer. This applies to layers where type: \"choropleth\".',\n type: 'array',\n items: { type: 'string' },\n default: '> primary | seriesByType(\"string\")',\n },\n areaValues: {\n description:\n 'Specify a dataSource series that indicates the values for the choropleth map areas. This applies to layers where type: \"choropleth\".',\n type: 'array',\n items: { type: 'number' },\n default: '> primary | seriesByType(\"number\")',\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n default: '> areaValues | gradient()',\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n {\n type: 'object',\n properties: {\n type: {\n description:\n 'Specify the type of data layer method to display points on the map. For example, “bubble”, “marker”, or \"choropleth\".',\n type: 'string',\n pattern: getPattern([\n LAYER_TYPE.Marker,\n LAYER_TYPE.Bubble,\n LAYER_TYPE.Choropleth,\n ]),\n default: LAYER_TYPE.Bubble,\n },\n bubbleSize: {\n description:\n 'Specify the data column to encode bubble size. This applies to layers where type: \"bubble\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default:\n '> primary | frameWithoutSeriesNames(\"geobin\", \"latitude\", \"longitude\") | frameBySeriesTypes(\"number\")',\n },\n latitude: {\n description:\n 'Specify a dataSource series to apply latitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"latitude\")',\n },\n longitude: {\n description:\n 'Specify a dataSource series to apply longitude coordinates for data points displayed on the map. This applies to layers where type: \"bubble\" or type: \"marker\".',\n type: ['string', 'array'],\n items: { type: 'number' },\n default: '> primary | seriesByName(\"longitude\")',\n },\n seriesColors: {\n description:\n 'Specify the colors to use for data points. If the dataColors option is specified, the seriesColors option is ignored. The seriesColors option applies to layers where type: \"bubble\" or type: \"marker\".',\n type: 'array',\n items: { type: 'string', pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA },\n default: VIZ_CATEGORICAL,\n },\n dataColors: {\n description:\n 'Specify the colors to use for data points. You can use an array of colors to be picked from, or you can use a dataSource to apply dynamic coloring. For example, “> primary | seriesByName(\"status\") | matchValue(colorMatchConfig)”. When type: \"choropleth\", dataColors is defined by default, and the opacities are shown at 80% of maximum to allow textual information to be visible in the map. By default, the dataColors option is not defined for type \"bubble\" or \"marker\".',\n type: ['string', 'array'],\n items: { type: 'string' },\n },\n additionalTooltipFields: {\n description:\n 'Specify the fields to add to the default set of tooltips. Tooltips appear when you hover over data points. These fields and their corresponding values are shown in addition to the ones displayed by default.',\n type: 'array',\n items: { type: 'string' },\n default: [],\n },\n resultLimit: {\n description:\n 'Specify the maximum number of data points to render on the map. Adjust the value to improve performance.',\n type: 'number',\n default: 1000,\n },\n },\n },\n ],\n },\n },\n scaleUnit: {\n default: 'metric',\n type: 'string',\n description: 'Specify the scale unit to use.',\n pattern: getPattern(['metric', 'imperial']),\n },\n // TODO: choropleth map retain old design\n // showBaseLayer: {\n // default: true,\n // type: 'boolean',\n // description: 'Specify if showing the base map.',\n // },\n showScale: {\n default: true,\n type: 'boolean',\n description: 'Specify whether to display the scale on the bottom left.',\n },\n baseLayerTileServer: {\n type: 'string',\n description: 'Specify the URL for the set of tiles that make up the base map.',\n },\n baseLayerTileServerType: {\n type: 'string',\n description: 'Specify the type of tile set for the base map.',\n pattern: getPattern(['vector', 'raster']),\n },\n zoom: {\n description: 'Specify the zoom level of the map.',\n type: 'number',\n },\n};\n\nconst themes: ThemedDefaults = {\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n controlBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.gray22(props),\n light: variables.white(props),\n },\n prisma: variables.backgroundColorPopup(props),\n })(props),\n controlForegroundColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: variables.contentColorDefault(props),\n })(props),\n};\n\nconst checkTypeIsChoropleth = options =>\n options.layers && options.layers.length && options.layers[0].type === LAYER_TYPE.Choropleth;\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data Layer Formatting'),\n layout: [\n [\n {\n label: _('Layer Type'),\n option: 'layers[0].type',\n editor: 'editor.select',\n editorProps: {\n values: [\n { label: _('Marker'), value: LAYER_TYPE.Marker },\n { label: _('Bubble'), value: LAYER_TYPE.Bubble },\n { label: _('Choropleth'), value: LAYER_TYPE.Choropleth },\n ],\n },\n },\n ],\n [\n {\n label: _('Region Area IDs'),\n option: 'layers[0].areaIds',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => checkTypeIsChoropleth(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['string'],\n },\n },\n ],\n [\n {\n label: _('Values'),\n option: 'layers[0].areaValues',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) => checkTypeIsChoropleth(options),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n filterByTypes: ['number'],\n },\n },\n ],\n [\n {\n label: _('Latitude'),\n option: 'layers[0].latitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) =>\n !(options.layers && options.layers.length && options.layers[0].type === 'choropleth'),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Longitude'),\n option: 'layers[0].longitude',\n editor: 'editor.columnSelector',\n showEditor: ({ options }) =>\n !(options.layers && options.layers.length && options.layers[0].type === 'choropleth'),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n },\n },\n ],\n [\n {\n label: _('Size'),\n option: 'layers[0].bubbleSize',\n editor: 'editor.columnMultiSelector',\n showEditor: ({ options }) =>\n !(\n options.layers &&\n options.layers.length &&\n (options.layers[0].type === 'marker' || options.layers[0].type === 'choropleth')\n ),\n editorProps: {\n dataSourceKey: 'primary',\n shouldShowInternalFields: false,\n excludeByNames: ['latitude', 'longitude', 'geobin'],\n },\n },\n ],\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.map',\n /**\n * viz name\n */\n name: 'Map',\n category: VizCategory.CHOROPLETH,\n status: 'preview',\n /**\n * viz icon\n */\n icon: MapIcon,\n placeholderIcon: MapPlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n events: {\n 'map.load': {\n description: 'triggered when map is fully loaded',\n },\n 'map.click': {\n description: 'trigger when user clicks map layer',\n },\n },\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.EVENTS, VizBehavior.PLACEHOLDER],\n themes,\n requiredProps: [],\n};\n\nexport default enhanceConfig(config);\n","import { forEach, sum, isNumber, min as lodashMin, max as lodashMax, get, isEqual, isObject } from 'lodash';\nimport { LngLatBoundsLike } from 'maplibre-gl';\nimport { scalePow } from 'd3-scale';\nimport * as chroma from 'chroma-js';\nimport type { MapContextInterface, BaseTileConfig } from '@splunk/visualization-context/MapContext';\nimport { isColor } from '@splunk/visualizations-shared/colorUtils';\nimport { VIZ_CATEGORICAL } from '@splunk/visualization-color-palettes';\nimport { isNumber as isNumberUtil } from '@splunk/visualization-encoding/utils/types';\nimport type { GeoJsonDataType } from '@splunk/visualizations-shared/mapUtils';\n\nexport const MAX_LATITUDE = 90;\nexport const MIN_LATITUDE = -90;\nexport const MAX_LONGITUDE = 180;\nexport const MIN_LONGITUDE = -180;\nexport const DEFAULT_RESULT_LIMIT = 1000;\nexport const DEFAULT_CLUSTER_COLOR = '#909090';\nexport const DEFAULT_SERIES_COLORS = VIZ_CATEGORICAL;\n// MapLibre requires a map style specification number which is always 8\nexport const MAP_STYLE_VERSION_NUMBER = 8;\n// currently using one [min, max] value set for bubbles across all zoom levels\n// TODO: design choices on [min, max] bubble size for different zoom levels\nexport const MIN_BUBBLE_RADIUS = 7.11; // 10px\nexport const MAX_BUBBLE_RADIUS = 45.26; // 85px\nexport const DEFAULT_OPACITY = 0.8;\nconst LONGITUDE = 'longitude';\nconst LATITUDE = 'latitude';\n\nexport enum LAYER_TYPE {\n Marker = 'marker',\n Bubble = 'bubble',\n Choropleth = 'choropleth',\n}\n\ninterface GenericLayerType {\n type: string;\n latitude: number[];\n longitude: number[];\n dataColors?: string[];\n seriesColors: string[];\n additionalTooltipFields?: string[];\n resultLimit: number;\n metadata?: Array<{ [key: string]: number | string }>;\n}\n\nexport interface MarkerLayerType extends GenericLayerType {\n type: LAYER_TYPE.Marker;\n}\n\nexport interface BubbleLayerType extends GenericLayerType {\n type: LAYER_TYPE.Bubble;\n bubbleSize?: number[][] | number[];\n bubbleSizeFields: string[];\n geobin?: string[];\n}\n\ninterface BubbleLayerDatumType {\n zoom: number;\n values: number[];\n sanitizedValues: number[];\n coordinates: number[];\n}\n\nexport interface BubbleLayerDataType {\n data: BubbleLayerDatumType[];\n dataRange: number[];\n isPie: boolean;\n resultLimit: number;\n bubbleSizeFields: string[];\n}\n\nexport interface ChoroplethLayerType {\n type: LAYER_TYPE.Choropleth;\n areaIds: string[];\n areaValues: number[];\n dataColors: string[];\n additionalTooltipFields?: string[];\n geom: GeoJsonDataType[];\n resultLimit: number;\n metadata?: Array<{ [key: string]: number | string | GeoJsonDataType }>;\n}\n\n// todo(@ssahnoune) - look into this\nexport interface MapLayerClickPayloadType {\n name?: string;\n value?: string | number;\n /* cell values of all cells of clicked row with the field and value - in shape row.<field>.value */\n [key: string]: string | number;\n}\n\nexport type ClusterLayerType = BubbleLayerType | MarkerLayerType;\nexport type LayerType = ClusterLayerType | ChoroplethLayerType;\n/**\n * Construct a tile preset {key: config} by combining the default + custom tile configs\n * Also returns the default tile config for each theme - light/dark\n * @param {MapContextInterface} args\n * @param {BaseTileConfig[]} args.defaultTileConfig\n * @param {BaseTileConfig[]} args.customTileConfig\n * @returns {Object} tile preset\n */\nexport const getTilePreset = ({\n defaultTileConfig = [],\n customTileConfig = [],\n}: MapContextInterface): {\n tilePreset: Record<string, BaseTileConfig>;\n defaultTileLight: BaseTileConfig;\n defaultTileDark: BaseTileConfig;\n} => {\n const tilePreset = {};\n let defaultTileLight = {};\n let defaultTileDark = {};\n const tileConfigs = [].concat(defaultTileConfig).concat(customTileConfig);\n forEach(tileConfigs, tileConfig => {\n const key = tileConfig?.key;\n const updatedConfig = { theme: 'all', ...tileConfig, version: MAP_STYLE_VERSION_NUMBER };\n tilePreset[key] = updatedConfig;\n });\n\n if (defaultTileConfig.length > 0) {\n defaultTileLight =\n defaultTileConfig.find(config => config.theme === 'light') ??\n defaultTileConfig.find(config => config.theme === undefined);\n defaultTileDark =\n defaultTileConfig.find(config => config.theme === 'dark') ??\n defaultTileConfig.find(config => config.theme === undefined);\n }\n\n return { tilePreset, defaultTileLight, defaultTileDark };\n};\n\n/**\n * Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.\n * If no, construct a mapStyle with baseLayerTilerServer and baseLayerTileServerType\n * Else return default tile config based on current theme\n * @param {Object} args\n * @param {BaseTileConfig[]} args.tilePreset\n * @param {String} args.baseLayerTilerServer\n * @param {String} args.baseLayerTileServerType\n * @param {String} args.colorScheme\n * @param {BaseTileConfig} args.defaultTileDark\n * @param {BaseTileConfig} args.defaultTileLight\n * @returns {BaseTileConfig} mapStyle\n */\nexport const getMapStyle = ({\n baseLayerTileServer = '',\n baseLayerTileServerType = '',\n tilePreset = {},\n colorScheme = 'light',\n defaultTileLight = {},\n defaultTileDark = {},\n}: {\n baseLayerTileServer?: string;\n baseLayerTileServerType?: string;\n tilePreset?: Record<string, BaseTileConfig>;\n colorScheme?: string;\n defaultTileLight?: BaseTileConfig;\n defaultTileDark?: BaseTileConfig;\n}): BaseTileConfig => {\n if (\n baseLayerTileServer &&\n tilePreset[baseLayerTileServer] &&\n (tilePreset[baseLayerTileServer].theme === colorScheme ||\n tilePreset[baseLayerTileServer].theme === 'all')\n ) {\n return tilePreset[baseLayerTileServer];\n }\n\n if (baseLayerTileServer && baseLayerTileServerType) {\n let tiles = [];\n /**\n * Tile Server URLs (eg: http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png) can specify the variable {s} which refers to a subdomain\n * Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'\n * Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers\n */\n if (baseLayerTileServer.match(/^(https?):\\/\\/{(s|S)}\\../)) {\n /**\n * sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains\n * In order to preserve this behavior during conversion to splunk.map,\n * if the variable {s} or {S} is detected, replace it with 'a', 'b' and 'c' - default values for subdomains\n * TODO: in the future, add an additional prop - baseLayerTileServerSubdomains: ['x', 'y', 'z'], default being ['a', 'b', 'c']\n */\n tiles = [\n baseLayerTileServer.replace(/{(s|S)}/, 'a'),\n baseLayerTileServer.replace(/{(s|S)}/, 'b'),\n baseLayerTileServer.replace(/{(s|S)}/, 'c'),\n ];\n } else {\n tiles = [baseLayerTileServer];\n }\n // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options\n const mapStyle = {\n version: MAP_STYLE_VERSION_NUMBER,\n sources: {\n 'base-tiles': {\n type: baseLayerTileServerType,\n tiles,\n tileSize: 256,\n },\n },\n layers: [\n {\n id: 'base-layer',\n type: 'raster',\n source: 'base-tiles',\n minzoom: 0,\n maxzoom: 10,\n },\n ],\n };\n return mapStyle;\n }\n\n // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults\n return colorScheme === 'light' ? defaultTileLight : defaultTileDark;\n};\n\nexport interface ZoomConstraints {\n minZoom: number;\n maxZoom: number;\n}\n\nexport const getZoomConstraintsFromTileConfig = (\n tileConfig: BaseTileConfig,\n baseLayerTileServer?: string\n): ZoomConstraints => {\n const { sources, layers } = tileConfig;\n let matchedBaseLayerTileServer = false;\n // check sources for minzoom maxzoom first\n const sourceKeys = Object.keys(sources);\n for (let i = 0; i < sourceKeys.length; i += 1) {\n const { minzoom, maxzoom } = sources[sourceKeys[i]];\n if (baseLayerTileServer && sources[sourceKeys[i]].tiles.indexOf(baseLayerTileServer) !== -1) {\n matchedBaseLayerTileServer = true;\n }\n if (\n ((baseLayerTileServer && matchedBaseLayerTileServer) || !baseLayerTileServer) &&\n isNumber(minzoom) &&\n isNumber(maxzoom)\n ) {\n return {\n minZoom: minzoom,\n maxZoom: maxzoom,\n };\n }\n }\n // then check layers\n for (let i = 0; i < layers.length; i += 1) {\n const { minzoom, maxzoom } = layers[i];\n if (\n ((baseLayerTileServer && matchedBaseLayerTileServer) || !baseLayerTileServer) &&\n isNumber(minzoom) &&\n isNumber(maxzoom)\n ) {\n return {\n minZoom: minzoom,\n maxZoom: maxzoom,\n };\n }\n }\n // Maplibre default - would reset previous min/maxZoom\n return {\n minZoom: 0,\n maxZoom: 22,\n };\n};\n\nexport const getZoomLevelFromGeobin = (geobinStr: string): number => {\n if (!geobinStr) {\n return null;\n }\n // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range\n const geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;\n const match = geobinPattern.exec(geobinStr);\n return (match?.length && parseInt(match[1], 10)) ?? null;\n};\n\n// Bubble colors - static\nexport const getStaticColors = (colorCount: number, colorArray: string[]): string[] => {\n if (colorCount < 0 || !colorCount) {\n return [DEFAULT_CLUSTER_COLOR];\n }\n if (!colorArray || !colorArray.length) {\n return [...Array(colorCount).keys()].map(i => DEFAULT_SERIES_COLORS[i]);\n }\n // loop through colorArray to pick the first $colorCount colors\n // start from begining again if colorCount > colorArray.length\n return [...Array(colorCount).keys()].map(i =>\n isColor(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : DEFAULT_CLUSTER_COLOR\n );\n};\n\n// Bubble size\nexport const matchBubbleSize = (dataRange: number[], data: number): any => {\n const size = scalePow().exponent(0.2).domain(dataRange).range([MIN_BUBBLE_RADIUS, MAX_BUBBLE_RADIUS])(\n data\n );\n\n if (size > MAX_BUBBLE_RADIUS) {\n return MAX_BUBBLE_RADIUS;\n }\n if (size < MIN_BUBBLE_RADIUS) {\n return MIN_BUBBLE_RADIUS;\n }\n return size;\n};\n\nexport const transposeArray = (array: number[][]): number[][] => {\n if (!array || !array.length || !array[0] || !array[0].length) {\n return [];\n }\n return array[0].map((_, i) => array.map(row => row[i]));\n};\n\n// sanitize values: update all null, undefined, or negative values to 0\nexport const sanitizeValues = (values: number[] | number[][]) => {\n // null / undefined\n if (!values) {\n return 0;\n }\n // number\n if (!Array.isArray(values)) {\n return values > 0 ? values : 0;\n }\n // array\n return values.map(arr => sanitizeValues(arr));\n};\n\nexport const bakeBubbleData = (layer: BubbleLayerType): BubbleLayerDataType => {\n if (\n !layer ||\n !layer.bubbleSize?.length ||\n !layer.geobin ||\n !layer.geobin.length ||\n !layer.latitude ||\n !layer.latitude.length ||\n !layer.longitude ||\n !layer.longitude.length\n ) {\n return null;\n }\n // if bubbleSize is passed as an array of single number array (data series)\n // e.g. [value0, value1, ...]\n // format each value as an array to unify data operations for data series and frames\n const sanitizedBubbleSize = sanitizeValues(layer.bubbleSize);\n let transposedBubbleSize: number[][];\n let transposedSanitizedBubbleSize: number[][];\n let isPie = false;\n // format array if bubbleSize is passed as an array of array (data frame)\n if (Array.isArray(layer.bubbleSize[0])) {\n // one-time array transpose,\n // e.g. from [column0data, column0data] (multi series)\n // to [[column0datum0, column1datum0], [column0datum1, column1data1], ...]\n // or e.g. from [column0data] (single series)\n // to [[column0data]]\n // for easy access of values at each geo location,\n // and min max pie size computation\n transposedBubbleSize = transposeArray(layer.bubbleSize as number[][]);\n transposedSanitizedBubbleSize = transposeArray(sanitizedBubbleSize);\n // if multiple series in the dataframe, set isPie to true\n if (layer.bubbleSize.length > 1) {\n isPie = true;\n }\n } else {\n transposedBubbleSize = layer.bubbleSize.map(n => [n]);\n transposedSanitizedBubbleSize = sanitizedBubbleSize.map(n => [n]);\n }\n if (!transposedBubbleSize || !transposedBubbleSize.length) {\n return null;\n }\n const data = layer.latitude\n .map((lat, i) => ({\n zoom: getZoomLevelFromGeobin(layer.geobin[i]),\n values: transposedBubbleSize[i],\n sanitizedValues: transposedSanitizedBubbleSize[i],\n coordinates: [layer.longitude[i], lat],\n metadata: layer.metadata ? layer.metadata[i] : {},\n }))\n .filter(d => Boolean(d.values));\n\n // compute the min/max value to encode min/max pie or bubble size\n let min = sum(transposedSanitizedBubbleSize[0]);\n let max = sum(transposedSanitizedBubbleSize[1]);\n transposedSanitizedBubbleSize.forEach(row => {\n const bubbleSize = sum(row);\n max = bubbleSize > max ? bubbleSize : max;\n min = bubbleSize < min ? bubbleSize : min;\n });\n return {\n data,\n dataRange: [min, max],\n isPie,\n resultLimit: layer.resultLimit,\n bubbleSizeFields: layer.bubbleSizeFields,\n };\n};\n\nexport const isValidLatLon = (latlon: Array<number | string>): boolean => {\n if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {\n return false;\n }\n const [lat, lon] = latlon;\n if (!isNumberUtil(lat) || !(lat >= MIN_LATITUDE && lat <= MAX_LATITUDE)) {\n return false;\n }\n if (!isNumberUtil(lon) || !(lon >= MIN_LONGITUDE && lon <= MAX_LONGITUDE)) {\n return false;\n }\n return true;\n};\n\n/**\n * Returns a list of all lat or lon coordinates used in a specified layer\n * @param {LayerType[]} layer\n * @param {string} field\n * @returns {number[]} list of lat coordinates or lon coordinates\n */\nconst getLatOrLonCoordinates = (layer: LayerType, field: string): number[] => {\n const getClusterValues = (clusterLayer: ClusterLayerType): number[] =>\n get(clusterLayer, field, []).slice(\n 0,\n clusterLayer.type === LAYER_TYPE.Marker && clusterLayer.resultLimit\n ? clusterLayer.resultLimit\n : DEFAULT_RESULT_LIMIT\n );\n\n const getChoroplethValues = (choroplethLayer: ChoroplethLayerType): number[] => {\n const slicedGeomList = choroplethLayer.geom.slice(0, choroplethLayer.resultLimit);\n const flatCoordinates = slicedGeomList.flatMap(geomObject => geomObject.coordinates.flat(2));\n return flatCoordinates.map(coord => coord[field === LONGITUDE ? 0 : 1]);\n };\n\n return layer.type === LAYER_TYPE.Choropleth ? getChoroplethValues(layer) : getClusterValues(layer);\n};\n\n/**\n * Returns the min and max LongLat pairs to determine the layer boundaries to fit all markers/bubbles\n * @param {LayerType[]} layers\n * @returns {LngLatBoundsLike}\n */\nexport const getGlobalLayerBoundaries = (layers: LayerType[]): LngLatBoundsLike => {\n const isLayerValid = (field: string): boolean =>\n layers.every(layer => layer[field] || (layer as ChoroplethLayerType).geom);\n const getDefaultMax = (field: string) => (field === LONGITUDE ? MAX_LONGITUDE : MAX_LATITUDE);\n const getDefaultMin = (field: string) => (field === LONGITUDE ? MIN_LONGITUDE : MIN_LATITUDE);\n\n if (!layers || !Array.isArray(layers) || !layers.length) {\n return null;\n }\n\n const getMin = (field: string): number => {\n if (!isLayerValid(field)) {\n return getDefaultMin(field);\n }\n return layers.reduce((prevVal, layer) => {\n const coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(x => +x);\n return lodashMin([prevVal, ...coordinatesNumArr]);\n }, getDefaultMax(field));\n };\n\n const getMax = (field: string): number => {\n if (!isLayerValid(field)) {\n return getDefaultMax(field);\n }\n return layers.reduce((prevVal, layer) => {\n const coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(Number);\n return lodashMax([prevVal, ...coordinatesNumArr]);\n }, getDefaultMin(field));\n };\n\n return [\n [getMin(LONGITUDE), getMin(LATITUDE)],\n [getMax(LONGITUDE), getMax(LATITUDE)],\n ];\n};\n\nexport const getScaledOpacities = (colors: string[]): number[] => {\n // extract opacity information from 8 digit hex codes\n const opacities = colors?.map(color =>\n color?.length === 9 ? chroma(color).alpha() ?? DEFAULT_OPACITY : DEFAULT_OPACITY\n );\n // opacity cannot be greater than 0.8, otherwise it will block map labels\n return opacities?.filter(opacity => opacity > DEFAULT_OPACITY).length > 0\n ? opacities.map(opacity => opacity * DEFAULT_OPACITY)\n : opacities;\n};\n\nexport const compareBaseStyles = (curr, next): boolean => {\n const currBaseLayer = curr?.layers?.find(layer => layer?.id === 'base-layer');\n const nextBaseLayer = next?.layers?.find(layer => layer?.id === 'base-layer');\n const currBaseSource = get(curr?.sources, (currBaseLayer?.source as string) ?? '');\n const nextBaseSource = get(next?.sources, (nextBaseLayer?.source as string) ?? '');\n\n if (!currBaseLayer || !nextBaseLayer || !currBaseSource || !nextBaseSource) {\n return false;\n }\n\n return isEqual(currBaseLayer, nextBaseLayer) && isEqual(currBaseSource, nextBaseSource);\n};\n\nexport const formatMetadata = (\n choroplethLayer: ChoroplethLayerType,\n i: number\n): { [key: string]: string } => {\n if (!choroplethLayer || !choroplethLayer.areaIds || !choroplethLayer.areaValues) return {};\n if (i >= choroplethLayer.areaIds.length) return {};\n\n const metadata = choroplethLayer.metadata ? choroplethLayer.metadata[i] : {};\n const name = choroplethLayer.areaIds[i];\n const value = choroplethLayer.areaValues[i];\n const base = { name, value: String(value) };\n\n return Object.keys(metadata).reduce((result, curr) => {\n const key = `row.${curr}.value`;\n const val = isObject(metadata[curr]) ? JSON.stringify(metadata[curr]) : String(metadata[curr]);\n return { ...result, [key]: val };\n }, base);\n};\n","module.exports = require(\"@babel/runtime/helpers/slicedToArray\");","module.exports = require(\"d3-scale\");","module.exports = require(\"chroma-js\");","module.exports = require(\"@splunk/visualizations-shared/colorUtils\");","module.exports = require(\"@splunk/visualization-encoding/utils/types\");"],"sourceRoot":""}