@splunk/visualizations 25.0.0 → 25.0.1

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 (142) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_dynamic_color.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color_with_no_seriesColors.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
  7. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  8. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  9. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  10. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  11. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  12. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  13. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  31. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  32. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Basic_Map.png +0 -0
  33. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer.png +0 -0
  34. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET.png +0 -0
  35. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
  36. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
  37. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Static_Coloring.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
  44. package/Area.config.js +26 -1
  45. package/Area.config.js.map +1 -1
  46. package/Area.js +49 -23
  47. package/Area.js.map +1 -1
  48. package/Bar.config.js +26 -1
  49. package/Bar.config.js.map +1 -1
  50. package/Bar.js +49 -23
  51. package/Bar.js.map +1 -1
  52. package/Bubble.config.js +26 -1
  53. package/Bubble.config.js.map +1 -1
  54. package/Bubble.js +49 -23
  55. package/Bubble.js.map +1 -1
  56. package/ChoroplethSvg.config.js +27 -3
  57. package/ChoroplethSvg.config.js.map +1 -1
  58. package/ChoroplethSvg.js +73 -48
  59. package/ChoroplethSvg.js.map +1 -1
  60. package/Column.config.js +26 -1
  61. package/Column.config.js.map +1 -1
  62. package/Column.js +49 -23
  63. package/Column.js.map +1 -1
  64. package/Ellipse.config.js +26 -1
  65. package/Ellipse.config.js.map +1 -1
  66. package/Ellipse.js +58 -32
  67. package/Ellipse.js.map +1 -1
  68. package/FillerGauge.config.js +27 -2
  69. package/FillerGauge.config.js.map +1 -1
  70. package/FillerGauge.js +60 -34
  71. package/FillerGauge.js.map +1 -1
  72. package/Image.config.js +27 -3
  73. package/Image.config.js.map +1 -1
  74. package/Image.js +58 -34
  75. package/Image.js.map +1 -1
  76. package/Line.config.js +26 -1
  77. package/Line.config.js.map +1 -1
  78. package/Line.js +49 -23
  79. package/Line.js.map +1 -1
  80. package/LinkGraph.config.js +26 -1
  81. package/LinkGraph.config.js.map +1 -1
  82. package/LinkGraph.js +87 -61
  83. package/LinkGraph.js.map +1 -1
  84. package/Map.config.js +42 -5
  85. package/Map.config.js.map +1 -1
  86. package/Map.js +100 -60
  87. package/Map.js.map +1 -1
  88. package/Markdown.config.js +28 -5
  89. package/Markdown.config.js.map +1 -1
  90. package/Markdown.js +58 -35
  91. package/Markdown.js.map +1 -1
  92. package/MarkerGauge.config.js +31 -7
  93. package/MarkerGauge.config.js.map +1 -1
  94. package/MarkerGauge.js +2939 -3022
  95. package/MarkerGauge.js.map +1 -1
  96. package/ParallelCoordinates.config.js +35 -10
  97. package/ParallelCoordinates.config.js.map +1 -1
  98. package/ParallelCoordinates.js +61 -35
  99. package/ParallelCoordinates.js.map +1 -1
  100. package/Pie.config.js +32 -8
  101. package/Pie.config.js.map +1 -1
  102. package/Pie.js +2242 -2330
  103. package/Pie.js.map +1 -1
  104. package/Punchcard.config.js +28 -5
  105. package/Punchcard.config.js.map +1 -1
  106. package/Punchcard.js +72 -48
  107. package/Punchcard.js.map +1 -1
  108. package/Rectangle.config.js +28 -3
  109. package/Rectangle.config.js.map +1 -1
  110. package/Rectangle.js +155 -130
  111. package/Rectangle.js.map +1 -1
  112. package/Sankey.config.js +30 -5
  113. package/Sankey.config.js.map +1 -1
  114. package/Sankey.js +107 -82
  115. package/Sankey.js.map +1 -1
  116. package/Scatter.config.js +29 -3
  117. package/Scatter.config.js.map +1 -1
  118. package/Scatter.js +47 -22
  119. package/Scatter.js.map +1 -1
  120. package/SingleValue.config.js +33 -7
  121. package/SingleValue.config.js.map +1 -1
  122. package/SingleValue.js +63 -38
  123. package/SingleValue.js.map +1 -1
  124. package/SingleValueBasic.js +2 -2
  125. package/SingleValueIcon.config.js +31 -5
  126. package/SingleValueIcon.config.js.map +1 -1
  127. package/SingleValueIcon.js +71 -45
  128. package/SingleValueIcon.js.map +1 -1
  129. package/SingleValueRadial.config.js +160 -165
  130. package/SingleValueRadial.config.js.map +1 -1
  131. package/SingleValueRadial.js +112 -87
  132. package/SingleValueRadial.js.map +1 -1
  133. package/Table.config.js +31 -6
  134. package/Table.config.js.map +1 -1
  135. package/Table.js +249 -224
  136. package/Table.js.map +1 -1
  137. package/common/OptionsDoc.js +26 -1
  138. package/common/OptionsDoc.js.map +1 -1
  139. package/common/utils/configUtils.js +26 -1
  140. package/common/utils/configUtils.js.map +1 -1
  141. package/common/withDashboardViz.js +2 -2
  142. package/package.json +10 -10
package/Map.config.js CHANGED
@@ -123,7 +123,7 @@ var __rest = this && this.__rest || function (s, e) {
123
123
  Object.defineProperty(exports, "__esModule", {
124
124
  value: true
125
125
  });
126
- exports.insertLayout = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
126
+ exports.insertLayout = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
127
127
 
128
128
  var lodash_1 = __webpack_require__(5);
129
129
 
@@ -198,8 +198,10 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
198
198
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
199
199
  /**
200
200
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
201
+ * this function also collapse all editor panels
201
202
  * @param vizConfig a Visualization Config
202
203
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
204
+ * and containing `open: false` for all editor panels in editorConfig
203
205
  */
204
206
 
205
207
  function enhanceConfig(vizConfig) {
@@ -209,10 +211,33 @@ function enhanceConfig(vizConfig) {
209
211
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
210
212
  }
211
213
 
214
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
215
+ return Object.assign(Object.assign({}, config), {
216
+ open: false
217
+ });
218
+ });
212
219
  return enhancedConfig;
213
220
  }
214
221
 
215
222
  exports.enhanceConfig = enhanceConfig;
223
+ /**
224
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
225
+ * Created for editor unit tests
226
+ * @param vizConfig a Visualization Config
227
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
228
+ */
229
+
230
+ function uncollapseEditorConfig(vizConfig) {
231
+ var editorPanelUncollapsedConfig = vizConfig;
232
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
233
+ return Object.assign(Object.assign({}, config), {
234
+ open: true
235
+ });
236
+ });
237
+ return editorPanelUncollapsedConfig;
238
+ }
239
+
240
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
216
241
 
217
242
  function isDynamicOption(option) {
218
243
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
@@ -952,6 +977,8 @@ var colorUtils_1 = __webpack_require__(55);
952
977
 
953
978
  var visualization_color_palettes_1 = __webpack_require__(12);
954
979
 
980
+ var types_1 = __webpack_require__(56);
981
+
955
982
  exports.MAX_LATITUDE = 90;
956
983
  exports.MIN_LATITUDE = -90;
957
984
  exports.MAX_LONGITUDE = 180;
@@ -1316,11 +1343,11 @@ var isValidLatLon = function isValidLatLon(latlon) {
1316
1343
  lat = _latlon[0],
1317
1344
  lon = _latlon[1];
1318
1345
 
1319
- if (typeof lat !== 'number' || !(lat >= exports.MIN_LATITUDE && lat <= exports.MAX_LATITUDE)) {
1346
+ if (!types_1.isNumber(lat) || !(lat >= exports.MIN_LATITUDE && lat <= exports.MAX_LATITUDE)) {
1320
1347
  return false;
1321
1348
  }
1322
1349
 
1323
- if (typeof lon !== 'number' || !(lon >= exports.MIN_LONGITUDE && lon <= exports.MAX_LONGITUDE)) {
1350
+ if (!types_1.isNumber(lon) || !(lon >= exports.MIN_LONGITUDE && lon <= exports.MAX_LONGITUDE)) {
1324
1351
  return false;
1325
1352
  }
1326
1353
 
@@ -1384,7 +1411,10 @@ var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
1384
1411
  }
1385
1412
 
1386
1413
  return layers.reduce(function (prevVal, layer) {
1387
- return lodash_1.min([prevVal].concat(_toConsumableArray(getLatOrLonCoordinates(layer, field))));
1414
+ var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(function (x) {
1415
+ return +x;
1416
+ });
1417
+ return lodash_1.min([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
1388
1418
  }, getDefaultMax(field));
1389
1419
  };
1390
1420
 
@@ -1394,7 +1424,8 @@ var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
1394
1424
  }
1395
1425
 
1396
1426
  return layers.reduce(function (prevVal, layer) {
1397
- return lodash_1.max([prevVal].concat(_toConsumableArray(getLatOrLonCoordinates(layer, field))));
1427
+ var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(Number);
1428
+ return lodash_1.max([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
1398
1429
  }, getDefaultMin(field));
1399
1430
  };
1400
1431
 
@@ -1484,6 +1515,12 @@ module.exports = require("chroma-js");
1484
1515
 
1485
1516
  module.exports = require("@splunk/visualizations-shared/colorUtils");
1486
1517
 
1518
+ /***/ }),
1519
+ /* 56 */
1520
+ /***/ (function(module, exports) {
1521
+
1522
+ module.exports = require("@splunk/visualization-encoding/utils/types");
1523
+
1487
1524
  /***/ })
1488
1525
  /******/ ]);
1489
1526
  //# sourceMappingURL=Map.config.js.map
package/Map.config.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","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\""],"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;;AACA;;AAEA;;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,EAbf,CAIF,KAJE;AAAA,QAKF,WALE,GAae,EAbf,CAKF,WALE;AAAA,QAMF,QANE,GAae,EAbf,CAMF,QANE;AAAA,QAOF,SAPE,GAae,EAbf,CAOF,SAPE;AAAA,QAQF,QARE,GA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C,MAAD,EAAS,IAAT,EAAiB;AACjD,QAAM,GAAG,iBAAU,IAAV,WAAT;AACA,QAAM,GAAG,GAAG,kBAAS,QAAQ,CAAC,IAAD,CAAjB,IAA2B,IAAI,CAAC,SAAL,CAAe,QAAQ,CAAC,IAAD,CAAvB,CAA3B,GAA4D,MAAM,CAAC,QAAQ,CAAC,IAAD,CAAT,CAA9E;AACA,2CAAY,MAAZ,uBAAqB,GAArB,EAA2B,GAA3B;AACH,GAJM,EAIJ,IAJI,CAAP;AAKH,CAjBM;;AAAM,yBAAc,cAAd,C;;;;;;ACneb,iE;;;;;;ACAA,qC;;;;;;ACAA,sC;;;;;;ACAA,qE","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 = 50);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig } 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 * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\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 return enhancedConfig;\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 isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\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(\"@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\");","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 { 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 = (tileConfig: BaseTileConfig): ZoomConstraints => {\n const { sources, layers } = tileConfig;\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 (isNumber(minzoom) && isNumber(maxzoom)) {\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 (isNumber(minzoom) && isNumber(maxzoom)) {\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>): boolean => {\n if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {\n return false;\n }\n const [lat, lon] = latlon;\n if (typeof lat !== 'number' || !(lat >= MIN_LATITUDE && lat <= MAX_LATITUDE)) {\n return false;\n }\n if (typeof lon !== 'number' || !(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(\n (prevVal, layer) => lodashMin([prevVal, ...getLatOrLonCoordinates(layer, field)]),\n getDefaultMax(field)\n );\n };\n\n const getMax = (field: string): number => {\n if (!isLayerValid(field)) {\n return getDefaultMax(field);\n }\n return layers.reduce(\n (prevVal, layer) => lodashMax([prevVal, ...getLatOrLonCoordinates(layer, field)]),\n getDefaultMin(field)\n );\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\");"],"sourceRoot":""}
1
+ {"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","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;;AACA;;AAEA;;AA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CAAC,IAAD,CAAjB,IAA2B,IAAI,CAAC,SAAL,CAAe,QAAQ,CAAC,IAAD,CAAvB,CAA3B,GAA4D,MAAM,CAAC,QAAQ,CAAC,IAAD,CAAT,CAA9E;AACA,2CAAY,MAAZ,uBAAqB,GAArB,EAA2B,GAA3B;AACH,GAJM,EAIJ,IAJI,CAAP;AAKH,CAjBM;;AAAM,yBAAc,cAAd,C;;;;;;ACpeb,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 = 50);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\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 isDynamicOption,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\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(\"@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\");","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 { GeoJsonDataType } from '@splunk/visualizations-shared/mapUtils';\nimport { isNumber as isNumberUtil } from '@splunk/visualization-encoding/utils/types';\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 = (tileConfig: BaseTileConfig): ZoomConstraints => {\n const { sources, layers } = tileConfig;\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 (isNumber(minzoom) && isNumber(maxzoom)) {\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 (isNumber(minzoom) && isNumber(maxzoom)) {\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":""}