@splunk/visualizations 25.10.0 → 25.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. package/Area.config.js +1 -1
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +3 -3
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +1 -1
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +3 -3
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +2 -2
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +4 -4
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +2 -2
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +11 -11
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +2 -2
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +4 -4
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +2 -2
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +15 -15
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +1 -1
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +37 -22
  28. package/Events.js.map +1 -1
  29. package/FEATUREFLAGS.md +5 -4
  30. package/FillerGauge.config.js +3 -3
  31. package/FillerGauge.config.js.map +1 -1
  32. package/FillerGauge.js +32 -22
  33. package/FillerGauge.js.map +1 -1
  34. package/Image.config.js +1 -1
  35. package/Image.config.js.map +1 -1
  36. package/Image.js +3 -3
  37. package/Image.js.map +1 -1
  38. package/Line.config.js +2 -2
  39. package/Line.config.js.map +1 -1
  40. package/Line.js +4 -4
  41. package/Line.js.map +1 -1
  42. package/LinkGraph.config.js +1 -1
  43. package/LinkGraph.config.js.map +1 -1
  44. package/LinkGraph.js +25 -25
  45. package/LinkGraph.js.map +1 -1
  46. package/Map.config.js +2 -2
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +203 -142
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +1 -1
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +7 -7
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +2 -2
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +32 -21
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +2 -2
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +5 -5
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +1 -1
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +11 -11
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +2 -2
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +6 -6
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +2 -2
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +14 -14
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +1 -1
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +8 -8
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +2 -2
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +8 -6
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +3 -3
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +8 -8
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +1 -1
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +3 -3
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +6 -6
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +3 -3
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +33 -27
  95. package/SingleValueRadial.js.map +1 -1
  96. package/Table.config.js +1 -1
  97. package/Table.config.js.map +1 -1
  98. package/Table.js +13 -13
  99. package/Table.js.map +1 -1
  100. package/common/GaugeValueMarker.js +20 -10
  101. package/common/GaugeValueMarker.js.map +1 -1
  102. package/common/utils/mapUtils.js +4 -3
  103. package/common/utils/mapUtils.js.map +1 -1
  104. package/common/utils/singleValueUtils.js +1 -1
  105. package/common/utils/singleValueUtils.js.map +1 -1
  106. package/common/withDashboardViz.js +2 -2
  107. package/common/withDashboardViz.js.map +1 -1
  108. package/package.json +15 -14
package/Map.js CHANGED
@@ -113,13 +113,6 @@ module.exports = require("@splunk/themes/variables");
113
113
 
114
114
  /***/ }),
115
115
 
116
- /***/ 105:
117
- /***/ (function(module, exports) {
118
-
119
- module.exports = require("@splunk/visualization-encoding/utils/dsl");
120
-
121
- /***/ }),
122
-
123
116
  /***/ 11:
124
117
  /***/ (function(module, exports) {
125
118
 
@@ -127,14 +120,7 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
127
120
 
128
121
  /***/ }),
129
122
 
130
- /***/ 12:
131
- /***/ (function(module, exports) {
132
-
133
- module.exports = require("@splunk/visualizations-shared/colorUtils");
134
-
135
- /***/ }),
136
-
137
- /***/ 120:
123
+ /***/ 119:
138
124
  /***/ (function(module, exports, __webpack_require__) {
139
125
 
140
126
  "use strict";
@@ -169,93 +155,14 @@ exports.convertToArrOfObjects = convertToArrOfObjects;
169
155
 
170
156
  /***/ }),
171
157
 
172
- /***/ 13:
173
- /***/ (function(module, exports, __webpack_require__) {
174
-
175
- "use strict";
176
-
158
+ /***/ 12:
159
+ /***/ (function(module, exports) {
177
160
 
178
- Object.defineProperty(exports, "__esModule", {
179
- value: true
180
- });
181
- var React = __webpack_require__(0);
182
- var styled_components_1 = __webpack_require__(4);
183
- var SizeAwareWrapper_1 = __webpack_require__(18);
184
- var style_1 = __webpack_require__(14);
185
- var colorUtils_1 = __webpack_require__(12);
186
- var Item = styled_components_1.default.div.attrs(function (_ref) {
187
- var width = _ref.width;
188
- return {
189
- style: {
190
- width: style_1.toPx(width)
191
- }
192
- };
193
- }).withConfig({
194
- displayName: "FixedSizeContainer__Item",
195
- componentId: "sc-1yhgpod-0"
196
- })(["position:relative;background-color:", "};"], function (props) {
197
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
198
- });
199
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
200
- var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
201
- var width = _ref2.width,
202
- height = _ref2.height;
203
- return {
204
- style: Object.assign(Object.assign({}, width && {
205
- width: style_1.toPx(width)
206
- }), height && {
207
- height: style_1.toPx(height)
208
- })
209
- };
210
- }).withConfig({
211
- displayName: "FixedSizeContainer__FixSizeItem",
212
- componentId: "sc-1yhgpod-1"
213
- })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
214
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
215
- });
216
- var ItemContent = styled_components_1.default.div.withConfig({
217
- displayName: "FixedSizeContainer__ItemContent",
218
- componentId: "sc-1yhgpod-2"
219
- })(["position:relative;min-height:100px;width:100%;"]);
220
- var FixSizeItemContent = styled_components_1.default.div.withConfig({
221
- displayName: "FixedSizeContainer__FixSizeItemContent",
222
- componentId: "sc-1yhgpod-3"
223
- })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
224
- var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
225
- var FixedSizeContainer = function FixedSizeContainer(props) {
226
- var width = props.width,
227
- height = props.height,
228
- backgroundColor = props.backgroundColor;
229
- if (!height) {
230
- return React.createElement(Item, {
231
- "data-test": "item",
232
- width: width,
233
- backgroundColor: backgroundColor
234
- }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
235
- }
236
- return React.createElement(FixSizeItem, {
237
- "data-test": "fix-size-item",
238
- "data-splunk-visualization-version": "25.10.0 - 8d01deb08",
239
- width: width,
240
- height: height,
241
- backgroundColor: backgroundColor
242
- }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
243
- var newWidth = _ref3.width,
244
- newHeight = _ref3.height;
245
- return React.createElement(Viz, Object.assign({}, props, {
246
- width: newWidth,
247
- height: newHeight
248
- }));
249
- })));
250
- };
251
- FixedSizeContainer.displayName = 'withFixedSizeContainer';
252
- return FixedSizeContainer;
253
- };
254
- exports.default = withFixedSizeContainer;
161
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
255
162
 
256
163
  /***/ }),
257
164
 
258
- /***/ 130:
165
+ /***/ 129:
259
166
  /***/ (function(module, exports, __webpack_require__) {
260
167
 
261
168
  "use strict";
@@ -273,7 +180,7 @@ var styled_components_1 = __webpack_require__(4);
273
180
  var lodash_1 = __webpack_require__(3);
274
181
  var colorUtils_1 = __webpack_require__(12);
275
182
  var MapUtils_1 = __webpack_require__(85);
276
- var MarkerWrapper_1 = __webpack_require__(131);
183
+ var MarkerWrapper_1 = __webpack_require__(130);
277
184
  exports.GEO_BOUND_PREFIX = '_geo_bounds_';
278
185
  exports.GEO_LAT_AND_LONG_FIELD = ['_geo_long_field', '_geo_lat_field'];
279
186
  exports.PieSegment = React.memo(function (_ref) {
@@ -340,7 +247,7 @@ exports.Bubble = React.memo(function (_ref3) {
340
247
  var onBubbleClick = React.useCallback(function (e, name, value) {
341
248
  handleMapClick(e, name, value);
342
249
  e.stopPropagation();
343
- }, [bubbleSize]);
250
+ }, [handleMapClick]);
344
251
  var bubble = React.useMemo(function () {
345
252
  var allZeros = originalValues.every(function (v) {
346
253
  return v === 0;
@@ -385,7 +292,7 @@ exports.Bubble = React.memo(function (_ref3) {
385
292
  handleBubbleClick: onBubbleClick
386
293
  });
387
294
  }));
388
- }, [colors, isPie, originalValues, themeColor, valueRange]);
295
+ }, [bubbleSize, colors, isPie, onBubbleClick, originalValues, themeColor, valueRange]);
389
296
  if (!bubble) {
390
297
  return null;
391
298
  }
@@ -455,7 +362,7 @@ var BubbleLayer = function BubbleLayer(props) {
455
362
  e: e,
456
363
  payload: payload
457
364
  });
458
- }, [dataToRender]);
365
+ }, [dataToRender, onMapClick]);
459
366
  return React.createElement(React.Fragment, null, dataToRender.map(function (datum, i) {
460
367
  var colors = dynamicColors ? [dataToRender.map(function (obj) {
461
368
  return colorUtils_1.isColor(dynamicColors[obj.idx]) ? dynamicColors[obj.idx] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
@@ -498,7 +405,93 @@ exports.default = BubbleLayer;
498
405
 
499
406
  /***/ }),
500
407
 
501
- /***/ 131:
408
+ /***/ 13:
409
+ /***/ (function(module, exports, __webpack_require__) {
410
+
411
+ "use strict";
412
+
413
+
414
+ Object.defineProperty(exports, "__esModule", {
415
+ value: true
416
+ });
417
+ var React = __webpack_require__(0);
418
+ var styled_components_1 = __webpack_require__(4);
419
+ var SizeAwareWrapper_1 = __webpack_require__(18);
420
+ var style_1 = __webpack_require__(14);
421
+ var colorUtils_1 = __webpack_require__(12);
422
+ var Item = styled_components_1.default.div.attrs(function (_ref) {
423
+ var width = _ref.width;
424
+ return {
425
+ style: {
426
+ width: style_1.toPx(width)
427
+ }
428
+ };
429
+ }).withConfig({
430
+ displayName: "FixedSizeContainer__Item",
431
+ componentId: "sc-1yhgpod-0"
432
+ })(["position:relative;background-color:", "};"], function (props) {
433
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
434
+ });
435
+ // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
436
+ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
437
+ var width = _ref2.width,
438
+ height = _ref2.height;
439
+ return {
440
+ style: Object.assign(Object.assign({}, width && {
441
+ width: style_1.toPx(width)
442
+ }), height && {
443
+ height: style_1.toPx(height)
444
+ })
445
+ };
446
+ }).withConfig({
447
+ displayName: "FixedSizeContainer__FixSizeItem",
448
+ componentId: "sc-1yhgpod-1"
449
+ })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
450
+ return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
451
+ });
452
+ var ItemContent = styled_components_1.default.div.withConfig({
453
+ displayName: "FixedSizeContainer__ItemContent",
454
+ componentId: "sc-1yhgpod-2"
455
+ })(["position:relative;min-height:100px;width:100%;"]);
456
+ var FixSizeItemContent = styled_components_1.default.div.withConfig({
457
+ displayName: "FixedSizeContainer__FixSizeItemContent",
458
+ componentId: "sc-1yhgpod-3"
459
+ })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
460
+ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
461
+ var FixedSizeContainer = function FixedSizeContainer(props) {
462
+ var width = props.width,
463
+ height = props.height,
464
+ backgroundColor = props.backgroundColor;
465
+ if (!height) {
466
+ return React.createElement(Item, {
467
+ "data-test": "item",
468
+ width: width,
469
+ backgroundColor: backgroundColor
470
+ }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
471
+ }
472
+ return React.createElement(FixSizeItem, {
473
+ "data-test": "fix-size-item",
474
+ "data-splunk-visualization-version": "25.12.0 - d7a0fecdf",
475
+ width: width,
476
+ height: height,
477
+ backgroundColor: backgroundColor
478
+ }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
479
+ var newWidth = _ref3.width,
480
+ newHeight = _ref3.height;
481
+ return React.createElement(Viz, Object.assign({}, props, {
482
+ width: newWidth,
483
+ height: newHeight
484
+ }));
485
+ })));
486
+ };
487
+ FixedSizeContainer.displayName = 'withFixedSizeContainer';
488
+ return FixedSizeContainer;
489
+ };
490
+ exports.default = withFixedSizeContainer;
491
+
492
+ /***/ }),
493
+
494
+ /***/ 130:
502
495
  /***/ (function(module, exports, __webpack_require__) {
503
496
 
504
497
  "use strict";
@@ -600,6 +593,13 @@ exports.default = MarkerWrapper;
600
593
 
601
594
  /***/ }),
602
595
 
596
+ /***/ 131:
597
+ /***/ (function(module, exports) {
598
+
599
+ module.exports = require("@splunk/visualization-encoding/utils/dsl");
600
+
601
+ /***/ }),
602
+
603
603
  /***/ 14:
604
604
  /***/ (function(module, exports) {
605
605
 
@@ -666,7 +666,7 @@ exports.Choropleth = exports.cleanupChoropleth = exports.compareChoropleth = exp
666
666
  var React = __webpack_require__(0);
667
667
  var lodash_1 = __webpack_require__(3);
668
668
  var MapUtils_1 = __webpack_require__(85);
669
- var MarkerWrapper_1 = __webpack_require__(131);
669
+ var MarkerWrapper_1 = __webpack_require__(130);
670
670
  var getShapeId = function getShapeId(id) {
671
671
  return "shape-".concat(id);
672
672
  };
@@ -1738,7 +1738,6 @@ exports.PureMap = exports.config = exports.themes = exports.useIconPlaceholder =
1738
1738
  /* eslint-disable no-sequences */
1739
1739
  var React = __webpack_require__(0);
1740
1740
  var colorUtils_1 = __webpack_require__(12);
1741
- var dsl_1 = __webpack_require__(105);
1742
1741
  var hocUtils_1 = __webpack_require__(26);
1743
1742
  var JSONSchemaUtils_1 = __webpack_require__(27);
1744
1743
  var PureMap_1 = __webpack_require__(405);
@@ -1747,8 +1746,8 @@ var config_1 = __webpack_require__(415);
1747
1746
  exports.config = config_1.default;
1748
1747
  var withDashboardViz_1 = __webpack_require__(36);
1749
1748
  var mapUtils_1 = __webpack_require__(416);
1750
- var BubbleLayer_1 = __webpack_require__(130);
1751
- var dataUtils_1 = __webpack_require__(120);
1749
+ var BubbleLayer_1 = __webpack_require__(129);
1750
+ var dataUtils_1 = __webpack_require__(119);
1752
1751
  var formatLayer = function formatLayer(l, dataFields, dataSourceData, transformedData) {
1753
1752
  // add key `geobin` to the layer object if the data is returned from geostats commands
1754
1753
  // to distinguish geostats commands from table commands
@@ -1807,7 +1806,7 @@ var computeVizProps = function computeVizProps(props) {
1807
1806
  exports.computeVizProps = computeVizProps;
1808
1807
  var withTooltipFields = function withTooltipFields(Viz) {
1809
1808
  var VizWithTooltipFields = function VizWithTooltipFields(_a) {
1810
- var _b, _c, _d, _e;
1809
+ var _b, _c, _d;
1811
1810
  var dataSources = _a.dataSources,
1812
1811
  options = _a.options,
1813
1812
  otherProps = __rest(_a, ["dataSources", "options"]);
@@ -1819,7 +1818,9 @@ var withTooltipFields = function withTooltipFields(Viz) {
1819
1818
  var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
1820
1819
  if ((_b = mergedOptions.layers) === null || _b === void 0 ? void 0 : _b[0]) {
1821
1820
  if (((_d = (_c = mergedOptions.layers) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.type) === 'bubble') {
1822
- mergedOptions.layers[0].bubbleSizeFields = dsl_1.getFieldsFromDSL((_e = mergedOptions.layers[0].bubbleSize) !== null && _e !== void 0 ? _e : mergedOptions.layers[0].bubbleSize, dataSources);
1821
+ // make sure bubbleSize and bubbleSizeFields dsl evaluation happen at the last HOC "withDashboardViz".
1822
+ // so value/type augmentation in the HOCs stay consistent
1823
+ mergedOptions.layers[0].bubbleSizeFields = '> bubbleSize | getField()';
1823
1824
  }
1824
1825
  var fields = dataSources.primary.data.fields;
1825
1826
  if (Array.isArray(mergedOptions.layers[0].additionalTooltipFields) && Array.isArray(fields) && fields.length) {
@@ -1948,6 +1949,7 @@ var react_1 = __webpack_require__(0);
1948
1949
  var T = __webpack_require__(1);
1949
1950
  var chroma = __webpack_require__(154);
1950
1951
  var maplibre_gl_1 = __webpack_require__(155);
1952
+ var i18n_1 = __webpack_require__(2);
1951
1953
  var MapContext_1 = __webpack_require__(406);
1952
1954
  var PureMapContainer_1 = __webpack_require__(407);
1953
1955
  var MapUtils_1 = __webpack_require__(85);
@@ -2012,7 +2014,12 @@ var PureMap = function PureMap(props) {
2012
2014
  var _React$useState = React.useState(zoom !== null && zoom !== void 0 ? zoom : exports.DEFAULT_ZOOM),
2013
2015
  _React$useState2 = _slicedToArray(_React$useState, 2),
2014
2016
  currentZoomLevel = _React$useState2[0],
2015
- setCurrentZoomLevel = _React$useState2[1];
2017
+ _setCurrentZoomLevel = _React$useState2[1];
2018
+ var currentZoomLevelRef = react_1.useRef(currentZoomLevel);
2019
+ var setCurrentZoomLevel = function setCurrentZoomLevel(newZoom) {
2020
+ currentZoomLevelRef.current = newZoom;
2021
+ _setCurrentZoomLevel(newZoom);
2022
+ };
2016
2023
  var _React$useState3 = React.useState(false),
2017
2024
  _React$useState4 = _slicedToArray(_React$useState3, 2),
2018
2025
  isMapLoaded = _React$useState4[0],
@@ -2020,7 +2027,21 @@ var PureMap = function PureMap(props) {
2020
2027
  var _React$useState5 = React.useState(false),
2021
2028
  _React$useState6 = _slicedToArray(_React$useState5, 2),
2022
2029
  isThemeChanged = _React$useState6[0],
2023
- setIsThemeChanged = _React$useState6[1]; // Assign default center when no center is defined
2030
+ setIsThemeChanged = _React$useState6[1]; // We are tracking mapMinZoom, which is the smallest zoom the map is capable of doing
2031
+ // This is because DEFAULT_ZOOM of 0 is sometimes not possible for maps with height > 500.
2032
+ // The map will do a little shake when it tries, and then auto change zoom value to mapMinZoom.
2033
+ // Interestingly, the larger the map height, the larger the mapMinZoom is.
2034
+ // For some reason, map.getMinZoom() is always 0, might be a MapLibre bug.
2035
+ var _React$useState7 = React.useState(-1),
2036
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
2037
+ mapMinZoom = _React$useState8[0],
2038
+ _setMapMinZoom = _React$useState8[1];
2039
+ var mapMinZoomRef = react_1.useRef(mapMinZoom);
2040
+ var setMapMinZoom = function setMapMinZoom(newMinZoom) {
2041
+ mapMinZoomRef.current = newMinZoom;
2042
+ _setMapMinZoom(newMinZoom);
2043
+ };
2044
+ // Assign default center when no center is defined
2024
2045
  var lngLatCenter = react_1.useMemo(function () {
2025
2046
  if (!MapUtils_1.isValidLatLon(center)) {
2026
2047
  return exports.DEFAULT_CENTER;
@@ -2038,30 +2059,27 @@ var PureMap = function PureMap(props) {
2038
2059
  var setIsThemeChangedCallback = function setIsThemeChangedCallback(isMyThemeChanged) {
2039
2060
  setIsThemeChanged(isMyThemeChanged);
2040
2061
  };
2041
- var onOptionsChangeProxy = function onOptionsChangeProxy(e) {
2062
+ var onOptionsChangeProxy = react_1.useCallback(function (e) {
2042
2063
  if (mode === 'edit') {
2043
2064
  onOptionsChange(e);
2044
2065
  }
2045
- };
2066
+ }, [onOptionsChange, mode]);
2067
+ var fitMapToContent = react_1.useCallback(function () {
2068
+ var lngLatBounds = MapUtils_1.getGlobalLayerBoundaries([layers[0]]);
2069
+ map.current.fitBounds(lngLatBounds, {
2070
+ padding: MapUtils_1.MAX_BUBBLE_RADIUS + 5,
2071
+ animate: false
2072
+ });
2073
+ }, [layers]);
2046
2074
  var initializeMap = react_1.useCallback(function (mapStyle) {
2047
- var fitMapToContent = function fitMapToContent() {
2048
- var lngLatBounds = MapUtils_1.getGlobalLayerBoundaries([layers[0]]);
2049
- map.current.fitBounds(lngLatBounds, {
2050
- padding: MapUtils_1.MAX_BUBBLE_RADIUS + 5,
2051
- animate: false
2052
- });
2053
- };
2054
2075
  var addZoomEndEventListener = function addZoomEndEventListener() {
2055
2076
  // register event listener - zoom
2056
2077
  map.current.on('zoomend', function () {
2057
- setCurrentZoomLevel(map.current.getZoom());
2058
- // when zooming with mouse/track pad,
2059
- // zooming centers at the cursor position, need to update center as well
2060
- var newCenter = map.current.getCenter();
2061
- onOptionsChangeProxy({
2062
- center: [newCenter.lat, newCenter.lng],
2063
- zoom: map.current.getZoom()
2064
- });
2078
+ var mapZoomLevel = map.current.getZoom();
2079
+ if (mapZoomLevel < mapMinZoomRef.current) {
2080
+ setMapMinZoom(mapZoomLevel);
2081
+ }
2082
+ setCurrentZoomLevel(mapZoomLevel);
2065
2083
  });
2066
2084
  };
2067
2085
  map.current = new maplibre_gl_1.Map(Object.assign({
@@ -2069,12 +2087,18 @@ var PureMap = function PureMap(props) {
2069
2087
  preserveDrawingBuffer: true,
2070
2088
  style: mapStyle,
2071
2089
  center: lngLatCenter,
2072
- zoom: zoomLevel
2090
+ zoom: zoomLevel,
2091
+ cooperativeGestures: {
2092
+ windowsHelpText: i18n_1._('Use Ctrl + scroll to zoom map'),
2093
+ macHelpText: i18n_1._('Use ⌘ + scroll to zoom map'),
2094
+ mobileHelpText: i18n_1._('Use two fingers to move the map')
2095
+ }
2073
2096
  }, MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle, baseLayerTileServer)));
2074
2097
  // Fired immediately after all necessary resources have been downloaded
2075
2098
  // and the first visually complete rendering of the map has occurred.
2076
2099
  map.current.on('load', function () {
2077
2100
  if ((layers === null || layers === void 0 ? void 0 : layers.length) > 0 && center === undefined && zoom === undefined) {
2101
+ setMapMinZoom(map.current.getZoom());
2078
2102
  map.current.on('zoomend', function () {
2079
2103
  addZoomEndEventListener();
2080
2104
  });
@@ -2086,16 +2110,28 @@ var PureMap = function PureMap(props) {
2086
2110
  // TODO :- Temp timeout added for onMapLoad event to avoid flaky screenshots caused by
2087
2111
  // https://maplibre.org/maplibre-gl-js-docs/api/map/#map#fitbounds. Need alternate approach to handle the same.
2088
2112
  setTimeout(function () {
2089
- return onMapLoad();
2113
+ if (onMapLoad && typeof onMapLoad.exec === 'function') {
2114
+ onMapLoad.exec();
2115
+ }
2090
2116
  }, 500);
2091
2117
  });
2092
2118
  // register event listener - drag
2093
2119
  map.current.on('dragend', function () {
2094
2120
  var newCenter = map.current.getCenter();
2095
2121
  onOptionsChangeProxy({
2096
- center: [newCenter.lat, newCenter.lng]
2122
+ center: [newCenter.lat, newCenter.lng],
2123
+ zoom: map.current.getZoom()
2097
2124
  });
2098
2125
  });
2126
+ map.current.on('resize', function () {
2127
+ var mapZoomLevel = map.current.getZoom();
2128
+ // If the map's zoom value is at the min zoom, and the map did a resize
2129
+ // sometimes the map will have a changed min zoom value.
2130
+ // Then we want to update the map's min zoom value.
2131
+ if (currentZoomLevelRef.current <= mapMinZoomRef.current && mapZoomLevel !== mapMinZoomRef.current) {
2132
+ setMapMinZoom(mapZoomLevel);
2133
+ }
2134
+ });
2099
2135
  // add zoom control
2100
2136
  zoomControl.current = new maplibre_gl_1.NavigationControl({
2101
2137
  showCompass: false
@@ -2120,6 +2156,24 @@ var PureMap = function PureMap(props) {
2120
2156
  map.current.resize();
2121
2157
  }
2122
2158
  }, [width, height]);
2159
+ react_1.useEffect(function () {
2160
+ if (map.current) {
2161
+ // We want to skip onOptionsChangeProxy if we have transitioned into the default map state, with undefined zoom and center.
2162
+ // This is because the DEFAULT_ZOOM value, 0, is sometimes not possible for maps with height > 500.
2163
+ // So in those cases the map will auto change its zoom from 0 => mapMinZoom
2164
+ // Since this is not a user event we don't want to broadcast it.
2165
+ if (currentZoomLevel === mapMinZoomRef.current && (zoom === undefined || zoom < mapMinZoomRef.current)) {
2166
+ return;
2167
+ }
2168
+ var newCenter = map.current.getCenter();
2169
+ onOptionsChangeProxy({
2170
+ // when zooming with mouse/track pad,
2171
+ // zooming centers at the cursor position, need to update center as well
2172
+ center: [newCenter.lat, newCenter.lng],
2173
+ zoom: currentZoomLevel
2174
+ });
2175
+ }
2176
+ }, [currentZoomLevel, onOptionsChangeProxy]);
2123
2177
  react_1.useEffect(function () {
2124
2178
  // do not render when defaultTileConfig, customTileConfig and tileset are not configured
2125
2179
  if (Object.keys(tilePreset).length === 0 && (!baseLayerTileServer || !baseLayerTileServerType)) {
@@ -2166,7 +2220,9 @@ var PureMap = function PureMap(props) {
2166
2220
  if (map.current) {
2167
2221
  map.current.flyTo({
2168
2222
  center: lngLatCenter,
2169
- zoom: zoomLevel
2223
+ // Make sure we are not flying to a zoom value smaller than the mapMinZoom
2224
+ // If we do, the map will do a little shake.
2225
+ zoom: Math.max(zoomLevel, mapMinZoomRef.current)
2170
2226
  });
2171
2227
  }
2172
2228
  }, [lngLatCenter, zoomLevel]);
@@ -2256,7 +2312,9 @@ PureMap.propTypes = {
2256
2312
  showScale: T.bool,
2257
2313
  themeColorScheme: T.string,
2258
2314
  zoom: T.number,
2259
- onMapLoad: T.func,
2315
+ onMapLoad: T.shape({
2316
+ exec: T.func
2317
+ }),
2260
2318
  onMapClick: T.func,
2261
2319
  onOptionsChange: T.func
2262
2320
  };
@@ -2273,7 +2331,9 @@ PureMap.defaultProps = {
2273
2331
  showBaseLayer: exports.DEFAULT_SHOW_BASELAYER,
2274
2332
  layers: [],
2275
2333
  themeColorScheme: 'dark',
2276
- onMapLoad: lodash_1.noop,
2334
+ onMapLoad: {
2335
+ exec: lodash_1.noop
2336
+ },
2277
2337
  onMapClick: lodash_1.noop,
2278
2338
  onOptionsChange: lodash_1.noop
2279
2339
  };
@@ -2304,7 +2364,7 @@ var maplibre_gl_css_1 = __webpack_require__(408);
2304
2364
  var PureMapContainer = styled_components_1.default.div.withConfig({
2305
2365
  displayName: "PureMapContainer",
2306
2366
  componentId: "sc-1gjwxfv-0"
2307
- })(["", " overflow:hidden;position:relative;z-index:0;background-color:", ";", ";.maplibregl-ctrl-top-left{display:", ";position:absolute;top:12px;left:16px;.maplibregl-ctrl-group{width:40px !important;height:87px !important;border-radius:4px;margin:8px 0px;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.64),0px 11px 18px rgba(0,0,0,0.32),0px 3px 6px rgba(0,0,0,0.3);& button{width:40px;height:43px;border-top:0;}.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9 1C9 0.447715 8.55229 0 8 0C7.44772 0 7 0.447715 7 1V7H1C0.447715 7 0 7.44772 0 8C0 8.55229 0.447715 9 1 9H7V15C7 15.5523 7.44772 16 8 16C8.55229 16 9 15.5523 9 15V9H15C15.5523 9 16 8.55229 16 8C16 7.44772 15.5523 7 15 7H9V1Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"14\" height=\"3\" viewBox=\"0 0 14 3\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0 1.99707C0 1.44479 0.447715 0.99707 1 0.99707H13C13.5523 0.99707 14 1.44479 14 1.99707C14 2.54936 13.5523 2.99707 13 2.99707H1C0.447715 2.99707 0 2.54936 0 1.99707Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}}}.maplibregl-ctrl-bottom-left{display:", ";position:absolute;z-index:0;bottom:16px;left:12px;width:86px;height:29px;border-radius:4px;margin:0;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.13),0px 11px 18px rgba(0,0,0,0.06),0px 3px 6px rgba(0,0,0,0.06);.maplibregl-ctrl-scale{background-color:", ";color:", ";border:2px solid ", ";border-top:0;border-left:0;border-right:0;padding:0;margin:6px 8px 8px 8px;line-height:13px;letter-spacing:0.02em;font-family:sans-serif;font-size:10px;}}"], maplibre_gl_css_1.default, function (props) {
2367
+ })(["", " overflow:hidden;position:relative;z-index:0;background-color:", ";", ";.maplibregl-cooperative-gesture-screen{z-index:0;}.maplibregl-ctrl-top-left{display:", ";position:absolute;top:12px;left:16px;.maplibregl-ctrl-group{width:40px !important;height:87px !important;border-radius:4px;margin:8px 0px;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.64),0px 11px 18px rgba(0,0,0,0.32),0px 3px 6px rgba(0,0,0,0.3);& button{width:40px;height:43px;border-top:0;}.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M9 1C9 0.447715 8.55229 0 8 0C7.44772 0 7 0.447715 7 1V7H1C0.447715 7 0 7.44772 0 8C0 8.55229 0.447715 9 1 9H7V15C7 15.5523 7.44772 16 8 16C8.55229 16 9 15.5523 9 15V9H15C15.5523 9 16 8.55229 16 8C16 7.44772 15.5523 7 15 7H9V1Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon{background-image:url('data:image/svg+xml;charset=UTF-8,<svg width=\"14\" height=\"3\" viewBox=\"0 0 14 3\" xmlns=\"http://www.w3.org/2000/svg\"><path fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M0 1.99707C0 1.44479 0.447715 0.99707 1 0.99707H13C13.5523 0.99707 14 1.44479 14 1.99707C14 2.54936 13.5523 2.99707 13 2.99707H1C0.447715 2.99707 0 2.54936 0 1.99707Z\" fill=\"", "\" fill-opacity=\"", "\" /></svg>');}}}.maplibregl-ctrl-bottom-left{display:", ";position:absolute;z-index:0;bottom:16px;left:12px;width:86px;height:29px;border-radius:4px;margin:0;background-color:", ";box-shadow:0px 26px 103px rgba(0,0,0,0.13),0px 11px 18px rgba(0,0,0,0.06),0px 3px 6px rgba(0,0,0,0.06);.maplibregl-ctrl-scale{background-color:", ";color:", ";border:2px solid ", ";border-top:0;border-left:0;border-right:0;padding:0;margin:6px 8px 8px 8px;line-height:13px;letter-spacing:0.02em;font-family:sans-serif;font-size:10px;}}"], maplibre_gl_css_1.default, function (props) {
2308
2368
  return props.backgroundColor;
2309
2369
  }, function (props) {
2310
2370
  return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
@@ -2354,7 +2414,7 @@ Object.defineProperty(exports, "__esModule", {
2354
2414
  value: true
2355
2415
  });
2356
2416
  var React = __webpack_require__(0);
2357
- var BubbleLayer_1 = __webpack_require__(130);
2417
+ var BubbleLayer_1 = __webpack_require__(129);
2358
2418
  var MarkerLayer_1 = __webpack_require__(411);
2359
2419
  var MapUtils_1 = __webpack_require__(85);
2360
2420
  var ClusterLayer = function ClusterLayer(_ref) {
@@ -2593,6 +2653,7 @@ var Tooltip = function Tooltip(_ref) {
2593
2653
  additionalFields = _ref$additionalFields === void 0 ? [] : _ref$additionalFields;
2594
2654
  return React.createElement(StyledPopover, {
2595
2655
  open: open,
2656
+ animation: false,
2596
2657
  anchor: anchor,
2597
2658
  "data-test": "map-marker-tooltip",
2598
2659
  defaultPlacement: "above"
@@ -2650,7 +2711,7 @@ var React = __webpack_require__(0);
2650
2711
  var colorUtils_1 = __webpack_require__(12);
2651
2712
  var lodash_1 = __webpack_require__(3);
2652
2713
  var MapUtils_1 = __webpack_require__(85);
2653
- var MarkerWrapper_1 = __webpack_require__(131);
2714
+ var MarkerWrapper_1 = __webpack_require__(130);
2654
2715
  var MarkerIcon = function MarkerIcon(_a) {
2655
2716
  var theme = _a.theme,
2656
2717
  color = _a.color,
@@ -3637,8 +3698,8 @@ var config = {
3637
3698
  /**
3638
3699
  * viz name
3639
3700
  */
3640
- name: 'Map',
3641
- category: VizCategory_1.VizCategory.CHOROPLETH,
3701
+ name: i18n_1._('Map'),
3702
+ category: VizCategory_1.VizCategory.SPATIAL,
3642
3703
  status: 'preview',
3643
3704
  /**
3644
3705
  * viz icon
@@ -3677,10 +3738,10 @@ Object.defineProperty(exports, "__esModule", {
3677
3738
  });
3678
3739
  exports.columnsNullToZeros = void 0;
3679
3740
  var types_1 = __webpack_require__(90);
3680
- var dsl_1 = __webpack_require__(105);
3741
+ var dsl_1 = __webpack_require__(131);
3681
3742
  var hocUtils_1 = __webpack_require__(26);
3682
3743
  var JSONSchemaUtils_1 = __webpack_require__(27);
3683
- var BubbleLayer_1 = __webpack_require__(130);
3744
+ var BubbleLayer_1 = __webpack_require__(129);
3684
3745
  var columnsNullToZeros = function columnsNullToZeros(config, dataSources, options) {
3685
3746
  var _a, _b;
3686
3747
  var primary = dataSources.primary;
@@ -3895,7 +3956,7 @@ var Cover = styled_components_1.default.div.withConfig({
3895
3956
  componentId: "sc-1gsbnxb-0"
3896
3957
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3897
3958
  var Blocker = styled_components_1.default.div.attrs({
3898
- 'data-splunk-visualization-version': "25.10.0 - 8d01deb08"
3959
+ 'data-splunk-visualization-version': "25.12.0 - d7a0fecdf"
3899
3960
  }).withConfig({
3900
3961
  displayName: "withEditModeCover__Blocker",
3901
3962
  componentId: "sc-1gsbnxb-1"