@splunk/visualizations 26.0.0 → 26.1.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 (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/Map.config.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 56);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 57);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -114,6 +114,7 @@ Object.defineProperty(exports, "__esModule", {
114
114
  });
115
115
  exports.VizBehavior = void 0;
116
116
  var VizBehavior;
117
+
117
118
  (function (VizBehavior) {
118
119
  /**
119
120
  * Dynamic Options Behavior.
@@ -133,6 +134,7 @@ var VizBehavior;
133
134
  * missing.
134
135
  * @type {string}
135
136
  */
137
+
136
138
  VizBehavior["PLACEHOLDER"] = "placeholder";
137
139
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
138
140
  VizBehavior["TRELLIS"] = "trellis";
@@ -152,24 +154,33 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
152
154
 
153
155
 
154
156
  var _toConsumableArray = __webpack_require__(1);
157
+
155
158
  var _defineProperty = __webpack_require__(7);
159
+
156
160
  var __rest = this && this.__rest || function (s, e) {
157
161
  var t = {};
162
+
158
163
  for (var p in s) {
159
164
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
160
165
  }
166
+
161
167
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
162
168
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
163
169
  }
164
170
  return t;
165
171
  };
172
+
166
173
  Object.defineProperty(exports, "__esModule", {
167
174
  value: true
168
175
  });
169
176
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
177
+
170
178
  var lodash_1 = __webpack_require__(6);
179
+
171
180
  var schemaUtils_1 = __webpack_require__(3);
181
+
172
182
  var VizBehavior_1 = __webpack_require__(2);
183
+
173
184
  var dynamicOptionsDSLType = {
174
185
  type: 'string',
175
186
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -179,20 +190,22 @@ var dynamicOptionsDSLType = {
179
190
  * @param optionsSchema a visualization's options schema
180
191
  * @returns an updated options schema that additionally allows strings starting with > for each option
181
192
  */
193
+
182
194
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
183
195
  var enhancedOptionsSchema = {};
184
196
  Object.keys(optionsSchema).forEach(function (key) {
185
197
  var _a = optionsSchema[key],
186
- title = _a.title,
187
- description = _a.description,
188
- readOnly = _a.readOnly,
189
- writeOnly = _a.writeOnly,
190
- examples = _a.examples,
191
- defaultValue = _a.default,
192
- type = _a.type,
193
- properties = _a.properties,
194
- patternProperties = _a.patternProperties,
195
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
198
+ title = _a.title,
199
+ description = _a.description,
200
+ readOnly = _a.readOnly,
201
+ writeOnly = _a.writeOnly,
202
+ examples = _a.examples,
203
+ defaultValue = _a.default,
204
+ type = _a.type,
205
+ properties = _a.properties,
206
+ patternProperties = _a.patternProperties,
207
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
208
+
196
209
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
197
210
  title: title
198
211
  }), description !== undefined && {
@@ -206,12 +219,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
206
219
  }), defaultValue !== undefined && {
207
220
  default: defaultValue
208
221
  });
222
+
209
223
  if (type === 'object') {
210
224
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
211
225
  type: type
212
226
  }), properties && {
213
227
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
214
228
  });
229
+
215
230
  if (patternProperties) {
216
231
  var enhancedPatternProperties = {};
217
232
  Object.keys(patternProperties).forEach(function (opt) {
@@ -229,6 +244,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
229
244
  });
230
245
  return enhancedOptionsSchema;
231
246
  }
247
+
232
248
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
233
249
  /**
234
250
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -237,11 +253,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
237
253
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
238
254
  * and containing `open: false` for all editor panels in editorConfig
239
255
  */
256
+
240
257
  function enhanceConfig(vizConfig) {
241
258
  var enhancedConfig = Object.assign({}, vizConfig);
259
+
242
260
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
243
261
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
244
262
  }
263
+
245
264
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
246
265
  return Object.assign(Object.assign({}, config), {
247
266
  open: config.open || false
@@ -249,6 +268,7 @@ function enhanceConfig(vizConfig) {
249
268
  });
250
269
  return enhancedConfig;
251
270
  }
271
+
252
272
  exports.enhanceConfig = enhanceConfig;
253
273
  /**
254
274
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -256,6 +276,7 @@ exports.enhanceConfig = enhanceConfig;
256
276
  * @param vizConfig a Visualization Config
257
277
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
258
278
  */
279
+
259
280
  function uncollapseEditorConfig(vizConfig) {
260
281
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
261
282
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -265,13 +286,16 @@ function uncollapseEditorConfig(vizConfig) {
265
286
  });
266
287
  return editorPanelUncollapsedConfig;
267
288
  }
289
+
268
290
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
291
+
269
292
  function isDynamicOption(option) {
270
293
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
271
294
  }
272
- exports.isDynamicOption = isDynamicOption;
273
- // private helpers to improve readability of getInitialPreset
295
+
296
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
274
297
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
298
+
275
299
  /**
276
300
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
277
301
  * 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
@@ -280,6 +304,7 @@ exports.isDynamicOption = isDynamicOption;
280
304
  *
281
305
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
282
306
  */
307
+
283
308
  function hasCompatibleContexts(vizContext, presetContext) {
284
309
  var presetContextKeys = Object.keys(presetContext);
285
310
  return presetContextKeys.every(function (contextKey) {
@@ -289,6 +314,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
289
314
  /**
290
315
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
291
316
  */
317
+
318
+
292
319
  function hasCompatibleOptions(vizOptions, presetOptions) {
293
320
  var presetOptionKeys = Object.keys(presetOptions);
294
321
  return presetOptionKeys.every(function (optionKey) {
@@ -303,18 +330,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
303
330
  * @param {Object} vizOptions - the current vizOptions definition
304
331
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
305
332
  */
333
+
334
+
306
335
  function getInitialPreset(vizContext, vizOptions, presets) {
307
336
  return presets.find(function (preset) {
308
337
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
309
338
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
310
339
  var presetContextKeys = Object.keys(presetContext);
311
- var presetOptionKeys = Object.keys(presetOptions);
312
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
340
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
313
341
  // if not, then the preset is invalid in config.ts
342
+
314
343
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
315
344
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
316
345
  });
317
346
  }
347
+
318
348
  exports.getInitialPreset = getInitialPreset;
319
349
  /**
320
350
  * generates number precision values for a Select editor
@@ -322,6 +352,7 @@ exports.getInitialPreset = getInitialPreset;
322
352
  * @param {Number} numPrecisionValues - number of integer precision values to generate
323
353
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
324
354
  */
355
+
325
356
  function generatePrecisionValues(numPrecisionValues) {
326
357
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
327
358
  return {
@@ -330,6 +361,7 @@ function generatePrecisionValues(numPrecisionValues) {
330
361
  };
331
362
  });
332
363
  }
364
+
333
365
  exports.generatePrecisionValues = generatePrecisionValues;
334
366
  /**
335
367
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -339,12 +371,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
339
371
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
340
372
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
341
373
  */
374
+
342
375
  var insertLayout = function insertLayout(layout, index) {
343
376
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
344
377
  layoutItems[_key - 2] = arguments[_key];
345
378
  }
379
+
346
380
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
347
381
  };
382
+
348
383
  exports.insertLayout = insertLayout;
349
384
 
350
385
  /***/ }),
@@ -372,6 +407,7 @@ Object.defineProperty(exports, "__esModule", {
372
407
  });
373
408
  exports.VizCategory = void 0;
374
409
  var VizCategory;
410
+
375
411
  (function (VizCategory) {
376
412
  VizCategory["SINGLE_VALUE"] = "Single Value";
377
413
  VizCategory["TRENDS"] = "Trends";
@@ -411,11 +447,13 @@ module.exports = require("@splunk/visualization-icons");
411
447
  Object.defineProperty(exports, "__esModule", {
412
448
  value: true
413
449
  });
450
+
414
451
  var i18n_1 = __webpack_require__(0);
452
+
415
453
  var background = function background(_ref) {
416
454
  var label = _ref.label,
417
- themes = _ref.themes,
418
- labelPosition = _ref.labelPosition;
455
+ themes = _ref.themes,
456
+ labelPosition = _ref.labelPosition;
419
457
  return [{
420
458
  label: (0, i18n_1._)(label || 'Background'),
421
459
  option: 'backgroundColor',
@@ -426,6 +464,7 @@ var background = function background(_ref) {
426
464
  }
427
465
  }];
428
466
  };
467
+
429
468
  exports.default = background;
430
469
 
431
470
  /***/ }),
@@ -481,7 +520,8 @@ module.exports = require("@splunk/themes");
481
520
  /* 53 */,
482
521
  /* 54 */,
483
522
  /* 55 */,
484
- /* 56 */
523
+ /* 56 */,
524
+ /* 57 */
485
525
  /***/ (function(module, exports, __webpack_require__) {
486
526
 
487
527
  "use strict";
@@ -490,17 +530,29 @@ module.exports = require("@splunk/themes");
490
530
  Object.defineProperty(exports, "__esModule", {
491
531
  value: true
492
532
  });
533
+
493
534
  var visualization_icons_1 = __webpack_require__(12);
535
+
494
536
  var placeholders_1 = __webpack_require__(11);
537
+
495
538
  var schemaUtils_1 = __webpack_require__(3);
539
+
496
540
  var visualization_color_palettes_1 = __webpack_require__(14);
541
+
497
542
  var themes_1 = __webpack_require__(21);
543
+
498
544
  var i18n_1 = __webpack_require__(0);
545
+
499
546
  var VizBehavior_1 = __webpack_require__(2);
547
+
500
548
  var VizCategory_1 = __webpack_require__(8);
549
+
501
550
  var configUtils_1 = __webpack_require__(4);
502
- var MapUtils_1 = __webpack_require__(57);
551
+
552
+ var MapUtils_1 = __webpack_require__(58);
553
+
503
554
  var BackgroundColor_1 = __webpack_require__(13);
555
+
504
556
  var defaultContext = {
505
557
  colorRangeConfig: [{
506
558
  to: 20,
@@ -860,12 +912,15 @@ var themes = {
860
912
  })(props);
861
913
  }
862
914
  };
915
+
863
916
  var checkTypeIsChoropleth = function checkTypeIsChoropleth(options) {
864
917
  return options.layers && options.layers.length && options.layers[0].type === MapUtils_1.LAYER_TYPE.Choropleth;
865
918
  };
919
+
866
920
  var checkTypeIsLocalChoropleth = function checkTypeIsLocalChoropleth(options) {
867
921
  return options.layers && options.layers.length && options.layers[0].type === MapUtils_1.LAYER_TYPE.Choropleth && (options.layers[0].source === 'geo://default/us' || options.layers[0].source === 'geo://default/world');
868
922
  };
923
+
869
924
  var EDITOR_LABEL_WIDTH = 140;
870
925
  var editorConfig = [{
871
926
  label: (0, i18n_1._)('Data configurations'),
@@ -1033,8 +1088,7 @@ var editorConfig = [{
1033
1088
  }]]
1034
1089
  }, {
1035
1090
  label: (0, i18n_1._)('Color and style'),
1036
- layout: [
1037
- // TODO: add support for color mode option and its corresponding editor
1091
+ layout: [// TODO: add support for color mode option and its corresponding editor
1038
1092
  // [
1039
1093
  // {
1040
1094
  // label: _('Color mode'),
@@ -1056,8 +1110,7 @@ var editorConfig = [{
1056
1110
  var options = _ref8.options;
1057
1111
  return !(options.layers && options.layers.length && options.layers[0].type === 'choropleth');
1058
1112
  }
1059
- }],
1060
- // TODO: add editor for data colors
1113
+ }], // TODO: add editor for data colors
1061
1114
  // [
1062
1115
  // {
1063
1116
  // label: _('Data colors'),
@@ -1103,8 +1156,7 @@ var editorConfig = [{
1103
1156
  themes: themes,
1104
1157
  min: 0
1105
1158
  }
1106
- }],
1107
- // TODO: add support for seriesColorsByField option
1159
+ }], // TODO: add support for seriesColorsByField option
1108
1160
  // [
1109
1161
  // {
1110
1162
  // label: _('Series colors by field name'),
@@ -1148,17 +1200,20 @@ var editorConfig = [{
1148
1200
  /**
1149
1201
  * visualization configuration
1150
1202
  */
1203
+
1151
1204
  var config = {
1152
1205
  /**
1153
1206
  * unique viz key
1154
1207
  */
1155
1208
  key: 'splunk.map',
1209
+
1156
1210
  /**
1157
1211
  * viz name
1158
1212
  */
1159
1213
  name: (0, i18n_1._)('Map'),
1160
1214
  category: VizCategory_1.VizCategory.SPATIAL,
1161
1215
  status: 'preview',
1216
+
1162
1217
  /**
1163
1218
  * viz icon
1164
1219
  */
@@ -1171,7 +1226,8 @@ var config = {
1171
1226
  editorConfig: editorConfig,
1172
1227
  events: {
1173
1228
  'map.load': {
1174
- description: 'triggered when map is fully loaded'
1229
+ description: 'triggered when map is fully loaded',
1230
+ parentKeys: ['exec']
1175
1231
  },
1176
1232
  'map.click': {
1177
1233
  description: 'trigger when user clicks map layer'
@@ -1184,42 +1240,55 @@ var config = {
1184
1240
  exports.default = (0, configUtils_1.enhanceConfig)(config);
1185
1241
 
1186
1242
  /***/ }),
1187
- /* 57 */
1243
+ /* 58 */
1188
1244
  /***/ (function(module, exports, __webpack_require__) {
1189
1245
 
1190
1246
  "use strict";
1191
1247
 
1192
1248
 
1193
1249
  var _defineProperty = __webpack_require__(7);
1194
- var _slicedToArray = __webpack_require__(58);
1250
+
1251
+ var _slicedToArray = __webpack_require__(59);
1252
+
1195
1253
  var _toConsumableArray = __webpack_require__(1);
1254
+
1196
1255
  Object.defineProperty(exports, "__esModule", {
1197
1256
  value: true
1198
1257
  });
1199
1258
  exports.formatMetadata = exports.compareBaseStyles = exports.getScaledOpacities = exports.getGlobalLayerBoundaries = exports.isValidLatLon = exports.bakeBubbleData = exports.sanitizeValues = exports.transposeArray = exports.matchBubbleSize = exports.getStaticColors = exports.getZoomLevelFromGeobin = exports.getZoomConstraintsFromTileConfig = exports.getMapStyle = exports.getTilePreset = exports.LAYER_TYPE = exports.DEFAULT_OPACITY = exports.MAX_BUBBLE_RADIUS = exports.MIN_BUBBLE_RADIUS = exports.MAP_STYLE_VERSION_NUMBER = exports.DEFAULT_SERIES_COLORS = exports.DEFAULT_CLUSTER_COLOR = exports.DEFAULT_RESULT_LIMIT = exports.MIN_LONGITUDE = exports.MAX_LONGITUDE = exports.MIN_LATITUDE = exports.MAX_LATITUDE = void 0;
1259
+
1200
1260
  var lodash_1 = __webpack_require__(6);
1201
- var d3_scale_1 = __webpack_require__(59);
1202
- var chroma = __webpack_require__(60);
1203
- var colorUtils_1 = __webpack_require__(61);
1261
+
1262
+ var d3_scale_1 = __webpack_require__(60);
1263
+
1264
+ var chroma = __webpack_require__(61);
1265
+
1266
+ var colorUtils_1 = __webpack_require__(62);
1267
+
1204
1268
  var visualization_color_palettes_1 = __webpack_require__(14);
1205
- var types_1 = __webpack_require__(62);
1269
+
1270
+ var types_1 = __webpack_require__(63);
1271
+
1206
1272
  exports.MAX_LATITUDE = 90;
1207
1273
  exports.MIN_LATITUDE = -90;
1208
1274
  exports.MAX_LONGITUDE = 180;
1209
1275
  exports.MIN_LONGITUDE = -180;
1210
1276
  exports.DEFAULT_RESULT_LIMIT = 1000;
1211
1277
  exports.DEFAULT_CLUSTER_COLOR = '#909090';
1212
- exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL;
1213
- // MapLibre requires a map style specification number which is always 8
1214
- exports.MAP_STYLE_VERSION_NUMBER = 8;
1215
- // currently using one [min, max] value set for bubbles across all zoom levels
1278
+ exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL; // MapLibre requires a map style specification number which is always 8
1279
+
1280
+ exports.MAP_STYLE_VERSION_NUMBER = 8; // currently using one [min, max] value set for bubbles across all zoom levels
1216
1281
  // TODO: design choices on [min, max] bubble size for different zoom levels
1282
+
1217
1283
  exports.MIN_BUBBLE_RADIUS = 7.11; // 10px
1284
+
1218
1285
  exports.MAX_BUBBLE_RADIUS = 45.26; // 85px
1286
+
1219
1287
  exports.DEFAULT_OPACITY = 0.8;
1220
1288
  var LONGITUDE = 'longitude';
1221
1289
  var LATITUDE = 'latitude';
1222
1290
  var LAYER_TYPE;
1291
+
1223
1292
  (function (LAYER_TYPE) {
1224
1293
  LAYER_TYPE["Marker"] = "marker";
1225
1294
  LAYER_TYPE["Bubble"] = "bubble";
@@ -1233,12 +1302,16 @@ var LAYER_TYPE;
1233
1302
  * @param {BaseTileConfig[]} args.customTileConfig
1234
1303
  * @returns {Object} tile preset
1235
1304
  */
1305
+
1306
+
1236
1307
  var getTilePreset = function getTilePreset(_ref) {
1237
1308
  var _ref$defaultTileConfi = _ref.defaultTileConfig,
1238
- defaultTileConfig = _ref$defaultTileConfi === void 0 ? [] : _ref$defaultTileConfi,
1239
- _ref$customTileConfig = _ref.customTileConfig,
1240
- customTileConfig = _ref$customTileConfig === void 0 ? [] : _ref$customTileConfig;
1309
+ defaultTileConfig = _ref$defaultTileConfi === void 0 ? [] : _ref$defaultTileConfi,
1310
+ _ref$customTileConfig = _ref.customTileConfig,
1311
+ customTileConfig = _ref$customTileConfig === void 0 ? [] : _ref$customTileConfig;
1312
+
1241
1313
  var _a, _b;
1314
+
1242
1315
  var tilePreset = {};
1243
1316
  var defaultTileLight = {};
1244
1317
  var defaultTileDark = {};
@@ -1252,6 +1325,7 @@ var getTilePreset = function getTilePreset(_ref) {
1252
1325
  });
1253
1326
  tilePreset[key] = updatedConfig;
1254
1327
  });
1328
+
1255
1329
  if (defaultTileConfig.length > 0) {
1256
1330
  defaultTileLight = (_a = defaultTileConfig.find(function (config) {
1257
1331
  return config.theme === 'light';
@@ -1264,12 +1338,14 @@ var getTilePreset = function getTilePreset(_ref) {
1264
1338
  return config.theme === undefined;
1265
1339
  });
1266
1340
  }
1341
+
1267
1342
  return {
1268
1343
  tilePreset: tilePreset,
1269
1344
  defaultTileLight: defaultTileLight,
1270
1345
  defaultTileDark: defaultTileDark
1271
1346
  };
1272
1347
  };
1348
+
1273
1349
  exports.getTilePreset = getTilePreset;
1274
1350
  /**
1275
1351
  * Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.
@@ -1284,20 +1360,22 @@ exports.getTilePreset = getTilePreset;
1284
1360
  * @param {BaseTileConfig} args.defaultTileLight
1285
1361
  * @returns {BaseTileConfig} mapStyle
1286
1362
  */
1363
+
1287
1364
  var getMapStyle = function getMapStyle(_ref2) {
1288
1365
  var showBaseLayer = _ref2.showBaseLayer,
1289
- _ref2$baseLayerTileSe = _ref2.baseLayerTileServer,
1290
- baseLayerTileServer = _ref2$baseLayerTileSe === void 0 ? '' : _ref2$baseLayerTileSe,
1291
- _ref2$baseLayerTileSe2 = _ref2.baseLayerTileServerType,
1292
- baseLayerTileServerType = _ref2$baseLayerTileSe2 === void 0 ? '' : _ref2$baseLayerTileSe2,
1293
- _ref2$tilePreset = _ref2.tilePreset,
1294
- tilePreset = _ref2$tilePreset === void 0 ? {} : _ref2$tilePreset,
1295
- _ref2$colorScheme = _ref2.colorScheme,
1296
- colorScheme = _ref2$colorScheme === void 0 ? 'light' : _ref2$colorScheme,
1297
- _ref2$defaultTileLigh = _ref2.defaultTileLight,
1298
- defaultTileLight = _ref2$defaultTileLigh === void 0 ? {} : _ref2$defaultTileLigh,
1299
- _ref2$defaultTileDark = _ref2.defaultTileDark,
1300
- defaultTileDark = _ref2$defaultTileDark === void 0 ? {} : _ref2$defaultTileDark;
1366
+ _ref2$baseLayerTileSe = _ref2.baseLayerTileServer,
1367
+ baseLayerTileServer = _ref2$baseLayerTileSe === void 0 ? '' : _ref2$baseLayerTileSe,
1368
+ _ref2$baseLayerTileSe2 = _ref2.baseLayerTileServerType,
1369
+ baseLayerTileServerType = _ref2$baseLayerTileSe2 === void 0 ? '' : _ref2$baseLayerTileSe2,
1370
+ _ref2$tilePreset = _ref2.tilePreset,
1371
+ tilePreset = _ref2$tilePreset === void 0 ? {} : _ref2$tilePreset,
1372
+ _ref2$colorScheme = _ref2.colorScheme,
1373
+ colorScheme = _ref2$colorScheme === void 0 ? 'light' : _ref2$colorScheme,
1374
+ _ref2$defaultTileLigh = _ref2.defaultTileLight,
1375
+ defaultTileLight = _ref2$defaultTileLigh === void 0 ? {} : _ref2$defaultTileLigh,
1376
+ _ref2$defaultTileDark = _ref2.defaultTileDark,
1377
+ defaultTileDark = _ref2$defaultTileDark === void 0 ? {} : _ref2$defaultTileDark;
1378
+
1301
1379
  if (!showBaseLayer) {
1302
1380
  return {
1303
1381
  version: exports.MAP_STYLE_VERSION_NUMBER,
@@ -1317,9 +1395,11 @@ var getMapStyle = function getMapStyle(_ref2) {
1317
1395
  }]
1318
1396
  };
1319
1397
  }
1398
+
1320
1399
  if (baseLayerTileServer && tilePreset[baseLayerTileServer] && (tilePreset[baseLayerTileServer].theme === colorScheme || tilePreset[baseLayerTileServer].theme === 'all')) {
1321
1400
  return tilePreset[baseLayerTileServer];
1322
1401
  }
1402
+
1323
1403
  if (baseLayerTileServer && baseLayerTileServerType) {
1324
1404
  var tiles = [];
1325
1405
  /**
@@ -1327,6 +1407,7 @@ var getMapStyle = function getMapStyle(_ref2) {
1327
1407
  * Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'
1328
1408
  * Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers
1329
1409
  */
1410
+
1330
1411
  if (baseLayerTileServer.match(/^(https?):\/\/{(s|S)}\../)) {
1331
1412
  /**
1332
1413
  * sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains
@@ -1337,8 +1418,9 @@ var getMapStyle = function getMapStyle(_ref2) {
1337
1418
  tiles = [baseLayerTileServer.replace(/{(s|S)}/, 'a'), baseLayerTileServer.replace(/{(s|S)}/, 'b'), baseLayerTileServer.replace(/{(s|S)}/, 'c')];
1338
1419
  } else {
1339
1420
  tiles = [baseLayerTileServer];
1340
- }
1341
- // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options
1421
+ } // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options
1422
+
1423
+
1342
1424
  var mapStyle = {
1343
1425
  version: exports.MAP_STYLE_VERSION_NUMBER,
1344
1426
  sources: {
@@ -1354,134 +1436,164 @@ var getMapStyle = function getMapStyle(_ref2) {
1354
1436
  source: 'base-tiles',
1355
1437
  minzoom: 0,
1356
1438
  maxzoom: 24 // https://maplibre.org/maplibre-gl-js-docs/api/map/
1439
+
1357
1440
  }]
1358
1441
  };
1359
-
1360
1442
  return mapStyle;
1361
- }
1362
- // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults
1443
+ } // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults
1444
+
1445
+
1363
1446
  return colorScheme === 'light' ? defaultTileLight : defaultTileDark;
1364
1447
  };
1448
+
1365
1449
  exports.getMapStyle = getMapStyle;
1450
+
1366
1451
  var getZoomConstraintsFromTileConfig = function getZoomConstraintsFromTileConfig(tileConfig, baseLayerTileServer) {
1367
1452
  var sources = tileConfig.sources,
1368
- layers = tileConfig.layers;
1369
- var matchedBaseLayerTileServer = false;
1370
- // check sources for minzoom maxzoom first
1453
+ layers = tileConfig.layers;
1454
+ var matchedBaseLayerTileServer = false; // check sources for minzoom maxzoom first
1455
+
1371
1456
  var sourceKeys = Object.keys(sources);
1457
+
1372
1458
  for (var i = 0; i < sourceKeys.length; i += 1) {
1373
1459
  var _sources$sourceKeys$i = sources[sourceKeys[i]],
1374
- minzoom = _sources$sourceKeys$i.minzoom,
1375
- maxzoom = _sources$sourceKeys$i.maxzoom;
1460
+ minzoom = _sources$sourceKeys$i.minzoom,
1461
+ maxzoom = _sources$sourceKeys$i.maxzoom;
1462
+
1376
1463
  if (baseLayerTileServer && sources[sourceKeys[i]].tiles.indexOf(baseLayerTileServer) !== -1) {
1377
1464
  matchedBaseLayerTileServer = true;
1378
1465
  }
1466
+
1379
1467
  if ((baseLayerTileServer && matchedBaseLayerTileServer || !baseLayerTileServer) && (0, lodash_1.isNumber)(minzoom) && (0, lodash_1.isNumber)(maxzoom)) {
1380
1468
  return {
1381
1469
  minZoom: minzoom,
1382
1470
  maxZoom: maxzoom
1383
1471
  };
1384
1472
  }
1385
- }
1386
- // then check layers
1473
+ } // then check layers
1474
+
1475
+
1387
1476
  for (var _i = 0; _i < layers.length; _i += 1) {
1388
1477
  var _layers$_i = layers[_i],
1389
- _minzoom = _layers$_i.minzoom,
1390
- _maxzoom = _layers$_i.maxzoom;
1478
+ _minzoom = _layers$_i.minzoom,
1479
+ _maxzoom = _layers$_i.maxzoom;
1480
+
1391
1481
  if ((baseLayerTileServer && matchedBaseLayerTileServer || !baseLayerTileServer) && (0, lodash_1.isNumber)(_minzoom) && (0, lodash_1.isNumber)(_maxzoom)) {
1392
1482
  return {
1393
1483
  minZoom: _minzoom,
1394
1484
  maxZoom: _maxzoom
1395
1485
  };
1396
1486
  }
1397
- }
1398
- // Maplibre default - would reset previous min/maxZoom https://maplibre.org/maplibre-gl-js-docs/api/map/
1487
+ } // Maplibre default - would reset previous min/maxZoom https://maplibre.org/maplibre-gl-js-docs/api/map/
1488
+
1489
+
1399
1490
  return {
1400
1491
  minZoom: 0,
1401
1492
  maxZoom: 24
1402
1493
  };
1403
1494
  };
1495
+
1404
1496
  exports.getZoomConstraintsFromTileConfig = getZoomConstraintsFromTileConfig;
1497
+
1405
1498
  var getZoomLevelFromGeobin = function getZoomLevelFromGeobin(geobinStr) {
1406
1499
  var _a;
1500
+
1407
1501
  if (!geobinStr) {
1408
1502
  return null;
1409
- }
1410
- // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
1503
+ } // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
1504
+
1505
+
1411
1506
  var geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;
1412
1507
  var match = geobinPattern.exec(geobinStr);
1413
1508
  return (_a = (match === null || match === void 0 ? void 0 : match.length) && parseInt(match[1], 10)) !== null && _a !== void 0 ? _a : null;
1414
1509
  };
1415
- exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin;
1416
- // Bubble colors - static
1510
+
1511
+ exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin; // Bubble colors - static
1512
+
1417
1513
  var getStaticColors = function getStaticColors(colorCount, colorArray) {
1418
1514
  if (colorCount < 0 || !colorCount) {
1419
1515
  return [exports.DEFAULT_CLUSTER_COLOR];
1420
1516
  }
1517
+
1421
1518
  if (!colorArray || !colorArray.length) {
1422
1519
  return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
1423
1520
  return exports.DEFAULT_SERIES_COLORS[i];
1424
1521
  });
1425
- }
1426
- // loop through colorArray to pick the first $colorCount colors
1522
+ } // loop through colorArray to pick the first $colorCount colors
1427
1523
  // start from begining again if colorCount > colorArray.length
1524
+
1525
+
1428
1526
  return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
1429
1527
  return (0, colorUtils_1.isColor)(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : exports.DEFAULT_CLUSTER_COLOR;
1430
1528
  });
1431
1529
  };
1432
- exports.getStaticColors = getStaticColors;
1433
- // Bubble size
1530
+
1531
+ exports.getStaticColors = getStaticColors; // Bubble size
1532
+
1434
1533
  var matchBubbleSize = function matchBubbleSize(dataRange, data) {
1435
1534
  var size = (0, d3_scale_1.scalePow)().exponent(0.2).domain(dataRange).range([exports.MIN_BUBBLE_RADIUS, exports.MAX_BUBBLE_RADIUS])(data);
1535
+
1436
1536
  if (size > exports.MAX_BUBBLE_RADIUS) {
1437
1537
  return exports.MAX_BUBBLE_RADIUS;
1438
1538
  }
1539
+
1439
1540
  if (size < exports.MIN_BUBBLE_RADIUS) {
1440
1541
  return exports.MIN_BUBBLE_RADIUS;
1441
1542
  }
1543
+
1442
1544
  return size;
1443
1545
  };
1546
+
1444
1547
  exports.matchBubbleSize = matchBubbleSize;
1548
+
1445
1549
  var transposeArray = function transposeArray(array) {
1446
1550
  if (!array || !array.length || !array[0] || !array[0].length) {
1447
1551
  return [];
1448
1552
  }
1553
+
1449
1554
  return array[0].map(function (_, i) {
1450
1555
  return array.map(function (row) {
1451
1556
  return row[i];
1452
1557
  });
1453
1558
  });
1454
1559
  };
1455
- exports.transposeArray = transposeArray;
1456
- // sanitize values: update all null, undefined, or negative values to 0
1560
+
1561
+ exports.transposeArray = transposeArray; // sanitize values: update all null, undefined, or negative values to 0
1562
+
1457
1563
  var sanitizeValues = function sanitizeValues(values) {
1458
1564
  // null / undefined
1459
1565
  if (!values) {
1460
1566
  return 0;
1461
- }
1462
- // number
1567
+ } // number
1568
+
1569
+
1463
1570
  if (!Array.isArray(values)) {
1464
1571
  return values > 0 ? values : 0;
1465
- }
1466
- // array
1572
+ } // array
1573
+
1574
+
1467
1575
  return values.map(function (arr) {
1468
1576
  return (0, exports.sanitizeValues)(arr);
1469
1577
  });
1470
1578
  };
1579
+
1471
1580
  exports.sanitizeValues = sanitizeValues;
1581
+
1472
1582
  var bakeBubbleData = function bakeBubbleData(layer) {
1473
1583
  var _a;
1584
+
1474
1585
  if (!layer || !((_a = layer.bubbleSize) === null || _a === void 0 ? void 0 : _a.length) || !layer.geobin || !layer.geobin.length || !layer.latitude || !layer.latitude.length || !layer.longitude || !layer.longitude.length) {
1475
1586
  return null;
1476
- }
1477
- // if bubbleSize is passed as an array of single number array (data series)
1587
+ } // if bubbleSize is passed as an array of single number array (data series)
1478
1588
  // e.g. [value0, value1, ...]
1479
1589
  // format each value as an array to unify data operations for data series and frames
1590
+
1591
+
1480
1592
  var sanitizedBubbleSize = (0, exports.sanitizeValues)(layer.bubbleSize);
1481
1593
  var transposedBubbleSize;
1482
1594
  var transposedSanitizedBubbleSize;
1483
- var isPie = false;
1484
- // format array if bubbleSize is passed as an array of array (data frame)
1595
+ var isPie = false; // format array if bubbleSize is passed as an array of array (data frame)
1596
+
1485
1597
  if (Array.isArray(layer.bubbleSize[0])) {
1486
1598
  // one-time array transpose,
1487
1599
  // e.g. from [column0data, column0data] (multi series)
@@ -1491,8 +1603,8 @@ var bakeBubbleData = function bakeBubbleData(layer) {
1491
1603
  // for easy access of values at each geo location,
1492
1604
  // and min max pie size computation
1493
1605
  transposedBubbleSize = (0, exports.transposeArray)(layer.bubbleSize);
1494
- transposedSanitizedBubbleSize = (0, exports.transposeArray)(sanitizedBubbleSize);
1495
- // if multiple series in the dataframe, set isPie to true
1606
+ transposedSanitizedBubbleSize = (0, exports.transposeArray)(sanitizedBubbleSize); // if multiple series in the dataframe, set isPie to true
1607
+
1496
1608
  if (layer.bubbleSize.length > 1) {
1497
1609
  isPie = true;
1498
1610
  }
@@ -1504,9 +1616,11 @@ var bakeBubbleData = function bakeBubbleData(layer) {
1504
1616
  return [n];
1505
1617
  });
1506
1618
  }
1619
+
1507
1620
  if (!transposedBubbleSize || !transposedBubbleSize.length) {
1508
1621
  return null;
1509
1622
  }
1623
+
1510
1624
  var data = layer.latitude.map(function (lat, i) {
1511
1625
  return {
1512
1626
  zoom: (0, exports.getZoomLevelFromGeobin)(layer.geobin[i]),
@@ -1517,8 +1631,8 @@ var bakeBubbleData = function bakeBubbleData(layer) {
1517
1631
  };
1518
1632
  }).filter(function (d) {
1519
1633
  return Boolean(d.values);
1520
- });
1521
- // compute the min/max value to encode min/max pie or bubble size
1634
+ }); // compute the min/max value to encode min/max pie or bubble size
1635
+
1522
1636
  var min = (0, lodash_1.sum)(transposedSanitizedBubbleSize[0]);
1523
1637
  var max = (0, lodash_1.sum)(transposedSanitizedBubbleSize[1]);
1524
1638
  transposedSanitizedBubbleSize.forEach(function (row) {
@@ -1534,22 +1648,29 @@ var bakeBubbleData = function bakeBubbleData(layer) {
1534
1648
  bubbleSizeFields: layer.bubbleSizeFields
1535
1649
  };
1536
1650
  };
1651
+
1537
1652
  exports.bakeBubbleData = bakeBubbleData;
1653
+
1538
1654
  var isValidLatLon = function isValidLatLon(latlon) {
1539
1655
  if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {
1540
1656
  return false;
1541
1657
  }
1658
+
1542
1659
  var _latlon = _slicedToArray(latlon, 2),
1543
- lat = _latlon[0],
1544
- lon = _latlon[1];
1660
+ lat = _latlon[0],
1661
+ lon = _latlon[1];
1662
+
1545
1663
  if (!(0, types_1.isNumber)(lat) || !(lat >= exports.MIN_LATITUDE && lat <= exports.MAX_LATITUDE)) {
1546
1664
  return false;
1547
1665
  }
1666
+
1548
1667
  if (!(0, types_1.isNumber)(lon) || !(lon >= exports.MIN_LONGITUDE && lon <= exports.MAX_LONGITUDE)) {
1549
1668
  return false;
1550
1669
  }
1670
+
1551
1671
  return true;
1552
1672
  };
1673
+
1553
1674
  exports.isValidLatLon = isValidLatLon;
1554
1675
  /**
1555
1676
  * Returns a list of all lat or lon coordinates used in a specified layer
@@ -1557,10 +1678,12 @@ exports.isValidLatLon = isValidLatLon;
1557
1678
  * @param {string} field
1558
1679
  * @returns {number[]} list of lat coordinates or lon coordinates
1559
1680
  */
1681
+
1560
1682
  var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
1561
1683
  var getClusterValues = function getClusterValues(clusterLayer) {
1562
1684
  return (0, lodash_1.get)(clusterLayer, field, []).slice(0, clusterLayer.type === LAYER_TYPE.Marker && clusterLayer.resultLimit ? clusterLayer.resultLimit : exports.DEFAULT_RESULT_LIMIT);
1563
1685
  };
1686
+
1564
1687
  var getChoroplethValues = function getChoroplethValues(choroplethLayer) {
1565
1688
  var slicedGeomList = choroplethLayer.geom.slice(0, choroplethLayer.resultLimit);
1566
1689
  var flatCoordinates = slicedGeomList.flatMap(function (geomObject) {
@@ -1570,6 +1693,7 @@ var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
1570
1693
  return coord[field === LONGITUDE ? 0 : 1];
1571
1694
  });
1572
1695
  };
1696
+
1573
1697
  return layer.type === LAYER_TYPE.Choropleth ? getChoroplethValues(layer) : getClusterValues(layer);
1574
1698
  };
1575
1699
  /**
@@ -1577,25 +1701,32 @@ var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
1577
1701
  * @param {LayerType[]} layers
1578
1702
  * @returns {LngLatBoundsLike}
1579
1703
  */
1704
+
1705
+
1580
1706
  var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
1581
1707
  var isLayerValid = function isLayerValid(field) {
1582
1708
  return layers.every(function (layer) {
1583
1709
  return layer[field] || layer.geom;
1584
1710
  });
1585
1711
  };
1712
+
1586
1713
  var getDefaultMax = function getDefaultMax(field) {
1587
1714
  return field === LONGITUDE ? exports.MAX_LONGITUDE : exports.MAX_LATITUDE;
1588
1715
  };
1716
+
1589
1717
  var getDefaultMin = function getDefaultMin(field) {
1590
1718
  return field === LONGITUDE ? exports.MIN_LONGITUDE : exports.MIN_LATITUDE;
1591
1719
  };
1720
+
1592
1721
  if (!layers || !Array.isArray(layers) || !layers.length) {
1593
1722
  return null;
1594
1723
  }
1724
+
1595
1725
  var getMin = function getMin(field) {
1596
1726
  if (!isLayerValid(field)) {
1597
1727
  return getDefaultMin(field);
1598
1728
  }
1729
+
1599
1730
  return layers.reduce(function (prevVal, layer) {
1600
1731
  var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(function (x) {
1601
1732
  return +x;
@@ -1603,32 +1734,41 @@ var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
1603
1734
  return (0, lodash_1.min)([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
1604
1735
  }, getDefaultMax(field));
1605
1736
  };
1737
+
1606
1738
  var getMax = function getMax(field) {
1607
1739
  if (!isLayerValid(field)) {
1608
1740
  return getDefaultMax(field);
1609
1741
  }
1742
+
1610
1743
  return layers.reduce(function (prevVal, layer) {
1611
1744
  var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(Number);
1612
1745
  return (0, lodash_1.max)([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
1613
1746
  }, getDefaultMin(field));
1614
1747
  };
1748
+
1615
1749
  return [[getMin(LONGITUDE), getMin(LATITUDE)], [getMax(LONGITUDE), getMax(LATITUDE)]];
1616
1750
  };
1751
+
1617
1752
  exports.getGlobalLayerBoundaries = getGlobalLayerBoundaries;
1753
+
1618
1754
  var getScaledOpacities = function getScaledOpacities(colors, cfgOpacity) {
1619
1755
  // extract opacity information from 8 digit hex codes
1620
1756
  var opacities = colors === null || colors === void 0 ? void 0 : colors.map(function (color) {
1621
1757
  var _a;
1758
+
1622
1759
  return (color === null || color === void 0 ? void 0 : color.length) === 9 ? (_a = chroma(color).alpha()) !== null && _a !== void 0 ? _a : 1 : 1;
1623
- });
1624
- // opacity cannot be greater than configured opacity
1760
+ }); // opacity cannot be greater than configured opacity
1761
+
1625
1762
  return opacities === null || opacities === void 0 ? void 0 : opacities.map(function (opacity) {
1626
1763
  return opacity * cfgOpacity;
1627
1764
  });
1628
1765
  };
1766
+
1629
1767
  exports.getScaledOpacities = getScaledOpacities;
1768
+
1630
1769
  var compareBaseStyles = function compareBaseStyles(curr, next) {
1631
1770
  var _a, _b, _c, _d;
1771
+
1632
1772
  var currBaseLayer = (_a = curr === null || curr === void 0 ? void 0 : curr.layers) === null || _a === void 0 ? void 0 : _a.find(function (layer) {
1633
1773
  return (layer === null || layer === void 0 ? void 0 : layer.id) === 'base-layer';
1634
1774
  });
@@ -1637,12 +1777,16 @@ var compareBaseStyles = function compareBaseStyles(curr, next) {
1637
1777
  });
1638
1778
  var currBaseSource = (0, lodash_1.get)(curr === null || curr === void 0 ? void 0 : curr.sources, (_c = currBaseLayer === null || currBaseLayer === void 0 ? void 0 : currBaseLayer.source) !== null && _c !== void 0 ? _c : '');
1639
1779
  var nextBaseSource = (0, lodash_1.get)(next === null || next === void 0 ? void 0 : next.sources, (_d = nextBaseLayer === null || nextBaseLayer === void 0 ? void 0 : nextBaseLayer.source) !== null && _d !== void 0 ? _d : '');
1780
+
1640
1781
  if (!currBaseLayer || !nextBaseLayer || !currBaseSource || !nextBaseSource) {
1641
1782
  return false;
1642
1783
  }
1784
+
1643
1785
  return (0, lodash_1.isEqual)(currBaseLayer, nextBaseLayer) && (0, lodash_1.isEqual)(currBaseSource, nextBaseSource);
1644
1786
  };
1787
+
1645
1788
  exports.compareBaseStyles = compareBaseStyles;
1789
+
1646
1790
  var formatMetadata = function formatMetadata(choroplethLayer, i) {
1647
1791
  if (!choroplethLayer || !choroplethLayer.areaIds || !choroplethLayer.areaValues) return {};
1648
1792
  if (i >= choroplethLayer.areaIds.length) return {};
@@ -1659,34 +1803,35 @@ var formatMetadata = function formatMetadata(choroplethLayer, i) {
1659
1803
  return Object.assign(Object.assign({}, result), _defineProperty({}, key, val));
1660
1804
  }, base);
1661
1805
  };
1806
+
1662
1807
  exports.formatMetadata = formatMetadata;
1663
1808
 
1664
1809
  /***/ }),
1665
- /* 58 */
1810
+ /* 59 */
1666
1811
  /***/ (function(module, exports) {
1667
1812
 
1668
1813
  module.exports = require("@babel/runtime/helpers/slicedToArray");
1669
1814
 
1670
1815
  /***/ }),
1671
- /* 59 */
1816
+ /* 60 */
1672
1817
  /***/ (function(module, exports) {
1673
1818
 
1674
1819
  module.exports = require("d3-scale");
1675
1820
 
1676
1821
  /***/ }),
1677
- /* 60 */
1822
+ /* 61 */
1678
1823
  /***/ (function(module, exports) {
1679
1824
 
1680
1825
  module.exports = require("chroma-js");
1681
1826
 
1682
1827
  /***/ }),
1683
- /* 61 */
1828
+ /* 62 */
1684
1829
  /***/ (function(module, exports) {
1685
1830
 
1686
1831
  module.exports = require("@splunk/visualizations-shared/colorUtils");
1687
1832
 
1688
1833
  /***/ }),
1689
- /* 62 */
1834
+ /* 63 */
1690
1835
  /***/ (function(module, exports) {
1691
1836
 
1692
1837
  module.exports = require("@splunk/visualization-encoding/utils/types");