@splunk/visualizations 25.9.1 → 25.11.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 (91) hide show
  1. package/Area.js +2 -2
  2. package/Area.js.map +1 -1
  3. package/Bar.js +2 -2
  4. package/Bar.js.map +1 -1
  5. package/Bubble.config.js +1 -1
  6. package/Bubble.config.js.map +1 -1
  7. package/Bubble.js +3 -3
  8. package/Bubble.js.map +1 -1
  9. package/ChoroplethSvg.config.js +2 -2
  10. package/ChoroplethSvg.config.js.map +1 -1
  11. package/ChoroplethSvg.js +11 -11
  12. package/ChoroplethSvg.js.map +1 -1
  13. package/Column.config.js +1 -1
  14. package/Column.config.js.map +1 -1
  15. package/Column.js +3 -3
  16. package/Column.js.map +1 -1
  17. package/Ellipse.config.js +1 -1
  18. package/Ellipse.config.js.map +1 -1
  19. package/Ellipse.js +14 -14
  20. package/Ellipse.js.map +1 -1
  21. package/Events.js +22 -20
  22. package/Events.js.map +1 -1
  23. package/FillerGauge.config.js +3 -3
  24. package/FillerGauge.config.js.map +1 -1
  25. package/FillerGauge.js +32 -22
  26. package/FillerGauge.js.map +1 -1
  27. package/Image.js +2 -2
  28. package/Image.js.map +1 -1
  29. package/Line.config.js +1 -1
  30. package/Line.config.js.map +1 -1
  31. package/Line.js +3 -3
  32. package/Line.js.map +1 -1
  33. package/LinkGraph.config.js +1 -1
  34. package/LinkGraph.config.js.map +1 -1
  35. package/LinkGraph.js +141 -109
  36. package/LinkGraph.js.map +1 -1
  37. package/Map.config.js +1 -1
  38. package/Map.config.js.map +1 -1
  39. package/Map.js +196 -139
  40. package/Map.js.map +1 -1
  41. package/Markdown.js +6 -6
  42. package/Markdown.js.map +1 -1
  43. package/MarkerGauge.config.js +2 -2
  44. package/MarkerGauge.config.js.map +1 -1
  45. package/MarkerGauge.js +32 -21
  46. package/MarkerGauge.js.map +1 -1
  47. package/ParallelCoordinates.config.js +2 -2
  48. package/ParallelCoordinates.config.js.map +1 -1
  49. package/ParallelCoordinates.js +5 -5
  50. package/ParallelCoordinates.js.map +1 -1
  51. package/Pie.js +10 -10
  52. package/Pie.js.map +1 -1
  53. package/Punchcard.config.js +1 -1
  54. package/Punchcard.config.js.map +1 -1
  55. package/Punchcard.js +5 -5
  56. package/Punchcard.js.map +1 -1
  57. package/Rectangle.config.js +1 -1
  58. package/Rectangle.config.js.map +1 -1
  59. package/Rectangle.js +13 -13
  60. package/Rectangle.js.map +1 -1
  61. package/Sankey.js +7 -7
  62. package/Sankey.js.map +1 -1
  63. package/Scatter.config.js +1 -1
  64. package/Scatter.config.js.map +1 -1
  65. package/Scatter.js +7 -5
  66. package/Scatter.js.map +1 -1
  67. package/SingleValue.config.js +3 -3
  68. package/SingleValue.config.js.map +1 -1
  69. package/SingleValue.js +8 -8
  70. package/SingleValue.js.map +1 -1
  71. package/SingleValueBasic.js +1 -1
  72. package/SingleValueBasic.js.map +1 -1
  73. package/SingleValueIcon.config.js +3 -3
  74. package/SingleValueIcon.config.js.map +1 -1
  75. package/SingleValueIcon.js +6 -6
  76. package/SingleValueIcon.js.map +1 -1
  77. package/SingleValueRadial.config.js +3 -3
  78. package/SingleValueRadial.config.js.map +1 -1
  79. package/SingleValueRadial.js +30 -19
  80. package/SingleValueRadial.js.map +1 -1
  81. package/Table.js +31 -27
  82. package/Table.js.map +1 -1
  83. package/common/GaugeValueMarker.js +20 -10
  84. package/common/GaugeValueMarker.js.map +1 -1
  85. package/common/utils/mapUtils.js +7 -4
  86. package/common/utils/mapUtils.js.map +1 -1
  87. package/common/utils/singleValueUtils.js +1 -1
  88. package/common/utils/singleValueUtils.js.map +1 -1
  89. package/common/withDashboardViz.js +2 -2
  90. package/common/withDashboardViz.js.map +1 -1
  91. package/package.json +21 -21
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.9.1 - 5ba41e723",
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.11.0 - 8b45fb274",
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";
@@ -558,7 +551,9 @@ var MarkerWrapper = function MarkerWrapper(_a) {
558
551
  if (marker.current) {
559
552
  marker.current.setLngLat([longitude, latitude]);
560
553
  } else {
561
- marker.current = new maplibre_gl_1.Marker(container.current);
554
+ marker.current = new maplibre_gl_1.Marker({
555
+ element: container.current
556
+ });
562
557
  marker.current.setLngLat([longitude, latitude]);
563
558
  marker.current.addTo(map.current);
564
559
  }
@@ -598,6 +593,13 @@ exports.default = MarkerWrapper;
598
593
 
599
594
  /***/ }),
600
595
 
596
+ /***/ 131:
597
+ /***/ (function(module, exports) {
598
+
599
+ module.exports = require("@splunk/visualization-encoding/utils/dsl");
600
+
601
+ /***/ }),
602
+
601
603
  /***/ 14:
602
604
  /***/ (function(module, exports) {
603
605
 
@@ -664,7 +666,7 @@ exports.Choropleth = exports.cleanupChoropleth = exports.compareChoropleth = exp
664
666
  var React = __webpack_require__(0);
665
667
  var lodash_1 = __webpack_require__(3);
666
668
  var MapUtils_1 = __webpack_require__(85);
667
- var MarkerWrapper_1 = __webpack_require__(131);
669
+ var MarkerWrapper_1 = __webpack_require__(130);
668
670
  var getShapeId = function getShapeId(id) {
669
671
  return "shape-".concat(id);
670
672
  };
@@ -1736,7 +1738,6 @@ exports.PureMap = exports.config = exports.themes = exports.useIconPlaceholder =
1736
1738
  /* eslint-disable no-sequences */
1737
1739
  var React = __webpack_require__(0);
1738
1740
  var colorUtils_1 = __webpack_require__(12);
1739
- var dsl_1 = __webpack_require__(105);
1740
1741
  var hocUtils_1 = __webpack_require__(26);
1741
1742
  var JSONSchemaUtils_1 = __webpack_require__(27);
1742
1743
  var PureMap_1 = __webpack_require__(405);
@@ -1745,8 +1746,8 @@ var config_1 = __webpack_require__(415);
1745
1746
  exports.config = config_1.default;
1746
1747
  var withDashboardViz_1 = __webpack_require__(36);
1747
1748
  var mapUtils_1 = __webpack_require__(416);
1748
- var BubbleLayer_1 = __webpack_require__(130);
1749
- var dataUtils_1 = __webpack_require__(120);
1749
+ var BubbleLayer_1 = __webpack_require__(129);
1750
+ var dataUtils_1 = __webpack_require__(119);
1750
1751
  var formatLayer = function formatLayer(l, dataFields, dataSourceData, transformedData) {
1751
1752
  // add key `geobin` to the layer object if the data is returned from geostats commands
1752
1753
  // to distinguish geostats commands from table commands
@@ -1805,7 +1806,7 @@ var computeVizProps = function computeVizProps(props) {
1805
1806
  exports.computeVizProps = computeVizProps;
1806
1807
  var withTooltipFields = function withTooltipFields(Viz) {
1807
1808
  var VizWithTooltipFields = function VizWithTooltipFields(_a) {
1808
- var _b, _c, _d, _e;
1809
+ var _b, _c, _d;
1809
1810
  var dataSources = _a.dataSources,
1810
1811
  options = _a.options,
1811
1812
  otherProps = __rest(_a, ["dataSources", "options"]);
@@ -1817,7 +1818,9 @@ var withTooltipFields = function withTooltipFields(Viz) {
1817
1818
  var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, JSONSchemaUtils_1.pickFieldFromJSONSchema(config_1.default.optionsSchema, 'default'));
1818
1819
  if ((_b = mergedOptions.layers) === null || _b === void 0 ? void 0 : _b[0]) {
1819
1820
  if (((_d = (_c = mergedOptions.layers) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.type) === 'bubble') {
1820
- 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()';
1821
1824
  }
1822
1825
  var fields = dataSources.primary.data.fields;
1823
1826
  if (Array.isArray(mergedOptions.layers[0].additionalTooltipFields) && Array.isArray(fields) && fields.length) {
@@ -1946,6 +1949,7 @@ var react_1 = __webpack_require__(0);
1946
1949
  var T = __webpack_require__(1);
1947
1950
  var chroma = __webpack_require__(154);
1948
1951
  var maplibre_gl_1 = __webpack_require__(155);
1952
+ var i18n_1 = __webpack_require__(2);
1949
1953
  var MapContext_1 = __webpack_require__(406);
1950
1954
  var PureMapContainer_1 = __webpack_require__(407);
1951
1955
  var MapUtils_1 = __webpack_require__(85);
@@ -2010,7 +2014,12 @@ var PureMap = function PureMap(props) {
2010
2014
  var _React$useState = React.useState(zoom !== null && zoom !== void 0 ? zoom : exports.DEFAULT_ZOOM),
2011
2015
  _React$useState2 = _slicedToArray(_React$useState, 2),
2012
2016
  currentZoomLevel = _React$useState2[0],
2013
- 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
+ };
2014
2023
  var _React$useState3 = React.useState(false),
2015
2024
  _React$useState4 = _slicedToArray(_React$useState3, 2),
2016
2025
  isMapLoaded = _React$useState4[0],
@@ -2018,7 +2027,21 @@ var PureMap = function PureMap(props) {
2018
2027
  var _React$useState5 = React.useState(false),
2019
2028
  _React$useState6 = _slicedToArray(_React$useState5, 2),
2020
2029
  isThemeChanged = _React$useState6[0],
2021
- 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
2022
2045
  var lngLatCenter = react_1.useMemo(function () {
2023
2046
  if (!MapUtils_1.isValidLatLon(center)) {
2024
2047
  return exports.DEFAULT_CENTER;
@@ -2036,30 +2059,27 @@ var PureMap = function PureMap(props) {
2036
2059
  var setIsThemeChangedCallback = function setIsThemeChangedCallback(isMyThemeChanged) {
2037
2060
  setIsThemeChanged(isMyThemeChanged);
2038
2061
  };
2039
- var onOptionsChangeProxy = function onOptionsChangeProxy(e) {
2062
+ var onOptionsChangeProxy = react_1.useCallback(function (e) {
2040
2063
  if (mode === 'edit') {
2041
2064
  onOptionsChange(e);
2042
2065
  }
2043
- };
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]);
2044
2074
  var initializeMap = react_1.useCallback(function (mapStyle) {
2045
- var fitMapToContent = function fitMapToContent() {
2046
- var lngLatBounds = MapUtils_1.getGlobalLayerBoundaries([layers[0]]);
2047
- map.current.fitBounds(lngLatBounds, {
2048
- padding: MapUtils_1.MAX_BUBBLE_RADIUS + 5,
2049
- animate: false
2050
- });
2051
- };
2052
2075
  var addZoomEndEventListener = function addZoomEndEventListener() {
2053
2076
  // register event listener - zoom
2054
2077
  map.current.on('zoomend', function () {
2055
- setCurrentZoomLevel(map.current.getZoom());
2056
- // when zooming with mouse/track pad,
2057
- // zooming centers at the cursor position, need to update center as well
2058
- var newCenter = map.current.getCenter();
2059
- onOptionsChangeProxy({
2060
- center: [newCenter.lat, newCenter.lng],
2061
- zoom: map.current.getZoom()
2062
- });
2078
+ var mapZoomLevel = map.current.getZoom();
2079
+ if (mapZoomLevel < mapMinZoomRef.current) {
2080
+ setMapMinZoom(mapZoomLevel);
2081
+ }
2082
+ setCurrentZoomLevel(mapZoomLevel);
2063
2083
  });
2064
2084
  };
2065
2085
  map.current = new maplibre_gl_1.Map(Object.assign({
@@ -2067,12 +2087,18 @@ var PureMap = function PureMap(props) {
2067
2087
  preserveDrawingBuffer: true,
2068
2088
  style: mapStyle,
2069
2089
  center: lngLatCenter,
2070
- 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
+ }
2071
2096
  }, MapUtils_1.getZoomConstraintsFromTileConfig(mapStyle, baseLayerTileServer)));
2072
2097
  // Fired immediately after all necessary resources have been downloaded
2073
2098
  // and the first visually complete rendering of the map has occurred.
2074
2099
  map.current.on('load', function () {
2075
2100
  if ((layers === null || layers === void 0 ? void 0 : layers.length) > 0 && center === undefined && zoom === undefined) {
2101
+ setMapMinZoom(map.current.getZoom());
2076
2102
  map.current.on('zoomend', function () {
2077
2103
  addZoomEndEventListener();
2078
2104
  });
@@ -2091,9 +2117,19 @@ var PureMap = function PureMap(props) {
2091
2117
  map.current.on('dragend', function () {
2092
2118
  var newCenter = map.current.getCenter();
2093
2119
  onOptionsChangeProxy({
2094
- center: [newCenter.lat, newCenter.lng]
2120
+ center: [newCenter.lat, newCenter.lng],
2121
+ zoom: map.current.getZoom()
2095
2122
  });
2096
2123
  });
2124
+ map.current.on('resize', function () {
2125
+ var mapZoomLevel = map.current.getZoom();
2126
+ // If the map's zoom value is at the min zoom, and the map did a resize
2127
+ // sometimes the map will have a changed min zoom value.
2128
+ // Then we want to update the map's min zoom value.
2129
+ if (currentZoomLevelRef.current <= mapMinZoomRef.current && mapZoomLevel !== mapMinZoomRef.current) {
2130
+ setMapMinZoom(mapZoomLevel);
2131
+ }
2132
+ });
2097
2133
  // add zoom control
2098
2134
  zoomControl.current = new maplibre_gl_1.NavigationControl({
2099
2135
  showCompass: false
@@ -2118,6 +2154,24 @@ var PureMap = function PureMap(props) {
2118
2154
  map.current.resize();
2119
2155
  }
2120
2156
  }, [width, height]);
2157
+ react_1.useEffect(function () {
2158
+ if (map.current) {
2159
+ // We want to skip onOptionsChangeProxy if we have transitioned into the default map state, with undefined zoom and center.
2160
+ // This is because the DEFAULT_ZOOM value, 0, is sometimes not possible for maps with height > 500.
2161
+ // So in those cases the map will auto change its zoom from 0 => mapMinZoom
2162
+ // Since this is not a user event we don't want to broadcast it.
2163
+ if (currentZoomLevel === mapMinZoomRef.current && (zoom === undefined || zoom < mapMinZoomRef.current)) {
2164
+ return;
2165
+ }
2166
+ var newCenter = map.current.getCenter();
2167
+ onOptionsChangeProxy({
2168
+ // when zooming with mouse/track pad,
2169
+ // zooming centers at the cursor position, need to update center as well
2170
+ center: [newCenter.lat, newCenter.lng],
2171
+ zoom: currentZoomLevel
2172
+ });
2173
+ }
2174
+ }, [currentZoomLevel, onOptionsChangeProxy]);
2121
2175
  react_1.useEffect(function () {
2122
2176
  // do not render when defaultTileConfig, customTileConfig and tileset are not configured
2123
2177
  if (Object.keys(tilePreset).length === 0 && (!baseLayerTileServer || !baseLayerTileServerType)) {
@@ -2164,7 +2218,9 @@ var PureMap = function PureMap(props) {
2164
2218
  if (map.current) {
2165
2219
  map.current.flyTo({
2166
2220
  center: lngLatCenter,
2167
- zoom: zoomLevel
2221
+ // Make sure we are not flying to a zoom value smaller than the mapMinZoom
2222
+ // If we do, the map will do a little shake.
2223
+ zoom: Math.max(zoomLevel, mapMinZoomRef.current)
2168
2224
  });
2169
2225
  }
2170
2226
  }, [lngLatCenter, zoomLevel]);
@@ -2302,7 +2358,7 @@ var maplibre_gl_css_1 = __webpack_require__(408);
2302
2358
  var PureMapContainer = styled_components_1.default.div.withConfig({
2303
2359
  displayName: "PureMapContainer",
2304
2360
  componentId: "sc-1gjwxfv-0"
2305
- })(["", " 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;}.mapboxgl-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) {
2361
+ })(["", " 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) {
2306
2362
  return props.backgroundColor;
2307
2363
  }, function (props) {
2308
2364
  return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
@@ -2352,7 +2408,7 @@ Object.defineProperty(exports, "__esModule", {
2352
2408
  value: true
2353
2409
  });
2354
2410
  var React = __webpack_require__(0);
2355
- var BubbleLayer_1 = __webpack_require__(130);
2411
+ var BubbleLayer_1 = __webpack_require__(129);
2356
2412
  var MarkerLayer_1 = __webpack_require__(411);
2357
2413
  var MapUtils_1 = __webpack_require__(85);
2358
2414
  var ClusterLayer = function ClusterLayer(_ref) {
@@ -2591,6 +2647,7 @@ var Tooltip = function Tooltip(_ref) {
2591
2647
  additionalFields = _ref$additionalFields === void 0 ? [] : _ref$additionalFields;
2592
2648
  return React.createElement(StyledPopover, {
2593
2649
  open: open,
2650
+ animation: false,
2594
2651
  anchor: anchor,
2595
2652
  "data-test": "map-marker-tooltip",
2596
2653
  defaultPlacement: "above"
@@ -2648,7 +2705,7 @@ var React = __webpack_require__(0);
2648
2705
  var colorUtils_1 = __webpack_require__(12);
2649
2706
  var lodash_1 = __webpack_require__(3);
2650
2707
  var MapUtils_1 = __webpack_require__(85);
2651
- var MarkerWrapper_1 = __webpack_require__(131);
2708
+ var MarkerWrapper_1 = __webpack_require__(130);
2652
2709
  var MarkerIcon = function MarkerIcon(_a) {
2653
2710
  var theme = _a.theme,
2654
2711
  color = _a.color,
@@ -3636,7 +3693,7 @@ var config = {
3636
3693
  * viz name
3637
3694
  */
3638
3695
  name: 'Map',
3639
- category: VizCategory_1.VizCategory.CHOROPLETH,
3696
+ category: VizCategory_1.VizCategory.SPATIAL,
3640
3697
  status: 'preview',
3641
3698
  /**
3642
3699
  * viz icon
@@ -3675,10 +3732,10 @@ Object.defineProperty(exports, "__esModule", {
3675
3732
  });
3676
3733
  exports.columnsNullToZeros = void 0;
3677
3734
  var types_1 = __webpack_require__(90);
3678
- var dsl_1 = __webpack_require__(105);
3735
+ var dsl_1 = __webpack_require__(131);
3679
3736
  var hocUtils_1 = __webpack_require__(26);
3680
3737
  var JSONSchemaUtils_1 = __webpack_require__(27);
3681
- var BubbleLayer_1 = __webpack_require__(130);
3738
+ var BubbleLayer_1 = __webpack_require__(129);
3682
3739
  var columnsNullToZeros = function columnsNullToZeros(config, dataSources, options) {
3683
3740
  var _a, _b;
3684
3741
  var primary = dataSources.primary;
@@ -3893,7 +3950,7 @@ var Cover = styled_components_1.default.div.withConfig({
3893
3950
  componentId: "sc-1gsbnxb-0"
3894
3951
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3895
3952
  var Blocker = styled_components_1.default.div.attrs({
3896
- 'data-splunk-visualization-version': "25.9.1 - 5ba41e723"
3953
+ 'data-splunk-visualization-version': "25.11.0 - 8b45fb274"
3897
3954
  }).withConfig({
3898
3955
  displayName: "withEditModeCover__Blocker",
3899
3956
  componentId: "sc-1gsbnxb-1"