@splunk/visualizations 26.0.0 → 26.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/MarkerGauge.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -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
- x1 = _ref.x1,
235
- y1 = _ref.y1,
236
- x2 = _ref.x2,
237
- y2 = _ref.y2,
238
- showLabels = _ref.showLabels,
239
- label = _ref.label,
240
- labelX = _ref.labelX,
241
- labelY = _ref.labelY,
242
- majorTickStrokeColor = _ref.majorTickStrokeColor,
243
- majorTickFillColor = _ref.majorTickFillColor;
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
- height = _ref2.height,
290
- startX = _ref2.startX,
291
- startY = _ref2.startY,
292
- orientation = _ref2.orientation,
293
- numOfTicks = _ref2.numOfTicks,
294
- i = _ref2.i;
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
- height = props.height,
331
- startX = props.startX,
332
- startY = props.startY,
333
- min = props.min,
334
- max = props.max,
335
- majorUnit = props.majorUnit,
336
- orientation = props.orientation,
337
- showLabels = props.showLabels,
338
- usePercentageRange = props.usePercentageRange,
339
- majorTickFillColor = props.majorTickFillColor,
340
- majorTickStrokeColor = props.majorTickStrokeColor;
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
- width: width,
347
- height: height,
348
- startX: startX,
349
- startY: startY,
350
- orientation: orientation,
351
- numOfTicks: numOfTicks,
352
- i: i
353
- }),
354
- x1 = _positionMajorTick.x1,
355
- y1 = _positionMajorTick.y1,
356
- x2 = _positionMajorTick.x2,
357
- y2 = _positionMajorTick.y2,
358
- labelX = _positionMajorTick.labelX,
359
- labelY = _positionMajorTick.labelY;
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
- width: width,
382
- height: height,
383
- startX: startX,
384
- startY: startY,
385
- orientation: orientation,
386
- numOfTicks: extraNumOfTicks,
387
- i: extraNumOfTicks
388
- }),
389
- _x = _positionMajorTick2.x1,
390
- _y = _positionMajorTick2.y1,
391
- _x2 = _positionMajorTick2.x2,
392
- _y2 = _positionMajorTick2.y2,
393
- _labelX = _positionMajorTick2.labelX,
394
- _labelY = _positionMajorTick2.labelY;
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
- y = _ref.y,
498
- orientation = _ref.orientation,
499
- valueMarkerRectLength = _ref.valueMarkerRectLength,
500
- _ref$alignCenter = _ref.alignCenter,
501
- alignCenter = _ref$alignCenter === void 0 ? false : _ref$alignCenter;
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
- y = _ref2.y,
540
- length = _ref2.length,
541
- orientation = _ref2.orientation,
542
- _ref2$alignCenter = _ref2.alignCenter,
543
- alignCenter = _ref2$alignCenter === void 0 ? false : _ref2$alignCenter;
544
- // for horizontal view
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
- y = props.y,
564
- length = props.length,
565
- min = props.min,
566
- max = props.max,
567
- value = props.value,
568
- orientation = props.orientation,
569
- showValue = props.showValue,
570
- usePercentageValue = props.usePercentageValue,
571
- valueMarkerFillColor = props.valueMarkerFillColor,
572
- valueMarkerLabelFillColor = props.valueMarkerLabelFillColor,
573
- alignCenter = props.alignCenter;
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
- x: x,
577
- y: y,
578
- length: length,
579
- orientation: orientation,
580
- alignCenter: alignCenter
581
- }),
582
- labelRectX = _positionLabel.labelRectX,
583
- labelRectY = _positionLabel.labelRectY,
584
- labelX = _positionLabel.labelX,
585
- labelY = _positionLabel.labelY;
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
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
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
- height = _ref2.height;
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
- height = props.height,
697
- backgroundColor = props.backgroundColor;
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.0.0 - 2f7458907",
737
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
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
- newHeight = _ref3.height;
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
- Visualization = _ref.Visualization;
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
  /***/ }),
@@ -769,7 +803,7 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
769
803
 
770
804
  /***/ }),
771
805
 
772
- /***/ 162:
806
+ /***/ 163:
773
807
  /***/ (function(module, exports, __webpack_require__) {
774
808
 
775
809
  "use strict";
@@ -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
- var withDashboardViz_1 = __webpack_require__(36);
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
- title = _a.title,
889
- description = _a.description,
890
- readOnly = _a.readOnly,
891
- writeOnly = _a.writeOnly,
892
- examples = _a.examples,
893
- defaultValue = _a.default,
894
- type = _a.type,
895
- properties = _a.properties,
896
- patternProperties = _a.patternProperties,
897
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
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
- exports.isDynamicOption = isDynamicOption;
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
- height = props.height,
1164
- icon = props.icon,
1165
- iconColor = props.iconColor;
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: {
@@ -1174,9 +1265,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
1174
1265
  transform: 'translate(-50%, -50%)'
1175
1266
  },
1176
1267
  width: '50%',
1177
- height: '50%'
1268
+ height: '50%',
1269
+ 'data-test': 'icon-placeholder'
1178
1270
  });
1179
1271
  }
1272
+
1180
1273
  return React.createElement(Message_1.default, {
1181
1274
  width: width,
1182
1275
  height: height,
@@ -1184,6 +1277,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
1184
1277
  message: (0, i18n_1._)('No DataSource Connected')
1185
1278
  });
1186
1279
  };
1280
+
1187
1281
  IconPlaceholder.propTypes = propTypes;
1188
1282
  IconPlaceholder.defaultProps = {
1189
1283
  width: '100%',
@@ -1200,21 +1294,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
1200
1294
 
1201
1295
 
1202
1296
  var _defineProperty = __webpack_require__(7);
1297
+
1203
1298
  Object.defineProperty(exports, "__esModule", {
1204
1299
  value: true
1205
1300
  });
1206
1301
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1302
+
1207
1303
  var T = __webpack_require__(0);
1304
+
1208
1305
  var lodash_1 = __webpack_require__(3);
1209
- var DataSource_1 = __webpack_require__(43);
1306
+
1307
+ var DataSource_1 = __webpack_require__(34);
1308
+
1210
1309
  exports.SortParamsPropTypes = T.shape({
1211
1310
  currentSortKey: T.string,
1212
1311
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1213
1312
  onSort: T.func
1214
1313
  });
1314
+
1215
1315
  var getSortingParams = function getSortingParams(_ref) {
1216
1316
  var requestParams = _ref.requestParams,
1217
- onRequestParamsChange = _ref.onRequestParamsChange;
1317
+ onRequestParamsChange = _ref.onRequestParamsChange;
1218
1318
  var currentSortKey;
1219
1319
  var currentSortDir;
1220
1320
  var nextSortDirMap = {
@@ -1223,15 +1323,18 @@ var getSortingParams = function getSortingParams(_ref) {
1223
1323
  none: 'asc'
1224
1324
  };
1225
1325
  var onSort;
1326
+
1226
1327
  if (typeof onRequestParamsChange === 'function') {
1227
1328
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
1228
1329
  currentSortKey = Object.keys(requestParams.sort).shift();
1229
1330
  currentSortDir = requestParams.sort[currentSortKey];
1230
- }
1231
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1331
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1332
+
1333
+
1232
1334
  onSort = function onSort(e, _ref2) {
1233
1335
  var sortKey = _ref2.sortKey,
1234
- sortDir = _ref2.sortDir;
1336
+ sortDir = _ref2.sortDir;
1337
+
1235
1338
  if (typeof sortKey === 'string') {
1236
1339
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1237
1340
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -1243,12 +1346,14 @@ var getSortingParams = function getSortingParams(_ref) {
1243
1346
  }
1244
1347
  };
1245
1348
  }
1349
+
1246
1350
  return {
1247
1351
  currentSortKey: currentSortKey,
1248
1352
  currentSortDir: currentSortDir,
1249
1353
  onSort: onSort
1250
1354
  };
1251
1355
  };
1356
+
1252
1357
  exports.getSortingParams = getSortingParams;
1253
1358
 
1254
1359
  /***/ }),
@@ -1259,43 +1364,69 @@ exports.getSortingParams = getSortingParams;
1259
1364
  "use strict";
1260
1365
 
1261
1366
 
1367
+ Object.defineProperty(exports, "__esModule", {
1368
+ value: true
1369
+ });
1370
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1371
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1372
+ exports.validSegmentationModes = ['none', 'inner'];
1373
+ exports.validOutputModes = ['json_cols', 'json'];
1374
+
1375
+ /***/ }),
1376
+
1377
+ /***/ 35:
1378
+ /***/ (function(module, exports, __webpack_require__) {
1379
+
1380
+ "use strict";
1381
+
1382
+
1262
1383
  Object.defineProperty(exports, "__esModule", {
1263
1384
  value: true
1264
1385
  });
1265
1386
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1387
+
1266
1388
  var T = __webpack_require__(0);
1389
+
1267
1390
  var lodash_1 = __webpack_require__(3);
1391
+
1268
1392
  exports.PaginatorParamsPropTypes = T.shape({
1269
1393
  isPaging: T.bool,
1270
1394
  current: T.number,
1271
1395
  totalPages: T.number,
1272
1396
  onChange: T.func
1273
1397
  });
1398
+
1274
1399
  var getPaginationParams = function getPaginationParams(_ref) {
1275
1400
  var requestParams = _ref.requestParams,
1276
- meta = _ref.meta,
1277
- onRequestParamsChange = _ref.onRequestParamsChange;
1401
+ meta = _ref.meta,
1402
+ onRequestParamsChange = _ref.onRequestParamsChange;
1278
1403
  var totalCount = meta && meta.totalCount || 0;
1279
1404
  var offset = requestParams && requestParams.offset || 0;
1280
1405
  var count = requestParams && requestParams.count;
1281
1406
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1282
1407
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1283
1408
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1409
+
1284
1410
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1285
1411
  var page = _ref2.page,
1286
- countArg = _ref2.count;
1412
+ countArg = _ref2.count;
1287
1413
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
1414
+
1288
1415
  if (typeof countArg === 'number') {
1289
1416
  newParams.count = countArg;
1290
1417
  newParams.offset = 0;
1291
1418
  }
1419
+
1292
1420
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1421
+
1293
1422
  if (typeof page === 'number' && page > 0) {
1294
1423
  newParams.count = pageCount;
1295
1424
  newParams.offset = (page - 1) * pageCount;
1296
1425
  }
1426
+
1297
1427
  onRequestParamsChange(newParams);
1298
1428
  };
1429
+
1299
1430
  return {
1300
1431
  isPaging: isPaging,
1301
1432
  current: current,
@@ -1303,11 +1434,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1303
1434
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1304
1435
  };
1305
1436
  };
1437
+
1306
1438
  exports.getPaginationParams = getPaginationParams;
1307
1439
 
1308
1440
  /***/ }),
1309
1441
 
1310
- /***/ 35:
1442
+ /***/ 36:
1311
1443
  /***/ (function(module, exports, __webpack_require__) {
1312
1444
 
1313
1445
  "use strict";
@@ -1318,6 +1450,7 @@ Object.defineProperty(exports, "__esModule", {
1318
1450
  });
1319
1451
  exports.VizCategory = void 0;
1320
1452
  var VizCategory;
1453
+
1321
1454
  (function (VizCategory) {
1322
1455
  VizCategory["SINGLE_VALUE"] = "Single Value";
1323
1456
  VizCategory["TRENDS"] = "Trends";
@@ -1335,67 +1468,96 @@ var VizCategory;
1335
1468
 
1336
1469
  /***/ }),
1337
1470
 
1338
- /***/ 36:
1471
+ /***/ 37:
1339
1472
  /***/ (function(module, exports, __webpack_require__) {
1340
1473
 
1341
1474
  "use strict";
1342
1475
 
1343
1476
 
1344
1477
  var _slicedToArray = __webpack_require__(17);
1478
+
1345
1479
  Object.defineProperty(exports, "__esModule", {
1346
1480
  value: true
1347
1481
  });
1482
+
1348
1483
  var React = __webpack_require__(1);
1484
+
1349
1485
  var lodash_1 = __webpack_require__(3);
1350
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1486
+
1487
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1488
+
1351
1489
  var Options_1 = __webpack_require__(30);
1352
- var SanitizeProps_1 = __webpack_require__(38);
1490
+
1491
+ var SanitizeProps_1 = __webpack_require__(39);
1492
+
1353
1493
  var TimezoneContext_1 = __webpack_require__(26);
1354
- var moment_1 = __webpack_require__(39);
1494
+
1495
+ var moment_1 = __webpack_require__(40);
1496
+
1355
1497
  var FeatureFlagContext_1 = __webpack_require__(21);
1498
+
1356
1499
  var styled_components_1 = __webpack_require__(4);
1500
+
1357
1501
  var hocUtils_1 = __webpack_require__(27);
1502
+
1358
1503
  var JSONSchemaUtils_1 = __webpack_require__(28);
1359
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1504
+
1505
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1506
+
1360
1507
  var id_1 = __webpack_require__(25);
1361
- var SplunkVisualization_1 = __webpack_require__(41);
1508
+
1509
+ var SplunkVisualization_1 = __webpack_require__(42);
1510
+
1362
1511
  var VizBehavior_1 = __webpack_require__(6);
1512
+
1363
1513
  var getSorting_1 = __webpack_require__(33);
1364
- var getPagination_1 = __webpack_require__(34);
1514
+
1515
+ var getPagination_1 = __webpack_require__(35);
1516
+
1365
1517
  var useDeepMemo_1 = __webpack_require__(44);
1518
+
1366
1519
  var MissingPropsMessage_1 = __webpack_require__(45);
1520
+
1367
1521
  var withEditModeCover_1 = __webpack_require__(46);
1522
+
1368
1523
  var withPlaceholder_1 = __webpack_require__(47);
1369
1524
  /**
1370
1525
  * hoc that wraps a pure react visualization in a Dashboard visualization
1371
1526
  * @param {DashboardVizOpts} opts
1372
1527
  * @returns {HOC}
1373
1528
  */
1529
+
1530
+
1374
1531
  var withDashboardViz = function withDashboardViz(opts) {
1375
1532
  var ReactViz = opts.ReactViz,
1376
- vizConfig = opts.vizConfig,
1377
- _opts$computeVizProps = opts.computeVizProps,
1378
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1379
- disableEditModeCover = opts.disableEditModeCover,
1380
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1533
+ vizConfig = opts.vizConfig,
1534
+ _opts$computeVizProps = opts.computeVizProps,
1535
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1536
+ disableEditModeCover = opts.disableEditModeCover,
1537
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1538
+
1381
1539
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1382
1540
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1541
+
1383
1542
  var DashboardViz = function DashboardViz(props) {
1384
1543
  var _a;
1544
+
1385
1545
  var mode = props.mode,
1386
- hasEventHandlers = props.hasEventHandlers,
1387
- dataSources = props.dataSources,
1388
- options = props.options,
1389
- _props$context = props.context,
1390
- context = _props$context === void 0 ? {} : _props$context,
1391
- width = props.width,
1392
- height = props.height,
1393
- onComputedProps = props.onComputedProps,
1394
- onEventTrigger = props.onEventTrigger,
1395
- theme = props.theme,
1396
- onRequestParamsChange = props.onRequestParamsChange;
1546
+ hasEventHandlers = props.hasEventHandlers,
1547
+ dataSources = props.dataSources,
1548
+ options = props.options,
1549
+ _props$context = props.context,
1550
+ context = _props$context === void 0 ? {} : _props$context,
1551
+ width = props.width,
1552
+ height = props.height,
1553
+ onComputedProps = props.onComputedProps,
1554
+ onEventTrigger = props.onEventTrigger,
1555
+ theme = props.theme,
1556
+ onRequestParamsChange = props.onRequestParamsChange;
1557
+
1397
1558
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1398
- serializedTimezone = _React$useContext.serializedTimezone;
1559
+ serializedTimezone = _React$useContext.serializedTimezone;
1560
+
1399
1561
  if (serializedTimezone) {
1400
1562
  /*
1401
1563
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1409,38 +1571,51 @@ var withDashboardViz = function withDashboardViz(opts) {
1409
1571
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1410
1572
  }
1411
1573
  }
1574
+
1412
1575
  var themeFunc = function themeFunc(themeVar) {
1413
1576
  var _a, _b;
1577
+
1414
1578
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1415
1579
  };
1580
+
1416
1581
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1582
+
1417
1583
  var _ref = (0, getSettingsFromThemedProps_1.default)({
1418
- theme: theme
1419
- }),
1420
- currentThemeFamily = _ref.family,
1421
- currentThemeColorScheme = _ref.colorScheme,
1422
- currentThemeDensity = _ref.density;
1584
+ theme: theme
1585
+ }),
1586
+ currentThemeFamily = _ref.family,
1587
+ currentThemeColorScheme = _ref.colorScheme,
1588
+ currentThemeDensity = _ref.density;
1589
+
1423
1590
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1591
+
1424
1592
  var _React$useState = React.useState({}),
1425
- _React$useState2 = _slicedToArray(_React$useState, 2),
1426
- evaluatedOptionsAsync = _React$useState2[0],
1427
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1593
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1594
+ evaluatedOptionsAsync = _React$useState2[0],
1595
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1596
+
1597
+
1428
1598
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1599
+
1429
1600
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1430
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1431
- visualizationID = _React$useState4[0];
1601
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1602
+ visualizationID = _React$useState4[0];
1603
+
1432
1604
  var _React$useState5 = React.useState({}),
1433
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1434
- dataSourcesInState = _React$useState6[0],
1435
- setDataSourcesInState = _React$useState6[1];
1605
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1606
+ dataSourcesInState = _React$useState6[0],
1607
+ setDataSourcesInState = _React$useState6[1];
1608
+
1436
1609
  var _React$useState7 = React.useState(),
1437
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1438
- dataFramesInState = _React$useState8[0],
1439
- setDataFramesInState = _React$useState8[1];
1610
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1611
+ dataFramesInState = _React$useState8[0],
1612
+ setDataFramesInState = _React$useState8[1];
1613
+
1440
1614
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1441
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1442
- useAsyncEvaluatedOptions = _React$useState10[0],
1443
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1615
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1616
+ useAsyncEvaluatedOptions = _React$useState10[0],
1617
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1618
+
1444
1619
  var isMounted = React.useRef(true);
1445
1620
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1446
1621
  try {
@@ -1465,11 +1640,13 @@ var withDashboardViz = function withDashboardViz(opts) {
1465
1640
  });
1466
1641
  } else {
1467
1642
  var dataFrames = dataFramesInState;
1643
+
1468
1644
  if (dataSources !== dataSourcesInState) {
1469
1645
  setDataSourcesInState(dataSources);
1470
1646
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1471
1647
  setDataFramesInState(dataFrames);
1472
1648
  }
1649
+
1473
1650
  return Options_1.Options.evaluate({
1474
1651
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1475
1652
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -1480,21 +1657,24 @@ var withDashboardViz = function withDashboardViz(opts) {
1480
1657
  console.error("unexpected error evaluating options: ".concat(e.message));
1481
1658
  return {};
1482
1659
  }
1660
+
1483
1661
  return {};
1484
1662
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1485
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1486
- // trellis specific backgroundColor update for onComputedProps
1663
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1487
1664
  // 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
1665
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1666
+
1489
1667
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1490
1668
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1669
+
1491
1670
  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
1671
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1493
1672
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1494
1673
  });
1495
- }
1496
- // useEffect hook needs to be initialized before any early returns
1674
+ } // useEffect hook needs to be initialized before any early returns
1497
1675
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1676
+
1677
+
1498
1678
  React.useEffect(function () {
1499
1679
  onComputedProps(clonedEvaluatedOptions);
1500
1680
  });
@@ -1504,53 +1684,68 @@ var withDashboardViz = function withDashboardViz(opts) {
1504
1684
  isMounted.current = false;
1505
1685
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1506
1686
  }
1507
- };
1508
- // eslint-disable-next-line react-hooks/exhaustive-deps
1509
- }, []);
1510
- // present warning message if any required props are missing
1687
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1688
+ }, []); // present warning message if any required props are missing
1689
+
1511
1690
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1512
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1513
- supports = vizConfig.supports;
1691
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1692
+ supports = vizConfig.supports;
1514
1693
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1694
+
1515
1695
  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
1696
  ) {
1517
- return React.createElement(MissingPropsMessage_1.default, {
1518
- "data-test": "missing-props-message",
1519
- width: width,
1520
- height: height,
1521
- missingProps: missing,
1522
- backgroundColor: bgColorFromTheme
1523
- });
1524
- }
1525
- // events
1697
+ return React.createElement(MissingPropsMessage_1.default, {
1698
+ "data-test": "missing-props-message",
1699
+ width: width,
1700
+ height: height,
1701
+ missingProps: missing,
1702
+ backgroundColor: bgColorFromTheme
1703
+ });
1704
+ } // events
1705
+
1706
+
1526
1707
  var eventCallbackProps = {};
1708
+
1527
1709
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1528
1710
  var supportedEvents = vizConfig.events;
1529
1711
  Object.keys(supportedEvents).forEach(function (eventName) {
1530
- 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
+ var _supportedEvents$even = supportedEvents[eventName],
1713
+ parentKeys = _supportedEvents$even.parentKeys,
1714
+ payloadKeys = _supportedEvents$even.payloadKeys;
1715
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1533
1716
  // then remove these lines
1534
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1717
+
1535
1718
  var payload = {};
1719
+
1536
1720
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1537
1721
  payloadKeys.forEach(function (p) {
1538
1722
  payload[p] = evaluatedOptionsToUse[p];
1539
1723
  });
1540
1724
  }
1725
+
1541
1726
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1542
1727
  if (ev && ev.payload) {
1543
1728
  payload = ev.payload;
1544
1729
  }
1730
+
1545
1731
  return onEventTrigger({
1546
1732
  originalEvent: ev,
1547
1733
  payload: payload,
1548
1734
  type: eventName
1549
1735
  });
1550
1736
  };
1737
+
1738
+ if (parentKeys) {
1739
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1740
+ var newObject = {};
1741
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1742
+ eventCallbackProps[eventCallbackPropName] = newObject;
1743
+ }
1744
+ }
1551
1745
  });
1552
- }
1553
- // compute pure viz props which are not from options
1746
+ } // compute pure viz props which are not from options
1747
+
1748
+
1554
1749
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1555
1750
  themeFunc: themeFunc
1556
1751
  }));
@@ -1568,15 +1763,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1568
1763
  * In future, we could automatically detect which all datasources are being used
1569
1764
  * and bind those magically to pagination/sorting behavior.
1570
1765
  */
1766
+
1571
1767
  var dataSourceMetadata = {};
1572
1768
  var OptionKey = 'paginateDataSourceKey';
1573
1769
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1770
+
1574
1771
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1575
1772
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1576
1773
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1774
+
1577
1775
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1578
1776
  return onRequestParamsChange(paginateDataSourceKey, payload);
1579
1777
  };
1778
+
1580
1779
  var sortParams = (0, getSorting_1.getSortingParams)({
1581
1780
  requestParams: requestParams,
1582
1781
  meta: meta,
@@ -1591,115 +1790,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1591
1790
  sortParams: sortParams,
1592
1791
  paginatorParams: paginatorParams
1593
1792
  };
1594
- }
1595
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1793
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1794
+
1795
+
1596
1796
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1597
1797
  return null;
1598
1798
  }
1799
+
1599
1800
  return React.createElement(SanitizedReactViz, Object.assign({
1600
1801
  mode: mode,
1601
1802
  width: width,
1602
1803
  height: height
1603
1804
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1604
1805
  };
1806
+
1605
1807
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1606
1808
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1607
1809
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1608
1810
  theme: {}
1609
- });
1610
- // attach viz config
1611
- DashboardViz.config = vizConfig;
1612
- // @ts-ignore: TODO fix sc upgrade TS issues
1811
+ }); // attach viz config
1812
+
1813
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1814
+
1613
1815
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1614
1816
  };
1817
+
1615
1818
  exports.default = withDashboardViz;
1616
1819
 
1617
1820
  /***/ }),
1618
1821
 
1619
- /***/ 37:
1822
+ /***/ 38:
1620
1823
  /***/ (function(module, exports) {
1621
1824
 
1622
1825
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1623
1826
 
1624
1827
  /***/ }),
1625
1828
 
1626
- /***/ 38:
1829
+ /***/ 39:
1627
1830
  /***/ (function(module, exports) {
1628
1831
 
1629
1832
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1630
1833
 
1631
1834
  /***/ }),
1632
1835
 
1633
- /***/ 39:
1836
+ /***/ 4:
1634
1837
  /***/ (function(module, exports) {
1635
1838
 
1636
- module.exports = require("@splunk/moment");
1839
+ module.exports = require("styled-components");
1637
1840
 
1638
1841
  /***/ }),
1639
1842
 
1640
- /***/ 4:
1843
+ /***/ 40:
1641
1844
  /***/ (function(module, exports) {
1642
1845
 
1643
- module.exports = require("styled-components");
1846
+ module.exports = require("@splunk/moment");
1644
1847
 
1645
1848
  /***/ }),
1646
1849
 
1647
- /***/ 40:
1850
+ /***/ 41:
1648
1851
  /***/ (function(module, exports) {
1649
1852
 
1650
1853
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1651
1854
 
1652
1855
  /***/ }),
1653
1856
 
1654
- /***/ 41:
1857
+ /***/ 42:
1655
1858
  /***/ (function(module, exports, __webpack_require__) {
1656
1859
 
1657
1860
  "use strict";
1658
1861
 
1659
1862
 
1660
1863
  var _classCallCheck = __webpack_require__(9);
1864
+
1661
1865
  Object.defineProperty(exports, "__esModule", {
1662
1866
  value: true
1663
1867
  });
1664
1868
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1665
1869
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1870
+
1666
1871
  var T = __webpack_require__(0);
1872
+
1667
1873
  var lodash_1 = __webpack_require__(3);
1668
- var VizActionHandler_1 = __webpack_require__(42);
1669
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1874
+
1875
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1876
+
1877
+
1670
1878
  exports.INITIAL_WIDTH = 250;
1671
1879
  exports.INITIAL_HEIGHT = 250;
1672
1880
  /**
1673
1881
  * A Splunk visualization
1674
1882
  */
1883
+
1675
1884
  var SplunkVisualization = function SplunkVisualization() {
1676
1885
  _classCallCheck(this, SplunkVisualization);
1677
1886
  };
1887
+
1678
1888
  SplunkVisualization.propTypes = {
1679
1889
  /**
1680
1890
  * display mode
1681
1891
  */
1682
1892
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1893
+
1683
1894
  /**
1684
1895
  * width in pixel or string, defaults to 100%
1685
1896
  */
1686
1897
  width: T.oneOfType([T.string, T.number]).isRequired,
1898
+
1687
1899
  /**
1688
1900
  * height in pixel or string
1689
1901
  */
1690
1902
  height: T.oneOfType([T.string, T.number]).isRequired,
1903
+
1691
1904
  /**
1692
1905
  * visualization context used for dynamic option evaluation
1693
1906
  */
1694
1907
  context: T.object,
1908
+
1695
1909
  /**
1696
1910
  * visualization formatting options
1697
1911
  */
1698
1912
  options: T.object,
1913
+
1699
1914
  /**
1700
1915
  * A callback to update formatting options
1701
1916
  */
1702
1917
  onOptionsChange: T.func,
1918
+
1703
1919
  /**
1704
1920
  * datasource state which include data and request params, object key indicate the datasource type.
1705
1921
  */
@@ -1708,6 +1924,7 @@ SplunkVisualization.propTypes = {
1708
1924
  * current request params
1709
1925
  */
1710
1926
  requestParams: T.object,
1927
+
1711
1928
  /**
1712
1929
  * current dataset
1713
1930
  */
@@ -1715,6 +1932,7 @@ SplunkVisualization.propTypes = {
1715
1932
  fields: T.array,
1716
1933
  columns: T.array
1717
1934
  }),
1935
+
1718
1936
  /**
1719
1937
  * error
1720
1938
  */
@@ -1722,29 +1940,35 @@ SplunkVisualization.propTypes = {
1722
1940
  level: T.string,
1723
1941
  message: T.string
1724
1942
  }),
1943
+
1725
1944
  /**
1726
1945
  * meta data that came with the dataset
1727
1946
  */
1728
1947
  meta: T.object
1729
1948
  })),
1949
+
1730
1950
  /**
1731
1951
  * A callback to trigger event
1732
1952
  */
1733
1953
  onEventTrigger: T.func,
1954
+
1734
1955
  /**
1735
1956
  * Inform viz if there are handlers listening to events
1736
1957
  */
1737
1958
  hasEventHandlers: T.bool,
1959
+
1738
1960
  /**
1739
1961
  * A callback to communicate computed props to a consumer
1740
1962
  */
1741
1963
  onComputedProps: T.func,
1964
+
1742
1965
  /**
1743
1966
  * A callback to obtain visualization api
1744
1967
  */
1745
1968
  vizActionHandlerRef: T.func,
1746
1969
  loading: T.bool,
1747
1970
  theme: T.object,
1971
+
1748
1972
  /**
1749
1973
  * A callback to request new data with updated request params
1750
1974
  */
@@ -1753,6 +1977,7 @@ SplunkVisualization.propTypes = {
1753
1977
  /**
1754
1978
  *
1755
1979
  */
1980
+
1756
1981
  SplunkVisualization.defaultProps = {
1757
1982
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1758
1983
  width: '100%',
@@ -1781,39 +2006,6 @@ exports.default = SplunkVisualization;
1781
2006
 
1782
2007
  /***/ }),
1783
2008
 
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
2009
  /***/ 427:
1818
2010
  /***/ (function(module, exports, __webpack_require__) {
1819
2011
 
@@ -1823,6 +2015,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1823
2015
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
1824
2016
  if (k2 === undefined) k2 = k;
1825
2017
  var desc = Object.getOwnPropertyDescriptor(m, k);
2018
+
1826
2019
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
1827
2020
  desc = {
1828
2021
  enumerable: true,
@@ -1831,22 +2024,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
1831
2024
  }
1832
2025
  };
1833
2026
  }
2027
+
1834
2028
  Object.defineProperty(o, k2, desc);
1835
2029
  } : function (o, m, k, k2) {
1836
2030
  if (k2 === undefined) k2 = k;
1837
2031
  o[k2] = m[k];
1838
2032
  });
2033
+
1839
2034
  var __exportStar = this && this.__exportStar || function (m, exports) {
1840
2035
  for (var p in m) {
1841
2036
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1842
2037
  }
1843
2038
  };
2039
+
1844
2040
  Object.defineProperty(exports, "__esModule", {
1845
2041
  value: true
1846
2042
  });
1847
2043
  exports.default = void 0;
1848
- __exportStar(__webpack_require__(162), exports);
1849
- var MarkerGauge_1 = __webpack_require__(162);
2044
+
2045
+ __exportStar(__webpack_require__(163), exports);
2046
+
2047
+ var MarkerGauge_1 = __webpack_require__(163);
2048
+
1850
2049
  Object.defineProperty(exports, "default", {
1851
2050
  enumerable: true,
1852
2051
  get: function get() {
@@ -1864,30 +2063,47 @@ Object.defineProperty(exports, "default", {
1864
2063
 
1865
2064
  var __rest = this && this.__rest || function (s, e) {
1866
2065
  var t = {};
2066
+
1867
2067
  for (var p in s) {
1868
2068
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1869
2069
  }
2070
+
1870
2071
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1871
2072
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1872
2073
  }
1873
2074
  return t;
1874
2075
  };
2076
+
1875
2077
  Object.defineProperty(exports, "__esModule", {
1876
2078
  value: true
1877
2079
  });
2080
+
1878
2081
  var React = __webpack_require__(1);
2082
+
1879
2083
  var react_1 = __webpack_require__(1);
2084
+
1880
2085
  var T = __webpack_require__(0);
2086
+
1881
2087
  var styled_components_1 = __webpack_require__(4);
2088
+
1882
2089
  var lodash_1 = __webpack_require__(3);
2090
+
1883
2091
  var i18n_1 = __webpack_require__(2);
2092
+
1884
2093
  var style_1 = __webpack_require__(14);
2094
+
1885
2095
  var SizeAwareWrapper_1 = __webpack_require__(19);
2096
+
1886
2097
  var Message_1 = __webpack_require__(10);
2098
+
1887
2099
  var id_1 = __webpack_require__(25);
2100
+
1888
2101
  var gaugeUtils_1 = __webpack_require__(98);
2102
+
1889
2103
  var GaugeMajorTicks_1 = __webpack_require__(127);
2104
+
1890
2105
  var GaugeValueMarker_1 = __webpack_require__(128);
2106
+
1891
2107
  var MAX_VERTICAL_CONTAINER_WIDTH = 200;
1892
2108
  var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
1893
2109
  var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
@@ -1932,27 +2148,30 @@ var MarkerBar = styled_components_1.default.rect.attrs({
1932
2148
  displayName: "MarkerGauge__MarkerBar",
1933
2149
  componentId: "sc-10z02va-5"
1934
2150
  })([""]);
2151
+
1935
2152
  var MarkerGauge = function MarkerGauge(_a) {
1936
2153
  var props = __rest(_a, []);
2154
+
1937
2155
  var width = props.width,
1938
- height = props.height,
1939
- value = props.value,
1940
- orientation = props.orientation,
1941
- majorUnit = props.majorUnit,
1942
- showLabels = props.showLabels,
1943
- showValue = props.showValue,
1944
- usePercentageRange = props.usePercentageRange,
1945
- usePercentageValue = props.usePercentageValue,
1946
- backgroundColor = props.backgroundColor,
1947
- fillColor = props.fillColor,
1948
- ranges = props.ranges,
1949
- majorTickFillColor = props.majorTickFillColor,
1950
- majorTickStrokeColor = props.majorTickStrokeColor,
1951
- valueMarkerFillColor = props.valueMarkerFillColor,
1952
- valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
2156
+ height = props.height,
2157
+ value = props.value,
2158
+ orientation = props.orientation,
2159
+ majorUnit = props.majorUnit,
2160
+ showLabels = props.showLabels,
2161
+ showValue = props.showValue,
2162
+ usePercentageRange = props.usePercentageRange,
2163
+ usePercentageValue = props.usePercentageValue,
2164
+ backgroundColor = props.backgroundColor,
2165
+ fillColor = props.fillColor,
2166
+ ranges = props.ranges,
2167
+ majorTickFillColor = props.majorTickFillColor,
2168
+ majorTickStrokeColor = props.majorTickStrokeColor,
2169
+ valueMarkerFillColor = props.valueMarkerFillColor,
2170
+ valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
1953
2171
  /**
1954
2172
  * Standard error message render
1955
2173
  */
2174
+
1956
2175
  var errorMessage = (0, react_1.useCallback)(function (containerWidth, containerHeight, err, errID) {
1957
2176
  return React.createElement(Message_1.default, {
1958
2177
  width: containerWidth,
@@ -1968,17 +2187,20 @@ var MarkerGauge = function MarkerGauge(_a) {
1968
2187
  /**
1969
2188
  * Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
1970
2189
  */
2190
+
1971
2191
  var error = (0, react_1.useMemo)(function () {
1972
2192
  return (0, gaugeUtils_1.validateRanges)(ranges);
1973
2193
  }, [ranges]);
1974
2194
  var sortedRanges = (0, react_1.useMemo)(function () {
1975
2195
  return (0, gaugeUtils_1.getSortedRanges)(ranges);
1976
2196
  }, [ranges]);
2197
+
1977
2198
  var _ref = (0, react_1.useMemo)(function () {
1978
- return (0, gaugeUtils_1.getGaugeRange)(sortedRanges);
1979
- }, [sortedRanges]),
1980
- min = _ref.min,
1981
- max = _ref.max;
2199
+ return (0, gaugeUtils_1.getGaugeRange)(sortedRanges);
2200
+ }, [sortedRanges]),
2201
+ min = _ref.min,
2202
+ max = _ref.max;
2203
+
1982
2204
  var linearGradientId = (0, react_1.useMemo)(function () {
1983
2205
  return (0, id_1.createDOMID)('marker');
1984
2206
  }, []);
@@ -1987,11 +2209,13 @@ var MarkerGauge = function MarkerGauge(_a) {
1987
2209
  ranges: sortedRanges,
1988
2210
  orientation: orientation
1989
2211
  });
2212
+
1990
2213
  var _ref2 = (0, gaugeUtils_1.getGradientDimensions)(orientation),
1991
- x1 = _ref2.x1,
1992
- y1 = _ref2.y1,
1993
- x2 = _ref2.x2,
1994
- y2 = _ref2.y2;
2214
+ x1 = _ref2.x1,
2215
+ y1 = _ref2.y1,
2216
+ x2 = _ref2.x2,
2217
+ y2 = _ref2.y2;
2218
+
1995
2219
  var linearGradientStops = stops.map(function (stop) {
1996
2220
  return React.createElement("stop", {
1997
2221
  key: "".concat(stop.offset, "_").concat(stop.stopColor),
@@ -2010,42 +2234,46 @@ var MarkerGauge = function MarkerGauge(_a) {
2010
2234
  /**
2011
2235
  * Calculate marker gauge dimensions
2012
2236
  */
2237
+
2013
2238
  var calculateMarkerGaugeDimensions = (0, react_1.useCallback)(function (containerWidth, containerHeight) {
2014
2239
  var _ref3 = (0, gaugeUtils_1.getGaugeDimensions)({
2015
- containerWidth: containerWidth,
2016
- containerHeight: containerHeight,
2017
- orientation: orientation
2018
- }),
2019
- gaugeLength = _ref3.gaugeLength,
2020
- gaugeStartX = _ref3.gaugeStartX,
2021
- gaugeStartY = _ref3.gaugeStartY,
2022
- gaugeWidth = _ref3.gaugeWidth,
2023
- gaugeHeight = _ref3.gaugeHeight;
2240
+ containerWidth: containerWidth,
2241
+ containerHeight: containerHeight,
2242
+ orientation: orientation
2243
+ }),
2244
+ gaugeLength = _ref3.gaugeLength,
2245
+ gaugeStartX = _ref3.gaugeStartX,
2246
+ gaugeStartY = _ref3.gaugeStartY,
2247
+ gaugeWidth = _ref3.gaugeWidth,
2248
+ gaugeHeight = _ref3.gaugeHeight;
2249
+
2024
2250
  var _ref4 = (0, gaugeUtils_1.getMarkerBarDimensions)({
2025
- gaugeLength: gaugeLength,
2026
- gaugeStartX: gaugeStartX,
2027
- gaugeStartY: gaugeStartY,
2028
- gaugeWidth: gaugeWidth,
2029
- gaugeHeight: gaugeHeight,
2030
- orientation: orientation
2031
- }),
2032
- markerBarLength = _ref4.markerBarLength,
2033
- markerBarX = _ref4.markerBarX,
2034
- markerBarY = _ref4.markerBarY,
2035
- markerBarWidth = _ref4.markerBarWidth,
2036
- markerBarHeight = _ref4.markerBarHeight;
2251
+ gaugeLength: gaugeLength,
2252
+ gaugeStartX: gaugeStartX,
2253
+ gaugeStartY: gaugeStartY,
2254
+ gaugeWidth: gaugeWidth,
2255
+ gaugeHeight: gaugeHeight,
2256
+ orientation: orientation
2257
+ }),
2258
+ markerBarLength = _ref4.markerBarLength,
2259
+ markerBarX = _ref4.markerBarX,
2260
+ markerBarY = _ref4.markerBarY,
2261
+ markerBarWidth = _ref4.markerBarWidth,
2262
+ markerBarHeight = _ref4.markerBarHeight;
2263
+
2037
2264
  var _ref5 = (0, gaugeUtils_1.getMarkerGaugeValueMarkerPositions)({
2038
- markerBarX: markerBarX,
2039
- markerBarY: markerBarY,
2040
- markerBarHeight: markerBarHeight,
2041
- markerBarLength: markerBarLength,
2042
- orientation: orientation,
2043
- value: value,
2044
- min: min,
2045
- max: max
2046
- }),
2047
- valueMarkerX = _ref5.valueMarkerX,
2048
- valueMarkerY = _ref5.valueMarkerY;
2265
+ markerBarX: markerBarX,
2266
+ markerBarY: markerBarY,
2267
+ markerBarHeight: markerBarHeight,
2268
+ markerBarLength: markerBarLength,
2269
+ orientation: orientation,
2270
+ value: value,
2271
+ min: min,
2272
+ max: max
2273
+ }),
2274
+ valueMarkerX = _ref5.valueMarkerX,
2275
+ valueMarkerY = _ref5.valueMarkerY;
2276
+
2049
2277
  return {
2050
2278
  markerBarX: markerBarX,
2051
2279
  markerBarY: markerBarY,
@@ -2061,26 +2289,30 @@ var MarkerGauge = function MarkerGauge(_a) {
2061
2289
  }, [orientation, value, min, max]);
2062
2290
  var renderVisualization = (0, react_1.useCallback)(function (_ref6) {
2063
2291
  var containerWidth = _ref6.width,
2064
- containerHeight = _ref6.height;
2292
+ containerHeight = _ref6.height;
2293
+
2065
2294
  // todo: need change the size when get design for smaller space
2066
2295
  // 58 is the title & description header height in dashboard visualization
2067
2296
  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
2297
  return errorMessage(containerWidth, containerHeight, (0, i18n_1._)('Too small to render content'), errorId);
2069
2298
  }
2299
+
2070
2300
  if (error) {
2071
2301
  return errorMessage(containerWidth, containerHeight, error, errorId);
2072
2302
  }
2303
+
2073
2304
  var _calculateMarkerGauge = calculateMarkerGaugeDimensions(containerWidth, containerHeight),
2074
- markerBarX = _calculateMarkerGauge.markerBarX,
2075
- markerBarY = _calculateMarkerGauge.markerBarY,
2076
- markerBarWidth = _calculateMarkerGauge.markerBarWidth,
2077
- markerBarHeight = _calculateMarkerGauge.markerBarHeight,
2078
- valueMarkerX = _calculateMarkerGauge.valueMarkerX,
2079
- valueMarkerY = _calculateMarkerGauge.valueMarkerY,
2080
- gaugeStartX = _calculateMarkerGauge.gaugeStartX,
2081
- gaugeStartY = _calculateMarkerGauge.gaugeStartY,
2082
- gaugeWidth = _calculateMarkerGauge.gaugeWidth,
2083
- gaugeHeight = _calculateMarkerGauge.gaugeHeight;
2305
+ markerBarX = _calculateMarkerGauge.markerBarX,
2306
+ markerBarY = _calculateMarkerGauge.markerBarY,
2307
+ markerBarWidth = _calculateMarkerGauge.markerBarWidth,
2308
+ markerBarHeight = _calculateMarkerGauge.markerBarHeight,
2309
+ valueMarkerX = _calculateMarkerGauge.valueMarkerX,
2310
+ valueMarkerY = _calculateMarkerGauge.valueMarkerY,
2311
+ gaugeStartX = _calculateMarkerGauge.gaugeStartX,
2312
+ gaugeStartY = _calculateMarkerGauge.gaugeStartY,
2313
+ gaugeWidth = _calculateMarkerGauge.gaugeWidth,
2314
+ gaugeHeight = _calculateMarkerGauge.gaugeHeight;
2315
+
2084
2316
  return React.createElement(MarkerGaugeWrapper, {
2085
2317
  backgroundColor: backgroundColor
2086
2318
  }, React.createElement(MarkerGaugeContainer, {
@@ -2137,6 +2369,7 @@ var MarkerGauge = function MarkerGauge(_a) {
2137
2369
  return renderVisualization(containerDimension);
2138
2370
  }));
2139
2371
  };
2372
+
2140
2373
  MarkerGauge.propTypes = {
2141
2374
  width: T.oneOfType([T.string, T.number]),
2142
2375
  height: T.oneOfType([T.string, T.number]),
@@ -2203,17 +2436,29 @@ exports.default = MarkerGauge;
2203
2436
  Object.defineProperty(exports, "__esModule", {
2204
2437
  value: true
2205
2438
  });
2439
+
2206
2440
  var i18n_1 = __webpack_require__(2);
2441
+
2207
2442
  var GaugeMarker_1 = __webpack_require__(430);
2443
+
2208
2444
  var placeholders_1 = __webpack_require__(50);
2445
+
2209
2446
  var schemaUtils_1 = __webpack_require__(16);
2447
+
2210
2448
  var variables_1 = __webpack_require__(11);
2449
+
2211
2450
  var pick_1 = __webpack_require__(23);
2451
+
2212
2452
  var Gauge_1 = __webpack_require__(126);
2453
+
2213
2454
  var VizBehavior_1 = __webpack_require__(6);
2214
- var VizCategory_1 = __webpack_require__(35);
2455
+
2456
+ var VizCategory_1 = __webpack_require__(36);
2457
+
2215
2458
  var configUtils_1 = __webpack_require__(20);
2459
+
2216
2460
  var BackgroundColor_1 = __webpack_require__(53);
2461
+
2217
2462
  var dataContract = {
2218
2463
  requiredDataSources: [{
2219
2464
  name: 'primary',
@@ -2326,12 +2571,13 @@ var themes = {
2326
2571
  enterprise: {
2327
2572
  light: variables_1.default.gray30(props),
2328
2573
  dark: variables_1.default.textGray(props) // was #D7DAE0
2329
- },
2330
2574
 
2575
+ },
2331
2576
  prisma: {
2332
2577
  // TODO: missed colors :(
2333
2578
  light: variables_1.default.neutral100(props),
2334
2579
  dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
2580
+
2335
2581
  }
2336
2582
  })(props);
2337
2583
  },
@@ -2392,6 +2638,7 @@ var editorConfig = [{
2392
2638
  editorProps: {
2393
2639
  openRanges: false,
2394
2640
  isTogglable: false // Can not disable thresholds
2641
+
2395
2642
  }
2396
2643
  }], (0, BackgroundColor_1.default)({
2397
2644
  themes: themes,
@@ -2401,16 +2648,19 @@ var editorConfig = [{
2401
2648
  /**
2402
2649
  * visualization configuration
2403
2650
  */
2651
+
2404
2652
  var config = {
2405
2653
  /**
2406
2654
  * unique viz key
2407
2655
  */
2408
2656
  key: 'splunk.markergauge',
2657
+
2409
2658
  /**
2410
2659
  * viz name
2411
2660
  */
2412
2661
  name: (0, i18n_1._)('Marker gauge'),
2413
2662
  category: VizCategory_1.VizCategory.GAUGE,
2663
+
2414
2664
  /**
2415
2665
  * viz icon
2416
2666
  */
@@ -2434,11 +2684,35 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
2434
2684
  "use strict";
2435
2685
 
2436
2686
 
2687
+ var _classCallCheck = __webpack_require__(9);
2688
+
2689
+ var _createClass = __webpack_require__(18);
2690
+
2437
2691
  Object.defineProperty(exports, "__esModule", {
2438
2692
  value: true
2439
2693
  });
2440
- exports.validSortDirs = void 0;
2441
- exports.validSortDirs = ['asc', 'desc', 'none'];
2694
+ exports.DefaultVizActionHandler = void 0;
2695
+
2696
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
2697
+ function DefaultVizActionHandler() {
2698
+ _classCallCheck(this, DefaultVizActionHandler);
2699
+ }
2700
+
2701
+ _createClass(DefaultVizActionHandler, [{
2702
+ key: "focus",
2703
+ value: function focus() {// noop
2704
+ }
2705
+ }, {
2706
+ key: "snapshot",
2707
+ value: function snapshot() {
2708
+ return null; // noop
2709
+ }
2710
+ }]);
2711
+
2712
+ return DefaultVizActionHandler;
2713
+ }();
2714
+
2715
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
2442
2716
 
2443
2717
  /***/ }),
2444
2718
 
@@ -2459,7 +2733,9 @@ Object.defineProperty(exports, "__esModule", {
2459
2733
  value: true
2460
2734
  });
2461
2735
  exports.useDeepMemo = void 0;
2736
+
2462
2737
  var react_1 = __webpack_require__(1);
2738
+
2463
2739
  var lodash_1 = __webpack_require__(3);
2464
2740
  /**
2465
2741
  * This hook evaluates and stores the result of a passed function and only
@@ -2474,16 +2750,21 @@ var lodash_1 = __webpack_require__(3);
2474
2750
  * @param fn the function to be executed and
2475
2751
  * @param dependencies an array of dependencies
2476
2752
  */
2753
+
2754
+
2477
2755
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
2478
2756
  var ref = (0, react_1.useRef)();
2757
+
2479
2758
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
2480
2759
  ref.current = {
2481
2760
  dependencies: dependencies,
2482
2761
  value: fn()
2483
2762
  };
2484
2763
  }
2764
+
2485
2765
  return ref.current.value;
2486
2766
  };
2767
+
2487
2768
  exports.useDeepMemo = useDeepMemo;
2488
2769
 
2489
2770
  /***/ }),
@@ -2498,19 +2779,27 @@ Object.defineProperty(exports, "__esModule", {
2498
2779
  value: true
2499
2780
  });
2500
2781
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2782
+
2501
2783
  var React = __webpack_require__(1);
2784
+
2502
2785
  var T = __webpack_require__(0);
2786
+
2503
2787
  var i18n_1 = __webpack_require__(2);
2788
+
2504
2789
  var Message_1 = __webpack_require__(10);
2790
+
2505
2791
  var FixedSizeContainer_1 = __webpack_require__(13);
2506
2792
  /**
2507
2793
  * @method isMissing
2508
2794
  * @param {any} v
2509
2795
  * @returns {boolean} true if the input value === null or undefined
2510
2796
  */
2797
+
2798
+
2511
2799
  var isMissing = function isMissing(v) {
2512
2800
  return v === null || v === undefined;
2513
2801
  };
2802
+
2514
2803
  exports.isMissing = isMissing;
2515
2804
  /**
2516
2805
  * @method misskingKeys
@@ -2518,11 +2807,13 @@ exports.isMissing = isMissing;
2518
2807
  * @param {object} target
2519
2808
  * @returns {string[]} the keys of missing required props
2520
2809
  */
2810
+
2521
2811
  var missingKeys = function missingKeys(keys, target) {
2522
2812
  return keys.filter(function (k) {
2523
2813
  return (0, exports.isMissing)(target[k]);
2524
2814
  });
2525
2815
  };
2816
+
2526
2817
  exports.missingKeys = missingKeys;
2527
2818
  var propTypes = {
2528
2819
  width: T.oneOfType([T.string, T.number]),
@@ -2536,10 +2827,11 @@ var propTypes = {
2536
2827
  * @param {MissingPropsProps} props
2537
2828
  * @returns {React.ReactElement}
2538
2829
  */
2830
+
2539
2831
  var MissingPropsMessage = function MissingPropsMessage(props) {
2540
2832
  var width = props.width,
2541
- height = props.height,
2542
- missingProps = props.missingProps;
2833
+ height = props.height,
2834
+ missingProps = props.missingProps;
2543
2835
  return React.createElement(Message_1.default, {
2544
2836
  "data-test": "message",
2545
2837
  width: width,
@@ -2547,6 +2839,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
2547
2839
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
2548
2840
  });
2549
2841
  };
2842
+
2550
2843
  exports.MissingPropsMessage = MissingPropsMessage;
2551
2844
  exports.MissingPropsMessage.propTypes = propTypes;
2552
2845
  exports.MissingPropsMessage.defaultProps = {
@@ -2566,15 +2859,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
2566
2859
  Object.defineProperty(exports, "__esModule", {
2567
2860
  value: true
2568
2861
  });
2862
+
2569
2863
  var React = __webpack_require__(1);
2864
+
2570
2865
  var styled_components_1 = __webpack_require__(4);
2866
+
2571
2867
  var hocUtils_1 = __webpack_require__(15);
2868
+
2572
2869
  var Cover = styled_components_1.default.div.withConfig({
2573
2870
  displayName: "withEditModeCover__Cover",
2574
2871
  componentId: "sc-1gsbnxb-0"
2575
2872
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2576
2873
  var Blocker = styled_components_1.default.div.attrs({
2577
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
2874
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
2578
2875
  }).withConfig({
2579
2876
  displayName: "withEditModeCover__Blocker",
2580
2877
  componentId: "sc-1gsbnxb-1"
@@ -2585,6 +2882,7 @@ var Blocker = styled_components_1.default.div.attrs({
2585
2882
  * @param {ExtendedDashViz} Visualization
2586
2883
  * @returns {ExtendedDashViz} Wrapper
2587
2884
  */
2885
+
2588
2886
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
2589
2887
  var Wrapper = function Wrapper(props) {
2590
2888
  var mode = props.mode;
@@ -2593,12 +2891,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
2593
2891
  "data-test": "edit-mode-cover"
2594
2892
  }));
2595
2893
  };
2894
+
2596
2895
  (0, hocUtils_1.extendStaticWrapperProps)({
2597
2896
  Wrapper: Wrapper,
2598
2897
  Visualization: Visualization
2599
2898
  });
2600
2899
  return Wrapper;
2601
2900
  };
2901
+
2602
2902
  exports.default = withEditModeCover;
2603
2903
 
2604
2904
  /***/ }),
@@ -2612,27 +2912,37 @@ exports.default = withEditModeCover;
2612
2912
  Object.defineProperty(exports, "__esModule", {
2613
2913
  value: true
2614
2914
  });
2915
+
2615
2916
  var React = __webpack_require__(1);
2917
+
2616
2918
  var colorUtils_1 = __webpack_require__(12);
2919
+
2617
2920
  var variables_1 = __webpack_require__(11);
2921
+
2618
2922
  var IconPlaceholder_1 = __webpack_require__(32);
2923
+
2619
2924
  var VizBehavior_1 = __webpack_require__(6);
2925
+
2620
2926
  var hocUtils_1 = __webpack_require__(15);
2927
+
2621
2928
  var withPlaceholder = function withPlaceholder(Visualization) {
2622
2929
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
2623
2930
  var config = Visualization.config;
2624
2931
  var themes = config.themes;
2932
+
2625
2933
  var Wrapper = function Wrapper(props) {
2626
2934
  var _a, _b;
2935
+
2627
2936
  var dataSources = props.dataSources,
2628
- loading = props.loading,
2629
- options = props.options,
2630
- height = props.height,
2631
- width = props.width;
2937
+ loading = props.loading,
2938
+ options = props.options,
2939
+ height = props.height,
2940
+ width = props.width;
2632
2941
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
2633
2942
  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
2943
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
2635
2944
  var iconColor = variables_1.default.contentColorActive(props);
2945
+
2636
2946
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
2637
2947
  return React.createElement(IconPlaceholder_1.default, {
2638
2948
  "data-test": "icon-placeholder",
@@ -2643,14 +2953,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
2643
2953
  iconColor: iconColor
2644
2954
  });
2645
2955
  }
2956
+
2646
2957
  return React.createElement(Visualization, Object.assign({}, props));
2647
2958
  };
2959
+
2648
2960
  (0, hocUtils_1.extendStaticWrapperProps)({
2649
2961
  Wrapper: Wrapper,
2650
2962
  Visualization: Visualization
2651
2963
  });
2652
2964
  return Wrapper;
2653
2965
  };
2966
+
2654
2967
  exports.default = withPlaceholder;
2655
2968
 
2656
2969
  /***/ }),
@@ -2685,11 +2998,13 @@ module.exports = require("@splunk/visualization-icons/placeholders");
2685
2998
  Object.defineProperty(exports, "__esModule", {
2686
2999
  value: true
2687
3000
  });
3001
+
2688
3002
  var i18n_1 = __webpack_require__(2);
3003
+
2689
3004
  var background = function background(_ref) {
2690
3005
  var label = _ref.label,
2691
- themes = _ref.themes,
2692
- labelPosition = _ref.labelPosition;
3006
+ themes = _ref.themes,
3007
+ labelPosition = _ref.labelPosition;
2693
3008
  return [{
2694
3009
  label: (0, i18n_1._)(label || 'Background'),
2695
3010
  option: 'backgroundColor',
@@ -2700,6 +3015,7 @@ var background = function background(_ref) {
2700
3015
  }
2701
3016
  }];
2702
3017
  };
3018
+
2703
3019
  exports.default = background;
2704
3020
 
2705
3021
  /***/ }),
@@ -2715,6 +3031,7 @@ Object.defineProperty(exports, "__esModule", {
2715
3031
  });
2716
3032
  exports.VizBehavior = void 0;
2717
3033
  var VizBehavior;
3034
+
2718
3035
  (function (VizBehavior) {
2719
3036
  /**
2720
3037
  * Dynamic Options Behavior.
@@ -2734,6 +3051,7 @@ var VizBehavior;
2734
3051
  * missing.
2735
3052
  * @type {string}
2736
3053
  */
3054
+
2737
3055
  VizBehavior["PLACEHOLDER"] = "placeholder";
2738
3056
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
2739
3057
  VizBehavior["TRELLIS"] = "trellis";
@@ -2769,13 +3087,18 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
2769
3087
 
2770
3088
 
2771
3089
  var _toConsumableArray = __webpack_require__(8);
3090
+
2772
3091
  Object.defineProperty(exports, "__esModule", {
2773
3092
  value: true
2774
3093
  });
2775
3094
  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;
3095
+
2776
3096
  var lodash_1 = __webpack_require__(3);
3097
+
2777
3098
  var colorConstants_1 = __webpack_require__(49);
3099
+
2778
3100
  var i18n_1 = __webpack_require__(2);
3101
+
2779
3102
  exports.GAUGE_THICKNESS = 50;
2780
3103
  exports.FILL_THICKNESS = 38;
2781
3104
  var GRADIENT_STOP_OFFSET_MIN = 0;
@@ -2788,11 +3111,13 @@ var GRADIENT_STOP_OFFSET_MAX = 100;
2788
3111
  * @param {String} orientation
2789
3112
  * @return {Number} width
2790
3113
  */
3114
+
2791
3115
  var getGaugeWidth = function getGaugeWidth(_ref) {
2792
3116
  var containerWidth = _ref.containerWidth,
2793
- orientation = _ref.orientation;
3117
+ orientation = _ref.orientation;
2794
3118
  return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
2795
3119
  };
3120
+
2796
3121
  exports.getGaugeWidth = getGaugeWidth;
2797
3122
  /**
2798
3123
  * get height for the whole gauge viz for horizontal or vertical view
@@ -2802,11 +3127,13 @@ exports.getGaugeWidth = getGaugeWidth;
2802
3127
  * @param {String} orientation
2803
3128
  * @return {Number} height
2804
3129
  */
3130
+
2805
3131
  var getGaugeHeight = function getGaugeHeight(_ref2) {
2806
3132
  var containerHeight = _ref2.containerHeight,
2807
- orientation = _ref2.orientation;
3133
+ orientation = _ref2.orientation;
2808
3134
  return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
2809
3135
  };
3136
+
2810
3137
  exports.getGaugeHeight = getGaugeHeight;
2811
3138
  /**
2812
3139
  * get how long the gauge shoud be.
@@ -2818,10 +3145,11 @@ exports.getGaugeHeight = getGaugeHeight;
2818
3145
  * @param {String} input.orientation
2819
3146
  * @return {Number} gaugeLength
2820
3147
  */
3148
+
2821
3149
  var getGaugeLength = function getGaugeLength(_ref3) {
2822
3150
  var containerWidth = _ref3.containerWidth,
2823
- containerHeight = _ref3.containerHeight,
2824
- orientation = _ref3.orientation;
3151
+ containerHeight = _ref3.containerHeight,
3152
+ orientation = _ref3.orientation;
2825
3153
  return orientation === 'vertical' ? (0, exports.getGaugeHeight)({
2826
3154
  containerHeight: containerHeight,
2827
3155
  orientation: orientation
@@ -2830,6 +3158,7 @@ var getGaugeLength = function getGaugeLength(_ref3) {
2830
3158
  orientation: orientation
2831
3159
  });
2832
3160
  };
3161
+
2833
3162
  exports.getGaugeLength = getGaugeLength;
2834
3163
  /**
2835
3164
  * get start x and y for rendering gauge
@@ -2843,23 +3172,27 @@ exports.getGaugeLength = getGaugeLength;
2843
3172
  * @return {Number} position.gaugeStartX
2844
3173
  * @return {Number} position.gaugeStartY
2845
3174
  */
3175
+
2846
3176
  var getGaugeStartPosition = function getGaugeStartPosition(_ref4) {
2847
3177
  var containerWidth = _ref4.containerWidth,
2848
- containerHeight = _ref4.containerHeight,
2849
- gaugeLength = _ref4.gaugeLength,
2850
- orientation = _ref4.orientation;
3178
+ containerHeight = _ref4.containerHeight,
3179
+ gaugeLength = _ref4.gaugeLength,
3180
+ orientation = _ref4.orientation;
2851
3181
  // for horizontal view
2852
3182
  var gaugeStartX = (containerWidth - gaugeLength) / 2.0;
2853
3183
  var gaugeStartY = (containerHeight - exports.GAUGE_THICKNESS) / 2.0;
3184
+
2854
3185
  if (orientation === 'vertical') {
2855
3186
  gaugeStartX = (containerWidth - exports.GAUGE_THICKNESS) / 2.0;
2856
3187
  gaugeStartY = (containerHeight - gaugeLength) / 2.0;
2857
3188
  }
3189
+
2858
3190
  return {
2859
3191
  gaugeStartX: gaugeStartX,
2860
3192
  gaugeStartY: gaugeStartY
2861
3193
  };
2862
3194
  };
3195
+
2863
3196
  exports.getGaugeStartPosition = getGaugeStartPosition;
2864
3197
  /**
2865
3198
  * get dimensions for the whole gauge viz,
@@ -2876,23 +3209,26 @@ exports.getGaugeStartPosition = getGaugeStartPosition;
2876
3209
  * @return {Number} gaugeDimensions.gaugeWidth natural width of gauge
2877
3210
  * @return {Number} gaugeDimensions.gaugeHeight natural height of gauge
2878
3211
  */
3212
+
2879
3213
  var getGaugeDimensions = function getGaugeDimensions(_ref5) {
2880
3214
  var containerWidth = _ref5.containerWidth,
2881
- containerHeight = _ref5.containerHeight,
2882
- orientation = _ref5.orientation;
3215
+ containerHeight = _ref5.containerHeight,
3216
+ orientation = _ref5.orientation;
2883
3217
  var gaugeLength = (0, exports.getGaugeLength)({
2884
3218
  containerWidth: containerWidth,
2885
3219
  containerHeight: containerHeight,
2886
3220
  orientation: orientation
2887
3221
  });
3222
+
2888
3223
  var _ref6 = (0, exports.getGaugeStartPosition)({
2889
- containerWidth: containerWidth,
2890
- containerHeight: containerHeight,
2891
- gaugeLength: gaugeLength,
2892
- orientation: orientation
2893
- }),
2894
- gaugeStartX = _ref6.gaugeStartX,
2895
- gaugeStartY = _ref6.gaugeStartY;
3224
+ containerWidth: containerWidth,
3225
+ containerHeight: containerHeight,
3226
+ gaugeLength: gaugeLength,
3227
+ orientation: orientation
3228
+ }),
3229
+ gaugeStartX = _ref6.gaugeStartX,
3230
+ gaugeStartY = _ref6.gaugeStartY;
3231
+
2896
3232
  var gaugeWidth = (0, exports.getGaugeWidth)({
2897
3233
  containerWidth: containerWidth,
2898
3234
  orientation: orientation
@@ -2909,6 +3245,7 @@ var getGaugeDimensions = function getGaugeDimensions(_ref5) {
2909
3245
  gaugeHeight: gaugeHeight
2910
3246
  };
2911
3247
  };
3248
+
2912
3249
  exports.getGaugeDimensions = getGaugeDimensions;
2913
3250
  /**
2914
3251
  * if gaugeColor is not specified, auto assign a gauge color to the fill bar
@@ -2916,19 +3253,24 @@ exports.getGaugeDimensions = getGaugeDimensions;
2916
3253
  * @method assignGaugeColor
2917
3254
  * @params
2918
3255
  * */
3256
+
2919
3257
  var assignGaugeColor = function assignGaugeColor(_ref7) {
2920
3258
  var value = _ref7.value,
2921
- min = _ref7.min,
2922
- max = _ref7.max;
3259
+ min = _ref7.min,
3260
+ max = _ref7.max;
2923
3261
  var rate = (value - min) / (max - min);
3262
+
2924
3263
  if (rate <= 0.3) {
2925
3264
  return colorConstants_1.SEMANTIC_SUCCESS;
2926
3265
  }
3266
+
2927
3267
  if (rate > 0.3 && rate <= 0.6) {
2928
3268
  return colorConstants_1.SEMANTIC_WARNING;
2929
3269
  }
3270
+
2930
3271
  return colorConstants_1.SEMANTIC_ERROR;
2931
3272
  };
3273
+
2932
3274
  exports.assignGaugeColor = assignGaugeColor;
2933
3275
  /**
2934
3276
  * get inner bar length in gauge
@@ -2940,22 +3282,28 @@ exports.assignGaugeColor = assignGaugeColor;
2940
3282
  * @param {Number} input.max
2941
3283
  * @return {Number} gaugeBarLength
2942
3284
  */
3285
+
2943
3286
  var getGaugeBarLength = function getGaugeBarLength(_ref8) {
2944
3287
  var gaugeLength = _ref8.gaugeLength,
2945
- value = _ref8.value,
2946
- min = _ref8.min,
2947
- max = _ref8.max;
3288
+ value = _ref8.value,
3289
+ min = _ref8.min,
3290
+ max = _ref8.max;
3291
+
2948
3292
  if (max < min) {
2949
3293
  return null;
2950
3294
  }
3295
+
2951
3296
  if (value >= max) {
2952
3297
  return gaugeLength;
2953
3298
  }
3299
+
2954
3300
  if (value < min) {
2955
3301
  return 0;
2956
3302
  }
3303
+
2957
3304
  return gaugeLength * (value - min) / (max - min);
2958
3305
  };
3306
+
2959
3307
  exports.getGaugeBarLength = getGaugeBarLength;
2960
3308
  /**
2961
3309
  * get x and y position for rendering inner bar in gauge
@@ -2971,26 +3319,30 @@ exports.getGaugeBarLength = getGaugeBarLength;
2971
3319
  * @return {Number} position.gaugeBarX
2972
3320
  * @return {Number} position.gaugeBarY
2973
3321
  */
3322
+
2974
3323
  var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref9) {
2975
3324
  var gaugeStartX = _ref9.gaugeStartX,
2976
- gaugeStartY = _ref9.gaugeStartY,
2977
- gaugeWidth = _ref9.gaugeWidth,
2978
- gaugeHeight = _ref9.gaugeHeight,
2979
- gaugeBarLength = _ref9.gaugeBarLength,
2980
- orientation = _ref9.orientation;
3325
+ gaugeStartY = _ref9.gaugeStartY,
3326
+ gaugeWidth = _ref9.gaugeWidth,
3327
+ gaugeHeight = _ref9.gaugeHeight,
3328
+ gaugeBarLength = _ref9.gaugeBarLength,
3329
+ orientation = _ref9.orientation;
2981
3330
  var gaugeBarX = gaugeStartX;
2982
3331
  var gaugeBarY = gaugeStartY;
3332
+
2983
3333
  if (orientation === 'vertical') {
2984
3334
  gaugeBarX += (gaugeWidth - exports.FILL_THICKNESS) / 2;
2985
3335
  gaugeBarY += gaugeHeight - gaugeBarLength;
2986
3336
  } else {
2987
3337
  gaugeBarY += (gaugeHeight - exports.FILL_THICKNESS) / 2;
2988
3338
  }
3339
+
2989
3340
  return {
2990
3341
  gaugeBarX: gaugeBarX,
2991
3342
  gaugeBarY: gaugeBarY
2992
3343
  };
2993
3344
  };
3345
+
2994
3346
  exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
2995
3347
  /**
2996
3348
  * get width of inner bar in gauge
@@ -3000,11 +3352,13 @@ exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
3000
3352
  * @param {String} orientation
3001
3353
  * @return {Number} gaugeBarWidth
3002
3354
  */
3355
+
3003
3356
  var getGaugeBarWidth = function getGaugeBarWidth(_ref10) {
3004
3357
  var gaugeBarLength = _ref10.gaugeBarLength,
3005
- orientation = _ref10.orientation;
3358
+ orientation = _ref10.orientation;
3006
3359
  return orientation === 'vertical' ? exports.FILL_THICKNESS : gaugeBarLength;
3007
3360
  };
3361
+
3008
3362
  exports.getGaugeBarWidth = getGaugeBarWidth;
3009
3363
  /**
3010
3364
  * get height of inner bar in gauge
@@ -3014,11 +3368,13 @@ exports.getGaugeBarWidth = getGaugeBarWidth;
3014
3368
  * @param {String} orientation
3015
3369
  * @return {Number} gaugeBarHeight
3016
3370
  */
3371
+
3017
3372
  var getGaugeBarHeight = function getGaugeBarHeight(_ref11) {
3018
3373
  var gaugeBarLength = _ref11.gaugeBarLength,
3019
- orientation = _ref11.orientation;
3374
+ orientation = _ref11.orientation;
3020
3375
  return orientation === 'vertical' ? gaugeBarLength : exports.FILL_THICKNESS;
3021
3376
  };
3377
+
3022
3378
  exports.getGaugeBarHeight = getGaugeBarHeight;
3023
3379
  /**
3024
3380
  * get dimensions for the fill bar in the gauge
@@ -3040,32 +3396,35 @@ exports.getGaugeBarHeight = getGaugeBarHeight;
3040
3396
  * @return {Number} fillBarDimensions.fillBarWidth
3041
3397
  * @return {Number} fillBarDimensions.fillBarHeight
3042
3398
  */
3399
+
3043
3400
  var getFillBarDimensions = function getFillBarDimensions(_ref12) {
3044
3401
  var gaugeLength = _ref12.gaugeLength,
3045
- gaugeStartX = _ref12.gaugeStartX,
3046
- gaugeStartY = _ref12.gaugeStartY,
3047
- gaugeWidth = _ref12.gaugeWidth,
3048
- gaugeHeight = _ref12.gaugeHeight,
3049
- value = _ref12.value,
3050
- min = _ref12.min,
3051
- max = _ref12.max,
3052
- orientation = _ref12.orientation;
3402
+ gaugeStartX = _ref12.gaugeStartX,
3403
+ gaugeStartY = _ref12.gaugeStartY,
3404
+ gaugeWidth = _ref12.gaugeWidth,
3405
+ gaugeHeight = _ref12.gaugeHeight,
3406
+ value = _ref12.value,
3407
+ min = _ref12.min,
3408
+ max = _ref12.max,
3409
+ orientation = _ref12.orientation;
3053
3410
  var gaugeBarLength = (0, exports.getGaugeBarLength)({
3054
3411
  gaugeLength: gaugeLength,
3055
3412
  value: value,
3056
3413
  max: max,
3057
3414
  min: min
3058
3415
  });
3416
+
3059
3417
  var _ref13 = (0, exports.getGaugeBarStartPositions)({
3060
- gaugeStartX: gaugeStartX,
3061
- gaugeStartY: gaugeStartY,
3062
- gaugeWidth: gaugeWidth,
3063
- gaugeHeight: gaugeHeight,
3064
- gaugeBarLength: gaugeBarLength,
3065
- orientation: orientation
3066
- }),
3067
- fillBarX = _ref13.gaugeBarX,
3068
- fillBarY = _ref13.gaugeBarY;
3418
+ gaugeStartX: gaugeStartX,
3419
+ gaugeStartY: gaugeStartY,
3420
+ gaugeWidth: gaugeWidth,
3421
+ gaugeHeight: gaugeHeight,
3422
+ gaugeBarLength: gaugeBarLength,
3423
+ orientation: orientation
3424
+ }),
3425
+ fillBarX = _ref13.gaugeBarX,
3426
+ fillBarY = _ref13.gaugeBarY;
3427
+
3069
3428
  var fillBarWidth = (0, exports.getGaugeBarWidth)({
3070
3429
  gaugeBarLength: gaugeBarLength,
3071
3430
  orientation: orientation
@@ -3082,6 +3441,7 @@ var getFillBarDimensions = function getFillBarDimensions(_ref12) {
3082
3441
  fillBarHeight: fillBarHeight
3083
3442
  };
3084
3443
  };
3444
+
3085
3445
  exports.getFillBarDimensions = getFillBarDimensions;
3086
3446
  /**
3087
3447
  * get position x and y for value marker in filler gauge
@@ -3095,24 +3455,28 @@ exports.getFillBarDimensions = getFillBarDimensions;
3095
3455
  * @return {Number} position.valueMarkerX
3096
3456
  * @return {Number} position.valueMarkerY
3097
3457
  */
3458
+
3098
3459
  var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref14) {
3099
3460
  var fillBarX = _ref14.fillBarX,
3100
- fillBarY = _ref14.fillBarY,
3101
- fillBarLength = _ref14.fillBarLength,
3102
- orientation = _ref14.orientation;
3461
+ fillBarY = _ref14.fillBarY,
3462
+ fillBarLength = _ref14.fillBarLength,
3463
+ orientation = _ref14.orientation;
3103
3464
  var valueMarkerX = fillBarX;
3104
3465
  var valueMarkerY = fillBarY;
3466
+
3105
3467
  if (orientation === 'vertical') {
3106
3468
  valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
3107
3469
  } else {
3108
3470
  valueMarkerX += fillBarLength;
3109
3471
  valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
3110
3472
  }
3473
+
3111
3474
  return {
3112
3475
  valueMarkerX: valueMarkerX,
3113
3476
  valueMarkerY: valueMarkerY
3114
3477
  };
3115
3478
  };
3479
+
3116
3480
  exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
3117
3481
  /**
3118
3482
  * get dimensions for the marker bar in the gauge
@@ -3131,24 +3495,27 @@ exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
3131
3495
  * @return {Number} markerBarDimensions.markerBarWidth
3132
3496
  * @return {Number} markerBarDimensions.markerBarHeight
3133
3497
  */
3498
+
3134
3499
  var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
3135
3500
  var gaugeLength = _ref15.gaugeLength,
3136
- gaugeStartX = _ref15.gaugeStartX,
3137
- gaugeStartY = _ref15.gaugeStartY,
3138
- gaugeWidth = _ref15.gaugeWidth,
3139
- gaugeHeight = _ref15.gaugeHeight,
3140
- orientation = _ref15.orientation;
3501
+ gaugeStartX = _ref15.gaugeStartX,
3502
+ gaugeStartY = _ref15.gaugeStartY,
3503
+ gaugeWidth = _ref15.gaugeWidth,
3504
+ gaugeHeight = _ref15.gaugeHeight,
3505
+ orientation = _ref15.orientation;
3141
3506
  var gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge
3507
+
3142
3508
  var _ref16 = (0, exports.getGaugeBarStartPositions)({
3143
- gaugeStartX: gaugeStartX,
3144
- gaugeStartY: gaugeStartY,
3145
- gaugeWidth: gaugeWidth,
3146
- gaugeHeight: gaugeHeight,
3147
- gaugeBarLength: gaugeBarLength,
3148
- orientation: orientation
3149
- }),
3150
- markerBarX = _ref16.gaugeBarX,
3151
- markerBarY = _ref16.gaugeBarY;
3509
+ gaugeStartX: gaugeStartX,
3510
+ gaugeStartY: gaugeStartY,
3511
+ gaugeWidth: gaugeWidth,
3512
+ gaugeHeight: gaugeHeight,
3513
+ gaugeBarLength: gaugeBarLength,
3514
+ orientation: orientation
3515
+ }),
3516
+ markerBarX = _ref16.gaugeBarX,
3517
+ markerBarY = _ref16.gaugeBarY;
3518
+
3152
3519
  var markerBarWidth = (0, exports.getGaugeBarWidth)({
3153
3520
  gaugeBarLength: gaugeBarLength,
3154
3521
  orientation: orientation
@@ -3165,6 +3532,7 @@ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
3165
3532
  markerBarHeight: markerBarHeight
3166
3533
  };
3167
3534
  };
3535
+
3168
3536
  exports.getMarkerBarDimensions = getMarkerBarDimensions;
3169
3537
  /**
3170
3538
  * get position x and y for value marker in marker gauge
@@ -3182,17 +3550,19 @@ exports.getMarkerBarDimensions = getMarkerBarDimensions;
3182
3550
  * @return {Number} position.valueMarkerX
3183
3551
  * @return {Number} position.valueMarkerY
3184
3552
  */
3553
+
3185
3554
  var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref17) {
3186
3555
  var markerBarX = _ref17.markerBarX,
3187
- markerBarY = _ref17.markerBarY,
3188
- markerBarHeight = _ref17.markerBarHeight,
3189
- gaugeLength = _ref17.markerBarLength,
3190
- orientation = _ref17.orientation,
3191
- value = _ref17.value,
3192
- min = _ref17.min,
3193
- max = _ref17.max;
3556
+ markerBarY = _ref17.markerBarY,
3557
+ markerBarHeight = _ref17.markerBarHeight,
3558
+ gaugeLength = _ref17.markerBarLength,
3559
+ orientation = _ref17.orientation,
3560
+ value = _ref17.value,
3561
+ min = _ref17.min,
3562
+ max = _ref17.max;
3194
3563
  var valueMarkerX = markerBarX;
3195
3564
  var valueMarkerY = markerBarY;
3565
+
3196
3566
  if (orientation === 'vertical') {
3197
3567
  valueMarkerY += markerBarHeight - (0, exports.getGaugeBarLength)({
3198
3568
  gaugeLength: gaugeLength,
@@ -3210,11 +3580,13 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
3210
3580
  });
3211
3581
  valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
3212
3582
  }
3583
+
3213
3584
  return {
3214
3585
  valueMarkerX: valueMarkerX,
3215
3586
  valueMarkerY: valueMarkerY
3216
3587
  };
3217
3588
  };
3589
+
3218
3590
  exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
3219
3591
  /**
3220
3592
  * sort the ranges in ascending order
@@ -3222,11 +3594,13 @@ exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
3222
3594
  * @param {Array} ranges
3223
3595
  * @return {Array} sortedRanges
3224
3596
  */
3597
+
3225
3598
  var getSortedRanges = function getSortedRanges(ranges) {
3226
3599
  return ranges.sort(function (a, b) {
3227
3600
  return a.from - b.from;
3228
3601
  });
3229
3602
  };
3603
+
3230
3604
  exports.getSortedRanges = getSortedRanges;
3231
3605
  /**
3232
3606
  * validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to
@@ -3234,29 +3608,35 @@ exports.getSortedRanges = getSortedRanges;
3234
3608
  * @param {Array} ranges
3235
3609
  * @return {String} error
3236
3610
  */
3611
+
3237
3612
  var validateRanges = function validateRanges(ranges) {
3238
3613
  if (!ranges.length) {
3239
3614
  return (0, i18n_1._)('Prop "ranges" is missing entries');
3240
- }
3241
- // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
3615
+ } // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
3616
+
3617
+
3242
3618
  if (ranges.some(function (range) {
3243
3619
  return range.from >= range.to;
3244
3620
  })) {
3245
3621
  return (0, i18n_1._)('Prop "ranges" has invalid entries: invalid range');
3246
- }
3247
- // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
3622
+ } // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
3623
+
3624
+
3248
3625
  if (ranges.length !== (0, lodash_1.uniqBy)(ranges, 'to').length || ranges.length !== (0, lodash_1.uniqBy)(ranges, 'from').length) {
3249
3626
  return (0, i18n_1._)('Prop "ranges" has invalid entries: duplicate values');
3250
3627
  }
3251
- var sortedRanges = (0, exports.getSortedRanges)(ranges);
3252
- // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
3628
+
3629
+ var sortedRanges = (0, exports.getSortedRanges)(ranges); // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
3630
+
3253
3631
  for (var i = 1; i < sortedRanges.length; i += 1) {
3254
3632
  if (sortedRanges[i].from !== sortedRanges[i - 1].to) {
3255
3633
  return (0, i18n_1._)('Prop "ranges" has invalid entries: discontinuous ranges');
3256
3634
  }
3257
3635
  }
3636
+
3258
3637
  return null;
3259
3638
  };
3639
+
3260
3640
  exports.validateRanges = validateRanges;
3261
3641
  /**
3262
3642
  * calculate min and max value of gauge
@@ -3266,6 +3646,7 @@ exports.validateRanges = validateRanges;
3266
3646
  * @return {Number} gaugeRange.min
3267
3647
  * @return {Number} gaugeRange.max
3268
3648
  */
3649
+
3269
3650
  var getGaugeRange = function getGaugeRange(ranges) {
3270
3651
  var min = Math.min.apply(Math, _toConsumableArray(ranges.map(function (range) {
3271
3652
  return range.from;
@@ -3278,6 +3659,7 @@ var getGaugeRange = function getGaugeRange(ranges) {
3278
3659
  max: max
3279
3660
  };
3280
3661
  };
3662
+
3281
3663
  exports.getGaugeRange = getGaugeRange;
3282
3664
  /**
3283
3665
  * calculate stop offsets for linear gradient
@@ -3286,17 +3668,20 @@ exports.getGaugeRange = getGaugeRange;
3286
3668
  * @param {String} orientation
3287
3669
  * @return {Array} cumulativeOffsets
3288
3670
  */
3671
+
3289
3672
  var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
3290
3673
  var ranges = _ref18.ranges,
3291
- orientation = _ref18.orientation;
3674
+ orientation = _ref18.orientation;
3675
+
3292
3676
  var _ref19 = (0, exports.getGaugeRange)(ranges),
3293
- min = _ref19.min,
3294
- max = _ref19.max;
3677
+ min = _ref19.min,
3678
+ max = _ref19.max;
3679
+
3295
3680
  var offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);
3296
3681
  var offsets = ranges.map(function (range) {
3297
3682
  return Math.abs(range.from - range.to) * offsetScale;
3298
- });
3299
- // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
3683
+ }); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
3684
+
3300
3685
  offsets = orientation === 'vertical' ? offsets.reverse() : offsets;
3301
3686
  var cumulativeOffsets = [];
3302
3687
  offsets.reduce(function (accumulator, currentValue, idx) {
@@ -3305,6 +3690,7 @@ var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
3305
3690
  }, 0);
3306
3691
  return cumulativeOffsets;
3307
3692
  };
3693
+
3308
3694
  exports.getGradientStopOffsets = getGradientStopOffsets;
3309
3695
  /**
3310
3696
  * calculate stop colors for linear gradient
@@ -3313,15 +3699,17 @@ exports.getGradientStopOffsets = getGradientStopOffsets;
3313
3699
  * @param {String} orientation
3314
3700
  * @return {Array} stopColors
3315
3701
  */
3702
+
3316
3703
  var getGradientStopColors = function getGradientStopColors(_ref20) {
3317
3704
  var ranges = _ref20.ranges,
3318
- orientation = _ref20.orientation;
3705
+ orientation = _ref20.orientation;
3319
3706
  var stopColors = ranges.map(function (range) {
3320
3707
  return range.value;
3321
- });
3322
- // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
3708
+ }); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
3709
+
3323
3710
  return orientation === 'vertical' ? stopColors.reverse() : stopColors;
3324
3711
  };
3712
+
3325
3713
  exports.getGradientStopColors = getGradientStopColors;
3326
3714
  /**
3327
3715
  * calculate linear gradient stops from ranges
@@ -3331,9 +3719,10 @@ exports.getGradientStopColors = getGradientStopColors;
3331
3719
  * @param {String} orientation
3332
3720
  * @return {Array} stops
3333
3721
  */
3722
+
3334
3723
  var getGradientStops = function getGradientStops(_ref21) {
3335
3724
  var ranges = _ref21.ranges,
3336
- orientation = _ref21.orientation;
3725
+ orientation = _ref21.orientation;
3337
3726
  var stops = [];
3338
3727
  var offsets = (0, exports.getGradientStopOffsets)({
3339
3728
  ranges: ranges,
@@ -3342,13 +3731,13 @@ var getGradientStops = function getGradientStops(_ref21) {
3342
3731
  var stopColors = (0, exports.getGradientStopColors)({
3343
3732
  ranges: ranges,
3344
3733
  orientation: orientation
3345
- });
3346
- // Initialize stops with the first color stop
3734
+ }); // Initialize stops with the first color stop
3735
+
3347
3736
  stops.push({
3348
3737
  offset: "".concat(offsets[0], "%"),
3349
3738
  stopColor: stopColors[0]
3350
- });
3351
- // Add the remaining color stops with gradient change at each stop
3739
+ }); // Add the remaining color stops with gradient change at each stop
3740
+
3352
3741
  for (var i = 1; i < ranges.length; i += 1) {
3353
3742
  stops.push({
3354
3743
  offset: "".concat(offsets[i - 1], "%"),
@@ -3359,8 +3748,10 @@ var getGradientStops = function getGradientStops(_ref21) {
3359
3748
  stopColor: stopColors[i]
3360
3749
  });
3361
3750
  }
3751
+
3362
3752
  return stops;
3363
3753
  };
3754
+
3364
3755
  exports.getGradientStops = getGradientStops;
3365
3756
  /**
3366
3757
  * calculate linear gradient dimensions
@@ -3372,6 +3763,7 @@ exports.getGradientStops = getGradientStops;
3372
3763
  * @return {String} dimensions.x2
3373
3764
  * @return {String} dimensions.y2
3374
3765
  */
3766
+
3375
3767
  var getGradientDimensions = function getGradientDimensions(orientation) {
3376
3768
  var x1 = '0%';
3377
3769
  var y1 = '0%';
@@ -3384,8 +3776,9 @@ var getGradientDimensions = function getGradientDimensions(orientation) {
3384
3776
  y2: y2
3385
3777
  };
3386
3778
  };
3387
- exports.getGradientDimensions = getGradientDimensions;
3388
- // map for new options names to old option names
3779
+
3780
+ exports.getGradientDimensions = getGradientDimensions; // map for new options names to old option names
3781
+
3389
3782
  var gaugeOptionsMapping = {
3390
3783
  majorTickInterval: 'majorUnit',
3391
3784
  gaugeRanges: 'ranges'
@@ -3396,11 +3789,13 @@ var gaugeOptionsMapping = {
3396
3789
  * @param {Object} options
3397
3790
  * @returns {Object}
3398
3791
  */
3792
+
3399
3793
  var mapToOldKey = function mapToOldKey(options) {
3400
3794
  return (0, lodash_1.mapKeys)(options, function (val, key) {
3401
3795
  return gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key;
3402
3796
  });
3403
3797
  };
3798
+
3404
3799
  exports.mapToOldKey = mapToOldKey;
3405
3800
  /**
3406
3801
  * Helper method to map labelDisplay and valueDisplay options to pure component option names
@@ -3409,12 +3804,14 @@ exports.mapToOldKey = mapToOldKey;
3409
3804
  * @param {Object} options
3410
3805
  * @returns {Object}
3411
3806
  */
3807
+
3412
3808
  var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options) {
3413
3809
  var rangeOrValue = labelOrValue === 'value' ? 'Value' : 'Range';
3414
3810
  var showKey = labelOrValue === 'value' ? 'showValue' : 'showLabels';
3415
3811
  var percentKey = "usePercentage".concat(rangeOrValue);
3416
3812
  var optionString = "".concat(labelOrValue, "Display");
3417
3813
  var newOptions = Object.assign({}, options);
3814
+
3418
3815
  if (newOptions[optionString]) {
3419
3816
  if (newOptions[optionString] === 'number') {
3420
3817
  newOptions[showKey] = true;
@@ -3427,8 +3824,10 @@ var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options)
3427
3824
  newOptions[percentKey] = false;
3428
3825
  }
3429
3826
  }
3827
+
3430
3828
  return (0, lodash_1.omit)(newOptions, [optionString]);
3431
3829
  };
3830
+
3432
3831
  exports.mapValueLabelDisplay = mapValueLabelDisplay;
3433
3832
  /**
3434
3833
  * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts
@@ -3437,6 +3836,7 @@ exports.mapValueLabelDisplay = mapValueLabelDisplay;
3437
3836
  * @param {Object} originalOptions
3438
3837
  * @returns {Object}
3439
3838
  */
3839
+
3440
3840
  var convertToGaugeProperties = function convertToGaugeProperties(originalOptions) {
3441
3841
  return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru(function (options) {
3442
3842
  return (0, exports.mapValueLabelDisplay)('label', options);
@@ -3444,6 +3844,7 @@ var convertToGaugeProperties = function convertToGaugeProperties(originalOptions
3444
3844
  return (0, exports.mapValueLabelDisplay)('value', options);
3445
3845
  }).value();
3446
3846
  };
3847
+
3447
3848
  exports.convertToGaugeProperties = convertToGaugeProperties;
3448
3849
 
3449
3850
  /***/ })