@splunk/visualizations 26.0.0 → 26.1.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.
- package/Area.config.js +102 -18
- package/Area.config.js.map +1 -1
- package/Area.js +618 -221
- package/Area.js.map +1 -1
- package/Bar.config.js +104 -20
- package/Bar.config.js.map +1 -1
- package/Bar.js +624 -219
- package/Bar.js.map +1 -1
- package/Bubble.config.js +94 -20
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +606 -211
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +65 -14
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +550 -183
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +103 -18
- package/Column.config.js.map +1 -1
- package/Column.js +637 -221
- package/Column.js.map +1 -1
- package/Ellipse.config.js +82 -17
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +425 -148
- package/Ellipse.js.map +1 -1
- package/Events.config.js +100 -18
- package/Events.config.js.map +1 -1
- package/Events.js +752 -293
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +96 -27
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +759 -374
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +62 -18
- package/Image.config.js.map +1 -1
- package/Image.js +419 -154
- package/Image.js.map +1 -1
- package/Line.config.js +106 -22
- package/Line.config.js.map +1 -1
- package/Line.js +631 -223
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +72 -22
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +632 -219
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +241 -97
- package/Map.config.js.map +1 -1
- package/Map.js +1195 -595
- package/Map.js.map +1 -1
- package/Markdown.config.js +70 -20
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +460 -195
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +79 -21
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +802 -411
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +72 -18
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +853 -484
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +75 -22
- package/Pie.config.js.map +1 -1
- package/Pie.js +612 -212
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +81 -29
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +844 -379
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +85 -19
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +432 -152
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +84 -22
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +878 -342
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +96 -22
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +607 -212
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +94 -24
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1182 -650
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +286 -225
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +92 -22
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +965 -506
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +99 -26
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1167 -616
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +126 -67
- package/SparkLine.js.map +1 -1
- package/Table.config.js +73 -20
- package/Table.config.js.map +1 -1
- package/Table.js +810 -322
- package/Table.js.map +1 -1
- package/common/Charting.js +107 -35
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +76 -22
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +68 -58
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +43 -34
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +156 -65
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +33 -5
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +31 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +8 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +27 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +44 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +11 -1
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +173 -90
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +14 -2
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +49 -14
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +7 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +3 -1
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +1 -0
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +287 -127
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +241 -196
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +9 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +61 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +274 -95
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +16 -18
package/Map.js
CHANGED
|
@@ -136,15 +136,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
136
136
|
Object.defineProperty(exports, "__esModule", {
|
|
137
137
|
value: true
|
|
138
138
|
});
|
|
139
|
-
exports.convertToArrOfObjects = void 0;
|
|
140
|
-
|
|
139
|
+
exports.convertToArrOfObjects = void 0; // TODO: utilize this fn in ParallelCoordinates
|
|
140
|
+
|
|
141
141
|
var convertToArrOfObjects = function convertToArrOfObjects(columns, fields) {
|
|
142
142
|
if (!columns || !columns[0] || !columns[0].length) return [];
|
|
143
143
|
var data = [];
|
|
144
|
+
|
|
144
145
|
var _loop = function _loop(i) {
|
|
145
146
|
var newObj = {};
|
|
146
147
|
fields.forEach(function (field, index) {
|
|
147
148
|
var fieldName = typeof field === 'string' ? field : field.name;
|
|
149
|
+
|
|
148
150
|
if (columns[index][i] === '') {
|
|
149
151
|
newObj[fieldName] = null;
|
|
150
152
|
} else {
|
|
@@ -153,11 +155,14 @@ var convertToArrOfObjects = function convertToArrOfObjects(columns, fields) {
|
|
|
153
155
|
});
|
|
154
156
|
data.push(newObj);
|
|
155
157
|
};
|
|
158
|
+
|
|
156
159
|
for (var i = 0; i < columns[0].length; i += 1) {
|
|
157
160
|
_loop(i);
|
|
158
161
|
}
|
|
162
|
+
|
|
159
163
|
return data;
|
|
160
164
|
};
|
|
165
|
+
|
|
161
166
|
exports.convertToArrOfObjects = convertToArrOfObjects;
|
|
162
167
|
|
|
163
168
|
/***/ }),
|
|
@@ -171,11 +176,17 @@ exports.convertToArrOfObjects = convertToArrOfObjects;
|
|
|
171
176
|
Object.defineProperty(exports, "__esModule", {
|
|
172
177
|
value: true
|
|
173
178
|
});
|
|
179
|
+
|
|
174
180
|
var React = __webpack_require__(1);
|
|
181
|
+
|
|
175
182
|
var styled_components_1 = __webpack_require__(4);
|
|
183
|
+
|
|
176
184
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
185
|
+
|
|
177
186
|
var style_1 = __webpack_require__(14);
|
|
187
|
+
|
|
178
188
|
var colorUtils_1 = __webpack_require__(12);
|
|
189
|
+
|
|
179
190
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
180
191
|
var width = _ref.width;
|
|
181
192
|
return {
|
|
@@ -188,11 +199,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
188
199
|
componentId: "sc-1yhgpod-0"
|
|
189
200
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
190
201
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
191
|
-
});
|
|
192
|
-
|
|
202
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
203
|
+
|
|
193
204
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
194
205
|
var width = _ref2.width,
|
|
195
|
-
|
|
206
|
+
height = _ref2.height;
|
|
196
207
|
return {
|
|
197
208
|
style: Object.assign(Object.assign({}, width && {
|
|
198
209
|
width: (0, style_1.toPx)(width)
|
|
@@ -214,11 +225,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
214
225
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
215
226
|
componentId: "sc-1yhgpod-3"
|
|
216
227
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
228
|
+
|
|
217
229
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
218
230
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
219
231
|
var width = props.width,
|
|
220
|
-
|
|
221
|
-
|
|
232
|
+
height = props.height,
|
|
233
|
+
backgroundColor = props.backgroundColor;
|
|
234
|
+
|
|
222
235
|
if (!height) {
|
|
223
236
|
return React.createElement(Item, {
|
|
224
237
|
"data-test": "item",
|
|
@@ -226,24 +239,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
226
239
|
backgroundColor: backgroundColor
|
|
227
240
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
228
241
|
}
|
|
242
|
+
|
|
229
243
|
return React.createElement(FixSizeItem, {
|
|
230
244
|
"data-test": "fix-size-item",
|
|
231
|
-
"data-splunk-visualization-version": "26.
|
|
245
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
232
246
|
width: width,
|
|
233
247
|
height: height,
|
|
234
248
|
backgroundColor: backgroundColor
|
|
235
249
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
236
250
|
var newWidth = _ref3.width,
|
|
237
|
-
|
|
251
|
+
newHeight = _ref3.height;
|
|
238
252
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
239
253
|
width: newWidth,
|
|
240
254
|
height: newHeight
|
|
241
255
|
}));
|
|
242
256
|
})));
|
|
243
257
|
};
|
|
258
|
+
|
|
244
259
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
245
260
|
return FixedSizeContainer;
|
|
246
261
|
};
|
|
262
|
+
|
|
247
263
|
exports.default = withFixedSizeContainer;
|
|
248
264
|
|
|
249
265
|
/***/ }),
|
|
@@ -255,36 +271,51 @@ exports.default = withFixedSizeContainer;
|
|
|
255
271
|
|
|
256
272
|
|
|
257
273
|
var _slicedToArray = __webpack_require__(17);
|
|
274
|
+
|
|
258
275
|
var _defineProperty = __webpack_require__(7);
|
|
276
|
+
|
|
259
277
|
var _toConsumableArray = __webpack_require__(8);
|
|
278
|
+
|
|
260
279
|
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
280
|
+
|
|
261
281
|
var _templateObject;
|
|
282
|
+
|
|
262
283
|
Object.defineProperty(exports, "__esModule", {
|
|
263
284
|
value: true
|
|
264
285
|
});
|
|
265
286
|
exports.Bubble = exports.PieSegment = exports.GEO_LAT_AND_LONG_FIELD = exports.GEO_BOUND_PREFIX = void 0;
|
|
287
|
+
|
|
266
288
|
var React = __webpack_require__(1);
|
|
289
|
+
|
|
267
290
|
var styled_components_1 = __webpack_require__(4);
|
|
291
|
+
|
|
268
292
|
var lodash_1 = __webpack_require__(3);
|
|
293
|
+
|
|
269
294
|
var colorUtils_1 = __webpack_require__(12);
|
|
270
|
-
|
|
295
|
+
|
|
296
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
297
|
+
|
|
271
298
|
var MarkerWrapper_1 = __webpack_require__(132);
|
|
299
|
+
|
|
272
300
|
exports.GEO_BOUND_PREFIX = '_geo_bounds_';
|
|
273
301
|
exports.GEO_LAT_AND_LONG_FIELD = ['_geo_long_field', '_geo_lat_field'];
|
|
274
302
|
exports.PieSegment = React.memo(function (_ref) {
|
|
275
303
|
var start = _ref.start,
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
304
|
+
end = _ref.end,
|
|
305
|
+
radius = _ref.radius,
|
|
306
|
+
color = _ref.color,
|
|
307
|
+
themeColor = _ref.themeColor,
|
|
308
|
+
segmentMetadata = _ref.segmentMetadata,
|
|
309
|
+
handleBubbleClick = _ref.handleBubbleClick;
|
|
310
|
+
|
|
282
311
|
var _ref2 = segmentMetadata !== null && segmentMetadata !== void 0 ? segmentMetadata : {},
|
|
283
|
-
|
|
284
|
-
|
|
312
|
+
name = _ref2.name,
|
|
313
|
+
value = _ref2.value;
|
|
314
|
+
|
|
285
315
|
var handleSegmentClick = React.useCallback(function (e) {
|
|
286
316
|
handleBubbleClick(e, name, value);
|
|
287
317
|
}, [name, value, handleBubbleClick]);
|
|
318
|
+
|
|
288
319
|
if (end - start === 1) {
|
|
289
320
|
return React.createElement("circle", {
|
|
290
321
|
onClick: handleSegmentClick,
|
|
@@ -297,6 +328,7 @@ exports.PieSegment = React.memo(function (_ref) {
|
|
|
297
328
|
stroke: color
|
|
298
329
|
});
|
|
299
330
|
}
|
|
331
|
+
|
|
300
332
|
var a0 = 2 * Math.PI * (start - 0.25);
|
|
301
333
|
var a1 = 2 * Math.PI * (end - 0.25);
|
|
302
334
|
var x0 = Math.cos(a0);
|
|
@@ -318,17 +350,17 @@ exports.PieSegment.displayName = 'MapBubblePieSegment';
|
|
|
318
350
|
var StyledMarkerWrapper = (0, styled_components_1.default)(MarkerWrapper_1.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n"])));
|
|
319
351
|
exports.Bubble = React.memo(function (_ref3) {
|
|
320
352
|
var originalValues = _ref3.originalValues,
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
353
|
+
valueRange = _ref3.valueRange,
|
|
354
|
+
colors = _ref3.colors,
|
|
355
|
+
themeColor = _ref3.themeColor,
|
|
356
|
+
isPie = _ref3.isPie,
|
|
357
|
+
latitude = _ref3.latitude,
|
|
358
|
+
longitude = _ref3.longitude,
|
|
359
|
+
bubbleSize = _ref3.bubbleSize,
|
|
360
|
+
_ref3$additionalField = _ref3.additionalFields,
|
|
361
|
+
additionalFields = _ref3$additionalField === void 0 ? [] : _ref3$additionalField,
|
|
362
|
+
map = _ref3.map,
|
|
363
|
+
handleMapClick = _ref3.handleMapClick;
|
|
332
364
|
var onBubbleClick = React.useCallback(function (e, name, value) {
|
|
333
365
|
handleMapClick(e, name, value);
|
|
334
366
|
e.stopPropagation();
|
|
@@ -337,14 +369,16 @@ exports.Bubble = React.memo(function (_ref3) {
|
|
|
337
369
|
var allZeros = originalValues.every(function (v) {
|
|
338
370
|
return v === 0;
|
|
339
371
|
});
|
|
372
|
+
|
|
340
373
|
if (allZeros || !originalValues.length) {
|
|
341
374
|
return null;
|
|
342
|
-
}
|
|
343
|
-
|
|
375
|
+
} // sanitize values
|
|
376
|
+
|
|
377
|
+
|
|
344
378
|
var values = originalValues.map(function (v) {
|
|
345
379
|
return v > 0 ? v : 0;
|
|
346
|
-
});
|
|
347
|
-
|
|
380
|
+
}); // compute offsets for pie segments
|
|
381
|
+
|
|
348
382
|
var offsets = [];
|
|
349
383
|
var total = 0;
|
|
350
384
|
values.forEach(function (count) {
|
|
@@ -378,9 +412,11 @@ exports.Bubble = React.memo(function (_ref3) {
|
|
|
378
412
|
});
|
|
379
413
|
}));
|
|
380
414
|
}, [bubbleSize, colors, isPie, onBubbleClick, originalValues, themeColor, valueRange]);
|
|
415
|
+
|
|
381
416
|
if (!bubble) {
|
|
382
417
|
return null;
|
|
383
418
|
}
|
|
419
|
+
|
|
384
420
|
return React.createElement(StyledMarkerWrapper, {
|
|
385
421
|
longitude: longitude,
|
|
386
422
|
latitude: latitude,
|
|
@@ -390,12 +426,13 @@ exports.Bubble = React.memo(function (_ref3) {
|
|
|
390
426
|
}, bubble);
|
|
391
427
|
});
|
|
392
428
|
exports.Bubble.displayName = 'MapBubble';
|
|
429
|
+
|
|
393
430
|
var BubbleLayer = function BubbleLayer(props) {
|
|
394
431
|
var bubbleLayer = props.bubbleLayer,
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
432
|
+
themeColorScheme = props.themeColorScheme,
|
|
433
|
+
map = props.map,
|
|
434
|
+
zoom = props.zoom,
|
|
435
|
+
onMapClick = props.onMapClick;
|
|
399
436
|
bubbleLayer.seriesColors = bubbleLayer.seriesColors || MapUtils_1.DEFAULT_SERIES_COLORS;
|
|
400
437
|
bubbleLayer.bubbleSize = bubbleLayer.bubbleSize || [];
|
|
401
438
|
var bakedData = React.useMemo(function () {
|
|
@@ -404,20 +441,22 @@ var BubbleLayer = function BubbleLayer(props) {
|
|
|
404
441
|
var staticColors = React.useMemo(function () {
|
|
405
442
|
return (0, MapUtils_1.getStaticColors)(bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors);
|
|
406
443
|
}, [bubbleLayer.bubbleSize.length, bubbleLayer.seriesColors]);
|
|
444
|
+
|
|
407
445
|
var _ref4 = bakedData !== null && bakedData !== void 0 ? bakedData : {},
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
446
|
+
_ref4$data = _ref4.data,
|
|
447
|
+
data = _ref4$data === void 0 ? [] : _ref4$data,
|
|
448
|
+
_ref4$dataRange = _ref4.dataRange,
|
|
449
|
+
dataRange = _ref4$dataRange === void 0 ? [] : _ref4$dataRange,
|
|
450
|
+
resultLimit = _ref4.resultLimit,
|
|
451
|
+
bubbleSizeFields = _ref4.bubbleSizeFields,
|
|
452
|
+
isPie = _ref4.isPie;
|
|
453
|
+
|
|
415
454
|
var _bubbleLayer$addition = bubbleLayer.additionalTooltipFields,
|
|
416
|
-
|
|
455
|
+
additionalTooltipFields = _bubbleLayer$addition === void 0 ? [] : _bubbleLayer$addition;
|
|
417
456
|
var roundedZoom = Math.round(zoom);
|
|
418
457
|
var themeColor = themeColorScheme === 'light' ? '#ffffff' : '#1a1c20';
|
|
419
|
-
var dynamicColors = bubbleLayer.dataColors;
|
|
420
|
-
|
|
458
|
+
var dynamicColors = bubbleLayer.dataColors; // filter data for the current zoom level and sort base on values
|
|
459
|
+
|
|
421
460
|
var dataToRender = React.useMemo(function () {
|
|
422
461
|
return data.reduce(function (acc, datum, i) {
|
|
423
462
|
if (datum.zoom === roundedZoom) {
|
|
@@ -426,14 +465,17 @@ var BubbleLayer = function BubbleLayer(props) {
|
|
|
426
465
|
idx: i
|
|
427
466
|
});
|
|
428
467
|
}
|
|
468
|
+
|
|
429
469
|
return acc;
|
|
430
470
|
}, []).slice(0, resultLimit || MapUtils_1.DEFAULT_RESULT_LIMIT).sort(function (a, b) {
|
|
431
471
|
return (0, lodash_1.sum)(b.data.values) - (0, lodash_1.sum)(a.data.values);
|
|
432
472
|
});
|
|
433
473
|
}, [data, resultLimit, roundedZoom]);
|
|
474
|
+
|
|
434
475
|
var _handleMapClick = React.useCallback(function (e, name, value, i) {
|
|
435
|
-
var _a, _b, _c;
|
|
436
|
-
|
|
476
|
+
var _a, _b, _c; // retrieve metadata from the appropriate datum, indexed by i
|
|
477
|
+
|
|
478
|
+
|
|
437
479
|
var metadata = (_c = (_b = (_a = dataToRender[i]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.metadata) !== null && _c !== void 0 ? _c : {};
|
|
438
480
|
var payload = Object.keys(metadata).reduce(function (acc, curr) {
|
|
439
481
|
var key = "row.".concat(curr, ".value");
|
|
@@ -448,13 +490,16 @@ var BubbleLayer = function BubbleLayer(props) {
|
|
|
448
490
|
payload: payload
|
|
449
491
|
});
|
|
450
492
|
}, [dataToRender, onMapClick]);
|
|
493
|
+
|
|
451
494
|
return React.createElement(React.Fragment, null, dataToRender.map(function (datum, i) {
|
|
452
495
|
var colors = dynamicColors ? [dataToRender.map(function (obj) {
|
|
453
496
|
return (0, colorUtils_1.isColor)(dynamicColors[obj.idx]) ? dynamicColors[obj.idx] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
|
|
454
497
|
})[i]] : staticColors;
|
|
498
|
+
|
|
455
499
|
var _datum$data$coordinat = _slicedToArray(datum.data.coordinates, 2),
|
|
456
|
-
|
|
457
|
-
|
|
500
|
+
longitude = _datum$data$coordinat[0],
|
|
501
|
+
latitude = _datum$data$coordinat[1];
|
|
502
|
+
|
|
458
503
|
var bubbleSize = datum.data.values.map(function (value, index) {
|
|
459
504
|
return {
|
|
460
505
|
name: bubbleSizeFields[index],
|
|
@@ -486,6 +531,7 @@ var BubbleLayer = function BubbleLayer(props) {
|
|
|
486
531
|
});
|
|
487
532
|
}));
|
|
488
533
|
};
|
|
534
|
+
|
|
489
535
|
exports.default = BubbleLayer;
|
|
490
536
|
|
|
491
537
|
/***/ }),
|
|
@@ -497,39 +543,50 @@ exports.default = BubbleLayer;
|
|
|
497
543
|
|
|
498
544
|
|
|
499
545
|
var _slicedToArray = __webpack_require__(17);
|
|
546
|
+
|
|
500
547
|
var __rest = this && this.__rest || function (s, e) {
|
|
501
548
|
var t = {};
|
|
549
|
+
|
|
502
550
|
for (var p in s) {
|
|
503
551
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
504
552
|
}
|
|
553
|
+
|
|
505
554
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
506
555
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
507
556
|
}
|
|
508
557
|
return t;
|
|
509
558
|
};
|
|
559
|
+
|
|
510
560
|
Object.defineProperty(exports, "__esModule", {
|
|
511
561
|
value: true
|
|
512
562
|
});
|
|
563
|
+
|
|
513
564
|
var maplibre_gl_1 = __webpack_require__(159);
|
|
565
|
+
|
|
514
566
|
var React = __webpack_require__(1);
|
|
567
|
+
|
|
515
568
|
var Tooltip_1 = __webpack_require__(416);
|
|
569
|
+
|
|
516
570
|
var MarkerWrapper = function MarkerWrapper(_a) {
|
|
517
571
|
var longitude = _a.longitude,
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
572
|
+
latitude = _a.latitude,
|
|
573
|
+
areaId = _a.areaId,
|
|
574
|
+
areaValue = _a.areaValue,
|
|
575
|
+
_a$additionalFields = _a.additionalFields,
|
|
576
|
+
additionalFields = _a$additionalFields === void 0 ? [] : _a$additionalFields,
|
|
577
|
+
map = _a.map,
|
|
578
|
+
isChoroplethTooltipOpen = _a.isChoroplethTooltipOpen,
|
|
579
|
+
children = _a.children,
|
|
580
|
+
otherProps = __rest(_a, ["longitude", "latitude", "areaId", "areaValue", "additionalFields", "map", "isChoroplethTooltipOpen", "children"]);
|
|
581
|
+
|
|
527
582
|
var container = React.useRef();
|
|
528
583
|
var marker = React.useRef();
|
|
584
|
+
|
|
529
585
|
var _React$useState = React.useState(false),
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
586
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
587
|
+
isTooltipOpen = _React$useState2[0],
|
|
588
|
+
setTooltipOpenStatus = _React$useState2[1];
|
|
589
|
+
|
|
533
590
|
var isChoroplethTooltip = React.useCallback(function () {
|
|
534
591
|
return isChoroplethTooltipOpen !== undefined;
|
|
535
592
|
}, [isChoroplethTooltipOpen]);
|
|
@@ -588,6 +645,7 @@ var MarkerWrapper = function MarkerWrapper(_a) {
|
|
|
588
645
|
additionalFields: additionalFields
|
|
589
646
|
})));
|
|
590
647
|
};
|
|
648
|
+
|
|
591
649
|
exports.default = MarkerWrapper;
|
|
592
650
|
|
|
593
651
|
/***/ }),
|
|
@@ -622,9 +680,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
622
680
|
* @param {DashboardVizType} props.Wrapper
|
|
623
681
|
* @param {DashboardVizType} props.Visualization
|
|
624
682
|
*/
|
|
683
|
+
|
|
625
684
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
626
685
|
var Wrapper = _ref.Wrapper,
|
|
627
|
-
|
|
686
|
+
Visualization = _ref.Visualization;
|
|
628
687
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
629
688
|
extendProperties.forEach(function (prop) {
|
|
630
689
|
if (Visualization[prop]) {
|
|
@@ -633,6 +692,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
633
692
|
}
|
|
634
693
|
});
|
|
635
694
|
};
|
|
695
|
+
|
|
636
696
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
637
697
|
|
|
638
698
|
/***/ }),
|
|
@@ -665,40 +725,56 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
665
725
|
|
|
666
726
|
|
|
667
727
|
var _slicedToArray = __webpack_require__(17);
|
|
728
|
+
|
|
668
729
|
Object.defineProperty(exports, "__esModule", {
|
|
669
730
|
value: true
|
|
670
731
|
});
|
|
671
732
|
exports.Choropleth = exports.cleanupChoropleth = exports.compareChoropleth = exports.compareGeom = void 0;
|
|
733
|
+
|
|
672
734
|
var React = __webpack_require__(1);
|
|
735
|
+
|
|
673
736
|
var lodash_1 = __webpack_require__(3);
|
|
674
|
-
|
|
737
|
+
|
|
738
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
739
|
+
|
|
675
740
|
var MarkerWrapper_1 = __webpack_require__(132);
|
|
741
|
+
|
|
676
742
|
var getShapeId = function getShapeId(id) {
|
|
677
743
|
return "shape-".concat(id);
|
|
678
744
|
};
|
|
745
|
+
|
|
679
746
|
var getSourceId = function getSourceId(id) {
|
|
680
747
|
return "source-".concat(id);
|
|
681
748
|
};
|
|
749
|
+
|
|
682
750
|
var getStrokeId = function getStrokeId(id) {
|
|
683
751
|
return "stroke-".concat(id);
|
|
684
752
|
};
|
|
753
|
+
|
|
685
754
|
var compareGeom = function compareGeom(prev, next) {
|
|
686
755
|
if (prev !== null && next !== null) {
|
|
687
756
|
return prev.type === next.type && (0, lodash_1.isEqual)(prev.coordinates, next.coordinates);
|
|
688
757
|
}
|
|
758
|
+
|
|
689
759
|
return prev === null && next === null;
|
|
690
760
|
};
|
|
761
|
+
|
|
691
762
|
exports.compareGeom = compareGeom;
|
|
763
|
+
|
|
692
764
|
var compareChoropleth = function compareChoropleth(prevProps, nextProps) {
|
|
693
765
|
return (0, exports.compareGeom)(prevProps.geomData, nextProps.geomData) && prevProps.id === nextProps.id && prevProps.map === nextProps.map && prevProps.areaId === nextProps.areaId && prevProps.areaValue === nextProps.areaValue && prevProps.color === nextProps.color && prevProps.opacity === nextProps.opacity && prevProps.strokeColor === nextProps.strokeColor && prevProps.isThemeChanged === nextProps.isThemeChanged && (0, lodash_1.isEqual)(prevProps.additionalFields, nextProps.additionalFields) && prevProps.handleMapClick.toString() === nextProps.handleMapClick.toString();
|
|
694
766
|
};
|
|
767
|
+
|
|
695
768
|
exports.compareChoropleth = compareChoropleth;
|
|
769
|
+
|
|
696
770
|
var cleanupChoropleth = function cleanupChoropleth(shapeId, sourceId, strokeId, map) {
|
|
697
|
-
var _a, _b, _c;
|
|
698
|
-
|
|
771
|
+
var _a, _b, _c; // catch errors where map is undefined
|
|
772
|
+
|
|
773
|
+
|
|
699
774
|
var currLayer;
|
|
700
775
|
var currSource;
|
|
701
776
|
var currStrokeLayer;
|
|
777
|
+
|
|
702
778
|
try {
|
|
703
779
|
currLayer = (_a = map === null || map === void 0 ? void 0 : map.current) === null || _a === void 0 ? void 0 : _a.getLayer(shapeId);
|
|
704
780
|
currStrokeLayer = (_b = map === null || map === void 0 ? void 0 : map.current) === null || _b === void 0 ? void 0 : _b.getLayer(strokeId);
|
|
@@ -706,29 +782,33 @@ var cleanupChoropleth = function cleanupChoropleth(shapeId, sourceId, strokeId,
|
|
|
706
782
|
} catch (_d) {
|
|
707
783
|
return;
|
|
708
784
|
}
|
|
785
|
+
|
|
709
786
|
if (currLayer) {
|
|
710
787
|
map.current.removeLayer(shapeId);
|
|
711
788
|
}
|
|
789
|
+
|
|
712
790
|
if (currStrokeLayer) {
|
|
713
791
|
map.current.removeLayer(strokeId);
|
|
714
792
|
}
|
|
793
|
+
|
|
715
794
|
if (currSource) {
|
|
716
795
|
map.current.removeSource(sourceId);
|
|
717
796
|
}
|
|
718
797
|
};
|
|
798
|
+
|
|
719
799
|
exports.cleanupChoropleth = cleanupChoropleth;
|
|
720
800
|
exports.Choropleth = React.memo(function (_ref) {
|
|
721
801
|
var id = _ref.id,
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
802
|
+
areaId = _ref.areaId,
|
|
803
|
+
areaValue = _ref.areaValue,
|
|
804
|
+
geomData = _ref.geomData,
|
|
805
|
+
map = _ref.map,
|
|
806
|
+
color = _ref.color,
|
|
807
|
+
opacity = _ref.opacity,
|
|
808
|
+
strokeColor = _ref.strokeColor,
|
|
809
|
+
isThemeChanged = _ref.isThemeChanged,
|
|
810
|
+
additionalFields = _ref.additionalFields,
|
|
811
|
+
handleMapClick = _ref.handleMapClick;
|
|
732
812
|
var sourceId = getSourceId(id);
|
|
733
813
|
var shapeId = getShapeId(id);
|
|
734
814
|
var strokeId = getStrokeId(id);
|
|
@@ -736,18 +816,22 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
736
816
|
type: 'Feature',
|
|
737
817
|
geometry: geomData
|
|
738
818
|
};
|
|
819
|
+
|
|
739
820
|
var _React$useState = React.useState(false),
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
821
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
822
|
+
isTooltipOpen = _React$useState2[0],
|
|
823
|
+
setTooltipOpenStatus = _React$useState2[1];
|
|
824
|
+
|
|
743
825
|
var _React$useState3 = React.useState(0),
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
826
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
827
|
+
mouseLat = _React$useState4[0],
|
|
828
|
+
setmouseLat = _React$useState4[1];
|
|
829
|
+
|
|
747
830
|
var _React$useState5 = React.useState(0),
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
831
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
832
|
+
mouseLng = _React$useState6[0],
|
|
833
|
+
setmouseLng = _React$useState6[1];
|
|
834
|
+
|
|
751
835
|
var openTooltip = React.useCallback(function () {
|
|
752
836
|
setTooltipOpenStatus(true);
|
|
753
837
|
}, []);
|
|
@@ -757,9 +841,9 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
757
841
|
var updateChoropleth = React.useCallback(function () {
|
|
758
842
|
// Apply changes by removing the existing choropleth and creating a new one
|
|
759
843
|
// instead of mutating the current
|
|
760
|
-
(0, exports.cleanupChoropleth)(shapeId, sourceId, strokeId, map);
|
|
761
|
-
// In order to set a different color and opacity to each choropleth region
|
|
844
|
+
(0, exports.cleanupChoropleth)(shapeId, sourceId, strokeId, map); // In order to set a different color and opacity to each choropleth region
|
|
762
845
|
// we are creating a different layer for each region, and each layer requires a source
|
|
846
|
+
|
|
763
847
|
map.current.addSource(sourceId, {
|
|
764
848
|
type: 'geojson',
|
|
765
849
|
data: formattedGeomData
|
|
@@ -774,6 +858,7 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
774
858
|
'fill-color': color
|
|
775
859
|
}
|
|
776
860
|
});
|
|
861
|
+
|
|
777
862
|
if (strokeColor !== 'transparent') {
|
|
778
863
|
map.current.addLayer({
|
|
779
864
|
id: strokeId,
|
|
@@ -786,6 +871,7 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
786
871
|
}
|
|
787
872
|
});
|
|
788
873
|
}
|
|
874
|
+
|
|
789
875
|
map.current.on('mousemove', shapeId, function (e) {
|
|
790
876
|
var mouseLngLat = e.lngLat;
|
|
791
877
|
setmouseLat(mouseLngLat.lat);
|
|
@@ -793,30 +879,30 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
793
879
|
openTooltip();
|
|
794
880
|
map.current.getCanvas().style.cursor = 'pointer'; // eslint-disable-line no-param-reassign
|
|
795
881
|
});
|
|
796
|
-
|
|
797
882
|
map.current.on('mouseleave', shapeId, function () {
|
|
798
883
|
closeTooltip();
|
|
799
884
|
map.current.getCanvas().style.cursor = ''; // eslint-disable-line no-param-reassign
|
|
800
885
|
});
|
|
801
|
-
|
|
802
886
|
map.current.on('click', shapeId, function (e) {
|
|
803
887
|
handleMapClick(e);
|
|
804
888
|
});
|
|
805
889
|
}, [shapeId, sourceId, map, color, opacity, formattedGeomData]);
|
|
806
890
|
React.useEffect(function () {
|
|
807
891
|
updateChoropleth();
|
|
808
|
-
}, [map, geomData, color, opacity, id, strokeColor]);
|
|
809
|
-
|
|
892
|
+
}, [map, geomData, color, opacity, id, strokeColor]); // Clean up on unmount
|
|
893
|
+
|
|
810
894
|
React.useEffect(function () {
|
|
811
895
|
return function () {
|
|
812
896
|
return (0, exports.cleanupChoropleth)(shapeId, sourceId, strokeId, map);
|
|
813
897
|
};
|
|
814
898
|
}, []);
|
|
899
|
+
|
|
815
900
|
if (isThemeChanged) {
|
|
816
901
|
// Theme changes will reset the style layers of the entire map
|
|
817
902
|
// so we need to rerender the choropleths
|
|
818
903
|
updateChoropleth();
|
|
819
904
|
}
|
|
905
|
+
|
|
820
906
|
return React.createElement(MarkerWrapper_1.default, {
|
|
821
907
|
isChoroplethTooltipOpen: isTooltipOpen,
|
|
822
908
|
additionalFields: additionalFields,
|
|
@@ -834,21 +920,23 @@ exports.Choropleth = React.memo(function (_ref) {
|
|
|
834
920
|
}));
|
|
835
921
|
}, exports.compareChoropleth);
|
|
836
922
|
exports.Choropleth.displayName = 'MapChoropleth';
|
|
923
|
+
|
|
837
924
|
var ChoroplethLayer = function ChoroplethLayer(props) {
|
|
838
925
|
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
926
|
+
|
|
839
927
|
var map = props.map,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
928
|
+
choroplethLayer = props.choroplethLayer,
|
|
929
|
+
isThemeChanged = props.isThemeChanged,
|
|
930
|
+
setIsThemeChanged = props.setIsThemeChanged,
|
|
931
|
+
onMapClick = props.onMapClick;
|
|
844
932
|
var cfgOpacity = Math.min(Math.max(choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.choroplethOpacity, 0), 1);
|
|
845
933
|
var scaledOpacities = (_a = (0, MapUtils_1.getScaledOpacities)(choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.dataColors, cfgOpacity)) !== null && _a !== void 0 ? _a : [];
|
|
846
934
|
var colors = (_b = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.dataColors) === null || _b === void 0 ? void 0 : _b.map(function (color) {
|
|
847
935
|
return (color === null || color === void 0 ? void 0 : color.length) > 7 ? color.slice(0, 7) : color;
|
|
848
936
|
});
|
|
849
937
|
var limit = Math.min((_c = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.areaIds) === null || _c === void 0 ? void 0 : _c.length, (_d = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.areaValues) === null || _d === void 0 ? void 0 : _d.length, (_f = (_e = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.geom) === null || _e === void 0 ? void 0 : _e.length) !== null && _f !== void 0 ? _f : 0, (choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.resultLimit) ? choroplethLayer.resultLimit : MapUtils_1.DEFAULT_RESULT_LIMIT);
|
|
850
|
-
var areaIdSliced = (_h = (_g = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.areaIds) === null || _g === void 0 ? void 0 : _g.slice(0, limit)) !== null && _h !== void 0 ? _h : [];
|
|
851
|
-
|
|
938
|
+
var areaIdSliced = (_h = (_g = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.areaIds) === null || _g === void 0 ? void 0 : _g.slice(0, limit)) !== null && _h !== void 0 ? _h : []; // generate a unique id if areaIds are not unique
|
|
939
|
+
|
|
852
940
|
var uniqueAreaIdSliced = (0, lodash_1.uniq)(areaIdSliced).length !== areaIdSliced.length ? areaIdSliced.map(function (id, i) {
|
|
853
941
|
return "".concat(id).concat(i);
|
|
854
942
|
}) : areaIdSliced;
|
|
@@ -860,6 +948,7 @@ var ChoroplethLayer = function ChoroplethLayer(props) {
|
|
|
860
948
|
};
|
|
861
949
|
});
|
|
862
950
|
}) : [];
|
|
951
|
+
|
|
863
952
|
var _handleMapClick = function handleMapClick(e, i) {
|
|
864
953
|
var payload = (0, MapUtils_1.formatMetadata)(choroplethLayer, i);
|
|
865
954
|
onMapClick({
|
|
@@ -867,12 +956,15 @@ var ChoroplethLayer = function ChoroplethLayer(props) {
|
|
|
867
956
|
payload: payload
|
|
868
957
|
});
|
|
869
958
|
};
|
|
959
|
+
|
|
870
960
|
if (!map || !choroplethLayer || !choroplethLayer.geom) {
|
|
871
961
|
return React.createElement(React.Fragment, null);
|
|
872
962
|
}
|
|
963
|
+
|
|
873
964
|
if (isThemeChanged) {
|
|
874
965
|
setIsThemeChanged(false);
|
|
875
966
|
}
|
|
967
|
+
|
|
876
968
|
return React.createElement("div", null, uniqueAreaIdSliced.map(function (id, i) {
|
|
877
969
|
var areaId = areaIdSliced[i];
|
|
878
970
|
var areaValue = choroplethLayer.areaValues[i];
|
|
@@ -894,6 +986,7 @@ var ChoroplethLayer = function ChoroplethLayer(props) {
|
|
|
894
986
|
});
|
|
895
987
|
}));
|
|
896
988
|
};
|
|
989
|
+
|
|
897
990
|
exports.default = ChoroplethLayer;
|
|
898
991
|
|
|
899
992
|
/***/ }),
|
|
@@ -933,24 +1026,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
933
1026
|
|
|
934
1027
|
|
|
935
1028
|
var _toConsumableArray = __webpack_require__(8);
|
|
1029
|
+
|
|
936
1030
|
var _defineProperty = __webpack_require__(7);
|
|
1031
|
+
|
|
937
1032
|
var __rest = this && this.__rest || function (s, e) {
|
|
938
1033
|
var t = {};
|
|
1034
|
+
|
|
939
1035
|
for (var p in s) {
|
|
940
1036
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
941
1037
|
}
|
|
1038
|
+
|
|
942
1039
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
943
1040
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
944
1041
|
}
|
|
945
1042
|
return t;
|
|
946
1043
|
};
|
|
1044
|
+
|
|
947
1045
|
Object.defineProperty(exports, "__esModule", {
|
|
948
1046
|
value: true
|
|
949
1047
|
});
|
|
950
1048
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
1049
|
+
|
|
951
1050
|
var lodash_1 = __webpack_require__(3);
|
|
1051
|
+
|
|
952
1052
|
var schemaUtils_1 = __webpack_require__(16);
|
|
1053
|
+
|
|
953
1054
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1055
|
+
|
|
954
1056
|
var dynamicOptionsDSLType = {
|
|
955
1057
|
type: 'string',
|
|
956
1058
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -960,20 +1062,22 @@ var dynamicOptionsDSLType = {
|
|
|
960
1062
|
* @param optionsSchema a visualization's options schema
|
|
961
1063
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
962
1064
|
*/
|
|
1065
|
+
|
|
963
1066
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
964
1067
|
var enhancedOptionsSchema = {};
|
|
965
1068
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
966
1069
|
var _a = optionsSchema[key],
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1070
|
+
title = _a.title,
|
|
1071
|
+
description = _a.description,
|
|
1072
|
+
readOnly = _a.readOnly,
|
|
1073
|
+
writeOnly = _a.writeOnly,
|
|
1074
|
+
examples = _a.examples,
|
|
1075
|
+
defaultValue = _a.default,
|
|
1076
|
+
type = _a.type,
|
|
1077
|
+
properties = _a.properties,
|
|
1078
|
+
patternProperties = _a.patternProperties,
|
|
1079
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
1080
|
+
|
|
977
1081
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
978
1082
|
title: title
|
|
979
1083
|
}), description !== undefined && {
|
|
@@ -987,12 +1091,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
987
1091
|
}), defaultValue !== undefined && {
|
|
988
1092
|
default: defaultValue
|
|
989
1093
|
});
|
|
1094
|
+
|
|
990
1095
|
if (type === 'object') {
|
|
991
1096
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
992
1097
|
type: type
|
|
993
1098
|
}), properties && {
|
|
994
1099
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
995
1100
|
});
|
|
1101
|
+
|
|
996
1102
|
if (patternProperties) {
|
|
997
1103
|
var enhancedPatternProperties = {};
|
|
998
1104
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -1010,6 +1116,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
1010
1116
|
});
|
|
1011
1117
|
return enhancedOptionsSchema;
|
|
1012
1118
|
}
|
|
1119
|
+
|
|
1013
1120
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
1014
1121
|
/**
|
|
1015
1122
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -1018,11 +1125,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
1018
1125
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
1019
1126
|
* and containing `open: false` for all editor panels in editorConfig
|
|
1020
1127
|
*/
|
|
1128
|
+
|
|
1021
1129
|
function enhanceConfig(vizConfig) {
|
|
1022
1130
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
1131
|
+
|
|
1023
1132
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
1024
1133
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
1025
1134
|
}
|
|
1135
|
+
|
|
1026
1136
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
1027
1137
|
return Object.assign(Object.assign({}, config), {
|
|
1028
1138
|
open: config.open || false
|
|
@@ -1030,6 +1140,7 @@ function enhanceConfig(vizConfig) {
|
|
|
1030
1140
|
});
|
|
1031
1141
|
return enhancedConfig;
|
|
1032
1142
|
}
|
|
1143
|
+
|
|
1033
1144
|
exports.enhanceConfig = enhanceConfig;
|
|
1034
1145
|
/**
|
|
1035
1146
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -1037,6 +1148,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
1037
1148
|
* @param vizConfig a Visualization Config
|
|
1038
1149
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
1039
1150
|
*/
|
|
1151
|
+
|
|
1040
1152
|
function uncollapseEditorConfig(vizConfig) {
|
|
1041
1153
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
1042
1154
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -1046,13 +1158,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
1046
1158
|
});
|
|
1047
1159
|
return editorPanelUncollapsedConfig;
|
|
1048
1160
|
}
|
|
1161
|
+
|
|
1049
1162
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
1163
|
+
|
|
1050
1164
|
function isDynamicOption(option) {
|
|
1051
1165
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
1052
1166
|
}
|
|
1053
|
-
|
|
1054
|
-
// private helpers to improve readability of getInitialPreset
|
|
1167
|
+
|
|
1168
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
1055
1169
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
1170
|
+
|
|
1056
1171
|
/**
|
|
1057
1172
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
1058
1173
|
* 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
|
|
@@ -1061,6 +1176,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
1061
1176
|
*
|
|
1062
1177
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
1063
1178
|
*/
|
|
1179
|
+
|
|
1064
1180
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
1065
1181
|
var presetContextKeys = Object.keys(presetContext);
|
|
1066
1182
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -1070,6 +1186,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
1070
1186
|
/**
|
|
1071
1187
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
1072
1188
|
*/
|
|
1189
|
+
|
|
1190
|
+
|
|
1073
1191
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
1074
1192
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
1075
1193
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -1084,18 +1202,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
1084
1202
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
1085
1203
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
1086
1204
|
*/
|
|
1205
|
+
|
|
1206
|
+
|
|
1087
1207
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
1088
1208
|
return presets.find(function (preset) {
|
|
1089
1209
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
1090
1210
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
1091
1211
|
var presetContextKeys = Object.keys(presetContext);
|
|
1092
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
1093
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1212
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1094
1213
|
// if not, then the preset is invalid in config.ts
|
|
1214
|
+
|
|
1095
1215
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
1096
1216
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
1097
1217
|
});
|
|
1098
1218
|
}
|
|
1219
|
+
|
|
1099
1220
|
exports.getInitialPreset = getInitialPreset;
|
|
1100
1221
|
/**
|
|
1101
1222
|
* generates number precision values for a Select editor
|
|
@@ -1103,6 +1224,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
1103
1224
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
1104
1225
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
1105
1226
|
*/
|
|
1227
|
+
|
|
1106
1228
|
function generatePrecisionValues(numPrecisionValues) {
|
|
1107
1229
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
1108
1230
|
return {
|
|
@@ -1111,6 +1233,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
1111
1233
|
};
|
|
1112
1234
|
});
|
|
1113
1235
|
}
|
|
1236
|
+
|
|
1114
1237
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
1115
1238
|
/**
|
|
1116
1239
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -1120,12 +1243,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
1120
1243
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
1121
1244
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
1122
1245
|
*/
|
|
1246
|
+
|
|
1123
1247
|
var insertLayout = function insertLayout(layout, index) {
|
|
1124
1248
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1125
1249
|
layoutItems[_key - 2] = arguments[_key];
|
|
1126
1250
|
}
|
|
1251
|
+
|
|
1127
1252
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
1128
1253
|
};
|
|
1254
|
+
|
|
1129
1255
|
exports.insertLayout = insertLayout;
|
|
1130
1256
|
|
|
1131
1257
|
/***/ }),
|
|
@@ -1189,11 +1315,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1189
1315
|
value: true
|
|
1190
1316
|
});
|
|
1191
1317
|
exports.shouldShowIconPlaceholder = void 0;
|
|
1318
|
+
|
|
1192
1319
|
var React = __webpack_require__(1);
|
|
1320
|
+
|
|
1193
1321
|
var T = __webpack_require__(0);
|
|
1322
|
+
|
|
1194
1323
|
var lodash_1 = __webpack_require__(3);
|
|
1324
|
+
|
|
1195
1325
|
var i18n_1 = __webpack_require__(2);
|
|
1326
|
+
|
|
1196
1327
|
var Message_1 = __webpack_require__(10);
|
|
1328
|
+
|
|
1197
1329
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1198
1330
|
/**
|
|
1199
1331
|
* @method shouldShowIconPlaceholder
|
|
@@ -1201,6 +1333,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
1201
1333
|
* @param {boolean} loading
|
|
1202
1334
|
* @returns {boolean}
|
|
1203
1335
|
*/
|
|
1336
|
+
|
|
1337
|
+
|
|
1204
1338
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1205
1339
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1206
1340
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -1209,6 +1343,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
1209
1343
|
var noFields = fields === undefined;
|
|
1210
1344
|
return loading || noData || noFields;
|
|
1211
1345
|
};
|
|
1346
|
+
|
|
1212
1347
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1213
1348
|
var propTypes = {
|
|
1214
1349
|
icon: T.func,
|
|
@@ -1223,11 +1358,13 @@ var propTypes = {
|
|
|
1223
1358
|
* @param {IconPlaceholderProps} props
|
|
1224
1359
|
* @returns {React.ReactElement}
|
|
1225
1360
|
*/
|
|
1361
|
+
|
|
1226
1362
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1227
1363
|
var width = props.width,
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1364
|
+
height = props.height,
|
|
1365
|
+
icon = props.icon,
|
|
1366
|
+
iconColor = props.iconColor;
|
|
1367
|
+
|
|
1231
1368
|
if (icon) {
|
|
1232
1369
|
return React.createElement(icon, {
|
|
1233
1370
|
style: {
|
|
@@ -1242,6 +1379,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1242
1379
|
height: '50%'
|
|
1243
1380
|
});
|
|
1244
1381
|
}
|
|
1382
|
+
|
|
1245
1383
|
return React.createElement(Message_1.default, {
|
|
1246
1384
|
width: width,
|
|
1247
1385
|
height: height,
|
|
@@ -1249,6 +1387,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1249
1387
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
1250
1388
|
});
|
|
1251
1389
|
};
|
|
1390
|
+
|
|
1252
1391
|
IconPlaceholder.propTypes = propTypes;
|
|
1253
1392
|
IconPlaceholder.defaultProps = {
|
|
1254
1393
|
width: '100%',
|
|
@@ -1265,21 +1404,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
1265
1404
|
|
|
1266
1405
|
|
|
1267
1406
|
var _defineProperty = __webpack_require__(7);
|
|
1407
|
+
|
|
1268
1408
|
Object.defineProperty(exports, "__esModule", {
|
|
1269
1409
|
value: true
|
|
1270
1410
|
});
|
|
1271
1411
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1412
|
+
|
|
1272
1413
|
var T = __webpack_require__(0);
|
|
1414
|
+
|
|
1273
1415
|
var lodash_1 = __webpack_require__(3);
|
|
1274
|
-
|
|
1416
|
+
|
|
1417
|
+
var DataSource_1 = __webpack_require__(34);
|
|
1418
|
+
|
|
1275
1419
|
exports.SortParamsPropTypes = T.shape({
|
|
1276
1420
|
currentSortKey: T.string,
|
|
1277
1421
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
1278
1422
|
onSort: T.func
|
|
1279
1423
|
});
|
|
1424
|
+
|
|
1280
1425
|
var getSortingParams = function getSortingParams(_ref) {
|
|
1281
1426
|
var requestParams = _ref.requestParams,
|
|
1282
|
-
|
|
1427
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1283
1428
|
var currentSortKey;
|
|
1284
1429
|
var currentSortDir;
|
|
1285
1430
|
var nextSortDirMap = {
|
|
@@ -1288,15 +1433,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1288
1433
|
none: 'asc'
|
|
1289
1434
|
};
|
|
1290
1435
|
var onSort;
|
|
1436
|
+
|
|
1291
1437
|
if (typeof onRequestParamsChange === 'function') {
|
|
1292
1438
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
1293
1439
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
1294
1440
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
1295
|
-
}
|
|
1296
|
-
|
|
1441
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1442
|
+
|
|
1443
|
+
|
|
1297
1444
|
onSort = function onSort(e, _ref2) {
|
|
1298
1445
|
var sortKey = _ref2.sortKey,
|
|
1299
|
-
|
|
1446
|
+
sortDir = _ref2.sortDir;
|
|
1447
|
+
|
|
1300
1448
|
if (typeof sortKey === 'string') {
|
|
1301
1449
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1302
1450
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -1308,12 +1456,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1308
1456
|
}
|
|
1309
1457
|
};
|
|
1310
1458
|
}
|
|
1459
|
+
|
|
1311
1460
|
return {
|
|
1312
1461
|
currentSortKey: currentSortKey,
|
|
1313
1462
|
currentSortDir: currentSortDir,
|
|
1314
1463
|
onSort: onSort
|
|
1315
1464
|
};
|
|
1316
1465
|
};
|
|
1466
|
+
|
|
1317
1467
|
exports.getSortingParams = getSortingParams;
|
|
1318
1468
|
|
|
1319
1469
|
/***/ }),
|
|
@@ -1324,43 +1474,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
1324
1474
|
"use strict";
|
|
1325
1475
|
|
|
1326
1476
|
|
|
1477
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1478
|
+
value: true
|
|
1479
|
+
});
|
|
1480
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
1481
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1482
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
1483
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
1484
|
+
|
|
1485
|
+
/***/ }),
|
|
1486
|
+
|
|
1487
|
+
/***/ 35:
|
|
1488
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1489
|
+
|
|
1490
|
+
"use strict";
|
|
1491
|
+
|
|
1492
|
+
|
|
1327
1493
|
Object.defineProperty(exports, "__esModule", {
|
|
1328
1494
|
value: true
|
|
1329
1495
|
});
|
|
1330
1496
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1497
|
+
|
|
1331
1498
|
var T = __webpack_require__(0);
|
|
1499
|
+
|
|
1332
1500
|
var lodash_1 = __webpack_require__(3);
|
|
1501
|
+
|
|
1333
1502
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
1334
1503
|
isPaging: T.bool,
|
|
1335
1504
|
current: T.number,
|
|
1336
1505
|
totalPages: T.number,
|
|
1337
1506
|
onChange: T.func
|
|
1338
1507
|
});
|
|
1508
|
+
|
|
1339
1509
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
1340
1510
|
var requestParams = _ref.requestParams,
|
|
1341
|
-
|
|
1342
|
-
|
|
1511
|
+
meta = _ref.meta,
|
|
1512
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1343
1513
|
var totalCount = meta && meta.totalCount || 0;
|
|
1344
1514
|
var offset = requestParams && requestParams.offset || 0;
|
|
1345
1515
|
var count = requestParams && requestParams.count;
|
|
1346
1516
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
1347
1517
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
1348
1518
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
1519
|
+
|
|
1349
1520
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1350
1521
|
var page = _ref2.page,
|
|
1351
|
-
|
|
1522
|
+
countArg = _ref2.count;
|
|
1352
1523
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1524
|
+
|
|
1353
1525
|
if (typeof countArg === 'number') {
|
|
1354
1526
|
newParams.count = countArg;
|
|
1355
1527
|
newParams.offset = 0;
|
|
1356
1528
|
}
|
|
1529
|
+
|
|
1357
1530
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1531
|
+
|
|
1358
1532
|
if (typeof page === 'number' && page > 0) {
|
|
1359
1533
|
newParams.count = pageCount;
|
|
1360
1534
|
newParams.offset = (page - 1) * pageCount;
|
|
1361
1535
|
}
|
|
1536
|
+
|
|
1362
1537
|
onRequestParamsChange(newParams);
|
|
1363
1538
|
};
|
|
1539
|
+
|
|
1364
1540
|
return {
|
|
1365
1541
|
isPaging: isPaging,
|
|
1366
1542
|
current: current,
|
|
@@ -1368,11 +1544,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1368
1544
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
1369
1545
|
};
|
|
1370
1546
|
};
|
|
1547
|
+
|
|
1371
1548
|
exports.getPaginationParams = getPaginationParams;
|
|
1372
1549
|
|
|
1373
1550
|
/***/ }),
|
|
1374
1551
|
|
|
1375
|
-
/***/
|
|
1552
|
+
/***/ 36:
|
|
1376
1553
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1377
1554
|
|
|
1378
1555
|
"use strict";
|
|
@@ -1383,6 +1560,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1383
1560
|
});
|
|
1384
1561
|
exports.VizCategory = void 0;
|
|
1385
1562
|
var VizCategory;
|
|
1563
|
+
|
|
1386
1564
|
(function (VizCategory) {
|
|
1387
1565
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1388
1566
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -1400,67 +1578,96 @@ var VizCategory;
|
|
|
1400
1578
|
|
|
1401
1579
|
/***/ }),
|
|
1402
1580
|
|
|
1403
|
-
/***/
|
|
1581
|
+
/***/ 37:
|
|
1404
1582
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1405
1583
|
|
|
1406
1584
|
"use strict";
|
|
1407
1585
|
|
|
1408
1586
|
|
|
1409
1587
|
var _slicedToArray = __webpack_require__(17);
|
|
1588
|
+
|
|
1410
1589
|
Object.defineProperty(exports, "__esModule", {
|
|
1411
1590
|
value: true
|
|
1412
1591
|
});
|
|
1592
|
+
|
|
1413
1593
|
var React = __webpack_require__(1);
|
|
1594
|
+
|
|
1414
1595
|
var lodash_1 = __webpack_require__(3);
|
|
1415
|
-
|
|
1596
|
+
|
|
1597
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1598
|
+
|
|
1416
1599
|
var Options_1 = __webpack_require__(30);
|
|
1417
|
-
|
|
1600
|
+
|
|
1601
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1602
|
+
|
|
1418
1603
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
1419
|
-
|
|
1604
|
+
|
|
1605
|
+
var moment_1 = __webpack_require__(40);
|
|
1606
|
+
|
|
1420
1607
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1608
|
+
|
|
1421
1609
|
var styled_components_1 = __webpack_require__(4);
|
|
1610
|
+
|
|
1422
1611
|
var hocUtils_1 = __webpack_require__(27);
|
|
1612
|
+
|
|
1423
1613
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1424
|
-
|
|
1614
|
+
|
|
1615
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1616
|
+
|
|
1425
1617
|
var id_1 = __webpack_require__(25);
|
|
1426
|
-
|
|
1618
|
+
|
|
1619
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
1620
|
+
|
|
1427
1621
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1622
|
+
|
|
1428
1623
|
var getSorting_1 = __webpack_require__(33);
|
|
1429
|
-
|
|
1624
|
+
|
|
1625
|
+
var getPagination_1 = __webpack_require__(35);
|
|
1626
|
+
|
|
1430
1627
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
1628
|
+
|
|
1431
1629
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
1630
|
+
|
|
1432
1631
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
1632
|
+
|
|
1433
1633
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
1434
1634
|
/**
|
|
1435
1635
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1436
1636
|
* @param {DashboardVizOpts} opts
|
|
1437
1637
|
* @returns {HOC}
|
|
1438
1638
|
*/
|
|
1639
|
+
|
|
1640
|
+
|
|
1439
1641
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
1440
1642
|
var ReactViz = opts.ReactViz,
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1643
|
+
vizConfig = opts.vizConfig,
|
|
1644
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
1645
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1646
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
1647
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1648
|
+
|
|
1446
1649
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1447
1650
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1651
|
+
|
|
1448
1652
|
var DashboardViz = function DashboardViz(props) {
|
|
1449
1653
|
var _a;
|
|
1654
|
+
|
|
1450
1655
|
var mode = props.mode,
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1656
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
1657
|
+
dataSources = props.dataSources,
|
|
1658
|
+
options = props.options,
|
|
1659
|
+
_props$context = props.context,
|
|
1660
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
1661
|
+
width = props.width,
|
|
1662
|
+
height = props.height,
|
|
1663
|
+
onComputedProps = props.onComputedProps,
|
|
1664
|
+
onEventTrigger = props.onEventTrigger,
|
|
1665
|
+
theme = props.theme,
|
|
1666
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1667
|
+
|
|
1462
1668
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
1463
|
-
|
|
1669
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1670
|
+
|
|
1464
1671
|
if (serializedTimezone) {
|
|
1465
1672
|
/*
|
|
1466
1673
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -1474,38 +1681,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1474
1681
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
1475
1682
|
}
|
|
1476
1683
|
}
|
|
1684
|
+
|
|
1477
1685
|
var themeFunc = function themeFunc(themeVar) {
|
|
1478
1686
|
var _a, _b;
|
|
1687
|
+
|
|
1479
1688
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
1480
1689
|
};
|
|
1690
|
+
|
|
1481
1691
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1692
|
+
|
|
1482
1693
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1694
|
+
theme: theme
|
|
1695
|
+
}),
|
|
1696
|
+
currentThemeFamily = _ref.family,
|
|
1697
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1698
|
+
currentThemeDensity = _ref.density;
|
|
1699
|
+
|
|
1488
1700
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1701
|
+
|
|
1489
1702
|
var _React$useState = React.useState({}),
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1703
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1704
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1705
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1706
|
+
|
|
1707
|
+
|
|
1493
1708
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1709
|
+
|
|
1494
1710
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1495
|
-
|
|
1496
|
-
|
|
1711
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1712
|
+
visualizationID = _React$useState4[0];
|
|
1713
|
+
|
|
1497
1714
|
var _React$useState5 = React.useState({}),
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1715
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1716
|
+
dataSourcesInState = _React$useState6[0],
|
|
1717
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1718
|
+
|
|
1501
1719
|
var _React$useState7 = React.useState(),
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1720
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1721
|
+
dataFramesInState = _React$useState8[0],
|
|
1722
|
+
setDataFramesInState = _React$useState8[1];
|
|
1723
|
+
|
|
1505
1724
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1725
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1726
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1727
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1728
|
+
|
|
1509
1729
|
var isMounted = React.useRef(true);
|
|
1510
1730
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1511
1731
|
try {
|
|
@@ -1530,11 +1750,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1530
1750
|
});
|
|
1531
1751
|
} else {
|
|
1532
1752
|
var dataFrames = dataFramesInState;
|
|
1753
|
+
|
|
1533
1754
|
if (dataSources !== dataSourcesInState) {
|
|
1534
1755
|
setDataSourcesInState(dataSources);
|
|
1535
1756
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1536
1757
|
setDataFramesInState(dataFrames);
|
|
1537
1758
|
}
|
|
1759
|
+
|
|
1538
1760
|
return Options_1.Options.evaluate({
|
|
1539
1761
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1540
1762
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -1545,21 +1767,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1545
1767
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1546
1768
|
return {};
|
|
1547
1769
|
}
|
|
1770
|
+
|
|
1548
1771
|
return {};
|
|
1549
1772
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1550
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1551
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1773
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1552
1774
|
// if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
|
|
1553
1775
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1776
|
+
|
|
1554
1777
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1555
1778
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1779
|
+
|
|
1556
1780
|
if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
|
|
1557
1781
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1558
1782
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1559
1783
|
});
|
|
1560
|
-
}
|
|
1561
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1784
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1562
1785
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1786
|
+
|
|
1787
|
+
|
|
1563
1788
|
React.useEffect(function () {
|
|
1564
1789
|
onComputedProps(clonedEvaluatedOptions);
|
|
1565
1790
|
});
|
|
@@ -1569,44 +1794,49 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1569
1794
|
isMounted.current = false;
|
|
1570
1795
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1571
1796
|
}
|
|
1572
|
-
};
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
// present warning message if any required props are missing
|
|
1797
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1798
|
+
}, []); // present warning message if any required props are missing
|
|
1799
|
+
|
|
1576
1800
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1577
|
-
|
|
1578
|
-
|
|
1801
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1802
|
+
supports = vizConfig.supports;
|
|
1579
1803
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1804
|
+
|
|
1580
1805
|
if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
|
|
1581
1806
|
) {
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1807
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1808
|
+
"data-test": "missing-props-message",
|
|
1809
|
+
width: width,
|
|
1810
|
+
height: height,
|
|
1811
|
+
missingProps: missing,
|
|
1812
|
+
backgroundColor: bgColorFromTheme
|
|
1813
|
+
});
|
|
1814
|
+
} // events
|
|
1815
|
+
|
|
1816
|
+
|
|
1591
1817
|
var eventCallbackProps = {};
|
|
1818
|
+
|
|
1592
1819
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1593
1820
|
var supportedEvents = vizConfig.events;
|
|
1594
1821
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1595
1822
|
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1596
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1597
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1823
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1598
1824
|
// then remove these lines
|
|
1825
|
+
|
|
1599
1826
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1600
1827
|
var payload = {};
|
|
1828
|
+
|
|
1601
1829
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1602
1830
|
payloadKeys.forEach(function (p) {
|
|
1603
1831
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1604
1832
|
});
|
|
1605
1833
|
}
|
|
1834
|
+
|
|
1606
1835
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1607
1836
|
if (ev && ev.payload) {
|
|
1608
1837
|
payload = ev.payload;
|
|
1609
1838
|
}
|
|
1839
|
+
|
|
1610
1840
|
return onEventTrigger({
|
|
1611
1841
|
originalEvent: ev,
|
|
1612
1842
|
payload: payload,
|
|
@@ -1614,8 +1844,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1614
1844
|
});
|
|
1615
1845
|
};
|
|
1616
1846
|
});
|
|
1617
|
-
}
|
|
1618
|
-
|
|
1847
|
+
} // compute pure viz props which are not from options
|
|
1848
|
+
|
|
1849
|
+
|
|
1619
1850
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1620
1851
|
themeFunc: themeFunc
|
|
1621
1852
|
}));
|
|
@@ -1633,15 +1864,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1633
1864
|
* In future, we could automatically detect which all datasources are being used
|
|
1634
1865
|
* and bind those magically to pagination/sorting behavior.
|
|
1635
1866
|
*/
|
|
1867
|
+
|
|
1636
1868
|
var dataSourceMetadata = {};
|
|
1637
1869
|
var OptionKey = 'paginateDataSourceKey';
|
|
1638
1870
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1871
|
+
|
|
1639
1872
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1640
1873
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1641
1874
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1875
|
+
|
|
1642
1876
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1643
1877
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1644
1878
|
};
|
|
1879
|
+
|
|
1645
1880
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1646
1881
|
requestParams: requestParams,
|
|
1647
1882
|
meta: meta,
|
|
@@ -1656,49 +1891,46 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1656
1891
|
sortParams: sortParams,
|
|
1657
1892
|
paginatorParams: paginatorParams
|
|
1658
1893
|
};
|
|
1659
|
-
}
|
|
1660
|
-
|
|
1894
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1895
|
+
|
|
1896
|
+
|
|
1661
1897
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1662
1898
|
return null;
|
|
1663
1899
|
}
|
|
1900
|
+
|
|
1664
1901
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1665
1902
|
mode: mode,
|
|
1666
1903
|
width: width,
|
|
1667
1904
|
height: height
|
|
1668
1905
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1669
1906
|
};
|
|
1907
|
+
|
|
1670
1908
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1671
1909
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1672
1910
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1673
1911
|
theme: {}
|
|
1674
|
-
});
|
|
1675
|
-
// attach viz config
|
|
1676
|
-
DashboardViz.config = vizConfig;
|
|
1677
|
-
// @ts-ignore: TODO fix sc upgrade TS issues
|
|
1678
|
-
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1679
|
-
};
|
|
1680
|
-
exports.default = withDashboardViz;
|
|
1912
|
+
}); // attach viz config
|
|
1681
1913
|
|
|
1682
|
-
|
|
1914
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1683
1915
|
|
|
1684
|
-
|
|
1685
|
-
|
|
1916
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1917
|
+
};
|
|
1686
1918
|
|
|
1687
|
-
|
|
1919
|
+
exports.default = withDashboardViz;
|
|
1688
1920
|
|
|
1689
1921
|
/***/ }),
|
|
1690
1922
|
|
|
1691
1923
|
/***/ 38:
|
|
1692
1924
|
/***/ (function(module, exports) {
|
|
1693
1925
|
|
|
1694
|
-
module.exports = require("@splunk/
|
|
1926
|
+
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1695
1927
|
|
|
1696
1928
|
/***/ }),
|
|
1697
1929
|
|
|
1698
1930
|
/***/ 39:
|
|
1699
1931
|
/***/ (function(module, exports) {
|
|
1700
1932
|
|
|
1701
|
-
module.exports = require("@splunk/
|
|
1933
|
+
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1702
1934
|
|
|
1703
1935
|
/***/ }),
|
|
1704
1936
|
|
|
@@ -1712,137 +1944,14 @@ module.exports = require("styled-components");
|
|
|
1712
1944
|
/***/ 40:
|
|
1713
1945
|
/***/ (function(module, exports) {
|
|
1714
1946
|
|
|
1715
|
-
module.exports = require("@splunk/
|
|
1947
|
+
module.exports = require("@splunk/moment");
|
|
1716
1948
|
|
|
1717
1949
|
/***/ }),
|
|
1718
1950
|
|
|
1719
1951
|
/***/ 41:
|
|
1720
|
-
/***/ (function(module, exports
|
|
1721
|
-
|
|
1722
|
-
"use strict";
|
|
1723
|
-
|
|
1952
|
+
/***/ (function(module, exports) {
|
|
1724
1953
|
|
|
1725
|
-
|
|
1726
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1727
|
-
value: true
|
|
1728
|
-
});
|
|
1729
|
-
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1730
|
-
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1731
|
-
var T = __webpack_require__(0);
|
|
1732
|
-
var lodash_1 = __webpack_require__(3);
|
|
1733
|
-
var VizActionHandler_1 = __webpack_require__(42);
|
|
1734
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1735
|
-
exports.INITIAL_WIDTH = 250;
|
|
1736
|
-
exports.INITIAL_HEIGHT = 250;
|
|
1737
|
-
/**
|
|
1738
|
-
* A Splunk visualization
|
|
1739
|
-
*/
|
|
1740
|
-
var SplunkVisualization = function SplunkVisualization() {
|
|
1741
|
-
_classCallCheck(this, SplunkVisualization);
|
|
1742
|
-
};
|
|
1743
|
-
SplunkVisualization.propTypes = {
|
|
1744
|
-
/**
|
|
1745
|
-
* display mode
|
|
1746
|
-
*/
|
|
1747
|
-
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1748
|
-
/**
|
|
1749
|
-
* width in pixel or string, defaults to 100%
|
|
1750
|
-
*/
|
|
1751
|
-
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1752
|
-
/**
|
|
1753
|
-
* height in pixel or string
|
|
1754
|
-
*/
|
|
1755
|
-
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1756
|
-
/**
|
|
1757
|
-
* visualization context used for dynamic option evaluation
|
|
1758
|
-
*/
|
|
1759
|
-
context: T.object,
|
|
1760
|
-
/**
|
|
1761
|
-
* visualization formatting options
|
|
1762
|
-
*/
|
|
1763
|
-
options: T.object,
|
|
1764
|
-
/**
|
|
1765
|
-
* A callback to update formatting options
|
|
1766
|
-
*/
|
|
1767
|
-
onOptionsChange: T.func,
|
|
1768
|
-
/**
|
|
1769
|
-
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1770
|
-
*/
|
|
1771
|
-
dataSources: T.objectOf(T.shape({
|
|
1772
|
-
/**
|
|
1773
|
-
* current request params
|
|
1774
|
-
*/
|
|
1775
|
-
requestParams: T.object,
|
|
1776
|
-
/**
|
|
1777
|
-
* current dataset
|
|
1778
|
-
*/
|
|
1779
|
-
data: T.shape({
|
|
1780
|
-
fields: T.array,
|
|
1781
|
-
columns: T.array
|
|
1782
|
-
}),
|
|
1783
|
-
/**
|
|
1784
|
-
* error
|
|
1785
|
-
*/
|
|
1786
|
-
error: T.shape({
|
|
1787
|
-
level: T.string,
|
|
1788
|
-
message: T.string
|
|
1789
|
-
}),
|
|
1790
|
-
/**
|
|
1791
|
-
* meta data that came with the dataset
|
|
1792
|
-
*/
|
|
1793
|
-
meta: T.object
|
|
1794
|
-
})),
|
|
1795
|
-
/**
|
|
1796
|
-
* A callback to trigger event
|
|
1797
|
-
*/
|
|
1798
|
-
onEventTrigger: T.func,
|
|
1799
|
-
/**
|
|
1800
|
-
* Inform viz if there are handlers listening to events
|
|
1801
|
-
*/
|
|
1802
|
-
hasEventHandlers: T.bool,
|
|
1803
|
-
/**
|
|
1804
|
-
* A callback to communicate computed props to a consumer
|
|
1805
|
-
*/
|
|
1806
|
-
onComputedProps: T.func,
|
|
1807
|
-
/**
|
|
1808
|
-
* A callback to obtain visualization api
|
|
1809
|
-
*/
|
|
1810
|
-
vizActionHandlerRef: T.func,
|
|
1811
|
-
loading: T.bool,
|
|
1812
|
-
theme: T.object,
|
|
1813
|
-
/**
|
|
1814
|
-
* A callback to request new data with updated request params
|
|
1815
|
-
*/
|
|
1816
|
-
onRequestParamsChange: T.func
|
|
1817
|
-
};
|
|
1818
|
-
/**
|
|
1819
|
-
*
|
|
1820
|
-
*/
|
|
1821
|
-
SplunkVisualization.defaultProps = {
|
|
1822
|
-
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1823
|
-
width: '100%',
|
|
1824
|
-
height: exports.INITIAL_HEIGHT,
|
|
1825
|
-
dataSources: {},
|
|
1826
|
-
onEventTrigger: function onEventTrigger() {
|
|
1827
|
-
return {};
|
|
1828
|
-
},
|
|
1829
|
-
mode: 'view',
|
|
1830
|
-
hasEventHandlers: false,
|
|
1831
|
-
options: {},
|
|
1832
|
-
context: {},
|
|
1833
|
-
onOptionsChange: function onOptionsChange() {
|
|
1834
|
-
return {};
|
|
1835
|
-
},
|
|
1836
|
-
vizActionHandlerRef: function vizActionHandlerRef() {
|
|
1837
|
-
return new VizActionHandler_1.DefaultVizActionHandler();
|
|
1838
|
-
},
|
|
1839
|
-
onComputedProps: function onComputedProps() {
|
|
1840
|
-
return {};
|
|
1841
|
-
},
|
|
1842
|
-
loading: false,
|
|
1843
|
-
onRequestParamsChange: lodash_1.noop
|
|
1844
|
-
};
|
|
1845
|
-
exports.default = SplunkVisualization;
|
|
1954
|
+
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1846
1955
|
|
|
1847
1956
|
/***/ }),
|
|
1848
1957
|
|
|
@@ -1854,74 +1963,98 @@ exports.default = SplunkVisualization;
|
|
|
1854
1963
|
|
|
1855
1964
|
var __rest = this && this.__rest || function (s, e) {
|
|
1856
1965
|
var t = {};
|
|
1966
|
+
|
|
1857
1967
|
for (var p in s) {
|
|
1858
1968
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1859
1969
|
}
|
|
1970
|
+
|
|
1860
1971
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1861
1972
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1862
1973
|
}
|
|
1863
1974
|
return t;
|
|
1864
1975
|
};
|
|
1976
|
+
|
|
1865
1977
|
Object.defineProperty(exports, "__esModule", {
|
|
1866
1978
|
value: true
|
|
1867
1979
|
});
|
|
1868
1980
|
exports.PureMap = exports.config = exports.themes = exports.useIconPlaceholder = exports.computeVizProps = void 0;
|
|
1869
1981
|
/* eslint-disable no-sequences */
|
|
1982
|
+
|
|
1870
1983
|
var React = __webpack_require__(1);
|
|
1984
|
+
|
|
1871
1985
|
var colorUtils_1 = __webpack_require__(12);
|
|
1986
|
+
|
|
1872
1987
|
var hocUtils_1 = __webpack_require__(27);
|
|
1988
|
+
|
|
1873
1989
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1990
|
+
|
|
1874
1991
|
var PureMap_1 = __webpack_require__(411);
|
|
1992
|
+
|
|
1875
1993
|
exports.PureMap = PureMap_1.default;
|
|
1994
|
+
|
|
1876
1995
|
var config_1 = __webpack_require__(421);
|
|
1996
|
+
|
|
1877
1997
|
exports.config = config_1.default;
|
|
1878
|
-
|
|
1998
|
+
|
|
1999
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
2000
|
+
|
|
1879
2001
|
var mapUtils_1 = __webpack_require__(422);
|
|
2002
|
+
|
|
1880
2003
|
var BubbleLayer_1 = __webpack_require__(131);
|
|
2004
|
+
|
|
1881
2005
|
var dataUtils_1 = __webpack_require__(121);
|
|
2006
|
+
|
|
1882
2007
|
var formatLayer = function formatLayer(l, dataFields, dataSourceData, transformedData) {
|
|
1883
2008
|
// add key `geobin` to the layer object if the data is returned from geostats commands
|
|
1884
2009
|
// to distinguish geostats commands from table commands
|
|
1885
2010
|
var geobinIdx = dataFields.indexOf('geobin');
|
|
1886
2011
|
var layer = l;
|
|
2012
|
+
|
|
1887
2013
|
if (geobinIdx > -1) {
|
|
1888
2014
|
layer.geobin = dataSourceData.columns[geobinIdx];
|
|
1889
|
-
}
|
|
1890
|
-
|
|
2015
|
+
} // similarly add key `geom` to layer object for choropleths
|
|
2016
|
+
|
|
2017
|
+
|
|
1891
2018
|
var geomIdx = dataFields.indexOf('geom');
|
|
2019
|
+
|
|
1892
2020
|
if (geomIdx > -1) {
|
|
1893
2021
|
layer.geom = dataSourceData.columns[geomIdx].map(function (geomItem) {
|
|
1894
2022
|
return typeof geomItem === 'string' ? JSON.parse(geomItem) : geomItem;
|
|
1895
2023
|
});
|
|
1896
|
-
}
|
|
1897
|
-
|
|
2024
|
+
} // Sanitize colors within layers
|
|
2025
|
+
|
|
2026
|
+
|
|
1898
2027
|
if (Object.prototype.hasOwnProperty.call(layer, 'seriesColors')) {
|
|
1899
2028
|
layer.seriesColors = Array.isArray(layer.seriesColors) ? (0, colorUtils_1.sanitizeArrayOfColors)(layer.seriesColors) : undefined;
|
|
1900
2029
|
}
|
|
2030
|
+
|
|
1901
2031
|
if (Object.prototype.hasOwnProperty.call(layer, 'dataColors')) {
|
|
1902
2032
|
layer.dataColors = Array.isArray(layer.dataColors) ? (0, colorUtils_1.sanitizeArrayOfColors)(layer.dataColors) : undefined;
|
|
1903
2033
|
}
|
|
2034
|
+
|
|
1904
2035
|
layer.metadata = transformedData;
|
|
1905
2036
|
};
|
|
2037
|
+
|
|
1906
2038
|
var computeVizProps = function computeVizProps(props) {
|
|
1907
2039
|
var _a, _b, _c;
|
|
2040
|
+
|
|
1908
2041
|
var themeFunc = props.themeFunc,
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
2042
|
+
theme = props.theme,
|
|
2043
|
+
layers = props.layers,
|
|
2044
|
+
dataSources = props.dataSources,
|
|
2045
|
+
onOptionsChange = props.onOptionsChange,
|
|
2046
|
+
title = props.title;
|
|
1914
2047
|
var themeColorVariables = ['controlBackgroundColor', 'controlForegroundColor'];
|
|
1915
2048
|
var themeColors = {};
|
|
1916
2049
|
themeColorVariables.forEach(function (variable) {
|
|
1917
2050
|
themeColors[variable] = themeFunc(variable);
|
|
1918
|
-
});
|
|
1919
|
-
// Markers use different icons, Bubbles has different styles for light and dark theme
|
|
2051
|
+
}); // Markers use different icons, Bubbles has different styles for light and dark theme
|
|
1920
2052
|
// this prop is passed for that
|
|
2053
|
+
|
|
1921
2054
|
var themeColorScheme = (theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1) ? theme === null || theme === void 0 ? void 0 : theme.splunkThemeV1.colorScheme : 'dark';
|
|
1922
|
-
var dataSourceData = (_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {};
|
|
1923
|
-
// transforms data structure into array of objects to allow for indexing metadata at layer level
|
|
2055
|
+
var dataSourceData = (_b = (_a = dataSources === null || dataSources === void 0 ? void 0 : dataSources.primary) === null || _a === void 0 ? void 0 : _a.data) !== null && _b !== void 0 ? _b : {}; // transforms data structure into array of objects to allow for indexing metadata at layer level
|
|
1924
2056
|
// TODO: explore any potential changes when multiple layers are supported
|
|
2057
|
+
|
|
1925
2058
|
var transformedData = (0, dataUtils_1.convertToArrOfObjects)(dataSourceData.columns, dataSourceData.fields);
|
|
1926
2059
|
var dataFields = ((_c = dataSourceData.fields) !== null && _c !== void 0 ? _c : []).map(function (field) {
|
|
1927
2060
|
return typeof field === 'string' ? field : field.name;
|
|
@@ -1936,29 +2069,37 @@ var computeVizProps = function computeVizProps(props) {
|
|
|
1936
2069
|
title: title
|
|
1937
2070
|
});
|
|
1938
2071
|
};
|
|
2072
|
+
|
|
1939
2073
|
exports.computeVizProps = computeVizProps;
|
|
2074
|
+
|
|
1940
2075
|
var withTooltipFields = function withTooltipFields(Viz) {
|
|
1941
2076
|
var VizWithTooltipFields = function VizWithTooltipFields(_a) {
|
|
1942
2077
|
var _b, _c, _d;
|
|
2078
|
+
|
|
1943
2079
|
var dataSources = _a.dataSources,
|
|
1944
|
-
|
|
1945
|
-
|
|
2080
|
+
options = _a.options,
|
|
2081
|
+
otherProps = __rest(_a, ["dataSources", "options"]);
|
|
2082
|
+
|
|
1946
2083
|
if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
|
|
1947
2084
|
return React.createElement(Viz, Object.assign({}, otherProps, {
|
|
1948
2085
|
options: options
|
|
1949
2086
|
}));
|
|
1950
2087
|
}
|
|
2088
|
+
|
|
1951
2089
|
var mergedOptions = (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(config_1.default.optionsSchema, 'default'));
|
|
2090
|
+
|
|
1952
2091
|
if ((_b = mergedOptions.layers) === null || _b === void 0 ? void 0 : _b[0]) {
|
|
1953
2092
|
if (((_d = (_c = mergedOptions.layers) === null || _c === void 0 ? void 0 : _c[0]) === null || _d === void 0 ? void 0 : _d.type) === 'bubble') {
|
|
1954
2093
|
// make sure bubbleSize and bubbleSizeFields dsl evaluation happen at the last HOC "withDashboardViz".
|
|
1955
2094
|
// so value/type augmentation in the HOCs stay consistent
|
|
1956
2095
|
mergedOptions.layers[0].bubbleSizeFields = '> bubbleSize | getField()';
|
|
1957
2096
|
}
|
|
2097
|
+
|
|
1958
2098
|
var fields = dataSources.primary.data.fields;
|
|
2099
|
+
|
|
1959
2100
|
if (Array.isArray(mergedOptions.layers[0].additionalTooltipFields) && Array.isArray(fields) && fields.length) {
|
|
1960
2101
|
var _mergedOptions$layers = mergedOptions.layers[0].bubbleSizeFields,
|
|
1961
|
-
|
|
2102
|
+
bubbleSizeFields = _mergedOptions$layers === void 0 ? [] : _mergedOptions$layers;
|
|
1962
2103
|
mergedOptions.layers[0].additionalTooltipFields = mergedOptions.layers[0].additionalTooltipFields.filter(function (field) {
|
|
1963
2104
|
return (typeof fields[0] === 'string' ? fields.includes(field) : fields.map(function (f) {
|
|
1964
2105
|
return f.name;
|
|
@@ -1966,38 +2107,46 @@ var withTooltipFields = function withTooltipFields(Viz) {
|
|
|
1966
2107
|
});
|
|
1967
2108
|
}
|
|
1968
2109
|
}
|
|
2110
|
+
|
|
1969
2111
|
return React.createElement(Viz, Object.assign({
|
|
1970
2112
|
dataSources: dataSources,
|
|
1971
2113
|
options: mergedOptions
|
|
1972
2114
|
}, otherProps));
|
|
1973
2115
|
};
|
|
2116
|
+
|
|
1974
2117
|
VizWithTooltipFields.propTypes = Viz.propTypes;
|
|
1975
2118
|
VizWithTooltipFields.defaultProps = Viz.defaultProps;
|
|
1976
2119
|
VizWithTooltipFields.config = Viz.config;
|
|
1977
2120
|
return VizWithTooltipFields;
|
|
1978
|
-
};
|
|
1979
|
-
|
|
2121
|
+
}; // HOC for stripping the internal fields for Maps
|
|
2122
|
+
|
|
2123
|
+
|
|
1980
2124
|
var withoutInternalFields = function withoutInternalFields(Viz) {
|
|
1981
2125
|
// eslint-disable-next-line react/display-name
|
|
1982
2126
|
var VizWithoutInternalFields = function VizWithoutInternalFields(_a) {
|
|
1983
2127
|
var dataSources = _a.dataSources,
|
|
1984
|
-
|
|
2128
|
+
otherProps = __rest(_a, ["dataSources"]);
|
|
2129
|
+
|
|
1985
2130
|
if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
|
|
1986
2131
|
return React.createElement(Viz, Object.assign({}, otherProps));
|
|
1987
2132
|
}
|
|
2133
|
+
|
|
1988
2134
|
var primary = dataSources.primary;
|
|
1989
2135
|
var _primary$data = primary.data,
|
|
1990
|
-
|
|
1991
|
-
|
|
2136
|
+
columns = _primary$data.columns,
|
|
2137
|
+
fields = _primary$data.fields;
|
|
1992
2138
|
var newColumns = [];
|
|
1993
2139
|
var newFields = [];
|
|
2140
|
+
|
|
1994
2141
|
if (fields && columns && fields.length === columns.length) {
|
|
1995
2142
|
// computed sorted index for removal
|
|
1996
2143
|
var indicesToRemove = new Set(fields.reduce(function (arr, e, i) {
|
|
1997
2144
|
var field = typeof e === 'string' ? e : e.name.toString();
|
|
2145
|
+
|
|
1998
2146
|
if (field.startsWith('_') && !field.startsWith(BubbleLayer_1.GEO_BOUND_PREFIX) && !BubbleLayer_1.GEO_LAT_AND_LONG_FIELD.includes(field)) {
|
|
1999
2147
|
arr.push(i);
|
|
2000
2148
|
}
|
|
2149
|
+
|
|
2001
2150
|
return arr;
|
|
2002
2151
|
}, []));
|
|
2003
2152
|
newFields = fields.filter(function (d, i) {
|
|
@@ -2007,6 +2156,7 @@ var withoutInternalFields = function withoutInternalFields(Viz) {
|
|
|
2007
2156
|
return !indicesToRemove.has(i);
|
|
2008
2157
|
});
|
|
2009
2158
|
}
|
|
2159
|
+
|
|
2010
2160
|
var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
|
|
2011
2161
|
primary: Object.assign(Object.assign({}, primary), {
|
|
2012
2162
|
data: Object.assign(Object.assign({}, primary.data), {
|
|
@@ -2019,38 +2169,45 @@ var withoutInternalFields = function withoutInternalFields(Viz) {
|
|
|
2019
2169
|
dataSources: modifiedDatasources
|
|
2020
2170
|
}, otherProps));
|
|
2021
2171
|
};
|
|
2172
|
+
|
|
2022
2173
|
VizWithoutInternalFields.propTypes = Viz.propTypes;
|
|
2023
2174
|
VizWithoutInternalFields.defaultProps = Viz.defaultProps;
|
|
2024
2175
|
VizWithoutInternalFields.config = Viz.config;
|
|
2025
2176
|
return VizWithoutInternalFields;
|
|
2026
|
-
};
|
|
2027
|
-
// HOC for updating all null values in data columns to zeros
|
|
2177
|
+
}; // HOC for updating all null values in data columns to zeros
|
|
2028
2178
|
// excluding 'latitude', 'longitude' and 'geobin'
|
|
2179
|
+
|
|
2180
|
+
|
|
2029
2181
|
var withNullToZeros = function withNullToZeros(Viz) {
|
|
2030
2182
|
// eslint-disable-next-line react/display-name
|
|
2031
2183
|
var VizWithColumnsNullToZeros = function VizWithColumnsNullToZeros(_a) {
|
|
2032
2184
|
var dataSources = _a.dataSources,
|
|
2033
|
-
|
|
2034
|
-
|
|
2185
|
+
options = _a.options,
|
|
2186
|
+
otherProps = __rest(_a, ["dataSources", "options"]);
|
|
2187
|
+
|
|
2035
2188
|
if (!dataSources || !dataSources.primary || !dataSources.primary.data) {
|
|
2036
2189
|
return React.createElement(Viz, Object.assign({
|
|
2037
2190
|
options: options
|
|
2038
2191
|
}, otherProps));
|
|
2039
2192
|
}
|
|
2193
|
+
|
|
2040
2194
|
var modifiedDatasources = (0, mapUtils_1.columnsNullToZeros)(config_1.default, dataSources, options);
|
|
2041
2195
|
return React.createElement(Viz, Object.assign({
|
|
2042
2196
|
dataSources: modifiedDatasources,
|
|
2043
2197
|
options: options
|
|
2044
2198
|
}, otherProps));
|
|
2045
2199
|
};
|
|
2200
|
+
|
|
2046
2201
|
VizWithColumnsNullToZeros.propTypes = Viz.propTypes;
|
|
2047
2202
|
VizWithColumnsNullToZeros.defaultProps = Viz.defaultProps;
|
|
2048
2203
|
VizWithColumnsNullToZeros.config = Viz.config;
|
|
2049
2204
|
return VizWithColumnsNullToZeros;
|
|
2050
2205
|
};
|
|
2206
|
+
|
|
2051
2207
|
function useIconPlaceholder(dataSources, loading) {
|
|
2052
2208
|
return loading;
|
|
2053
2209
|
}
|
|
2210
|
+
|
|
2054
2211
|
exports.useIconPlaceholder = useIconPlaceholder;
|
|
2055
2212
|
var Map = withoutInternalFields(withTooltipFields(withNullToZeros((0, withDashboardViz_1.default)({
|
|
2056
2213
|
ReactViz: PureMap_1.default,
|
|
@@ -2072,23 +2229,38 @@ exports.default = Map;
|
|
|
2072
2229
|
|
|
2073
2230
|
|
|
2074
2231
|
var _slicedToArray = __webpack_require__(17);
|
|
2232
|
+
|
|
2075
2233
|
Object.defineProperty(exports, "__esModule", {
|
|
2076
2234
|
value: true
|
|
2077
2235
|
});
|
|
2078
2236
|
exports.isLatLng = exports.formatColor = exports.DEFAULT_ZOOM = exports.DEFAULT_SHOW_BASELAYER = exports.DEFAULT_SHOW_ZOOM_CONTROLS = exports.DEFAULT_SHOW_SCALE = exports.DEFAULT_SCALE_UNIT = exports.DEFAULT_CONTROL_FOREGROUND_COLOR = exports.DEFAULT_CONTROL_BACKGROUND_COLOR = exports.DEFAULT_CENTER = void 0;
|
|
2237
|
+
|
|
2079
2238
|
var React = __webpack_require__(1);
|
|
2239
|
+
|
|
2080
2240
|
var lodash_1 = __webpack_require__(3);
|
|
2241
|
+
|
|
2081
2242
|
var react_1 = __webpack_require__(1);
|
|
2243
|
+
|
|
2082
2244
|
var T = __webpack_require__(0);
|
|
2245
|
+
|
|
2083
2246
|
var chroma = __webpack_require__(158);
|
|
2247
|
+
|
|
2084
2248
|
var maplibre_gl_1 = __webpack_require__(159);
|
|
2249
|
+
|
|
2085
2250
|
var i18n_1 = __webpack_require__(2);
|
|
2251
|
+
|
|
2086
2252
|
var MapContext_1 = __webpack_require__(412);
|
|
2253
|
+
|
|
2087
2254
|
var PureMapContainer_1 = __webpack_require__(413);
|
|
2088
|
-
|
|
2255
|
+
|
|
2256
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
2257
|
+
|
|
2089
2258
|
var ClusterLayer_1 = __webpack_require__(415);
|
|
2259
|
+
|
|
2090
2260
|
var ChoroplethLayer_1 = __webpack_require__(160);
|
|
2261
|
+
|
|
2091
2262
|
var LocalChoroplethLayer_1 = __webpack_require__(418);
|
|
2263
|
+
|
|
2092
2264
|
exports.DEFAULT_CENTER = [0, 0];
|
|
2093
2265
|
exports.DEFAULT_CONTROL_BACKGROUND_COLOR = '#2b3033';
|
|
2094
2266
|
exports.DEFAULT_CONTROL_FOREGROUND_COLOR = '#B5B5B5';
|
|
@@ -2096,8 +2268,8 @@ exports.DEFAULT_SCALE_UNIT = 'imperial';
|
|
|
2096
2268
|
exports.DEFAULT_SHOW_SCALE = true;
|
|
2097
2269
|
exports.DEFAULT_SHOW_ZOOM_CONTROLS = true;
|
|
2098
2270
|
exports.DEFAULT_SHOW_BASELAYER = true;
|
|
2099
|
-
exports.DEFAULT_ZOOM = 0;
|
|
2100
|
-
|
|
2271
|
+
exports.DEFAULT_ZOOM = 0; // convert rgb/rgba/hex color to encoded color & opacity for SVG strings
|
|
2272
|
+
|
|
2101
2273
|
var formatColor = function formatColor(color) {
|
|
2102
2274
|
var chromaColor = chroma(color);
|
|
2103
2275
|
return {
|
|
@@ -2105,94 +2277,115 @@ var formatColor = function formatColor(color) {
|
|
|
2105
2277
|
opacity: chromaColor.alpha()
|
|
2106
2278
|
};
|
|
2107
2279
|
};
|
|
2280
|
+
|
|
2108
2281
|
exports.formatColor = formatColor;
|
|
2109
2282
|
PureMapContainer_1.default.displayName = 'PureMapContainer';
|
|
2283
|
+
|
|
2110
2284
|
var PureMap = function PureMap(props) {
|
|
2111
2285
|
var width = props.width,
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2286
|
+
height = props.height,
|
|
2287
|
+
backgroundColor = props.backgroundColor,
|
|
2288
|
+
baseLayerTileServer = props.baseLayerTileServer,
|
|
2289
|
+
baseLayerTileServerType = props.baseLayerTileServerType,
|
|
2290
|
+
center = props.center,
|
|
2291
|
+
controlBackgroundColor = props.controlBackgroundColor,
|
|
2292
|
+
controlForegroundColor = props.controlForegroundColor,
|
|
2293
|
+
_props$layers = props.layers,
|
|
2294
|
+
layers = _props$layers === void 0 ? [] : _props$layers,
|
|
2295
|
+
scaleUnit = props.scaleUnit,
|
|
2296
|
+
showScale = props.showScale,
|
|
2297
|
+
showZoomControls = props.showZoomControls,
|
|
2298
|
+
showBaseLayer = props.showBaseLayer,
|
|
2299
|
+
themeColorScheme = props.themeColorScheme,
|
|
2300
|
+
zoom = props.zoom,
|
|
2301
|
+
onMapLoad = props.onMapLoad,
|
|
2302
|
+
onMapClick = props.onMapClick,
|
|
2303
|
+
onOptionsChange = props.onOptionsChange,
|
|
2304
|
+
mode = props.mode,
|
|
2305
|
+
title = props.title;
|
|
2306
|
+
|
|
2132
2307
|
var _ref = (0, react_1.useContext)(MapContext_1.default),
|
|
2133
|
-
|
|
2134
|
-
|
|
2308
|
+
defaultTileConfig = _ref.defaultTileConfig,
|
|
2309
|
+
customTileConfig = _ref.customTileConfig;
|
|
2310
|
+
|
|
2135
2311
|
var basemapContainer = (0, react_1.useRef)(null);
|
|
2136
2312
|
var map = (0, react_1.useRef)(null);
|
|
2137
2313
|
var scaleControl = (0, react_1.useRef)(null);
|
|
2138
2314
|
var zoomControl = (0, react_1.useRef)(null);
|
|
2315
|
+
|
|
2139
2316
|
var _ref2 = (0, react_1.useMemo)(function () {
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2317
|
+
return (0, MapUtils_1.getTilePreset)({
|
|
2318
|
+
defaultTileConfig: defaultTileConfig,
|
|
2319
|
+
customTileConfig: customTileConfig
|
|
2320
|
+
});
|
|
2321
|
+
}, [defaultTileConfig, customTileConfig]),
|
|
2322
|
+
tilePreset = _ref2.tilePreset,
|
|
2323
|
+
defaultTileLight = _ref2.defaultTileLight,
|
|
2324
|
+
defaultTileDark = _ref2.defaultTileDark;
|
|
2325
|
+
|
|
2148
2326
|
var _React$useState = React.useState(zoom !== null && zoom !== void 0 ? zoom : exports.DEFAULT_ZOOM),
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2327
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
2328
|
+
currentZoomLevel = _React$useState2[0],
|
|
2329
|
+
_setCurrentZoomLevel = _React$useState2[1];
|
|
2330
|
+
|
|
2152
2331
|
var currentZoomLevelRef = (0, react_1.useRef)(currentZoomLevel);
|
|
2332
|
+
|
|
2153
2333
|
var setCurrentZoomLevel = function setCurrentZoomLevel(newZoom) {
|
|
2154
2334
|
currentZoomLevelRef.current = newZoom;
|
|
2335
|
+
|
|
2155
2336
|
_setCurrentZoomLevel(newZoom);
|
|
2156
2337
|
};
|
|
2338
|
+
|
|
2157
2339
|
var _React$useState3 = React.useState(false),
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2340
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
2341
|
+
isMapLoaded = _React$useState4[0],
|
|
2342
|
+
setMapIsLoaded = _React$useState4[1];
|
|
2343
|
+
|
|
2161
2344
|
var _React$useState5 = React.useState(false),
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2345
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
2346
|
+
isThemeChanged = _React$useState6[0],
|
|
2347
|
+
setIsThemeChanged = _React$useState6[1]; // We are tracking mapMinZoom, which is the smallest zoom the map is capable of doing
|
|
2165
2348
|
// This is because DEFAULT_ZOOM of 0 is sometimes not possible for maps with height > 500.
|
|
2166
2349
|
// The map will do a little shake when it tries, and then auto change zoom value to mapMinZoom.
|
|
2167
2350
|
// Interestingly, the larger the map height, the larger the mapMinZoom is.
|
|
2168
2351
|
// For some reason, map.getMinZoom() is always 0, might be a MapLibre bug.
|
|
2352
|
+
|
|
2353
|
+
|
|
2169
2354
|
var _React$useState7 = React.useState(-1),
|
|
2170
|
-
|
|
2171
|
-
|
|
2172
|
-
|
|
2355
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
2356
|
+
mapMinZoom = _React$useState8[0],
|
|
2357
|
+
_setMapMinZoom = _React$useState8[1];
|
|
2358
|
+
|
|
2173
2359
|
var mapMinZoomRef = (0, react_1.useRef)(mapMinZoom);
|
|
2360
|
+
|
|
2174
2361
|
var setMapMinZoom = function setMapMinZoom(newMinZoom) {
|
|
2175
2362
|
mapMinZoomRef.current = newMinZoom;
|
|
2363
|
+
|
|
2176
2364
|
_setMapMinZoom(newMinZoom);
|
|
2177
|
-
};
|
|
2178
|
-
|
|
2365
|
+
}; // Assign default center when no center is defined
|
|
2366
|
+
|
|
2367
|
+
|
|
2179
2368
|
var lngLatCenter = (0, react_1.useMemo)(function () {
|
|
2180
2369
|
if (!(0, MapUtils_1.isValidLatLon)(center)) {
|
|
2181
2370
|
return exports.DEFAULT_CENTER;
|
|
2182
2371
|
}
|
|
2372
|
+
|
|
2183
2373
|
return [center[1], center[0]];
|
|
2184
|
-
}, [center]);
|
|
2185
|
-
// TODO: take out zoomLevel to use zoom instead (set prop zoom = DEFAULT_ZOOM)
|
|
2374
|
+
}, [center]); // TODO: take out zoomLevel to use zoom instead (set prop zoom = DEFAULT_ZOOM)
|
|
2186
2375
|
// Assign default zoom when no zoom is defined
|
|
2376
|
+
|
|
2187
2377
|
var zoomLevel = (0, react_1.useMemo)(function () {
|
|
2188
2378
|
if (zoom === undefined) {
|
|
2189
2379
|
return exports.DEFAULT_ZOOM;
|
|
2190
2380
|
}
|
|
2381
|
+
|
|
2191
2382
|
return zoom;
|
|
2192
2383
|
}, [zoom]);
|
|
2384
|
+
|
|
2193
2385
|
var setIsThemeChangedCallback = function setIsThemeChangedCallback(isMyThemeChanged) {
|
|
2194
2386
|
setIsThemeChanged(isMyThemeChanged);
|
|
2195
2387
|
};
|
|
2388
|
+
|
|
2196
2389
|
var onOptionsChangeProxy = (0, react_1.useCallback)(function (e) {
|
|
2197
2390
|
if (mode === 'edit') {
|
|
2198
2391
|
onOptionsChange(e);
|
|
@@ -2210,12 +2403,15 @@ var PureMap = function PureMap(props) {
|
|
|
2210
2403
|
// register event listener - zoom
|
|
2211
2404
|
map.current.on('zoomend', function () {
|
|
2212
2405
|
var mapZoomLevel = map.current.getZoom();
|
|
2406
|
+
|
|
2213
2407
|
if (mapZoomLevel < mapMinZoomRef.current) {
|
|
2214
2408
|
setMapMinZoom(mapZoomLevel);
|
|
2215
2409
|
}
|
|
2410
|
+
|
|
2216
2411
|
setCurrentZoomLevel(mapZoomLevel);
|
|
2217
2412
|
});
|
|
2218
2413
|
};
|
|
2414
|
+
|
|
2219
2415
|
map.current = new maplibre_gl_1.Map(Object.assign({
|
|
2220
2416
|
container: basemapContainer.current,
|
|
2221
2417
|
preserveDrawingBuffer: true,
|
|
@@ -2227,9 +2423,9 @@ var PureMap = function PureMap(props) {
|
|
|
2227
2423
|
macHelpText: (0, i18n_1._)('Use ⌘ + scroll to zoom map'),
|
|
2228
2424
|
mobileHelpText: (0, i18n_1._)('Use two fingers to move the map')
|
|
2229
2425
|
}
|
|
2230
|
-
}, (0, MapUtils_1.getZoomConstraintsFromTileConfig)(mapStyle, baseLayerTileServer)));
|
|
2231
|
-
// Fired immediately after all necessary resources have been downloaded
|
|
2426
|
+
}, (0, MapUtils_1.getZoomConstraintsFromTileConfig)(mapStyle, baseLayerTileServer))); // Fired immediately after all necessary resources have been downloaded
|
|
2232
2427
|
// and the first visually complete rendering of the map has occurred.
|
|
2428
|
+
|
|
2233
2429
|
map.current.on('load', function () {
|
|
2234
2430
|
if ((layers === null || layers === void 0 ? void 0 : layers.length) > 0 && center === undefined && zoom === undefined) {
|
|
2235
2431
|
setMapMinZoom(map.current.getZoom());
|
|
@@ -2240,16 +2436,17 @@ var PureMap = function PureMap(props) {
|
|
|
2240
2436
|
} else {
|
|
2241
2437
|
addZoomEndEventListener();
|
|
2242
2438
|
}
|
|
2243
|
-
|
|
2244
|
-
// TODO :- Temp timeout added for onMapLoad event to avoid flaky screenshots caused by
|
|
2439
|
+
|
|
2440
|
+
setMapIsLoaded(true); // TODO :- Temp timeout added for onMapLoad event to avoid flaky screenshots caused by
|
|
2245
2441
|
// https://maplibre.org/maplibre-gl-js-docs/api/map/#map#fitbounds. Need alternate approach to handle the same.
|
|
2442
|
+
|
|
2246
2443
|
setTimeout(function () {
|
|
2247
2444
|
if (onMapLoad && typeof onMapLoad.exec === 'function') {
|
|
2248
2445
|
onMapLoad.exec();
|
|
2249
2446
|
}
|
|
2250
2447
|
}, 500);
|
|
2251
|
-
});
|
|
2252
|
-
|
|
2448
|
+
}); // register event listener - drag
|
|
2449
|
+
|
|
2253
2450
|
map.current.on('dragend', function () {
|
|
2254
2451
|
var newCenter = map.current.getCenter();
|
|
2255
2452
|
onOptionsChangeProxy({
|
|
@@ -2258,15 +2455,15 @@ var PureMap = function PureMap(props) {
|
|
|
2258
2455
|
});
|
|
2259
2456
|
});
|
|
2260
2457
|
map.current.on('resize', function () {
|
|
2261
|
-
var mapZoomLevel = map.current.getZoom();
|
|
2262
|
-
// If the map's zoom value is at the min zoom, and the map did a resize
|
|
2458
|
+
var mapZoomLevel = map.current.getZoom(); // If the map's zoom value is at the min zoom, and the map did a resize
|
|
2263
2459
|
// sometimes the map will have a changed min zoom value.
|
|
2264
2460
|
// Then we want to update the map's min zoom value.
|
|
2461
|
+
|
|
2265
2462
|
if (currentZoomLevelRef.current <= mapMinZoomRef.current && mapZoomLevel !== mapMinZoomRef.current) {
|
|
2266
2463
|
setMapMinZoom(mapZoomLevel);
|
|
2267
2464
|
}
|
|
2268
|
-
});
|
|
2269
|
-
|
|
2465
|
+
}); // add zoom control
|
|
2466
|
+
|
|
2270
2467
|
zoomControl.current = new maplibre_gl_1.NavigationControl({
|
|
2271
2468
|
showCompass: false
|
|
2272
2469
|
});
|
|
@@ -2281,6 +2478,7 @@ var PureMap = function PureMap(props) {
|
|
|
2281
2478
|
}, [scaleUnit]);
|
|
2282
2479
|
var updateScale = (0, react_1.useCallback)(function () {
|
|
2283
2480
|
var _a;
|
|
2481
|
+
|
|
2284
2482
|
if (showScale) {
|
|
2285
2483
|
(_a = scaleControl === null || scaleControl === void 0 ? void 0 : scaleControl.current) === null || _a === void 0 ? void 0 : _a.setUnit(scaleUnit);
|
|
2286
2484
|
}
|
|
@@ -2299,6 +2497,7 @@ var PureMap = function PureMap(props) {
|
|
|
2299
2497
|
if (currentZoomLevel === mapMinZoomRef.current && (zoom === undefined || zoom < mapMinZoomRef.current)) {
|
|
2300
2498
|
return;
|
|
2301
2499
|
}
|
|
2500
|
+
|
|
2302
2501
|
var newCenter = map.current.getCenter();
|
|
2303
2502
|
onOptionsChangeProxy({
|
|
2304
2503
|
// when zooming with mouse/track pad,
|
|
@@ -2315,6 +2514,7 @@ var PureMap = function PureMap(props) {
|
|
|
2315
2514
|
console.warn('Map Tile Server configuration is missing or invalid. Please provide a valid configuration');
|
|
2316
2515
|
return;
|
|
2317
2516
|
}
|
|
2517
|
+
|
|
2318
2518
|
var mapStyle = (0, MapUtils_1.getMapStyle)({
|
|
2319
2519
|
showBaseLayer: showBaseLayer,
|
|
2320
2520
|
baseLayerTileServer: baseLayerTileServer,
|
|
@@ -2324,22 +2524,24 @@ var PureMap = function PureMap(props) {
|
|
|
2324
2524
|
defaultTileLight: defaultTileLight,
|
|
2325
2525
|
defaultTileDark: defaultTileDark
|
|
2326
2526
|
});
|
|
2327
|
-
mapStyle.version = MapUtils_1.MAP_STYLE_VERSION_NUMBER;
|
|
2328
|
-
|
|
2527
|
+
mapStyle.version = MapUtils_1.MAP_STYLE_VERSION_NUMBER; // If the map has already been initialized, we update the styles
|
|
2528
|
+
|
|
2329
2529
|
if (map.current) {
|
|
2330
2530
|
var curr = map.current.getStyle();
|
|
2331
|
-
var next = (0, lodash_1.omit)(mapStyle, ['theme', 'name', 'key']);
|
|
2332
|
-
// In dashboard studio this setStyle function is triggered by zoom changes as well
|
|
2531
|
+
var next = (0, lodash_1.omit)(mapStyle, ['theme', 'name', 'key']); // In dashboard studio this setStyle function is triggered by zoom changes as well
|
|
2333
2532
|
// Since setStyle will reset all style layers on the map including choropleth,
|
|
2334
2533
|
// we ONLY want to this to be called when there are style changes
|
|
2534
|
+
|
|
2335
2535
|
if (!(0, MapUtils_1.compareBaseStyles)(curr, next)) {
|
|
2336
2536
|
// Refer to https://maplibre.org/maplibre-gl-js-docs/api/map/#setstyle-example for options.diff (default is true)
|
|
2337
2537
|
map.current.setStyle((0, lodash_1.omit)(mapStyle, ['theme', 'name', 'key']));
|
|
2338
2538
|
setIsThemeChanged(true);
|
|
2339
2539
|
}
|
|
2540
|
+
|
|
2340
2541
|
var _ref3 = (0, MapUtils_1.getZoomConstraintsFromTileConfig)(mapStyle, baseLayerTileServer),
|
|
2341
|
-
|
|
2342
|
-
|
|
2542
|
+
minZoom = _ref3.minZoom,
|
|
2543
|
+
maxZoom = _ref3.maxZoom;
|
|
2544
|
+
|
|
2343
2545
|
map.current.setMinZoom(minZoom);
|
|
2344
2546
|
map.current.setMaxZoom(maxZoom);
|
|
2345
2547
|
updateScale();
|
|
@@ -2367,8 +2569,10 @@ var PureMap = function PureMap(props) {
|
|
|
2367
2569
|
}
|
|
2368
2570
|
};
|
|
2369
2571
|
}, []);
|
|
2572
|
+
|
|
2370
2573
|
var _layers = _slicedToArray(layers, 1),
|
|
2371
|
-
|
|
2574
|
+
layer = _layers[0];
|
|
2575
|
+
|
|
2372
2576
|
return React.createElement(React.Fragment, null, React.createElement(PureMapContainer_1.default, {
|
|
2373
2577
|
"aria-label": title || (0, i18n_1._)('Map'),
|
|
2374
2578
|
className: "puremap",
|
|
@@ -2403,21 +2607,27 @@ var PureMap = function PureMap(props) {
|
|
|
2403
2607
|
onMapClick: onMapClick
|
|
2404
2608
|
})));
|
|
2405
2609
|
};
|
|
2610
|
+
|
|
2406
2611
|
var isLatLng = function isLatLng(props, propName, componentName) {
|
|
2407
2612
|
if (!props[propName]) {
|
|
2408
2613
|
return null;
|
|
2409
2614
|
}
|
|
2615
|
+
|
|
2410
2616
|
var latAbs = Math.abs(props[propName][0]);
|
|
2411
2617
|
var lonAbs = Math.abs(props[propName][1]);
|
|
2412
2618
|
var latlon = props[propName];
|
|
2619
|
+
|
|
2413
2620
|
if (latAbs > MapUtils_1.MAX_LATITUDE && lonAbs <= MapUtils_1.MAX_LATITUDE) {
|
|
2414
2621
|
throw new Error("".concat(componentName, " ").concat(propName, " may have reversed [lat, lon] ranges."));
|
|
2415
2622
|
}
|
|
2623
|
+
|
|
2416
2624
|
if (!(0, MapUtils_1.isValidLatLon)(latlon)) {
|
|
2417
2625
|
throw new Error("".concat(componentName, " ").concat(propName, " incorrect [lat, lon] ranges."));
|
|
2418
2626
|
}
|
|
2627
|
+
|
|
2419
2628
|
return null;
|
|
2420
2629
|
};
|
|
2630
|
+
|
|
2421
2631
|
exports.isLatLng = isLatLng;
|
|
2422
2632
|
PureMap.propTypes = {
|
|
2423
2633
|
// eslint-disable-next-line react/no-unused-prop-types
|
|
@@ -2492,10 +2702,15 @@ module.exports = require("@splunk/visualization-context/MapContext");
|
|
|
2492
2702
|
Object.defineProperty(exports, "__esModule", {
|
|
2493
2703
|
value: true
|
|
2494
2704
|
});
|
|
2705
|
+
|
|
2495
2706
|
var styled_components_1 = __webpack_require__(4);
|
|
2707
|
+
|
|
2496
2708
|
var lodash_1 = __webpack_require__(3);
|
|
2709
|
+
|
|
2497
2710
|
var style_1 = __webpack_require__(14);
|
|
2711
|
+
|
|
2498
2712
|
var maplibre_gl_css_1 = __webpack_require__(414);
|
|
2713
|
+
|
|
2499
2714
|
var PureMapContainer = styled_components_1.default.div.attrs({
|
|
2500
2715
|
'data-testid': 'puremap-container'
|
|
2501
2716
|
}).withConfig({
|
|
@@ -2550,17 +2765,24 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
2550
2765
|
Object.defineProperty(exports, "__esModule", {
|
|
2551
2766
|
value: true
|
|
2552
2767
|
});
|
|
2768
|
+
|
|
2553
2769
|
var React = __webpack_require__(1);
|
|
2770
|
+
|
|
2554
2771
|
var BubbleLayer_1 = __webpack_require__(131);
|
|
2772
|
+
|
|
2555
2773
|
var MarkerLayer_1 = __webpack_require__(417);
|
|
2556
|
-
|
|
2774
|
+
|
|
2775
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
2776
|
+
|
|
2557
2777
|
var ClusterLayer = function ClusterLayer(_ref) {
|
|
2558
2778
|
var clusterLayer = _ref.clusterLayer,
|
|
2559
|
-
|
|
2560
|
-
|
|
2561
|
-
|
|
2562
|
-
|
|
2779
|
+
themeColorScheme = _ref.themeColorScheme,
|
|
2780
|
+
zoom = _ref.zoom,
|
|
2781
|
+
map = _ref.map,
|
|
2782
|
+
onMapClick = _ref.onMapClick;
|
|
2783
|
+
|
|
2563
2784
|
var _a;
|
|
2785
|
+
|
|
2564
2786
|
if (((_a = map === null || map === void 0 ? void 0 : map.current) === null || _a === void 0 ? void 0 : _a.isStyleLoaded) && [clusterLayer.longitude, clusterLayer.latitude].every(Array.isArray)) {
|
|
2565
2787
|
if ((clusterLayer === null || clusterLayer === void 0 ? void 0 : clusterLayer.type) === MapUtils_1.LAYER_TYPE.Marker && !('geobin' in clusterLayer)) {
|
|
2566
2788
|
return React.createElement(MarkerLayer_1.default, {
|
|
@@ -2570,6 +2792,7 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
2570
2792
|
onMapClick: onMapClick
|
|
2571
2793
|
});
|
|
2572
2794
|
}
|
|
2795
|
+
|
|
2573
2796
|
if ((clusterLayer === null || clusterLayer === void 0 ? void 0 : clusterLayer.type) === MapUtils_1.LAYER_TYPE.Bubble && 'geobin' in clusterLayer && 'bubbleSize' in clusterLayer) {
|
|
2574
2797
|
return React.createElement(BubbleLayer_1.default, {
|
|
2575
2798
|
bubbleLayer: clusterLayer,
|
|
@@ -2580,8 +2803,10 @@ var ClusterLayer = function ClusterLayer(_ref) {
|
|
|
2580
2803
|
});
|
|
2581
2804
|
}
|
|
2582
2805
|
}
|
|
2806
|
+
|
|
2583
2807
|
return null;
|
|
2584
2808
|
};
|
|
2809
|
+
|
|
2585
2810
|
exports.default = ClusterLayer;
|
|
2586
2811
|
|
|
2587
2812
|
/***/ }),
|
|
@@ -2593,15 +2818,22 @@ exports.default = ClusterLayer;
|
|
|
2593
2818
|
|
|
2594
2819
|
|
|
2595
2820
|
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
2821
|
+
|
|
2596
2822
|
var _templateObject;
|
|
2823
|
+
|
|
2597
2824
|
Object.defineProperty(exports, "__esModule", {
|
|
2598
2825
|
value: true
|
|
2599
2826
|
});
|
|
2600
2827
|
exports.convertDegToDMS = void 0;
|
|
2828
|
+
|
|
2601
2829
|
var React = __webpack_require__(1);
|
|
2830
|
+
|
|
2602
2831
|
var styled_components_1 = __webpack_require__(4);
|
|
2832
|
+
|
|
2603
2833
|
var Popover_1 = __webpack_require__(62);
|
|
2834
|
+
|
|
2604
2835
|
var i18n_1 = __webpack_require__(2);
|
|
2836
|
+
|
|
2605
2837
|
var StyledPopover = (0, styled_components_1.default)(Popover_1.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 250px;\n font-size: 12px;\n"])));
|
|
2606
2838
|
var StyledTable = styled_components_1.default.table.withConfig({
|
|
2607
2839
|
displayName: "Tooltip__StyledTable",
|
|
@@ -2621,42 +2853,50 @@ var StyledColorBlock = styled_components_1.default.div.withConfig({
|
|
|
2621
2853
|
})(["background-color:", ";display:inline-block;margin-right:4px;border-radius:2px;width:6px;height:11px;transform:translateY(1px);"], function (props) {
|
|
2622
2854
|
return props.color;
|
|
2623
2855
|
});
|
|
2856
|
+
|
|
2624
2857
|
var convertDegToDMS = function convertDegToDMS(decimalDegree, type) {
|
|
2625
2858
|
var truncate = function truncate(n) {
|
|
2626
2859
|
return n > 0 ? Math.floor(n) : Math.ceil(n);
|
|
2627
2860
|
};
|
|
2861
|
+
|
|
2628
2862
|
var absoluteDegree = Math.abs(decimalDegree);
|
|
2629
2863
|
var degrees = truncate(absoluteDegree);
|
|
2630
2864
|
var minutes = truncate((absoluteDegree - degrees) * 60);
|
|
2631
2865
|
var seconds = Math.round((absoluteDegree - degrees - minutes / 60) * 3600);
|
|
2866
|
+
|
|
2632
2867
|
if (seconds === 60) {
|
|
2633
2868
|
minutes += 1;
|
|
2634
2869
|
seconds = 0;
|
|
2635
2870
|
}
|
|
2871
|
+
|
|
2636
2872
|
if (minutes === 60) {
|
|
2637
2873
|
degrees += 1;
|
|
2638
2874
|
minutes = 0;
|
|
2639
2875
|
}
|
|
2876
|
+
|
|
2640
2877
|
var direction;
|
|
2878
|
+
|
|
2641
2879
|
if (type === 'longitude') {
|
|
2642
2880
|
direction = decimalDegree < 0 ? 'W' : 'E';
|
|
2643
2881
|
} else if (type === 'latitude') {
|
|
2644
2882
|
direction = decimalDegree < 0 ? 'S' : 'N';
|
|
2645
2883
|
}
|
|
2884
|
+
|
|
2646
2885
|
return "".concat(degrees, "\xB0 ").concat(minutes, "' ").concat(seconds, "\" ").concat(direction);
|
|
2647
2886
|
};
|
|
2648
|
-
|
|
2649
|
-
// only want latitude/longitude for marker and bubble
|
|
2887
|
+
|
|
2888
|
+
exports.convertDegToDMS = convertDegToDMS; // only want latitude/longitude for marker and bubble
|
|
2650
2889
|
// omit for choropleth, and put areaid, areavalue instead
|
|
2890
|
+
|
|
2651
2891
|
var Tooltip = function Tooltip(_ref) {
|
|
2652
2892
|
var open = _ref.open,
|
|
2653
|
-
|
|
2654
|
-
|
|
2655
|
-
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2893
|
+
anchor = _ref.anchor,
|
|
2894
|
+
latitude = _ref.latitude,
|
|
2895
|
+
longitude = _ref.longitude,
|
|
2896
|
+
areaId = _ref.areaId,
|
|
2897
|
+
areaValue = _ref.areaValue,
|
|
2898
|
+
_ref$additionalFields = _ref.additionalFields,
|
|
2899
|
+
additionalFields = _ref$additionalFields === void 0 ? [] : _ref$additionalFields;
|
|
2660
2900
|
return React.createElement(StyledPopover, {
|
|
2661
2901
|
open: open,
|
|
2662
2902
|
animation: false,
|
|
@@ -2676,8 +2916,8 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
2676
2916
|
return value && String(value) !== '0';
|
|
2677
2917
|
}).map(function (_ref3, index) {
|
|
2678
2918
|
var name = _ref3.name,
|
|
2679
|
-
|
|
2680
|
-
|
|
2919
|
+
value = _ref3.value,
|
|
2920
|
+
color = _ref3.color;
|
|
2681
2921
|
return React.createElement("tr", {
|
|
2682
2922
|
key: String(index)
|
|
2683
2923
|
}, React.createElement(StyledTitleColumn, {
|
|
@@ -2690,6 +2930,7 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
2690
2930
|
}, value));
|
|
2691
2931
|
}))));
|
|
2692
2932
|
};
|
|
2933
|
+
|
|
2693
2934
|
exports.default = Tooltip;
|
|
2694
2935
|
|
|
2695
2936
|
/***/ }),
|
|
@@ -2701,32 +2942,46 @@ exports.default = Tooltip;
|
|
|
2701
2942
|
|
|
2702
2943
|
|
|
2703
2944
|
var _defineProperty = __webpack_require__(7);
|
|
2945
|
+
|
|
2704
2946
|
var _taggedTemplateLiteral = __webpack_require__(59);
|
|
2947
|
+
|
|
2705
2948
|
var _templateObject;
|
|
2949
|
+
|
|
2706
2950
|
var __rest = this && this.__rest || function (s, e) {
|
|
2707
2951
|
var t = {};
|
|
2952
|
+
|
|
2708
2953
|
for (var p in s) {
|
|
2709
2954
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2710
2955
|
}
|
|
2956
|
+
|
|
2711
2957
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2712
2958
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2713
2959
|
}
|
|
2714
2960
|
return t;
|
|
2715
2961
|
};
|
|
2962
|
+
|
|
2716
2963
|
Object.defineProperty(exports, "__esModule", {
|
|
2717
2964
|
value: true
|
|
2718
2965
|
});
|
|
2719
2966
|
exports.generateMarkerWrapperProps = exports.MarkerIcon = void 0;
|
|
2967
|
+
|
|
2720
2968
|
var styled_components_1 = __webpack_require__(4);
|
|
2969
|
+
|
|
2721
2970
|
var React = __webpack_require__(1);
|
|
2971
|
+
|
|
2722
2972
|
var colorUtils_1 = __webpack_require__(12);
|
|
2973
|
+
|
|
2723
2974
|
var lodash_1 = __webpack_require__(3);
|
|
2724
|
-
|
|
2975
|
+
|
|
2976
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
2977
|
+
|
|
2725
2978
|
var MarkerWrapper_1 = __webpack_require__(132);
|
|
2979
|
+
|
|
2726
2980
|
var MarkerIcon = function MarkerIcon(_a) {
|
|
2727
2981
|
var theme = _a.theme,
|
|
2728
|
-
|
|
2729
|
-
|
|
2982
|
+
color = _a.color,
|
|
2983
|
+
otherProps = __rest(_a, ["theme", "color"]);
|
|
2984
|
+
|
|
2730
2985
|
var strokeOpacity = theme === 'light' ? 0.7 : 0.15;
|
|
2731
2986
|
return React.createElement("svg", Object.assign({
|
|
2732
2987
|
width: 22,
|
|
@@ -2744,15 +2999,16 @@ var MarkerIcon = function MarkerIcon(_a) {
|
|
|
2744
2999
|
strokeOpacity: strokeOpacity
|
|
2745
3000
|
}));
|
|
2746
3001
|
};
|
|
3002
|
+
|
|
2747
3003
|
exports.MarkerIcon = MarkerIcon;
|
|
2748
3004
|
var Marker = React.memo(function (_ref) {
|
|
2749
3005
|
var latitude = _ref.latitude,
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2754
|
-
|
|
2755
|
-
|
|
3006
|
+
longitude = _ref.longitude,
|
|
3007
|
+
color = _ref.color,
|
|
3008
|
+
themeColorScheme = _ref.themeColorScheme,
|
|
3009
|
+
map = _ref.map,
|
|
3010
|
+
additionalFields = _ref.additionalFields,
|
|
3011
|
+
handleLayerClick = _ref.handleLayerClick;
|
|
2756
3012
|
var icon = React.useMemo(function () {
|
|
2757
3013
|
return React.createElement(exports.MarkerIcon, {
|
|
2758
3014
|
color: color,
|
|
@@ -2770,6 +3026,7 @@ var Marker = React.memo(function (_ref) {
|
|
|
2770
3026
|
});
|
|
2771
3027
|
Marker.displayName = 'MapMarker';
|
|
2772
3028
|
var StyledMarkerWrapper = (0, styled_components_1.default)(MarkerWrapper_1.default)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n width: 22px;\n height: 28px;\n cursor: pointer;\n"])));
|
|
3029
|
+
|
|
2773
3030
|
var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer) {
|
|
2774
3031
|
var onMapClick = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : lodash_1.noop;
|
|
2775
3032
|
var latArray = markerLayer.latitude;
|
|
@@ -2777,6 +3034,7 @@ var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer
|
|
|
2777
3034
|
var isStaticColor = !markerLayer.dataColors;
|
|
2778
3035
|
var limit = Math.min(latArray.length, lonArray.length, markerLayer.resultLimit ? markerLayer.resultLimit : MapUtils_1.DEFAULT_RESULT_LIMIT);
|
|
2779
3036
|
var markerProps = [];
|
|
3037
|
+
|
|
2780
3038
|
var _loop = function _loop(i) {
|
|
2781
3039
|
var staticColor = markerLayer.seriesColors && (0, colorUtils_1.isColor)(markerLayer.seriesColors[0]) ? markerLayer.seriesColors[0] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
|
|
2782
3040
|
var dynamicColor = markerLayer.dataColors && (0, colorUtils_1.isColor)(markerLayer.dataColors[i]) ? markerLayer.dataColors[i] : MapUtils_1.DEFAULT_CLUSTER_COLOR;
|
|
@@ -2787,8 +3045,10 @@ var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer
|
|
|
2787
3045
|
value: markerLayer.metadata[i][field]
|
|
2788
3046
|
};
|
|
2789
3047
|
}) : [];
|
|
3048
|
+
|
|
2790
3049
|
var handleLayerClick = function handleLayerClick(e) {
|
|
2791
3050
|
var _a;
|
|
3051
|
+
|
|
2792
3052
|
var metadata = (_a = markerLayer === null || markerLayer === void 0 ? void 0 : markerLayer.metadata[i]) !== null && _a !== void 0 ? _a : {};
|
|
2793
3053
|
var payload = Object.keys(metadata).reduce(function (acc, curr) {
|
|
2794
3054
|
var key = "row.".concat(curr, ".value");
|
|
@@ -2800,6 +3060,7 @@ var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer
|
|
|
2800
3060
|
payload: payload
|
|
2801
3061
|
});
|
|
2802
3062
|
};
|
|
3063
|
+
|
|
2803
3064
|
markerProps.push({
|
|
2804
3065
|
latitude: latArray[i],
|
|
2805
3066
|
longitude: lonArray[i],
|
|
@@ -2808,17 +3069,21 @@ var generateMarkerWrapperProps = function generateMarkerWrapperProps(markerLayer
|
|
|
2808
3069
|
handleLayerClick: handleLayerClick
|
|
2809
3070
|
});
|
|
2810
3071
|
};
|
|
3072
|
+
|
|
2811
3073
|
for (var i = 0; i < limit; i += 1) {
|
|
2812
3074
|
_loop(i);
|
|
2813
3075
|
}
|
|
3076
|
+
|
|
2814
3077
|
return markerProps;
|
|
2815
3078
|
};
|
|
3079
|
+
|
|
2816
3080
|
exports.generateMarkerWrapperProps = generateMarkerWrapperProps;
|
|
3081
|
+
|
|
2817
3082
|
var MarkerLayer = function MarkerLayer(props) {
|
|
2818
3083
|
var map = props.map,
|
|
2819
|
-
|
|
2820
|
-
|
|
2821
|
-
|
|
3084
|
+
themeColorScheme = props.themeColorScheme,
|
|
3085
|
+
markerLayer = props.markerLayer,
|
|
3086
|
+
onMapClick = props.onMapClick;
|
|
2822
3087
|
markerLayer.seriesColors = markerLayer.seriesColors || MapUtils_1.DEFAULT_SERIES_COLORS;
|
|
2823
3088
|
var markerPropsList = React.useMemo(function () {
|
|
2824
3089
|
return (0, exports.generateMarkerWrapperProps)(markerLayer, onMapClick);
|
|
@@ -2831,6 +3096,7 @@ var MarkerLayer = function MarkerLayer(props) {
|
|
|
2831
3096
|
}, markerProps));
|
|
2832
3097
|
}));
|
|
2833
3098
|
};
|
|
3099
|
+
|
|
2834
3100
|
exports.default = MarkerLayer;
|
|
2835
3101
|
|
|
2836
3102
|
/***/ }),
|
|
@@ -2842,51 +3108,66 @@ exports.default = MarkerLayer;
|
|
|
2842
3108
|
|
|
2843
3109
|
|
|
2844
3110
|
var _slicedToArray = __webpack_require__(17);
|
|
3111
|
+
|
|
2845
3112
|
Object.defineProperty(exports, "__esModule", {
|
|
2846
3113
|
value: true
|
|
2847
3114
|
});
|
|
3115
|
+
|
|
2848
3116
|
var React = __webpack_require__(1);
|
|
3117
|
+
|
|
2849
3118
|
var Message_1 = __webpack_require__(10);
|
|
3119
|
+
|
|
2850
3120
|
var GeoRegistry_1 = __webpack_require__(419);
|
|
3121
|
+
|
|
2851
3122
|
var GeoJsonProvider_1 = __webpack_require__(420);
|
|
2852
|
-
|
|
3123
|
+
|
|
3124
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
3125
|
+
|
|
2853
3126
|
var ChoroplethLayer_1 = __webpack_require__(160);
|
|
3127
|
+
|
|
2854
3128
|
var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
2855
3129
|
var _a, _b;
|
|
3130
|
+
|
|
2856
3131
|
var width = props.width,
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
3132
|
+
height = props.height,
|
|
3133
|
+
map = props.map,
|
|
3134
|
+
choroplethLayer = props.choroplethLayer,
|
|
3135
|
+
isThemeChanged = props.isThemeChanged,
|
|
3136
|
+
setIsThemeChanged = props.setIsThemeChanged,
|
|
3137
|
+
onMapClick = props.onMapClick;
|
|
2863
3138
|
var cfgOpacity = Math.min(Math.max(choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.choroplethOpacity, 0), 1);
|
|
3139
|
+
|
|
2864
3140
|
var _React$useState = React.useState({
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
3141
|
+
features: [{
|
|
3142
|
+
properties: {
|
|
3143
|
+
name: ''
|
|
3144
|
+
},
|
|
3145
|
+
geometry: []
|
|
3146
|
+
}]
|
|
3147
|
+
}),
|
|
3148
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
3149
|
+
geoJson = _React$useState2[0],
|
|
3150
|
+
setGeoJson = _React$useState2[1];
|
|
3151
|
+
|
|
2875
3152
|
var _React$useState3 = React.useState(true),
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
3153
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
3154
|
+
validGeoJson = _React$useState4[0],
|
|
3155
|
+
setValidGeoJson = _React$useState4[1];
|
|
3156
|
+
|
|
2879
3157
|
var _React$useState5 = React.useState({
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
3158
|
+
level: 'info',
|
|
3159
|
+
message: ''
|
|
3160
|
+
}),
|
|
3161
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
3162
|
+
geoJsonError = _React$useState6[0],
|
|
3163
|
+
setGeoJsonError = _React$useState6[1]; // load local geoJson registry data
|
|
3164
|
+
|
|
3165
|
+
|
|
2886
3166
|
React.useEffect(function () {
|
|
2887
3167
|
var geoJsonData;
|
|
2888
3168
|
var geoRegistry = GeoRegistry_1.default.create();
|
|
2889
3169
|
geoRegistry.addDefaultProvider(new GeoJsonProvider_1.default());
|
|
3170
|
+
|
|
2890
3171
|
try {
|
|
2891
3172
|
geoJsonData = geoRegistry.getByURL(choroplethLayer.source);
|
|
2892
3173
|
setGeoJson(geoJsonData);
|
|
@@ -2898,9 +3179,10 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2898
3179
|
}, [choroplethLayer.source]);
|
|
2899
3180
|
var updatedPropertyFormat = React.useMemo(function () {
|
|
2900
3181
|
var propertyFormat = 'name';
|
|
3182
|
+
|
|
2901
3183
|
if (choroplethLayer.areaIds && validGeoJson) {
|
|
2902
|
-
var propertyFormats = Object.keys(geoJson.features[0].properties);
|
|
2903
|
-
|
|
3184
|
+
var propertyFormats = Object.keys(geoJson.features[0].properties); // check the state or country format used in dataSource
|
|
3185
|
+
|
|
2904
3186
|
/* Accepted format for countries:
|
|
2905
3187
|
"properties":
|
|
2906
3188
|
{
|
|
@@ -2917,21 +3199,26 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2917
3199
|
"label_en": "Michigan"
|
|
2918
3200
|
},
|
|
2919
3201
|
*/
|
|
3202
|
+
|
|
2920
3203
|
var _loop = function _loop(idx) {
|
|
2921
3204
|
var shapeProperty = geoJson.features[idx].properties;
|
|
2922
3205
|
var formatCheck = propertyFormats.find(function (key) {
|
|
2923
3206
|
return shapeProperty[key] === choroplethLayer.areaIds[0];
|
|
2924
3207
|
});
|
|
3208
|
+
|
|
2925
3209
|
if (formatCheck !== undefined) {
|
|
2926
3210
|
propertyFormat = formatCheck;
|
|
2927
3211
|
return "break";
|
|
2928
3212
|
}
|
|
2929
3213
|
};
|
|
3214
|
+
|
|
2930
3215
|
for (var idx = 0; idx < geoJson.features.length; idx += 1) {
|
|
2931
3216
|
var _ret = _loop(idx);
|
|
3217
|
+
|
|
2932
3218
|
if (_ret === "break") break;
|
|
2933
3219
|
}
|
|
2934
3220
|
}
|
|
3221
|
+
|
|
2935
3222
|
return propertyFormat;
|
|
2936
3223
|
}, [choroplethLayer.areaIds, geoJson]);
|
|
2937
3224
|
var colors = (_a = choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.dataColors) === null || _a === void 0 ? void 0 : _a.map(function (color) {
|
|
@@ -2940,6 +3227,7 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2940
3227
|
var scaledOpacities = (_b = (0, MapUtils_1.getScaledOpacities)(choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.dataColors, cfgOpacity)) !== null && _b !== void 0 ? _b : [];
|
|
2941
3228
|
var updatedAllChoroplethData = React.useMemo(function () {
|
|
2942
3229
|
var allChoroplethData = [];
|
|
3230
|
+
|
|
2943
3231
|
if (validGeoJson) {
|
|
2944
3232
|
for (var idx = 0; idx < geoJson.features.length; idx += 1) {
|
|
2945
3233
|
var el = geoJson.features[idx];
|
|
@@ -2950,11 +3238,12 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2950
3238
|
name: '',
|
|
2951
3239
|
idx: 0
|
|
2952
3240
|
};
|
|
2953
|
-
choroplethData.name = el.properties[updatedPropertyFormat];
|
|
2954
|
-
|
|
3241
|
+
choroplethData.name = el.properties[updatedPropertyFormat]; // check whether dataSource exists
|
|
3242
|
+
|
|
2955
3243
|
if (choroplethLayer.areaIds) {
|
|
2956
3244
|
// store the postion of dataSource in geoJson
|
|
2957
3245
|
var dataIdx = choroplethLayer.areaIds.indexOf(el.properties[updatedPropertyFormat]);
|
|
3246
|
+
|
|
2958
3247
|
if (dataIdx !== -1) {
|
|
2959
3248
|
choroplethData.color = colors[dataIdx];
|
|
2960
3249
|
choroplethData.areaValue = choroplethLayer.areaValues[dataIdx];
|
|
@@ -2964,11 +3253,14 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2964
3253
|
choroplethData.idx = choroplethLayer.areaIds.length;
|
|
2965
3254
|
}
|
|
2966
3255
|
}
|
|
3256
|
+
|
|
2967
3257
|
allChoroplethData.push(choroplethData);
|
|
2968
3258
|
}
|
|
2969
3259
|
}
|
|
3260
|
+
|
|
2970
3261
|
return allChoroplethData;
|
|
2971
3262
|
}, [choroplethLayer.areaIds, choroplethLayer.areaValues, colors, scaledOpacities]);
|
|
3263
|
+
|
|
2972
3264
|
var _handleMapClick = function handleMapClick(e, i) {
|
|
2973
3265
|
var payload = (0, MapUtils_1.formatMetadata)(choroplethLayer, i);
|
|
2974
3266
|
onMapClick({
|
|
@@ -2976,11 +3268,14 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
2976
3268
|
payload: payload
|
|
2977
3269
|
});
|
|
2978
3270
|
};
|
|
3271
|
+
|
|
2979
3272
|
if (isThemeChanged) {
|
|
2980
3273
|
setIsThemeChanged(false);
|
|
2981
3274
|
}
|
|
3275
|
+
|
|
2982
3276
|
var additionalFields = (choroplethLayer === null || choroplethLayer === void 0 ? void 0 : choroplethLayer.metadata) ? choroplethLayer.metadata.map(function (choroplethMetadata) {
|
|
2983
3277
|
var _a;
|
|
3278
|
+
|
|
2984
3279
|
return (_a = choroplethLayer.additionalTooltipFields) === null || _a === void 0 ? void 0 : _a.map(function (field) {
|
|
2985
3280
|
return {
|
|
2986
3281
|
name: field,
|
|
@@ -3013,6 +3308,7 @@ var LocalChoroplethLayer = function LocalChoroplethLayer(props) {
|
|
|
3013
3308
|
});
|
|
3014
3309
|
}));
|
|
3015
3310
|
};
|
|
3311
|
+
|
|
3016
3312
|
exports.default = LocalChoroplethLayer;
|
|
3017
3313
|
|
|
3018
3314
|
/***/ }),
|
|
@@ -3031,29 +3327,148 @@ module.exports = require("@splunk/visualization-context/GeoRegistry");
|
|
|
3031
3327
|
|
|
3032
3328
|
|
|
3033
3329
|
var _classCallCheck = __webpack_require__(9);
|
|
3034
|
-
|
|
3330
|
+
|
|
3035
3331
|
Object.defineProperty(exports, "__esModule", {
|
|
3036
3332
|
value: true
|
|
3037
3333
|
});
|
|
3038
|
-
exports.
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3334
|
+
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
3335
|
+
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
3336
|
+
|
|
3337
|
+
var T = __webpack_require__(0);
|
|
3338
|
+
|
|
3339
|
+
var lodash_1 = __webpack_require__(3);
|
|
3340
|
+
|
|
3341
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
3342
|
+
|
|
3343
|
+
|
|
3344
|
+
exports.INITIAL_WIDTH = 250;
|
|
3345
|
+
exports.INITIAL_HEIGHT = 250;
|
|
3346
|
+
/**
|
|
3347
|
+
* A Splunk visualization
|
|
3348
|
+
*/
|
|
3349
|
+
|
|
3350
|
+
var SplunkVisualization = function SplunkVisualization() {
|
|
3351
|
+
_classCallCheck(this, SplunkVisualization);
|
|
3352
|
+
};
|
|
3353
|
+
|
|
3354
|
+
SplunkVisualization.propTypes = {
|
|
3355
|
+
/**
|
|
3356
|
+
* display mode
|
|
3357
|
+
*/
|
|
3358
|
+
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
3359
|
+
|
|
3360
|
+
/**
|
|
3361
|
+
* width in pixel or string, defaults to 100%
|
|
3362
|
+
*/
|
|
3363
|
+
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
3364
|
+
|
|
3365
|
+
/**
|
|
3366
|
+
* height in pixel or string
|
|
3367
|
+
*/
|
|
3368
|
+
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
3369
|
+
|
|
3370
|
+
/**
|
|
3371
|
+
* visualization context used for dynamic option evaluation
|
|
3372
|
+
*/
|
|
3373
|
+
context: T.object,
|
|
3374
|
+
|
|
3375
|
+
/**
|
|
3376
|
+
* visualization formatting options
|
|
3377
|
+
*/
|
|
3378
|
+
options: T.object,
|
|
3379
|
+
|
|
3380
|
+
/**
|
|
3381
|
+
* A callback to update formatting options
|
|
3382
|
+
*/
|
|
3383
|
+
onOptionsChange: T.func,
|
|
3384
|
+
|
|
3385
|
+
/**
|
|
3386
|
+
* datasource state which include data and request params, object key indicate the datasource type.
|
|
3387
|
+
*/
|
|
3388
|
+
dataSources: T.objectOf(T.shape({
|
|
3389
|
+
/**
|
|
3390
|
+
* current request params
|
|
3391
|
+
*/
|
|
3392
|
+
requestParams: T.object,
|
|
3393
|
+
|
|
3394
|
+
/**
|
|
3395
|
+
* current dataset
|
|
3396
|
+
*/
|
|
3397
|
+
data: T.shape({
|
|
3398
|
+
fields: T.array,
|
|
3399
|
+
columns: T.array
|
|
3400
|
+
}),
|
|
3401
|
+
|
|
3402
|
+
/**
|
|
3403
|
+
* error
|
|
3404
|
+
*/
|
|
3405
|
+
error: T.shape({
|
|
3406
|
+
level: T.string,
|
|
3407
|
+
message: T.string
|
|
3408
|
+
}),
|
|
3409
|
+
|
|
3410
|
+
/**
|
|
3411
|
+
* meta data that came with the dataset
|
|
3412
|
+
*/
|
|
3413
|
+
meta: T.object
|
|
3414
|
+
})),
|
|
3415
|
+
|
|
3416
|
+
/**
|
|
3417
|
+
* A callback to trigger event
|
|
3418
|
+
*/
|
|
3419
|
+
onEventTrigger: T.func,
|
|
3420
|
+
|
|
3421
|
+
/**
|
|
3422
|
+
* Inform viz if there are handlers listening to events
|
|
3423
|
+
*/
|
|
3424
|
+
hasEventHandlers: T.bool,
|
|
3425
|
+
|
|
3426
|
+
/**
|
|
3427
|
+
* A callback to communicate computed props to a consumer
|
|
3428
|
+
*/
|
|
3429
|
+
onComputedProps: T.func,
|
|
3430
|
+
|
|
3431
|
+
/**
|
|
3432
|
+
* A callback to obtain visualization api
|
|
3433
|
+
*/
|
|
3434
|
+
vizActionHandlerRef: T.func,
|
|
3435
|
+
loading: T.bool,
|
|
3436
|
+
theme: T.object,
|
|
3437
|
+
|
|
3438
|
+
/**
|
|
3439
|
+
* A callback to request new data with updated request params
|
|
3440
|
+
*/
|
|
3441
|
+
onRequestParamsChange: T.func
|
|
3442
|
+
};
|
|
3443
|
+
/**
|
|
3444
|
+
*
|
|
3445
|
+
*/
|
|
3446
|
+
|
|
3447
|
+
SplunkVisualization.defaultProps = {
|
|
3448
|
+
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
3449
|
+
width: '100%',
|
|
3450
|
+
height: exports.INITIAL_HEIGHT,
|
|
3451
|
+
dataSources: {},
|
|
3452
|
+
onEventTrigger: function onEventTrigger() {
|
|
3453
|
+
return {};
|
|
3454
|
+
},
|
|
3455
|
+
mode: 'view',
|
|
3456
|
+
hasEventHandlers: false,
|
|
3457
|
+
options: {},
|
|
3458
|
+
context: {},
|
|
3459
|
+
onOptionsChange: function onOptionsChange() {
|
|
3460
|
+
return {};
|
|
3461
|
+
},
|
|
3462
|
+
vizActionHandlerRef: function vizActionHandlerRef() {
|
|
3463
|
+
return new VizActionHandler_1.DefaultVizActionHandler();
|
|
3464
|
+
},
|
|
3465
|
+
onComputedProps: function onComputedProps() {
|
|
3466
|
+
return {};
|
|
3467
|
+
},
|
|
3468
|
+
loading: false,
|
|
3469
|
+
onRequestParamsChange: lodash_1.noop
|
|
3470
|
+
};
|
|
3471
|
+
exports.default = SplunkVisualization;
|
|
3057
3472
|
|
|
3058
3473
|
/***/ }),
|
|
3059
3474
|
|
|
@@ -3073,17 +3488,29 @@ module.exports = require("@splunk/visualization-context/GeoJsonProvider");
|
|
|
3073
3488
|
Object.defineProperty(exports, "__esModule", {
|
|
3074
3489
|
value: true
|
|
3075
3490
|
});
|
|
3491
|
+
|
|
3076
3492
|
var visualization_icons_1 = __webpack_require__(52);
|
|
3493
|
+
|
|
3077
3494
|
var placeholders_1 = __webpack_require__(50);
|
|
3495
|
+
|
|
3078
3496
|
var schemaUtils_1 = __webpack_require__(16);
|
|
3497
|
+
|
|
3079
3498
|
var visualization_color_palettes_1 = __webpack_require__(51);
|
|
3499
|
+
|
|
3080
3500
|
var themes_1 = __webpack_require__(60);
|
|
3501
|
+
|
|
3081
3502
|
var i18n_1 = __webpack_require__(2);
|
|
3503
|
+
|
|
3082
3504
|
var VizBehavior_1 = __webpack_require__(6);
|
|
3083
|
-
|
|
3505
|
+
|
|
3506
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
3507
|
+
|
|
3084
3508
|
var configUtils_1 = __webpack_require__(20);
|
|
3085
|
-
|
|
3509
|
+
|
|
3510
|
+
var MapUtils_1 = __webpack_require__(92);
|
|
3511
|
+
|
|
3086
3512
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
3513
|
+
|
|
3087
3514
|
var defaultContext = {
|
|
3088
3515
|
colorRangeConfig: [{
|
|
3089
3516
|
to: 20,
|
|
@@ -3443,12 +3870,15 @@ var themes = {
|
|
|
3443
3870
|
})(props);
|
|
3444
3871
|
}
|
|
3445
3872
|
};
|
|
3873
|
+
|
|
3446
3874
|
var checkTypeIsChoropleth = function checkTypeIsChoropleth(options) {
|
|
3447
3875
|
return options.layers && options.layers.length && options.layers[0].type === MapUtils_1.LAYER_TYPE.Choropleth;
|
|
3448
3876
|
};
|
|
3877
|
+
|
|
3449
3878
|
var checkTypeIsLocalChoropleth = function checkTypeIsLocalChoropleth(options) {
|
|
3450
3879
|
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');
|
|
3451
3880
|
};
|
|
3881
|
+
|
|
3452
3882
|
var EDITOR_LABEL_WIDTH = 140;
|
|
3453
3883
|
var editorConfig = [{
|
|
3454
3884
|
label: (0, i18n_1._)('Data configurations'),
|
|
@@ -3616,8 +4046,7 @@ var editorConfig = [{
|
|
|
3616
4046
|
}]]
|
|
3617
4047
|
}, {
|
|
3618
4048
|
label: (0, i18n_1._)('Color and style'),
|
|
3619
|
-
layout: [
|
|
3620
|
-
// TODO: add support for color mode option and its corresponding editor
|
|
4049
|
+
layout: [// TODO: add support for color mode option and its corresponding editor
|
|
3621
4050
|
// [
|
|
3622
4051
|
// {
|
|
3623
4052
|
// label: _('Color mode'),
|
|
@@ -3639,8 +4068,7 @@ var editorConfig = [{
|
|
|
3639
4068
|
var options = _ref8.options;
|
|
3640
4069
|
return !(options.layers && options.layers.length && options.layers[0].type === 'choropleth');
|
|
3641
4070
|
}
|
|
3642
|
-
}],
|
|
3643
|
-
// TODO: add editor for data colors
|
|
4071
|
+
}], // TODO: add editor for data colors
|
|
3644
4072
|
// [
|
|
3645
4073
|
// {
|
|
3646
4074
|
// label: _('Data colors'),
|
|
@@ -3686,8 +4114,7 @@ var editorConfig = [{
|
|
|
3686
4114
|
themes: themes,
|
|
3687
4115
|
min: 0
|
|
3688
4116
|
}
|
|
3689
|
-
}],
|
|
3690
|
-
// TODO: add support for seriesColorsByField option
|
|
4117
|
+
}], // TODO: add support for seriesColorsByField option
|
|
3691
4118
|
// [
|
|
3692
4119
|
// {
|
|
3693
4120
|
// label: _('Series colors by field name'),
|
|
@@ -3731,17 +4158,20 @@ var editorConfig = [{
|
|
|
3731
4158
|
/**
|
|
3732
4159
|
* visualization configuration
|
|
3733
4160
|
*/
|
|
4161
|
+
|
|
3734
4162
|
var config = {
|
|
3735
4163
|
/**
|
|
3736
4164
|
* unique viz key
|
|
3737
4165
|
*/
|
|
3738
4166
|
key: 'splunk.map',
|
|
4167
|
+
|
|
3739
4168
|
/**
|
|
3740
4169
|
* viz name
|
|
3741
4170
|
*/
|
|
3742
4171
|
name: (0, i18n_1._)('Map'),
|
|
3743
4172
|
category: VizCategory_1.VizCategory.SPATIAL,
|
|
3744
4173
|
status: 'preview',
|
|
4174
|
+
|
|
3745
4175
|
/**
|
|
3746
4176
|
* viz icon
|
|
3747
4177
|
*/
|
|
@@ -3778,28 +4208,38 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3778
4208
|
value: true
|
|
3779
4209
|
});
|
|
3780
4210
|
exports.columnsNullToZeros = void 0;
|
|
3781
|
-
|
|
4211
|
+
|
|
4212
|
+
var types_1 = __webpack_require__(83);
|
|
4213
|
+
|
|
3782
4214
|
var dsl_1 = __webpack_require__(133);
|
|
4215
|
+
|
|
3783
4216
|
var hocUtils_1 = __webpack_require__(27);
|
|
4217
|
+
|
|
3784
4218
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
4219
|
+
|
|
3785
4220
|
var BubbleLayer_1 = __webpack_require__(131);
|
|
4221
|
+
|
|
3786
4222
|
var columnsNullToZeros = function columnsNullToZeros(config, dataSources, options) {
|
|
3787
4223
|
var _a, _b;
|
|
4224
|
+
|
|
3788
4225
|
var primary = dataSources.primary;
|
|
3789
4226
|
var _primary$data = primary.data,
|
|
3790
|
-
|
|
3791
|
-
|
|
4227
|
+
columns = _primary$data.columns,
|
|
4228
|
+
fields = _primary$data.fields;
|
|
3792
4229
|
var newColumns = columns;
|
|
3793
4230
|
var mergedOptions = (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(config.optionsSchema, 'default'));
|
|
4231
|
+
|
|
3794
4232
|
if (((_b = (_a = mergedOptions.layers) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.type) === 'bubble') {
|
|
3795
4233
|
var latitudeField = (0, dsl_1.getFieldsFromDSL)(mergedOptions.layers[0].latitude, dataSources)[0] || '';
|
|
3796
4234
|
var longitudeField = (0, dsl_1.getFieldsFromDSL)(mergedOptions.layers[0].longitude, dataSources)[0] || '';
|
|
3797
4235
|
var excludedFields = [latitudeField, longitudeField, 'geobin'].concat(BubbleLayer_1.GEO_LAT_AND_LONG_FIELD);
|
|
3798
4236
|
var indicesToEvaluate = new Set(fields.reduce(function (arr, e, i) {
|
|
3799
4237
|
var field = typeof e === 'string' ? e : e.name.toString();
|
|
4238
|
+
|
|
3800
4239
|
if (!excludedFields.includes(field)) {
|
|
3801
4240
|
arr.push(i);
|
|
3802
4241
|
}
|
|
4242
|
+
|
|
3803
4243
|
return arr;
|
|
3804
4244
|
}, []));
|
|
3805
4245
|
newColumns = columns.map(function (column, i) {
|
|
@@ -3809,9 +4249,11 @@ var columnsNullToZeros = function columnsNullToZeros(config, dataSources, option
|
|
|
3809
4249
|
return !value || !(0, types_1.isNumber)(value) ? 0 : +value;
|
|
3810
4250
|
});
|
|
3811
4251
|
}
|
|
4252
|
+
|
|
3812
4253
|
return column;
|
|
3813
4254
|
});
|
|
3814
4255
|
}
|
|
4256
|
+
|
|
3815
4257
|
var modifiedDatasources = Object.assign(Object.assign({}, dataSources), {
|
|
3816
4258
|
primary: Object.assign(Object.assign({}, primary), {
|
|
3817
4259
|
data: Object.assign(Object.assign({}, primary.data), {
|
|
@@ -3821,6 +4263,7 @@ var columnsNullToZeros = function columnsNullToZeros(config, dataSources, option
|
|
|
3821
4263
|
});
|
|
3822
4264
|
return modifiedDatasources;
|
|
3823
4265
|
};
|
|
4266
|
+
|
|
3824
4267
|
exports.columnsNullToZeros = columnsNullToZeros;
|
|
3825
4268
|
|
|
3826
4269
|
/***/ }),
|
|
@@ -3831,11 +4274,35 @@ exports.columnsNullToZeros = columnsNullToZeros;
|
|
|
3831
4274
|
"use strict";
|
|
3832
4275
|
|
|
3833
4276
|
|
|
4277
|
+
var _classCallCheck = __webpack_require__(9);
|
|
4278
|
+
|
|
4279
|
+
var _createClass = __webpack_require__(18);
|
|
4280
|
+
|
|
3834
4281
|
Object.defineProperty(exports, "__esModule", {
|
|
3835
4282
|
value: true
|
|
3836
4283
|
});
|
|
3837
|
-
exports.
|
|
3838
|
-
|
|
4284
|
+
exports.DefaultVizActionHandler = void 0;
|
|
4285
|
+
|
|
4286
|
+
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
4287
|
+
function DefaultVizActionHandler() {
|
|
4288
|
+
_classCallCheck(this, DefaultVizActionHandler);
|
|
4289
|
+
}
|
|
4290
|
+
|
|
4291
|
+
_createClass(DefaultVizActionHandler, [{
|
|
4292
|
+
key: "focus",
|
|
4293
|
+
value: function focus() {// noop
|
|
4294
|
+
}
|
|
4295
|
+
}, {
|
|
4296
|
+
key: "snapshot",
|
|
4297
|
+
value: function snapshot() {
|
|
4298
|
+
return null; // noop
|
|
4299
|
+
}
|
|
4300
|
+
}]);
|
|
4301
|
+
|
|
4302
|
+
return DefaultVizActionHandler;
|
|
4303
|
+
}();
|
|
4304
|
+
|
|
4305
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
3839
4306
|
|
|
3840
4307
|
/***/ }),
|
|
3841
4308
|
|
|
@@ -3849,7 +4316,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3849
4316
|
value: true
|
|
3850
4317
|
});
|
|
3851
4318
|
exports.useDeepMemo = void 0;
|
|
4319
|
+
|
|
3852
4320
|
var react_1 = __webpack_require__(1);
|
|
4321
|
+
|
|
3853
4322
|
var lodash_1 = __webpack_require__(3);
|
|
3854
4323
|
/**
|
|
3855
4324
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -3864,16 +4333,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
3864
4333
|
* @param fn the function to be executed and
|
|
3865
4334
|
* @param dependencies an array of dependencies
|
|
3866
4335
|
*/
|
|
4336
|
+
|
|
4337
|
+
|
|
3867
4338
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
3868
4339
|
var ref = (0, react_1.useRef)();
|
|
4340
|
+
|
|
3869
4341
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
3870
4342
|
ref.current = {
|
|
3871
4343
|
dependencies: dependencies,
|
|
3872
4344
|
value: fn()
|
|
3873
4345
|
};
|
|
3874
4346
|
}
|
|
4347
|
+
|
|
3875
4348
|
return ref.current.value;
|
|
3876
4349
|
};
|
|
4350
|
+
|
|
3877
4351
|
exports.useDeepMemo = useDeepMemo;
|
|
3878
4352
|
|
|
3879
4353
|
/***/ }),
|
|
@@ -3888,19 +4362,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3888
4362
|
value: true
|
|
3889
4363
|
});
|
|
3890
4364
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
4365
|
+
|
|
3891
4366
|
var React = __webpack_require__(1);
|
|
4367
|
+
|
|
3892
4368
|
var T = __webpack_require__(0);
|
|
4369
|
+
|
|
3893
4370
|
var i18n_1 = __webpack_require__(2);
|
|
4371
|
+
|
|
3894
4372
|
var Message_1 = __webpack_require__(10);
|
|
4373
|
+
|
|
3895
4374
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
3896
4375
|
/**
|
|
3897
4376
|
* @method isMissing
|
|
3898
4377
|
* @param {any} v
|
|
3899
4378
|
* @returns {boolean} true if the input value === null or undefined
|
|
3900
4379
|
*/
|
|
4380
|
+
|
|
4381
|
+
|
|
3901
4382
|
var isMissing = function isMissing(v) {
|
|
3902
4383
|
return v === null || v === undefined;
|
|
3903
4384
|
};
|
|
4385
|
+
|
|
3904
4386
|
exports.isMissing = isMissing;
|
|
3905
4387
|
/**
|
|
3906
4388
|
* @method misskingKeys
|
|
@@ -3908,11 +4390,13 @@ exports.isMissing = isMissing;
|
|
|
3908
4390
|
* @param {object} target
|
|
3909
4391
|
* @returns {string[]} the keys of missing required props
|
|
3910
4392
|
*/
|
|
4393
|
+
|
|
3911
4394
|
var missingKeys = function missingKeys(keys, target) {
|
|
3912
4395
|
return keys.filter(function (k) {
|
|
3913
4396
|
return (0, exports.isMissing)(target[k]);
|
|
3914
4397
|
});
|
|
3915
4398
|
};
|
|
4399
|
+
|
|
3916
4400
|
exports.missingKeys = missingKeys;
|
|
3917
4401
|
var propTypes = {
|
|
3918
4402
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -3926,10 +4410,11 @@ var propTypes = {
|
|
|
3926
4410
|
* @param {MissingPropsProps} props
|
|
3927
4411
|
* @returns {React.ReactElement}
|
|
3928
4412
|
*/
|
|
4413
|
+
|
|
3929
4414
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
3930
4415
|
var width = props.width,
|
|
3931
|
-
|
|
3932
|
-
|
|
4416
|
+
height = props.height,
|
|
4417
|
+
missingProps = props.missingProps;
|
|
3933
4418
|
return React.createElement(Message_1.default, {
|
|
3934
4419
|
"data-test": "message",
|
|
3935
4420
|
width: width,
|
|
@@ -3937,6 +4422,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
3937
4422
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
3938
4423
|
});
|
|
3939
4424
|
};
|
|
4425
|
+
|
|
3940
4426
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
3941
4427
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
3942
4428
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -3956,15 +4442,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
3956
4442
|
Object.defineProperty(exports, "__esModule", {
|
|
3957
4443
|
value: true
|
|
3958
4444
|
});
|
|
4445
|
+
|
|
3959
4446
|
var React = __webpack_require__(1);
|
|
4447
|
+
|
|
3960
4448
|
var styled_components_1 = __webpack_require__(4);
|
|
4449
|
+
|
|
3961
4450
|
var hocUtils_1 = __webpack_require__(15);
|
|
4451
|
+
|
|
3962
4452
|
var Cover = styled_components_1.default.div.withConfig({
|
|
3963
4453
|
displayName: "withEditModeCover__Cover",
|
|
3964
4454
|
componentId: "sc-1gsbnxb-0"
|
|
3965
4455
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
3966
4456
|
var Blocker = styled_components_1.default.div.attrs({
|
|
3967
|
-
'data-splunk-visualization-version': "26.
|
|
4457
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
3968
4458
|
}).withConfig({
|
|
3969
4459
|
displayName: "withEditModeCover__Blocker",
|
|
3970
4460
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -3975,6 +4465,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
3975
4465
|
* @param {ExtendedDashViz} Visualization
|
|
3976
4466
|
* @returns {ExtendedDashViz} Wrapper
|
|
3977
4467
|
*/
|
|
4468
|
+
|
|
3978
4469
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
3979
4470
|
var Wrapper = function Wrapper(props) {
|
|
3980
4471
|
var mode = props.mode;
|
|
@@ -3983,12 +4474,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
3983
4474
|
"data-test": "edit-mode-cover"
|
|
3984
4475
|
}));
|
|
3985
4476
|
};
|
|
4477
|
+
|
|
3986
4478
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
3987
4479
|
Wrapper: Wrapper,
|
|
3988
4480
|
Visualization: Visualization
|
|
3989
4481
|
});
|
|
3990
4482
|
return Wrapper;
|
|
3991
4483
|
};
|
|
4484
|
+
|
|
3992
4485
|
exports.default = withEditModeCover;
|
|
3993
4486
|
|
|
3994
4487
|
/***/ }),
|
|
@@ -4002,27 +4495,37 @@ exports.default = withEditModeCover;
|
|
|
4002
4495
|
Object.defineProperty(exports, "__esModule", {
|
|
4003
4496
|
value: true
|
|
4004
4497
|
});
|
|
4498
|
+
|
|
4005
4499
|
var React = __webpack_require__(1);
|
|
4500
|
+
|
|
4006
4501
|
var colorUtils_1 = __webpack_require__(12);
|
|
4502
|
+
|
|
4007
4503
|
var variables_1 = __webpack_require__(11);
|
|
4504
|
+
|
|
4008
4505
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
4506
|
+
|
|
4009
4507
|
var VizBehavior_1 = __webpack_require__(6);
|
|
4508
|
+
|
|
4010
4509
|
var hocUtils_1 = __webpack_require__(15);
|
|
4510
|
+
|
|
4011
4511
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
4012
4512
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
4013
4513
|
var config = Visualization.config;
|
|
4014
4514
|
var themes = config.themes;
|
|
4515
|
+
|
|
4015
4516
|
var Wrapper = function Wrapper(props) {
|
|
4016
4517
|
var _a, _b;
|
|
4518
|
+
|
|
4017
4519
|
var dataSources = props.dataSources,
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4520
|
+
loading = props.loading,
|
|
4521
|
+
options = props.options,
|
|
4522
|
+
height = props.height,
|
|
4523
|
+
width = props.width;
|
|
4022
4524
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
4023
4525
|
var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
4024
4526
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
4025
4527
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
4528
|
+
|
|
4026
4529
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
4027
4530
|
return React.createElement(IconPlaceholder_1.default, {
|
|
4028
4531
|
"data-test": "icon-placeholder",
|
|
@@ -4033,14 +4536,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
4033
4536
|
iconColor: iconColor
|
|
4034
4537
|
});
|
|
4035
4538
|
}
|
|
4539
|
+
|
|
4036
4540
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
4037
4541
|
};
|
|
4542
|
+
|
|
4038
4543
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
4039
4544
|
Wrapper: Wrapper,
|
|
4040
4545
|
Visualization: Visualization
|
|
4041
4546
|
});
|
|
4042
4547
|
return Wrapper;
|
|
4043
4548
|
};
|
|
4549
|
+
|
|
4044
4550
|
exports.default = withPlaceholder;
|
|
4045
4551
|
|
|
4046
4552
|
/***/ }),
|
|
@@ -4075,11 +4581,13 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
4075
4581
|
Object.defineProperty(exports, "__esModule", {
|
|
4076
4582
|
value: true
|
|
4077
4583
|
});
|
|
4584
|
+
|
|
4078
4585
|
var i18n_1 = __webpack_require__(2);
|
|
4586
|
+
|
|
4079
4587
|
var background = function background(_ref) {
|
|
4080
4588
|
var label = _ref.label,
|
|
4081
|
-
|
|
4082
|
-
|
|
4589
|
+
themes = _ref.themes,
|
|
4590
|
+
labelPosition = _ref.labelPosition;
|
|
4083
4591
|
return [{
|
|
4084
4592
|
label: (0, i18n_1._)(label || 'Background'),
|
|
4085
4593
|
option: 'backgroundColor',
|
|
@@ -4090,6 +4598,7 @@ var background = function background(_ref) {
|
|
|
4090
4598
|
}
|
|
4091
4599
|
}];
|
|
4092
4600
|
};
|
|
4601
|
+
|
|
4093
4602
|
exports.default = background;
|
|
4094
4603
|
|
|
4095
4604
|
/***/ }),
|
|
@@ -4112,6 +4621,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4112
4621
|
});
|
|
4113
4622
|
exports.VizBehavior = void 0;
|
|
4114
4623
|
var VizBehavior;
|
|
4624
|
+
|
|
4115
4625
|
(function (VizBehavior) {
|
|
4116
4626
|
/**
|
|
4117
4627
|
* Dynamic Options Behavior.
|
|
@@ -4131,6 +4641,7 @@ var VizBehavior;
|
|
|
4131
4641
|
* missing.
|
|
4132
4642
|
* @type {string}
|
|
4133
4643
|
*/
|
|
4644
|
+
|
|
4134
4645
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
4135
4646
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
4136
4647
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -4166,6 +4677,13 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
|
4166
4677
|
|
|
4167
4678
|
/***/ }),
|
|
4168
4679
|
|
|
4680
|
+
/***/ 83:
|
|
4681
|
+
/***/ (function(module, exports) {
|
|
4682
|
+
|
|
4683
|
+
module.exports = require("@splunk/visualization-encoding/utils/types");
|
|
4684
|
+
|
|
4685
|
+
/***/ }),
|
|
4686
|
+
|
|
4169
4687
|
/***/ 9:
|
|
4170
4688
|
/***/ (function(module, exports) {
|
|
4171
4689
|
|
|
@@ -4173,42 +4691,55 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
|
4173
4691
|
|
|
4174
4692
|
/***/ }),
|
|
4175
4693
|
|
|
4176
|
-
/***/
|
|
4694
|
+
/***/ 92:
|
|
4177
4695
|
/***/ (function(module, exports, __webpack_require__) {
|
|
4178
4696
|
|
|
4179
4697
|
"use strict";
|
|
4180
4698
|
|
|
4181
4699
|
|
|
4182
4700
|
var _defineProperty = __webpack_require__(7);
|
|
4701
|
+
|
|
4183
4702
|
var _slicedToArray = __webpack_require__(17);
|
|
4703
|
+
|
|
4184
4704
|
var _toConsumableArray = __webpack_require__(8);
|
|
4705
|
+
|
|
4185
4706
|
Object.defineProperty(exports, "__esModule", {
|
|
4186
4707
|
value: true
|
|
4187
4708
|
});
|
|
4188
4709
|
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;
|
|
4710
|
+
|
|
4189
4711
|
var lodash_1 = __webpack_require__(3);
|
|
4190
|
-
|
|
4712
|
+
|
|
4713
|
+
var d3_scale_1 = __webpack_require__(93);
|
|
4714
|
+
|
|
4191
4715
|
var chroma = __webpack_require__(158);
|
|
4716
|
+
|
|
4192
4717
|
var colorUtils_1 = __webpack_require__(12);
|
|
4718
|
+
|
|
4193
4719
|
var visualization_color_palettes_1 = __webpack_require__(51);
|
|
4194
|
-
|
|
4720
|
+
|
|
4721
|
+
var types_1 = __webpack_require__(83);
|
|
4722
|
+
|
|
4195
4723
|
exports.MAX_LATITUDE = 90;
|
|
4196
4724
|
exports.MIN_LATITUDE = -90;
|
|
4197
4725
|
exports.MAX_LONGITUDE = 180;
|
|
4198
4726
|
exports.MIN_LONGITUDE = -180;
|
|
4199
4727
|
exports.DEFAULT_RESULT_LIMIT = 1000;
|
|
4200
4728
|
exports.DEFAULT_CLUSTER_COLOR = '#909090';
|
|
4201
|
-
exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL;
|
|
4202
|
-
|
|
4203
|
-
exports.MAP_STYLE_VERSION_NUMBER = 8;
|
|
4204
|
-
// currently using one [min, max] value set for bubbles across all zoom levels
|
|
4729
|
+
exports.DEFAULT_SERIES_COLORS = visualization_color_palettes_1.VIZ_CATEGORICAL; // MapLibre requires a map style specification number which is always 8
|
|
4730
|
+
|
|
4731
|
+
exports.MAP_STYLE_VERSION_NUMBER = 8; // currently using one [min, max] value set for bubbles across all zoom levels
|
|
4205
4732
|
// TODO: design choices on [min, max] bubble size for different zoom levels
|
|
4733
|
+
|
|
4206
4734
|
exports.MIN_BUBBLE_RADIUS = 7.11; // 10px
|
|
4735
|
+
|
|
4207
4736
|
exports.MAX_BUBBLE_RADIUS = 45.26; // 85px
|
|
4737
|
+
|
|
4208
4738
|
exports.DEFAULT_OPACITY = 0.8;
|
|
4209
4739
|
var LONGITUDE = 'longitude';
|
|
4210
4740
|
var LATITUDE = 'latitude';
|
|
4211
4741
|
var LAYER_TYPE;
|
|
4742
|
+
|
|
4212
4743
|
(function (LAYER_TYPE) {
|
|
4213
4744
|
LAYER_TYPE["Marker"] = "marker";
|
|
4214
4745
|
LAYER_TYPE["Bubble"] = "bubble";
|
|
@@ -4222,12 +4753,16 @@ var LAYER_TYPE;
|
|
|
4222
4753
|
* @param {BaseTileConfig[]} args.customTileConfig
|
|
4223
4754
|
* @returns {Object} tile preset
|
|
4224
4755
|
*/
|
|
4756
|
+
|
|
4757
|
+
|
|
4225
4758
|
var getTilePreset = function getTilePreset(_ref) {
|
|
4226
4759
|
var _ref$defaultTileConfi = _ref.defaultTileConfig,
|
|
4227
|
-
|
|
4228
|
-
|
|
4229
|
-
|
|
4760
|
+
defaultTileConfig = _ref$defaultTileConfi === void 0 ? [] : _ref$defaultTileConfi,
|
|
4761
|
+
_ref$customTileConfig = _ref.customTileConfig,
|
|
4762
|
+
customTileConfig = _ref$customTileConfig === void 0 ? [] : _ref$customTileConfig;
|
|
4763
|
+
|
|
4230
4764
|
var _a, _b;
|
|
4765
|
+
|
|
4231
4766
|
var tilePreset = {};
|
|
4232
4767
|
var defaultTileLight = {};
|
|
4233
4768
|
var defaultTileDark = {};
|
|
@@ -4241,6 +4776,7 @@ var getTilePreset = function getTilePreset(_ref) {
|
|
|
4241
4776
|
});
|
|
4242
4777
|
tilePreset[key] = updatedConfig;
|
|
4243
4778
|
});
|
|
4779
|
+
|
|
4244
4780
|
if (defaultTileConfig.length > 0) {
|
|
4245
4781
|
defaultTileLight = (_a = defaultTileConfig.find(function (config) {
|
|
4246
4782
|
return config.theme === 'light';
|
|
@@ -4253,12 +4789,14 @@ var getTilePreset = function getTilePreset(_ref) {
|
|
|
4253
4789
|
return config.theme === undefined;
|
|
4254
4790
|
});
|
|
4255
4791
|
}
|
|
4792
|
+
|
|
4256
4793
|
return {
|
|
4257
4794
|
tilePreset: tilePreset,
|
|
4258
4795
|
defaultTileLight: defaultTileLight,
|
|
4259
4796
|
defaultTileDark: defaultTileDark
|
|
4260
4797
|
};
|
|
4261
4798
|
};
|
|
4799
|
+
|
|
4262
4800
|
exports.getTilePreset = getTilePreset;
|
|
4263
4801
|
/**
|
|
4264
4802
|
* Check if baseLayerTileServer is in tilePreset and config matches current theme, if yes, return.
|
|
@@ -4273,20 +4811,22 @@ exports.getTilePreset = getTilePreset;
|
|
|
4273
4811
|
* @param {BaseTileConfig} args.defaultTileLight
|
|
4274
4812
|
* @returns {BaseTileConfig} mapStyle
|
|
4275
4813
|
*/
|
|
4814
|
+
|
|
4276
4815
|
var getMapStyle = function getMapStyle(_ref2) {
|
|
4277
4816
|
var showBaseLayer = _ref2.showBaseLayer,
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4817
|
+
_ref2$baseLayerTileSe = _ref2.baseLayerTileServer,
|
|
4818
|
+
baseLayerTileServer = _ref2$baseLayerTileSe === void 0 ? '' : _ref2$baseLayerTileSe,
|
|
4819
|
+
_ref2$baseLayerTileSe2 = _ref2.baseLayerTileServerType,
|
|
4820
|
+
baseLayerTileServerType = _ref2$baseLayerTileSe2 === void 0 ? '' : _ref2$baseLayerTileSe2,
|
|
4821
|
+
_ref2$tilePreset = _ref2.tilePreset,
|
|
4822
|
+
tilePreset = _ref2$tilePreset === void 0 ? {} : _ref2$tilePreset,
|
|
4823
|
+
_ref2$colorScheme = _ref2.colorScheme,
|
|
4824
|
+
colorScheme = _ref2$colorScheme === void 0 ? 'light' : _ref2$colorScheme,
|
|
4825
|
+
_ref2$defaultTileLigh = _ref2.defaultTileLight,
|
|
4826
|
+
defaultTileLight = _ref2$defaultTileLigh === void 0 ? {} : _ref2$defaultTileLigh,
|
|
4827
|
+
_ref2$defaultTileDark = _ref2.defaultTileDark,
|
|
4828
|
+
defaultTileDark = _ref2$defaultTileDark === void 0 ? {} : _ref2$defaultTileDark;
|
|
4829
|
+
|
|
4290
4830
|
if (!showBaseLayer) {
|
|
4291
4831
|
return {
|
|
4292
4832
|
version: exports.MAP_STYLE_VERSION_NUMBER,
|
|
@@ -4306,9 +4846,11 @@ var getMapStyle = function getMapStyle(_ref2) {
|
|
|
4306
4846
|
}]
|
|
4307
4847
|
};
|
|
4308
4848
|
}
|
|
4849
|
+
|
|
4309
4850
|
if (baseLayerTileServer && tilePreset[baseLayerTileServer] && (tilePreset[baseLayerTileServer].theme === colorScheme || tilePreset[baseLayerTileServer].theme === 'all')) {
|
|
4310
4851
|
return tilePreset[baseLayerTileServer];
|
|
4311
4852
|
}
|
|
4853
|
+
|
|
4312
4854
|
if (baseLayerTileServer && baseLayerTileServerType) {
|
|
4313
4855
|
var tiles = [];
|
|
4314
4856
|
/**
|
|
@@ -4316,6 +4858,7 @@ var getMapStyle = function getMapStyle(_ref2) {
|
|
|
4316
4858
|
* Subdomains are used to help with browser parallel requests per domain limitation. These subdomains are typically single letters 'a', 'b' and 'c'
|
|
4317
4859
|
* Refer to https://leafletjs.com/SlavaUkraini/reference.html#tilelayer and https://wiki.openstreetmap.org/wiki/Tile_servers
|
|
4318
4860
|
*/
|
|
4861
|
+
|
|
4319
4862
|
if (baseLayerTileServer.match(/^(https?):\/\/{(s|S)}\../)) {
|
|
4320
4863
|
/**
|
|
4321
4864
|
* sXML (Leaflet) allows users to define their own tile server URLs + list of available subdomains
|
|
@@ -4326,8 +4869,9 @@ var getMapStyle = function getMapStyle(_ref2) {
|
|
|
4326
4869
|
tiles = [baseLayerTileServer.replace(/{(s|S)}/, 'a'), baseLayerTileServer.replace(/{(s|S)}/, 'b'), baseLayerTileServer.replace(/{(s|S)}/, 'c')];
|
|
4327
4870
|
} else {
|
|
4328
4871
|
tiles = [baseLayerTileServer];
|
|
4329
|
-
}
|
|
4330
|
-
|
|
4872
|
+
} // TODO: remove hardcoded style when we allow users to pass in layer style through Viz options
|
|
4873
|
+
|
|
4874
|
+
|
|
4331
4875
|
var mapStyle = {
|
|
4332
4876
|
version: exports.MAP_STYLE_VERSION_NUMBER,
|
|
4333
4877
|
sources: {
|
|
@@ -4343,134 +4887,164 @@ var getMapStyle = function getMapStyle(_ref2) {
|
|
|
4343
4887
|
source: 'base-tiles',
|
|
4344
4888
|
minzoom: 0,
|
|
4345
4889
|
maxzoom: 24 // https://maplibre.org/maplibre-gl-js-docs/api/map/
|
|
4890
|
+
|
|
4346
4891
|
}]
|
|
4347
4892
|
};
|
|
4348
|
-
|
|
4349
4893
|
return mapStyle;
|
|
4350
|
-
}
|
|
4351
|
-
|
|
4894
|
+
} // if tile server is not present in the preset AND we can't construct a mapStyle, fall back on defaults
|
|
4895
|
+
|
|
4896
|
+
|
|
4352
4897
|
return colorScheme === 'light' ? defaultTileLight : defaultTileDark;
|
|
4353
4898
|
};
|
|
4899
|
+
|
|
4354
4900
|
exports.getMapStyle = getMapStyle;
|
|
4901
|
+
|
|
4355
4902
|
var getZoomConstraintsFromTileConfig = function getZoomConstraintsFromTileConfig(tileConfig, baseLayerTileServer) {
|
|
4356
4903
|
var sources = tileConfig.sources,
|
|
4357
|
-
|
|
4358
|
-
var matchedBaseLayerTileServer = false;
|
|
4359
|
-
|
|
4904
|
+
layers = tileConfig.layers;
|
|
4905
|
+
var matchedBaseLayerTileServer = false; // check sources for minzoom maxzoom first
|
|
4906
|
+
|
|
4360
4907
|
var sourceKeys = Object.keys(sources);
|
|
4908
|
+
|
|
4361
4909
|
for (var i = 0; i < sourceKeys.length; i += 1) {
|
|
4362
4910
|
var _sources$sourceKeys$i = sources[sourceKeys[i]],
|
|
4363
|
-
|
|
4364
|
-
|
|
4911
|
+
minzoom = _sources$sourceKeys$i.minzoom,
|
|
4912
|
+
maxzoom = _sources$sourceKeys$i.maxzoom;
|
|
4913
|
+
|
|
4365
4914
|
if (baseLayerTileServer && sources[sourceKeys[i]].tiles.indexOf(baseLayerTileServer) !== -1) {
|
|
4366
4915
|
matchedBaseLayerTileServer = true;
|
|
4367
4916
|
}
|
|
4917
|
+
|
|
4368
4918
|
if ((baseLayerTileServer && matchedBaseLayerTileServer || !baseLayerTileServer) && (0, lodash_1.isNumber)(minzoom) && (0, lodash_1.isNumber)(maxzoom)) {
|
|
4369
4919
|
return {
|
|
4370
4920
|
minZoom: minzoom,
|
|
4371
4921
|
maxZoom: maxzoom
|
|
4372
4922
|
};
|
|
4373
4923
|
}
|
|
4374
|
-
}
|
|
4375
|
-
|
|
4924
|
+
} // then check layers
|
|
4925
|
+
|
|
4926
|
+
|
|
4376
4927
|
for (var _i = 0; _i < layers.length; _i += 1) {
|
|
4377
4928
|
var _layers$_i = layers[_i],
|
|
4378
|
-
|
|
4379
|
-
|
|
4929
|
+
_minzoom = _layers$_i.minzoom,
|
|
4930
|
+
_maxzoom = _layers$_i.maxzoom;
|
|
4931
|
+
|
|
4380
4932
|
if ((baseLayerTileServer && matchedBaseLayerTileServer || !baseLayerTileServer) && (0, lodash_1.isNumber)(_minzoom) && (0, lodash_1.isNumber)(_maxzoom)) {
|
|
4381
4933
|
return {
|
|
4382
4934
|
minZoom: _minzoom,
|
|
4383
4935
|
maxZoom: _maxzoom
|
|
4384
4936
|
};
|
|
4385
4937
|
}
|
|
4386
|
-
}
|
|
4387
|
-
|
|
4938
|
+
} // Maplibre default - would reset previous min/maxZoom https://maplibre.org/maplibre-gl-js-docs/api/map/
|
|
4939
|
+
|
|
4940
|
+
|
|
4388
4941
|
return {
|
|
4389
4942
|
minZoom: 0,
|
|
4390
4943
|
maxZoom: 24
|
|
4391
4944
|
};
|
|
4392
4945
|
};
|
|
4946
|
+
|
|
4393
4947
|
exports.getZoomConstraintsFromTileConfig = getZoomConstraintsFromTileConfig;
|
|
4948
|
+
|
|
4394
4949
|
var getZoomLevelFromGeobin = function getZoomLevelFromGeobin(geobinStr) {
|
|
4395
4950
|
var _a;
|
|
4951
|
+
|
|
4396
4952
|
if (!geobinStr) {
|
|
4397
4953
|
return null;
|
|
4398
|
-
}
|
|
4399
|
-
|
|
4954
|
+
} // geostats cmds return geobin with zoom level 0-18, 0-99 in the geobinPattern covers the range
|
|
4955
|
+
|
|
4956
|
+
|
|
4400
4957
|
var geobinPattern = /bin_id_zl_([0-9]{0,2})?_y_/g;
|
|
4401
4958
|
var match = geobinPattern.exec(geobinStr);
|
|
4402
4959
|
return (_a = (match === null || match === void 0 ? void 0 : match.length) && parseInt(match[1], 10)) !== null && _a !== void 0 ? _a : null;
|
|
4403
4960
|
};
|
|
4404
|
-
|
|
4405
|
-
// Bubble colors - static
|
|
4961
|
+
|
|
4962
|
+
exports.getZoomLevelFromGeobin = getZoomLevelFromGeobin; // Bubble colors - static
|
|
4963
|
+
|
|
4406
4964
|
var getStaticColors = function getStaticColors(colorCount, colorArray) {
|
|
4407
4965
|
if (colorCount < 0 || !colorCount) {
|
|
4408
4966
|
return [exports.DEFAULT_CLUSTER_COLOR];
|
|
4409
4967
|
}
|
|
4968
|
+
|
|
4410
4969
|
if (!colorArray || !colorArray.length) {
|
|
4411
4970
|
return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
|
|
4412
4971
|
return exports.DEFAULT_SERIES_COLORS[i];
|
|
4413
4972
|
});
|
|
4414
|
-
}
|
|
4415
|
-
// loop through colorArray to pick the first $colorCount colors
|
|
4973
|
+
} // loop through colorArray to pick the first $colorCount colors
|
|
4416
4974
|
// start from begining again if colorCount > colorArray.length
|
|
4975
|
+
|
|
4976
|
+
|
|
4417
4977
|
return _toConsumableArray(Array(colorCount).keys()).map(function (i) {
|
|
4418
4978
|
return (0, colorUtils_1.isColor)(colorArray[i % colorArray.length]) ? colorArray[i % colorArray.length] : exports.DEFAULT_CLUSTER_COLOR;
|
|
4419
4979
|
});
|
|
4420
4980
|
};
|
|
4421
|
-
|
|
4422
|
-
// Bubble size
|
|
4981
|
+
|
|
4982
|
+
exports.getStaticColors = getStaticColors; // Bubble size
|
|
4983
|
+
|
|
4423
4984
|
var matchBubbleSize = function matchBubbleSize(dataRange, data) {
|
|
4424
4985
|
var size = (0, d3_scale_1.scalePow)().exponent(0.2).domain(dataRange).range([exports.MIN_BUBBLE_RADIUS, exports.MAX_BUBBLE_RADIUS])(data);
|
|
4986
|
+
|
|
4425
4987
|
if (size > exports.MAX_BUBBLE_RADIUS) {
|
|
4426
4988
|
return exports.MAX_BUBBLE_RADIUS;
|
|
4427
4989
|
}
|
|
4990
|
+
|
|
4428
4991
|
if (size < exports.MIN_BUBBLE_RADIUS) {
|
|
4429
4992
|
return exports.MIN_BUBBLE_RADIUS;
|
|
4430
4993
|
}
|
|
4994
|
+
|
|
4431
4995
|
return size;
|
|
4432
4996
|
};
|
|
4997
|
+
|
|
4433
4998
|
exports.matchBubbleSize = matchBubbleSize;
|
|
4999
|
+
|
|
4434
5000
|
var transposeArray = function transposeArray(array) {
|
|
4435
5001
|
if (!array || !array.length || !array[0] || !array[0].length) {
|
|
4436
5002
|
return [];
|
|
4437
5003
|
}
|
|
5004
|
+
|
|
4438
5005
|
return array[0].map(function (_, i) {
|
|
4439
5006
|
return array.map(function (row) {
|
|
4440
5007
|
return row[i];
|
|
4441
5008
|
});
|
|
4442
5009
|
});
|
|
4443
5010
|
};
|
|
4444
|
-
|
|
4445
|
-
// sanitize values: update all null, undefined, or negative values to 0
|
|
5011
|
+
|
|
5012
|
+
exports.transposeArray = transposeArray; // sanitize values: update all null, undefined, or negative values to 0
|
|
5013
|
+
|
|
4446
5014
|
var sanitizeValues = function sanitizeValues(values) {
|
|
4447
5015
|
// null / undefined
|
|
4448
5016
|
if (!values) {
|
|
4449
5017
|
return 0;
|
|
4450
|
-
}
|
|
4451
|
-
|
|
5018
|
+
} // number
|
|
5019
|
+
|
|
5020
|
+
|
|
4452
5021
|
if (!Array.isArray(values)) {
|
|
4453
5022
|
return values > 0 ? values : 0;
|
|
4454
|
-
}
|
|
4455
|
-
|
|
5023
|
+
} // array
|
|
5024
|
+
|
|
5025
|
+
|
|
4456
5026
|
return values.map(function (arr) {
|
|
4457
5027
|
return (0, exports.sanitizeValues)(arr);
|
|
4458
5028
|
});
|
|
4459
5029
|
};
|
|
5030
|
+
|
|
4460
5031
|
exports.sanitizeValues = sanitizeValues;
|
|
5032
|
+
|
|
4461
5033
|
var bakeBubbleData = function bakeBubbleData(layer) {
|
|
4462
5034
|
var _a;
|
|
5035
|
+
|
|
4463
5036
|
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) {
|
|
4464
5037
|
return null;
|
|
4465
|
-
}
|
|
4466
|
-
// if bubbleSize is passed as an array of single number array (data series)
|
|
5038
|
+
} // if bubbleSize is passed as an array of single number array (data series)
|
|
4467
5039
|
// e.g. [value0, value1, ...]
|
|
4468
5040
|
// format each value as an array to unify data operations for data series and frames
|
|
5041
|
+
|
|
5042
|
+
|
|
4469
5043
|
var sanitizedBubbleSize = (0, exports.sanitizeValues)(layer.bubbleSize);
|
|
4470
5044
|
var transposedBubbleSize;
|
|
4471
5045
|
var transposedSanitizedBubbleSize;
|
|
4472
|
-
var isPie = false;
|
|
4473
|
-
|
|
5046
|
+
var isPie = false; // format array if bubbleSize is passed as an array of array (data frame)
|
|
5047
|
+
|
|
4474
5048
|
if (Array.isArray(layer.bubbleSize[0])) {
|
|
4475
5049
|
// one-time array transpose,
|
|
4476
5050
|
// e.g. from [column0data, column0data] (multi series)
|
|
@@ -4480,8 +5054,8 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
4480
5054
|
// for easy access of values at each geo location,
|
|
4481
5055
|
// and min max pie size computation
|
|
4482
5056
|
transposedBubbleSize = (0, exports.transposeArray)(layer.bubbleSize);
|
|
4483
|
-
transposedSanitizedBubbleSize = (0, exports.transposeArray)(sanitizedBubbleSize);
|
|
4484
|
-
|
|
5057
|
+
transposedSanitizedBubbleSize = (0, exports.transposeArray)(sanitizedBubbleSize); // if multiple series in the dataframe, set isPie to true
|
|
5058
|
+
|
|
4485
5059
|
if (layer.bubbleSize.length > 1) {
|
|
4486
5060
|
isPie = true;
|
|
4487
5061
|
}
|
|
@@ -4493,9 +5067,11 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
4493
5067
|
return [n];
|
|
4494
5068
|
});
|
|
4495
5069
|
}
|
|
5070
|
+
|
|
4496
5071
|
if (!transposedBubbleSize || !transposedBubbleSize.length) {
|
|
4497
5072
|
return null;
|
|
4498
5073
|
}
|
|
5074
|
+
|
|
4499
5075
|
var data = layer.latitude.map(function (lat, i) {
|
|
4500
5076
|
return {
|
|
4501
5077
|
zoom: (0, exports.getZoomLevelFromGeobin)(layer.geobin[i]),
|
|
@@ -4506,8 +5082,8 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
4506
5082
|
};
|
|
4507
5083
|
}).filter(function (d) {
|
|
4508
5084
|
return Boolean(d.values);
|
|
4509
|
-
});
|
|
4510
|
-
|
|
5085
|
+
}); // compute the min/max value to encode min/max pie or bubble size
|
|
5086
|
+
|
|
4511
5087
|
var min = (0, lodash_1.sum)(transposedSanitizedBubbleSize[0]);
|
|
4512
5088
|
var max = (0, lodash_1.sum)(transposedSanitizedBubbleSize[1]);
|
|
4513
5089
|
transposedSanitizedBubbleSize.forEach(function (row) {
|
|
@@ -4523,22 +5099,29 @@ var bakeBubbleData = function bakeBubbleData(layer) {
|
|
|
4523
5099
|
bubbleSizeFields: layer.bubbleSizeFields
|
|
4524
5100
|
};
|
|
4525
5101
|
};
|
|
5102
|
+
|
|
4526
5103
|
exports.bakeBubbleData = bakeBubbleData;
|
|
5104
|
+
|
|
4527
5105
|
var isValidLatLon = function isValidLatLon(latlon) {
|
|
4528
5106
|
if (!latlon || !Array.isArray(latlon) || latlon.length !== 2) {
|
|
4529
5107
|
return false;
|
|
4530
5108
|
}
|
|
5109
|
+
|
|
4531
5110
|
var _latlon = _slicedToArray(latlon, 2),
|
|
4532
|
-
|
|
4533
|
-
|
|
5111
|
+
lat = _latlon[0],
|
|
5112
|
+
lon = _latlon[1];
|
|
5113
|
+
|
|
4534
5114
|
if (!(0, types_1.isNumber)(lat) || !(lat >= exports.MIN_LATITUDE && lat <= exports.MAX_LATITUDE)) {
|
|
4535
5115
|
return false;
|
|
4536
5116
|
}
|
|
5117
|
+
|
|
4537
5118
|
if (!(0, types_1.isNumber)(lon) || !(lon >= exports.MIN_LONGITUDE && lon <= exports.MAX_LONGITUDE)) {
|
|
4538
5119
|
return false;
|
|
4539
5120
|
}
|
|
5121
|
+
|
|
4540
5122
|
return true;
|
|
4541
5123
|
};
|
|
5124
|
+
|
|
4542
5125
|
exports.isValidLatLon = isValidLatLon;
|
|
4543
5126
|
/**
|
|
4544
5127
|
* Returns a list of all lat or lon coordinates used in a specified layer
|
|
@@ -4546,10 +5129,12 @@ exports.isValidLatLon = isValidLatLon;
|
|
|
4546
5129
|
* @param {string} field
|
|
4547
5130
|
* @returns {number[]} list of lat coordinates or lon coordinates
|
|
4548
5131
|
*/
|
|
5132
|
+
|
|
4549
5133
|
var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
|
|
4550
5134
|
var getClusterValues = function getClusterValues(clusterLayer) {
|
|
4551
5135
|
return (0, lodash_1.get)(clusterLayer, field, []).slice(0, clusterLayer.type === LAYER_TYPE.Marker && clusterLayer.resultLimit ? clusterLayer.resultLimit : exports.DEFAULT_RESULT_LIMIT);
|
|
4552
5136
|
};
|
|
5137
|
+
|
|
4553
5138
|
var getChoroplethValues = function getChoroplethValues(choroplethLayer) {
|
|
4554
5139
|
var slicedGeomList = choroplethLayer.geom.slice(0, choroplethLayer.resultLimit);
|
|
4555
5140
|
var flatCoordinates = slicedGeomList.flatMap(function (geomObject) {
|
|
@@ -4559,6 +5144,7 @@ var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
|
|
|
4559
5144
|
return coord[field === LONGITUDE ? 0 : 1];
|
|
4560
5145
|
});
|
|
4561
5146
|
};
|
|
5147
|
+
|
|
4562
5148
|
return layer.type === LAYER_TYPE.Choropleth ? getChoroplethValues(layer) : getClusterValues(layer);
|
|
4563
5149
|
};
|
|
4564
5150
|
/**
|
|
@@ -4566,25 +5152,32 @@ var getLatOrLonCoordinates = function getLatOrLonCoordinates(layer, field) {
|
|
|
4566
5152
|
* @param {LayerType[]} layers
|
|
4567
5153
|
* @returns {LngLatBoundsLike}
|
|
4568
5154
|
*/
|
|
5155
|
+
|
|
5156
|
+
|
|
4569
5157
|
var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
|
|
4570
5158
|
var isLayerValid = function isLayerValid(field) {
|
|
4571
5159
|
return layers.every(function (layer) {
|
|
4572
5160
|
return layer[field] || layer.geom;
|
|
4573
5161
|
});
|
|
4574
5162
|
};
|
|
5163
|
+
|
|
4575
5164
|
var getDefaultMax = function getDefaultMax(field) {
|
|
4576
5165
|
return field === LONGITUDE ? exports.MAX_LONGITUDE : exports.MAX_LATITUDE;
|
|
4577
5166
|
};
|
|
5167
|
+
|
|
4578
5168
|
var getDefaultMin = function getDefaultMin(field) {
|
|
4579
5169
|
return field === LONGITUDE ? exports.MIN_LONGITUDE : exports.MIN_LATITUDE;
|
|
4580
5170
|
};
|
|
5171
|
+
|
|
4581
5172
|
if (!layers || !Array.isArray(layers) || !layers.length) {
|
|
4582
5173
|
return null;
|
|
4583
5174
|
}
|
|
5175
|
+
|
|
4584
5176
|
var getMin = function getMin(field) {
|
|
4585
5177
|
if (!isLayerValid(field)) {
|
|
4586
5178
|
return getDefaultMin(field);
|
|
4587
5179
|
}
|
|
5180
|
+
|
|
4588
5181
|
return layers.reduce(function (prevVal, layer) {
|
|
4589
5182
|
var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(function (x) {
|
|
4590
5183
|
return +x;
|
|
@@ -4592,32 +5185,41 @@ var getGlobalLayerBoundaries = function getGlobalLayerBoundaries(layers) {
|
|
|
4592
5185
|
return (0, lodash_1.min)([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
|
|
4593
5186
|
}, getDefaultMax(field));
|
|
4594
5187
|
};
|
|
5188
|
+
|
|
4595
5189
|
var getMax = function getMax(field) {
|
|
4596
5190
|
if (!isLayerValid(field)) {
|
|
4597
5191
|
return getDefaultMax(field);
|
|
4598
5192
|
}
|
|
5193
|
+
|
|
4599
5194
|
return layers.reduce(function (prevVal, layer) {
|
|
4600
5195
|
var coordinatesNumArr = getLatOrLonCoordinates(layer, field).map(Number);
|
|
4601
5196
|
return (0, lodash_1.max)([prevVal].concat(_toConsumableArray(coordinatesNumArr)));
|
|
4602
5197
|
}, getDefaultMin(field));
|
|
4603
5198
|
};
|
|
5199
|
+
|
|
4604
5200
|
return [[getMin(LONGITUDE), getMin(LATITUDE)], [getMax(LONGITUDE), getMax(LATITUDE)]];
|
|
4605
5201
|
};
|
|
5202
|
+
|
|
4606
5203
|
exports.getGlobalLayerBoundaries = getGlobalLayerBoundaries;
|
|
5204
|
+
|
|
4607
5205
|
var getScaledOpacities = function getScaledOpacities(colors, cfgOpacity) {
|
|
4608
5206
|
// extract opacity information from 8 digit hex codes
|
|
4609
5207
|
var opacities = colors === null || colors === void 0 ? void 0 : colors.map(function (color) {
|
|
4610
5208
|
var _a;
|
|
5209
|
+
|
|
4611
5210
|
return (color === null || color === void 0 ? void 0 : color.length) === 9 ? (_a = chroma(color).alpha()) !== null && _a !== void 0 ? _a : 1 : 1;
|
|
4612
|
-
});
|
|
4613
|
-
|
|
5211
|
+
}); // opacity cannot be greater than configured opacity
|
|
5212
|
+
|
|
4614
5213
|
return opacities === null || opacities === void 0 ? void 0 : opacities.map(function (opacity) {
|
|
4615
5214
|
return opacity * cfgOpacity;
|
|
4616
5215
|
});
|
|
4617
5216
|
};
|
|
5217
|
+
|
|
4618
5218
|
exports.getScaledOpacities = getScaledOpacities;
|
|
5219
|
+
|
|
4619
5220
|
var compareBaseStyles = function compareBaseStyles(curr, next) {
|
|
4620
5221
|
var _a, _b, _c, _d;
|
|
5222
|
+
|
|
4621
5223
|
var currBaseLayer = (_a = curr === null || curr === void 0 ? void 0 : curr.layers) === null || _a === void 0 ? void 0 : _a.find(function (layer) {
|
|
4622
5224
|
return (layer === null || layer === void 0 ? void 0 : layer.id) === 'base-layer';
|
|
4623
5225
|
});
|
|
@@ -4626,12 +5228,16 @@ var compareBaseStyles = function compareBaseStyles(curr, next) {
|
|
|
4626
5228
|
});
|
|
4627
5229
|
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 : '');
|
|
4628
5230
|
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 : '');
|
|
5231
|
+
|
|
4629
5232
|
if (!currBaseLayer || !nextBaseLayer || !currBaseSource || !nextBaseSource) {
|
|
4630
5233
|
return false;
|
|
4631
5234
|
}
|
|
5235
|
+
|
|
4632
5236
|
return (0, lodash_1.isEqual)(currBaseLayer, nextBaseLayer) && (0, lodash_1.isEqual)(currBaseSource, nextBaseSource);
|
|
4633
5237
|
};
|
|
5238
|
+
|
|
4634
5239
|
exports.compareBaseStyles = compareBaseStyles;
|
|
5240
|
+
|
|
4635
5241
|
var formatMetadata = function formatMetadata(choroplethLayer, i) {
|
|
4636
5242
|
if (!choroplethLayer || !choroplethLayer.areaIds || !choroplethLayer.areaValues) return {};
|
|
4637
5243
|
if (i >= choroplethLayer.areaIds.length) return {};
|
|
@@ -4648,22 +5254,16 @@ var formatMetadata = function formatMetadata(choroplethLayer, i) {
|
|
|
4648
5254
|
return Object.assign(Object.assign({}, result), _defineProperty({}, key, val));
|
|
4649
5255
|
}, base);
|
|
4650
5256
|
};
|
|
5257
|
+
|
|
4651
5258
|
exports.formatMetadata = formatMetadata;
|
|
4652
5259
|
|
|
4653
5260
|
/***/ }),
|
|
4654
5261
|
|
|
4655
|
-
/***/
|
|
5262
|
+
/***/ 93:
|
|
4656
5263
|
/***/ (function(module, exports) {
|
|
4657
5264
|
|
|
4658
5265
|
module.exports = require("d3-scale");
|
|
4659
5266
|
|
|
4660
|
-
/***/ }),
|
|
4661
|
-
|
|
4662
|
-
/***/ 94:
|
|
4663
|
-
/***/ (function(module, exports) {
|
|
4664
|
-
|
|
4665
|
-
module.exports = require("@splunk/visualization-encoding/utils/types");
|
|
4666
|
-
|
|
4667
5267
|
/***/ })
|
|
4668
5268
|
|
|
4669
5269
|
/******/ });
|