@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/MarkerGauge.js
CHANGED
|
@@ -136,7 +136,9 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
136
136
|
Object.defineProperty(exports, "__esModule", {
|
|
137
137
|
value: true
|
|
138
138
|
});
|
|
139
|
+
|
|
139
140
|
var i18n_1 = __webpack_require__(2);
|
|
141
|
+
|
|
140
142
|
var gauge = {
|
|
141
143
|
label: (0, i18n_1._)('Data display'),
|
|
142
144
|
layout: [[{
|
|
@@ -231,16 +233,16 @@ var MajorTickLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.te
|
|
|
231
233
|
});
|
|
232
234
|
var MajorTick = function MajorTick(_ref) {
|
|
233
235
|
var index = _ref.index,
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
236
|
+
x1 = _ref.x1,
|
|
237
|
+
y1 = _ref.y1,
|
|
238
|
+
x2 = _ref.x2,
|
|
239
|
+
y2 = _ref.y2,
|
|
240
|
+
showLabels = _ref.showLabels,
|
|
241
|
+
label = _ref.label,
|
|
242
|
+
labelX = _ref.labelX,
|
|
243
|
+
labelY = _ref.labelY,
|
|
244
|
+
majorTickStrokeColor = _ref.majorTickStrokeColor,
|
|
245
|
+
majorTickFillColor = _ref.majorTickFillColor;
|
|
244
246
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLine, {
|
|
245
247
|
index: index,
|
|
246
248
|
x1: x1,
|
|
@@ -270,7 +272,6 @@ MajorTick.propTypes = {
|
|
|
270
272
|
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
271
273
|
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
272
274
|
};
|
|
273
|
-
|
|
274
275
|
/**
|
|
275
276
|
* calculate position for each major tick
|
|
276
277
|
* @method positionMajorTick
|
|
@@ -284,20 +285,22 @@ MajorTick.propTypes = {
|
|
|
284
285
|
* @param {Number} input.i index of major tick
|
|
285
286
|
* @return {Object} MajorTick positions
|
|
286
287
|
*/
|
|
288
|
+
|
|
287
289
|
var positionMajorTick = function positionMajorTick(_ref2) {
|
|
288
290
|
var width = _ref2.width,
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
291
|
+
height = _ref2.height,
|
|
292
|
+
startX = _ref2.startX,
|
|
293
|
+
startY = _ref2.startY,
|
|
294
|
+
orientation = _ref2.orientation,
|
|
295
|
+
numOfTicks = _ref2.numOfTicks,
|
|
296
|
+
i = _ref2.i;
|
|
295
297
|
var x1 = startX;
|
|
296
298
|
var y1 = startY;
|
|
297
299
|
var x2 = startX;
|
|
298
300
|
var y2 = startY;
|
|
299
301
|
var labelX = startX;
|
|
300
302
|
var labelY;
|
|
303
|
+
|
|
301
304
|
if (orientation === 'vertical') {
|
|
302
305
|
var y = height / numOfTicks * (numOfTicks - i) + startY;
|
|
303
306
|
x1 -= TICK_LENGTH_DELTA;
|
|
@@ -315,6 +318,7 @@ var positionMajorTick = function positionMajorTick(_ref2) {
|
|
|
315
318
|
labelX = x;
|
|
316
319
|
labelY = y2 + 16;
|
|
317
320
|
}
|
|
321
|
+
|
|
318
322
|
return {
|
|
319
323
|
x1: x1,
|
|
320
324
|
y1: y1,
|
|
@@ -324,39 +328,43 @@ var positionMajorTick = function positionMajorTick(_ref2) {
|
|
|
324
328
|
labelY: labelY
|
|
325
329
|
};
|
|
326
330
|
};
|
|
331
|
+
|
|
327
332
|
var MajorTicks = function MajorTicks(_ref3) {
|
|
328
333
|
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
334
|
+
|
|
329
335
|
var width = props.width,
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
336
|
+
height = props.height,
|
|
337
|
+
startX = props.startX,
|
|
338
|
+
startY = props.startY,
|
|
339
|
+
min = props.min,
|
|
340
|
+
max = props.max,
|
|
341
|
+
majorUnit = props.majorUnit,
|
|
342
|
+
orientation = props.orientation,
|
|
343
|
+
showLabels = props.showLabels,
|
|
344
|
+
usePercentageRange = props.usePercentageRange,
|
|
345
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
346
|
+
majorTickStrokeColor = props.majorTickStrokeColor;
|
|
341
347
|
var range = max - min;
|
|
342
348
|
var numOfTicks = majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0 ? DEFAULT_NUM_OF_TICKS : range / majorUnit;
|
|
343
349
|
var majorTicks = [];
|
|
350
|
+
|
|
344
351
|
for (var i = 0; i <= numOfTicks; i += 1) {
|
|
345
352
|
var _positionMajorTick = positionMajorTick({
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
353
|
+
width: width,
|
|
354
|
+
height: height,
|
|
355
|
+
startX: startX,
|
|
356
|
+
startY: startY,
|
|
357
|
+
orientation: orientation,
|
|
358
|
+
numOfTicks: numOfTicks,
|
|
359
|
+
i: i
|
|
360
|
+
}),
|
|
361
|
+
x1 = _positionMajorTick.x1,
|
|
362
|
+
y1 = _positionMajorTick.y1,
|
|
363
|
+
x2 = _positionMajorTick.x2,
|
|
364
|
+
y2 = _positionMajorTick.y2,
|
|
365
|
+
labelX = _positionMajorTick.labelX,
|
|
366
|
+
labelY = _positionMajorTick.labelY;
|
|
367
|
+
|
|
360
368
|
var label = usePercentageRange ? "".concat(parseInt((i / numOfTicks - min / range) * 100, 10), "%") : parseInt(min + range / numOfTicks * i, 10);
|
|
361
369
|
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
362
370
|
key: i,
|
|
@@ -372,26 +380,28 @@ var MajorTicks = function MajorTicks(_ref3) {
|
|
|
372
380
|
majorTickFillColor: majorTickFillColor,
|
|
373
381
|
majorTickStrokeColor: majorTickStrokeColor
|
|
374
382
|
}));
|
|
375
|
-
}
|
|
383
|
+
} // if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
384
|
+
|
|
376
385
|
|
|
377
|
-
// if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
378
386
|
if (!Number.isInteger(numOfTicks)) {
|
|
379
387
|
var extraNumOfTicks = Math.ceil(numOfTicks);
|
|
388
|
+
|
|
380
389
|
var _positionMajorTick2 = positionMajorTick({
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
390
|
+
width: width,
|
|
391
|
+
height: height,
|
|
392
|
+
startX: startX,
|
|
393
|
+
startY: startY,
|
|
394
|
+
orientation: orientation,
|
|
395
|
+
numOfTicks: extraNumOfTicks,
|
|
396
|
+
i: extraNumOfTicks
|
|
397
|
+
}),
|
|
398
|
+
_x = _positionMajorTick2.x1,
|
|
399
|
+
_y = _positionMajorTick2.y1,
|
|
400
|
+
_x2 = _positionMajorTick2.x2,
|
|
401
|
+
_y2 = _positionMajorTick2.y2,
|
|
402
|
+
_labelX = _positionMajorTick2.labelX,
|
|
403
|
+
_labelY = _positionMajorTick2.labelY;
|
|
404
|
+
|
|
395
405
|
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
396
406
|
key: extraNumOfTicks,
|
|
397
407
|
id: extraNumOfTicks,
|
|
@@ -407,8 +417,10 @@ var MajorTicks = function MajorTicks(_ref3) {
|
|
|
407
417
|
majorTickStrokeColor: majorTickStrokeColor
|
|
408
418
|
}));
|
|
409
419
|
}
|
|
420
|
+
|
|
410
421
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, majorTicks);
|
|
411
422
|
};
|
|
423
|
+
|
|
412
424
|
MajorTicks.propTypes = {
|
|
413
425
|
width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
414
426
|
height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
@@ -481,7 +493,6 @@ var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.
|
|
|
481
493
|
})(["fill:", ";font-size:14px;font-family:Splunk Platform Sans,sans-serif;line-height:16px;text-anchor:middle;text-align:center;dominant-baseline:middle;"], function (props) {
|
|
482
494
|
return props.valueMarkerLabelFillColor;
|
|
483
495
|
});
|
|
484
|
-
|
|
485
496
|
/**
|
|
486
497
|
* calculate the path of Value Marker shape
|
|
487
498
|
* @method positionValueMarkerRect
|
|
@@ -492,13 +503,14 @@ var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.
|
|
|
492
503
|
* @param {Number} input.valueMarkerRectLength
|
|
493
504
|
* @return {String} d containing a series of path commands that define the path to be
|
|
494
505
|
*/
|
|
506
|
+
|
|
495
507
|
var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
496
508
|
var x = _ref.x,
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
509
|
+
y = _ref.y,
|
|
510
|
+
orientation = _ref.orientation,
|
|
511
|
+
valueMarkerRectLength = _ref.valueMarkerRectLength,
|
|
512
|
+
_ref$alignCenter = _ref.alignCenter,
|
|
513
|
+
alignCenter = _ref$alignCenter === void 0 ? false : _ref$alignCenter;
|
|
502
514
|
var hLength = MARKER_THICKNESS;
|
|
503
515
|
var vLength = valueMarkerRectLength;
|
|
504
516
|
var markerStartX = alignCenter ? x - MARKER_THICKNESS / 2 : x - MARKER_THICKNESS;
|
|
@@ -507,6 +519,7 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
507
519
|
var innerVLength = MARKER_INNER_LENGTH;
|
|
508
520
|
var innerStartX = markerStartX + innerHLength;
|
|
509
521
|
var innerStartY = markerStartY + 7;
|
|
522
|
+
|
|
510
523
|
if (orientation === 'vertical') {
|
|
511
524
|
hLength = valueMarkerRectLength;
|
|
512
525
|
vLength = MARKER_THICKNESS;
|
|
@@ -517,9 +530,9 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
517
530
|
innerStartX = markerStartX + 7;
|
|
518
531
|
innerStartY = markerStartY + innerVLength;
|
|
519
532
|
}
|
|
533
|
+
|
|
520
534
|
return "M".concat(markerStartX, ",").concat(markerStartY, "h").concat(hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(RADIUS, "v").concat(vLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(RADIUS, "h").concat(-hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(-RADIUS, "v").concat(2 * RADIUS - vLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(-RADIUS, "z") + "M".concat(innerStartX, ",").concat(innerStartY, "v").concat(innerVLength - RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(RADIUS, "h").concat(innerHLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(-RADIUS, "v").concat(RADIUS - innerVLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(-RADIUS, "h").concat(2 * RADIUS - innerHLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(RADIUS, "z");
|
|
521
535
|
};
|
|
522
|
-
|
|
523
536
|
/**
|
|
524
537
|
* calculate the position of value marker label
|
|
525
538
|
* @method positionLabel
|
|
@@ -534,20 +547,23 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
534
547
|
* @return {Number} positions.labelX x of value marker label text
|
|
535
548
|
* @return {Number} positions.labelY y of value marker label text
|
|
536
549
|
*/
|
|
550
|
+
|
|
537
551
|
var positionLabel = function positionLabel(_ref2) {
|
|
538
552
|
var x = _ref2.x,
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
553
|
+
y = _ref2.y,
|
|
554
|
+
length = _ref2.length,
|
|
555
|
+
orientation = _ref2.orientation,
|
|
556
|
+
_ref2$alignCenter = _ref2.alignCenter,
|
|
557
|
+
alignCenter = _ref2$alignCenter === void 0 ? false : _ref2$alignCenter; // for horizontal view
|
|
558
|
+
|
|
545
559
|
var labelRectX = alignCenter ? x - MARKER_LABEL_WIDTH / 2 : x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;
|
|
546
560
|
var labelRectY = y + length;
|
|
561
|
+
|
|
547
562
|
if (orientation === 'vertical') {
|
|
548
563
|
labelRectX = x + length;
|
|
549
564
|
labelRectY = alignCenter ? y - MARKER_LABEL_HEIGHT / 2 : y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;
|
|
550
565
|
}
|
|
566
|
+
|
|
551
567
|
var labelX = labelRectX + MARKER_LABEL_WIDTH / 2;
|
|
552
568
|
var labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;
|
|
553
569
|
return {
|
|
@@ -557,32 +573,36 @@ var positionLabel = function positionLabel(_ref2) {
|
|
|
557
573
|
labelY: labelY
|
|
558
574
|
};
|
|
559
575
|
};
|
|
576
|
+
|
|
560
577
|
var ValueMarker = function ValueMarker(_ref3) {
|
|
561
578
|
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
579
|
+
|
|
562
580
|
var x = props.x,
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
581
|
+
y = props.y,
|
|
582
|
+
length = props.length,
|
|
583
|
+
min = props.min,
|
|
584
|
+
max = props.max,
|
|
585
|
+
value = props.value,
|
|
586
|
+
orientation = props.orientation,
|
|
587
|
+
showValue = props.showValue,
|
|
588
|
+
usePercentageValue = props.usePercentageValue,
|
|
589
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
590
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor,
|
|
591
|
+
alignCenter = props.alignCenter;
|
|
574
592
|
var valueMarkerRectLength = length + DELTA_LENGTH;
|
|
593
|
+
|
|
575
594
|
var _positionLabel = positionLabel({
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
595
|
+
x: x,
|
|
596
|
+
y: y,
|
|
597
|
+
length: length,
|
|
598
|
+
orientation: orientation,
|
|
599
|
+
alignCenter: alignCenter
|
|
600
|
+
}),
|
|
601
|
+
labelRectX = _positionLabel.labelRectX,
|
|
602
|
+
labelRectY = _positionLabel.labelRectY,
|
|
603
|
+
labelX = _positionLabel.labelX,
|
|
604
|
+
labelY = _positionLabel.labelY;
|
|
605
|
+
|
|
586
606
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerRect, {
|
|
587
607
|
"data-test": "value-marker-rect",
|
|
588
608
|
d: positionValueMarkerRect({
|
|
@@ -612,6 +632,7 @@ var ValueMarker = function ValueMarker(_ref3) {
|
|
|
612
632
|
useTrendUnits: true
|
|
613
633
|
}))));
|
|
614
634
|
};
|
|
635
|
+
|
|
615
636
|
ValueMarker.propTypes = {
|
|
616
637
|
x: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
617
638
|
y: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
@@ -647,11 +668,17 @@ ValueMarker.defaultProps = {
|
|
|
647
668
|
Object.defineProperty(exports, "__esModule", {
|
|
648
669
|
value: true
|
|
649
670
|
});
|
|
671
|
+
|
|
650
672
|
var React = __webpack_require__(1);
|
|
673
|
+
|
|
651
674
|
var styled_components_1 = __webpack_require__(4);
|
|
675
|
+
|
|
652
676
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
677
|
+
|
|
653
678
|
var style_1 = __webpack_require__(14);
|
|
679
|
+
|
|
654
680
|
var colorUtils_1 = __webpack_require__(12);
|
|
681
|
+
|
|
655
682
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
656
683
|
var width = _ref.width;
|
|
657
684
|
return {
|
|
@@ -664,11 +691,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
664
691
|
componentId: "sc-1yhgpod-0"
|
|
665
692
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
666
693
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
667
|
-
});
|
|
668
|
-
|
|
694
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
695
|
+
|
|
669
696
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
670
697
|
var width = _ref2.width,
|
|
671
|
-
|
|
698
|
+
height = _ref2.height;
|
|
672
699
|
return {
|
|
673
700
|
style: Object.assign(Object.assign({}, width && {
|
|
674
701
|
width: (0, style_1.toPx)(width)
|
|
@@ -690,11 +717,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
690
717
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
691
718
|
componentId: "sc-1yhgpod-3"
|
|
692
719
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
720
|
+
|
|
693
721
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
694
722
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
695
723
|
var width = props.width,
|
|
696
|
-
|
|
697
|
-
|
|
724
|
+
height = props.height,
|
|
725
|
+
backgroundColor = props.backgroundColor;
|
|
726
|
+
|
|
698
727
|
if (!height) {
|
|
699
728
|
return React.createElement(Item, {
|
|
700
729
|
"data-test": "item",
|
|
@@ -702,24 +731,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
702
731
|
backgroundColor: backgroundColor
|
|
703
732
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
704
733
|
}
|
|
734
|
+
|
|
705
735
|
return React.createElement(FixSizeItem, {
|
|
706
736
|
"data-test": "fix-size-item",
|
|
707
|
-
"data-splunk-visualization-version": "26.
|
|
737
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
708
738
|
width: width,
|
|
709
739
|
height: height,
|
|
710
740
|
backgroundColor: backgroundColor
|
|
711
741
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
712
742
|
var newWidth = _ref3.width,
|
|
713
|
-
|
|
743
|
+
newHeight = _ref3.height;
|
|
714
744
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
715
745
|
width: newWidth,
|
|
716
746
|
height: newHeight
|
|
717
747
|
}));
|
|
718
748
|
})));
|
|
719
749
|
};
|
|
750
|
+
|
|
720
751
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
721
752
|
return FixedSizeContainer;
|
|
722
753
|
};
|
|
754
|
+
|
|
723
755
|
exports.default = withFixedSizeContainer;
|
|
724
756
|
|
|
725
757
|
/***/ }),
|
|
@@ -747,9 +779,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
747
779
|
* @param {DashboardVizType} props.Wrapper
|
|
748
780
|
* @param {DashboardVizType} props.Visualization
|
|
749
781
|
*/
|
|
782
|
+
|
|
750
783
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
751
784
|
var Wrapper = _ref.Wrapper,
|
|
752
|
-
|
|
785
|
+
Visualization = _ref.Visualization;
|
|
753
786
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
754
787
|
extendProperties.forEach(function (prop) {
|
|
755
788
|
if (Visualization[prop]) {
|
|
@@ -758,6 +791,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
758
791
|
}
|
|
759
792
|
});
|
|
760
793
|
};
|
|
794
|
+
|
|
761
795
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
762
796
|
|
|
763
797
|
/***/ }),
|
|
@@ -777,28 +811,40 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
777
811
|
|
|
778
812
|
var __rest = this && this.__rest || function (s, e) {
|
|
779
813
|
var t = {};
|
|
814
|
+
|
|
780
815
|
for (var p in s) {
|
|
781
816
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
782
817
|
}
|
|
818
|
+
|
|
783
819
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
784
820
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
785
821
|
}
|
|
786
822
|
return t;
|
|
787
823
|
};
|
|
824
|
+
|
|
788
825
|
Object.defineProperty(exports, "__esModule", {
|
|
789
826
|
value: true
|
|
790
827
|
});
|
|
791
828
|
exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
|
|
829
|
+
|
|
792
830
|
var lodash_1 = __webpack_require__(3);
|
|
831
|
+
|
|
793
832
|
var MarkerGauge_1 = __webpack_require__(428);
|
|
833
|
+
|
|
794
834
|
var config_1 = __webpack_require__(429);
|
|
835
|
+
|
|
795
836
|
exports.config = config_1.default;
|
|
796
|
-
|
|
837
|
+
|
|
838
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
839
|
+
|
|
797
840
|
var gaugeUtils_1 = __webpack_require__(98);
|
|
841
|
+
|
|
798
842
|
exports.PureMarkerGauge = MarkerGauge_1.default;
|
|
799
843
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
844
|
+
|
|
800
845
|
var computeVizProps = function computeVizProps(_a) {
|
|
801
846
|
var props = __rest(_a, []);
|
|
847
|
+
|
|
802
848
|
var options = (0, lodash_1.chain)(props).pick(validOptions).thru(gaugeUtils_1.convertToGaugeProperties).value();
|
|
803
849
|
var defaultColors = {
|
|
804
850
|
fillColor: config_1.default.themes.defaultFillColor(props),
|
|
@@ -809,6 +855,7 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
809
855
|
};
|
|
810
856
|
return Object.assign(Object.assign({}, options), defaultColors);
|
|
811
857
|
};
|
|
858
|
+
|
|
812
859
|
exports.computeVizProps = computeVizProps;
|
|
813
860
|
var viz = (0, withDashboardViz_1.default)({
|
|
814
861
|
ReactViz: MarkerGauge_1.default,
|
|
@@ -854,24 +901,33 @@ module.exports = require("@splunk/ui-utils/i18n");
|
|
|
854
901
|
|
|
855
902
|
|
|
856
903
|
var _toConsumableArray = __webpack_require__(8);
|
|
904
|
+
|
|
857
905
|
var _defineProperty = __webpack_require__(7);
|
|
906
|
+
|
|
858
907
|
var __rest = this && this.__rest || function (s, e) {
|
|
859
908
|
var t = {};
|
|
909
|
+
|
|
860
910
|
for (var p in s) {
|
|
861
911
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
862
912
|
}
|
|
913
|
+
|
|
863
914
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
864
915
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
865
916
|
}
|
|
866
917
|
return t;
|
|
867
918
|
};
|
|
919
|
+
|
|
868
920
|
Object.defineProperty(exports, "__esModule", {
|
|
869
921
|
value: true
|
|
870
922
|
});
|
|
871
923
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
924
|
+
|
|
872
925
|
var lodash_1 = __webpack_require__(3);
|
|
926
|
+
|
|
873
927
|
var schemaUtils_1 = __webpack_require__(16);
|
|
928
|
+
|
|
874
929
|
var VizBehavior_1 = __webpack_require__(6);
|
|
930
|
+
|
|
875
931
|
var dynamicOptionsDSLType = {
|
|
876
932
|
type: 'string',
|
|
877
933
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -881,20 +937,22 @@ var dynamicOptionsDSLType = {
|
|
|
881
937
|
* @param optionsSchema a visualization's options schema
|
|
882
938
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
883
939
|
*/
|
|
940
|
+
|
|
884
941
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
885
942
|
var enhancedOptionsSchema = {};
|
|
886
943
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
887
944
|
var _a = optionsSchema[key],
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
945
|
+
title = _a.title,
|
|
946
|
+
description = _a.description,
|
|
947
|
+
readOnly = _a.readOnly,
|
|
948
|
+
writeOnly = _a.writeOnly,
|
|
949
|
+
examples = _a.examples,
|
|
950
|
+
defaultValue = _a.default,
|
|
951
|
+
type = _a.type,
|
|
952
|
+
properties = _a.properties,
|
|
953
|
+
patternProperties = _a.patternProperties,
|
|
954
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
955
|
+
|
|
898
956
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
899
957
|
title: title
|
|
900
958
|
}), description !== undefined && {
|
|
@@ -908,12 +966,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
908
966
|
}), defaultValue !== undefined && {
|
|
909
967
|
default: defaultValue
|
|
910
968
|
});
|
|
969
|
+
|
|
911
970
|
if (type === 'object') {
|
|
912
971
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
913
972
|
type: type
|
|
914
973
|
}), properties && {
|
|
915
974
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
916
975
|
});
|
|
976
|
+
|
|
917
977
|
if (patternProperties) {
|
|
918
978
|
var enhancedPatternProperties = {};
|
|
919
979
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -931,6 +991,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
931
991
|
});
|
|
932
992
|
return enhancedOptionsSchema;
|
|
933
993
|
}
|
|
994
|
+
|
|
934
995
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
935
996
|
/**
|
|
936
997
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -939,11 +1000,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
939
1000
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
940
1001
|
* and containing `open: false` for all editor panels in editorConfig
|
|
941
1002
|
*/
|
|
1003
|
+
|
|
942
1004
|
function enhanceConfig(vizConfig) {
|
|
943
1005
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
1006
|
+
|
|
944
1007
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
945
1008
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
946
1009
|
}
|
|
1010
|
+
|
|
947
1011
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
948
1012
|
return Object.assign(Object.assign({}, config), {
|
|
949
1013
|
open: config.open || false
|
|
@@ -951,6 +1015,7 @@ function enhanceConfig(vizConfig) {
|
|
|
951
1015
|
});
|
|
952
1016
|
return enhancedConfig;
|
|
953
1017
|
}
|
|
1018
|
+
|
|
954
1019
|
exports.enhanceConfig = enhanceConfig;
|
|
955
1020
|
/**
|
|
956
1021
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -958,6 +1023,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
958
1023
|
* @param vizConfig a Visualization Config
|
|
959
1024
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
960
1025
|
*/
|
|
1026
|
+
|
|
961
1027
|
function uncollapseEditorConfig(vizConfig) {
|
|
962
1028
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
963
1029
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -967,13 +1033,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
967
1033
|
});
|
|
968
1034
|
return editorPanelUncollapsedConfig;
|
|
969
1035
|
}
|
|
1036
|
+
|
|
970
1037
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
1038
|
+
|
|
971
1039
|
function isDynamicOption(option) {
|
|
972
1040
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
973
1041
|
}
|
|
974
|
-
|
|
975
|
-
// private helpers to improve readability of getInitialPreset
|
|
1042
|
+
|
|
1043
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
976
1044
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
1045
|
+
|
|
977
1046
|
/**
|
|
978
1047
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
979
1048
|
* 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
|
|
@@ -982,6 +1051,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
982
1051
|
*
|
|
983
1052
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
984
1053
|
*/
|
|
1054
|
+
|
|
985
1055
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
986
1056
|
var presetContextKeys = Object.keys(presetContext);
|
|
987
1057
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -991,6 +1061,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
991
1061
|
/**
|
|
992
1062
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
993
1063
|
*/
|
|
1064
|
+
|
|
1065
|
+
|
|
994
1066
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
995
1067
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
996
1068
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -1005,18 +1077,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
1005
1077
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
1006
1078
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
1007
1079
|
*/
|
|
1080
|
+
|
|
1081
|
+
|
|
1008
1082
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
1009
1083
|
return presets.find(function (preset) {
|
|
1010
1084
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
1011
1085
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
1012
1086
|
var presetContextKeys = Object.keys(presetContext);
|
|
1013
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
1014
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1087
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
1015
1088
|
// if not, then the preset is invalid in config.ts
|
|
1089
|
+
|
|
1016
1090
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
1017
1091
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
1018
1092
|
});
|
|
1019
1093
|
}
|
|
1094
|
+
|
|
1020
1095
|
exports.getInitialPreset = getInitialPreset;
|
|
1021
1096
|
/**
|
|
1022
1097
|
* generates number precision values for a Select editor
|
|
@@ -1024,6 +1099,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
1024
1099
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
1025
1100
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
1026
1101
|
*/
|
|
1102
|
+
|
|
1027
1103
|
function generatePrecisionValues(numPrecisionValues) {
|
|
1028
1104
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
1029
1105
|
return {
|
|
@@ -1032,6 +1108,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
1032
1108
|
};
|
|
1033
1109
|
});
|
|
1034
1110
|
}
|
|
1111
|
+
|
|
1035
1112
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
1036
1113
|
/**
|
|
1037
1114
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -1041,12 +1118,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
1041
1118
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
1042
1119
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
1043
1120
|
*/
|
|
1121
|
+
|
|
1044
1122
|
var insertLayout = function insertLayout(layout, index) {
|
|
1045
1123
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
1046
1124
|
layoutItems[_key - 2] = arguments[_key];
|
|
1047
1125
|
}
|
|
1126
|
+
|
|
1048
1127
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
1049
1128
|
};
|
|
1129
|
+
|
|
1050
1130
|
exports.insertLayout = insertLayout;
|
|
1051
1131
|
|
|
1052
1132
|
/***/ }),
|
|
@@ -1124,11 +1204,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1124
1204
|
value: true
|
|
1125
1205
|
});
|
|
1126
1206
|
exports.shouldShowIconPlaceholder = void 0;
|
|
1207
|
+
|
|
1127
1208
|
var React = __webpack_require__(1);
|
|
1209
|
+
|
|
1128
1210
|
var T = __webpack_require__(0);
|
|
1211
|
+
|
|
1129
1212
|
var lodash_1 = __webpack_require__(3);
|
|
1213
|
+
|
|
1130
1214
|
var i18n_1 = __webpack_require__(2);
|
|
1215
|
+
|
|
1131
1216
|
var Message_1 = __webpack_require__(10);
|
|
1217
|
+
|
|
1132
1218
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1133
1219
|
/**
|
|
1134
1220
|
* @method shouldShowIconPlaceholder
|
|
@@ -1136,6 +1222,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
1136
1222
|
* @param {boolean} loading
|
|
1137
1223
|
* @returns {boolean}
|
|
1138
1224
|
*/
|
|
1225
|
+
|
|
1226
|
+
|
|
1139
1227
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1140
1228
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1141
1229
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -1144,6 +1232,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
1144
1232
|
var noFields = fields === undefined;
|
|
1145
1233
|
return loading || noData || noFields;
|
|
1146
1234
|
};
|
|
1235
|
+
|
|
1147
1236
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1148
1237
|
var propTypes = {
|
|
1149
1238
|
icon: T.func,
|
|
@@ -1158,11 +1247,13 @@ var propTypes = {
|
|
|
1158
1247
|
* @param {IconPlaceholderProps} props
|
|
1159
1248
|
* @returns {React.ReactElement}
|
|
1160
1249
|
*/
|
|
1250
|
+
|
|
1161
1251
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1162
1252
|
var width = props.width,
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1253
|
+
height = props.height,
|
|
1254
|
+
icon = props.icon,
|
|
1255
|
+
iconColor = props.iconColor;
|
|
1256
|
+
|
|
1166
1257
|
if (icon) {
|
|
1167
1258
|
return React.createElement(icon, {
|
|
1168
1259
|
style: {
|
|
@@ -1177,6 +1268,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1177
1268
|
height: '50%'
|
|
1178
1269
|
});
|
|
1179
1270
|
}
|
|
1271
|
+
|
|
1180
1272
|
return React.createElement(Message_1.default, {
|
|
1181
1273
|
width: width,
|
|
1182
1274
|
height: height,
|
|
@@ -1184,6 +1276,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1184
1276
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
1185
1277
|
});
|
|
1186
1278
|
};
|
|
1279
|
+
|
|
1187
1280
|
IconPlaceholder.propTypes = propTypes;
|
|
1188
1281
|
IconPlaceholder.defaultProps = {
|
|
1189
1282
|
width: '100%',
|
|
@@ -1200,21 +1293,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
1200
1293
|
|
|
1201
1294
|
|
|
1202
1295
|
var _defineProperty = __webpack_require__(7);
|
|
1296
|
+
|
|
1203
1297
|
Object.defineProperty(exports, "__esModule", {
|
|
1204
1298
|
value: true
|
|
1205
1299
|
});
|
|
1206
1300
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1301
|
+
|
|
1207
1302
|
var T = __webpack_require__(0);
|
|
1303
|
+
|
|
1208
1304
|
var lodash_1 = __webpack_require__(3);
|
|
1209
|
-
|
|
1305
|
+
|
|
1306
|
+
var DataSource_1 = __webpack_require__(34);
|
|
1307
|
+
|
|
1210
1308
|
exports.SortParamsPropTypes = T.shape({
|
|
1211
1309
|
currentSortKey: T.string,
|
|
1212
1310
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
1213
1311
|
onSort: T.func
|
|
1214
1312
|
});
|
|
1313
|
+
|
|
1215
1314
|
var getSortingParams = function getSortingParams(_ref) {
|
|
1216
1315
|
var requestParams = _ref.requestParams,
|
|
1217
|
-
|
|
1316
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1218
1317
|
var currentSortKey;
|
|
1219
1318
|
var currentSortDir;
|
|
1220
1319
|
var nextSortDirMap = {
|
|
@@ -1223,15 +1322,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1223
1322
|
none: 'asc'
|
|
1224
1323
|
};
|
|
1225
1324
|
var onSort;
|
|
1325
|
+
|
|
1226
1326
|
if (typeof onRequestParamsChange === 'function') {
|
|
1227
1327
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
1228
1328
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
1229
1329
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1330
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1331
|
+
|
|
1332
|
+
|
|
1232
1333
|
onSort = function onSort(e, _ref2) {
|
|
1233
1334
|
var sortKey = _ref2.sortKey,
|
|
1234
|
-
|
|
1335
|
+
sortDir = _ref2.sortDir;
|
|
1336
|
+
|
|
1235
1337
|
if (typeof sortKey === 'string') {
|
|
1236
1338
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1237
1339
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -1243,12 +1345,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1243
1345
|
}
|
|
1244
1346
|
};
|
|
1245
1347
|
}
|
|
1348
|
+
|
|
1246
1349
|
return {
|
|
1247
1350
|
currentSortKey: currentSortKey,
|
|
1248
1351
|
currentSortDir: currentSortDir,
|
|
1249
1352
|
onSort: onSort
|
|
1250
1353
|
};
|
|
1251
1354
|
};
|
|
1355
|
+
|
|
1252
1356
|
exports.getSortingParams = getSortingParams;
|
|
1253
1357
|
|
|
1254
1358
|
/***/ }),
|
|
@@ -1259,43 +1363,69 @@ exports.getSortingParams = getSortingParams;
|
|
|
1259
1363
|
"use strict";
|
|
1260
1364
|
|
|
1261
1365
|
|
|
1366
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1367
|
+
value: true
|
|
1368
|
+
});
|
|
1369
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
1370
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1371
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
1372
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
1373
|
+
|
|
1374
|
+
/***/ }),
|
|
1375
|
+
|
|
1376
|
+
/***/ 35:
|
|
1377
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1378
|
+
|
|
1379
|
+
"use strict";
|
|
1380
|
+
|
|
1381
|
+
|
|
1262
1382
|
Object.defineProperty(exports, "__esModule", {
|
|
1263
1383
|
value: true
|
|
1264
1384
|
});
|
|
1265
1385
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1386
|
+
|
|
1266
1387
|
var T = __webpack_require__(0);
|
|
1388
|
+
|
|
1267
1389
|
var lodash_1 = __webpack_require__(3);
|
|
1390
|
+
|
|
1268
1391
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
1269
1392
|
isPaging: T.bool,
|
|
1270
1393
|
current: T.number,
|
|
1271
1394
|
totalPages: T.number,
|
|
1272
1395
|
onChange: T.func
|
|
1273
1396
|
});
|
|
1397
|
+
|
|
1274
1398
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
1275
1399
|
var requestParams = _ref.requestParams,
|
|
1276
|
-
|
|
1277
|
-
|
|
1400
|
+
meta = _ref.meta,
|
|
1401
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1278
1402
|
var totalCount = meta && meta.totalCount || 0;
|
|
1279
1403
|
var offset = requestParams && requestParams.offset || 0;
|
|
1280
1404
|
var count = requestParams && requestParams.count;
|
|
1281
1405
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
1282
1406
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
1283
1407
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
1408
|
+
|
|
1284
1409
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1285
1410
|
var page = _ref2.page,
|
|
1286
|
-
|
|
1411
|
+
countArg = _ref2.count;
|
|
1287
1412
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1413
|
+
|
|
1288
1414
|
if (typeof countArg === 'number') {
|
|
1289
1415
|
newParams.count = countArg;
|
|
1290
1416
|
newParams.offset = 0;
|
|
1291
1417
|
}
|
|
1418
|
+
|
|
1292
1419
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1420
|
+
|
|
1293
1421
|
if (typeof page === 'number' && page > 0) {
|
|
1294
1422
|
newParams.count = pageCount;
|
|
1295
1423
|
newParams.offset = (page - 1) * pageCount;
|
|
1296
1424
|
}
|
|
1425
|
+
|
|
1297
1426
|
onRequestParamsChange(newParams);
|
|
1298
1427
|
};
|
|
1428
|
+
|
|
1299
1429
|
return {
|
|
1300
1430
|
isPaging: isPaging,
|
|
1301
1431
|
current: current,
|
|
@@ -1303,11 +1433,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1303
1433
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
1304
1434
|
};
|
|
1305
1435
|
};
|
|
1436
|
+
|
|
1306
1437
|
exports.getPaginationParams = getPaginationParams;
|
|
1307
1438
|
|
|
1308
1439
|
/***/ }),
|
|
1309
1440
|
|
|
1310
|
-
/***/
|
|
1441
|
+
/***/ 36:
|
|
1311
1442
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1312
1443
|
|
|
1313
1444
|
"use strict";
|
|
@@ -1318,6 +1449,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1318
1449
|
});
|
|
1319
1450
|
exports.VizCategory = void 0;
|
|
1320
1451
|
var VizCategory;
|
|
1452
|
+
|
|
1321
1453
|
(function (VizCategory) {
|
|
1322
1454
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1323
1455
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -1335,67 +1467,96 @@ var VizCategory;
|
|
|
1335
1467
|
|
|
1336
1468
|
/***/ }),
|
|
1337
1469
|
|
|
1338
|
-
/***/
|
|
1470
|
+
/***/ 37:
|
|
1339
1471
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1340
1472
|
|
|
1341
1473
|
"use strict";
|
|
1342
1474
|
|
|
1343
1475
|
|
|
1344
1476
|
var _slicedToArray = __webpack_require__(17);
|
|
1477
|
+
|
|
1345
1478
|
Object.defineProperty(exports, "__esModule", {
|
|
1346
1479
|
value: true
|
|
1347
1480
|
});
|
|
1481
|
+
|
|
1348
1482
|
var React = __webpack_require__(1);
|
|
1483
|
+
|
|
1349
1484
|
var lodash_1 = __webpack_require__(3);
|
|
1350
|
-
|
|
1485
|
+
|
|
1486
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
1487
|
+
|
|
1351
1488
|
var Options_1 = __webpack_require__(30);
|
|
1352
|
-
|
|
1489
|
+
|
|
1490
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
1491
|
+
|
|
1353
1492
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
1354
|
-
|
|
1493
|
+
|
|
1494
|
+
var moment_1 = __webpack_require__(40);
|
|
1495
|
+
|
|
1355
1496
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1497
|
+
|
|
1356
1498
|
var styled_components_1 = __webpack_require__(4);
|
|
1499
|
+
|
|
1357
1500
|
var hocUtils_1 = __webpack_require__(27);
|
|
1501
|
+
|
|
1358
1502
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1359
|
-
|
|
1503
|
+
|
|
1504
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
1505
|
+
|
|
1360
1506
|
var id_1 = __webpack_require__(25);
|
|
1361
|
-
|
|
1507
|
+
|
|
1508
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
1509
|
+
|
|
1362
1510
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1511
|
+
|
|
1363
1512
|
var getSorting_1 = __webpack_require__(33);
|
|
1364
|
-
|
|
1513
|
+
|
|
1514
|
+
var getPagination_1 = __webpack_require__(35);
|
|
1515
|
+
|
|
1365
1516
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
1517
|
+
|
|
1366
1518
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
1519
|
+
|
|
1367
1520
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
1521
|
+
|
|
1368
1522
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
1369
1523
|
/**
|
|
1370
1524
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1371
1525
|
* @param {DashboardVizOpts} opts
|
|
1372
1526
|
* @returns {HOC}
|
|
1373
1527
|
*/
|
|
1528
|
+
|
|
1529
|
+
|
|
1374
1530
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
1375
1531
|
var ReactViz = opts.ReactViz,
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1532
|
+
vizConfig = opts.vizConfig,
|
|
1533
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
1534
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1535
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
1536
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1537
|
+
|
|
1381
1538
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1382
1539
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1540
|
+
|
|
1383
1541
|
var DashboardViz = function DashboardViz(props) {
|
|
1384
1542
|
var _a;
|
|
1543
|
+
|
|
1385
1544
|
var mode = props.mode,
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1545
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
1546
|
+
dataSources = props.dataSources,
|
|
1547
|
+
options = props.options,
|
|
1548
|
+
_props$context = props.context,
|
|
1549
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
1550
|
+
width = props.width,
|
|
1551
|
+
height = props.height,
|
|
1552
|
+
onComputedProps = props.onComputedProps,
|
|
1553
|
+
onEventTrigger = props.onEventTrigger,
|
|
1554
|
+
theme = props.theme,
|
|
1555
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1556
|
+
|
|
1397
1557
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
1398
|
-
|
|
1558
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1559
|
+
|
|
1399
1560
|
if (serializedTimezone) {
|
|
1400
1561
|
/*
|
|
1401
1562
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -1409,38 +1570,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1409
1570
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
1410
1571
|
}
|
|
1411
1572
|
}
|
|
1573
|
+
|
|
1412
1574
|
var themeFunc = function themeFunc(themeVar) {
|
|
1413
1575
|
var _a, _b;
|
|
1576
|
+
|
|
1414
1577
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
1415
1578
|
};
|
|
1579
|
+
|
|
1416
1580
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1581
|
+
|
|
1417
1582
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1583
|
+
theme: theme
|
|
1584
|
+
}),
|
|
1585
|
+
currentThemeFamily = _ref.family,
|
|
1586
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1587
|
+
currentThemeDensity = _ref.density;
|
|
1588
|
+
|
|
1423
1589
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1590
|
+
|
|
1424
1591
|
var _React$useState = React.useState({}),
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1592
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1593
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1594
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1595
|
+
|
|
1596
|
+
|
|
1428
1597
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1598
|
+
|
|
1429
1599
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1430
|
-
|
|
1431
|
-
|
|
1600
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1601
|
+
visualizationID = _React$useState4[0];
|
|
1602
|
+
|
|
1432
1603
|
var _React$useState5 = React.useState({}),
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1604
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1605
|
+
dataSourcesInState = _React$useState6[0],
|
|
1606
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1607
|
+
|
|
1436
1608
|
var _React$useState7 = React.useState(),
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1609
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1610
|
+
dataFramesInState = _React$useState8[0],
|
|
1611
|
+
setDataFramesInState = _React$useState8[1];
|
|
1612
|
+
|
|
1440
1613
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1614
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1615
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1616
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1617
|
+
|
|
1444
1618
|
var isMounted = React.useRef(true);
|
|
1445
1619
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1446
1620
|
try {
|
|
@@ -1465,11 +1639,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1465
1639
|
});
|
|
1466
1640
|
} else {
|
|
1467
1641
|
var dataFrames = dataFramesInState;
|
|
1642
|
+
|
|
1468
1643
|
if (dataSources !== dataSourcesInState) {
|
|
1469
1644
|
setDataSourcesInState(dataSources);
|
|
1470
1645
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
1471
1646
|
setDataFramesInState(dataFrames);
|
|
1472
1647
|
}
|
|
1648
|
+
|
|
1473
1649
|
return Options_1.Options.evaluate({
|
|
1474
1650
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1475
1651
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -1480,21 +1656,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1480
1656
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
1481
1657
|
return {};
|
|
1482
1658
|
}
|
|
1659
|
+
|
|
1483
1660
|
return {};
|
|
1484
1661
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
1485
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
1486
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1662
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
1487
1663
|
// 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
|
|
1488
1664
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1665
|
+
|
|
1489
1666
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
1490
1667
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1668
|
+
|
|
1491
1669
|
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) {
|
|
1492
1670
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
1493
1671
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
1494
1672
|
});
|
|
1495
|
-
}
|
|
1496
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1673
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
1497
1674
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1675
|
+
|
|
1676
|
+
|
|
1498
1677
|
React.useEffect(function () {
|
|
1499
1678
|
onComputedProps(clonedEvaluatedOptions);
|
|
1500
1679
|
});
|
|
@@ -1504,44 +1683,49 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1504
1683
|
isMounted.current = false;
|
|
1505
1684
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1506
1685
|
}
|
|
1507
|
-
};
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
// present warning message if any required props are missing
|
|
1686
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1687
|
+
}, []); // present warning message if any required props are missing
|
|
1688
|
+
|
|
1511
1689
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1512
|
-
|
|
1513
|
-
|
|
1690
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1691
|
+
supports = vizConfig.supports;
|
|
1514
1692
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1693
|
+
|
|
1515
1694
|
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
|
|
1516
1695
|
) {
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1696
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1697
|
+
"data-test": "missing-props-message",
|
|
1698
|
+
width: width,
|
|
1699
|
+
height: height,
|
|
1700
|
+
missingProps: missing,
|
|
1701
|
+
backgroundColor: bgColorFromTheme
|
|
1702
|
+
});
|
|
1703
|
+
} // events
|
|
1704
|
+
|
|
1705
|
+
|
|
1526
1706
|
var eventCallbackProps = {};
|
|
1707
|
+
|
|
1527
1708
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1528
1709
|
var supportedEvents = vizConfig.events;
|
|
1529
1710
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1530
1711
|
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1531
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1532
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1712
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1533
1713
|
// then remove these lines
|
|
1714
|
+
|
|
1534
1715
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1535
1716
|
var payload = {};
|
|
1717
|
+
|
|
1536
1718
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1537
1719
|
payloadKeys.forEach(function (p) {
|
|
1538
1720
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1539
1721
|
});
|
|
1540
1722
|
}
|
|
1723
|
+
|
|
1541
1724
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1542
1725
|
if (ev && ev.payload) {
|
|
1543
1726
|
payload = ev.payload;
|
|
1544
1727
|
}
|
|
1728
|
+
|
|
1545
1729
|
return onEventTrigger({
|
|
1546
1730
|
originalEvent: ev,
|
|
1547
1731
|
payload: payload,
|
|
@@ -1549,8 +1733,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1549
1733
|
});
|
|
1550
1734
|
};
|
|
1551
1735
|
});
|
|
1552
|
-
}
|
|
1553
|
-
|
|
1736
|
+
} // compute pure viz props which are not from options
|
|
1737
|
+
|
|
1738
|
+
|
|
1554
1739
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1555
1740
|
themeFunc: themeFunc
|
|
1556
1741
|
}));
|
|
@@ -1568,15 +1753,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1568
1753
|
* In future, we could automatically detect which all datasources are being used
|
|
1569
1754
|
* and bind those magically to pagination/sorting behavior.
|
|
1570
1755
|
*/
|
|
1756
|
+
|
|
1571
1757
|
var dataSourceMetadata = {};
|
|
1572
1758
|
var OptionKey = 'paginateDataSourceKey';
|
|
1573
1759
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1760
|
+
|
|
1574
1761
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1575
1762
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1576
1763
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1764
|
+
|
|
1577
1765
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1578
1766
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1579
1767
|
};
|
|
1768
|
+
|
|
1580
1769
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1581
1770
|
requestParams: requestParams,
|
|
1582
1771
|
meta: meta,
|
|
@@ -1591,115 +1780,132 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1591
1780
|
sortParams: sortParams,
|
|
1592
1781
|
paginatorParams: paginatorParams
|
|
1593
1782
|
};
|
|
1594
|
-
}
|
|
1595
|
-
|
|
1783
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1784
|
+
|
|
1785
|
+
|
|
1596
1786
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1597
1787
|
return null;
|
|
1598
1788
|
}
|
|
1789
|
+
|
|
1599
1790
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1600
1791
|
mode: mode,
|
|
1601
1792
|
width: width,
|
|
1602
1793
|
height: height
|
|
1603
1794
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1604
1795
|
};
|
|
1796
|
+
|
|
1605
1797
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1606
1798
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1607
1799
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1608
1800
|
theme: {}
|
|
1609
|
-
});
|
|
1610
|
-
|
|
1611
|
-
DashboardViz.config = vizConfig;
|
|
1612
|
-
|
|
1801
|
+
}); // attach viz config
|
|
1802
|
+
|
|
1803
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1804
|
+
|
|
1613
1805
|
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1614
1806
|
};
|
|
1807
|
+
|
|
1615
1808
|
exports.default = withDashboardViz;
|
|
1616
1809
|
|
|
1617
1810
|
/***/ }),
|
|
1618
1811
|
|
|
1619
|
-
/***/
|
|
1812
|
+
/***/ 38:
|
|
1620
1813
|
/***/ (function(module, exports) {
|
|
1621
1814
|
|
|
1622
1815
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1623
1816
|
|
|
1624
1817
|
/***/ }),
|
|
1625
1818
|
|
|
1626
|
-
/***/
|
|
1819
|
+
/***/ 39:
|
|
1627
1820
|
/***/ (function(module, exports) {
|
|
1628
1821
|
|
|
1629
1822
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1630
1823
|
|
|
1631
1824
|
/***/ }),
|
|
1632
1825
|
|
|
1633
|
-
/***/
|
|
1826
|
+
/***/ 4:
|
|
1634
1827
|
/***/ (function(module, exports) {
|
|
1635
1828
|
|
|
1636
|
-
module.exports = require("
|
|
1829
|
+
module.exports = require("styled-components");
|
|
1637
1830
|
|
|
1638
1831
|
/***/ }),
|
|
1639
1832
|
|
|
1640
|
-
/***/
|
|
1833
|
+
/***/ 40:
|
|
1641
1834
|
/***/ (function(module, exports) {
|
|
1642
1835
|
|
|
1643
|
-
module.exports = require("
|
|
1836
|
+
module.exports = require("@splunk/moment");
|
|
1644
1837
|
|
|
1645
1838
|
/***/ }),
|
|
1646
1839
|
|
|
1647
|
-
/***/
|
|
1840
|
+
/***/ 41:
|
|
1648
1841
|
/***/ (function(module, exports) {
|
|
1649
1842
|
|
|
1650
1843
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1651
1844
|
|
|
1652
1845
|
/***/ }),
|
|
1653
1846
|
|
|
1654
|
-
/***/
|
|
1847
|
+
/***/ 42:
|
|
1655
1848
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1656
1849
|
|
|
1657
1850
|
"use strict";
|
|
1658
1851
|
|
|
1659
1852
|
|
|
1660
1853
|
var _classCallCheck = __webpack_require__(9);
|
|
1854
|
+
|
|
1661
1855
|
Object.defineProperty(exports, "__esModule", {
|
|
1662
1856
|
value: true
|
|
1663
1857
|
});
|
|
1664
1858
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1665
1859
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1860
|
+
|
|
1666
1861
|
var T = __webpack_require__(0);
|
|
1862
|
+
|
|
1667
1863
|
var lodash_1 = __webpack_require__(3);
|
|
1668
|
-
|
|
1669
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1864
|
+
|
|
1865
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1866
|
+
|
|
1867
|
+
|
|
1670
1868
|
exports.INITIAL_WIDTH = 250;
|
|
1671
1869
|
exports.INITIAL_HEIGHT = 250;
|
|
1672
1870
|
/**
|
|
1673
1871
|
* A Splunk visualization
|
|
1674
1872
|
*/
|
|
1873
|
+
|
|
1675
1874
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1676
1875
|
_classCallCheck(this, SplunkVisualization);
|
|
1677
1876
|
};
|
|
1877
|
+
|
|
1678
1878
|
SplunkVisualization.propTypes = {
|
|
1679
1879
|
/**
|
|
1680
1880
|
* display mode
|
|
1681
1881
|
*/
|
|
1682
1882
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1883
|
+
|
|
1683
1884
|
/**
|
|
1684
1885
|
* width in pixel or string, defaults to 100%
|
|
1685
1886
|
*/
|
|
1686
1887
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1888
|
+
|
|
1687
1889
|
/**
|
|
1688
1890
|
* height in pixel or string
|
|
1689
1891
|
*/
|
|
1690
1892
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1893
|
+
|
|
1691
1894
|
/**
|
|
1692
1895
|
* visualization context used for dynamic option evaluation
|
|
1693
1896
|
*/
|
|
1694
1897
|
context: T.object,
|
|
1898
|
+
|
|
1695
1899
|
/**
|
|
1696
1900
|
* visualization formatting options
|
|
1697
1901
|
*/
|
|
1698
1902
|
options: T.object,
|
|
1903
|
+
|
|
1699
1904
|
/**
|
|
1700
1905
|
* A callback to update formatting options
|
|
1701
1906
|
*/
|
|
1702
1907
|
onOptionsChange: T.func,
|
|
1908
|
+
|
|
1703
1909
|
/**
|
|
1704
1910
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1705
1911
|
*/
|
|
@@ -1708,6 +1914,7 @@ SplunkVisualization.propTypes = {
|
|
|
1708
1914
|
* current request params
|
|
1709
1915
|
*/
|
|
1710
1916
|
requestParams: T.object,
|
|
1917
|
+
|
|
1711
1918
|
/**
|
|
1712
1919
|
* current dataset
|
|
1713
1920
|
*/
|
|
@@ -1715,6 +1922,7 @@ SplunkVisualization.propTypes = {
|
|
|
1715
1922
|
fields: T.array,
|
|
1716
1923
|
columns: T.array
|
|
1717
1924
|
}),
|
|
1925
|
+
|
|
1718
1926
|
/**
|
|
1719
1927
|
* error
|
|
1720
1928
|
*/
|
|
@@ -1722,29 +1930,35 @@ SplunkVisualization.propTypes = {
|
|
|
1722
1930
|
level: T.string,
|
|
1723
1931
|
message: T.string
|
|
1724
1932
|
}),
|
|
1933
|
+
|
|
1725
1934
|
/**
|
|
1726
1935
|
* meta data that came with the dataset
|
|
1727
1936
|
*/
|
|
1728
1937
|
meta: T.object
|
|
1729
1938
|
})),
|
|
1939
|
+
|
|
1730
1940
|
/**
|
|
1731
1941
|
* A callback to trigger event
|
|
1732
1942
|
*/
|
|
1733
1943
|
onEventTrigger: T.func,
|
|
1944
|
+
|
|
1734
1945
|
/**
|
|
1735
1946
|
* Inform viz if there are handlers listening to events
|
|
1736
1947
|
*/
|
|
1737
1948
|
hasEventHandlers: T.bool,
|
|
1949
|
+
|
|
1738
1950
|
/**
|
|
1739
1951
|
* A callback to communicate computed props to a consumer
|
|
1740
1952
|
*/
|
|
1741
1953
|
onComputedProps: T.func,
|
|
1954
|
+
|
|
1742
1955
|
/**
|
|
1743
1956
|
* A callback to obtain visualization api
|
|
1744
1957
|
*/
|
|
1745
1958
|
vizActionHandlerRef: T.func,
|
|
1746
1959
|
loading: T.bool,
|
|
1747
1960
|
theme: T.object,
|
|
1961
|
+
|
|
1748
1962
|
/**
|
|
1749
1963
|
* A callback to request new data with updated request params
|
|
1750
1964
|
*/
|
|
@@ -1753,6 +1967,7 @@ SplunkVisualization.propTypes = {
|
|
|
1753
1967
|
/**
|
|
1754
1968
|
*
|
|
1755
1969
|
*/
|
|
1970
|
+
|
|
1756
1971
|
SplunkVisualization.defaultProps = {
|
|
1757
1972
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1758
1973
|
width: '100%',
|
|
@@ -1781,39 +1996,6 @@ exports.default = SplunkVisualization;
|
|
|
1781
1996
|
|
|
1782
1997
|
/***/ }),
|
|
1783
1998
|
|
|
1784
|
-
/***/ 42:
|
|
1785
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1786
|
-
|
|
1787
|
-
"use strict";
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
var _classCallCheck = __webpack_require__(9);
|
|
1791
|
-
var _createClass = __webpack_require__(18);
|
|
1792
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1793
|
-
value: true
|
|
1794
|
-
});
|
|
1795
|
-
exports.DefaultVizActionHandler = void 0;
|
|
1796
|
-
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1797
|
-
function DefaultVizActionHandler() {
|
|
1798
|
-
_classCallCheck(this, DefaultVizActionHandler);
|
|
1799
|
-
}
|
|
1800
|
-
_createClass(DefaultVizActionHandler, [{
|
|
1801
|
-
key: "focus",
|
|
1802
|
-
value: function focus() {
|
|
1803
|
-
// noop
|
|
1804
|
-
}
|
|
1805
|
-
}, {
|
|
1806
|
-
key: "snapshot",
|
|
1807
|
-
value: function snapshot() {
|
|
1808
|
-
return null; // noop
|
|
1809
|
-
}
|
|
1810
|
-
}]);
|
|
1811
|
-
return DefaultVizActionHandler;
|
|
1812
|
-
}();
|
|
1813
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1814
|
-
|
|
1815
|
-
/***/ }),
|
|
1816
|
-
|
|
1817
1999
|
/***/ 427:
|
|
1818
2000
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1819
2001
|
|
|
@@ -1823,6 +2005,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1823
2005
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1824
2006
|
if (k2 === undefined) k2 = k;
|
|
1825
2007
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
2008
|
+
|
|
1826
2009
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1827
2010
|
desc = {
|
|
1828
2011
|
enumerable: true,
|
|
@@ -1831,22 +2014,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
1831
2014
|
}
|
|
1832
2015
|
};
|
|
1833
2016
|
}
|
|
2017
|
+
|
|
1834
2018
|
Object.defineProperty(o, k2, desc);
|
|
1835
2019
|
} : function (o, m, k, k2) {
|
|
1836
2020
|
if (k2 === undefined) k2 = k;
|
|
1837
2021
|
o[k2] = m[k];
|
|
1838
2022
|
});
|
|
2023
|
+
|
|
1839
2024
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1840
2025
|
for (var p in m) {
|
|
1841
2026
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1842
2027
|
}
|
|
1843
2028
|
};
|
|
2029
|
+
|
|
1844
2030
|
Object.defineProperty(exports, "__esModule", {
|
|
1845
2031
|
value: true
|
|
1846
2032
|
});
|
|
1847
2033
|
exports.default = void 0;
|
|
2034
|
+
|
|
1848
2035
|
__exportStar(__webpack_require__(162), exports);
|
|
2036
|
+
|
|
1849
2037
|
var MarkerGauge_1 = __webpack_require__(162);
|
|
2038
|
+
|
|
1850
2039
|
Object.defineProperty(exports, "default", {
|
|
1851
2040
|
enumerable: true,
|
|
1852
2041
|
get: function get() {
|
|
@@ -1864,30 +2053,47 @@ Object.defineProperty(exports, "default", {
|
|
|
1864
2053
|
|
|
1865
2054
|
var __rest = this && this.__rest || function (s, e) {
|
|
1866
2055
|
var t = {};
|
|
2056
|
+
|
|
1867
2057
|
for (var p in s) {
|
|
1868
2058
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1869
2059
|
}
|
|
2060
|
+
|
|
1870
2061
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1871
2062
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1872
2063
|
}
|
|
1873
2064
|
return t;
|
|
1874
2065
|
};
|
|
2066
|
+
|
|
1875
2067
|
Object.defineProperty(exports, "__esModule", {
|
|
1876
2068
|
value: true
|
|
1877
2069
|
});
|
|
2070
|
+
|
|
1878
2071
|
var React = __webpack_require__(1);
|
|
2072
|
+
|
|
1879
2073
|
var react_1 = __webpack_require__(1);
|
|
2074
|
+
|
|
1880
2075
|
var T = __webpack_require__(0);
|
|
2076
|
+
|
|
1881
2077
|
var styled_components_1 = __webpack_require__(4);
|
|
2078
|
+
|
|
1882
2079
|
var lodash_1 = __webpack_require__(3);
|
|
2080
|
+
|
|
1883
2081
|
var i18n_1 = __webpack_require__(2);
|
|
2082
|
+
|
|
1884
2083
|
var style_1 = __webpack_require__(14);
|
|
2084
|
+
|
|
1885
2085
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
2086
|
+
|
|
1886
2087
|
var Message_1 = __webpack_require__(10);
|
|
2088
|
+
|
|
1887
2089
|
var id_1 = __webpack_require__(25);
|
|
2090
|
+
|
|
1888
2091
|
var gaugeUtils_1 = __webpack_require__(98);
|
|
2092
|
+
|
|
1889
2093
|
var GaugeMajorTicks_1 = __webpack_require__(127);
|
|
2094
|
+
|
|
1890
2095
|
var GaugeValueMarker_1 = __webpack_require__(128);
|
|
2096
|
+
|
|
1891
2097
|
var MAX_VERTICAL_CONTAINER_WIDTH = 200;
|
|
1892
2098
|
var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
|
|
1893
2099
|
var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
|
|
@@ -1932,27 +2138,30 @@ var MarkerBar = styled_components_1.default.rect.attrs({
|
|
|
1932
2138
|
displayName: "MarkerGauge__MarkerBar",
|
|
1933
2139
|
componentId: "sc-10z02va-5"
|
|
1934
2140
|
})([""]);
|
|
2141
|
+
|
|
1935
2142
|
var MarkerGauge = function MarkerGauge(_a) {
|
|
1936
2143
|
var props = __rest(_a, []);
|
|
2144
|
+
|
|
1937
2145
|
var width = props.width,
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
1942
|
-
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1948
|
-
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
2146
|
+
height = props.height,
|
|
2147
|
+
value = props.value,
|
|
2148
|
+
orientation = props.orientation,
|
|
2149
|
+
majorUnit = props.majorUnit,
|
|
2150
|
+
showLabels = props.showLabels,
|
|
2151
|
+
showValue = props.showValue,
|
|
2152
|
+
usePercentageRange = props.usePercentageRange,
|
|
2153
|
+
usePercentageValue = props.usePercentageValue,
|
|
2154
|
+
backgroundColor = props.backgroundColor,
|
|
2155
|
+
fillColor = props.fillColor,
|
|
2156
|
+
ranges = props.ranges,
|
|
2157
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
2158
|
+
majorTickStrokeColor = props.majorTickStrokeColor,
|
|
2159
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
2160
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
1953
2161
|
/**
|
|
1954
2162
|
* Standard error message render
|
|
1955
2163
|
*/
|
|
2164
|
+
|
|
1956
2165
|
var errorMessage = (0, react_1.useCallback)(function (containerWidth, containerHeight, err, errID) {
|
|
1957
2166
|
return React.createElement(Message_1.default, {
|
|
1958
2167
|
width: containerWidth,
|
|
@@ -1968,17 +2177,20 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
1968
2177
|
/**
|
|
1969
2178
|
* Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
|
|
1970
2179
|
*/
|
|
2180
|
+
|
|
1971
2181
|
var error = (0, react_1.useMemo)(function () {
|
|
1972
2182
|
return (0, gaugeUtils_1.validateRanges)(ranges);
|
|
1973
2183
|
}, [ranges]);
|
|
1974
2184
|
var sortedRanges = (0, react_1.useMemo)(function () {
|
|
1975
2185
|
return (0, gaugeUtils_1.getSortedRanges)(ranges);
|
|
1976
2186
|
}, [ranges]);
|
|
2187
|
+
|
|
1977
2188
|
var _ref = (0, react_1.useMemo)(function () {
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
2189
|
+
return (0, gaugeUtils_1.getGaugeRange)(sortedRanges);
|
|
2190
|
+
}, [sortedRanges]),
|
|
2191
|
+
min = _ref.min,
|
|
2192
|
+
max = _ref.max;
|
|
2193
|
+
|
|
1982
2194
|
var linearGradientId = (0, react_1.useMemo)(function () {
|
|
1983
2195
|
return (0, id_1.createDOMID)('marker');
|
|
1984
2196
|
}, []);
|
|
@@ -1987,11 +2199,13 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
1987
2199
|
ranges: sortedRanges,
|
|
1988
2200
|
orientation: orientation
|
|
1989
2201
|
});
|
|
2202
|
+
|
|
1990
2203
|
var _ref2 = (0, gaugeUtils_1.getGradientDimensions)(orientation),
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
2204
|
+
x1 = _ref2.x1,
|
|
2205
|
+
y1 = _ref2.y1,
|
|
2206
|
+
x2 = _ref2.x2,
|
|
2207
|
+
y2 = _ref2.y2;
|
|
2208
|
+
|
|
1995
2209
|
var linearGradientStops = stops.map(function (stop) {
|
|
1996
2210
|
return React.createElement("stop", {
|
|
1997
2211
|
key: "".concat(stop.offset, "_").concat(stop.stopColor),
|
|
@@ -2010,42 +2224,46 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2010
2224
|
/**
|
|
2011
2225
|
* Calculate marker gauge dimensions
|
|
2012
2226
|
*/
|
|
2227
|
+
|
|
2013
2228
|
var calculateMarkerGaugeDimensions = (0, react_1.useCallback)(function (containerWidth, containerHeight) {
|
|
2014
2229
|
var _ref3 = (0, gaugeUtils_1.getGaugeDimensions)({
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2230
|
+
containerWidth: containerWidth,
|
|
2231
|
+
containerHeight: containerHeight,
|
|
2232
|
+
orientation: orientation
|
|
2233
|
+
}),
|
|
2234
|
+
gaugeLength = _ref3.gaugeLength,
|
|
2235
|
+
gaugeStartX = _ref3.gaugeStartX,
|
|
2236
|
+
gaugeStartY = _ref3.gaugeStartY,
|
|
2237
|
+
gaugeWidth = _ref3.gaugeWidth,
|
|
2238
|
+
gaugeHeight = _ref3.gaugeHeight;
|
|
2239
|
+
|
|
2024
2240
|
var _ref4 = (0, gaugeUtils_1.getMarkerBarDimensions)({
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2241
|
+
gaugeLength: gaugeLength,
|
|
2242
|
+
gaugeStartX: gaugeStartX,
|
|
2243
|
+
gaugeStartY: gaugeStartY,
|
|
2244
|
+
gaugeWidth: gaugeWidth,
|
|
2245
|
+
gaugeHeight: gaugeHeight,
|
|
2246
|
+
orientation: orientation
|
|
2247
|
+
}),
|
|
2248
|
+
markerBarLength = _ref4.markerBarLength,
|
|
2249
|
+
markerBarX = _ref4.markerBarX,
|
|
2250
|
+
markerBarY = _ref4.markerBarY,
|
|
2251
|
+
markerBarWidth = _ref4.markerBarWidth,
|
|
2252
|
+
markerBarHeight = _ref4.markerBarHeight;
|
|
2253
|
+
|
|
2037
2254
|
var _ref5 = (0, gaugeUtils_1.getMarkerGaugeValueMarkerPositions)({
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2255
|
+
markerBarX: markerBarX,
|
|
2256
|
+
markerBarY: markerBarY,
|
|
2257
|
+
markerBarHeight: markerBarHeight,
|
|
2258
|
+
markerBarLength: markerBarLength,
|
|
2259
|
+
orientation: orientation,
|
|
2260
|
+
value: value,
|
|
2261
|
+
min: min,
|
|
2262
|
+
max: max
|
|
2263
|
+
}),
|
|
2264
|
+
valueMarkerX = _ref5.valueMarkerX,
|
|
2265
|
+
valueMarkerY = _ref5.valueMarkerY;
|
|
2266
|
+
|
|
2049
2267
|
return {
|
|
2050
2268
|
markerBarX: markerBarX,
|
|
2051
2269
|
markerBarY: markerBarY,
|
|
@@ -2061,26 +2279,30 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2061
2279
|
}, [orientation, value, min, max]);
|
|
2062
2280
|
var renderVisualization = (0, react_1.useCallback)(function (_ref6) {
|
|
2063
2281
|
var containerWidth = _ref6.width,
|
|
2064
|
-
|
|
2282
|
+
containerHeight = _ref6.height;
|
|
2283
|
+
|
|
2065
2284
|
// todo: need change the size when get design for smaller space
|
|
2066
2285
|
// 58 is the title & description header height in dashboard visualization
|
|
2067
2286
|
if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
|
|
2068
2287
|
return errorMessage(containerWidth, containerHeight, (0, i18n_1._)('Too small to render content'), errorId);
|
|
2069
2288
|
}
|
|
2289
|
+
|
|
2070
2290
|
if (error) {
|
|
2071
2291
|
return errorMessage(containerWidth, containerHeight, error, errorId);
|
|
2072
2292
|
}
|
|
2293
|
+
|
|
2073
2294
|
var _calculateMarkerGauge = calculateMarkerGaugeDimensions(containerWidth, containerHeight),
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2295
|
+
markerBarX = _calculateMarkerGauge.markerBarX,
|
|
2296
|
+
markerBarY = _calculateMarkerGauge.markerBarY,
|
|
2297
|
+
markerBarWidth = _calculateMarkerGauge.markerBarWidth,
|
|
2298
|
+
markerBarHeight = _calculateMarkerGauge.markerBarHeight,
|
|
2299
|
+
valueMarkerX = _calculateMarkerGauge.valueMarkerX,
|
|
2300
|
+
valueMarkerY = _calculateMarkerGauge.valueMarkerY,
|
|
2301
|
+
gaugeStartX = _calculateMarkerGauge.gaugeStartX,
|
|
2302
|
+
gaugeStartY = _calculateMarkerGauge.gaugeStartY,
|
|
2303
|
+
gaugeWidth = _calculateMarkerGauge.gaugeWidth,
|
|
2304
|
+
gaugeHeight = _calculateMarkerGauge.gaugeHeight;
|
|
2305
|
+
|
|
2084
2306
|
return React.createElement(MarkerGaugeWrapper, {
|
|
2085
2307
|
backgroundColor: backgroundColor
|
|
2086
2308
|
}, React.createElement(MarkerGaugeContainer, {
|
|
@@ -2137,6 +2359,7 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2137
2359
|
return renderVisualization(containerDimension);
|
|
2138
2360
|
}));
|
|
2139
2361
|
};
|
|
2362
|
+
|
|
2140
2363
|
MarkerGauge.propTypes = {
|
|
2141
2364
|
width: T.oneOfType([T.string, T.number]),
|
|
2142
2365
|
height: T.oneOfType([T.string, T.number]),
|
|
@@ -2203,17 +2426,29 @@ exports.default = MarkerGauge;
|
|
|
2203
2426
|
Object.defineProperty(exports, "__esModule", {
|
|
2204
2427
|
value: true
|
|
2205
2428
|
});
|
|
2429
|
+
|
|
2206
2430
|
var i18n_1 = __webpack_require__(2);
|
|
2431
|
+
|
|
2207
2432
|
var GaugeMarker_1 = __webpack_require__(430);
|
|
2433
|
+
|
|
2208
2434
|
var placeholders_1 = __webpack_require__(50);
|
|
2435
|
+
|
|
2209
2436
|
var schemaUtils_1 = __webpack_require__(16);
|
|
2437
|
+
|
|
2210
2438
|
var variables_1 = __webpack_require__(11);
|
|
2439
|
+
|
|
2211
2440
|
var pick_1 = __webpack_require__(23);
|
|
2441
|
+
|
|
2212
2442
|
var Gauge_1 = __webpack_require__(126);
|
|
2443
|
+
|
|
2213
2444
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2214
|
-
|
|
2445
|
+
|
|
2446
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
2447
|
+
|
|
2215
2448
|
var configUtils_1 = __webpack_require__(20);
|
|
2449
|
+
|
|
2216
2450
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
2451
|
+
|
|
2217
2452
|
var dataContract = {
|
|
2218
2453
|
requiredDataSources: [{
|
|
2219
2454
|
name: 'primary',
|
|
@@ -2326,12 +2561,13 @@ var themes = {
|
|
|
2326
2561
|
enterprise: {
|
|
2327
2562
|
light: variables_1.default.gray30(props),
|
|
2328
2563
|
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
2329
|
-
},
|
|
2330
2564
|
|
|
2565
|
+
},
|
|
2331
2566
|
prisma: {
|
|
2332
2567
|
// TODO: missed colors :(
|
|
2333
2568
|
light: variables_1.default.neutral100(props),
|
|
2334
2569
|
dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
|
|
2570
|
+
|
|
2335
2571
|
}
|
|
2336
2572
|
})(props);
|
|
2337
2573
|
},
|
|
@@ -2392,6 +2628,7 @@ var editorConfig = [{
|
|
|
2392
2628
|
editorProps: {
|
|
2393
2629
|
openRanges: false,
|
|
2394
2630
|
isTogglable: false // Can not disable thresholds
|
|
2631
|
+
|
|
2395
2632
|
}
|
|
2396
2633
|
}], (0, BackgroundColor_1.default)({
|
|
2397
2634
|
themes: themes,
|
|
@@ -2401,16 +2638,19 @@ var editorConfig = [{
|
|
|
2401
2638
|
/**
|
|
2402
2639
|
* visualization configuration
|
|
2403
2640
|
*/
|
|
2641
|
+
|
|
2404
2642
|
var config = {
|
|
2405
2643
|
/**
|
|
2406
2644
|
* unique viz key
|
|
2407
2645
|
*/
|
|
2408
2646
|
key: 'splunk.markergauge',
|
|
2647
|
+
|
|
2409
2648
|
/**
|
|
2410
2649
|
* viz name
|
|
2411
2650
|
*/
|
|
2412
2651
|
name: (0, i18n_1._)('Marker gauge'),
|
|
2413
2652
|
category: VizCategory_1.VizCategory.GAUGE,
|
|
2653
|
+
|
|
2414
2654
|
/**
|
|
2415
2655
|
* viz icon
|
|
2416
2656
|
*/
|
|
@@ -2434,11 +2674,35 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
|
2434
2674
|
"use strict";
|
|
2435
2675
|
|
|
2436
2676
|
|
|
2677
|
+
var _classCallCheck = __webpack_require__(9);
|
|
2678
|
+
|
|
2679
|
+
var _createClass = __webpack_require__(18);
|
|
2680
|
+
|
|
2437
2681
|
Object.defineProperty(exports, "__esModule", {
|
|
2438
2682
|
value: true
|
|
2439
2683
|
});
|
|
2440
|
-
exports.
|
|
2441
|
-
|
|
2684
|
+
exports.DefaultVizActionHandler = void 0;
|
|
2685
|
+
|
|
2686
|
+
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
2687
|
+
function DefaultVizActionHandler() {
|
|
2688
|
+
_classCallCheck(this, DefaultVizActionHandler);
|
|
2689
|
+
}
|
|
2690
|
+
|
|
2691
|
+
_createClass(DefaultVizActionHandler, [{
|
|
2692
|
+
key: "focus",
|
|
2693
|
+
value: function focus() {// noop
|
|
2694
|
+
}
|
|
2695
|
+
}, {
|
|
2696
|
+
key: "snapshot",
|
|
2697
|
+
value: function snapshot() {
|
|
2698
|
+
return null; // noop
|
|
2699
|
+
}
|
|
2700
|
+
}]);
|
|
2701
|
+
|
|
2702
|
+
return DefaultVizActionHandler;
|
|
2703
|
+
}();
|
|
2704
|
+
|
|
2705
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
2442
2706
|
|
|
2443
2707
|
/***/ }),
|
|
2444
2708
|
|
|
@@ -2459,7 +2723,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2459
2723
|
value: true
|
|
2460
2724
|
});
|
|
2461
2725
|
exports.useDeepMemo = void 0;
|
|
2726
|
+
|
|
2462
2727
|
var react_1 = __webpack_require__(1);
|
|
2728
|
+
|
|
2463
2729
|
var lodash_1 = __webpack_require__(3);
|
|
2464
2730
|
/**
|
|
2465
2731
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -2474,16 +2740,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
2474
2740
|
* @param fn the function to be executed and
|
|
2475
2741
|
* @param dependencies an array of dependencies
|
|
2476
2742
|
*/
|
|
2743
|
+
|
|
2744
|
+
|
|
2477
2745
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
2478
2746
|
var ref = (0, react_1.useRef)();
|
|
2747
|
+
|
|
2479
2748
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
2480
2749
|
ref.current = {
|
|
2481
2750
|
dependencies: dependencies,
|
|
2482
2751
|
value: fn()
|
|
2483
2752
|
};
|
|
2484
2753
|
}
|
|
2754
|
+
|
|
2485
2755
|
return ref.current.value;
|
|
2486
2756
|
};
|
|
2757
|
+
|
|
2487
2758
|
exports.useDeepMemo = useDeepMemo;
|
|
2488
2759
|
|
|
2489
2760
|
/***/ }),
|
|
@@ -2498,19 +2769,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2498
2769
|
value: true
|
|
2499
2770
|
});
|
|
2500
2771
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
2772
|
+
|
|
2501
2773
|
var React = __webpack_require__(1);
|
|
2774
|
+
|
|
2502
2775
|
var T = __webpack_require__(0);
|
|
2776
|
+
|
|
2503
2777
|
var i18n_1 = __webpack_require__(2);
|
|
2778
|
+
|
|
2504
2779
|
var Message_1 = __webpack_require__(10);
|
|
2780
|
+
|
|
2505
2781
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
2506
2782
|
/**
|
|
2507
2783
|
* @method isMissing
|
|
2508
2784
|
* @param {any} v
|
|
2509
2785
|
* @returns {boolean} true if the input value === null or undefined
|
|
2510
2786
|
*/
|
|
2787
|
+
|
|
2788
|
+
|
|
2511
2789
|
var isMissing = function isMissing(v) {
|
|
2512
2790
|
return v === null || v === undefined;
|
|
2513
2791
|
};
|
|
2792
|
+
|
|
2514
2793
|
exports.isMissing = isMissing;
|
|
2515
2794
|
/**
|
|
2516
2795
|
* @method misskingKeys
|
|
@@ -2518,11 +2797,13 @@ exports.isMissing = isMissing;
|
|
|
2518
2797
|
* @param {object} target
|
|
2519
2798
|
* @returns {string[]} the keys of missing required props
|
|
2520
2799
|
*/
|
|
2800
|
+
|
|
2521
2801
|
var missingKeys = function missingKeys(keys, target) {
|
|
2522
2802
|
return keys.filter(function (k) {
|
|
2523
2803
|
return (0, exports.isMissing)(target[k]);
|
|
2524
2804
|
});
|
|
2525
2805
|
};
|
|
2806
|
+
|
|
2526
2807
|
exports.missingKeys = missingKeys;
|
|
2527
2808
|
var propTypes = {
|
|
2528
2809
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -2536,10 +2817,11 @@ var propTypes = {
|
|
|
2536
2817
|
* @param {MissingPropsProps} props
|
|
2537
2818
|
* @returns {React.ReactElement}
|
|
2538
2819
|
*/
|
|
2820
|
+
|
|
2539
2821
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
2540
2822
|
var width = props.width,
|
|
2541
|
-
|
|
2542
|
-
|
|
2823
|
+
height = props.height,
|
|
2824
|
+
missingProps = props.missingProps;
|
|
2543
2825
|
return React.createElement(Message_1.default, {
|
|
2544
2826
|
"data-test": "message",
|
|
2545
2827
|
width: width,
|
|
@@ -2547,6 +2829,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
2547
2829
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
2548
2830
|
});
|
|
2549
2831
|
};
|
|
2832
|
+
|
|
2550
2833
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
2551
2834
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
2552
2835
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -2566,15 +2849,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
2566
2849
|
Object.defineProperty(exports, "__esModule", {
|
|
2567
2850
|
value: true
|
|
2568
2851
|
});
|
|
2852
|
+
|
|
2569
2853
|
var React = __webpack_require__(1);
|
|
2854
|
+
|
|
2570
2855
|
var styled_components_1 = __webpack_require__(4);
|
|
2856
|
+
|
|
2571
2857
|
var hocUtils_1 = __webpack_require__(15);
|
|
2858
|
+
|
|
2572
2859
|
var Cover = styled_components_1.default.div.withConfig({
|
|
2573
2860
|
displayName: "withEditModeCover__Cover",
|
|
2574
2861
|
componentId: "sc-1gsbnxb-0"
|
|
2575
2862
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
2576
2863
|
var Blocker = styled_components_1.default.div.attrs({
|
|
2577
|
-
'data-splunk-visualization-version': "26.
|
|
2864
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
2578
2865
|
}).withConfig({
|
|
2579
2866
|
displayName: "withEditModeCover__Blocker",
|
|
2580
2867
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -2585,6 +2872,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
2585
2872
|
* @param {ExtendedDashViz} Visualization
|
|
2586
2873
|
* @returns {ExtendedDashViz} Wrapper
|
|
2587
2874
|
*/
|
|
2875
|
+
|
|
2588
2876
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
2589
2877
|
var Wrapper = function Wrapper(props) {
|
|
2590
2878
|
var mode = props.mode;
|
|
@@ -2593,12 +2881,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
2593
2881
|
"data-test": "edit-mode-cover"
|
|
2594
2882
|
}));
|
|
2595
2883
|
};
|
|
2884
|
+
|
|
2596
2885
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2597
2886
|
Wrapper: Wrapper,
|
|
2598
2887
|
Visualization: Visualization
|
|
2599
2888
|
});
|
|
2600
2889
|
return Wrapper;
|
|
2601
2890
|
};
|
|
2891
|
+
|
|
2602
2892
|
exports.default = withEditModeCover;
|
|
2603
2893
|
|
|
2604
2894
|
/***/ }),
|
|
@@ -2612,27 +2902,37 @@ exports.default = withEditModeCover;
|
|
|
2612
2902
|
Object.defineProperty(exports, "__esModule", {
|
|
2613
2903
|
value: true
|
|
2614
2904
|
});
|
|
2905
|
+
|
|
2615
2906
|
var React = __webpack_require__(1);
|
|
2907
|
+
|
|
2616
2908
|
var colorUtils_1 = __webpack_require__(12);
|
|
2909
|
+
|
|
2617
2910
|
var variables_1 = __webpack_require__(11);
|
|
2911
|
+
|
|
2618
2912
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
2913
|
+
|
|
2619
2914
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2915
|
+
|
|
2620
2916
|
var hocUtils_1 = __webpack_require__(15);
|
|
2917
|
+
|
|
2621
2918
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
2622
2919
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
2623
2920
|
var config = Visualization.config;
|
|
2624
2921
|
var themes = config.themes;
|
|
2922
|
+
|
|
2625
2923
|
var Wrapper = function Wrapper(props) {
|
|
2626
2924
|
var _a, _b;
|
|
2925
|
+
|
|
2627
2926
|
var dataSources = props.dataSources,
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2927
|
+
loading = props.loading,
|
|
2928
|
+
options = props.options,
|
|
2929
|
+
height = props.height,
|
|
2930
|
+
width = props.width;
|
|
2632
2931
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
2633
2932
|
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);
|
|
2634
2933
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
2635
2934
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
2935
|
+
|
|
2636
2936
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
2637
2937
|
return React.createElement(IconPlaceholder_1.default, {
|
|
2638
2938
|
"data-test": "icon-placeholder",
|
|
@@ -2643,14 +2943,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2643
2943
|
iconColor: iconColor
|
|
2644
2944
|
});
|
|
2645
2945
|
}
|
|
2946
|
+
|
|
2646
2947
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
2647
2948
|
};
|
|
2949
|
+
|
|
2648
2950
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2649
2951
|
Wrapper: Wrapper,
|
|
2650
2952
|
Visualization: Visualization
|
|
2651
2953
|
});
|
|
2652
2954
|
return Wrapper;
|
|
2653
2955
|
};
|
|
2956
|
+
|
|
2654
2957
|
exports.default = withPlaceholder;
|
|
2655
2958
|
|
|
2656
2959
|
/***/ }),
|
|
@@ -2685,11 +2988,13 @@ module.exports = require("@splunk/visualization-icons/placeholders");
|
|
|
2685
2988
|
Object.defineProperty(exports, "__esModule", {
|
|
2686
2989
|
value: true
|
|
2687
2990
|
});
|
|
2991
|
+
|
|
2688
2992
|
var i18n_1 = __webpack_require__(2);
|
|
2993
|
+
|
|
2689
2994
|
var background = function background(_ref) {
|
|
2690
2995
|
var label = _ref.label,
|
|
2691
|
-
|
|
2692
|
-
|
|
2996
|
+
themes = _ref.themes,
|
|
2997
|
+
labelPosition = _ref.labelPosition;
|
|
2693
2998
|
return [{
|
|
2694
2999
|
label: (0, i18n_1._)(label || 'Background'),
|
|
2695
3000
|
option: 'backgroundColor',
|
|
@@ -2700,6 +3005,7 @@ var background = function background(_ref) {
|
|
|
2700
3005
|
}
|
|
2701
3006
|
}];
|
|
2702
3007
|
};
|
|
3008
|
+
|
|
2703
3009
|
exports.default = background;
|
|
2704
3010
|
|
|
2705
3011
|
/***/ }),
|
|
@@ -2715,6 +3021,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2715
3021
|
});
|
|
2716
3022
|
exports.VizBehavior = void 0;
|
|
2717
3023
|
var VizBehavior;
|
|
3024
|
+
|
|
2718
3025
|
(function (VizBehavior) {
|
|
2719
3026
|
/**
|
|
2720
3027
|
* Dynamic Options Behavior.
|
|
@@ -2734,6 +3041,7 @@ var VizBehavior;
|
|
|
2734
3041
|
* missing.
|
|
2735
3042
|
* @type {string}
|
|
2736
3043
|
*/
|
|
3044
|
+
|
|
2737
3045
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
2738
3046
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
2739
3047
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -2769,13 +3077,18 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
|
2769
3077
|
|
|
2770
3078
|
|
|
2771
3079
|
var _toConsumableArray = __webpack_require__(8);
|
|
3080
|
+
|
|
2772
3081
|
Object.defineProperty(exports, "__esModule", {
|
|
2773
3082
|
value: true
|
|
2774
3083
|
});
|
|
2775
3084
|
exports.convertToGaugeProperties = exports.mapValueLabelDisplay = exports.mapToOldKey = exports.getGradientDimensions = exports.getGradientStops = exports.getGradientStopColors = exports.getGradientStopOffsets = exports.getGaugeRange = exports.validateRanges = exports.getSortedRanges = exports.getMarkerGaugeValueMarkerPositions = exports.getMarkerBarDimensions = exports.getFillerGaugeValueMarkerPositions = exports.getFillBarDimensions = exports.getGaugeBarHeight = exports.getGaugeBarWidth = exports.getGaugeBarStartPositions = exports.getGaugeBarLength = exports.assignGaugeColor = exports.getGaugeDimensions = exports.getGaugeStartPosition = exports.getGaugeLength = exports.getGaugeHeight = exports.getGaugeWidth = exports.FILL_THICKNESS = exports.GAUGE_THICKNESS = void 0;
|
|
3085
|
+
|
|
2776
3086
|
var lodash_1 = __webpack_require__(3);
|
|
3087
|
+
|
|
2777
3088
|
var colorConstants_1 = __webpack_require__(49);
|
|
3089
|
+
|
|
2778
3090
|
var i18n_1 = __webpack_require__(2);
|
|
3091
|
+
|
|
2779
3092
|
exports.GAUGE_THICKNESS = 50;
|
|
2780
3093
|
exports.FILL_THICKNESS = 38;
|
|
2781
3094
|
var GRADIENT_STOP_OFFSET_MIN = 0;
|
|
@@ -2788,11 +3101,13 @@ var GRADIENT_STOP_OFFSET_MAX = 100;
|
|
|
2788
3101
|
* @param {String} orientation
|
|
2789
3102
|
* @return {Number} width
|
|
2790
3103
|
*/
|
|
3104
|
+
|
|
2791
3105
|
var getGaugeWidth = function getGaugeWidth(_ref) {
|
|
2792
3106
|
var containerWidth = _ref.containerWidth,
|
|
2793
|
-
|
|
3107
|
+
orientation = _ref.orientation;
|
|
2794
3108
|
return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
|
|
2795
3109
|
};
|
|
3110
|
+
|
|
2796
3111
|
exports.getGaugeWidth = getGaugeWidth;
|
|
2797
3112
|
/**
|
|
2798
3113
|
* get height for the whole gauge viz for horizontal or vertical view
|
|
@@ -2802,11 +3117,13 @@ exports.getGaugeWidth = getGaugeWidth;
|
|
|
2802
3117
|
* @param {String} orientation
|
|
2803
3118
|
* @return {Number} height
|
|
2804
3119
|
*/
|
|
3120
|
+
|
|
2805
3121
|
var getGaugeHeight = function getGaugeHeight(_ref2) {
|
|
2806
3122
|
var containerHeight = _ref2.containerHeight,
|
|
2807
|
-
|
|
3123
|
+
orientation = _ref2.orientation;
|
|
2808
3124
|
return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
|
|
2809
3125
|
};
|
|
3126
|
+
|
|
2810
3127
|
exports.getGaugeHeight = getGaugeHeight;
|
|
2811
3128
|
/**
|
|
2812
3129
|
* get how long the gauge shoud be.
|
|
@@ -2818,10 +3135,11 @@ exports.getGaugeHeight = getGaugeHeight;
|
|
|
2818
3135
|
* @param {String} input.orientation
|
|
2819
3136
|
* @return {Number} gaugeLength
|
|
2820
3137
|
*/
|
|
3138
|
+
|
|
2821
3139
|
var getGaugeLength = function getGaugeLength(_ref3) {
|
|
2822
3140
|
var containerWidth = _ref3.containerWidth,
|
|
2823
|
-
|
|
2824
|
-
|
|
3141
|
+
containerHeight = _ref3.containerHeight,
|
|
3142
|
+
orientation = _ref3.orientation;
|
|
2825
3143
|
return orientation === 'vertical' ? (0, exports.getGaugeHeight)({
|
|
2826
3144
|
containerHeight: containerHeight,
|
|
2827
3145
|
orientation: orientation
|
|
@@ -2830,6 +3148,7 @@ var getGaugeLength = function getGaugeLength(_ref3) {
|
|
|
2830
3148
|
orientation: orientation
|
|
2831
3149
|
});
|
|
2832
3150
|
};
|
|
3151
|
+
|
|
2833
3152
|
exports.getGaugeLength = getGaugeLength;
|
|
2834
3153
|
/**
|
|
2835
3154
|
* get start x and y for rendering gauge
|
|
@@ -2843,23 +3162,27 @@ exports.getGaugeLength = getGaugeLength;
|
|
|
2843
3162
|
* @return {Number} position.gaugeStartX
|
|
2844
3163
|
* @return {Number} position.gaugeStartY
|
|
2845
3164
|
*/
|
|
3165
|
+
|
|
2846
3166
|
var getGaugeStartPosition = function getGaugeStartPosition(_ref4) {
|
|
2847
3167
|
var containerWidth = _ref4.containerWidth,
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
3168
|
+
containerHeight = _ref4.containerHeight,
|
|
3169
|
+
gaugeLength = _ref4.gaugeLength,
|
|
3170
|
+
orientation = _ref4.orientation;
|
|
2851
3171
|
// for horizontal view
|
|
2852
3172
|
var gaugeStartX = (containerWidth - gaugeLength) / 2.0;
|
|
2853
3173
|
var gaugeStartY = (containerHeight - exports.GAUGE_THICKNESS) / 2.0;
|
|
3174
|
+
|
|
2854
3175
|
if (orientation === 'vertical') {
|
|
2855
3176
|
gaugeStartX = (containerWidth - exports.GAUGE_THICKNESS) / 2.0;
|
|
2856
3177
|
gaugeStartY = (containerHeight - gaugeLength) / 2.0;
|
|
2857
3178
|
}
|
|
3179
|
+
|
|
2858
3180
|
return {
|
|
2859
3181
|
gaugeStartX: gaugeStartX,
|
|
2860
3182
|
gaugeStartY: gaugeStartY
|
|
2861
3183
|
};
|
|
2862
3184
|
};
|
|
3185
|
+
|
|
2863
3186
|
exports.getGaugeStartPosition = getGaugeStartPosition;
|
|
2864
3187
|
/**
|
|
2865
3188
|
* get dimensions for the whole gauge viz,
|
|
@@ -2876,23 +3199,26 @@ exports.getGaugeStartPosition = getGaugeStartPosition;
|
|
|
2876
3199
|
* @return {Number} gaugeDimensions.gaugeWidth natural width of gauge
|
|
2877
3200
|
* @return {Number} gaugeDimensions.gaugeHeight natural height of gauge
|
|
2878
3201
|
*/
|
|
3202
|
+
|
|
2879
3203
|
var getGaugeDimensions = function getGaugeDimensions(_ref5) {
|
|
2880
3204
|
var containerWidth = _ref5.containerWidth,
|
|
2881
|
-
|
|
2882
|
-
|
|
3205
|
+
containerHeight = _ref5.containerHeight,
|
|
3206
|
+
orientation = _ref5.orientation;
|
|
2883
3207
|
var gaugeLength = (0, exports.getGaugeLength)({
|
|
2884
3208
|
containerWidth: containerWidth,
|
|
2885
3209
|
containerHeight: containerHeight,
|
|
2886
3210
|
orientation: orientation
|
|
2887
3211
|
});
|
|
3212
|
+
|
|
2888
3213
|
var _ref6 = (0, exports.getGaugeStartPosition)({
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
3214
|
+
containerWidth: containerWidth,
|
|
3215
|
+
containerHeight: containerHeight,
|
|
3216
|
+
gaugeLength: gaugeLength,
|
|
3217
|
+
orientation: orientation
|
|
3218
|
+
}),
|
|
3219
|
+
gaugeStartX = _ref6.gaugeStartX,
|
|
3220
|
+
gaugeStartY = _ref6.gaugeStartY;
|
|
3221
|
+
|
|
2896
3222
|
var gaugeWidth = (0, exports.getGaugeWidth)({
|
|
2897
3223
|
containerWidth: containerWidth,
|
|
2898
3224
|
orientation: orientation
|
|
@@ -2909,6 +3235,7 @@ var getGaugeDimensions = function getGaugeDimensions(_ref5) {
|
|
|
2909
3235
|
gaugeHeight: gaugeHeight
|
|
2910
3236
|
};
|
|
2911
3237
|
};
|
|
3238
|
+
|
|
2912
3239
|
exports.getGaugeDimensions = getGaugeDimensions;
|
|
2913
3240
|
/**
|
|
2914
3241
|
* if gaugeColor is not specified, auto assign a gauge color to the fill bar
|
|
@@ -2916,19 +3243,24 @@ exports.getGaugeDimensions = getGaugeDimensions;
|
|
|
2916
3243
|
* @method assignGaugeColor
|
|
2917
3244
|
* @params
|
|
2918
3245
|
* */
|
|
3246
|
+
|
|
2919
3247
|
var assignGaugeColor = function assignGaugeColor(_ref7) {
|
|
2920
3248
|
var value = _ref7.value,
|
|
2921
|
-
|
|
2922
|
-
|
|
3249
|
+
min = _ref7.min,
|
|
3250
|
+
max = _ref7.max;
|
|
2923
3251
|
var rate = (value - min) / (max - min);
|
|
3252
|
+
|
|
2924
3253
|
if (rate <= 0.3) {
|
|
2925
3254
|
return colorConstants_1.SEMANTIC_SUCCESS;
|
|
2926
3255
|
}
|
|
3256
|
+
|
|
2927
3257
|
if (rate > 0.3 && rate <= 0.6) {
|
|
2928
3258
|
return colorConstants_1.SEMANTIC_WARNING;
|
|
2929
3259
|
}
|
|
3260
|
+
|
|
2930
3261
|
return colorConstants_1.SEMANTIC_ERROR;
|
|
2931
3262
|
};
|
|
3263
|
+
|
|
2932
3264
|
exports.assignGaugeColor = assignGaugeColor;
|
|
2933
3265
|
/**
|
|
2934
3266
|
* get inner bar length in gauge
|
|
@@ -2940,22 +3272,28 @@ exports.assignGaugeColor = assignGaugeColor;
|
|
|
2940
3272
|
* @param {Number} input.max
|
|
2941
3273
|
* @return {Number} gaugeBarLength
|
|
2942
3274
|
*/
|
|
3275
|
+
|
|
2943
3276
|
var getGaugeBarLength = function getGaugeBarLength(_ref8) {
|
|
2944
3277
|
var gaugeLength = _ref8.gaugeLength,
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
3278
|
+
value = _ref8.value,
|
|
3279
|
+
min = _ref8.min,
|
|
3280
|
+
max = _ref8.max;
|
|
3281
|
+
|
|
2948
3282
|
if (max < min) {
|
|
2949
3283
|
return null;
|
|
2950
3284
|
}
|
|
3285
|
+
|
|
2951
3286
|
if (value >= max) {
|
|
2952
3287
|
return gaugeLength;
|
|
2953
3288
|
}
|
|
3289
|
+
|
|
2954
3290
|
if (value < min) {
|
|
2955
3291
|
return 0;
|
|
2956
3292
|
}
|
|
3293
|
+
|
|
2957
3294
|
return gaugeLength * (value - min) / (max - min);
|
|
2958
3295
|
};
|
|
3296
|
+
|
|
2959
3297
|
exports.getGaugeBarLength = getGaugeBarLength;
|
|
2960
3298
|
/**
|
|
2961
3299
|
* get x and y position for rendering inner bar in gauge
|
|
@@ -2971,26 +3309,30 @@ exports.getGaugeBarLength = getGaugeBarLength;
|
|
|
2971
3309
|
* @return {Number} position.gaugeBarX
|
|
2972
3310
|
* @return {Number} position.gaugeBarY
|
|
2973
3311
|
*/
|
|
3312
|
+
|
|
2974
3313
|
var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref9) {
|
|
2975
3314
|
var gaugeStartX = _ref9.gaugeStartX,
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
|
|
2979
|
-
|
|
2980
|
-
|
|
3315
|
+
gaugeStartY = _ref9.gaugeStartY,
|
|
3316
|
+
gaugeWidth = _ref9.gaugeWidth,
|
|
3317
|
+
gaugeHeight = _ref9.gaugeHeight,
|
|
3318
|
+
gaugeBarLength = _ref9.gaugeBarLength,
|
|
3319
|
+
orientation = _ref9.orientation;
|
|
2981
3320
|
var gaugeBarX = gaugeStartX;
|
|
2982
3321
|
var gaugeBarY = gaugeStartY;
|
|
3322
|
+
|
|
2983
3323
|
if (orientation === 'vertical') {
|
|
2984
3324
|
gaugeBarX += (gaugeWidth - exports.FILL_THICKNESS) / 2;
|
|
2985
3325
|
gaugeBarY += gaugeHeight - gaugeBarLength;
|
|
2986
3326
|
} else {
|
|
2987
3327
|
gaugeBarY += (gaugeHeight - exports.FILL_THICKNESS) / 2;
|
|
2988
3328
|
}
|
|
3329
|
+
|
|
2989
3330
|
return {
|
|
2990
3331
|
gaugeBarX: gaugeBarX,
|
|
2991
3332
|
gaugeBarY: gaugeBarY
|
|
2992
3333
|
};
|
|
2993
3334
|
};
|
|
3335
|
+
|
|
2994
3336
|
exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
|
|
2995
3337
|
/**
|
|
2996
3338
|
* get width of inner bar in gauge
|
|
@@ -3000,11 +3342,13 @@ exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
|
|
|
3000
3342
|
* @param {String} orientation
|
|
3001
3343
|
* @return {Number} gaugeBarWidth
|
|
3002
3344
|
*/
|
|
3345
|
+
|
|
3003
3346
|
var getGaugeBarWidth = function getGaugeBarWidth(_ref10) {
|
|
3004
3347
|
var gaugeBarLength = _ref10.gaugeBarLength,
|
|
3005
|
-
|
|
3348
|
+
orientation = _ref10.orientation;
|
|
3006
3349
|
return orientation === 'vertical' ? exports.FILL_THICKNESS : gaugeBarLength;
|
|
3007
3350
|
};
|
|
3351
|
+
|
|
3008
3352
|
exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
3009
3353
|
/**
|
|
3010
3354
|
* get height of inner bar in gauge
|
|
@@ -3014,11 +3358,13 @@ exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
|
3014
3358
|
* @param {String} orientation
|
|
3015
3359
|
* @return {Number} gaugeBarHeight
|
|
3016
3360
|
*/
|
|
3361
|
+
|
|
3017
3362
|
var getGaugeBarHeight = function getGaugeBarHeight(_ref11) {
|
|
3018
3363
|
var gaugeBarLength = _ref11.gaugeBarLength,
|
|
3019
|
-
|
|
3364
|
+
orientation = _ref11.orientation;
|
|
3020
3365
|
return orientation === 'vertical' ? gaugeBarLength : exports.FILL_THICKNESS;
|
|
3021
3366
|
};
|
|
3367
|
+
|
|
3022
3368
|
exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
3023
3369
|
/**
|
|
3024
3370
|
* get dimensions for the fill bar in the gauge
|
|
@@ -3040,32 +3386,35 @@ exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
|
3040
3386
|
* @return {Number} fillBarDimensions.fillBarWidth
|
|
3041
3387
|
* @return {Number} fillBarDimensions.fillBarHeight
|
|
3042
3388
|
*/
|
|
3389
|
+
|
|
3043
3390
|
var getFillBarDimensions = function getFillBarDimensions(_ref12) {
|
|
3044
3391
|
var gaugeLength = _ref12.gaugeLength,
|
|
3045
|
-
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3392
|
+
gaugeStartX = _ref12.gaugeStartX,
|
|
3393
|
+
gaugeStartY = _ref12.gaugeStartY,
|
|
3394
|
+
gaugeWidth = _ref12.gaugeWidth,
|
|
3395
|
+
gaugeHeight = _ref12.gaugeHeight,
|
|
3396
|
+
value = _ref12.value,
|
|
3397
|
+
min = _ref12.min,
|
|
3398
|
+
max = _ref12.max,
|
|
3399
|
+
orientation = _ref12.orientation;
|
|
3053
3400
|
var gaugeBarLength = (0, exports.getGaugeBarLength)({
|
|
3054
3401
|
gaugeLength: gaugeLength,
|
|
3055
3402
|
value: value,
|
|
3056
3403
|
max: max,
|
|
3057
3404
|
min: min
|
|
3058
3405
|
});
|
|
3406
|
+
|
|
3059
3407
|
var _ref13 = (0, exports.getGaugeBarStartPositions)({
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
|
|
3068
|
-
|
|
3408
|
+
gaugeStartX: gaugeStartX,
|
|
3409
|
+
gaugeStartY: gaugeStartY,
|
|
3410
|
+
gaugeWidth: gaugeWidth,
|
|
3411
|
+
gaugeHeight: gaugeHeight,
|
|
3412
|
+
gaugeBarLength: gaugeBarLength,
|
|
3413
|
+
orientation: orientation
|
|
3414
|
+
}),
|
|
3415
|
+
fillBarX = _ref13.gaugeBarX,
|
|
3416
|
+
fillBarY = _ref13.gaugeBarY;
|
|
3417
|
+
|
|
3069
3418
|
var fillBarWidth = (0, exports.getGaugeBarWidth)({
|
|
3070
3419
|
gaugeBarLength: gaugeBarLength,
|
|
3071
3420
|
orientation: orientation
|
|
@@ -3082,6 +3431,7 @@ var getFillBarDimensions = function getFillBarDimensions(_ref12) {
|
|
|
3082
3431
|
fillBarHeight: fillBarHeight
|
|
3083
3432
|
};
|
|
3084
3433
|
};
|
|
3434
|
+
|
|
3085
3435
|
exports.getFillBarDimensions = getFillBarDimensions;
|
|
3086
3436
|
/**
|
|
3087
3437
|
* get position x and y for value marker in filler gauge
|
|
@@ -3095,24 +3445,28 @@ exports.getFillBarDimensions = getFillBarDimensions;
|
|
|
3095
3445
|
* @return {Number} position.valueMarkerX
|
|
3096
3446
|
* @return {Number} position.valueMarkerY
|
|
3097
3447
|
*/
|
|
3448
|
+
|
|
3098
3449
|
var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref14) {
|
|
3099
3450
|
var fillBarX = _ref14.fillBarX,
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3451
|
+
fillBarY = _ref14.fillBarY,
|
|
3452
|
+
fillBarLength = _ref14.fillBarLength,
|
|
3453
|
+
orientation = _ref14.orientation;
|
|
3103
3454
|
var valueMarkerX = fillBarX;
|
|
3104
3455
|
var valueMarkerY = fillBarY;
|
|
3456
|
+
|
|
3105
3457
|
if (orientation === 'vertical') {
|
|
3106
3458
|
valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
3107
3459
|
} else {
|
|
3108
3460
|
valueMarkerX += fillBarLength;
|
|
3109
3461
|
valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
3110
3462
|
}
|
|
3463
|
+
|
|
3111
3464
|
return {
|
|
3112
3465
|
valueMarkerX: valueMarkerX,
|
|
3113
3466
|
valueMarkerY: valueMarkerY
|
|
3114
3467
|
};
|
|
3115
3468
|
};
|
|
3469
|
+
|
|
3116
3470
|
exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
|
|
3117
3471
|
/**
|
|
3118
3472
|
* get dimensions for the marker bar in the gauge
|
|
@@ -3131,24 +3485,27 @@ exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
|
|
|
3131
3485
|
* @return {Number} markerBarDimensions.markerBarWidth
|
|
3132
3486
|
* @return {Number} markerBarDimensions.markerBarHeight
|
|
3133
3487
|
*/
|
|
3488
|
+
|
|
3134
3489
|
var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
|
|
3135
3490
|
var gaugeLength = _ref15.gaugeLength,
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3491
|
+
gaugeStartX = _ref15.gaugeStartX,
|
|
3492
|
+
gaugeStartY = _ref15.gaugeStartY,
|
|
3493
|
+
gaugeWidth = _ref15.gaugeWidth,
|
|
3494
|
+
gaugeHeight = _ref15.gaugeHeight,
|
|
3495
|
+
orientation = _ref15.orientation;
|
|
3141
3496
|
var gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge
|
|
3497
|
+
|
|
3142
3498
|
var _ref16 = (0, exports.getGaugeBarStartPositions)({
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3148
|
-
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3499
|
+
gaugeStartX: gaugeStartX,
|
|
3500
|
+
gaugeStartY: gaugeStartY,
|
|
3501
|
+
gaugeWidth: gaugeWidth,
|
|
3502
|
+
gaugeHeight: gaugeHeight,
|
|
3503
|
+
gaugeBarLength: gaugeBarLength,
|
|
3504
|
+
orientation: orientation
|
|
3505
|
+
}),
|
|
3506
|
+
markerBarX = _ref16.gaugeBarX,
|
|
3507
|
+
markerBarY = _ref16.gaugeBarY;
|
|
3508
|
+
|
|
3152
3509
|
var markerBarWidth = (0, exports.getGaugeBarWidth)({
|
|
3153
3510
|
gaugeBarLength: gaugeBarLength,
|
|
3154
3511
|
orientation: orientation
|
|
@@ -3165,6 +3522,7 @@ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
|
|
|
3165
3522
|
markerBarHeight: markerBarHeight
|
|
3166
3523
|
};
|
|
3167
3524
|
};
|
|
3525
|
+
|
|
3168
3526
|
exports.getMarkerBarDimensions = getMarkerBarDimensions;
|
|
3169
3527
|
/**
|
|
3170
3528
|
* get position x and y for value marker in marker gauge
|
|
@@ -3182,17 +3540,19 @@ exports.getMarkerBarDimensions = getMarkerBarDimensions;
|
|
|
3182
3540
|
* @return {Number} position.valueMarkerX
|
|
3183
3541
|
* @return {Number} position.valueMarkerY
|
|
3184
3542
|
*/
|
|
3543
|
+
|
|
3185
3544
|
var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref17) {
|
|
3186
3545
|
var markerBarX = _ref17.markerBarX,
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3546
|
+
markerBarY = _ref17.markerBarY,
|
|
3547
|
+
markerBarHeight = _ref17.markerBarHeight,
|
|
3548
|
+
gaugeLength = _ref17.markerBarLength,
|
|
3549
|
+
orientation = _ref17.orientation,
|
|
3550
|
+
value = _ref17.value,
|
|
3551
|
+
min = _ref17.min,
|
|
3552
|
+
max = _ref17.max;
|
|
3194
3553
|
var valueMarkerX = markerBarX;
|
|
3195
3554
|
var valueMarkerY = markerBarY;
|
|
3555
|
+
|
|
3196
3556
|
if (orientation === 'vertical') {
|
|
3197
3557
|
valueMarkerY += markerBarHeight - (0, exports.getGaugeBarLength)({
|
|
3198
3558
|
gaugeLength: gaugeLength,
|
|
@@ -3210,11 +3570,13 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
|
|
|
3210
3570
|
});
|
|
3211
3571
|
valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
3212
3572
|
}
|
|
3573
|
+
|
|
3213
3574
|
return {
|
|
3214
3575
|
valueMarkerX: valueMarkerX,
|
|
3215
3576
|
valueMarkerY: valueMarkerY
|
|
3216
3577
|
};
|
|
3217
3578
|
};
|
|
3579
|
+
|
|
3218
3580
|
exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
|
|
3219
3581
|
/**
|
|
3220
3582
|
* sort the ranges in ascending order
|
|
@@ -3222,11 +3584,13 @@ exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
|
|
|
3222
3584
|
* @param {Array} ranges
|
|
3223
3585
|
* @return {Array} sortedRanges
|
|
3224
3586
|
*/
|
|
3587
|
+
|
|
3225
3588
|
var getSortedRanges = function getSortedRanges(ranges) {
|
|
3226
3589
|
return ranges.sort(function (a, b) {
|
|
3227
3590
|
return a.from - b.from;
|
|
3228
3591
|
});
|
|
3229
3592
|
};
|
|
3593
|
+
|
|
3230
3594
|
exports.getSortedRanges = getSortedRanges;
|
|
3231
3595
|
/**
|
|
3232
3596
|
* validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to
|
|
@@ -3234,29 +3598,35 @@ exports.getSortedRanges = getSortedRanges;
|
|
|
3234
3598
|
* @param {Array} ranges
|
|
3235
3599
|
* @return {String} error
|
|
3236
3600
|
*/
|
|
3601
|
+
|
|
3237
3602
|
var validateRanges = function validateRanges(ranges) {
|
|
3238
3603
|
if (!ranges.length) {
|
|
3239
3604
|
return (0, i18n_1._)('Prop "ranges" is missing entries');
|
|
3240
|
-
}
|
|
3241
|
-
|
|
3605
|
+
} // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
|
|
3606
|
+
|
|
3607
|
+
|
|
3242
3608
|
if (ranges.some(function (range) {
|
|
3243
3609
|
return range.from >= range.to;
|
|
3244
3610
|
})) {
|
|
3245
3611
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: invalid range');
|
|
3246
|
-
}
|
|
3247
|
-
|
|
3612
|
+
} // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
|
|
3613
|
+
|
|
3614
|
+
|
|
3248
3615
|
if (ranges.length !== (0, lodash_1.uniqBy)(ranges, 'to').length || ranges.length !== (0, lodash_1.uniqBy)(ranges, 'from').length) {
|
|
3249
3616
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: duplicate values');
|
|
3250
3617
|
}
|
|
3251
|
-
|
|
3252
|
-
// check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
|
|
3618
|
+
|
|
3619
|
+
var sortedRanges = (0, exports.getSortedRanges)(ranges); // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
|
|
3620
|
+
|
|
3253
3621
|
for (var i = 1; i < sortedRanges.length; i += 1) {
|
|
3254
3622
|
if (sortedRanges[i].from !== sortedRanges[i - 1].to) {
|
|
3255
3623
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: discontinuous ranges');
|
|
3256
3624
|
}
|
|
3257
3625
|
}
|
|
3626
|
+
|
|
3258
3627
|
return null;
|
|
3259
3628
|
};
|
|
3629
|
+
|
|
3260
3630
|
exports.validateRanges = validateRanges;
|
|
3261
3631
|
/**
|
|
3262
3632
|
* calculate min and max value of gauge
|
|
@@ -3266,6 +3636,7 @@ exports.validateRanges = validateRanges;
|
|
|
3266
3636
|
* @return {Number} gaugeRange.min
|
|
3267
3637
|
* @return {Number} gaugeRange.max
|
|
3268
3638
|
*/
|
|
3639
|
+
|
|
3269
3640
|
var getGaugeRange = function getGaugeRange(ranges) {
|
|
3270
3641
|
var min = Math.min.apply(Math, _toConsumableArray(ranges.map(function (range) {
|
|
3271
3642
|
return range.from;
|
|
@@ -3278,6 +3649,7 @@ var getGaugeRange = function getGaugeRange(ranges) {
|
|
|
3278
3649
|
max: max
|
|
3279
3650
|
};
|
|
3280
3651
|
};
|
|
3652
|
+
|
|
3281
3653
|
exports.getGaugeRange = getGaugeRange;
|
|
3282
3654
|
/**
|
|
3283
3655
|
* calculate stop offsets for linear gradient
|
|
@@ -3286,17 +3658,20 @@ exports.getGaugeRange = getGaugeRange;
|
|
|
3286
3658
|
* @param {String} orientation
|
|
3287
3659
|
* @return {Array} cumulativeOffsets
|
|
3288
3660
|
*/
|
|
3661
|
+
|
|
3289
3662
|
var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
|
|
3290
3663
|
var ranges = _ref18.ranges,
|
|
3291
|
-
|
|
3664
|
+
orientation = _ref18.orientation;
|
|
3665
|
+
|
|
3292
3666
|
var _ref19 = (0, exports.getGaugeRange)(ranges),
|
|
3293
|
-
|
|
3294
|
-
|
|
3667
|
+
min = _ref19.min,
|
|
3668
|
+
max = _ref19.max;
|
|
3669
|
+
|
|
3295
3670
|
var offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);
|
|
3296
3671
|
var offsets = ranges.map(function (range) {
|
|
3297
3672
|
return Math.abs(range.from - range.to) * offsetScale;
|
|
3298
|
-
});
|
|
3299
|
-
|
|
3673
|
+
}); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
|
|
3674
|
+
|
|
3300
3675
|
offsets = orientation === 'vertical' ? offsets.reverse() : offsets;
|
|
3301
3676
|
var cumulativeOffsets = [];
|
|
3302
3677
|
offsets.reduce(function (accumulator, currentValue, idx) {
|
|
@@ -3305,6 +3680,7 @@ var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
|
|
|
3305
3680
|
}, 0);
|
|
3306
3681
|
return cumulativeOffsets;
|
|
3307
3682
|
};
|
|
3683
|
+
|
|
3308
3684
|
exports.getGradientStopOffsets = getGradientStopOffsets;
|
|
3309
3685
|
/**
|
|
3310
3686
|
* calculate stop colors for linear gradient
|
|
@@ -3313,15 +3689,17 @@ exports.getGradientStopOffsets = getGradientStopOffsets;
|
|
|
3313
3689
|
* @param {String} orientation
|
|
3314
3690
|
* @return {Array} stopColors
|
|
3315
3691
|
*/
|
|
3692
|
+
|
|
3316
3693
|
var getGradientStopColors = function getGradientStopColors(_ref20) {
|
|
3317
3694
|
var ranges = _ref20.ranges,
|
|
3318
|
-
|
|
3695
|
+
orientation = _ref20.orientation;
|
|
3319
3696
|
var stopColors = ranges.map(function (range) {
|
|
3320
3697
|
return range.value;
|
|
3321
|
-
});
|
|
3322
|
-
|
|
3698
|
+
}); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
|
|
3699
|
+
|
|
3323
3700
|
return orientation === 'vertical' ? stopColors.reverse() : stopColors;
|
|
3324
3701
|
};
|
|
3702
|
+
|
|
3325
3703
|
exports.getGradientStopColors = getGradientStopColors;
|
|
3326
3704
|
/**
|
|
3327
3705
|
* calculate linear gradient stops from ranges
|
|
@@ -3331,9 +3709,10 @@ exports.getGradientStopColors = getGradientStopColors;
|
|
|
3331
3709
|
* @param {String} orientation
|
|
3332
3710
|
* @return {Array} stops
|
|
3333
3711
|
*/
|
|
3712
|
+
|
|
3334
3713
|
var getGradientStops = function getGradientStops(_ref21) {
|
|
3335
3714
|
var ranges = _ref21.ranges,
|
|
3336
|
-
|
|
3715
|
+
orientation = _ref21.orientation;
|
|
3337
3716
|
var stops = [];
|
|
3338
3717
|
var offsets = (0, exports.getGradientStopOffsets)({
|
|
3339
3718
|
ranges: ranges,
|
|
@@ -3342,13 +3721,13 @@ var getGradientStops = function getGradientStops(_ref21) {
|
|
|
3342
3721
|
var stopColors = (0, exports.getGradientStopColors)({
|
|
3343
3722
|
ranges: ranges,
|
|
3344
3723
|
orientation: orientation
|
|
3345
|
-
});
|
|
3346
|
-
|
|
3724
|
+
}); // Initialize stops with the first color stop
|
|
3725
|
+
|
|
3347
3726
|
stops.push({
|
|
3348
3727
|
offset: "".concat(offsets[0], "%"),
|
|
3349
3728
|
stopColor: stopColors[0]
|
|
3350
|
-
});
|
|
3351
|
-
|
|
3729
|
+
}); // Add the remaining color stops with gradient change at each stop
|
|
3730
|
+
|
|
3352
3731
|
for (var i = 1; i < ranges.length; i += 1) {
|
|
3353
3732
|
stops.push({
|
|
3354
3733
|
offset: "".concat(offsets[i - 1], "%"),
|
|
@@ -3359,8 +3738,10 @@ var getGradientStops = function getGradientStops(_ref21) {
|
|
|
3359
3738
|
stopColor: stopColors[i]
|
|
3360
3739
|
});
|
|
3361
3740
|
}
|
|
3741
|
+
|
|
3362
3742
|
return stops;
|
|
3363
3743
|
};
|
|
3744
|
+
|
|
3364
3745
|
exports.getGradientStops = getGradientStops;
|
|
3365
3746
|
/**
|
|
3366
3747
|
* calculate linear gradient dimensions
|
|
@@ -3372,6 +3753,7 @@ exports.getGradientStops = getGradientStops;
|
|
|
3372
3753
|
* @return {String} dimensions.x2
|
|
3373
3754
|
* @return {String} dimensions.y2
|
|
3374
3755
|
*/
|
|
3756
|
+
|
|
3375
3757
|
var getGradientDimensions = function getGradientDimensions(orientation) {
|
|
3376
3758
|
var x1 = '0%';
|
|
3377
3759
|
var y1 = '0%';
|
|
@@ -3384,8 +3766,9 @@ var getGradientDimensions = function getGradientDimensions(orientation) {
|
|
|
3384
3766
|
y2: y2
|
|
3385
3767
|
};
|
|
3386
3768
|
};
|
|
3387
|
-
|
|
3388
|
-
// map for new options names to old option names
|
|
3769
|
+
|
|
3770
|
+
exports.getGradientDimensions = getGradientDimensions; // map for new options names to old option names
|
|
3771
|
+
|
|
3389
3772
|
var gaugeOptionsMapping = {
|
|
3390
3773
|
majorTickInterval: 'majorUnit',
|
|
3391
3774
|
gaugeRanges: 'ranges'
|
|
@@ -3396,11 +3779,13 @@ var gaugeOptionsMapping = {
|
|
|
3396
3779
|
* @param {Object} options
|
|
3397
3780
|
* @returns {Object}
|
|
3398
3781
|
*/
|
|
3782
|
+
|
|
3399
3783
|
var mapToOldKey = function mapToOldKey(options) {
|
|
3400
3784
|
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
3401
3785
|
return gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key;
|
|
3402
3786
|
});
|
|
3403
3787
|
};
|
|
3788
|
+
|
|
3404
3789
|
exports.mapToOldKey = mapToOldKey;
|
|
3405
3790
|
/**
|
|
3406
3791
|
* Helper method to map labelDisplay and valueDisplay options to pure component option names
|
|
@@ -3409,12 +3794,14 @@ exports.mapToOldKey = mapToOldKey;
|
|
|
3409
3794
|
* @param {Object} options
|
|
3410
3795
|
* @returns {Object}
|
|
3411
3796
|
*/
|
|
3797
|
+
|
|
3412
3798
|
var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options) {
|
|
3413
3799
|
var rangeOrValue = labelOrValue === 'value' ? 'Value' : 'Range';
|
|
3414
3800
|
var showKey = labelOrValue === 'value' ? 'showValue' : 'showLabels';
|
|
3415
3801
|
var percentKey = "usePercentage".concat(rangeOrValue);
|
|
3416
3802
|
var optionString = "".concat(labelOrValue, "Display");
|
|
3417
3803
|
var newOptions = Object.assign({}, options);
|
|
3804
|
+
|
|
3418
3805
|
if (newOptions[optionString]) {
|
|
3419
3806
|
if (newOptions[optionString] === 'number') {
|
|
3420
3807
|
newOptions[showKey] = true;
|
|
@@ -3427,8 +3814,10 @@ var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options)
|
|
|
3427
3814
|
newOptions[percentKey] = false;
|
|
3428
3815
|
}
|
|
3429
3816
|
}
|
|
3817
|
+
|
|
3430
3818
|
return (0, lodash_1.omit)(newOptions, [optionString]);
|
|
3431
3819
|
};
|
|
3820
|
+
|
|
3432
3821
|
exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
3433
3822
|
/**
|
|
3434
3823
|
* Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts
|
|
@@ -3437,6 +3826,7 @@ exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
|
3437
3826
|
* @param {Object} originalOptions
|
|
3438
3827
|
* @returns {Object}
|
|
3439
3828
|
*/
|
|
3829
|
+
|
|
3440
3830
|
var convertToGaugeProperties = function convertToGaugeProperties(originalOptions) {
|
|
3441
3831
|
return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru(function (options) {
|
|
3442
3832
|
return (0, exports.mapValueLabelDisplay)('label', options);
|
|
@@ -3444,6 +3834,7 @@ var convertToGaugeProperties = function convertToGaugeProperties(originalOptions
|
|
|
3444
3834
|
return (0, exports.mapValueLabelDisplay)('value', options);
|
|
3445
3835
|
}).value();
|
|
3446
3836
|
};
|
|
3837
|
+
|
|
3447
3838
|
exports.convertToGaugeProperties = convertToGaugeProperties;
|
|
3448
3839
|
|
|
3449
3840
|
/***/ })
|