@splunk/visualizations 25.13.1 → 26.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/Area.config.js +216 -216
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +529 -561
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +213 -213
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +394 -386
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +140 -140
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +313 -305
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +15 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +149 -144
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +205 -205
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +387 -379
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +45 -45
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +157 -144
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +11 -11
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +273 -261
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +46 -46
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +267 -262
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +8 -8
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +110 -104
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +220 -220
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +404 -396
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +27 -27
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +557 -548
  44. package/LinkGraph.js.map +1 -1
  45. package/Map.config.js +71 -71
  46. package/Map.config.js.map +1 -1
  47. package/Map.js +471 -465
  48. package/Map.js.map +1 -1
  49. package/Markdown.config.js +23 -23
  50. package/Markdown.config.js.map +1 -1
  51. package/Markdown.js +151 -145
  52. package/Markdown.js.map +1 -1
  53. package/MarkerGauge.config.js +84 -84
  54. package/MarkerGauge.config.js.map +1 -1
  55. package/MarkerGauge.js +295 -289
  56. package/MarkerGauge.js.map +1 -1
  57. package/ParallelCoordinates.config.js +23 -23
  58. package/ParallelCoordinates.config.js.map +1 -1
  59. package/ParallelCoordinates.js +164 -162
  60. package/ParallelCoordinates.js.map +1 -1
  61. package/Pie.config.js +24 -24
  62. package/Pie.config.js.map +1 -1
  63. package/Pie.js +233 -228
  64. package/Pie.js.map +1 -1
  65. package/Punchcard.config.js +33 -33
  66. package/Punchcard.config.js.map +1 -1
  67. package/Punchcard.js +278 -279
  68. package/Punchcard.js.map +1 -1
  69. package/Rectangle.config.js +46 -46
  70. package/Rectangle.config.js.map +1 -1
  71. package/Rectangle.js +154 -142
  72. package/Rectangle.js.map +1 -1
  73. package/Sankey.config.js +19 -19
  74. package/Sankey.config.js.map +1 -1
  75. package/Sankey.js +281 -275
  76. package/Sankey.js.map +1 -1
  77. package/Scatter.config.js +135 -135
  78. package/Scatter.config.js.map +1 -1
  79. package/Scatter.js +304 -299
  80. package/Scatter.js.map +1 -1
  81. package/SingleValue.config.js +119 -119
  82. package/SingleValue.config.js.map +1 -1
  83. package/SingleValue.js +359 -341
  84. package/SingleValue.js.map +1 -1
  85. package/SingleValueBasic.js +14 -14
  86. package/SingleValueBasic.js.map +1 -1
  87. package/SingleValueIcon.config.js +117 -117
  88. package/SingleValueIcon.config.js.map +1 -1
  89. package/SingleValueIcon.js +373 -371
  90. package/SingleValueIcon.js.map +1 -1
  91. package/SingleValueRadial.config.js +157 -115
  92. package/SingleValueRadial.config.js.map +1 -1
  93. package/SingleValueRadial.js +1114 -540
  94. package/SingleValueRadial.js.map +1 -1
  95. package/SparkLine.js +50 -20
  96. package/SparkLine.js.map +1 -1
  97. package/Table.config.js +54 -54
  98. package/Table.config.js.map +1 -1
  99. package/Table.js +302 -286
  100. package/Table.js.map +1 -1
  101. package/common/Charting.js +41 -41
  102. package/common/Charting.js.map +1 -1
  103. package/common/EventsDoc.js +15 -14
  104. package/common/EventsDoc.js.map +1 -1
  105. package/common/GaugeMajorTicks.js +2 -2
  106. package/common/GaugeMajorTicks.js.map +1 -1
  107. package/common/GaugeValueMarker.js +2 -2
  108. package/common/GaugeValueMarker.js.map +1 -1
  109. package/common/OptionsDoc.js +22 -22
  110. package/common/OptionsDoc.js.map +1 -1
  111. package/common/OverviewDoc.js +32 -27
  112. package/common/OverviewDoc.js.map +1 -1
  113. package/common/SplunkVisualization.js +4 -4
  114. package/common/SplunkVisualization.js.map +1 -1
  115. package/common/SplunkVisualizationApi.js +2 -2
  116. package/common/SplunkVisualizationApi.js.map +1 -1
  117. package/common/ThemesDoc.js +14 -14
  118. package/common/ThemesDoc.js.map +1 -1
  119. package/common/chartingUtils.js +12 -12
  120. package/common/chartingUtils.js.map +1 -1
  121. package/common/docUtils.js +4 -4
  122. package/common/docUtils.js.map +1 -1
  123. package/common/gaugeUtils.js +112 -112
  124. package/common/gaugeUtils.js.map +1 -1
  125. package/common/shapeUtils.js +21 -15
  126. package/common/shapeUtils.js.map +1 -1
  127. package/common/utils/configUtils.js +10 -9
  128. package/common/utils/configUtils.js.map +1 -1
  129. package/common/utils/dataUtils.js +2 -2
  130. package/common/utils/dataUtils.js.map +1 -1
  131. package/common/utils/hocUtils.js +2 -2
  132. package/common/utils/hocUtils.js.map +1 -1
  133. package/common/utils/layoutUtils.js +2 -2
  134. package/common/utils/layoutUtils.js.map +1 -1
  135. package/common/utils/mapUtils.js +84 -80
  136. package/common/utils/mapUtils.js.map +1 -1
  137. package/common/utils/singleValueUtils.js +2 -2
  138. package/common/utils/singleValueUtils.js.map +1 -1
  139. package/common/utils/testHelper.js +27 -9
  140. package/common/utils/testHelper.js.map +1 -1
  141. package/common/utils/trellisUtils.js +26 -26
  142. package/common/utils/trellisUtils.js.map +1 -1
  143. package/common/utils/urlUtils.js +2 -2
  144. package/common/utils/urlUtils.js.map +1 -1
  145. package/common/withDashboardViz.js +107 -104
  146. package/common/withDashboardViz.js.map +1 -1
  147. package/package.json +19 -19
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 472);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 475);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -116,57 +116,6 @@ module.exports = require("@splunk/visualizations-shared/Message");
116
116
  /***/ 100:
117
117
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
118
118
 
119
- "use strict";
120
- __webpack_require__.r(__webpack_exports__);
121
- /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
122
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
123
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
124
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
125
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
126
-
127
-
128
- var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
129
- var defaultContext = _ref.defaultContext,
130
- defaultPalettesConfig = _ref.defaultPalettesConfig;
131
- return {
132
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
133
- option: 'majorColor',
134
- context: 'majorColorEditorConfig',
135
- editor: 'editor.dynamicColor',
136
- showEditor: function showEditor(_ref2) {
137
- var options = _ref2.options;
138
- return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
139
- },
140
- editorProps: {
141
- labelPosition: 'top',
142
- flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
143
- formatters: [{
144
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
145
- value: 'rangeValue',
146
- defaults: {
147
- majorValue: defaultContext.majorColorConfig
148
- }
149
- }, {
150
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Matches'),
151
- value: 'matchValue',
152
- defaults: {
153
- majorValue: defaultContext.majorColorMatchConfig
154
- }
155
- }],
156
- dataSelectors: [{
157
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
158
- value: 'majorValue'
159
- }],
160
- defaultPalettesConfig: defaultPalettesConfig
161
- }
162
- };
163
- };
164
-
165
- /***/ }),
166
-
167
- /***/ 101:
168
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
169
-
170
119
  "use strict";
171
120
  __webpack_require__.r(__webpack_exports__);
172
121
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
@@ -209,7 +158,7 @@ var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
209
158
 
210
159
  /***/ }),
211
160
 
212
- /***/ 102:
161
+ /***/ 101:
213
162
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
214
163
 
215
164
  "use strict";
@@ -264,7 +213,7 @@ var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_
264
213
 
265
214
  /***/ }),
266
215
 
267
- /***/ 103:
216
+ /***/ 102:
268
217
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
269
218
 
270
219
  "use strict";
@@ -315,7 +264,7 @@ var StaticMajorAndTrendLayout = [[{
315
264
 
316
265
  /***/ }),
317
266
 
318
- /***/ 104:
267
+ /***/ 103:
319
268
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
320
269
 
321
270
  "use strict";
@@ -339,7 +288,7 @@ var StaticMajorColorEditor = {
339
288
 
340
289
  /***/ }),
341
290
 
342
- /***/ 105:
291
+ /***/ 104:
343
292
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
344
293
 
345
294
  "use strict";
@@ -367,7 +316,7 @@ var StaticTrendColorEditor = {
367
316
 
368
317
  /***/ }),
369
318
 
370
- /***/ 106:
319
+ /***/ 105:
371
320
  /***/ (function(module, exports, __webpack_require__) {
372
321
 
373
322
  "use strict";
@@ -383,7 +332,7 @@ var FeatureFlagContext_1 = __webpack_require__(21);
383
332
  var layoutUtils_1 = __webpack_require__(58);
384
333
  /* eslint-disable react-hooks/rules-of-hooks */
385
334
  exports.TrellisEditorConfig = [[{
386
- label: i18n_1._('Trellis layout'),
335
+ label: (0, i18n_1._)('Trellis layout'),
387
336
  option: 'splitByLayout',
388
337
  editor: 'editor.toggle',
389
338
  showEditor: function showEditor() {
@@ -392,7 +341,7 @@ exports.TrellisEditorConfig = [[{
392
341
  return isTrellisFeatureFlagOn;
393
342
  }
394
343
  }], [{
395
- label: i18n_1._('Split by'),
344
+ label: (0, i18n_1._)('Split by'),
396
345
  option: 'trellisSplitBy',
397
346
  editor: 'editor.trellisSplitBy',
398
347
  editorProps: {
@@ -405,13 +354,13 @@ exports.TrellisEditorConfig = [[{
405
354
  return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
406
355
  }
407
356
  }], [{
408
- label: i18n_1._('Number of columns'),
357
+ label: (0, i18n_1._)('Number of columns'),
409
358
  option: 'trellisColumns',
410
359
  editor: 'editor.number',
411
360
  editorProps: {
412
361
  min: 1
413
362
  },
414
- placeholder: i18n_1._('Auto'),
363
+ placeholder: (0, i18n_1._)('Auto'),
415
364
  showEditor: function showEditor(_ref2) {
416
365
  var options = _ref2.options;
417
366
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
@@ -419,7 +368,7 @@ exports.TrellisEditorConfig = [[{
419
368
  return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
420
369
  }
421
370
  }], [{
422
- label: i18n_1._('Min column width'),
371
+ label: (0, i18n_1._)('Min column width'),
423
372
  option: 'trellisMinColumnWidth',
424
373
  editor: 'editor.number',
425
374
  editorProps: {
@@ -432,7 +381,7 @@ exports.TrellisEditorConfig = [[{
432
381
  return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
433
382
  }
434
383
  }, {
435
- label: i18n_1._('Row height'),
384
+ label: (0, i18n_1._)('Row height'),
436
385
  option: 'trellisRowHeight',
437
386
  editor: 'editor.number',
438
387
  editorProps: {
@@ -445,7 +394,7 @@ exports.TrellisEditorConfig = [[{
445
394
  return isTrellisFeatureFlagOn && options.splitByLayout === layoutUtils_1.LAYOUT_TYPE.Trellis;
446
395
  }
447
396
  }], [{
448
- label: i18n_1._('Max number of components per page'),
397
+ label: (0, i18n_1._)('Max number of components per page'),
449
398
  option: 'trellisPageCount',
450
399
  editor: 'editor.number',
451
400
  editorProps: {
@@ -459,7 +408,7 @@ exports.TrellisEditorConfig = [[{
459
408
  }
460
409
  }]];
461
410
  exports.TrellisBackgroundColorEditor = {
462
- label: i18n_1._('Trellis background'),
411
+ label: (0, i18n_1._)('Trellis background'),
463
412
  option: 'trellisBackgroundColor',
464
413
  editor: 'editor.color',
465
414
  showEditor: function showEditor(_ref6) {
@@ -472,7 +421,7 @@ exports.TrellisBackgroundColorEditor = {
472
421
 
473
422
  /***/ }),
474
423
 
475
- /***/ 107:
424
+ /***/ 106:
476
425
  /***/ (function(module, exports, __webpack_require__) {
477
426
 
478
427
  "use strict";
@@ -496,19 +445,19 @@ var React = __webpack_require__(1);
496
445
  var react_1 = __webpack_require__(1);
497
446
  var lodash_1 = __webpack_require__(3);
498
447
  var styled_components_1 = __webpack_require__(4);
499
- var Paginator_1 = __webpack_require__(92);
448
+ var Paginator_1 = __webpack_require__(93);
500
449
  var i18n_1 = __webpack_require__(2);
501
- var themes_1 = __webpack_require__(59);
450
+ var themes_1 = __webpack_require__(60);
502
451
  var useSplunkTheme_1 = __webpack_require__(57);
503
452
  var FeatureFlagContext_1 = __webpack_require__(21);
504
453
  var SizeAwareWrapper_1 = __webpack_require__(19);
505
454
  var style_1 = __webpack_require__(14);
506
455
  var Message_1 = __webpack_require__(10);
507
- var trellisUtils_1 = __webpack_require__(80);
508
- var hocUtils_1 = __webpack_require__(26);
509
- var JSONSchemaUtils_1 = __webpack_require__(27);
510
- var Options_1 = __webpack_require__(29);
511
- var trellisUtils_2 = __webpack_require__(108);
456
+ var trellisUtils_1 = __webpack_require__(83);
457
+ var hocUtils_1 = __webpack_require__(27);
458
+ var JSONSchemaUtils_1 = __webpack_require__(28);
459
+ var Options_1 = __webpack_require__(30);
460
+ var trellisUtils_2 = __webpack_require__(107);
512
461
  var layoutUtils_1 = __webpack_require__(58);
513
462
  var TrellisContainer = styled_components_1.default.div.withConfig({
514
463
  displayName: "withTrellis__TrellisContainer",
@@ -516,7 +465,7 @@ var TrellisContainer = styled_components_1.default.div.withConfig({
516
465
  })(["overflow:hidden;display:flex;flex-direction:column;background-color:", ";", ";> [data-test='paginator']{align-self:flex-end;margin-bottom:10px;}"], function (props) {
517
466
  return props.backgroundColor;
518
467
  }, function (props) {
519
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
468
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
520
469
  });
521
470
  var TrellisContainerGrid = styled_components_1.default.div.withConfig({
522
471
  displayName: "withTrellis__TrellisContainerGrid",
@@ -535,7 +484,7 @@ var showErrorMessage = function showErrorMessage(errorCode, width, height) {
535
484
  return React.createElement(Message_1.default, {
536
485
  width: width,
537
486
  height: height,
538
- message: i18n_1._('Select a valid trellis split by field'),
487
+ message: (0, i18n_1._)('Select a valid trellis split by field'),
539
488
  level: "info"
540
489
  });
541
490
  }
@@ -543,14 +492,14 @@ var showErrorMessage = function showErrorMessage(errorCode, width, height) {
543
492
  return React.createElement(Message_1.default, {
544
493
  width: width,
545
494
  height: height,
546
- message: i18n_1._('Unknown data split mode'),
495
+ message: (0, i18n_1._)('Unknown data split mode'),
547
496
  level: "info"
548
497
  });
549
498
  }
550
499
  return React.createElement(Message_1.default, {
551
500
  width: width,
552
501
  height: height,
553
- message: i18n_1._('Error render in trellis'),
502
+ message: (0, i18n_1._)('Error render in trellis'),
554
503
  level: "info"
555
504
  });
556
505
  };
@@ -561,8 +510,8 @@ var withTrellis = function withTrellis(Viz) {
561
510
  height = opts.height,
562
511
  width = opts.width,
563
512
  otherProps = __rest(opts, ["options", "height", "width"]);
564
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(Viz.config.optionsSchema, 'default');
565
- var mergedOptions = hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions);
513
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(Viz.config.optionsSchema, 'default');
514
+ var mergedOptions = (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions);
566
515
  var trellisColumns = mergedOptions.trellisColumns,
567
516
  trellisPageCount = mergedOptions.trellisPageCount,
568
517
  trellisMinColumnWidth = mergedOptions.trellisMinColumnWidth,
@@ -573,28 +522,28 @@ var withTrellis = function withTrellis(Viz) {
573
522
  var pageCount = +trellisPageCount > 0 ? +trellisPageCount : defaultOptions.trellisPageCount;
574
523
  var colMinWidth = trellisMinColumnWidth > 0 ? trellisMinColumnWidth : defaultOptions.trellisMinColumnWidth;
575
524
  var rowHeight = trellisRowHeight > 0 ? trellisRowHeight : defaultOptions.trellisRowHeight;
576
- var _react_1$useState = react_1.useState(1),
577
- _react_1$useState2 = _slicedToArray(_react_1$useState, 2),
578
- pageNum = _react_1$useState2[0],
579
- setPageNum = _react_1$useState2[1];
580
- var _react_1$useState3 = react_1.useState(null),
581
- _react_1$useState4 = _slicedToArray(_react_1$useState3, 2),
582
- pagedData = _react_1$useState4[0],
583
- setPagedData = _react_1$useState4[1];
525
+ var _ref = (0, react_1.useState)(1),
526
+ _ref2 = _slicedToArray(_ref, 2),
527
+ pageNum = _ref2[0],
528
+ setPageNum = _ref2[1];
529
+ var _ref3 = (0, react_1.useState)(null),
530
+ _ref4 = _slicedToArray(_ref3, 2),
531
+ pagedData = _ref4[0],
532
+ setPagedData = _ref4[1];
584
533
  var splitByKeys = [];
585
534
  var totalPages = 0;
586
535
  var showPaginator = false;
587
536
  var dataSources = otherProps.dataSources;
588
537
  var theme = {
589
- splunkThemeV1: useSplunkTheme_1.default()
538
+ splunkThemeV1: (0, useSplunkTheme_1.default)()
590
539
  };
591
- var _themes_1$getSettings = themes_1.getSettingsFromThemedProps({
540
+ var _ref5 = (0, themes_1.getSettingsFromThemedProps)({
592
541
  theme: theme
593
542
  }),
594
- currentThemeFamily = _themes_1$getSettings.family,
595
- currentThemeColorScheme = _themes_1$getSettings.colorScheme,
596
- currentThemeDensity = _themes_1$getSettings.density;
597
- var trellisBackgroundColor = react_1.useMemo(function () {
543
+ currentThemeFamily = _ref5.family,
544
+ currentThemeColorScheme = _ref5.colorScheme,
545
+ currentThemeDensity = _ref5.density;
546
+ var trellisBackgroundColor = (0, react_1.useMemo)(function () {
598
547
  var themeFunc = function themeFunc(themeVar) {
599
548
  var _a, _b;
600
549
  return (_b = (_a = Viz.config.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, {
@@ -611,8 +560,8 @@ var withTrellis = function withTrellis(Viz) {
611
560
  }, {}, themeFunc);
612
561
  return evaluated.trellisBackgroundColor;
613
562
  }, [mergedOptions.trellisBackgroundColor, currentThemeFamily, currentThemeColorScheme, currentThemeDensity]);
614
- var columns = lodash_1.get(dataSources, 'primary.data.columns', undefined);
615
- var fields = lodash_1.get(dataSources, 'primary.data.fields', undefined);
563
+ var columns = (0, lodash_1.get)(dataSources, 'primary.data.columns', undefined);
564
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields', undefined);
616
565
  var noColumns = columns === undefined;
617
566
  var noFields = fields === undefined;
618
567
  var updateDataDisplay = function updateDataDisplay(currPage) {
@@ -625,15 +574,15 @@ var withTrellis = function withTrellis(Viz) {
625
574
  setPagedData(paged);
626
575
  }
627
576
  };
628
- react_1.useEffect(function () {
577
+ (0, react_1.useEffect)(function () {
629
578
  setPageNum(1);
630
579
  updateDataDisplay(1);
631
580
  }, [pageCount, trellisSplitBy]);
632
- react_1.useEffect(function () {
581
+ (0, react_1.useEffect)(function () {
633
582
  updateDataDisplay(pageNum);
634
583
  }, [columns, fields, trellisSplitBy, pageNum, splitByLayout]);
635
- var handlePageChange = react_1.useCallback(function (event, _ref) {
636
- var page = _ref.page;
584
+ var handlePageChange = (0, react_1.useCallback)(function (event, _ref6) {
585
+ var page = _ref6.page;
637
586
  setPageNum(page);
638
587
  }, [pageNum, pagedData]);
639
588
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
@@ -646,7 +595,7 @@ var withTrellis = function withTrellis(Viz) {
646
595
  return React.createElement(Message_1.default, {
647
596
  width: width,
648
597
  height: height,
649
- message: i18n_1._('Loading'),
598
+ message: (0, i18n_1._)('Loading'),
650
599
  level: "info"
651
600
  });
652
601
  }
@@ -654,11 +603,11 @@ var withTrellis = function withTrellis(Viz) {
654
603
  // The default value will be the first value in the individual splitBy field list or 'aggregations'
655
604
  var currTrellisSplitBy = trellisSplitBy;
656
605
  if (!trellisSplitBy || trellisSplitBy.length === 0) {
657
- var splitByPossibleFields = trellisUtils_1.getAllPossibleSplitByFields(fields);
606
+ var splitByPossibleFields = (0, trellisUtils_1.getAllPossibleSplitByFields)(fields);
658
607
  currTrellisSplitBy = splitByPossibleFields.fields && splitByPossibleFields.fields.length ? splitByPossibleFields.fields[0] : trellisUtils_2.AGGREGATIONS;
659
608
  }
660
- var splitMode = trellisUtils_1.getTrellisDataSplitterMode(fields);
661
- var dataSplitResult = trellisUtils_2.getTrellisDataSourcesBySplitMode(splitMode, dataSources, currTrellisSplitBy);
609
+ var splitMode = (0, trellisUtils_1.getTrellisDataSplitterMode)(fields);
610
+ var dataSplitResult = (0, trellisUtils_2.getTrellisDataSourcesBySplitMode)(splitMode, dataSources, currTrellisSplitBy);
662
611
  var modifiedDataSourceBySplitBy = dataSplitResult === null || dataSplitResult === void 0 ? void 0 : dataSplitResult.splitDataSources;
663
612
  var dataSplitErrorCode = dataSplitResult === null || dataSplitResult === void 0 ? void 0 : dataSplitResult.errorCode;
664
613
  if (!modifiedDataSourceBySplitBy || Object.keys(modifiedDataSourceBySplitBy).length === 0 || dataSplitErrorCode) {
@@ -684,10 +633,10 @@ var withTrellis = function withTrellis(Viz) {
684
633
  className: "child",
685
634
  "data-test": "trellis-child",
686
635
  key: "div-child-".concat(idx.toString())
687
- }, React.createElement(SizeAwareWrapper_1.default, null, function (_ref2) {
688
- var childWidth = _ref2.childWidth,
689
- _ref2$childHeight = _ref2.childHeight,
690
- childHeight = _ref2$childHeight === void 0 ? rowHeight : _ref2$childHeight;
636
+ }, React.createElement(SizeAwareWrapper_1.default, null, function (_ref7) {
637
+ var childWidth = _ref7.childWidth,
638
+ _ref7$childHeight = _ref7.childHeight,
639
+ childHeight = _ref7$childHeight === void 0 ? rowHeight : _ref7$childHeight;
691
640
  return React.createElement(Viz, Object.assign({}, otherProps, {
692
641
  trellisKey: splitByKey,
693
642
  trellisSplitBy: currTrellisSplitBy,
@@ -716,7 +665,7 @@ exports.default = withTrellis;
716
665
 
717
666
  /***/ }),
718
667
 
719
- /***/ 108:
668
+ /***/ 107:
720
669
  /***/ (function(module, exports, __webpack_require__) {
721
670
 
722
671
  "use strict";
@@ -728,7 +677,7 @@ Object.defineProperty(exports, "__esModule", {
728
677
  });
729
678
  exports.getTrellisDataSourcesBySplitMode = exports.dataSourcesSplitByModeStatsorUnknown = exports.dataSourcesSplitByModeChart = exports.dataSourcesSplitByModeTimechart = exports.dataSourcesSplitByAggregationsStats = exports.dataSourcesSplitByAggregationsTimechartAndChart = exports.dataSourcesSplitByAggregationsUnknown = exports.AGGREGATIONS = void 0;
730
679
  var lodash_1 = __webpack_require__(3);
731
- var trellisUtils_1 = __webpack_require__(80);
680
+ var trellisUtils_1 = __webpack_require__(83);
732
681
  exports.AGGREGATIONS = 'aggregations';
733
682
  /**
734
683
  * There can be certain SPL cmds that can produce dataSource without a specific field meta info (like group_by_rank, split_by_field etc),
@@ -749,7 +698,7 @@ var dataSourcesSplitByAggregationsUnknown = function dataSourcesSplitByAggregati
749
698
  for (var i = 0; i < fields.length; i += 1) {
750
699
  var fieldName = fields[i].name;
751
700
  if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
752
- splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
701
+ splitDataSources[fieldName] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
753
702
  splitDataSources[fieldName].primary.data.fields = [fields[i]];
754
703
  splitDataSources[fieldName].primary.data.columns = [columns[i]];
755
704
  }
@@ -771,12 +720,12 @@ var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitB
771
720
  var splitByFields = [];
772
721
  var errorCode = null;
773
722
  if (typeof fields[0] !== 'string') {
774
- splitByFields = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
723
+ splitByFields = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
775
724
  }
776
725
  if (splitByFields && splitByFields.length > 0) {
777
726
  splitDataSources = {};
778
727
  splitByFields.forEach(function (splitByField) {
779
- splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
728
+ splitDataSources[splitByField] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
780
729
  splitDataSources[splitByField].primary.data.fields = [fields[0]];
781
730
  splitDataSources[splitByField].primary.data.columns = [columns[0]];
782
731
  fields.forEach(function (field, idx) {
@@ -795,7 +744,7 @@ var dataSourcesSplitByAggregationsTimechartAndChart = function dataSourcesSplitB
795
744
  for (var i = 1; i < fields.length; i += 1) {
796
745
  var fieldName = fields[i].name;
797
746
  if (!(fieldName === null || fieldName === void 0 ? void 0 : fieldName.startsWith('_'))) {
798
- splitDataSources[fieldName] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
747
+ splitDataSources[fieldName] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
799
748
  splitDataSources[fieldName].primary.data.fields = [fields[0], fields[i]];
800
749
  splitDataSources[fieldName].primary.data.columns = [columns[0], columns[i]];
801
750
  }
@@ -817,12 +766,12 @@ var dataSourcesSplitByAggregationsStats = function dataSourcesSplitByAggregation
817
766
  var splitByFields = [];
818
767
  var errorCode = null;
819
768
  if (typeof fields[0] !== 'string') {
820
- splitByFields = trellisUtils_1.extractDataSourceAggregationKeysStats(fields);
769
+ splitByFields = (0, trellisUtils_1.extractDataSourceAggregationKeysStats)(fields);
821
770
  }
822
771
  if (splitByFields && splitByFields.length > 0) {
823
772
  splitDataSources = {};
824
773
  splitByFields.forEach(function (splitByField) {
825
- splitDataSources[splitByField] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
774
+ splitDataSources[splitByField] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
826
775
  splitDataSources[splitByField].primary.data.fields = [fields[0]];
827
776
  splitDataSources[splitByField].primary.data.columns = [columns[0]];
828
777
  var idx = fields.findIndex(function (field) {
@@ -850,11 +799,11 @@ var dataSourcesSplitByModeTimechart = function dataSourcesSplitByModeTimechart(d
850
799
  var splitByFields = [];
851
800
  var errorCode = null;
852
801
  if (typeof fields[0] !== 'string') {
853
- splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
802
+ splitByFields = (0, trellisUtils_1.extractSplitByFieldsChartFields)(fields);
854
803
  }
855
804
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
856
805
  splitDataSources = {};
857
- var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
806
+ var dataSourceKeys = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
858
807
  var valueKeys = [];
859
808
  for (var i = 1; i < fields.length; i += 1) {
860
809
  // not including internal fields
@@ -863,7 +812,7 @@ var dataSourcesSplitByModeTimechart = function dataSourcesSplitByModeTimechart(d
863
812
  }
864
813
  }
865
814
  valueKeys.forEach(function (val) {
866
- splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
815
+ splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
867
816
  splitDataSources[val].primary.data.fields = [{
868
817
  name: fields[0].name
869
818
  }].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
@@ -897,7 +846,7 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
897
846
  var splitByFields = [];
898
847
  var errorCode = null;
899
848
  if (typeof fields[0] !== 'string') {
900
- splitByFields = trellisUtils_1.extractSplitByFieldsChartFields(fields);
849
+ splitByFields = (0, trellisUtils_1.extractSplitByFieldsChartFields)(fields);
901
850
  }
902
851
  if (splitByFields && splitByFields.indexOf(splitBy) > -1) {
903
852
  splitDataSources = {};
@@ -907,7 +856,7 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
907
856
  var otherSplitBy = splitByFields.filter(function (f) {
908
857
  return f !== splitBy;
909
858
  });
910
- var dataSourceKeys = trellisUtils_1.extractDataSourceAggregationKeysChart(fields);
859
+ var dataSourceKeys = (0, trellisUtils_1.extractDataSourceAggregationKeysChart)(fields);
911
860
  var nonDataSourceAggregations = [];
912
861
  if (!dataSourceKeys.length && fields[0].groupby_rank === '0' && fields.length && !fields[1].groupby_rank) {
913
862
  /* check for another aggregation scenario where no key 'data_source' will be returned (applies for both chart and stats cmd)
@@ -935,9 +884,9 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
935
884
  }
936
885
  if (splitByFieldIdx === 0) {
937
886
  // if splitBy is the first field, split row wise
938
- var valueKeys = lodash_1.cloneDeep(columns[0]);
887
+ var valueKeys = (0, lodash_1.cloneDeep)(columns[0]);
939
888
  valueKeys.forEach(function (val, idx) {
940
- splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
889
+ splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
941
890
  splitDataSources[val].primary.data.fields = [];
942
891
  if (otherSplitBy.length) {
943
892
  splitDataSources[val].primary.data.fields = [{
@@ -1045,7 +994,7 @@ var dataSourcesSplitByModeChart = function dataSourcesSplitByModeChart(dataSourc
1045
994
  _valueKeys.push(fields[_i2].splitby_value ? fields[_i2].splitby_value : fields[_i2].name);
1046
995
  }
1047
996
  _valueKeys.forEach(function (val) {
1048
- splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
997
+ splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
1049
998
  splitDataSources[val].primary.data.fields = [{
1050
999
  name: otherSplitBy[0]
1051
1000
  }].concat(_toConsumableArray(dataSourceKeys.map(function (k) {
@@ -1084,7 +1033,7 @@ var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatso
1084
1033
  var splitByFields = [];
1085
1034
  var errorCode = null;
1086
1035
  if (typeof fields[0] !== 'string') {
1087
- splitByFields = splitMode !== trellisUtils_1.UNKNOWN ? trellisUtils_1.extractSplitByFieldsForStats(fields) : trellisUtils_1.extractSplitByFieldsForUnknown(fields);
1036
+ splitByFields = splitMode !== trellisUtils_1.UNKNOWN ? (0, trellisUtils_1.extractSplitByFieldsForStats)(fields) : (0, trellisUtils_1.extractSplitByFieldsForUnknown)(fields);
1088
1037
  }
1089
1038
  var splitByIndex = fields === null || fields === void 0 ? void 0 : fields.findIndex(function (field) {
1090
1039
  return field === splitBy || field.name === splitBy;
@@ -1099,12 +1048,12 @@ var dataSourcesSplitByModeStatsorUnknown = function dataSourcesSplitByModeStatso
1099
1048
  splitDataSources[val].push(idx);
1100
1049
  }
1101
1050
  });
1102
- var cloneFields = lodash_1.cloneDeep(fields);
1051
+ var cloneFields = (0, lodash_1.cloneDeep)(fields);
1103
1052
  cloneFields.splice(splitByIndex, 1);
1104
1053
  var valueKeys = Object.keys(splitDataSources);
1105
1054
  valueKeys.forEach(function (val) {
1106
- var valIndices = lodash_1.cloneDeep(splitDataSources[val]);
1107
- splitDataSources[val] = lodash_1.cloneDeep(lodash_1.omit(dataSource, ['primary.data.fields', 'primary.data.columns']));
1055
+ var valIndices = (0, lodash_1.cloneDeep)(splitDataSources[val]);
1056
+ splitDataSources[val] = (0, lodash_1.cloneDeep)((0, lodash_1.omit)(dataSource, ['primary.data.fields', 'primary.data.columns']));
1108
1057
  splitDataSources[val].primary.data.fields = cloneFields;
1109
1058
  splitDataSources[val].primary.data.columns = [];
1110
1059
  columns.forEach(function (col, idx) {
@@ -1129,13 +1078,13 @@ var getTrellisDataSourcesBySplitMode = function getTrellisDataSourcesBySplitMode
1129
1078
  var result = null;
1130
1079
  try {
1131
1080
  if (splitMode === trellisUtils_1.TIMECHART) {
1132
- result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeTimechart(dataSources, trellisSplitBy);
1081
+ result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsTimechartAndChart)(dataSources) : (0, exports.dataSourcesSplitByModeTimechart)(dataSources, trellisSplitBy);
1133
1082
  } else if (splitMode === trellisUtils_1.STATS) {
1134
- result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsStats(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.STATS);
1083
+ result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsStats)(dataSources) : (0, exports.dataSourcesSplitByModeStatsorUnknown)(dataSources, trellisSplitBy, trellisUtils_1.STATS);
1135
1084
  } else if (splitMode === trellisUtils_1.CHART) {
1136
- result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsTimechartAndChart(dataSources) : exports.dataSourcesSplitByModeChart(dataSources, trellisSplitBy);
1085
+ result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsTimechartAndChart)(dataSources) : (0, exports.dataSourcesSplitByModeChart)(dataSources, trellisSplitBy);
1137
1086
  } else if (splitMode === trellisUtils_1.UNKNOWN) {
1138
- result = trellisSplitBy === exports.AGGREGATIONS ? exports.dataSourcesSplitByAggregationsUnknown(dataSources) : exports.dataSourcesSplitByModeStatsorUnknown(dataSources, trellisSplitBy, trellisUtils_1.UNKNOWN);
1087
+ result = trellisSplitBy === exports.AGGREGATIONS ? (0, exports.dataSourcesSplitByAggregationsUnknown)(dataSources) : (0, exports.dataSourcesSplitByModeStatsorUnknown)(dataSources, trellisSplitBy, trellisUtils_1.UNKNOWN);
1139
1088
  }
1140
1089
  } catch (ex) {
1141
1090
  console.error('getTrellisDataSourcesBySplitMode ', ex);
@@ -1182,14 +1131,14 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
1182
1131
  var width = _ref.width;
1183
1132
  return {
1184
1133
  style: {
1185
- width: style_1.toPx(width)
1134
+ width: (0, style_1.toPx)(width)
1186
1135
  }
1187
1136
  };
1188
1137
  }).withConfig({
1189
1138
  displayName: "FixedSizeContainer__Item",
1190
1139
  componentId: "sc-1yhgpod-0"
1191
1140
  })(["position:relative;background-color:", "};"], function (props) {
1192
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
1141
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
1193
1142
  });
1194
1143
  // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
1195
1144
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
@@ -1197,16 +1146,16 @@ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
1197
1146
  height = _ref2.height;
1198
1147
  return {
1199
1148
  style: Object.assign(Object.assign({}, width && {
1200
- width: style_1.toPx(width)
1149
+ width: (0, style_1.toPx)(width)
1201
1150
  }), height && {
1202
- height: style_1.toPx(height)
1151
+ height: (0, style_1.toPx)(height)
1203
1152
  })
1204
1153
  };
1205
1154
  }).withConfig({
1206
1155
  displayName: "FixedSizeContainer__FixSizeItem",
1207
1156
  componentId: "sc-1yhgpod-1"
1208
1157
  })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
1209
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
1158
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
1210
1159
  });
1211
1160
  var ItemContent = styled_components_1.default.div.withConfig({
1212
1161
  displayName: "FixedSizeContainer__ItemContent",
@@ -1230,7 +1179,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
1230
1179
  }
1231
1180
  return React.createElement(FixSizeItem, {
1232
1181
  "data-test": "fix-size-item",
1233
- "data-splunk-visualization-version": "25.13.1 - ea48ec41e",
1182
+ "data-splunk-visualization-version": "26.0.0 - 2f7458907",
1234
1183
  width: width,
1235
1184
  height: height,
1236
1185
  backgroundColor: backgroundColor
@@ -1302,6 +1251,264 @@ module.exports = require("@babel/runtime/helpers/slicedToArray");
1302
1251
 
1303
1252
  /***/ }),
1304
1253
 
1254
+ /***/ 176:
1255
+ /***/ (function(module, exports, __webpack_require__) {
1256
+
1257
+ "use strict";
1258
+
1259
+
1260
+ Object.defineProperty(exports, "__esModule", {
1261
+ value: true
1262
+ });
1263
+ var React = __webpack_require__(1);
1264
+ var T = __webpack_require__(0);
1265
+ var colorConstants_1 = __webpack_require__(49);
1266
+ var gaugeUtils_1 = __webpack_require__(96);
1267
+ var displayUtils_1 = __webpack_require__(80);
1268
+ var GaugeGraph = function GaugeGraph(_ref) {
1269
+ var _ref$width = _ref.width,
1270
+ width = _ref$width === void 0 ? 200 : _ref$width,
1271
+ _ref$height = _ref.height,
1272
+ height = _ref$height === void 0 ? 200 : _ref$height,
1273
+ _ref$strokeWidth = _ref.strokeWidth,
1274
+ strokeWidth = _ref$strokeWidth === void 0 ? (0, gaugeUtils_1.getGaugeStrokeWidth)(height) : _ref$strokeWidth,
1275
+ _ref$radialBackground = _ref.radialBackgroundColor,
1276
+ radialBackgroundColor = _ref$radialBackground === void 0 ? colorConstants_1.RADIAL_BACKGROUND_COLOR : _ref$radialBackground,
1277
+ fontColor = _ref.fontColor,
1278
+ formattedGaugeRanges = _ref.formattedGaugeRanges,
1279
+ propMajorValue = _ref.majorValue,
1280
+ maxValue = _ref.maxValue,
1281
+ minValue = _ref.minValue,
1282
+ showRadialGraph = _ref.showRadialGraph;
1283
+ function toRadians(degrees) {
1284
+ return degrees * Math.PI / 180;
1285
+ }
1286
+ function toDegrees(radians) {
1287
+ return radians * 180 / Math.PI;
1288
+ }
1289
+ var labelFontSize = (0, gaugeUtils_1.getLabelFontSize)(height, showRadialGraph);
1290
+ var labelFontSizeString = "".concat(String(labelFontSize), "px Splunk Platform Sans");
1291
+ var maxOffset = 0.35;
1292
+ // space between the label and the radial
1293
+ var labelSpace = labelFontSize / 2;
1294
+ // length of the base of triangle marker
1295
+ var triangleBase = height >= 113 ? 8 : 4;
1296
+ // amount of padding around semi-circle
1297
+ var padding = labelFontSize > 0 ? labelSpace * 2 + labelFontSize * 2 : triangleBase;
1298
+ var semicircleRadius = height - strokeWidth / 2 - padding;
1299
+ var circumference = semicircleRadius * 2 * Math.PI;
1300
+ var bgCircleOffset = circumference * 0.5; // half a circle
1301
+ var strokeDashoffset = circumference * 0.5; // half a circle
1302
+ var semicircleEdgeRadius = semicircleRadius + strokeWidth / 2;
1303
+ // For inner radial
1304
+ var innerStrokeWidth = strokeWidth / 4;
1305
+ var innerSemicircleRadius = height - strokeWidth - padding - innerStrokeWidth / 2 - 1; // subtract 1 to make the 1px space between outer and inner arc
1306
+ var innerCircumference = innerSemicircleRadius * 2 * Math.PI;
1307
+ // Center of radials
1308
+ var cx = width / 2;
1309
+ var cyOffset = labelFontSize > 0 ? labelSpace * 2 + labelFontSize : triangleBase / 2;
1310
+ var cy = semicircleRadius + strokeWidth / 2 + cyOffset;
1311
+ var majorValue;
1312
+ if (typeof propMajorValue === 'string') {
1313
+ majorValue = parseInt(propMajorValue, 10);
1314
+ } else {
1315
+ majorValue = propMajorValue;
1316
+ }
1317
+ var range = (0, gaugeUtils_1.getGaugeRange)(formattedGaugeRanges, majorValue);
1318
+ var circles = [];
1319
+ var labels = [];
1320
+ var showMarker = false;
1321
+ // Calculate Marker Values
1322
+ var radius = semicircleRadius;
1323
+ var x = strokeWidth / 2 + innerStrokeWidth + 2; // distance of tip of marker from center of outer semicircle stroke
1324
+ var markerVal = Math.max(Math.min(maxValue, majorValue), minValue);
1325
+ var theta = toRadians(180 - (0, displayUtils_1.getRadialProgress)(markerVal - minValue, minValue, maxValue) / 100 * 180); // degree of progress
1326
+ var p1x = cx + (radius - x) * Math.cos(theta);
1327
+ var p1y = cy - (radius - x) * Math.sin(theta);
1328
+ var centerX = (radius - x - triangleBase / Math.sqrt(3)) * Math.cos(theta);
1329
+ var centerY = (radius - x - triangleBase / Math.sqrt(3)) * Math.sin(theta);
1330
+ var rotation1 = 2 * Math.PI / 3; // degrees of rotation around center for 2nd point
1331
+ var rotation2 = -2 * Math.PI / 3; // degrees of rotation around center for 3rd point
1332
+ var xVal = (radius - x) * Math.cos(theta); // x-axis offset of center
1333
+ var yVal = (radius - x) * Math.sin(theta); // y-axis offset of center
1334
+ var p2x = centerX + (xVal - centerX) * Math.cos(rotation1) - (yVal - centerY) * Math.sin(rotation1); // x-axis of 2nd point
1335
+ var p2y = centerY + (xVal - centerX) * Math.sin(rotation1) + (yVal - centerY) * Math.cos(rotation1); // y-axis of 2nd point
1336
+ var p3x = centerX + (xVal - centerX) * Math.cos(rotation2) - (yVal - centerY) * Math.sin(rotation2); // x-axis of 3rd point
1337
+ var p3y = centerY + (xVal - centerX) * Math.sin(rotation2) + (yVal - centerY) * Math.cos(rotation2); // y-axis of 3rd point
1338
+ var d = "M ".concat(p1x, " ").concat(p1y, " L ").concat(cx + p2x, " ").concat(cy - p2y, " L ").concat(cx + p3x, " ").concat(cy - p3y, " Z"); // d-value for marker path in SVG
1339
+ formattedGaugeRanges.forEach(function (r, i) {
1340
+ if (range >= i && typeof majorValue === 'number') {
1341
+ var startVal = Math.min(r.from, majorValue);
1342
+ var endVal = Math.min(r.to, majorValue);
1343
+ // width of stroke for each gauge range
1344
+ var _progressWidth = (0, gaugeUtils_1.getProgressWidth)(endVal - startVal, minValue, maxValue, circumference);
1345
+ // distance of stroke from right edge of circle
1346
+ var _offsetDistance = (0, gaugeUtils_1.getProgressWidth)(maxValue - startVal, minValue, maxValue, circumference);
1347
+ // main gauge progress radial
1348
+ circles.push(React.createElement("circle", {
1349
+ "data-test": "progress-radial",
1350
+ stroke: r.value,
1351
+ fill: "transparent",
1352
+ strokeWidth: strokeWidth,
1353
+ strokeDasharray: "".concat(_progressWidth, " ").concat(circumference - _progressWidth),
1354
+ style: {
1355
+ strokeDashoffset: _offsetDistance
1356
+ },
1357
+ r: semicircleRadius,
1358
+ cx: cx,
1359
+ cy: cy,
1360
+ key: "progress".concat(r.from)
1361
+ }));
1362
+ }
1363
+ if (range <= i && (typeof majorValue !== 'number' || majorValue < r.to) && i < formattedGaugeRanges.length - 1) {
1364
+ // width of stroke for each breakpoint dash
1365
+ var breakpointWidth = 1;
1366
+ // opacity of the dash (15%)
1367
+ var breakpointOpacity = 0.15;
1368
+ // distance of stroke from right edge of circle
1369
+ var _offsetDistance2 = (0, gaugeUtils_1.getProgressWidth)(maxValue - r.to, minValue, maxValue, circumference);
1370
+ // dashes at each gauge breakpoint after the major value
1371
+ circles.push(React.createElement("circle", {
1372
+ "data-test": "breakpoint-radial",
1373
+ stroke: fontColor,
1374
+ opacity: breakpointOpacity,
1375
+ fill: "transparent",
1376
+ strokeWidth: strokeWidth,
1377
+ strokeDasharray: "".concat(breakpointWidth, " ").concat(circumference - breakpointWidth),
1378
+ style: {
1379
+ strokeDashoffset: _offsetDistance2
1380
+ },
1381
+ r: semicircleRadius,
1382
+ cx: cx,
1383
+ cy: cy,
1384
+ key: "breakpoint".concat(r.from)
1385
+ }));
1386
+ }
1387
+ if (i < formattedGaugeRanges.length - 1) {
1388
+ var toTheta = toRadians(180 - (0, displayUtils_1.getRadialProgress)(r.to - minValue, minValue, maxValue) / 100 * 180);
1389
+ var labelX = cx + (semicircleEdgeRadius + labelSpace) * Math.cos(toTheta);
1390
+ var labelY = cy - (semicircleEdgeRadius + labelSpace) * Math.sin(toTheta);
1391
+ var labelWidth = (0, gaugeUtils_1.computeTextWidth)(String(r.to), labelFontSizeString);
1392
+ var vertOffset = (0, gaugeUtils_1.getVerticalLabelOffset)(toDegrees(toTheta), labelFontSize, maxOffset);
1393
+ labelY += vertOffset;
1394
+ if (r.to < (maxValue + minValue) / 2) {
1395
+ labelX -= labelWidth + vertOffset / 3;
1396
+ } else if (r.to === (maxValue + minValue) / 2) {
1397
+ labelX -= labelWidth / 2;
1398
+ }
1399
+ // labels of each gauge range, excluding min and max
1400
+ labels.push(React.createElement("text", {
1401
+ "data-test": "label",
1402
+ fill: fontColor,
1403
+ x: labelX,
1404
+ y: labelY,
1405
+ fontSize: labelFontSize,
1406
+ key: "label".concat(r.from)
1407
+ }, r.to));
1408
+ }
1409
+ // width of stroke for each inner radial gauge range
1410
+ var progressWidth = (0, gaugeUtils_1.getProgressWidth)(r.to - r.from, minValue, maxValue, innerCircumference);
1411
+ // distance of stroke from right edge of circle
1412
+ var offsetDistance = (0, gaugeUtils_1.getProgressWidth)(maxValue - r.from, minValue, maxValue, innerCircumference);
1413
+ // inner radial for all gauge ranges
1414
+ circles.push(React.createElement("circle", {
1415
+ "data-test": "inner-radial",
1416
+ stroke: r.value,
1417
+ fill: "transparent",
1418
+ strokeWidth: innerStrokeWidth,
1419
+ strokeDasharray: "".concat(progressWidth, " ").concat(innerCircumference - progressWidth),
1420
+ style: {
1421
+ strokeDashoffset: offsetDistance
1422
+ },
1423
+ r: innerSemicircleRadius,
1424
+ cx: cx,
1425
+ cy: cy,
1426
+ key: "inner".concat(r.from)
1427
+ }));
1428
+ });
1429
+ // min label
1430
+ labels.push(React.createElement("text", {
1431
+ "data-test": "min-label",
1432
+ fill: fontColor,
1433
+ x: cx - semicircleEdgeRadius,
1434
+ y: cy + labelFontSize,
1435
+ fontSize: labelFontSize,
1436
+ key: "min-label"
1437
+ }, minValue));
1438
+ // max label
1439
+ var maxLabelWidth = (0, gaugeUtils_1.computeTextWidth)(String(maxValue), labelFontSizeString);
1440
+ labels.push(React.createElement("text", {
1441
+ "data-test": "max-label",
1442
+ fill: fontColor,
1443
+ x: cx + semicircleEdgeRadius - maxLabelWidth,
1444
+ y: cy + labelFontSize,
1445
+ fontSize: labelFontSize,
1446
+ key: "max-label"
1447
+ }, maxValue));
1448
+ // dash to indicate majorValue
1449
+ showMarker = typeof majorValue === 'number' && formattedGaugeRanges.length >= 1;
1450
+ if (showMarker && majorValue > formattedGaugeRanges[0].from && majorValue <= formattedGaugeRanges[formattedGaugeRanges.length - 1].to) {
1451
+ var progressWidth = (0, gaugeUtils_1.getProgressWidth)(maxValue - majorValue, minValue, maxValue, circumference);
1452
+ var indicatorWidth = 1;
1453
+ circles.push(React.createElement("circle", {
1454
+ "data-test": "indicator-radial",
1455
+ stroke: fontColor || '#FFFFFF',
1456
+ fill: "transparent",
1457
+ strokeWidth: strokeWidth,
1458
+ strokeDasharray: "".concat(indicatorWidth, " ").concat(circumference - indicatorWidth),
1459
+ style: {
1460
+ strokeDashoffset: progressWidth
1461
+ },
1462
+ r: semicircleRadius,
1463
+ cx: cx,
1464
+ cy: cy,
1465
+ key: "indicator"
1466
+ }));
1467
+ }
1468
+ return React.createElement("svg", {
1469
+ height: height,
1470
+ width: width,
1471
+ "data-test": "radial-gauge-visualization"
1472
+ }, React.createElement("g", null, React.createElement("circle", {
1473
+ "data-test": "background-radial",
1474
+ stroke: radialBackgroundColor,
1475
+ fill: "transparent",
1476
+ strokeWidth: strokeWidth,
1477
+ strokeDasharray: "".concat(bgCircleOffset, " ").concat(circumference - bgCircleOffset),
1478
+ style: {
1479
+ strokeDashoffset: strokeDashoffset
1480
+ },
1481
+ r: semicircleRadius,
1482
+ cx: cx,
1483
+ cy: cy
1484
+ }), circles, labels, showMarker && React.createElement("path", {
1485
+ fill: fontColor,
1486
+ d: d,
1487
+ opacity: "100",
1488
+ "data-z-index": "4",
1489
+ "data-test": "marker"
1490
+ })));
1491
+ };
1492
+ GaugeGraph.propTypes = {
1493
+ width: T.number,
1494
+ height: T.number,
1495
+ strokeWidth: T.number,
1496
+ radialBackgroundColor: T.string,
1497
+ formattedGaugeRanges: T.array,
1498
+ majorValue: T.oneOfType([T.string, T.number]),
1499
+ maxValue: T.number,
1500
+ minValue: T.number,
1501
+ showRadialGraph: T.bool
1502
+ };
1503
+ GaugeGraph.defaultProps = {
1504
+ strokeWidth: 12,
1505
+ formattedGaugeRanges: [],
1506
+ majorValue: 'N/A'
1507
+ };
1508
+ exports.default = GaugeGraph;
1509
+
1510
+ /***/ }),
1511
+
1305
1512
  /***/ 18:
1306
1513
  /***/ (function(module, exports) {
1307
1514
 
@@ -1483,8 +1690,8 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
1483
1690
  */
1484
1691
  function getInitialPreset(vizContext, vizOptions, presets) {
1485
1692
  return presets.find(function (preset) {
1486
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
1487
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
1693
+ var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
1694
+ var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
1488
1695
  var presetContextKeys = Object.keys(presetContext);
1489
1696
  var presetOptionKeys = Object.keys(presetOptions);
1490
1697
  // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
@@ -1501,7 +1708,7 @@ exports.getInitialPreset = getInitialPreset;
1501
1708
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
1502
1709
  */
1503
1710
  function generatePrecisionValues(numPrecisionValues) {
1504
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
1711
+ return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
1505
1712
  return {
1506
1713
  label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
1507
1714
  value: i
@@ -1587,13 +1794,13 @@ __webpack_require__.r(__webpack_exports__);
1587
1794
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
1588
1795
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
1589
1796
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
1590
- /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
1797
+ /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
1591
1798
  /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__);
1592
1799
  /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54);
1593
1800
  /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__);
1594
- /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
1801
+ /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29);
1595
1802
  /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__);
1596
- /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50);
1803
+ /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(49);
1597
1804
  /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__);
1598
1805
 
1599
1806
  function ownKeys(object, enumerableOnly) {
@@ -2526,35 +2733,35 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
2526
2733
  /***/ 25:
2527
2734
  /***/ (function(module, exports) {
2528
2735
 
2529
- module.exports = require("@splunk/visualization-context/TimezoneContext");
2736
+ module.exports = require("@splunk/ui-utils/id");
2530
2737
 
2531
2738
  /***/ }),
2532
2739
 
2533
2740
  /***/ 26:
2534
2741
  /***/ (function(module, exports) {
2535
2742
 
2536
- module.exports = require("@splunk/visualizations-shared/hocUtils");
2743
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
2537
2744
 
2538
2745
  /***/ }),
2539
2746
 
2540
2747
  /***/ 27:
2541
2748
  /***/ (function(module, exports) {
2542
2749
 
2543
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
2750
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
2544
2751
 
2545
2752
  /***/ }),
2546
2753
 
2547
2754
  /***/ 28:
2548
2755
  /***/ (function(module, exports) {
2549
2756
 
2550
- module.exports = require("@splunk/visualizations-shared/propUtils");
2757
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
2551
2758
 
2552
2759
  /***/ }),
2553
2760
 
2554
2761
  /***/ 29:
2555
2762
  /***/ (function(module, exports) {
2556
2763
 
2557
- module.exports = require("@splunk/visualization-encoding/Options");
2764
+ module.exports = require("@splunk/visualizations-shared/propUtils");
2558
2765
 
2559
2766
  /***/ }),
2560
2767
 
@@ -2568,11 +2775,18 @@ module.exports = require("lodash");
2568
2775
  /***/ 30:
2569
2776
  /***/ (function(module, exports) {
2570
2777
 
2571
- module.exports = require("@splunk/visualizations-shared/numberUtils");
2778
+ module.exports = require("@splunk/visualization-encoding/Options");
2572
2779
 
2573
2780
  /***/ }),
2574
2781
 
2575
2782
  /***/ 31:
2783
+ /***/ (function(module, exports) {
2784
+
2785
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
2786
+
2787
+ /***/ }),
2788
+
2789
+ /***/ 32:
2576
2790
  /***/ (function(module, exports, __webpack_require__) {
2577
2791
 
2578
2792
  "use strict";
@@ -2596,9 +2810,9 @@ var FixedSizeContainer_1 = __webpack_require__(13);
2596
2810
  */
2597
2811
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
2598
2812
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2599
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
2813
+ var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
2600
2814
  var noData = data === undefined;
2601
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
2815
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
2602
2816
  var noFields = fields === undefined;
2603
2817
  return loading || noData || noFields;
2604
2818
  };
@@ -2639,7 +2853,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
2639
2853
  width: width,
2640
2854
  height: height,
2641
2855
  level: "warning",
2642
- message: i18n_1._('No DataSource Connected')
2856
+ message: (0, i18n_1._)('No DataSource Connected')
2643
2857
  });
2644
2858
  };
2645
2859
  IconPlaceholder.propTypes = propTypes;
@@ -2647,14 +2861,7 @@ IconPlaceholder.defaultProps = {
2647
2861
  width: '100%',
2648
2862
  height: 250
2649
2863
  };
2650
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
2651
-
2652
- /***/ }),
2653
-
2654
- /***/ 32:
2655
- /***/ (function(module, exports) {
2656
-
2657
- module.exports = require("@splunk/ui-utils/id");
2864
+ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
2658
2865
 
2659
2866
  /***/ }),
2660
2867
 
@@ -2689,7 +2896,7 @@ var getSortingParams = function getSortingParams(_ref) {
2689
2896
  };
2690
2897
  var onSort;
2691
2898
  if (typeof onRequestParamsChange === 'function') {
2692
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
2899
+ if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
2693
2900
  currentSortKey = Object.keys(requestParams.sort).shift();
2694
2901
  currentSortDir = requestParams.sort[currentSortKey];
2695
2902
  }
@@ -2698,7 +2905,7 @@ var getSortingParams = function getSortingParams(_ref) {
2698
2905
  var sortKey = _ref2.sortKey,
2699
2906
  sortDir = _ref2.sortDir;
2700
2907
  if (typeof sortKey === 'string') {
2701
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
2908
+ var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
2702
2909
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
2703
2910
  offset: 0,
2704
2911
  sort: _defineProperty({}, sortKey, nextSortDir)
@@ -2749,7 +2956,7 @@ var getPaginationParams = function getPaginationParams(_ref) {
2749
2956
  var onChangeHandler = function onChangeHandler(e, _ref2) {
2750
2957
  var page = _ref2.page,
2751
2958
  countArg = _ref2.count;
2752
- var newParams = lodash_1.cloneDeep(requestParams);
2959
+ var newParams = (0, lodash_1.cloneDeep)(requestParams);
2753
2960
  if (typeof countArg === 'number') {
2754
2961
  newParams.count = countArg;
2755
2962
  newParams.offset = 0;
@@ -2813,16 +3020,16 @@ Object.defineProperty(exports, "__esModule", {
2813
3020
  var React = __webpack_require__(1);
2814
3021
  var lodash_1 = __webpack_require__(3);
2815
3022
  var getSettingsFromThemedProps_1 = __webpack_require__(37);
2816
- var Options_1 = __webpack_require__(29);
3023
+ var Options_1 = __webpack_require__(30);
2817
3024
  var SanitizeProps_1 = __webpack_require__(38);
2818
- var TimezoneContext_1 = __webpack_require__(25);
3025
+ var TimezoneContext_1 = __webpack_require__(26);
2819
3026
  var moment_1 = __webpack_require__(39);
2820
3027
  var FeatureFlagContext_1 = __webpack_require__(21);
2821
3028
  var styled_components_1 = __webpack_require__(4);
2822
- var hocUtils_1 = __webpack_require__(26);
2823
- var JSONSchemaUtils_1 = __webpack_require__(27);
3029
+ var hocUtils_1 = __webpack_require__(27);
3030
+ var JSONSchemaUtils_1 = __webpack_require__(28);
2824
3031
  var async_dynamic_options_evaluator_1 = __webpack_require__(40);
2825
- var id_1 = __webpack_require__(32);
3032
+ var id_1 = __webpack_require__(25);
2826
3033
  var SplunkVisualization_1 = __webpack_require__(41);
2827
3034
  var VizBehavior_1 = __webpack_require__(6);
2828
3035
  var getSorting_1 = __webpack_require__(33);
@@ -2843,8 +3050,8 @@ var withDashboardViz = function withDashboardViz(opts) {
2843
3050
  computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
2844
3051
  disableEditModeCover = opts.disableEditModeCover,
2845
3052
  useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
2846
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
2847
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
3053
+ var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
3054
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
2848
3055
  var DashboardViz = function DashboardViz(props) {
2849
3056
  var _a;
2850
3057
  var mode = props.mode,
@@ -2879,19 +3086,19 @@ var withDashboardViz = function withDashboardViz(opts) {
2879
3086
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
2880
3087
  };
2881
3088
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
2882
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
3089
+ var _ref = (0, getSettingsFromThemedProps_1.default)({
2883
3090
  theme: theme
2884
3091
  }),
2885
- currentThemeFamily = _getSettingsFromTheme.family,
2886
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
2887
- currentThemeDensity = _getSettingsFromTheme.density;
3092
+ currentThemeFamily = _ref.family,
3093
+ currentThemeColorScheme = _ref.colorScheme,
3094
+ currentThemeDensity = _ref.density;
2888
3095
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
2889
3096
  var _React$useState = React.useState({}),
2890
3097
  _React$useState2 = _slicedToArray(_React$useState, 2),
2891
3098
  evaluatedOptionsAsync = _React$useState2[0],
2892
3099
  setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
2893
3100
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
2894
- var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
3101
+ var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
2895
3102
  _React$useState4 = _slicedToArray(_React$useState3, 1),
2896
3103
  visualizationID = _React$useState4[0];
2897
3104
  var _React$useState5 = React.useState({}),
@@ -2902,16 +3109,17 @@ var withDashboardViz = function withDashboardViz(opts) {
2902
3109
  _React$useState8 = _slicedToArray(_React$useState7, 2),
2903
3110
  dataFramesInState = _React$useState8[0],
2904
3111
  setDataFramesInState = _React$useState8[1];
2905
- var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
3112
+ var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
2906
3113
  _React$useState10 = _slicedToArray(_React$useState9, 2),
2907
3114
  useAsyncEvaluatedOptions = _React$useState10[0],
2908
3115
  setUseAsyncEvaluatedOptions = _React$useState10[1];
2909
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
3116
+ var isMounted = React.useRef(true);
3117
+ evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
2910
3118
  try {
2911
3119
  if (useAsyncEvaluatedOptions) {
2912
3120
  var optionsToEvaluate = {
2913
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
2914
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
3121
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
3122
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
2915
3123
  };
2916
3124
  var asyncDynamicOptionsEvaluatorParams = {
2917
3125
  visualizationID: visualizationID,
@@ -2922,10 +3130,10 @@ var withDashboardViz = function withDashboardViz(opts) {
2922
3130
  };
2923
3131
  async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
2924
3132
  setEvaluatedOptionsAsync(results.results);
2925
- }).catch(function (e) {
2926
- // eslint-disable-next-line no-console
2927
- console.error("unexpected error evaluating options - async: ".concat(e.message));
2928
- setUseAsyncEvaluatedOptions(false);
3133
+ }).catch(function () {
3134
+ if (isMounted.current) {
3135
+ setUseAsyncEvaluatedOptions(false);
3136
+ }
2929
3137
  });
2930
3138
  } else {
2931
3139
  var dataFrames = dataFramesInState;
@@ -2935,8 +3143,8 @@ var withDashboardViz = function withDashboardViz(opts) {
2935
3143
  setDataFramesInState(dataFrames);
2936
3144
  }
2937
3145
  return Options_1.Options.evaluate({
2938
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
2939
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
3146
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
3147
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
2940
3148
  }, dataSources, themeFunc, dataFrames);
2941
3149
  }
2942
3150
  } catch (e) {
@@ -2965,6 +3173,7 @@ var withDashboardViz = function withDashboardViz(opts) {
2965
3173
  React.useEffect(function () {
2966
3174
  return function () {
2967
3175
  if (useAsyncEvaluatedOptions) {
3176
+ isMounted.current = false;
2968
3177
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
2969
3178
  }
2970
3179
  };
@@ -2974,7 +3183,7 @@ var withDashboardViz = function withDashboardViz(opts) {
2974
3183
  var _vizConfig$requiredPr = vizConfig.requiredProps,
2975
3184
  requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
2976
3185
  supports = vizConfig.supports;
2977
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
3186
+ var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
2978
3187
  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
2979
3188
  ) {
2980
3189
  return React.createElement(MissingPropsMessage_1.default, {
@@ -2990,7 +3199,7 @@ var withDashboardViz = function withDashboardViz(opts) {
2990
3199
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
2991
3200
  var supportedEvents = vizConfig.events;
2992
3201
  Object.keys(supportedEvents).forEach(function (eventName) {
2993
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
3202
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
2994
3203
  eventCallbackProps[eventCallbackPropName] = null;
2995
3204
  // todo: refactor single value and single value icon to send payload from viz
2996
3205
  // then remove these lines
@@ -3033,19 +3242,19 @@ var withDashboardViz = function withDashboardViz(opts) {
3033
3242
  */
3034
3243
  var dataSourceMetadata = {};
3035
3244
  var OptionKey = 'paginateDataSourceKey';
3036
- var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
3037
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
3038
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
3039
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
3245
+ var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
3246
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
3247
+ var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
3248
+ var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
3040
3249
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
3041
3250
  return onRequestParamsChange(paginateDataSourceKey, payload);
3042
3251
  };
3043
- var sortParams = getSorting_1.getSortingParams({
3252
+ var sortParams = (0, getSorting_1.getSortingParams)({
3044
3253
  requestParams: requestParams,
3045
3254
  meta: meta,
3046
3255
  onRequestParamsChange: handleRequestParamsChange
3047
3256
  });
3048
- var paginatorParams = getPagination_1.getPaginationParams({
3257
+ var paginatorParams = (0, getPagination_1.getPaginationParams)({
3049
3258
  requestParams: requestParams,
3050
3259
  meta: meta,
3051
3260
  onRequestParamsChange: handleRequestParamsChange
@@ -3073,7 +3282,7 @@ var withDashboardViz = function withDashboardViz(opts) {
3073
3282
  // attach viz config
3074
3283
  DashboardViz.config = vizConfig;
3075
3284
  // @ts-ignore: TODO fix sc upgrade TS issues
3076
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
3285
+ return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
3077
3286
  };
3078
3287
  exports.default = withDashboardViz;
3079
3288
 
@@ -3317,8 +3526,8 @@ var lodash_1 = __webpack_require__(3);
3317
3526
  * @param dependencies an array of dependencies
3318
3527
  */
3319
3528
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
3320
- var ref = react_1.useRef();
3321
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
3529
+ var ref = (0, react_1.useRef)();
3530
+ if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
3322
3531
  ref.current = {
3323
3532
  dependencies: dependencies,
3324
3533
  value: fn()
@@ -3362,7 +3571,7 @@ exports.isMissing = isMissing;
3362
3571
  */
3363
3572
  var missingKeys = function missingKeys(keys, target) {
3364
3573
  return keys.filter(function (k) {
3365
- return exports.isMissing(target[k]);
3574
+ return (0, exports.isMissing)(target[k]);
3366
3575
  });
3367
3576
  };
3368
3577
  exports.missingKeys = missingKeys;
@@ -3386,7 +3595,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
3386
3595
  "data-test": "message",
3387
3596
  width: width,
3388
3597
  height: height,
3389
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
3598
+ message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
3390
3599
  });
3391
3600
  };
3392
3601
  exports.MissingPropsMessage = MissingPropsMessage;
@@ -3395,7 +3604,7 @@ exports.MissingPropsMessage.defaultProps = {
3395
3604
  width: '100%',
3396
3605
  height: 250
3397
3606
  };
3398
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
3607
+ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
3399
3608
 
3400
3609
  /***/ }),
3401
3610
 
@@ -3416,7 +3625,7 @@ var Cover = styled_components_1.default.div.withConfig({
3416
3625
  componentId: "sc-1gsbnxb-0"
3417
3626
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3418
3627
  var Blocker = styled_components_1.default.div.attrs({
3419
- 'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
3628
+ 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
3420
3629
  }).withConfig({
3421
3630
  displayName: "withEditModeCover__Blocker",
3422
3631
  componentId: "sc-1gsbnxb-1"
@@ -3435,7 +3644,7 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
3435
3644
  "data-test": "edit-mode-cover"
3436
3645
  }));
3437
3646
  };
3438
- hocUtils_1.extendStaticWrapperProps({
3647
+ (0, hocUtils_1.extendStaticWrapperProps)({
3439
3648
  Wrapper: Wrapper,
3440
3649
  Visualization: Visualization
3441
3650
  });
@@ -3457,7 +3666,7 @@ Object.defineProperty(exports, "__esModule", {
3457
3666
  var React = __webpack_require__(1);
3458
3667
  var colorUtils_1 = __webpack_require__(12);
3459
3668
  var variables_1 = __webpack_require__(11);
3460
- var IconPlaceholder_1 = __webpack_require__(31);
3669
+ var IconPlaceholder_1 = __webpack_require__(32);
3461
3670
  var VizBehavior_1 = __webpack_require__(6);
3462
3671
  var hocUtils_1 = __webpack_require__(15);
3463
3672
  var withPlaceholder = function withPlaceholder(Visualization) {
@@ -3472,7 +3681,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
3472
3681
  height = props.height,
3473
3682
  width = props.width;
3474
3683
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
3475
- var bgColorFromTheme = 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);
3684
+ 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);
3476
3685
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
3477
3686
  var iconColor = variables_1.default.contentColorActive(props);
3478
3687
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
@@ -3487,7 +3696,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
3487
3696
  }
3488
3697
  return React.createElement(Visualization, Object.assign({}, props));
3489
3698
  };
3490
- hocUtils_1.extendStaticWrapperProps({
3699
+ (0, hocUtils_1.extendStaticWrapperProps)({
3491
3700
  Wrapper: Wrapper,
3492
3701
  Visualization: Visualization
3493
3702
  });
@@ -3497,7 +3706,7 @@ exports.default = withPlaceholder;
3497
3706
 
3498
3707
  /***/ }),
3499
3708
 
3500
- /***/ 472:
3709
+ /***/ 475:
3501
3710
  /***/ (function(module, exports, __webpack_require__) {
3502
3711
 
3503
3712
  "use strict";
@@ -3517,10 +3726,10 @@ Object.defineProperty(exports, "__esModule", {
3517
3726
  value: true
3518
3727
  });
3519
3728
  exports.themes = exports.computeVizProps = exports.PureSingleValueRadialThemes = exports.PureSingleValueRadial = exports.config = void 0;
3520
- var SingleValueRadial_1 = __webpack_require__(487);
3729
+ var SingleValueRadial_1 = __webpack_require__(491);
3521
3730
  var withDashboardViz_1 = __webpack_require__(36);
3522
- var config_1 = __webpack_require__(473);
3523
- var withTrellis_1 = __webpack_require__(107);
3731
+ var config_1 = __webpack_require__(476);
3732
+ var withTrellis_1 = __webpack_require__(106);
3524
3733
  exports.config = config_1.default;
3525
3734
  exports.PureSingleValueRadial = SingleValueRadial_1.default;
3526
3735
  // TODO: proper theming support for SVR when we come back to SVR viz
@@ -3533,7 +3742,7 @@ var computeVizProps = function computeVizProps(_a) {
3533
3742
  }, props);
3534
3743
  };
3535
3744
  exports.computeVizProps = computeVizProps;
3536
- var viz = withTrellis_1.default(withDashboardViz_1.default({
3745
+ var viz = (0, withTrellis_1.default)((0, withDashboardViz_1.default)({
3537
3746
  ReactViz: SingleValueRadial_1.default,
3538
3747
  vizConfig: config_1.default,
3539
3748
  computeVizProps: exports.computeVizProps
@@ -3543,7 +3752,7 @@ exports.default = viz;
3543
3752
 
3544
3753
  /***/ }),
3545
3754
 
3546
- /***/ 473:
3755
+ /***/ 476:
3547
3756
  /***/ (function(module, exports, __webpack_require__) {
3548
3757
 
3549
3758
  "use strict";
@@ -3557,21 +3766,22 @@ var i18n_1 = __webpack_require__(2);
3557
3766
  var schemaUtils_1 = __webpack_require__(16);
3558
3767
  var pick_1 = __webpack_require__(23);
3559
3768
  var variables_1 = __webpack_require__(11);
3560
- var PresetPalettes_1 = __webpack_require__(60);
3769
+ var PresetPalettes_1 = __webpack_require__(61);
3561
3770
  var visualization_icons_1 = __webpack_require__(52);
3562
- var placeholders_1 = __webpack_require__(49);
3563
- var StaticMajorAndTrendLayout_1 = __webpack_require__(103);
3771
+ var placeholders_1 = __webpack_require__(50);
3772
+ var configUtils_1 = __webpack_require__(22);
3773
+ var StaticMajorAndTrendLayout_1 = __webpack_require__(102);
3564
3774
  var VizBehavior_1 = __webpack_require__(6);
3565
- var configUtils_1 = __webpack_require__(20);
3775
+ var configUtils_2 = __webpack_require__(20);
3566
3776
  var VizCategory_1 = __webpack_require__(35);
3567
- var DynamicMajorColorEditor_1 = __webpack_require__(100);
3568
- var DynamicTrendColorEditor_1 = __webpack_require__(101);
3569
- var DynamicBackgroundColorEditor_1 = __webpack_require__(102);
3570
- var StaticMajorColorEditor_1 = __webpack_require__(104);
3571
- var StaticTrendColorEditor_1 = __webpack_require__(105);
3572
- var StaticBackgroundColorEditor_1 = __webpack_require__(89);
3573
- var RadialBackgroundColor_1 = __webpack_require__(474);
3574
- var TrellisEditors_1 = __webpack_require__(106);
3777
+ var DynamicMajorColorAndGaugeEditor_1 = __webpack_require__(477);
3778
+ var DynamicTrendColorEditor_1 = __webpack_require__(100);
3779
+ var DynamicBackgroundColorEditor_1 = __webpack_require__(101);
3780
+ var StaticMajorColorEditor_1 = __webpack_require__(103);
3781
+ var StaticTrendColorEditor_1 = __webpack_require__(104);
3782
+ var StaticBackgroundColorEditor_1 = __webpack_require__(90);
3783
+ var RadialBackgroundColor_1 = __webpack_require__(478);
3784
+ var TrellisEditors_1 = __webpack_require__(105);
3575
3785
  var layoutUtils_1 = __webpack_require__(58);
3576
3786
  var dataContract = {
3577
3787
  requiredDataSources: [{
@@ -3591,13 +3801,6 @@ var size = {
3591
3801
  initialHeight: 250
3592
3802
  };
3593
3803
  var defaultContext = {
3594
- trendColorConfig: [{
3595
- to: 0,
3596
- value: '#9E2520'
3597
- }, {
3598
- from: 0,
3599
- value: '#1C6B2D'
3600
- }],
3601
3804
  majorColorConfig: [{
3602
3805
  to: 20,
3603
3806
  value: '#D41F1F'
@@ -3620,6 +3823,13 @@ var defaultContext = {
3620
3823
  majorColorMatchConfig: [{
3621
3824
  match: '',
3622
3825
  value: '#5C33FF'
3826
+ }],
3827
+ trendColorConfig: [{
3828
+ to: 0,
3829
+ value: '#9E2520'
3830
+ }, {
3831
+ from: 0,
3832
+ value: '#1C6B2D'
3623
3833
  }]
3624
3834
  };
3625
3835
  var optionsSchema = {
@@ -3629,6 +3839,31 @@ var optionsSchema = {
3629
3839
  pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
3630
3840
  type: 'string'
3631
3841
  },
3842
+ gaugeRanges: {
3843
+ default: '> majorColorEditorConfig',
3844
+ description: 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{"to": 20, "value": "#4BEBA8"}, {"from": 20, "to": 50, "value": "#D41F1F"}, {"from": 50, "value": "#F4DF7A"}]. Must be unbounded, open ranges. Ranges are bound by a separate minValue/maxValue option. Only configured if isGaugeOn is true.',
3845
+ type: 'array',
3846
+ items: {
3847
+ type: 'object',
3848
+ properties: {
3849
+ from: {
3850
+ type: 'number'
3851
+ },
3852
+ to: {
3853
+ type: 'number'
3854
+ },
3855
+ value: {
3856
+ type: 'string',
3857
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
3858
+ }
3859
+ }
3860
+ }
3861
+ },
3862
+ isGaugeOn: {
3863
+ default: false,
3864
+ description: 'Specify if gauge is on.',
3865
+ type: 'boolean'
3866
+ },
3632
3867
  majorColor: {
3633
3868
  default: '> themes.defaultFontColor',
3634
3869
  description: 'Specify the color for the major value. You may use a dataSource to apply the color. The hex value format should be “#ffffff”. The default for enterprise light is "#000000". The default for enterprise dark is "#ffffff". The default for prisma dark is "rgba(255, 255, 255, 0.98)".',
@@ -3645,6 +3880,11 @@ var optionsSchema = {
3645
3880
  description: 'Specify the field that should be mapped to the major value.',
3646
3881
  type: 'string'
3647
3882
  },
3883
+ minValue: {
3884
+ default: 0,
3885
+ description: 'Specify the min value of the radial.',
3886
+ type: 'number'
3887
+ },
3648
3888
  maxValue: {
3649
3889
  default: 100,
3650
3890
  description: 'Specify the value the radial fills up to.',
@@ -3683,7 +3923,7 @@ var optionsSchema = {
3683
3923
  default: 'off',
3684
3924
  description: 'Specify the layout method by which to display the visualization, which splits the data into individual visualizations based on a certain category.',
3685
3925
  type: 'string',
3686
- pattern: schemaUtils_1.getPattern([layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]),
3926
+ pattern: (0, schemaUtils_1.getPattern)([layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]),
3687
3927
  enum: [layoutUtils_1.LAYOUT_TYPE.Off, layoutUtils_1.LAYOUT_TYPE.Trellis]
3688
3928
  },
3689
3929
  trendColor: {
@@ -3695,7 +3935,7 @@ var optionsSchema = {
3695
3935
  trendDisplay: {
3696
3936
  default: 'absolute',
3697
3937
  description: 'Specify how to display the trend value.',
3698
- pattern: schemaUtils_1.getPattern(['percent', 'absolute', 'off']),
3938
+ pattern: (0, schemaUtils_1.getPattern)(['percent', 'absolute', 'off']),
3699
3939
  type: 'string'
3700
3940
  },
3701
3941
  trendValue: {
@@ -3747,7 +3987,7 @@ var optionsSchema = {
3747
3987
  unitPosition: {
3748
3988
  default: 'after',
3749
3989
  description: 'Specify whether the unit text should appear before or after the major value.',
3750
- pattern: schemaUtils_1.getPattern(['before', 'after']),
3990
+ pattern: (0, schemaUtils_1.getPattern)(['before', 'after']),
3751
3991
  type: 'string'
3752
3992
  }
3753
3993
  };
@@ -3763,14 +4003,14 @@ var basePresetOptions = {
3763
4003
  };
3764
4004
  var presets = [{
3765
4005
  // dummy context variables to allow for resetting of unused context states
3766
- label: i18n_1._('None'),
4006
+ label: (0, i18n_1._)('None'),
3767
4007
  name: 'singleValueRadial.none',
3768
4008
  value: {
3769
4009
  context: Object.assign({}, basePresetContext),
3770
4010
  options: Object.assign({}, basePresetOptions)
3771
4011
  }
3772
4012
  }, {
3773
- label: i18n_1._('Major value'),
4013
+ label: (0, i18n_1._)('Major value and gauge'),
3774
4014
  name: 'singleValueRadial.majorValue',
3775
4015
  value: {
3776
4016
  context: Object.assign(Object.assign({}, basePresetContext), {
@@ -3781,7 +4021,7 @@ var presets = [{
3781
4021
  })
3782
4022
  }
3783
4023
  }, {
3784
- label: i18n_1._('Major value and Trend value'),
4024
+ label: (0, i18n_1._)('Major value, trend value, and gauge'),
3785
4025
  name: 'singleValueRadial.majorValueAndTrend',
3786
4026
  value: {
3787
4027
  context: Object.assign(Object.assign({}, basePresetContext), {
@@ -3794,7 +4034,7 @@ var presets = [{
3794
4034
  })
3795
4035
  }
3796
4036
  }, {
3797
- label: i18n_1._('Trend value'),
4037
+ label: (0, i18n_1._)('Trend value'),
3798
4038
  name: 'singleValueRadial.trend',
3799
4039
  value: {
3800
4040
  context: Object.assign(Object.assign({}, basePresetContext), {
@@ -3805,7 +4045,7 @@ var presets = [{
3805
4045
  })
3806
4046
  }
3807
4047
  }, {
3808
- label: i18n_1._('Background'),
4048
+ label: (0, i18n_1._)('Background'),
3809
4049
  name: 'singleValueRadial.background',
3810
4050
  value: {
3811
4051
  context: Object.assign(Object.assign({}, basePresetContext), {
@@ -3818,7 +4058,7 @@ var presets = [{
3818
4058
  }];
3819
4059
  var themes = {
3820
4060
  defaultFontColor: function defaultFontColor(props) {
3821
- return pick_1.default({
4061
+ return (0, pick_1.default)({
3822
4062
  enterprise: {
3823
4063
  dark: variables_1.default.white(props),
3824
4064
  light: variables_1.default.black(props)
@@ -3827,7 +4067,7 @@ var themes = {
3827
4067
  })(props);
3828
4068
  },
3829
4069
  defaultBackgroundColor: function defaultBackgroundColor(props) {
3830
- return pick_1.default({
4070
+ return (0, pick_1.default)({
3831
4071
  enterprise: {
3832
4072
  dark: variables_1.default.black(props),
3833
4073
  light: variables_1.default.white(props)
@@ -3836,7 +4076,7 @@ var themes = {
3836
4076
  })(props);
3837
4077
  },
3838
4078
  defaultRadialBackgroundColor: function defaultRadialBackgroundColor(props) {
3839
- return pick_1.default({
4079
+ return (0, pick_1.default)({
3840
4080
  enterprise: {
3841
4081
  dark: 'rgba(255, 255, 255, 0.15)',
3842
4082
  light: 'rgba(0, 0, 0, 0.1)'
@@ -3846,9 +4086,9 @@ var themes = {
3846
4086
  }
3847
4087
  };
3848
4088
  var editorConfig = [{
3849
- label: i18n_1._('Data configurations'),
4089
+ label: (0, i18n_1._)('Data configurations'),
3850
4090
  layout: [[{
3851
- label: i18n_1._('Value'),
4091
+ label: (0, i18n_1._)('Value'),
3852
4092
  editor: 'editor.columnSelector',
3853
4093
  option: 'majorValue',
3854
4094
  context: 'valuesContext',
@@ -3871,20 +4111,20 @@ var editorConfig = [{
3871
4111
  }
3872
4112
  }]]
3873
4113
  }, {
3874
- label: i18n_1._('Data display'),
4114
+ label: (0, i18n_1._)('Data display'),
3875
4115
  layout: [].concat(_toConsumableArray(StaticMajorAndTrendLayout_1.default), [[{
3876
- label: i18n_1._('Trend display'),
4116
+ label: (0, i18n_1._)('Trend display'),
3877
4117
  option: 'trendDisplay',
3878
4118
  editor: 'editor.select',
3879
4119
  editorProps: {
3880
4120
  values: [{
3881
- label: i18n_1._('Percent'),
4121
+ label: (0, i18n_1._)('Percent'),
3882
4122
  value: 'percent'
3883
4123
  }, {
3884
- label: i18n_1._('Absolute'),
4124
+ label: (0, i18n_1._)('Absolute'),
3885
4125
  value: 'absolute'
3886
4126
  }, {
3887
- label: i18n_1._('Off'),
4127
+ label: (0, i18n_1._)('Off'),
3888
4128
  value: 'off'
3889
4129
  }]
3890
4130
  },
@@ -3892,11 +4132,19 @@ var editorConfig = [{
3892
4132
  var options = _ref2.options;
3893
4133
  return options.showValue || options.showValue === undefined;
3894
4134
  }
4135
+ }], [{
4136
+ label: (0, i18n_1._)('Min'),
4137
+ option: 'minValue',
4138
+ editor: 'editor.number'
4139
+ }, {
4140
+ label: (0, i18n_1._)('Max'),
4141
+ option: 'maxValue',
4142
+ editor: 'editor.number'
3895
4143
  }]], _toConsumableArray(TrellisEditors_1.TrellisEditorConfig))
3896
4144
  }, {
3897
- label: i18n_1._('Color and style'),
4145
+ label: (0, i18n_1._)('Color and style'),
3898
4146
  layout: [[{
3899
- label: i18n_1._('Dynamic elements'),
4147
+ label: (0, i18n_1._)('Dynamic elements'),
3900
4148
  key: 'presetSelector',
3901
4149
  editor: 'editor.presetSelector',
3902
4150
  editorProps: {
@@ -3904,7 +4152,7 @@ var editorConfig = [{
3904
4152
  value: function value(_ref3) {
3905
4153
  var context = _ref3.context,
3906
4154
  options = _ref3.options;
3907
- var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
4155
+ var initialPreset = (0, configUtils_2.getInitialPreset)(context, options, presets);
3908
4156
  return initialPreset && initialPreset.label || null;
3909
4157
  }
3910
4158
  }
@@ -3912,17 +4160,17 @@ var editorConfig = [{
3912
4160
  editorProps: {
3913
4161
  themes: themes
3914
4162
  }
3915
- })], [DynamicMajorColorEditor_1.getDynamicMajorColorEditor({
4163
+ })], [(0, DynamicMajorColorAndGaugeEditor_1.getDynamicMajorColorAndGaugeEditor)({
3916
4164
  defaultContext: defaultContext,
3917
4165
  defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
3918
4166
  })], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
3919
4167
  editorProps: {
3920
4168
  themes: themes
3921
4169
  }
3922
- })], [DynamicTrendColorEditor_1.getDynamicTrendColorEditor({
4170
+ })], [(0, DynamicTrendColorEditor_1.getDynamicTrendColorEditor)({
3923
4171
  defaultContext: defaultContext,
3924
4172
  defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
3925
- })], RadialBackgroundColor_1.default({
4173
+ })], (0, RadialBackgroundColor_1.default)({
3926
4174
  themes: themes
3927
4175
  }), [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
3928
4176
  editorProps: {
@@ -3932,10 +4180,18 @@ var editorConfig = [{
3932
4180
  editorProps: {
3933
4181
  themes: themes
3934
4182
  }
3935
- })], [DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor({
4183
+ })], [(0, DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor)({
3936
4184
  defaultContext: defaultContext,
3937
4185
  defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
3938
- })]]
4186
+ })], [{
4187
+ label: (0, i18n_1._)('Show gauge ranges'),
4188
+ option: 'isGaugeOn',
4189
+ editor: 'editor.toggle',
4190
+ showEditor: function showEditor(_ref4) {
4191
+ var options = _ref4.options;
4192
+ return (0, configUtils_1.isDynamicOption)(options.majorColor);
4193
+ }
4194
+ }]]
3939
4195
  }];
3940
4196
  /**
3941
4197
  * visualization configuration
@@ -3948,7 +4204,7 @@ var config = {
3948
4204
  /**
3949
4205
  * viz name
3950
4206
  */
3951
- name: i18n_1._('Single value radial'),
4207
+ name: (0, i18n_1._)('Single value radial'),
3952
4208
  category: VizCategory_1.VizCategory.SINGLE_VALUE,
3953
4209
  /**
3954
4210
  * viz icon
@@ -3969,11 +4225,56 @@ var config = {
3969
4225
  supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER, VizBehavior_1.VizBehavior.TRELLIS],
3970
4226
  themes: themes
3971
4227
  };
3972
- exports.default = configUtils_1.enhanceConfig(config);
4228
+ exports.default = (0, configUtils_2.enhanceConfig)(config);
4229
+
4230
+ /***/ }),
4231
+
4232
+ /***/ 477:
4233
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
4234
+
4235
+ "use strict";
4236
+ __webpack_require__.r(__webpack_exports__);
4237
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorAndGaugeEditor", function() { return getDynamicMajorColorAndGaugeEditor; });
4238
+ /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4239
+ /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4240
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(22);
4241
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4242
+
4243
+
4244
+ var getDynamicMajorColorAndGaugeEditor = function getDynamicMajorColorAndGaugeEditor(_ref) {
4245
+ var defaultContext = _ref.defaultContext,
4246
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
4247
+ return {
4248
+ label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value and gauge'),
4249
+ option: 'majorColor',
4250
+ context: 'majorColorEditorConfig',
4251
+ editor: 'editor.dynamicColor',
4252
+ showEditor: function showEditor(_ref2) {
4253
+ var options = _ref2.options;
4254
+ return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
4255
+ },
4256
+ editorProps: {
4257
+ labelPosition: 'top',
4258
+ flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: major value'),
4259
+ formatters: [{
4260
+ label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
4261
+ value: 'rangeValue',
4262
+ defaults: {
4263
+ majorValue: defaultContext.majorColorConfig
4264
+ }
4265
+ }],
4266
+ dataSelectors: [{
4267
+ label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Major value'),
4268
+ value: 'majorValue'
4269
+ }],
4270
+ defaultPalettesConfig: defaultPalettesConfig
4271
+ }
4272
+ };
4273
+ };
3973
4274
 
3974
4275
  /***/ }),
3975
4276
 
3976
- /***/ 474:
4277
+ /***/ 478:
3977
4278
  /***/ (function(module, exports, __webpack_require__) {
3978
4279
 
3979
4280
  "use strict";
@@ -3988,7 +4289,7 @@ var radialBackground = function radialBackground(_ref) {
3988
4289
  themes = _ref.themes,
3989
4290
  labelPosition = _ref.labelPosition;
3990
4291
  return [{
3991
- label: i18n_1._(label || 'Radial background'),
4292
+ label: (0, i18n_1._)(label || 'Radial background'),
3992
4293
  option: 'radialBackgroundColor',
3993
4294
  editor: 'editor.color',
3994
4295
  editorProps: {
@@ -4008,7 +4309,14 @@ module.exports = require("@babel/runtime/helpers/extends");
4008
4309
 
4009
4310
  /***/ }),
4010
4311
 
4011
- /***/ 487:
4312
+ /***/ 49:
4313
+ /***/ (function(module, exports) {
4314
+
4315
+ module.exports = require("@splunk/visualizations-shared/colorConstants");
4316
+
4317
+ /***/ }),
4318
+
4319
+ /***/ 491:
4012
4320
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4013
4321
 
4014
4322
  "use strict";
@@ -4039,13 +4347,8 @@ var variables_default = /*#__PURE__*/__webpack_require__.n(variables_);
4039
4347
  var external_styled_components_ = __webpack_require__(4);
4040
4348
  var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
4041
4349
 
4042
- // EXTERNAL MODULE: external "lodash/pick"
4043
- var external_lodash_pick_ = __webpack_require__(81);
4044
- var external_lodash_pick_default = /*#__PURE__*/__webpack_require__.n(external_lodash_pick_);
4045
-
4046
- // EXTERNAL MODULE: external "lodash/isEmpty"
4047
- var isEmpty_ = __webpack_require__(82);
4048
- var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
4350
+ // EXTERNAL MODULE: external "lodash"
4351
+ var external_lodash_ = __webpack_require__(3);
4049
4352
 
4050
4353
  // EXTERNAL MODULE: external "@splunk/visualization-context/FeatureFlagContext"
4051
4354
  var FeatureFlagContext_ = __webpack_require__(21);
@@ -4059,10 +4362,10 @@ var SizeAwareWrapper_ = __webpack_require__(19);
4059
4362
  var SizeAwareWrapper_default = /*#__PURE__*/__webpack_require__.n(SizeAwareWrapper_);
4060
4363
 
4061
4364
  // EXTERNAL MODULE: ./src/common/components/VizStyleWrapper.jsx
4062
- var VizStyleWrapper = __webpack_require__(72);
4365
+ var VizStyleWrapper = __webpack_require__(73);
4063
4366
 
4064
4367
  // EXTERNAL MODULE: ./src/common/components/TrellisTitle.tsx
4065
- var TrellisTitle = __webpack_require__(78);
4368
+ var TrellisTitle = __webpack_require__(79);
4066
4369
 
4067
4370
  // EXTERNAL MODULE: ./src/common/utils/layoutUtils.ts
4068
4371
  var layoutUtils = __webpack_require__(58);
@@ -4072,10 +4375,10 @@ var defineProperty_ = __webpack_require__(7);
4072
4375
  var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
4073
4376
 
4074
4377
  // EXTERNAL MODULE: ./src/SingleValueBasic/SingleValueBasic.jsx + 2 modules
4075
- var SingleValueBasic = __webpack_require__(79);
4378
+ var SingleValueBasic = __webpack_require__(81);
4076
4379
 
4077
4380
  // EXTERNAL MODULE: external "@splunk/visualizations-shared/colorConstants"
4078
- var colorConstants_ = __webpack_require__(50);
4381
+ var colorConstants_ = __webpack_require__(49);
4079
4382
 
4080
4383
  // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialGraph.jsx
4081
4384
 
@@ -4141,171 +4444,14 @@ RadialGraph_RadialGraph.defaultProps = {
4141
4444
  strokeWidth: 12
4142
4445
  };
4143
4446
  /* harmony default export */ var PureSingleValueRadial_RadialGraph = (RadialGraph_RadialGraph);
4144
- // EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
4145
- var singleValueUtils = __webpack_require__(24);
4146
-
4147
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/displayUtils.js
4148
-
4447
+ // EXTERNAL MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/displayUtils.js
4448
+ var displayUtils = __webpack_require__(80);
4149
4449
 
4150
- var VALID_TREND_POSITIONS = ['standard', 'below', 'outside'];
4151
- var MAJOR_FONT_THRESHOLD = 25;
4152
- var TREND_FONT_THRESHOLD = 12;
4153
- var DEFAULT_RADIAL_STROKE_WIDTH = 16;
4154
- var SMALL_RADIAL_STROKE_WIDTH = 6;
4450
+ // EXTERNAL MODULE: ./src/SingleValueRadial/PureSingleValueRadial/GaugeGraph.tsx
4451
+ var GaugeGraph = __webpack_require__(176);
4452
+ var GaugeGraph_default = /*#__PURE__*/__webpack_require__.n(GaugeGraph);
4155
4453
 
4156
- /**
4157
- * Get the colors for a radial graph based on severity
4158
- * @method getRadialColors
4159
- * @param {Object} props
4160
- * @param {Bool} props.backgroundEnabled
4161
- * @param {String} props.backgroundColor
4162
- * @returns {Object} { background, stroke } colors
4163
- */
4164
- var displayUtils_getRadialColors = function getRadialColors(_ref) {
4165
- var backgroundEnabled = _ref.backgroundEnabled,
4166
- backgroundColor = _ref.backgroundColor;
4167
- return Object(singleValueUtils["getGraphColors"])({
4168
- backgroundEnabled: backgroundEnabled,
4169
- backgroundColor: backgroundColor,
4170
- defaultColors: colorConstants_["RADIAL_SEVERITY_COLORS"],
4171
- customColorFormatter: function customColorFormatter(color) {
4172
- return {
4173
- background: Object(singleValueUtils["lighten"])(color),
4174
- stroke: Object(singleValueUtils["darken"])(color)
4175
- };
4176
- }
4177
- });
4178
- };
4179
-
4180
- /**
4181
- * Figure out the dimensions of the graph
4182
- * @method getRadialGraphDimensions
4183
- * @param {Object} props
4184
- * @param {Number} props.width // Width of the container
4185
- * @param {Number} props.height // Height of the container
4186
- * @returns {Number} width and height of the graph
4187
- */
4188
- var displayUtils_getRadialGraphDimensions = function getRadialGraphDimensions(_ref2) {
4189
- var width = _ref2.width,
4190
- height = _ref2.height;
4191
- // height * 2 because we are fitting only half of a circle inside the container
4192
- var radius = Math.min(width, height * 2) / 2;
4193
- return {
4194
- width: width - singleValueUtils["SVR_PADDING"].left - singleValueUtils["SVR_PADDING"].right,
4195
- height: radius - singleValueUtils["SVR_PADDING"].top - singleValueUtils["SVR_PADDING"].bottom
4196
- };
4197
- };
4198
-
4199
- /**
4200
- * Figure out the dimensions of the content container for SVR
4201
- * @method getRadialHelperDimensions
4202
- * @param {Object} props
4203
- * @param {Number} props.width // Width of the visualization space
4204
- * @param {Number} props.height // Height of the visualization space
4205
- * @returns {Number} width and height of the content graph
4206
- */
4207
- var getRadialHelperDimensions = function getRadialHelperDimensions(_ref3) {
4208
- var height = _ref3.height,
4209
- _ref3$strokeWidth = _ref3.strokeWidth,
4210
- strokeWidth = _ref3$strokeWidth === void 0 ? DEFAULT_RADIAL_STROKE_WIDTH : _ref3$strokeWidth;
4211
- // The radius of the visualization is equal to the height
4212
- var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
4213
- var innerArcRadius = semicircleRadius * 0.9;
4214
- var halfContentWidth = innerArcRadius * 0.7;
4215
- var contentHeight = Math.floor(Math.sqrt(Math.pow(innerArcRadius, 2) - Math.pow(halfContentWidth, 2)));
4216
- return {
4217
- contentWidth: halfContentWidth * 2,
4218
- contentHeight: contentHeight,
4219
- helperArcRadius: innerArcRadius,
4220
- semicircleRadius: semicircleRadius
4221
- };
4222
- };
4223
-
4224
- /**
4225
- * Get the maximum size of the container that holds the graph text
4226
- * @method getValueContentSize
4227
- * @param {Object} props
4228
- * @param {Number} props.graphSize
4229
- * @param {Number} props.radialStrokeWidth // Stroke width of the graph
4230
- * @returns {Number} content size for showing major and trend values in radial graph
4231
- */
4232
- var getValueContentSize = function getValueContentSize(_ref4) {
4233
- var graphSize = _ref4.graphSize,
4234
- radialStrokeWidth = _ref4.radialStrokeWidth;
4235
- // Account for the graph's stroke width
4236
- var diameter = graphSize - radialStrokeWidth;
4237
- // Use pythagoreum theorum with circle diameter
4238
- // to calculate the size of the sides of the square inside the circle
4239
- return Math.floor(Math.sqrt(Math.pow(diameter, 2) / 2));
4240
- };
4241
-
4242
- /*
4243
- * @method getRadialStrokeWidth
4244
- * @param {Number} graphHeight
4245
- * @returns {Number} radial stroke width
4246
- */
4247
- var getRadialStrokeWidth = function getRadialStrokeWidth(graphHeight) {
4248
- return graphHeight >= 90 ? DEFAULT_RADIAL_STROKE_WIDTH : SMALL_RADIAL_STROKE_WIDTH;
4249
- };
4250
-
4251
- /*
4252
- * @method isValidPosition
4253
- * @param {String} position
4254
- * @returns {Bool}
4255
- */
4256
- var isValidPosition = function isValidPosition(position) {
4257
- return VALID_TREND_POSITIONS.indexOf(position) > -1;
4258
- };
4259
-
4260
- /*
4261
- * @method showTrendPositionStandard
4262
- * @param {Object} props
4263
- * @param {Bool} props.showTrendIndicator
4264
- * @param {String} props.position
4265
- * @returns {Bool}
4266
- */
4267
- var showTrendPositionStandard = function showTrendPositionStandard(_ref5) {
4268
- var showTrendIndicator = _ref5.showTrendIndicator,
4269
- position = _ref5.position;
4270
- return showTrendIndicator && position === 'standard';
4271
- };
4272
-
4273
- /*
4274
- * @method showTrendPositionBelow
4275
- * @param {Object} props
4276
- * @param {Bool} props.showTrendIndicator
4277
- * @param {String} props.position
4278
- * @returns {Bool}
4279
- */
4280
- var showTrendPositionBelow = function showTrendPositionBelow(_ref6) {
4281
- var showTrendIndicator = _ref6.showTrendIndicator,
4282
- position = _ref6.position;
4283
- return showTrendIndicator && position === 'below';
4284
- };
4285
-
4286
- /*
4287
- * @method showTrendPositionOutside
4288
- * @param {Object} props
4289
- * @param {Bool} props.showTrendIndicator
4290
- * @param {String} props.position
4291
- * @returns {Bool}
4292
- */
4293
- var showTrendPositionOutside = function showTrendPositionOutside(_ref7) {
4294
- var showTrendIndicator = _ref7.showTrendIndicator,
4295
- position = _ref7.position;
4296
- return showTrendIndicator && position === 'outside';
4297
- };
4298
-
4299
- /*
4300
- * need to handle max and min
4301
- * @method getRadialProgress
4302
- * @param {Number} majorValue
4303
- * @returns {Number} progress bar in radial graph
4304
- */
4305
- var getRadialProgress = function getRadialProgress(majorValue, maxValue) {
4306
- return Number.isNaN(Number(majorValue)) || Number.isNaN(Number(maxValue)) || majorValue < 0 && majorValue < maxValue ? 0 : majorValue / maxValue * 100;
4307
- };
4308
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
4454
+ // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
4309
4455
 
4310
4456
 
4311
4457
  function ownKeys(object, enumerableOnly) {
@@ -4335,6 +4481,7 @@ function _objectSpread(target) {
4335
4481
 
4336
4482
 
4337
4483
 
4484
+
4338
4485
  var TextContainer = external_styled_components_default.a.div.withConfig({
4339
4486
  displayName: "RadialLayout__TextContainer",
4340
4487
  componentId: "sc-13x2rjt-0"
@@ -4392,9 +4539,12 @@ var UnderLabelText = external_styled_components_default.a.span.withConfig({
4392
4539
  var RadialLayout_RadialContent = function RadialContent(_ref) {
4393
4540
  var props = extends_default()({}, _ref);
4394
4541
  var majorColor = props.majorColor,
4542
+ majorValue = props.majorValue,
4395
4543
  majorText = props.majorText,
4396
4544
  majorTextFontSize = props.majorTextFontSize,
4397
4545
  majorValueTitle = props.majorValueTitle,
4546
+ minValue = props.minValue,
4547
+ maxValue = props.maxValue,
4398
4548
  trendColor = props.trendColor,
4399
4549
  trendText = props.trendText,
4400
4550
  trendTextFontSize = props.trendTextFontSize,
@@ -4410,8 +4560,11 @@ var RadialLayout_RadialContent = function RadialContent(_ref) {
4410
4560
  radialStrokeColor = props.radialStrokeColor,
4411
4561
  radialStrokeWidth = props.radialStrokeWidth,
4412
4562
  graphWidth = props.graphWidth,
4413
- graphHeight = props.graphHeight;
4414
- var _getRadialHelperDimen = getRadialHelperDimensions({
4563
+ graphHeight = props.graphHeight,
4564
+ isGaugeValid = props.isGaugeValid,
4565
+ formattedGaugeRanges = props.formattedGaugeRanges,
4566
+ defaultFontColor = props.defaultFontColor;
4567
+ var _getRadialHelperDimen = Object(displayUtils["getRadialHelperDimensions"])({
4415
4568
  height: graphHeight,
4416
4569
  strokeWidth: radialStrokeWidth
4417
4570
  }),
@@ -4426,14 +4579,28 @@ var RadialLayout_RadialContent = function RadialContent(_ref) {
4426
4579
 
4427
4580
  // Remove extra padding under major value - this is specific to Proxima Nova
4428
4581
  var singleValueBottomOffset = majorTextFontSize * 0.2;
4429
- var radialGraph = showRadialGraph ? /*#__PURE__*/external_react_default.a.createElement(PureSingleValueRadial_RadialGraph, {
4430
- progress: progress,
4431
- backgroundColor: radialBackgroundColor,
4432
- progressColor: radialStrokeColor,
4433
- strokeWidth: radialStrokeWidth,
4434
- width: graphWidth,
4435
- height: graphHeight
4436
- }) : null;
4582
+ var radialGraph = null;
4583
+ if (showRadialGraph) {
4584
+ radialGraph = isGaugeValid ? /*#__PURE__*/external_react_default.a.createElement(GaugeGraph_default.a, {
4585
+ width: graphWidth,
4586
+ height: graphHeight,
4587
+ strokeWidth: radialStrokeWidth,
4588
+ radialBackgroundColor: radialBackgroundColor,
4589
+ fontColor: defaultFontColor,
4590
+ formattedGaugeRanges: formattedGaugeRanges,
4591
+ majorValue: majorValue,
4592
+ minValue: minValue,
4593
+ maxValue: maxValue,
4594
+ showRadialGraph: showRadialGraph
4595
+ }) : /*#__PURE__*/external_react_default.a.createElement(PureSingleValueRadial_RadialGraph, {
4596
+ progress: progress,
4597
+ backgroundColor: radialBackgroundColor,
4598
+ progressColor: radialStrokeColor,
4599
+ strokeWidth: radialStrokeWidth,
4600
+ width: graphWidth,
4601
+ height: graphHeight
4602
+ });
4603
+ }
4437
4604
  var singleValueComponent = /*#__PURE__*/external_react_default.a.createElement(SingleValueContainer, {
4438
4605
  singleValueBottomOffset: singleValueBottomOffset
4439
4606
  }, /*#__PURE__*/external_react_default.a.createElement(SingleValueBasic["default"], {
@@ -4461,7 +4628,8 @@ var RadialLayout_RadialContent = function RadialContent(_ref) {
4461
4628
  }, underLabel));
4462
4629
  return /*#__PURE__*/external_react_default.a.createElement(GraphContainer, {
4463
4630
  width: graphWidth,
4464
- height: graphHeight
4631
+ height: graphHeight,
4632
+ "data-test": "graph-container"
4465
4633
  }, radialGraph, /*#__PURE__*/external_react_default.a.createElement(TextContainer, {
4466
4634
  smallViz: !showRadialGraph,
4467
4635
  height: graphHeight
@@ -4475,9 +4643,17 @@ RadialLayout_RadialContent.propTypes = _objectSpread(_objectSpread({}, SingleVal
4475
4643
  radialStrokeColor: external_prop_types_default.a.string,
4476
4644
  radialStrokeWidth: external_prop_types_default.a.number,
4477
4645
  graphWidth: external_prop_types_default.a.number,
4478
- graphHeight: external_prop_types_default.a.number
4646
+ graphHeight: external_prop_types_default.a.number,
4647
+ gaugeComponent: external_prop_types_default.a.element,
4648
+ backgroundColor: external_prop_types_default.a.string
4479
4649
  });
4480
4650
  /* harmony default export */ var RadialLayout = (RadialLayout_RadialContent);
4651
+ // EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
4652
+ var singleValueUtils = __webpack_require__(24);
4653
+
4654
+ // EXTERNAL MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/gaugeUtils.ts
4655
+ var gaugeUtils = __webpack_require__(96);
4656
+
4481
4657
  // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/SingleValueRadial.jsx
4482
4658
 
4483
4659
 
@@ -4496,11 +4672,12 @@ RadialLayout_RadialContent.propTypes = _objectSpread(_objectSpread({}, SingleVal
4496
4672
 
4497
4673
 
4498
4674
 
4675
+
4499
4676
  var Container = external_styled_components_default.a.div.withConfig({
4500
4677
  displayName: "SingleValueRadial__Container",
4501
4678
  componentId: "sc-404dvw-0"
4502
4679
  })(["overflow:hidden;", ";"], function (props) {
4503
- return Object(style_["toDimension"])(external_lodash_pick_default()(props, ['width', 'height']));
4680
+ return Object(style_["toDimension"])(Object(external_lodash_["pick"])(props, ['width', 'height']));
4504
4681
  });
4505
4682
  var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
4506
4683
  var props = extends_default()({}, _ref);
@@ -4508,9 +4685,12 @@ var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
4508
4685
  _props$height = props.height,
4509
4686
  height = _props$height === void 0 ? 250 : _props$height,
4510
4687
  style = props.style,
4688
+ isGaugeOn = props.isGaugeOn,
4689
+ gaugeRanges = props.gaugeRanges,
4511
4690
  majorFontSize = props.majorFontSize,
4512
4691
  majorValue = props.majorValue,
4513
4692
  majorValueField = props.majorValueField,
4693
+ minValue = props.minValue,
4514
4694
  maxValue = props.maxValue,
4515
4695
  trendValue = props.trendValue,
4516
4696
  trendFontSize = props.trendFontSize,
@@ -4543,42 +4723,48 @@ var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
4543
4723
  majorColor = _computeColors.majorColor,
4544
4724
  trendColor = _computeColors.trendColor,
4545
4725
  underLabelColor = _computeColors.underLabelColor;
4546
- var radialColors = displayUtils_getRadialColors({
4726
+ var radialColors = Object(displayUtils["getRadialColors"])({
4547
4727
  backgroundEnabled: backgroundEnabled,
4548
4728
  backgroundColor: backgroundColor
4549
4729
  });
4550
4730
  var radialBackgroundColor = props.radialBackgroundColor || radialColors.background;
4551
4731
  var radialStrokeColor = props.radialStrokeColor || radialColors.stroke;
4552
- var featureFlagContext = external_react_default.a.useContext(FeatureFlagContext_default.a);
4732
+ var featureFlagContext = external_react_["useContext"](FeatureFlagContext_default.a);
4553
4733
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
4554
4734
  var trellisEnabled = isTrellisFeatureFlagOn && splitByLayout === layoutUtils["LAYOUT_TYPE"].Trellis;
4555
4735
  var handleValueClick = Object(external_react_["useCallback"])(function (ev) {
4556
4736
  return Object(singleValueUtils["handleValueClickCallback"])(ev, majorValue, majorValueField, trendValue, onValueClick, trellisEnabled, trellisSplitBy, trellisKey);
4557
4737
  }, [onValueClick, majorValue, majorValueField, trendValue, trellisEnabled, trellisSplitBy, trellisKey]);
4738
+ var sortedGaugeRanges = gaugeRanges && Object(gaugeUtils["getSortedGaugeRanges"])(gaugeRanges);
4739
+ var isGaugeValid = isGaugeOn && gaugeRanges && Object(gaugeUtils["validateGaugeRanges"])(sortedGaugeRanges);
4740
+ var formattedGaugeRanges = isGaugeValid && Object(gaugeUtils["getFormattedGaugeRanges"])(sortedGaugeRanges, minValue, maxValue);
4558
4741
  var renderVisualization = function renderVisualization(_ref2) {
4559
4742
  var containerWidth = _ref2.width,
4560
4743
  containerHeight = _ref2.height;
4561
4744
  var underLabel = props.underLabel;
4562
4745
  var trendDisplay = props.trendDisplay,
4563
4746
  unit = props.unit; // calculate radial graph dimensions, strokewidth, and major and trend content dimensions
4564
- var _getRadialGraphDimens = displayUtils_getRadialGraphDimensions({
4747
+ var _getRadialGraphDimens = Object(displayUtils["getRadialGraphDimensions"])({
4565
4748
  width: containerWidth,
4566
4749
  height: containerHeight
4567
4750
  }),
4568
4751
  graphWidth = _getRadialGraphDimens.width,
4569
4752
  graphHeight = _getRadialGraphDimens.height; // Radial stroke width is stepped to lower value at lower sizes.
4570
- var radialStrokeWidth = getRadialStrokeWidth(graphHeight);
4571
- var _getRadialHelperDimen = getRadialHelperDimensions({
4572
- height: graphHeight - radialStrokeWidth / 2,
4573
- strokeWidth: radialStrokeWidth
4574
- }),
4575
- contentWidth = _getRadialHelperDimen.contentWidth,
4576
- contentHeight = _getRadialHelperDimen.contentHeight; // Subtract half of the stroke width for the exact internal radius.
4753
+ var radialStrokeWidth = Object(displayUtils["getRadialStrokeWidth"])(graphHeight);
4754
+
4755
+ // Subtract half of the stroke width for the exact internal radius.
4577
4756
  var semicircleRadius = graphHeight - radialStrokeWidth / 2;
4578
- // If radius drops below 20px, hide the radial graph. The dependency of this variable on font size is removed, and it now only depends on semicircle radius.
4757
+ // If radius drops below 20px, hide the radial graph.
4579
4758
  var showRadialGraph = semicircleRadius >= 20;
4580
4759
 
4581
- // If not showing the radial graph, then can forgo padding logic and use original container dimensions for content sizing computation.
4760
+ // if gauge is valid, reduce contentWidth and contentHeight by padding from GaugeGraph
4761
+ var offSet = isGaugeValid ? Object(gaugeUtils["getLabelFontSize"])(graphHeight, showRadialGraph) * 3 : 0;
4762
+ var _getRadialHelperDimen = Object(displayUtils["getRadialHelperDimensions"])({
4763
+ height: graphHeight - radialStrokeWidth / 2 - offSet,
4764
+ strokeWidth: radialStrokeWidth
4765
+ }),
4766
+ contentWidth = _getRadialHelperDimen.contentWidth,
4767
+ contentHeight = _getRadialHelperDimen.contentHeight; // If not showing the radial graph, then can forgo padding logic and use original container dimensions for content sizing computation.
4582
4768
  if (!showRadialGraph) {
4583
4769
  graphWidth = containerWidth;
4584
4770
  contentWidth = containerWidth;
@@ -4608,23 +4794,26 @@ var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
4608
4794
  trendTextFontSize = _computeSingleValueRa.trendTextFontSize,
4609
4795
  majorValueTitle = _computeSingleValueRa.majorValueTitle,
4610
4796
  smallVizProps = _computeSingleValueRa.smallVizProps;
4611
- if (!isEmpty_default()(smallVizProps)) {
4797
+ if (!Object(external_lodash_["isEmpty"])(smallVizProps)) {
4612
4798
  trendDisplay = smallVizProps.trendDisplay;
4613
4799
  unit = smallVizProps.unit;
4614
4800
  }
4615
4801
 
4616
4802
  // calculate radial progress
4617
- var progress = getRadialProgress(majorValue, maxValue);
4618
- return /*#__PURE__*/external_react_default.a.createElement(VizStyleWrapper["default"], {
4803
+ var progress = Object(displayUtils["getRadialProgress"])(majorValue - minValue, minValue, maxValue);
4804
+ return /*#__PURE__*/external_react_["createElement"](VizStyleWrapper["default"], {
4619
4805
  backgroundColor: backgroundColor,
4620
4806
  style: style,
4621
4807
  dataTestKey: "SingleValueRadialWrapper"
4622
- }, /*#__PURE__*/external_react_default.a.createElement(RadialLayout, {
4808
+ }, /*#__PURE__*/external_react_["createElement"](RadialLayout, {
4623
4809
  "data-test": "RadialLayout",
4624
4810
  majorColor: majorColor,
4811
+ majorValue: majorValue,
4625
4812
  majorText: majorText,
4626
4813
  majorTextFontSize: majorTextFontSize,
4627
4814
  majorValueTitle: majorValueTitle,
4815
+ minValue: minValue,
4816
+ maxValue: maxValue,
4628
4817
  trendColor: trendColor,
4629
4818
  trendText: trendText,
4630
4819
  trendTextFontSize: trendTextFontSize,
@@ -4640,61 +4829,69 @@ var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
4640
4829
  radialStrokeColor: radialStrokeColor,
4641
4830
  radialStrokeWidth: radialStrokeWidth,
4642
4831
  graphWidth: graphWidth,
4643
- graphHeight: graphHeight
4832
+ graphHeight: graphHeight,
4833
+ isGaugeValid: isGaugeValid,
4834
+ formattedGaugeRanges: formattedGaugeRanges,
4835
+ defaultFontColor: defaultColors.defaultFontColor
4644
4836
  }));
4645
4837
  };
4646
4838
  if (trellisEnabled) {
4647
- return /*#__PURE__*/external_react_default.a.createElement(external_react_default.a.Fragment, null, /*#__PURE__*/external_react_default.a.createElement(TrellisTitle["TrellisTitle"], {
4839
+ return /*#__PURE__*/external_react_["createElement"](external_react_["Fragment"], null, /*#__PURE__*/external_react_["createElement"](TrellisTitle["TrellisTitle"], {
4648
4840
  fontColor: defaultColors.defaultFontColor,
4649
4841
  backgroundColor: backgroundColor,
4650
4842
  trellisKey: trellisKey
4651
- }), /*#__PURE__*/external_react_default.a.createElement(Container, {
4843
+ }), /*#__PURE__*/external_react_["createElement"](Container, {
4652
4844
  width: width,
4653
4845
  height: height - TrellisTitle["TRELLIS_TITLE_HEIGHT"]
4654
- }, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
4846
+ }, /*#__PURE__*/external_react_["createElement"](SizeAwareWrapper_default.a, null, function (containerDimension) {
4655
4847
  return renderVisualization(containerDimension);
4656
4848
  })));
4657
4849
  }
4658
- return /*#__PURE__*/external_react_default.a.createElement(Container, {
4850
+ return /*#__PURE__*/external_react_["createElement"](Container, {
4659
4851
  width: width,
4660
4852
  height: height
4661
- }, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
4853
+ }, /*#__PURE__*/external_react_["createElement"](SizeAwareWrapper_default.a, null, function (containerDimension) {
4662
4854
  return renderVisualization(containerDimension);
4663
4855
  }));
4664
4856
  };
4665
4857
  SingleValueRadial_SingleValueRadial.propTypes = {
4666
- width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
4667
- height: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
4668
- style: external_prop_types_default.a.object,
4669
- majorValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
4670
- majorValueField: external_prop_types_default.a.string,
4671
- majorColor: external_prop_types_default.a.string,
4672
- majorFontSize: external_prop_types_default.a.number,
4673
- maxValue: external_prop_types_default.a.number,
4674
- trendValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
4675
- trendColor: external_prop_types_default.a.string,
4676
- trendFontSize: external_prop_types_default.a.number,
4677
- trendDisplay: external_prop_types_default.a.string,
4678
- trendIndicatorPosition: external_prop_types_default.a.oneOf(['standard', 'below', 'outside']),
4679
- shouldAbbreviateTrendValue: external_prop_types_default.a.bool,
4680
- backgroundColor: external_prop_types_default.a.string,
4681
- unit: external_prop_types_default.a.string,
4682
- unitPosition: external_prop_types_default.a.string,
4683
- underLabel: external_prop_types_default.a.string,
4684
- numberPrecision: external_prop_types_default.a.number,
4685
- shouldUseThousandSeparators: external_prop_types_default.a.bool,
4686
- radialBackgroundColor: external_prop_types_default.a.string,
4687
- radialStrokeColor: external_prop_types_default.a.string,
4688
- onValueClick: external_prop_types_default.a.func,
4689
- splitByLayout: external_prop_types_default.a.string,
4690
- trellisKey: external_prop_types_default.a.string,
4691
- trellisSplitBy: external_prop_types_default.a.string
4858
+ width: external_prop_types_["oneOfType"]([external_prop_types_["string"], external_prop_types_["number"]]),
4859
+ height: external_prop_types_["oneOfType"]([external_prop_types_["string"], external_prop_types_["number"]]),
4860
+ style: external_prop_types_["object"],
4861
+ majorValue: external_prop_types_["oneOfType"]([external_prop_types_["string"], external_prop_types_["number"]]),
4862
+ majorValueField: external_prop_types_["string"],
4863
+ majorColor: external_prop_types_["string"],
4864
+ majorFontSize: external_prop_types_["number"],
4865
+ minValue: external_prop_types_["number"],
4866
+ maxValue: external_prop_types_["number"],
4867
+ trendValue: external_prop_types_["oneOfType"]([external_prop_types_["string"], external_prop_types_["number"]]),
4868
+ trendColor: external_prop_types_["string"],
4869
+ trendFontSize: external_prop_types_["number"],
4870
+ trendDisplay: external_prop_types_["string"],
4871
+ trendIndicatorPosition: external_prop_types_["oneOf"](['standard', 'below', 'outside']),
4872
+ shouldAbbreviateTrendValue: external_prop_types_["bool"],
4873
+ backgroundColor: external_prop_types_["string"],
4874
+ unit: external_prop_types_["string"],
4875
+ unitPosition: external_prop_types_["string"],
4876
+ underLabel: external_prop_types_["string"],
4877
+ numberPrecision: external_prop_types_["number"],
4878
+ shouldUseThousandSeparators: external_prop_types_["bool"],
4879
+ radialBackgroundColor: external_prop_types_["string"],
4880
+ radialStrokeColor: external_prop_types_["string"],
4881
+ onValueClick: external_prop_types_["func"],
4882
+ splitByLayout: external_prop_types_["string"],
4883
+ trellisKey: external_prop_types_["string"],
4884
+ trellisSplitBy: external_prop_types_["string"],
4885
+ isGaugeOn: external_prop_types_["bool"],
4886
+ gaugeComponent: external_prop_types_["element"],
4887
+ gaugeRanges: external_prop_types_["array"]
4692
4888
  };
4693
4889
  SingleValueRadial_SingleValueRadial.defaultProps = {
4694
4890
  width: '100%',
4695
4891
  height: 250,
4696
4892
  majorValue: 'N/A',
4697
4893
  majorValueField: '',
4894
+ minValue: 0,
4698
4895
  maxValue: 100,
4699
4896
  trendDisplay: 'absolute',
4700
4897
  trendIndicatorPosition: 'standard',
@@ -4710,17 +4907,10 @@ SingleValueRadial_SingleValueRadial.defaultProps = {
4710
4907
 
4711
4908
  /***/ }),
4712
4909
 
4713
- /***/ 49:
4714
- /***/ (function(module, exports) {
4715
-
4716
- module.exports = require("@splunk/visualization-icons/placeholders");
4717
-
4718
- /***/ }),
4719
-
4720
4910
  /***/ 50:
4721
4911
  /***/ (function(module, exports) {
4722
4912
 
4723
- module.exports = require("@splunk/visualizations-shared/colorConstants");
4913
+ module.exports = require("@splunk/visualization-icons/placeholders");
4724
4914
 
4725
4915
  /***/ }),
4726
4916
 
@@ -4763,13 +4953,6 @@ var LAYOUT_TYPE;
4763
4953
 
4764
4954
  /***/ }),
4765
4955
 
4766
- /***/ 59:
4767
- /***/ (function(module, exports) {
4768
-
4769
- module.exports = require("@splunk/themes");
4770
-
4771
- /***/ }),
4772
-
4773
4956
  /***/ 6:
4774
4957
  /***/ (function(module, exports, __webpack_require__) {
4775
4958
 
@@ -4810,6 +4993,13 @@ var VizBehavior;
4810
4993
  /***/ 60:
4811
4994
  /***/ (function(module, exports) {
4812
4995
 
4996
+ module.exports = require("@splunk/themes");
4997
+
4998
+ /***/ }),
4999
+
5000
+ /***/ 61:
5001
+ /***/ (function(module, exports) {
5002
+
4813
5003
  module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
4814
5004
 
4815
5005
  /***/ }),
@@ -4821,7 +5011,7 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
4821
5011
 
4822
5012
  /***/ }),
4823
5013
 
4824
- /***/ 72:
5014
+ /***/ 73:
4825
5015
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4826
5016
 
4827
5017
  "use strict";
@@ -4846,7 +5036,7 @@ VizStyleWrapper.displayName = 'VizStyleWrapper';
4846
5036
 
4847
5037
  /***/ }),
4848
5038
 
4849
- /***/ 78:
5039
+ /***/ 79:
4850
5040
  /***/ (function(module, exports, __webpack_require__) {
4851
5041
 
4852
5042
  "use strict";
@@ -4886,7 +5076,201 @@ exports.TrellisTitle = TrellisTitle;
4886
5076
 
4887
5077
  /***/ }),
4888
5078
 
4889
- /***/ 79:
5079
+ /***/ 8:
5080
+ /***/ (function(module, exports) {
5081
+
5082
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
5083
+
5084
+ /***/ }),
5085
+
5086
+ /***/ 80:
5087
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
5088
+
5089
+ "use strict";
5090
+ __webpack_require__.r(__webpack_exports__);
5091
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "VALID_TREND_POSITIONS", function() { return VALID_TREND_POSITIONS; });
5092
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MAJOR_FONT_THRESHOLD", function() { return MAJOR_FONT_THRESHOLD; });
5093
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "TREND_FONT_THRESHOLD", function() { return TREND_FONT_THRESHOLD; });
5094
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_RADIAL_STROKE_WIDTH", function() { return DEFAULT_RADIAL_STROKE_WIDTH; });
5095
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "SMALL_RADIAL_STROKE_WIDTH", function() { return SMALL_RADIAL_STROKE_WIDTH; });
5096
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadialColors", function() { return getRadialColors; });
5097
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadialGraphDimensions", function() { return getRadialGraphDimensions; });
5098
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadialHelperDimensions", function() { return getRadialHelperDimensions; });
5099
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getValueContentSize", function() { return getValueContentSize; });
5100
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadialStrokeWidth", function() { return getRadialStrokeWidth; });
5101
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "isValidPosition", function() { return isValidPosition; });
5102
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showTrendPositionStandard", function() { return showTrendPositionStandard; });
5103
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showTrendPositionBelow", function() { return showTrendPositionBelow; });
5104
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "showTrendPositionOutside", function() { return showTrendPositionOutside; });
5105
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getRadialProgress", function() { return getRadialProgress; });
5106
+ /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(49);
5107
+ /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_0__);
5108
+ /* harmony import */ var _common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(24);
5109
+
5110
+
5111
+ var VALID_TREND_POSITIONS = ['standard', 'below', 'outside'];
5112
+ var MAJOR_FONT_THRESHOLD = 25;
5113
+ var TREND_FONT_THRESHOLD = 12;
5114
+ var DEFAULT_RADIAL_STROKE_WIDTH = 16;
5115
+ var SMALL_RADIAL_STROKE_WIDTH = 6;
5116
+
5117
+ /**
5118
+ * Get the colors for a radial graph based on severity
5119
+ * @method getRadialColors
5120
+ * @param {Object} props
5121
+ * @param {Bool} props.backgroundEnabled
5122
+ * @param {String} props.backgroundColor
5123
+ * @returns {Object} { background, stroke } colors
5124
+ */
5125
+ var getRadialColors = function getRadialColors(_ref) {
5126
+ var backgroundEnabled = _ref.backgroundEnabled,
5127
+ backgroundColor = _ref.backgroundColor;
5128
+ return Object(_common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["getGraphColors"])({
5129
+ backgroundEnabled: backgroundEnabled,
5130
+ backgroundColor: backgroundColor,
5131
+ defaultColors: _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_0__["RADIAL_SEVERITY_COLORS"],
5132
+ customColorFormatter: function customColorFormatter(color) {
5133
+ return {
5134
+ background: Object(_common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["lighten"])(color),
5135
+ stroke: Object(_common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["darken"])(color)
5136
+ };
5137
+ }
5138
+ });
5139
+ };
5140
+
5141
+ /**
5142
+ * Figure out the dimensions of the graph
5143
+ * @method getRadialGraphDimensions
5144
+ * @param {Object} props
5145
+ * @param {Number} props.width // Width of the container
5146
+ * @param {Number} props.height // Height of the container
5147
+ * @returns {Number} width and height of the graph
5148
+ */
5149
+ var getRadialGraphDimensions = function getRadialGraphDimensions(_ref2) {
5150
+ var width = _ref2.width,
5151
+ height = _ref2.height;
5152
+ // height * 2 because we are fitting only half of a circle inside the container
5153
+ var radius = Math.min(width, height * 2) / 2;
5154
+ return {
5155
+ width: width - _common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["SVR_PADDING"].left - _common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["SVR_PADDING"].right,
5156
+ height: radius - _common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["SVR_PADDING"].top - _common_utils_singleValueUtils__WEBPACK_IMPORTED_MODULE_1__["SVR_PADDING"].bottom
5157
+ };
5158
+ };
5159
+
5160
+ /**
5161
+ * Figure out the dimensions of the content container for SVR
5162
+ * @method getRadialHelperDimensions
5163
+ * @param {Object} props
5164
+ * @param {Number} props.width // Width of the visualization space
5165
+ * @param {Number} props.height // Height of the visualization space
5166
+ * @returns {Number} width and height of the content graph
5167
+ */
5168
+ var getRadialHelperDimensions = function getRadialHelperDimensions(_ref3) {
5169
+ var height = _ref3.height,
5170
+ _ref3$strokeWidth = _ref3.strokeWidth,
5171
+ strokeWidth = _ref3$strokeWidth === void 0 ? DEFAULT_RADIAL_STROKE_WIDTH : _ref3$strokeWidth;
5172
+ // The radius of the visualization is equal to the height
5173
+ var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
5174
+ var innerArcRadius = semicircleRadius * 0.9;
5175
+ var halfContentWidth = innerArcRadius * 0.7;
5176
+ var contentHeight = Math.floor(Math.sqrt(Math.pow(innerArcRadius, 2) - Math.pow(halfContentWidth, 2)));
5177
+ return {
5178
+ contentWidth: halfContentWidth * 2,
5179
+ contentHeight: contentHeight,
5180
+ helperArcRadius: innerArcRadius,
5181
+ semicircleRadius: semicircleRadius
5182
+ };
5183
+ };
5184
+
5185
+ /**
5186
+ * Get the maximum size of the container that holds the graph text
5187
+ * @method getValueContentSize
5188
+ * @param {Object} props
5189
+ * @param {Number} props.graphSize
5190
+ * @param {Number} props.radialStrokeWidth // Stroke width of the graph
5191
+ * @returns {Number} content size for showing major and trend values in radial graph
5192
+ */
5193
+ var getValueContentSize = function getValueContentSize(_ref4) {
5194
+ var graphSize = _ref4.graphSize,
5195
+ radialStrokeWidth = _ref4.radialStrokeWidth;
5196
+ // Account for the graph's stroke width
5197
+ var diameter = graphSize - radialStrokeWidth;
5198
+ // Use pythagoreum theorum with circle diameter
5199
+ // to calculate the size of the sides of the square inside the circle
5200
+ return Math.floor(Math.sqrt(Math.pow(diameter, 2) / 2));
5201
+ };
5202
+
5203
+ /*
5204
+ * @method getRadialStrokeWidth
5205
+ * @param {Number} graphHeight
5206
+ * @returns {Number} radial stroke width
5207
+ */
5208
+ var getRadialStrokeWidth = function getRadialStrokeWidth(graphHeight) {
5209
+ return graphHeight >= 90 ? DEFAULT_RADIAL_STROKE_WIDTH : SMALL_RADIAL_STROKE_WIDTH;
5210
+ };
5211
+
5212
+ /*
5213
+ * @method isValidPosition
5214
+ * @param {String} position
5215
+ * @returns {Bool}
5216
+ */
5217
+ var isValidPosition = function isValidPosition(position) {
5218
+ return VALID_TREND_POSITIONS.indexOf(position) > -1;
5219
+ };
5220
+
5221
+ /*
5222
+ * @method showTrendPositionStandard
5223
+ * @param {Object} props
5224
+ * @param {Bool} props.showTrendIndicator
5225
+ * @param {String} props.position
5226
+ * @returns {Bool}
5227
+ */
5228
+ var showTrendPositionStandard = function showTrendPositionStandard(_ref5) {
5229
+ var showTrendIndicator = _ref5.showTrendIndicator,
5230
+ position = _ref5.position;
5231
+ return showTrendIndicator && position === 'standard';
5232
+ };
5233
+
5234
+ /*
5235
+ * @method showTrendPositionBelow
5236
+ * @param {Object} props
5237
+ * @param {Bool} props.showTrendIndicator
5238
+ * @param {String} props.position
5239
+ * @returns {Bool}
5240
+ */
5241
+ var showTrendPositionBelow = function showTrendPositionBelow(_ref6) {
5242
+ var showTrendIndicator = _ref6.showTrendIndicator,
5243
+ position = _ref6.position;
5244
+ return showTrendIndicator && position === 'below';
5245
+ };
5246
+
5247
+ /*
5248
+ * @method showTrendPositionOutside
5249
+ * @param {Object} props
5250
+ * @param {Bool} props.showTrendIndicator
5251
+ * @param {String} props.position
5252
+ * @returns {Bool}
5253
+ */
5254
+ var showTrendPositionOutside = function showTrendPositionOutside(_ref7) {
5255
+ var showTrendIndicator = _ref7.showTrendIndicator,
5256
+ position = _ref7.position;
5257
+ return showTrendIndicator && position === 'outside';
5258
+ };
5259
+
5260
+ /*
5261
+ * @method getRadialProgress
5262
+ * @param {Number} amount of progress in the radial
5263
+ * @param {Number} minValue
5264
+ * @param {Number} maxValue
5265
+ * @returns {Number} percentage of progress in the radial
5266
+ */
5267
+ var getRadialProgress = function getRadialProgress(progressValue, minValue, maxValue) {
5268
+ return typeof progressValue === 'number' && minValue < maxValue && progressValue > 0 ? progressValue / (maxValue - minValue) * 100 : 0;
5269
+ };
5270
+
5271
+ /***/ }),
5272
+
5273
+ /***/ 81:
4890
5274
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4891
5275
 
4892
5276
  "use strict";
@@ -4916,11 +5300,11 @@ var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(exte
4916
5300
  var singleValueUtils = __webpack_require__(24);
4917
5301
 
4918
5302
  // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ArrowUp"
4919
- var ArrowUp_ = __webpack_require__(83);
5303
+ var ArrowUp_ = __webpack_require__(84);
4920
5304
  var ArrowUp_default = /*#__PURE__*/__webpack_require__.n(ArrowUp_);
4921
5305
 
4922
5306
  // EXTERNAL MODULE: external "@splunk/react-icons/enterprise/ArrowDown"
4923
- var ArrowDown_ = __webpack_require__(84);
5307
+ var ArrowDown_ = __webpack_require__(85);
4924
5308
  var ArrowDown_default = /*#__PURE__*/__webpack_require__.n(ArrowDown_);
4925
5309
 
4926
5310
  // EXTERNAL MODULE: external "@splunk/ui-utils/i18n"
@@ -4995,7 +5379,7 @@ TrendValue_SingleValueContent.propTypes = {
4995
5379
  };
4996
5380
  /* harmony default export */ var TrendValue = (TrendValue_SingleValueContent);
4997
5381
  // EXTERNAL MODULE: external "cssesc"
4998
- var external_cssesc_ = __webpack_require__(85);
5382
+ var external_cssesc_ = __webpack_require__(86);
4999
5383
  var external_cssesc_default = /*#__PURE__*/__webpack_require__.n(external_cssesc_);
5000
5384
 
5001
5385
  // CONCATENATED MODULE: ./src/SingleValueBasic/MajorValue.jsx
@@ -5180,56 +5564,49 @@ var SingleValueTrendValue = TrendValue;
5180
5564
 
5181
5565
  /***/ }),
5182
5566
 
5183
- /***/ 8:
5567
+ /***/ 82:
5184
5568
  /***/ (function(module, exports) {
5185
5569
 
5186
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
5570
+ module.exports = require("@babel/runtime/helpers/typeof");
5187
5571
 
5188
5572
  /***/ }),
5189
5573
 
5190
- /***/ 80:
5574
+ /***/ 83:
5191
5575
  /***/ (function(module, exports) {
5192
5576
 
5193
5577
  module.exports = require("@splunk/visualizations-shared/trellisUtils");
5194
5578
 
5195
5579
  /***/ }),
5196
5580
 
5197
- /***/ 81:
5198
- /***/ (function(module, exports) {
5199
-
5200
- module.exports = require("lodash/pick");
5201
-
5202
- /***/ }),
5203
-
5204
- /***/ 82:
5581
+ /***/ 84:
5205
5582
  /***/ (function(module, exports) {
5206
5583
 
5207
- module.exports = require("lodash/isEmpty");
5584
+ module.exports = require("@splunk/react-icons/enterprise/ArrowUp");
5208
5585
 
5209
5586
  /***/ }),
5210
5587
 
5211
- /***/ 83:
5588
+ /***/ 85:
5212
5589
  /***/ (function(module, exports) {
5213
5590
 
5214
- module.exports = require("@splunk/react-icons/enterprise/ArrowUp");
5591
+ module.exports = require("@splunk/react-icons/enterprise/ArrowDown");
5215
5592
 
5216
5593
  /***/ }),
5217
5594
 
5218
- /***/ 84:
5595
+ /***/ 86:
5219
5596
  /***/ (function(module, exports) {
5220
5597
 
5221
- module.exports = require("@splunk/react-icons/enterprise/ArrowDown");
5598
+ module.exports = require("cssesc");
5222
5599
 
5223
5600
  /***/ }),
5224
5601
 
5225
- /***/ 85:
5602
+ /***/ 9:
5226
5603
  /***/ (function(module, exports) {
5227
5604
 
5228
- module.exports = require("cssesc");
5605
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
5229
5606
 
5230
5607
  /***/ }),
5231
5608
 
5232
- /***/ 89:
5609
+ /***/ 90:
5233
5610
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
5234
5611
 
5235
5612
  "use strict";
@@ -5253,17 +5630,214 @@ var StaticBackgroundColorEditor = {
5253
5630
 
5254
5631
  /***/ }),
5255
5632
 
5256
- /***/ 9:
5633
+ /***/ 93:
5257
5634
  /***/ (function(module, exports) {
5258
5635
 
5259
- module.exports = require("@babel/runtime/helpers/classCallCheck");
5636
+ module.exports = require("@splunk/react-ui/Paginator");
5260
5637
 
5261
5638
  /***/ }),
5262
5639
 
5263
- /***/ 92:
5264
- /***/ (function(module, exports) {
5640
+ /***/ 96:
5641
+ /***/ (function(module, exports, __webpack_require__) {
5265
5642
 
5266
- module.exports = require("@splunk/react-ui/Paginator");
5643
+ "use strict";
5644
+
5645
+
5646
+ var _typeof = __webpack_require__(82);
5647
+ Object.defineProperty(exports, "__esModule", {
5648
+ value: true
5649
+ });
5650
+ exports.getFormattedGaugeRanges = exports.getSortedGaugeRanges = exports.getGaugeStrokeWidth = exports.getLabelFontSize = exports.getVerticalLabelOffset = exports.computeTextWidth = exports.getProgressWidth = exports.validateGaugeRanges = exports.getGaugeRange = void 0;
5651
+ var displayUtils_1 = __webpack_require__(80);
5652
+ /**
5653
+ * Figure out what range the major value lies in
5654
+ * @method getGaugeRange
5655
+ * @param {Array} formattedGaugeRanges
5656
+ * @param {Number} majorValue
5657
+ * @returns {Number} index of range that the major value lies in
5658
+ */
5659
+ var getGaugeRange = function getGaugeRange(formattedGaugeRanges, majorValue) {
5660
+ if (typeof majorValue !== 'number') {
5661
+ return -1;
5662
+ }
5663
+ var numRanges = formattedGaugeRanges.length;
5664
+ return formattedGaugeRanges.findIndex(function (r, i) {
5665
+ return i === numRanges - 1 && r.from <= majorValue || r.from <= majorValue && majorValue < r.to;
5666
+ });
5667
+ };
5668
+ exports.getGaugeRange = getGaugeRange;
5669
+ /**
5670
+ * Validate gauge ranges object
5671
+ * @method validateGaugeRanges
5672
+ * @param {Array} gaugeRanges unformatted, open gauge ranges
5673
+ * @returns {boolean} whether gauge ranges object is valid
5674
+ */
5675
+ var validateGaugeRanges = function validateGaugeRanges(gaugeRanges) {
5676
+ if (!gaugeRanges || !Array.isArray(gaugeRanges) || gaugeRanges.length < 2) {
5677
+ return false;
5678
+ }
5679
+ for (var i = 0; i < gaugeRanges.length; i += 1) {
5680
+ var range = gaugeRanges[i];
5681
+ if (!range || _typeof(range) !== 'object') {
5682
+ return false;
5683
+ }
5684
+ if (i === 0 && (Object.keys(range).includes('from') || !Object.keys(range).includes('to') || typeof range.to !== 'number')) {
5685
+ return false;
5686
+ }
5687
+ if (i === gaugeRanges.length - 1 && (Object.keys(range).includes('to') || !Object.keys(range).includes('from') || typeof range.from !== 'number')) {
5688
+ return false;
5689
+ }
5690
+ if (i > 0 && i < gaugeRanges.length - 1 && (!Object.keys(range).includes('from') || !Object.keys(range).includes('to') || typeof range.from !== 'number' || typeof range.to !== 'number' || range.from !== gaugeRanges[i - 1].to || range.from >= range.to)) {
5691
+ return false;
5692
+ }
5693
+ if (!Object.keys(range).includes('value') || typeof range.value !== 'string') {
5694
+ return false;
5695
+ }
5696
+ }
5697
+ return true;
5698
+ };
5699
+ exports.validateGaugeRanges = validateGaugeRanges;
5700
+ /**
5701
+ * Return progress width
5702
+ * @method getProgressWidth
5703
+ * @param {Number} value
5704
+ * @param {Number} minValue
5705
+ * @param {Number} maxValue
5706
+ * @param {Number} circumference
5707
+ * @returns {Number} progress width of radial
5708
+ */
5709
+ var getProgressWidth = function getProgressWidth(value, minValue, maxValue, circumference) {
5710
+ var progress = (0, displayUtils_1.getRadialProgress)(value, minValue, maxValue);
5711
+ var progress50 = progress / 100 * 50;
5712
+ var progressWidth = progress50 / 100 * circumference;
5713
+ return progressWidth;
5714
+ };
5715
+ exports.getProgressWidth = getProgressWidth;
5716
+ /**
5717
+ * Return text width
5718
+ * @method computeTextWidth
5719
+ * @param {String} text
5720
+ * @param {String} font
5721
+ * @returns {Number} width of text with font
5722
+ */
5723
+ var computeTextWidth = function computeTextWidth(text, font) {
5724
+ var canvas = document.createElement('canvas');
5725
+ var context = canvas.getContext('2d');
5726
+ context.font = font;
5727
+ var measure = context.measureText(text);
5728
+ return measure.width;
5729
+ };
5730
+ exports.computeTextWidth = computeTextWidth;
5731
+ /**
5732
+ * Return vertical offset of label
5733
+ * @method getVerticalLabelOffset
5734
+ * @param {Number} theta
5735
+ * @param {Number} textHeight
5736
+ * @param {Number} maxOffset
5737
+ * @returns {Number} vertical offset of label
5738
+ */
5739
+ var getVerticalLabelOffset = function getVerticalLabelOffset(theta, textHeight, maxOffset) {
5740
+ if (theta > 90) {
5741
+ return (-(maxOffset / 90) * (180 - theta) + maxOffset) * textHeight;
5742
+ }
5743
+ return (-(maxOffset / 90) * theta + maxOffset) * textHeight;
5744
+ };
5745
+ exports.getVerticalLabelOffset = getVerticalLabelOffset;
5746
+ /**
5747
+ * Returns font size of label
5748
+ * @method getLabelFontSize
5749
+ * @param {Number} height
5750
+ * @param {Number} showRadialGraph
5751
+ * @returns {Number} font size of label
5752
+ */
5753
+ var getLabelFontSize = function getLabelFontSize(height, showRadialGraph) {
5754
+ var strokeWidth = (0, exports.getGaugeStrokeWidth)(height);
5755
+ var _ref = (0, displayUtils_1.getRadialHelperDimensions)({
5756
+ height: height,
5757
+ strokeWidth: strokeWidth
5758
+ }),
5759
+ semicircleRadius = _ref.semicircleRadius,
5760
+ helperArcRadius = _ref.helperArcRadius; // Two cases for removing the labels:
5761
+ // 1. the semicircle radius is insufficiently sized for text
5762
+ // 2. the radial visualization has been disabled (first condition reached first when making smaller).
5763
+ var fillVacantSpace = semicircleRadius < 50 || !showRadialGraph;
5764
+ return fillVacantSpace ? 0 : Math.min(helperArcRadius * 0.08, 16);
5765
+ };
5766
+ exports.getLabelFontSize = getLabelFontSize;
5767
+ /**
5768
+ * Returns radial gauge's stroke width
5769
+ * @method getGaugeStrokeWidth
5770
+ * @param {Number} height
5771
+ * @returns {Number} radial gauge's stroke width
5772
+ */
5773
+ var getGaugeStrokeWidth = function getGaugeStrokeWidth(height) {
5774
+ return height >= 225 ? 30 : 16;
5775
+ };
5776
+ exports.getGaugeStrokeWidth = getGaugeStrokeWidth;
5777
+ /**
5778
+ * sort the ranges in ascending order
5779
+ * @method getSortedGaugeRanges
5780
+ * @param {Array} gaugeRanges
5781
+ * @return {Array} sortedRanges
5782
+ */
5783
+ var getSortedGaugeRanges = function getSortedGaugeRanges(gaugeRanges) {
5784
+ gaugeRanges.sort(function (a, b) {
5785
+ if (a.to == null) return 1;
5786
+ if (b.to == null) return -1;
5787
+ return +a.to - +b.to;
5788
+ });
5789
+ return gaugeRanges;
5790
+ };
5791
+ exports.getSortedGaugeRanges = getSortedGaugeRanges;
5792
+ /**
5793
+ * format the ranges
5794
+ * @method getFormattedGaugeRanges
5795
+ * @param {Array} gaugeRanges
5796
+ * @param {number} minValue
5797
+ * @param {number} maxValue
5798
+ * @return {Array} formatted, bounded gauge ranges
5799
+ */
5800
+ var getFormattedGaugeRanges = function getFormattedGaugeRanges(gaugeRanges, minValue, maxValue) {
5801
+ var formattedGaugeRanges = [];
5802
+ gaugeRanges.forEach(function (range, index) {
5803
+ if (index === 0 && minValue < range.to) {
5804
+ var newRange = {
5805
+ from: minValue,
5806
+ to: range.to,
5807
+ value: range.value
5808
+ };
5809
+ if (maxValue < range.to) {
5810
+ newRange.to = maxValue;
5811
+ }
5812
+ formattedGaugeRanges.push(newRange);
5813
+ }
5814
+ if (index === gaugeRanges.length - 1 && maxValue > range.from) {
5815
+ var _newRange = {
5816
+ from: range.from,
5817
+ to: maxValue,
5818
+ value: range.value
5819
+ };
5820
+ if (minValue > range.from) {
5821
+ _newRange.from = minValue;
5822
+ }
5823
+ formattedGaugeRanges.push(_newRange);
5824
+ }
5825
+ if (Object.keys(range).includes('from') && Object.keys(range).includes('to')) {
5826
+ var _newRange2 = Object.assign({}, range);
5827
+ if (minValue > range.from && minValue < range.to) {
5828
+ _newRange2.from = minValue;
5829
+ }
5830
+ if (maxValue > range.from && maxValue < range.to) {
5831
+ _newRange2.to = maxValue;
5832
+ }
5833
+ if (minValue < range.to && maxValue > range.from) {
5834
+ formattedGaugeRanges.push(_newRange2);
5835
+ }
5836
+ }
5837
+ });
5838
+ return formattedGaugeRanges;
5839
+ };
5840
+ exports.getFormattedGaugeRanges = getFormattedGaugeRanges;
5267
5841
 
5268
5842
  /***/ })
5269
5843