@splunk/visualizations 25.1.0 → 25.3.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 (184) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
  8. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
  9. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
  10. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
  11. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
  12. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
  13. package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  32. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  33. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  34. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  35. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  36. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  37. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
  45. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
  46. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
  47. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Value_Highlighting.png +0 -0
  48. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
  49. package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
  50. package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
  51. package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
  52. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
  53. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
  54. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
  55. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Color_purple.png +0 -0
  56. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_custom.png +0 -0
  57. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_extraLarge.png +0 -0
  58. package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Markdown_with_number_as_DSL.png +0 -0
  59. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
  60. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
  61. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
  62. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
  63. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
  64. package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
  65. package/Area.config.js +72 -22
  66. package/Area.config.js.map +1 -1
  67. package/Area.js +246 -185
  68. package/Area.js.map +1 -1
  69. package/Bar.config.js +17 -17
  70. package/Bar.config.js.map +1 -1
  71. package/Bar.js +191 -180
  72. package/Bar.js.map +1 -1
  73. package/Bubble.config.js +21 -14
  74. package/Bubble.config.js.map +1 -1
  75. package/Bubble.js +193 -175
  76. package/Bubble.js.map +1 -1
  77. package/ChoroplethSvg.config.js +6 -6
  78. package/ChoroplethSvg.config.js.map +1 -1
  79. package/ChoroplethSvg.js +180 -170
  80. package/ChoroplethSvg.js.map +1 -1
  81. package/Column.config.js +17 -17
  82. package/Column.config.js.map +1 -1
  83. package/Column.js +190 -180
  84. package/Column.js.map +1 -1
  85. package/Ellipse.config.js +3 -3
  86. package/Ellipse.config.js.map +1 -1
  87. package/Ellipse.js +144 -134
  88. package/Ellipse.js.map +1 -1
  89. package/Events.config.js +664 -0
  90. package/Events.config.js.map +1 -0
  91. package/Events.js +3114 -0
  92. package/Events.js.map +1 -0
  93. package/FillerGauge.config.js +20 -19
  94. package/FillerGauge.config.js.map +1 -1
  95. package/FillerGauge.js +183 -166
  96. package/FillerGauge.js.map +1 -1
  97. package/Image.config.js +5 -5
  98. package/Image.config.js.map +1 -1
  99. package/Image.js +128 -128
  100. package/Image.js.map +1 -1
  101. package/Line.config.js +73 -22
  102. package/Line.config.js.map +1 -1
  103. package/Line.js +253 -186
  104. package/Line.js.map +1 -1
  105. package/LinkGraph.config.js +15 -8
  106. package/LinkGraph.config.js.map +1 -1
  107. package/LinkGraph.js +25270 -434
  108. package/LinkGraph.js.map +1 -1
  109. package/Map.config.js +30 -29
  110. package/Map.config.js.map +1 -1
  111. package/Map.js +3064 -3125
  112. package/Map.js.map +1 -1
  113. package/Markdown.config.js +32 -10
  114. package/Markdown.config.js.map +1 -1
  115. package/Markdown.js +576 -529
  116. package/Markdown.js.map +1 -1
  117. package/MarkerGauge.config.js +16 -16
  118. package/MarkerGauge.config.js.map +1 -1
  119. package/MarkerGauge.js +1287 -1287
  120. package/MarkerGauge.js.map +1 -1
  121. package/ParallelCoordinates.config.js +14 -14
  122. package/ParallelCoordinates.config.js.map +1 -1
  123. package/ParallelCoordinates.js +532 -639
  124. package/ParallelCoordinates.js.map +1 -1
  125. package/Pie.config.js +16 -16
  126. package/Pie.config.js.map +1 -1
  127. package/Pie.js +1205 -1205
  128. package/Pie.js.map +1 -1
  129. package/Punchcard.config.js +14 -14
  130. package/Punchcard.config.js.map +1 -1
  131. package/Punchcard.js +2584 -2700
  132. package/Punchcard.js.map +1 -1
  133. package/Rectangle.config.js +7 -7
  134. package/Rectangle.config.js.map +1 -1
  135. package/Rectangle.js +726 -726
  136. package/Rectangle.js.map +1 -1
  137. package/Sankey.config.js +18 -18
  138. package/Sankey.config.js.map +1 -1
  139. package/Sankey.js +3132 -3253
  140. package/Sankey.js.map +1 -1
  141. package/Scatter.config.js +24 -16
  142. package/Scatter.config.js.map +1 -1
  143. package/Scatter.js +1402 -1395
  144. package/Scatter.js.map +1 -1
  145. package/SingleValue.config.js +11 -10
  146. package/SingleValue.config.js.map +1 -1
  147. package/SingleValue.js +2208 -2208
  148. package/SingleValue.js.map +1 -1
  149. package/SingleValueBasic.js +32 -32
  150. package/SingleValueBasic.js.map +1 -1
  151. package/SingleValueIcon.config.js +11 -10
  152. package/SingleValueIcon.config.js.map +1 -1
  153. package/SingleValueIcon.js +825 -966
  154. package/SingleValueIcon.js.map +1 -1
  155. package/SingleValueRadial.config.js +11 -10
  156. package/SingleValueRadial.config.js.map +1 -1
  157. package/SingleValueRadial.js +1897 -1897
  158. package/SingleValueRadial.js.map +1 -1
  159. package/Table.config.js +7 -7
  160. package/Table.config.js.map +1 -1
  161. package/Table.js +2158 -2155
  162. package/Table.js.map +1 -1
  163. package/common/EventsDoc.js +15 -8
  164. package/common/EventsDoc.js.map +1 -1
  165. package/common/GaugeMajorTicks.js +2 -2
  166. package/common/GaugeValueMarker.js +2 -2
  167. package/common/OptionsDoc.js +8 -8
  168. package/common/OptionsDoc.js.map +1 -1
  169. package/common/ThemesDoc.js +2 -2
  170. package/common/utils/configUtils.js +3 -3
  171. package/common/utils/configUtils.js.map +1 -1
  172. package/common/utils/dataUtils.js +136 -0
  173. package/common/utils/dataUtils.js.map +1 -0
  174. package/common/utils/hocUtils.js +2 -2
  175. package/common/utils/hocUtils.js.map +1 -1
  176. package/common/utils/mapUtils.js +11 -10
  177. package/common/utils/mapUtils.js.map +1 -1
  178. package/common/utils/singleValueUtils.js +3 -2
  179. package/common/utils/singleValueUtils.js.map +1 -1
  180. package/common/utils/testHelper.js +8 -8
  181. package/common/utils/testHelper.js.map +1 -1
  182. package/common/withDashboardViz.js +2 -2
  183. package/common/withDashboardViz.js.map +1 -1
  184. package/package.json +15 -13
@@ -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 = 265);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 454);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -95,32 +95,39 @@ module.exports =
95
95
  /***/ 0:
96
96
  /***/ (function(module, exports) {
97
97
 
98
- module.exports = require("prop-types");
98
+ module.exports = require("react");
99
99
 
100
100
  /***/ }),
101
101
 
102
102
  /***/ 1:
103
103
  /***/ (function(module, exports) {
104
104
 
105
- module.exports = require("react");
105
+ module.exports = require("prop-types");
106
106
 
107
107
  /***/ }),
108
108
 
109
109
  /***/ 10:
110
110
  /***/ (function(module, exports) {
111
111
 
112
- module.exports = require("@babel/runtime/helpers/classCallCheck");
112
+ module.exports = require("@splunk/visualizations-shared/Message");
113
113
 
114
114
  /***/ }),
115
115
 
116
116
  /***/ 11:
117
117
  /***/ (function(module, exports) {
118
118
 
119
- module.exports = require("@splunk/visualizations-shared/colorUtils");
119
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
120
120
 
121
121
  /***/ }),
122
122
 
123
123
  /***/ 12:
124
+ /***/ (function(module, exports) {
125
+
126
+ module.exports = require("@splunk/visualizations-shared/colorUtils");
127
+
128
+ /***/ }),
129
+
130
+ /***/ 13:
124
131
  /***/ (function(module, exports, __webpack_require__) {
125
132
 
126
133
  "use strict";
@@ -130,15 +137,15 @@ Object.defineProperty(exports, "__esModule", {
130
137
  value: true
131
138
  });
132
139
 
133
- var React = __webpack_require__(1);
140
+ var React = __webpack_require__(0);
134
141
 
135
142
  var styled_components_1 = __webpack_require__(4);
136
143
 
137
- var SizeAwareWrapper_1 = __webpack_require__(19);
144
+ var SizeAwareWrapper_1 = __webpack_require__(20);
138
145
 
139
- var style_1 = __webpack_require__(14);
146
+ var style_1 = __webpack_require__(15);
140
147
 
141
- var colorUtils_1 = __webpack_require__(11);
148
+ var colorUtils_1 = __webpack_require__(12);
142
149
 
143
150
  var Item = styled_components_1.default.div.attrs(function (_ref) {
144
151
  var width = _ref.width;
@@ -195,7 +202,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
195
202
 
196
203
  return React.createElement(FixSizeItem, {
197
204
  "data-test": "fix-size-item",
198
- "data-splunk-visualization-version": "25.1.0 - 812a9a4d8",
205
+ "data-splunk-visualization-version": "25.3.0 - dae70ec02",
199
206
  width: width,
200
207
  height: height,
201
208
  backgroundColor: backgroundColor
@@ -217,7 +224,7 @@ exports.default = withFixedSizeContainer;
217
224
 
218
225
  /***/ }),
219
226
 
220
- /***/ 13:
227
+ /***/ 14:
221
228
  /***/ (function(module, exports, __webpack_require__) {
222
229
 
223
230
  "use strict";
@@ -250,29 +257,29 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
250
257
 
251
258
  /***/ }),
252
259
 
253
- /***/ 14:
260
+ /***/ 15:
254
261
  /***/ (function(module, exports) {
255
262
 
256
263
  module.exports = require("@splunk/visualizations-shared/style");
257
264
 
258
265
  /***/ }),
259
266
 
260
- /***/ 15:
267
+ /***/ 16:
261
268
  /***/ (function(module, exports) {
262
269
 
263
270
  module.exports = require("@splunk/visualizations-shared/schemaUtils");
264
271
 
265
272
  /***/ }),
266
273
 
267
- /***/ 16:
274
+ /***/ 17:
268
275
  /***/ (function(module, exports, __webpack_require__) {
269
276
 
270
277
  "use strict";
271
278
 
272
279
 
273
- var _toConsumableArray = __webpack_require__(7);
280
+ var _toConsumableArray = __webpack_require__(8);
274
281
 
275
- var _defineProperty = __webpack_require__(6);
282
+ var _defineProperty = __webpack_require__(7);
276
283
 
277
284
  var __rest = this && this.__rest || function (s, e) {
278
285
  var t = {};
@@ -294,9 +301,9 @@ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig
294
301
 
295
302
  var lodash_1 = __webpack_require__(3);
296
303
 
297
- var schemaUtils_1 = __webpack_require__(15);
304
+ var schemaUtils_1 = __webpack_require__(16);
298
305
 
299
- var VizBehavior_1 = __webpack_require__(5);
306
+ var VizBehavior_1 = __webpack_require__(6);
300
307
 
301
308
  var dynamicOptionsDSLType = {
302
309
  type: 'string',
@@ -372,7 +379,7 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
372
379
  */
373
380
 
374
381
  function enhanceConfig(vizConfig) {
375
- var enhancedConfig = vizConfig;
382
+ var enhancedConfig = Object.assign({}, vizConfig);
376
383
 
377
384
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
378
385
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
@@ -380,7 +387,7 @@ function enhanceConfig(vizConfig) {
380
387
 
381
388
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
382
389
  return Object.assign(Object.assign({}, config), {
383
- open: false
390
+ open: config.open || false
384
391
  });
385
392
  });
386
393
  return enhancedConfig;
@@ -395,7 +402,7 @@ exports.enhanceConfig = enhanceConfig;
395
402
  */
396
403
 
397
404
  function uncollapseEditorConfig(vizConfig) {
398
- var editorPanelUncollapsedConfig = vizConfig;
405
+ var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
399
406
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
400
407
  return Object.assign(Object.assign({}, config), {
401
408
  open: true
@@ -501,35 +508,42 @@ exports.insertLayout = insertLayout;
501
508
 
502
509
  /***/ }),
503
510
 
504
- /***/ 17:
511
+ /***/ 18:
505
512
  /***/ (function(module, exports) {
506
513
 
507
514
  module.exports = require("@splunk/visualizations-shared/configUtils");
508
515
 
509
516
  /***/ }),
510
517
 
511
- /***/ 18:
518
+ /***/ 19:
512
519
  /***/ (function(module, exports) {
513
520
 
514
521
  module.exports = require("@babel/runtime/helpers/createClass");
515
522
 
516
523
  /***/ }),
517
524
 
518
- /***/ 19:
525
+ /***/ 2:
526
+ /***/ (function(module, exports) {
527
+
528
+ module.exports = require("@splunk/ui-utils/i18n");
529
+
530
+ /***/ }),
531
+
532
+ /***/ 20:
519
533
  /***/ (function(module, exports) {
520
534
 
521
535
  module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
522
536
 
523
537
  /***/ }),
524
538
 
525
- /***/ 2:
539
+ /***/ 21:
526
540
  /***/ (function(module, exports) {
527
541
 
528
- module.exports = require("@splunk/ui-utils/i18n");
542
+ module.exports = require("@splunk/themes/pick");
529
543
 
530
544
  /***/ }),
531
545
 
532
- /***/ 20:
546
+ /***/ 22:
533
547
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
534
548
 
535
549
  "use strict";
@@ -564,17 +578,17 @@ __webpack_require__.r(__webpack_exports__);
564
578
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lighten", function() { return lighten; });
565
579
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "darken", function() { return darken; });
566
580
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "handleValueClickCallback", function() { return handleValueClickCallback; });
567
- /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6);
581
+ /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7);
568
582
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
569
583
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
570
584
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
571
- /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(26);
585
+ /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
572
586
  /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__);
573
- /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(48);
587
+ /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(49);
574
588
  /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__);
575
- /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23);
589
+ /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(24);
576
590
  /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__);
577
- /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(43);
591
+ /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(45);
578
592
  /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__);
579
593
 
580
594
 
@@ -1538,77 +1552,198 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
1538
1552
 
1539
1553
  /***/ }),
1540
1554
 
1541
- /***/ 21:
1542
- /***/ (function(module, exports) {
1543
-
1544
- module.exports = require("@splunk/themes/pick");
1545
-
1546
- /***/ }),
1547
-
1548
- /***/ 22:
1555
+ /***/ 23:
1549
1556
  /***/ (function(module, exports) {
1550
1557
 
1551
1558
  module.exports = require("@splunk/visualization-context/TimezoneContext");
1552
1559
 
1553
1560
  /***/ }),
1554
1561
 
1555
- /***/ 23:
1562
+ /***/ 24:
1556
1563
  /***/ (function(module, exports) {
1557
1564
 
1558
1565
  module.exports = require("@splunk/visualizations-shared/propUtils");
1559
1566
 
1560
1567
  /***/ }),
1561
1568
 
1562
- /***/ 24:
1569
+ /***/ 25:
1563
1570
  /***/ (function(module, exports) {
1564
1571
 
1565
1572
  module.exports = require("@splunk/visualizations-shared/hocUtils");
1566
1573
 
1567
1574
  /***/ }),
1568
1575
 
1569
- /***/ 25:
1576
+ /***/ 26:
1570
1577
  /***/ (function(module, exports) {
1571
1578
 
1572
1579
  module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1573
1580
 
1574
1581
  /***/ }),
1575
1582
 
1576
- /***/ 26:
1577
- /***/ (function(module, exports) {
1583
+ /***/ 27:
1584
+ /***/ (function(module, exports, __webpack_require__) {
1578
1585
 
1579
- module.exports = require("@splunk/visualizations-shared/numberUtils");
1586
+ "use strict";
1587
+
1588
+
1589
+ Object.defineProperty(exports, "__esModule", {
1590
+ value: true
1591
+ });
1592
+ exports.shouldShowIconPlaceholder = void 0;
1593
+
1594
+ var React = __webpack_require__(0);
1595
+
1596
+ var T = __webpack_require__(1);
1597
+
1598
+ var lodash_1 = __webpack_require__(3);
1599
+
1600
+ var i18n_1 = __webpack_require__(2);
1601
+
1602
+ var Message_1 = __webpack_require__(10);
1603
+
1604
+ var FixedSizeContainer_1 = __webpack_require__(13);
1605
+ /**
1606
+ * @method shouldShowIconPlaceholder
1607
+ * @param {object} dataSources
1608
+ * @param {boolean} loading
1609
+ * @returns {boolean}
1610
+ */
1611
+
1612
+
1613
+ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1614
+ var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1615
+ var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1616
+ var noData = data === undefined;
1617
+ var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1618
+ var noFields = fields === undefined;
1619
+ return loading || noData || noFields;
1620
+ };
1621
+
1622
+ exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1623
+ var propTypes = {
1624
+ icon: T.func,
1625
+ width: T.oneOfType([T.string, T.number]),
1626
+ height: T.oneOfType([T.string, T.number]),
1627
+ // eslint-disable-next-line react/no-unused-prop-types
1628
+ backgroundColor: T.string,
1629
+ iconColor: T.string
1630
+ };
1631
+ /**
1632
+ * @method IconPlaceholder
1633
+ * @param {IconPlaceholderProps} props
1634
+ * @returns {React.ReactElement}
1635
+ */
1636
+
1637
+ var IconPlaceholder = function IconPlaceholder(props) {
1638
+ var width = props.width,
1639
+ height = props.height,
1640
+ icon = props.icon,
1641
+ iconColor = props.iconColor;
1642
+
1643
+ if (icon) {
1644
+ return React.createElement(icon, {
1645
+ style: {
1646
+ left: '50%',
1647
+ top: '50%',
1648
+ color: iconColor,
1649
+ opacity: 0.15,
1650
+ position: 'absolute',
1651
+ transform: 'translate(-50%, -50%)'
1652
+ },
1653
+ width: '50%',
1654
+ height: '50%'
1655
+ });
1656
+ }
1657
+
1658
+ return React.createElement(Message_1.default, {
1659
+ width: width,
1660
+ height: height,
1661
+ level: "warning",
1662
+ message: i18n_1._('No DataSource Connected')
1663
+ });
1664
+ };
1665
+
1666
+ IconPlaceholder.propTypes = propTypes;
1667
+ IconPlaceholder.defaultProps = {
1668
+ width: '100%',
1669
+ height: 250
1670
+ };
1671
+ exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1580
1672
 
1581
1673
  /***/ }),
1582
1674
 
1583
- /***/ 265:
1675
+ /***/ 28:
1584
1676
  /***/ (function(module, exports, __webpack_require__) {
1585
1677
 
1586
1678
  "use strict";
1587
1679
 
1588
1680
 
1681
+ var _defineProperty = __webpack_require__(7);
1682
+
1589
1683
  Object.defineProperty(exports, "__esModule", {
1590
1684
  value: true
1591
1685
  });
1592
- exports.PureSingleValueRadialThemes = exports.PureSingleValueRadial = exports.config = void 0;
1593
-
1594
- var SingleValueRadial_1 = __webpack_require__(282);
1686
+ exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1595
1687
 
1596
- var withDashboardViz_1 = __webpack_require__(31);
1688
+ var T = __webpack_require__(1);
1597
1689
 
1598
- var config_1 = __webpack_require__(266);
1690
+ var lodash_1 = __webpack_require__(3);
1599
1691
 
1600
- exports.config = config_1.default;
1601
- exports.PureSingleValueRadial = SingleValueRadial_1.default; // TODO: proper theming support for SVR when we come back to SVR viz
1692
+ var DataSource_1 = __webpack_require__(39);
1602
1693
 
1603
- exports.PureSingleValueRadialThemes = {};
1604
- exports.default = withDashboardViz_1.default({
1605
- ReactViz: SingleValueRadial_1.default,
1606
- vizConfig: config_1.default
1694
+ exports.SortParamsPropTypes = T.shape({
1695
+ currentSortKey: T.string,
1696
+ currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1697
+ onSort: T.func
1607
1698
  });
1608
1699
 
1700
+ var getSortingParams = function getSortingParams(_ref) {
1701
+ var requestParams = _ref.requestParams,
1702
+ onRequestParamsChange = _ref.onRequestParamsChange;
1703
+ var currentSortKey;
1704
+ var currentSortDir;
1705
+ var nextSortDirMap = {
1706
+ asc: 'desc',
1707
+ desc: 'asc',
1708
+ none: 'asc'
1709
+ };
1710
+ var onSort;
1711
+
1712
+ if (lodash_1.isFunction(onRequestParamsChange)) {
1713
+ if (requestParams && lodash_1.has(requestParams, 'sort')) {
1714
+ currentSortKey = Object.keys(requestParams.sort).shift();
1715
+ currentSortDir = requestParams.sort[currentSortKey];
1716
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1717
+
1718
+
1719
+ onSort = function onSort(e, _ref2) {
1720
+ var sortKey = _ref2.sortKey,
1721
+ sortDir = _ref2.sortDir;
1722
+
1723
+ if (typeof sortKey === 'string') {
1724
+ var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1725
+ onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1726
+ offset: 0,
1727
+ sort: _defineProperty({}, sortKey, nextSortDir)
1728
+ }));
1729
+ } else {
1730
+ onRequestParamsChange(requestParams);
1731
+ }
1732
+ };
1733
+ }
1734
+
1735
+ return {
1736
+ currentSortKey: currentSortKey,
1737
+ currentSortDir: currentSortDir,
1738
+ onSort: onSort
1739
+ };
1740
+ };
1741
+
1742
+ exports.getSortingParams = getSortingParams;
1743
+
1609
1744
  /***/ }),
1610
1745
 
1611
- /***/ 266:
1746
+ /***/ 29:
1612
1747
  /***/ (function(module, exports, __webpack_require__) {
1613
1748
 
1614
1749
  "use strict";
@@ -1617,432 +1752,77 @@ exports.default = withDashboardViz_1.default({
1617
1752
  Object.defineProperty(exports, "__esModule", {
1618
1753
  value: true
1619
1754
  });
1755
+ exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1620
1756
 
1621
- var i18n_1 = __webpack_require__(2);
1757
+ var T = __webpack_require__(1);
1622
1758
 
1623
- var schemaUtils_1 = __webpack_require__(15);
1759
+ var lodash_1 = __webpack_require__(3);
1624
1760
 
1625
- var pick_1 = __webpack_require__(21);
1761
+ exports.PaginatorParamsPropTypes = T.shape({
1762
+ isPaging: T.bool,
1763
+ current: T.number,
1764
+ totalPages: T.number,
1765
+ onChange: T.func
1766
+ });
1626
1767
 
1627
- var variables_1 = __webpack_require__(8);
1768
+ var getPaginationParams = function getPaginationParams(_ref) {
1769
+ var requestParams = _ref.requestParams,
1770
+ meta = _ref.meta,
1771
+ onRequestParamsChange = _ref.onRequestParamsChange;
1772
+ var totalCount = meta && meta.totalCount || 0;
1773
+ var offset = requestParams && requestParams.offset || 0;
1774
+ var count = requestParams && requestParams.count;
1775
+ var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1776
+ var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1777
+ var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
1628
1778
 
1629
- var PresetPalettes_1 = __webpack_require__(53);
1779
+ var onChangeHandler = function onChangeHandler(e, _ref2) {
1780
+ var page = _ref2.page,
1781
+ countArg = _ref2.count;
1782
+ var newParams = lodash_1.cloneDeep(requestParams);
1630
1783
 
1631
- var visualization_icons_1 = __webpack_require__(46);
1784
+ if (typeof countArg === 'number') {
1785
+ newParams.count = countArg;
1786
+ newParams.offset = 0;
1787
+ }
1632
1788
 
1633
- var placeholders_1 = __webpack_require__(45);
1789
+ var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1634
1790
 
1635
- var VizBehavior_1 = __webpack_require__(5);
1791
+ if (typeof page === 'number' && page > 0) {
1792
+ newParams.count = pageCount;
1793
+ newParams.offset = (page - 1) * pageCount;
1794
+ }
1636
1795
 
1637
- var configUtils_1 = __webpack_require__(16);
1796
+ onRequestParamsChange(newParams);
1797
+ };
1638
1798
 
1639
- var VizCategory_1 = __webpack_require__(30);
1799
+ return {
1800
+ isPaging: isPaging,
1801
+ current: current,
1802
+ totalPages: totalPages,
1803
+ onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
1804
+ };
1805
+ };
1640
1806
 
1641
- var DynamicMajorColorEditor_1 = __webpack_require__(83);
1807
+ exports.getPaginationParams = getPaginationParams;
1642
1808
 
1643
- var DynamicTrendColorEditor_1 = __webpack_require__(84);
1809
+ /***/ }),
1644
1810
 
1645
- var DynamicBackgroundColorEditor_1 = __webpack_require__(85);
1811
+ /***/ 3:
1812
+ /***/ (function(module, exports) {
1646
1813
 
1647
- var StaticMajorColorEditor_1 = __webpack_require__(86);
1814
+ module.exports = require("lodash");
1648
1815
 
1649
- var StaticTrendColorEditor_1 = __webpack_require__(87);
1816
+ /***/ }),
1650
1817
 
1651
- var StaticBackgroundColorEditor_1 = __webpack_require__(77);
1818
+ /***/ 30:
1819
+ /***/ (function(module, exports) {
1652
1820
 
1653
- var RadialBackgroundColor_1 = __webpack_require__(267);
1654
-
1655
- var dataContract = {
1656
- requiredDataSources: [{
1657
- name: 'primary',
1658
- description: 'DataSource that powers the visualization'
1659
- }],
1660
- optionalDataSources: [],
1661
- initialRequestParams: {
1662
- primary: {
1663
- offset: 0,
1664
- count: 10000
1665
- }
1666
- }
1667
- };
1668
- var size = {
1669
- initialWidth: 250,
1670
- initialHeight: 250
1671
- };
1672
- var defaultContext = {
1673
- trendColorConfig: [{
1674
- to: 0,
1675
- value: '#9E2520'
1676
- }, {
1677
- from: 0,
1678
- value: '#1C6B2D'
1679
- }],
1680
- majorColorConfig: [{
1681
- to: 20,
1682
- value: '#D41F1F'
1683
- }, {
1684
- from: 20,
1685
- to: 40,
1686
- value: '#D94E17'
1687
- }, {
1688
- from: 40,
1689
- to: 60,
1690
- value: '#CBA700'
1691
- }, {
1692
- from: 60,
1693
- to: 80,
1694
- value: '#669922'
1695
- }, {
1696
- from: 80,
1697
- value: '#118832'
1698
- }],
1699
- majorColorMatchConfig: [{
1700
- match: '',
1701
- value: '#5C33FF'
1702
- }]
1703
- };
1704
- var optionsSchema = {
1705
- backgroundColor: {
1706
- default: '> themes.defaultBackgroundColor',
1707
- description: 'Specify the color for the background. The hex value format should be “#ffffff”. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
1708
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1709
- type: 'string'
1710
- },
1711
- majorColor: {
1712
- default: '> themes.defaultFontColor',
1713
- 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)".',
1714
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1715
- type: 'string'
1716
- },
1717
- majorValue: {
1718
- default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | lastPoint()',
1719
- description: 'Specify the dataSource applied to the major value.',
1720
- type: ['string', 'number']
1721
- },
1722
- majorValueField: {
1723
- default: '> majorValue | getField()',
1724
- description: 'Specify the field that should be mapped to the major value.',
1725
- type: 'string'
1726
- },
1727
- maxValue: {
1728
- default: 100,
1729
- description: 'Specify the value the radial fills up to.',
1730
- type: 'number'
1731
- },
1732
- numberPrecision: {
1733
- default: 0,
1734
- maximum: 20,
1735
- minimum: 0,
1736
- description: 'Specify the number of decimal places to display. For example, to display 3 decimal places, use a value of 3. The maximum value is 20.',
1737
- type: 'number'
1738
- },
1739
- radialBackgroundColor: {
1740
- default: '> themes.defaultRadialBackgroundColor',
1741
- description: 'Specify the color for the radial background. The hex value format should be “#ffffff”. The default for enterprise light is "rgba(0, 0, 0, 0.1)". The default for enterprise dark is "rgba(255, 255, 255, 0.15)". The default for prisma dark is "rgba(255, 255, 255, 0.15)".',
1742
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1743
- type: 'string'
1744
- },
1745
- radialStrokeColor: {
1746
- default: '> majorColor',
1747
- description: 'Specify the color for the radial. 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)".',
1748
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1749
- type: 'string'
1750
- },
1751
- shouldAbbreviateTrendValue: {
1752
- default: false,
1753
- description: 'Specify whether to abbreviate the trend value to 2 decimal points. A magnitude unit will be displayed.',
1754
- type: 'boolean'
1755
- },
1756
- shouldUseThousandSeparators: {
1757
- default: true,
1758
- description: 'Specify whether numeric values use commas as thousandths separaters.',
1759
- type: 'boolean'
1760
- },
1761
- trendColor: {
1762
- default: '> themes.defaultFontColor',
1763
- description: 'Specify the color for the trend 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)".',
1764
- pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
1765
- type: 'string'
1766
- },
1767
- trendDisplay: {
1768
- default: 'absolute',
1769
- description: 'Specify how to display the trend value.',
1770
- pattern: schemaUtils_1.getPattern(['percent', 'absolute', 'off']),
1771
- type: 'string'
1772
- },
1773
- trendValue: {
1774
- default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | delta(-2)',
1775
- description: 'Specify the dataSource applied to the trend value.',
1776
- type: 'number'
1777
- },
1778
- underLabel: {
1779
- description: 'Specify the text that appears below the major value.',
1780
- type: 'string'
1781
- },
1782
- unit: {
1783
- description: 'Specify text to show next to the major value.',
1784
- type: 'string'
1785
- },
1786
- unitPosition: {
1787
- default: 'after',
1788
- description: 'Specify whether the unit text should appear before or after the major value.',
1789
- pattern: schemaUtils_1.getPattern(['before', 'after']),
1790
- type: 'string'
1791
- }
1792
- };
1793
- var basePresetContext = {
1794
- majorColorEditorConfig: undefined,
1795
- trendColorEditorConfig: undefined,
1796
- backgroundColorEditorConfig: undefined
1797
- };
1798
- var basePresetOptions = {
1799
- majorColor: undefined,
1800
- trendColor: undefined,
1801
- backgroundColor: undefined
1802
- };
1803
- var presets = [{
1804
- // dummy context variables to allow for resetting of unused context states
1805
- label: i18n_1._('None'),
1806
- name: 'singleValueRadial.none',
1807
- value: {
1808
- context: Object.assign({}, basePresetContext),
1809
- options: Object.assign({}, basePresetOptions)
1810
- }
1811
- }, {
1812
- label: i18n_1._('Major Value'),
1813
- name: 'singleValueRadial.majorValue',
1814
- value: {
1815
- context: Object.assign(Object.assign({}, basePresetContext), {
1816
- majorColorEditorConfig: defaultContext.majorColorConfig
1817
- }),
1818
- options: Object.assign(Object.assign({}, basePresetOptions), {
1819
- majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
1820
- })
1821
- }
1822
- }, {
1823
- label: i18n_1._('Major Value & Trend'),
1824
- name: 'singleValueRadial.majorValueAndTrend',
1825
- value: {
1826
- context: Object.assign(Object.assign({}, basePresetContext), {
1827
- majorColorEditorConfig: defaultContext.majorColorConfig,
1828
- trendColorEditorConfig: defaultContext.trendColorConfig
1829
- }),
1830
- options: Object.assign(Object.assign({}, basePresetOptions), {
1831
- majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
1832
- trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
1833
- })
1834
- }
1835
- }, {
1836
- label: i18n_1._('Trend'),
1837
- name: 'singleValueRadial.trend',
1838
- value: {
1839
- context: Object.assign(Object.assign({}, basePresetContext), {
1840
- trendColorEditorConfig: defaultContext.trendColorConfig
1841
- }),
1842
- options: Object.assign(Object.assign({}, basePresetOptions), {
1843
- trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
1844
- })
1845
- }
1846
- }, {
1847
- label: i18n_1._('Background'),
1848
- name: 'singleValueRadial.background',
1849
- value: {
1850
- context: Object.assign(Object.assign({}, basePresetContext), {
1851
- backgroundColorEditorConfig: defaultContext.majorColorConfig
1852
- }),
1853
- options: Object.assign(Object.assign({}, basePresetOptions), {
1854
- backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
1855
- })
1856
- }
1857
- }];
1858
- var themes = {
1859
- defaultFontColor: function defaultFontColor(props) {
1860
- return pick_1.default({
1861
- enterprise: {
1862
- dark: variables_1.default.white(props),
1863
- light: variables_1.default.black(props)
1864
- },
1865
- prisma: variables_1.default.contentColorActive(props)
1866
- })(props);
1867
- },
1868
- defaultBackgroundColor: function defaultBackgroundColor(props) {
1869
- return pick_1.default({
1870
- enterprise: {
1871
- dark: variables_1.default.black(props),
1872
- light: variables_1.default.white(props)
1873
- },
1874
- prisma: variables_1.default.backgroundColorSidebar(props)
1875
- })(props);
1876
- },
1877
- defaultRadialBackgroundColor: function defaultRadialBackgroundColor(props) {
1878
- return pick_1.default({
1879
- enterprise: {
1880
- dark: 'rgba(255, 255, 255, 0.15)',
1881
- light: 'rgba(0, 0, 0, 0.1)'
1882
- },
1883
- prisma: variables_1.default.interactiveColorBackgroundDisabled(props)
1884
- })(props);
1885
- }
1886
- };
1887
- var editorConfig = [{
1888
- label: i18n_1._('Major Value & Trend'),
1889
- layout: [[{
1890
- label: 'Unit Position',
1891
- option: 'unitPosition',
1892
- editor: 'editor.select',
1893
- editorProps: {
1894
- values: [{
1895
- label: i18n_1._('Before'),
1896
- value: 'before'
1897
- }, {
1898
- label: i18n_1._('After'),
1899
- value: 'after'
1900
- }]
1901
- }
1902
- }, {
1903
- label: i18n_1._('Unit Label'),
1904
- option: 'unit',
1905
- editor: 'editor.text'
1906
- }], [{
1907
- label: i18n_1._('Precision'),
1908
- option: 'numberPrecision',
1909
- editor: 'editor.number',
1910
- editorProps: {
1911
- min: 0,
1912
- max: 20
1913
- }
1914
- }, {
1915
- label: i18n_1._('Trend Display'),
1916
- option: 'trendDisplay',
1917
- editor: 'editor.select',
1918
- editorProps: {
1919
- values: [{
1920
- label: i18n_1._('Percent'),
1921
- value: 'percent'
1922
- }, {
1923
- label: i18n_1._('Absolute'),
1924
- value: 'absolute'
1925
- }, {
1926
- label: i18n_1._('Off'),
1927
- value: 'off'
1928
- }]
1929
- }
1930
- }]]
1931
- }, {
1932
- label: i18n_1._('Coloring'),
1933
- layout: [[{
1934
- label: 'Dynamic Elements',
1935
- key: 'presetSelector',
1936
- editor: 'editor.presetSelector',
1937
- editorProps: {
1938
- presets: presets,
1939
- value: function value(_ref) {
1940
- var context = _ref.context,
1941
- options = _ref.options;
1942
- var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
1943
- return initialPreset && initialPreset.label || null;
1944
- }
1945
- }
1946
- }], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
1947
- editorProps: {
1948
- labelPosition: 'left',
1949
- themes: themes
1950
- }
1951
- })], [DynamicMajorColorEditor_1.getDynamicMajorColorEditor({
1952
- defaultContext: defaultContext,
1953
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1954
- })], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
1955
- editorProps: {
1956
- labelPosition: 'left',
1957
- themes: themes
1958
- }
1959
- })], [DynamicTrendColorEditor_1.getDynamicTrendColorEditor({
1960
- defaultContext: defaultContext,
1961
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1962
- })], RadialBackgroundColor_1.default({
1963
- labelPosition: 'left',
1964
- themes: themes
1965
- }), [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
1966
- editorProps: {
1967
- labelPosition: 'left',
1968
- themes: themes
1969
- }
1970
- })], [DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor({
1971
- defaultContext: defaultContext,
1972
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
1973
- })]]
1974
- }];
1975
- /**
1976
- * visualization configuration
1977
- */
1978
-
1979
- var config = {
1980
- /**
1981
- * unique viz key
1982
- */
1983
- key: 'splunk.singlevalueradial',
1984
-
1985
- /**
1986
- * viz name
1987
- */
1988
- name: 'Single Value Radial',
1989
- category: VizCategory_1.VizCategory.SINGLE_VALUE,
1990
-
1991
- /**
1992
- * viz icon
1993
- */
1994
- icon: visualization_icons_1.SingleValueRadial,
1995
- placeholderIcon: placeholders_1.SingleValueRadial,
1996
- dataContract: dataContract,
1997
- size: size,
1998
- defaultContext: defaultContext,
1999
- optionsSchema: optionsSchema,
2000
- editorConfig: editorConfig,
2001
- events: {
2002
- 'value.click': {
2003
- description: 'trigger when user clicks major value',
2004
- payloadKeys: ['majorValue', 'trendValue']
2005
- }
2006
- },
2007
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
2008
- themes: themes
2009
- };
2010
- exports.default = configUtils_1.enhanceConfig(config);
2011
-
2012
- /***/ }),
2013
-
2014
- /***/ 267:
2015
- /***/ (function(module, exports, __webpack_require__) {
2016
-
2017
- "use strict";
2018
-
2019
-
2020
- Object.defineProperty(exports, "__esModule", {
2021
- value: true
2022
- });
2023
-
2024
- var i18n_1 = __webpack_require__(2);
2025
-
2026
- var radialBackground = function radialBackground(_ref) {
2027
- var label = _ref.label,
2028
- themes = _ref.themes,
2029
- labelPosition = _ref.labelPosition;
2030
- return [{
2031
- label: i18n_1._(label || 'Radial Background'),
2032
- option: 'radialBackgroundColor',
2033
- editor: 'editor.color',
2034
- editorProps: {
2035
- labelPosition: labelPosition || 'top',
2036
- themes: themes
2037
- }
2038
- }];
2039
- };
2040
-
2041
- exports.default = radialBackground;
1821
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
2042
1822
 
2043
1823
  /***/ }),
2044
1824
 
2045
- /***/ 27:
1825
+ /***/ 31:
2046
1826
  /***/ (function(module, exports, __webpack_require__) {
2047
1827
 
2048
1828
  "use strict";
@@ -2051,855 +1831,639 @@ exports.default = radialBackground;
2051
1831
  Object.defineProperty(exports, "__esModule", {
2052
1832
  value: true
2053
1833
  });
2054
- exports.shouldShowIconPlaceholder = void 0;
2055
-
2056
- var React = __webpack_require__(1);
2057
-
2058
- var T = __webpack_require__(0);
2059
-
2060
- var lodash_1 = __webpack_require__(3);
2061
-
2062
- var i18n_1 = __webpack_require__(2);
2063
-
2064
- var Message_1 = __webpack_require__(9);
2065
-
2066
- var FixedSizeContainer_1 = __webpack_require__(12);
2067
- /**
2068
- * @method shouldShowIconPlaceholder
2069
- * @param {object} dataSources
2070
- * @param {boolean} loading
2071
- * @returns {boolean}
2072
- */
2073
-
2074
-
2075
- var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
2076
- var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
2077
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
2078
- var noData = data === undefined;
2079
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
2080
- var noFields = fields === undefined;
2081
- return loading || noData || noFields;
2082
- };
2083
-
2084
- exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
2085
- var propTypes = {
2086
- icon: T.func,
2087
- width: T.oneOfType([T.string, T.number]),
2088
- height: T.oneOfType([T.string, T.number]),
2089
- // eslint-disable-next-line react/no-unused-prop-types
2090
- backgroundColor: T.string,
2091
- iconColor: T.string
2092
- };
2093
- /**
2094
- * @method IconPlaceholder
2095
- * @param {IconPlaceholderProps} props
2096
- * @returns {React.ReactElement}
2097
- */
2098
-
2099
- var IconPlaceholder = function IconPlaceholder(props) {
2100
- var width = props.width,
2101
- height = props.height,
2102
- icon = props.icon,
2103
- iconColor = props.iconColor;
2104
-
2105
- if (icon) {
2106
- return React.createElement(icon, {
2107
- style: {
2108
- left: '50%',
2109
- top: '50%',
2110
- color: iconColor,
2111
- opacity: 0.15,
2112
- position: 'absolute',
2113
- transform: 'translate(-50%, -50%)'
2114
- },
2115
- width: '50%',
2116
- height: '50%'
2117
- });
2118
- }
2119
-
2120
- return React.createElement(Message_1.default, {
2121
- width: width,
2122
- height: height,
2123
- level: "warning",
2124
- message: i18n_1._('No DataSource Connected')
2125
- });
2126
- };
1834
+ exports.VizCategory = void 0;
1835
+ var VizCategory;
2127
1836
 
2128
- IconPlaceholder.propTypes = propTypes;
2129
- IconPlaceholder.defaultProps = {
2130
- width: '100%',
2131
- height: 250
2132
- };
2133
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1837
+ (function (VizCategory) {
1838
+ VizCategory["SINGLE_VALUE"] = "Single Value";
1839
+ VizCategory["TRENDS"] = "Trends";
1840
+ VizCategory["COMPARISONS"] = "Comparisons";
1841
+ VizCategory["TABLE"] = "Table";
1842
+ VizCategory["GAUGE"] = "Gauge";
1843
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
1844
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
1845
+ VizCategory["SHAPES"] = "Shapes";
1846
+ VizCategory["MISC"] = "misc";
1847
+ VizCategory["FLOW"] = "Flow";
1848
+ VizCategory["CORRELATION"] = "Correlation";
1849
+ VizCategory["SPATIAL"] = "Spatial";
1850
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
2134
1851
 
2135
1852
  /***/ }),
2136
1853
 
2137
- /***/ 28:
1854
+ /***/ 32:
2138
1855
  /***/ (function(module, exports, __webpack_require__) {
2139
1856
 
2140
1857
  "use strict";
2141
1858
 
2142
1859
 
2143
- var _defineProperty = __webpack_require__(6);
2144
-
2145
1860
  Object.defineProperty(exports, "__esModule", {
2146
1861
  value: true
2147
1862
  });
2148
- exports.getSortingParams = exports.SortParamsPropTypes = void 0;
2149
1863
 
2150
- var T = __webpack_require__(0);
1864
+ var React = __webpack_require__(0);
2151
1865
 
2152
1866
  var lodash_1 = __webpack_require__(3);
2153
1867
 
2154
- var DataSource_1 = __webpack_require__(38);
1868
+ var getSettingsFromThemedProps_1 = __webpack_require__(33);
2155
1869
 
2156
- exports.SortParamsPropTypes = T.shape({
2157
- currentSortKey: T.string,
2158
- currentSortDir: T.oneOf(DataSource_1.validSortDirs),
2159
- onSort: T.func
2160
- });
1870
+ var Options_1 = __webpack_require__(34);
2161
1871
 
2162
- var getSortingParams = function getSortingParams(_ref) {
2163
- var requestParams = _ref.requestParams,
2164
- onRequestParamsChange = _ref.onRequestParamsChange;
2165
- var currentSortKey;
2166
- var currentSortDir;
2167
- var nextSortDirMap = {
2168
- asc: 'desc',
2169
- desc: 'asc',
2170
- none: 'asc'
2171
- };
2172
- var onSort;
1872
+ var SanitizeProps_1 = __webpack_require__(35);
2173
1873
 
2174
- if (lodash_1.isFunction(onRequestParamsChange)) {
2175
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
2176
- currentSortKey = Object.keys(requestParams.sort).shift();
2177
- currentSortDir = requestParams.sort[currentSortKey];
2178
- } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1874
+ var TimezoneContext_1 = __webpack_require__(23);
2179
1875
 
1876
+ var moment_1 = __webpack_require__(36);
2180
1877
 
2181
- onSort = function onSort(e, _ref2) {
2182
- var sortKey = _ref2.sortKey,
2183
- sortDir = _ref2.sortDir;
1878
+ var styled_components_1 = __webpack_require__(4);
2184
1879
 
2185
- if (typeof sortKey === 'string') {
2186
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
2187
- onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
2188
- offset: 0,
2189
- sort: _defineProperty({}, sortKey, nextSortDir)
2190
- }));
2191
- } else {
2192
- onRequestParamsChange(requestParams);
1880
+ var hocUtils_1 = __webpack_require__(25);
1881
+
1882
+ var JSONSchemaUtils_1 = __webpack_require__(26);
1883
+
1884
+ var SplunkVisualization_1 = __webpack_require__(37);
1885
+
1886
+ var VizBehavior_1 = __webpack_require__(6);
1887
+
1888
+ var getSorting_1 = __webpack_require__(28);
1889
+
1890
+ var getPagination_1 = __webpack_require__(29);
1891
+
1892
+ var useDeepMemo_1 = __webpack_require__(40);
1893
+
1894
+ var MissingPropsMessage_1 = __webpack_require__(41);
1895
+
1896
+ var withEditModeCover_1 = __webpack_require__(42);
1897
+
1898
+ var withPlaceholder_1 = __webpack_require__(43);
1899
+ /**
1900
+ * hoc that wraps a pure react visualization in a Dashboard visualization
1901
+ * @param {DashboardVizOpts} opts
1902
+ * @returns {HOC}
1903
+ */
1904
+
1905
+
1906
+ var withDashboardViz = function withDashboardViz(opts) {
1907
+ var ReactViz = opts.ReactViz,
1908
+ vizConfig = opts.vizConfig,
1909
+ _opts$computeVizProps = opts.computeVizProps,
1910
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1911
+ disableEditModeCover = opts.disableEditModeCover,
1912
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1913
+
1914
+ var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1915
+ var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1916
+
1917
+ var DashboardViz = function DashboardViz(props) {
1918
+ var mode = props.mode,
1919
+ hasEventHandlers = props.hasEventHandlers,
1920
+ dataSources = props.dataSources,
1921
+ options = props.options,
1922
+ _props$context = props.context,
1923
+ context = _props$context === void 0 ? {} : _props$context,
1924
+ width = props.width,
1925
+ height = props.height,
1926
+ onComputedProps = props.onComputedProps,
1927
+ onEventTrigger = props.onEventTrigger,
1928
+ theme = props.theme,
1929
+ onRequestParamsChange = props.onRequestParamsChange;
1930
+
1931
+ var _React$useContext = React.useContext(TimezoneContext_1.default),
1932
+ serializedTimezone = _React$useContext.serializedTimezone;
1933
+
1934
+ if (serializedTimezone) {
1935
+ /*
1936
+ @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
1937
+ This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
1938
+ will use it.
1939
+ @TODO(pwied):
1940
+ - remove when we moved away from @splunk/moment
1941
+ - provide timezone context to dynamic option evaluation phase
1942
+ */
1943
+ if (!moment_1.default.getDefaultSplunkTimezone()) {
1944
+ moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
2193
1945
  }
1946
+ }
1947
+
1948
+ var themeFunc = function themeFunc(themeVar) {
1949
+ var _a, _b;
1950
+
1951
+ return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
2194
1952
  };
2195
- }
2196
1953
 
2197
- return {
2198
- currentSortKey: currentSortKey,
2199
- currentSortDir: currentSortDir,
2200
- onSort: onSort
2201
- };
2202
- };
1954
+ var bgColorFromTheme = themeFunc('defaultBackgroundColor');
2203
1955
 
2204
- exports.getSortingParams = getSortingParams;
1956
+ var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1957
+ theme: theme
1958
+ }),
1959
+ currentThemeFamily = _getSettingsFromTheme.family,
1960
+ currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1961
+ currentThemeDensity = _getSettingsFromTheme.density;
2205
1962
 
2206
- /***/ }),
1963
+ var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
2207
1964
 
2208
- /***/ 282:
2209
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
1965
+ evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1966
+ try {
1967
+ return Options_1.Options.evaluate({
1968
+ context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1969
+ options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1970
+ }, dataSources, themeFunc);
1971
+ } catch (e) {
1972
+ // eslint-disable-next-line no-console
1973
+ console.error("unexpected error evaluating options: + ".concat(e.message));
1974
+ return {};
1975
+ }
1976
+ }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
1977
+ // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
2210
1978
 
2211
- "use strict";
2212
- // ESM COMPAT FLAG
2213
- __webpack_require__.r(__webpack_exports__);
1979
+ React.useEffect(function () {
1980
+ onComputedProps(evaluatedOptions);
1981
+ }); // present warning message if any required props are missing
2214
1982
 
2215
- // EXTERNAL MODULE: external "@babel/runtime/helpers/extends"
2216
- var extends_ = __webpack_require__(47);
2217
- var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
1983
+ var _vizConfig$requiredPr = vizConfig.requiredProps,
1984
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1985
+ supports = vizConfig.supports;
1986
+ var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
2218
1987
 
2219
- // EXTERNAL MODULE: external "react"
2220
- var external_react_ = __webpack_require__(1);
2221
- var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
1988
+ if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
1989
+ return React.createElement(MissingPropsMessage_1.default, {
1990
+ "data-test": "missing-props-message",
1991
+ width: width,
1992
+ height: height,
1993
+ missingProps: missing,
1994
+ backgroundColor: bgColorFromTheme
1995
+ });
1996
+ } // events
2222
1997
 
2223
- // EXTERNAL MODULE: external "prop-types"
2224
- var external_prop_types_ = __webpack_require__(0);
2225
- var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
2226
1998
 
2227
- // EXTERNAL MODULE: external "@splunk/themes/pick"
2228
- var pick_ = __webpack_require__(21);
2229
- var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
1999
+ var eventCallbackProps = {};
2230
2000
 
2231
- // EXTERNAL MODULE: external "@splunk/themes/variables"
2232
- var variables_ = __webpack_require__(8);
2233
- var variables_default = /*#__PURE__*/__webpack_require__.n(variables_);
2001
+ if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
2002
+ var supportedEvents = vizConfig.events;
2003
+ Object.keys(supportedEvents).forEach(function (eventName) {
2004
+ var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
2005
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
2006
+ // then remove these lines
2234
2007
 
2235
- // EXTERNAL MODULE: external "styled-components"
2236
- var external_styled_components_ = __webpack_require__(4);
2237
- var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
2008
+ var payloadKeys = supportedEvents[eventName].payloadKeys;
2009
+ var payload = {};
2238
2010
 
2239
- // EXTERNAL MODULE: external "lodash/pick"
2240
- var external_lodash_pick_ = __webpack_require__(70);
2241
- var external_lodash_pick_default = /*#__PURE__*/__webpack_require__.n(external_lodash_pick_);
2011
+ if (Array.isArray(payloadKeys) && payloadKeys.length) {
2012
+ payloadKeys.forEach(function (p) {
2013
+ payload[p] = evaluatedOptions[p];
2014
+ });
2015
+ }
2242
2016
 
2243
- // EXTERNAL MODULE: external "lodash/isEmpty"
2244
- var isEmpty_ = __webpack_require__(71);
2245
- var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
2017
+ eventCallbackProps[eventCallbackPropName] = function (ev) {
2018
+ if (ev && ev.payload) {
2019
+ payload = ev.payload;
2020
+ }
2246
2021
 
2247
- // EXTERNAL MODULE: external "@splunk/visualizations-shared/style"
2248
- var style_ = __webpack_require__(14);
2022
+ return onEventTrigger({
2023
+ originalEvent: ev,
2024
+ payload: payload,
2025
+ type: eventName
2026
+ });
2027
+ };
2028
+ });
2029
+ } // compute pure viz props which are not from options
2249
2030
 
2250
- // EXTERNAL MODULE: external "@splunk/visualizations-shared/SizeAwareWrapper"
2251
- var SizeAwareWrapper_ = __webpack_require__(19);
2252
- var SizeAwareWrapper_default = /*#__PURE__*/__webpack_require__.n(SizeAwareWrapper_);
2253
2031
 
2254
- // EXTERNAL MODULE: ./src/common/components/VizStyleWrapper.jsx
2255
- var VizStyleWrapper = __webpack_require__(62);
2032
+ var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
2033
+ themeFunc: themeFunc
2034
+ }));
2035
+ /**
2036
+ * PAGE_AND_SORT behavior
2037
+ *
2038
+ * Some visualizations, like table, requires metadata about the datasource,
2039
+ * like total number of results, current count, offset, and sort, for rendering
2040
+ * paginator and sorting direction. In this approach, the visualization
2041
+ * allow users to set 'paginateDataSourceKey' to select which datasource
2042
+ * should the visualization extract the metadata from. It defaults to 'primary' datasource.
2043
+ * The visualization config should set the PAGE_AND_SORT behavior to receive
2044
+ * 'requestParams', 'meta' and onRequestParams callback as props.
2045
+ *
2046
+ * In future, we could automatically detect which all datasources are being used
2047
+ * and bind those magically to pagination/sorting behavior.
2048
+ */
2049
+
2050
+ var dataSourceMetadata = {};
2051
+ var OptionKey = 'paginateDataSourceKey';
2052
+ var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
2053
+
2054
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
2055
+ var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
2056
+ var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
2057
+
2058
+ var handleRequestParamsChange = function handleRequestParamsChange(payload) {
2059
+ return onRequestParamsChange(paginateDataSourceKey, payload);
2060
+ };
2061
+
2062
+ var sortParams = getSorting_1.getSortingParams({
2063
+ requestParams: requestParams,
2064
+ meta: meta,
2065
+ onRequestParamsChange: handleRequestParamsChange
2066
+ });
2067
+ var paginatorParams = getPagination_1.getPaginationParams({
2068
+ requestParams: requestParams,
2069
+ meta: meta,
2070
+ onRequestParamsChange: handleRequestParamsChange
2071
+ });
2072
+ dataSourceMetadata = {
2073
+ sortParams: sortParams,
2074
+ paginatorParams: paginatorParams
2075
+ };
2076
+ }
2077
+
2078
+ return React.createElement(SanitizedReactViz, Object.assign({
2079
+ mode: mode,
2080
+ width: width,
2081
+ height: height
2082
+ }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
2083
+ };
2084
+
2085
+ DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
2086
+ DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
2087
+ // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
2088
+ theme: {}
2089
+ }); // attach viz config
2090
+
2091
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
2256
2092
 
2257
- // EXTERNAL MODULE: external "@babel/runtime/helpers/defineProperty"
2258
- var defineProperty_ = __webpack_require__(6);
2259
- var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
2093
+ return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
2094
+ };
2260
2095
 
2261
- // EXTERNAL MODULE: ./src/SingleValueBasic/SingleValueBasic.jsx + 2 modules
2262
- var SingleValueBasic = __webpack_require__(68);
2096
+ exports.default = withDashboardViz;
2263
2097
 
2264
- // EXTERNAL MODULE: external "@splunk/visualizations-shared/colorConstants"
2265
- var colorConstants_ = __webpack_require__(43);
2098
+ /***/ }),
2266
2099
 
2267
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialGraph.jsx
2100
+ /***/ 33:
2101
+ /***/ (function(module, exports) {
2268
2102
 
2103
+ module.exports = require("@splunk/themes/getSettingsFromThemedProps");
2269
2104
 
2105
+ /***/ }),
2270
2106
 
2107
+ /***/ 34:
2108
+ /***/ (function(module, exports) {
2271
2109
 
2272
- var RadialGraph_RadialGraph = function RadialGraph(_ref) {
2273
- var progress = _ref.progress,
2274
- strokeWidth = _ref.strokeWidth,
2275
- _ref$backgroundColor = _ref.backgroundColor,
2276
- backgroundColor = _ref$backgroundColor === void 0 ? colorConstants_["RADIAL_BACKGROUND_COLOR"] : _ref$backgroundColor,
2277
- _ref$progressColor = _ref.progressColor,
2278
- progressColor = _ref$progressColor === void 0 ? colorConstants_["RADIAL_STROKE_COLOR"] : _ref$progressColor,
2279
- _ref$width = _ref.width,
2280
- width = _ref$width === void 0 ? 200 : _ref$width,
2281
- _ref$height = _ref.height,
2282
- height = _ref$height === void 0 ? 200 : _ref$height;
2283
- var semicircleRadius = height - strokeWidth / 2;
2284
- var circumference = semicircleRadius * 2 * Math.PI;
2285
- var bgCircleOffset = 0.5 * circumference;
2286
- var progress50 = progress / 100 * 50;
2287
- var progressWidth = progress50 / 100 * circumference;
2288
- var strokeDashoffset = circumference * 0.5;
2289
- return /*#__PURE__*/external_react_default.a.createElement("svg", {
2290
- height: height,
2291
- width: width,
2292
- "data-test": "radial-visualization"
2293
- }, /*#__PURE__*/external_react_default.a.createElement("g", null, /*#__PURE__*/external_react_default.a.createElement("circle", {
2294
- "data-test": "background-radial",
2295
- stroke: backgroundColor,
2296
- fill: "transparent",
2297
- strokeWidth: strokeWidth,
2298
- strokeDasharray: "".concat(bgCircleOffset, " ").concat(circumference - bgCircleOffset),
2299
- style: {
2300
- strokeDashoffset: strokeDashoffset
2301
- },
2302
- r: semicircleRadius,
2303
- cx: width / 2,
2304
- cy: semicircleRadius + strokeWidth / 2
2305
- }), /*#__PURE__*/external_react_default.a.createElement("circle", {
2306
- "data-test": "progress-radial",
2307
- stroke: progressColor,
2308
- fill: "transparent",
2309
- strokeWidth: strokeWidth,
2310
- strokeDasharray: "".concat(progressWidth, " ").concat(circumference - progressWidth),
2311
- style: {
2312
- strokeDashoffset: strokeDashoffset
2313
- },
2314
- r: semicircleRadius,
2315
- cx: width / 2,
2316
- cy: semicircleRadius + strokeWidth / 2
2317
- })));
2318
- };
2110
+ module.exports = require("@splunk/visualization-encoding/Options");
2319
2111
 
2320
- RadialGraph_RadialGraph.propTypes = {
2321
- progress: external_prop_types_default.a.number,
2322
- strokeWidth: external_prop_types_default.a.number,
2323
- backgroundColor: external_prop_types_default.a.string,
2324
- progressColor: external_prop_types_default.a.string,
2325
- width: external_prop_types_default.a.number,
2326
- height: external_prop_types_default.a.number
2327
- };
2328
- RadialGraph_RadialGraph.defaultProps = {
2329
- progress: 0,
2330
- strokeWidth: 12
2331
- };
2332
- /* harmony default export */ var PureSingleValueRadial_RadialGraph = (RadialGraph_RadialGraph);
2333
- // EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
2334
- var singleValueUtils = __webpack_require__(20);
2112
+ /***/ }),
2335
2113
 
2336
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/displayUtils.js
2114
+ /***/ 35:
2115
+ /***/ (function(module, exports) {
2337
2116
 
2117
+ module.exports = require("@splunk/visualizations-shared/SanitizeProps");
2338
2118
 
2339
- var VALID_TREND_POSITIONS = ['standard', 'below', 'outside'];
2340
- var MAJOR_FONT_THRESHOLD = 25;
2341
- var TREND_FONT_THRESHOLD = 12;
2342
- var DEFAULT_RADIAL_STROKE_WIDTH = 16;
2343
- var SMALL_RADIAL_STROKE_WIDTH = 6;
2344
- /**
2345
- * Get the colors for a radial graph based on severity
2346
- * @method getRadialColors
2347
- * @param {Object} props
2348
- * @param {Bool} props.backgroundEnabled
2349
- * @param {String} props.backgroundColor
2350
- * @returns {Object} { background, stroke } colors
2351
- */
2119
+ /***/ }),
2352
2120
 
2353
- var displayUtils_getRadialColors = function getRadialColors(_ref) {
2354
- var backgroundEnabled = _ref.backgroundEnabled,
2355
- backgroundColor = _ref.backgroundColor;
2356
- return Object(singleValueUtils["getGraphColors"])({
2357
- backgroundEnabled: backgroundEnabled,
2358
- backgroundColor: backgroundColor,
2359
- defaultColors: colorConstants_["RADIAL_SEVERITY_COLORS"],
2360
- customColorFormatter: function customColorFormatter(color) {
2361
- return {
2362
- background: Object(singleValueUtils["lighten"])(color),
2363
- stroke: Object(singleValueUtils["darken"])(color)
2364
- };
2365
- }
2366
- });
2367
- };
2368
- /**
2369
- * Figure out the dimensions of the graph
2370
- * @method getRadialGraphDimensions
2371
- * @param {Object} props
2372
- * @param {Number} props.width // Width of the container
2373
- * @param {Number} props.height // Height of the container
2374
- * @returns {Number} width and height of the graph
2375
- */
2121
+ /***/ 36:
2122
+ /***/ (function(module, exports) {
2376
2123
 
2377
- var displayUtils_getRadialGraphDimensions = function getRadialGraphDimensions(_ref2) {
2378
- var width = _ref2.width,
2379
- height = _ref2.height; // height * 2 because we are fitting only half of a circle inside the container
2124
+ module.exports = require("@splunk/moment");
2380
2125
 
2381
- var radius = Math.min(width, height * 2) / 2;
2382
- return {
2383
- width: width - singleValueUtils["SVR_PADDING"].left - singleValueUtils["SVR_PADDING"].right,
2384
- height: radius - singleValueUtils["SVR_PADDING"].top - singleValueUtils["SVR_PADDING"].bottom
2385
- };
2386
- };
2387
- /**
2388
- * Figure out the dimensions of the content container for SVR
2389
- * @method getRadialHelperDimensions
2390
- * @param {Object} props
2391
- * @param {Number} props.width // Width of the visualization space
2392
- * @param {Number} props.height // Height of the visualization space
2393
- * @returns {Number} width and height of the content graph
2394
- */
2126
+ /***/ }),
2395
2127
 
2396
- var getRadialHelperDimensions = function getRadialHelperDimensions(_ref3) {
2397
- var height = _ref3.height,
2398
- _ref3$strokeWidth = _ref3.strokeWidth,
2399
- strokeWidth = _ref3$strokeWidth === void 0 ? DEFAULT_RADIAL_STROKE_WIDTH : _ref3$strokeWidth; // The radius of the visualization is equal to the height
2128
+ /***/ 37:
2129
+ /***/ (function(module, exports, __webpack_require__) {
2400
2130
 
2401
- var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
2131
+ "use strict";
2402
2132
 
2403
- var innerArcRadius = semicircleRadius * 0.9;
2404
- var halfContentWidth = innerArcRadius * 0.7;
2405
- var contentHeight = Math.floor(Math.sqrt(Math.pow(innerArcRadius, 2) - Math.pow(halfContentWidth, 2)));
2406
- return {
2407
- contentWidth: halfContentWidth * 2,
2408
- contentHeight: contentHeight,
2409
- helperArcRadius: innerArcRadius,
2410
- semicircleRadius: semicircleRadius
2411
- };
2412
- };
2413
- /**
2414
- * Get the maximum size of the container that holds the graph text
2415
- * @method getValueContentSize
2416
- * @param {Object} props
2417
- * @param {Number} props.graphSize
2418
- * @param {Number} props.radialStrokeWidth // Stroke width of the graph
2419
- * @returns {Number} content size for showing major and trend values in radial graph
2420
- */
2421
2133
 
2422
- var getValueContentSize = function getValueContentSize(_ref4) {
2423
- var graphSize = _ref4.graphSize,
2424
- radialStrokeWidth = _ref4.radialStrokeWidth; // Account for the graph's stroke width
2134
+ var _classCallCheck = __webpack_require__(11);
2425
2135
 
2426
- var diameter = graphSize - radialStrokeWidth; // Use pythagoreum theorum with circle diameter
2427
- // to calculate the size of the sides of the square inside the circle
2136
+ Object.defineProperty(exports, "__esModule", {
2137
+ value: true
2138
+ });
2139
+ exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
2140
+ /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
2428
2141
 
2429
- return Math.floor(Math.sqrt(Math.pow(diameter, 2) / 2));
2430
- };
2431
- /*
2432
- * @method getRadialStrokeWidth
2433
- * @param {Number} graphHeight
2434
- * @returns {Number} radial stroke width
2435
- */
2142
+ var T = __webpack_require__(1);
2436
2143
 
2437
- var getRadialStrokeWidth = function getRadialStrokeWidth(graphHeight) {
2438
- return graphHeight >= 90 ? DEFAULT_RADIAL_STROKE_WIDTH : SMALL_RADIAL_STROKE_WIDTH;
2439
- };
2440
- /*
2441
- * @method isValidPosition
2442
- * @param {String} position
2443
- * @returns {Bool}
2444
- */
2144
+ var lodash_1 = __webpack_require__(3);
2445
2145
 
2446
- var isValidPosition = function isValidPosition(position) {
2447
- return VALID_TREND_POSITIONS.indexOf(position) > -1;
2448
- };
2449
- /*
2450
- * @method showTrendPositionStandard
2451
- * @param {Object} props
2452
- * @param {Bool} props.showTrendIndicator
2453
- * @param {String} props.position
2454
- * @returns {Bool}
2455
- */
2146
+ var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2456
2147
 
2457
- var showTrendPositionStandard = function showTrendPositionStandard(_ref5) {
2458
- var showTrendIndicator = _ref5.showTrendIndicator,
2459
- position = _ref5.position;
2460
- return showTrendIndicator && position === 'standard';
2461
- };
2462
- /*
2463
- * @method showTrendPositionBelow
2464
- * @param {Object} props
2465
- * @param {Bool} props.showTrendIndicator
2466
- * @param {String} props.position
2467
- * @returns {Bool}
2468
- */
2469
2148
 
2470
- var showTrendPositionBelow = function showTrendPositionBelow(_ref6) {
2471
- var showTrendIndicator = _ref6.showTrendIndicator,
2472
- position = _ref6.position;
2473
- return showTrendIndicator && position === 'below';
2474
- };
2475
- /*
2476
- * @method showTrendPositionOutside
2477
- * @param {Object} props
2478
- * @param {Bool} props.showTrendIndicator
2479
- * @param {String} props.position
2480
- * @returns {Bool}
2149
+ exports.INITIAL_WIDTH = 250;
2150
+ exports.INITIAL_HEIGHT = 250;
2151
+ /**
2152
+ * A Splunk visualization
2481
2153
  */
2482
2154
 
2483
- var showTrendPositionOutside = function showTrendPositionOutside(_ref7) {
2484
- var showTrendIndicator = _ref7.showTrendIndicator,
2485
- position = _ref7.position;
2486
- return showTrendIndicator && position === 'outside';
2155
+ var SplunkVisualization = function SplunkVisualization() {
2156
+ _classCallCheck(this, SplunkVisualization);
2487
2157
  };
2488
- /*
2489
- * need to handle max and min
2490
- * @method getRadialProgress
2491
- * @param {Number} majorValue
2492
- * @returns {Number} progress bar in radial graph
2493
- */
2494
2158
 
2495
- var getRadialProgress = function getRadialProgress(majorValue, maxValue) {
2496
- return Number.isNaN(Number(majorValue)) || Number.isNaN(Number(maxValue)) || majorValue < 0 && majorValue < maxValue ? 0 : majorValue / maxValue * 100;
2497
- };
2498
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
2159
+ SplunkVisualization.propTypes = {
2160
+ /**
2161
+ * display mode
2162
+ */
2163
+ mode: T.oneOf(['view', 'edit', 'export']).isRequired,
2499
2164
 
2165
+ /**
2166
+ * width in pixel or string, defaults to 100%
2167
+ */
2168
+ width: T.oneOfType([T.string, T.number]).isRequired,
2500
2169
 
2170
+ /**
2171
+ * height in pixel or string
2172
+ */
2173
+ height: T.oneOfType([T.string, T.number]).isRequired,
2501
2174
 
2502
- function ownKeys(object, enumerableOnly) {
2503
- var keys = Object.keys(object);
2175
+ /**
2176
+ * visualization context used for dynamic option evaluation
2177
+ */
2178
+ context: T.object,
2504
2179
 
2505
- if (Object.getOwnPropertySymbols) {
2506
- var symbols = Object.getOwnPropertySymbols(object);
2507
- if (enumerableOnly) symbols = symbols.filter(function (sym) {
2508
- return Object.getOwnPropertyDescriptor(object, sym).enumerable;
2509
- });
2510
- keys.push.apply(keys, symbols);
2511
- }
2180
+ /**
2181
+ * visualization formatting options
2182
+ */
2183
+ options: T.object,
2512
2184
 
2513
- return keys;
2514
- }
2185
+ /**
2186
+ * A callback to update formatting options
2187
+ */
2188
+ onOptionsChange: T.func,
2515
2189
 
2516
- function _objectSpread(target) {
2517
- for (var i = 1; i < arguments.length; i++) {
2518
- var source = arguments[i] != null ? arguments[i] : {};
2190
+ /**
2191
+ * datasource state which include data and request params, object key indicate the datasource type.
2192
+ */
2193
+ dataSources: T.objectOf(T.shape({
2194
+ /**
2195
+ * current request params
2196
+ */
2197
+ requestParams: T.object,
2519
2198
 
2520
- if (i % 2) {
2521
- ownKeys(Object(source), true).forEach(function (key) {
2522
- defineProperty_default()(target, key, source[key]);
2523
- });
2524
- } else if (Object.getOwnPropertyDescriptors) {
2525
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
2526
- } else {
2527
- ownKeys(Object(source)).forEach(function (key) {
2528
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
2529
- });
2530
- }
2531
- }
2199
+ /**
2200
+ * current dataset
2201
+ */
2202
+ data: T.shape({
2203
+ fields: T.array,
2204
+ columns: T.array
2205
+ }),
2532
2206
 
2533
- return target;
2534
- }
2207
+ /**
2208
+ * error
2209
+ */
2210
+ error: T.shape({
2211
+ level: T.string,
2212
+ message: T.string
2213
+ }),
2535
2214
 
2215
+ /**
2216
+ * meta data that came with the dataset
2217
+ */
2218
+ meta: T.object
2219
+ })),
2536
2220
 
2221
+ /**
2222
+ * A callback to trigger event
2223
+ */
2224
+ onEventTrigger: T.func,
2537
2225
 
2226
+ /**
2227
+ * Inform viz if there are handlers listening to events
2228
+ */
2229
+ hasEventHandlers: T.bool,
2538
2230
 
2231
+ /**
2232
+ * A callback to communicate computed props to a consumer
2233
+ */
2234
+ onComputedProps: T.func,
2539
2235
 
2236
+ /**
2237
+ * A callback to obtain visualization api
2238
+ */
2239
+ vizActionHandlerRef: T.func,
2240
+ loading: T.bool,
2241
+ theme: T.object,
2540
2242
 
2243
+ /**
2244
+ * A callback to request new data with updated request params
2245
+ */
2246
+ onRequestParamsChange: T.func
2247
+ };
2248
+ /**
2249
+ *
2250
+ */
2541
2251
 
2542
- var TextContainer = external_styled_components_default.a.div.withConfig({
2543
- displayName: "RadialLayout__TextContainer",
2544
- componentId: "sc-13x2rjt-0"
2545
- })(["position:", ";left:0;bottom:0;width:100%;display:flex;align-items:", ";justify-content:center;flex-direction:column;[data-test='majorValue']{", "::before{font-size:inherit;vertical-align:unset;top:unset;}::after{font-size:inherit;vertical-align:unset;top:unset;}}[data-test='trendValueIndicator']{align-items:flex-end;", "}[data-test='trendValue']{", "}div[class^='TrendValue__Column']{", "}"], function (props) {
2546
- return props.smallViz ? 'relative' : 'absolute';
2547
- }, function (props) {
2548
- return props.align || 'center';
2549
- }, function (props) {
2550
- return !props.smallViz && {
2551
- lineHeight: '0px'
2552
- };
2553
- }, function (props) {
2554
- return props.smallViz && {
2555
- marginLeft: '1px'
2556
- };
2557
- }, function (props) {
2558
- return props.smallViz && {
2559
- marginLeft: '1px'
2560
- };
2561
- }, function (props) {
2562
- return props.smallViz && {
2563
- margin: '0 1px'
2564
- };
2565
- });
2566
- var GraphContainer = external_styled_components_default.a.div.withConfig({
2567
- displayName: "RadialLayout__GraphContainer",
2568
- componentId: "sc-13x2rjt-1"
2569
- })(["position:relative;margin:0 auto;width:", "px;height:", "px;display:flex;justify-content:center;align-items:center;flex-direction:column;"], function (props) {
2570
- return props.width;
2571
- }, function (props) {
2572
- return props.height;
2573
- });
2574
- var UnderLabelContainer = external_styled_components_default.a.div.withConfig({
2575
- displayName: "RadialLayout__UnderLabelContainer",
2576
- componentId: "sc-13x2rjt-2"
2577
- })(["display:flex;flex:0 0 ", "px;align-items:flex-end;"], function (props) {
2578
- return props.underLabelHeight;
2579
- });
2580
- var UnderLabelText = external_styled_components_default.a.span.withConfig({
2581
- displayName: "RadialLayout__UnderLabelText",
2582
- componentId: "sc-13x2rjt-3"
2583
- })(["color:", ";-webkit-text-stroke:0.5px ", ";font-size:12px;max-width:", "px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], function (props) {
2584
- return props.color;
2585
- }, function (props) {
2586
- return props.strokeColor;
2587
- }, function (props) {
2588
- return props.maxWidth;
2589
- });
2252
+ SplunkVisualization.defaultProps = {
2253
+ // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
2254
+ width: '100%',
2255
+ height: exports.INITIAL_HEIGHT,
2256
+ dataSources: {},
2257
+ onEventTrigger: function onEventTrigger() {
2258
+ return {};
2259
+ },
2260
+ mode: 'view',
2261
+ hasEventHandlers: false,
2262
+ options: {},
2263
+ context: {},
2264
+ onOptionsChange: function onOptionsChange() {
2265
+ return {};
2266
+ },
2267
+ vizActionHandlerRef: function vizActionHandlerRef() {
2268
+ return new VizActionHandler_1.DefaultVizActionHandler();
2269
+ },
2270
+ onComputedProps: function onComputedProps() {
2271
+ return {};
2272
+ },
2273
+ loading: false,
2274
+ onRequestParamsChange: lodash_1.noop
2275
+ };
2276
+ exports.default = SplunkVisualization;
2590
2277
 
2591
- var RadialLayout_RadialContent = function RadialContent(_ref) {
2592
- var props = extends_default()({}, _ref);
2278
+ /***/ }),
2593
2279
 
2594
- var majorColor = props.majorColor,
2595
- majorText = props.majorText,
2596
- majorTextFontSize = props.majorTextFontSize,
2597
- majorValueTitle = props.majorValueTitle,
2598
- trendColor = props.trendColor,
2599
- trendText = props.trendText,
2600
- trendTextFontSize = props.trendTextFontSize,
2601
- showTrendIndicator = props.showTrendIndicator,
2602
- unit = props.unit,
2603
- unitPosition = props.unitPosition,
2604
- underLabelColor = props.underLabelColor,
2605
- underLabel = props.underLabel,
2606
- onValueClick = props.onValueClick,
2607
- showRadialGraph = props.showRadialGraph,
2608
- progress = props.progress,
2609
- radialBackgroundColor = props.radialBackgroundColor,
2610
- radialStrokeColor = props.radialStrokeColor,
2611
- radialStrokeWidth = props.radialStrokeWidth,
2612
- graphWidth = props.graphWidth,
2613
- graphHeight = props.graphHeight,
2614
- underLabelStrokeColor = props.underLabelStrokeColor;
2280
+ /***/ 38:
2281
+ /***/ (function(module, exports, __webpack_require__) {
2615
2282
 
2616
- var _getRadialHelperDimen = getRadialHelperDimensions({
2617
- height: graphHeight,
2618
- strokeWidth: radialStrokeWidth
2619
- }),
2620
- semicircleRadius = _getRadialHelperDimen.semicircleRadius,
2621
- helperArcRadius = _getRadialHelperDimen.helperArcRadius; // Two cases for filling underLabel space: either the semicircle radius is insufficiently sized for text
2622
- // or the radial visualization has been disabled (first condition reached first when making smaller).
2283
+ "use strict";
2623
2284
 
2624
2285
 
2625
- var fillVacantSpace = semicircleRadius < 50 || !showRadialGraph; // If filling the vacant space, no height on underLabel container. Otherwise, the underLabel height is 20% of the helperArcRadius (min 20px).
2286
+ var _classCallCheck = __webpack_require__(11);
2626
2287
 
2627
- var underLabelHeight = fillVacantSpace ? 0 : Math.max(helperArcRadius * 0.2, 20);
2628
- var underLabelWidth = helperArcRadius * 2;
2629
- var basicSingleValues = /*#__PURE__*/external_react_default.a.createElement(SingleValueBasic["default"], {
2630
- majorColor: majorColor,
2631
- majorText: majorText,
2632
- majorTextFontSize: majorTextFontSize,
2633
- majorValueTitle: majorValueTitle,
2634
- trendColor: trendColor,
2635
- trendText: trendText,
2636
- trendTextFontSize: trendTextFontSize,
2637
- showTrendIndicator: showTrendIndicator,
2638
- unit: unit,
2639
- unitPosition: unitPosition,
2640
- onValueClick: onValueClick
2641
- });
2642
- var radialGraph = showRadialGraph ? /*#__PURE__*/external_react_default.a.createElement(PureSingleValueRadial_RadialGraph, {
2643
- progress: progress,
2644
- backgroundColor: radialBackgroundColor,
2645
- progressColor: radialStrokeColor,
2646
- strokeWidth: radialStrokeWidth,
2647
- width: graphWidth,
2648
- height: graphHeight
2649
- }) : null;
2650
- var underLabelComponent = /*#__PURE__*/external_react_default.a.createElement(UnderLabelContainer, {
2651
- underLabelHeight: underLabelHeight
2652
- }, !fillVacantSpace && underLabel && /*#__PURE__*/external_react_default.a.createElement(UnderLabelText, {
2653
- "data-test": "underLabel",
2654
- maxWidth: underLabelWidth * 0.9 // buffer for overflow ellipses
2655
- ,
2656
- color: underLabelColor,
2657
- strokeColor: underLabelStrokeColor,
2658
- title: underLabel
2659
- }, underLabel));
2660
- return /*#__PURE__*/external_react_default.a.createElement(GraphContainer, {
2661
- width: graphWidth,
2662
- height: graphHeight
2663
- }, radialGraph, /*#__PURE__*/external_react_default.a.createElement(TextContainer, {
2664
- smallViz: !showRadialGraph,
2665
- height: graphHeight
2666
- }, basicSingleValues, underLabelComponent));
2667
- };
2288
+ var _createClass = __webpack_require__(19);
2668
2289
 
2669
- RadialLayout_RadialContent.propTypes = _objectSpread(_objectSpread({}, SingleValueBasic["default"].propTypes), {}, {
2670
- trendPosition: external_prop_types_default.a.string,
2671
- showRadialGraph: external_prop_types_default.a.bool,
2672
- progress: external_prop_types_default.a.number,
2673
- radialBackgroundColor: external_prop_types_default.a.string,
2674
- radialStrokeColor: external_prop_types_default.a.string,
2675
- radialStrokeWidth: external_prop_types_default.a.number,
2676
- graphWidth: external_prop_types_default.a.number,
2677
- graphHeight: external_prop_types_default.a.number,
2678
- underLabelStrokeColor: external_prop_types_default.a.string
2290
+ Object.defineProperty(exports, "__esModule", {
2291
+ value: true
2679
2292
  });
2680
- /* harmony default export */ var RadialLayout = (RadialLayout_RadialContent);
2681
- // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/SingleValueRadial.jsx
2293
+ exports.DefaultVizActionHandler = void 0;
2294
+
2295
+ var DefaultVizActionHandler = /*#__PURE__*/function () {
2296
+ function DefaultVizActionHandler() {
2297
+ _classCallCheck(this, DefaultVizActionHandler);
2298
+ }
2299
+
2300
+ _createClass(DefaultVizActionHandler, [{
2301
+ key: "focus",
2302
+ value: function focus() {// noop
2303
+ }
2304
+ }, {
2305
+ key: "snapshot",
2306
+ value: function snapshot() {
2307
+ return null; // noop
2308
+ }
2309
+ }]);
2682
2310
 
2311
+ return DefaultVizActionHandler;
2312
+ }();
2313
+
2314
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
2683
2315
 
2316
+ /***/ }),
2684
2317
 
2318
+ /***/ 39:
2319
+ /***/ (function(module, exports, __webpack_require__) {
2685
2320
 
2321
+ "use strict";
2686
2322
 
2687
2323
 
2324
+ Object.defineProperty(exports, "__esModule", {
2325
+ value: true
2326
+ });
2327
+ exports.validSortDirs = void 0;
2328
+ exports.validSortDirs = ['asc', 'desc', 'none'];
2688
2329
 
2330
+ /***/ }),
2689
2331
 
2332
+ /***/ 4:
2333
+ /***/ (function(module, exports) {
2690
2334
 
2335
+ module.exports = require("styled-components");
2691
2336
 
2337
+ /***/ }),
2692
2338
 
2339
+ /***/ 40:
2340
+ /***/ (function(module, exports, __webpack_require__) {
2693
2341
 
2342
+ "use strict";
2694
2343
 
2695
2344
 
2696
- var Container = external_styled_components_default.a.div.withConfig({
2697
- displayName: "SingleValueRadial__Container",
2698
- componentId: "sc-404dvw-0"
2699
- })(["overflow:hidden;", ";"], function (props) {
2700
- return Object(style_["toDimension"])(external_lodash_pick_default()(props, ['width', 'height']));
2345
+ Object.defineProperty(exports, "__esModule", {
2346
+ value: true
2701
2347
  });
2348
+ exports.useDeepMemo = void 0;
2702
2349
 
2703
- var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
2704
- var props = extends_default()({}, _ref);
2350
+ var react_1 = __webpack_require__(0);
2705
2351
 
2706
- var width = props.width,
2707
- _props$height = props.height,
2708
- height = _props$height === void 0 ? 250 : _props$height,
2709
- style = props.style,
2710
- majorFontSize = props.majorFontSize,
2711
- majorValue = props.majorValue,
2712
- majorValueField = props.majorValueField,
2713
- maxValue = props.maxValue,
2714
- trendValue = props.trendValue,
2715
- trendFontSize = props.trendFontSize,
2716
- unitPosition = props.unitPosition,
2717
- numberPrecision = props.numberPrecision,
2718
- shouldUseThousandSeparators = props.shouldUseThousandSeparators,
2719
- shouldAbbreviateTrendValue = props.shouldAbbreviateTrendValue,
2720
- onValueClick = props.onValueClick; // calculate colors
2352
+ var lodash_1 = __webpack_require__(3);
2353
+ /**
2354
+ * This hook evaluates and stores the result of a passed function and only
2355
+ * re-evaluates the function when passed dependencies change.
2356
+ *
2357
+ * It is different from the internal React useMemo in the following aspects:
2358
+ * - it only stores the last evaluated result
2359
+ * - it uses a deep equality check to determine if dependencies have changed
2360
+ *
2361
+ * Inspired by apollo-client's useDeepMemo
2362
+ *
2363
+ * @param fn the function to be executed and
2364
+ * @param dependencies an array of dependencies
2365
+ */
2721
2366
 
2722
- var defaultColors = {
2723
- defaultFontColor: pick_default()({
2724
- enterprise: {
2725
- dark: variables_default.a.textColor(props),
2726
- light: variables_default.a.gray20(props)
2727
- },
2728
- prisma: variables_default.a.contentColorActive(props)
2729
- })(props),
2730
- defaultBlockFontColor: pick_default()({
2731
- enterprise: variables_default.a.white(props),
2732
- prisma: variables_default.a.contentColorActive(props)
2733
- })(props)
2734
- };
2735
2367
 
2736
- var _computeColors = Object(singleValueUtils["computeColors"])(props, defaultColors),
2737
- backgroundEnabled = _computeColors.backgroundEnabled,
2738
- backgroundColor = _computeColors.backgroundColor,
2739
- majorColor = _computeColors.majorColor,
2740
- trendColor = _computeColors.trendColor,
2741
- underLabelColor = _computeColors.underLabelColor;
2368
+ var useDeepMemo = function useDeepMemo(fn, dependencies) {
2369
+ var ref = react_1.useRef();
2742
2370
 
2743
- var radialColors = displayUtils_getRadialColors({
2744
- backgroundEnabled: backgroundEnabled,
2745
- backgroundColor: backgroundColor
2746
- });
2747
- var radialBackgroundColor = props.radialBackgroundColor || radialColors.background;
2748
- var radialStrokeColor = props.radialStrokeColor || radialColors.stroke;
2749
- var underLabelStrokeColor = backgroundEnabled ? backgroundColor : 'transparent';
2750
- var handleValueClick = Object(external_react_["useCallback"])(function (ev) {
2751
- return Object(singleValueUtils["handleValueClickCallback"])(ev, majorValue, majorValueField, trendValue, onValueClick);
2752
- }, [onValueClick, majorValue, majorValueField, trendValue]);
2371
+ if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
2372
+ ref.current = {
2373
+ dependencies: dependencies,
2374
+ value: fn()
2375
+ };
2376
+ }
2753
2377
 
2754
- var renderVisualization = function renderVisualization(_ref2) {
2755
- var containerWidth = _ref2.width,
2756
- containerHeight = _ref2.height;
2757
- var underLabel = props.underLabel;
2758
- var trendDisplay = props.trendDisplay,
2759
- unit = props.unit; // calculate radial graph dimensions, strokewidth, and major and trend content dimensions
2378
+ return ref.current.value;
2379
+ };
2760
2380
 
2761
- var _getRadialGraphDimens = displayUtils_getRadialGraphDimensions({
2762
- width: containerWidth,
2763
- height: containerHeight
2764
- }),
2765
- graphWidth = _getRadialGraphDimens.width,
2766
- graphHeight = _getRadialGraphDimens.height; // Radial stroke width is stepped to lower value at lower sizes.
2381
+ exports.useDeepMemo = useDeepMemo;
2767
2382
 
2383
+ /***/ }),
2768
2384
 
2769
- var radialStrokeWidth = getRadialStrokeWidth(graphHeight);
2385
+ /***/ 41:
2386
+ /***/ (function(module, exports, __webpack_require__) {
2770
2387
 
2771
- var _getRadialHelperDimen = getRadialHelperDimensions({
2772
- height: graphHeight - radialStrokeWidth / 2,
2773
- strokeWidth: radialStrokeWidth
2774
- }),
2775
- contentWidth = _getRadialHelperDimen.contentWidth,
2776
- contentHeight = _getRadialHelperDimen.contentHeight; // Subtract half of the stroke width for the exact internal radius.
2388
+ "use strict";
2777
2389
 
2778
2390
 
2779
- var semicircleRadius = graphHeight - radialStrokeWidth / 2; // 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.
2391
+ Object.defineProperty(exports, "__esModule", {
2392
+ value: true
2393
+ });
2394
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2780
2395
 
2781
- var showRadialGraph = semicircleRadius >= 20; // If not showing the radial graph, then can forgo padding logic and use original container dimensions for content sizing computation.
2396
+ var React = __webpack_require__(0);
2782
2397
 
2783
- if (!showRadialGraph) {
2784
- graphWidth = containerWidth;
2785
- contentWidth = containerWidth;
2786
- graphHeight = containerHeight;
2787
- contentHeight = containerHeight;
2788
- }
2398
+ var T = __webpack_require__(1);
2789
2399
 
2790
- var _computeSingleValueRa = Object(singleValueUtils["computeSingleValueRadialContent"])({
2791
- majorValue: majorValue,
2792
- trendValue: trendValue,
2793
- majorFontSize: majorFontSize,
2794
- trendFontSize: trendFontSize,
2795
- trendDisplay: trendDisplay,
2796
- contentWidth: contentWidth,
2797
- contentHeight: contentHeight,
2798
- // buffer for height of div
2799
- containerWidth: containerWidth * 0.9,
2800
- containerHeight: containerHeight * 0.9,
2801
- unit: unit,
2802
- numberPrecision: numberPrecision,
2803
- shouldUseThousandSeparators: shouldUseThousandSeparators,
2804
- shouldAbbreviateTrendValue: shouldAbbreviateTrendValue,
2805
- smallViz: !showRadialGraph
2806
- }),
2807
- majorText = _computeSingleValueRa.majorText,
2808
- trendText = _computeSingleValueRa.trendText,
2809
- majorTextFontSize = _computeSingleValueRa.majorTextFontSize,
2810
- trendTextFontSize = _computeSingleValueRa.trendTextFontSize,
2811
- majorValueTitle = _computeSingleValueRa.majorValueTitle,
2812
- smallVizProps = _computeSingleValueRa.smallVizProps;
2400
+ var i18n_1 = __webpack_require__(2);
2813
2401
 
2814
- if (!isEmpty_default()(smallVizProps)) {
2815
- trendDisplay = smallVizProps.trendDisplay;
2816
- unit = smallVizProps.unit;
2817
- } // calculate radial progress
2402
+ var Message_1 = __webpack_require__(10);
2818
2403
 
2404
+ var FixedSizeContainer_1 = __webpack_require__(13);
2405
+ /**
2406
+ * @method isMissing
2407
+ * @param {any} v
2408
+ * @returns {boolean} true if the input value === null or undefined
2409
+ */
2819
2410
 
2820
- var progress = getRadialProgress(majorValue, maxValue);
2821
- return /*#__PURE__*/external_react_default.a.createElement(VizStyleWrapper["default"], {
2822
- backgroundColor: backgroundColor,
2823
- style: style,
2824
- dataTestKey: "SingleValueRadialWrapper"
2825
- }, /*#__PURE__*/external_react_default.a.createElement(RadialLayout, {
2826
- "data-test": "RadialLayout",
2827
- majorColor: majorColor,
2828
- majorText: majorText,
2829
- majorTextFontSize: majorTextFontSize,
2830
- majorValueTitle: majorValueTitle,
2831
- trendColor: trendColor,
2832
- trendText: trendText,
2833
- trendTextFontSize: trendTextFontSize,
2834
- showTrendIndicator: Object(singleValueUtils["shouldShowTrend"])(trendDisplay),
2835
- unit: unit,
2836
- unitPosition: unitPosition,
2837
- underLabelColor: underLabelColor,
2838
- underLabel: underLabel,
2839
- onValueClick: handleValueClick,
2840
- showRadialGraph: showRadialGraph,
2841
- progress: progress,
2842
- radialBackgroundColor: radialBackgroundColor,
2843
- radialStrokeColor: radialStrokeColor,
2844
- radialStrokeWidth: radialStrokeWidth,
2845
- graphWidth: graphWidth,
2846
- graphHeight: graphHeight,
2847
- underLabelStrokeColor: underLabelStrokeColor
2848
- }));
2849
- };
2850
2411
 
2851
- return /*#__PURE__*/external_react_default.a.createElement(Container, {
2412
+ var isMissing = function isMissing(v) {
2413
+ return v === null || v === undefined;
2414
+ };
2415
+
2416
+ exports.isMissing = isMissing;
2417
+ /**
2418
+ * @method misskingKeys
2419
+ * @param {string[]} keys
2420
+ * @param {object} target
2421
+ * @returns {string[]} the keys of missing required props
2422
+ */
2423
+
2424
+ var missingKeys = function missingKeys(keys, target) {
2425
+ return keys.filter(function (k) {
2426
+ return exports.isMissing(target[k]);
2427
+ });
2428
+ };
2429
+
2430
+ exports.missingKeys = missingKeys;
2431
+ var propTypes = {
2432
+ width: T.oneOfType([T.string, T.number]),
2433
+ height: T.oneOfType([T.string, T.number]),
2434
+ // eslint-disable-next-line react/no-unused-prop-types
2435
+ backgroundColor: T.string,
2436
+ missingProps: T.arrayOf(T.string)
2437
+ };
2438
+ /**
2439
+ * @method MissingPropsMessage
2440
+ * @param {MissingPropsProps} props
2441
+ * @returns {React.ReactElement}
2442
+ */
2443
+
2444
+ var MissingPropsMessage = function MissingPropsMessage(props) {
2445
+ var width = props.width,
2446
+ height = props.height,
2447
+ missingProps = props.missingProps;
2448
+ return React.createElement(Message_1.default, {
2449
+ "data-test": "message",
2852
2450
  width: width,
2853
- height: height
2854
- }, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
2855
- return renderVisualization(containerDimension);
2856
- }));
2451
+ height: height,
2452
+ message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
2453
+ });
2857
2454
  };
2858
2455
 
2859
- SingleValueRadial_SingleValueRadial.propTypes = {
2860
- width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
2861
- height: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
2862
- style: external_prop_types_default.a.object,
2863
- majorValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
2864
- majorValueField: external_prop_types_default.a.string,
2865
- majorColor: external_prop_types_default.a.string,
2866
- majorFontSize: external_prop_types_default.a.number,
2867
- maxValue: external_prop_types_default.a.number,
2868
- trendValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
2869
- trendColor: external_prop_types_default.a.string,
2870
- trendFontSize: external_prop_types_default.a.number,
2871
- trendDisplay: external_prop_types_default.a.string,
2872
- trendIndicatorPosition: external_prop_types_default.a.oneOf(['standard', 'below', 'outside']),
2873
- shouldAbbreviateTrendValue: external_prop_types_default.a.bool,
2874
- backgroundColor: external_prop_types_default.a.string,
2875
- unit: external_prop_types_default.a.string,
2876
- unitPosition: external_prop_types_default.a.string,
2877
- underLabel: external_prop_types_default.a.string,
2878
- numberPrecision: external_prop_types_default.a.number,
2879
- shouldUseThousandSeparators: external_prop_types_default.a.bool,
2880
- radialBackgroundColor: external_prop_types_default.a.string,
2881
- radialStrokeColor: external_prop_types_default.a.string,
2882
- onValueClick: external_prop_types_default.a.func
2883
- };
2884
- SingleValueRadial_SingleValueRadial.defaultProps = {
2456
+ exports.MissingPropsMessage = MissingPropsMessage;
2457
+ exports.MissingPropsMessage.propTypes = propTypes;
2458
+ exports.MissingPropsMessage.defaultProps = {
2885
2459
  width: '100%',
2886
- height: 250,
2887
- majorValue: 'N/A',
2888
- majorValueField: '',
2889
- maxValue: 100,
2890
- trendDisplay: 'absolute',
2891
- trendIndicatorPosition: 'standard',
2892
- shouldAbbreviateTrendValue: false,
2893
- unitPosition: 'after',
2894
- numberPrecision: 0,
2895
- shouldUseThousandSeparators: true,
2896
- onValueClick: function onValueClick() {}
2460
+ height: 250
2897
2461
  };
2898
- /* harmony default export */ var PureSingleValueRadial_SingleValueRadial = __webpack_exports__["default"] = (Object(external_styled_components_["withTheme"])(SingleValueRadial_SingleValueRadial));
2462
+ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
2899
2463
 
2900
2464
  /***/ }),
2901
2465
 
2902
- /***/ 29:
2466
+ /***/ 42:
2903
2467
  /***/ (function(module, exports, __webpack_require__) {
2904
2468
 
2905
2469
  "use strict";
@@ -2908,99 +2472,130 @@ SingleValueRadial_SingleValueRadial.defaultProps = {
2908
2472
  Object.defineProperty(exports, "__esModule", {
2909
2473
  value: true
2910
2474
  });
2911
- exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
2912
2475
 
2913
- var T = __webpack_require__(0);
2476
+ var React = __webpack_require__(0);
2914
2477
 
2915
- var lodash_1 = __webpack_require__(3);
2478
+ var styled_components_1 = __webpack_require__(4);
2916
2479
 
2917
- exports.PaginatorParamsPropTypes = T.shape({
2918
- isPaging: T.bool,
2919
- current: T.number,
2920
- totalPages: T.number,
2921
- onChange: T.func
2480
+ var hocUtils_1 = __webpack_require__(14);
2481
+
2482
+ var Cover = styled_components_1.default.div.withConfig({
2483
+ displayName: "withEditModeCover__Cover",
2484
+ componentId: "sc-1gsbnxb-0"
2485
+ })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
2486
+ var Blocker = styled_components_1.default.div.attrs({
2487
+ 'data-splunk-visualization-version': "25.3.0 - dae70ec02"
2488
+ }).withConfig({
2489
+ displayName: "withEditModeCover__Blocker",
2490
+ componentId: "sc-1gsbnxb-1"
2491
+ })(["position:relative;width:100%;height:100%;"]);
2492
+ /**
2493
+ * HOC that renders a cover layer in edit mode
2494
+ * @method withEditModeCover
2495
+ * @param {ExtendedDashViz} Visualization
2496
+ * @returns {ExtendedDashViz} Wrapper
2497
+ */
2498
+
2499
+ var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
2500
+ var Wrapper = function Wrapper(props) {
2501
+ var mode = props.mode;
2502
+ var showEditCover = mode === 'edit' && !disableEditModeCover;
2503
+ return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
2504
+ "data-test": "edit-mode-cover"
2505
+ }));
2506
+ };
2507
+
2508
+ hocUtils_1.extendStaticWrapperProps({
2509
+ Wrapper: Wrapper,
2510
+ Visualization: Visualization
2511
+ });
2512
+ return Wrapper;
2513
+ };
2514
+
2515
+ exports.default = withEditModeCover;
2516
+
2517
+ /***/ }),
2518
+
2519
+ /***/ 43:
2520
+ /***/ (function(module, exports, __webpack_require__) {
2521
+
2522
+ "use strict";
2523
+
2524
+
2525
+ Object.defineProperty(exports, "__esModule", {
2526
+ value: true
2922
2527
  });
2923
2528
 
2924
- var getPaginationParams = function getPaginationParams(_ref) {
2925
- var requestParams = _ref.requestParams,
2926
- meta = _ref.meta,
2927
- onRequestParamsChange = _ref.onRequestParamsChange;
2928
- var totalCount = meta && meta.totalCount || 0;
2929
- var offset = requestParams && requestParams.offset || 0;
2930
- var count = requestParams && requestParams.count;
2931
- var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
2932
- var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
2933
- var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
2529
+ var React = __webpack_require__(0);
2934
2530
 
2935
- var onChangeHandler = function onChangeHandler(e, _ref2) {
2936
- var page = _ref2.page,
2937
- countArg = _ref2.count;
2938
- var newParams = lodash_1.cloneDeep(requestParams);
2531
+ var colorUtils_1 = __webpack_require__(12);
2939
2532
 
2940
- if (typeof countArg === 'number') {
2941
- newParams.count = countArg;
2942
- newParams.offset = 0;
2943
- }
2533
+ var variables_1 = __webpack_require__(9);
2944
2534
 
2945
- var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
2535
+ var IconPlaceholder_1 = __webpack_require__(27);
2946
2536
 
2947
- if (typeof page === 'number' && page > 0) {
2948
- newParams.count = pageCount;
2949
- newParams.offset = (page - 1) * pageCount;
2537
+ var VizBehavior_1 = __webpack_require__(6);
2538
+
2539
+ var hocUtils_1 = __webpack_require__(14);
2540
+
2541
+ var withPlaceholder = function withPlaceholder(Visualization) {
2542
+ var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
2543
+ var config = Visualization.config;
2544
+ var themes = config.themes;
2545
+
2546
+ var Wrapper = function Wrapper(props) {
2547
+ var _a, _b;
2548
+
2549
+ var dataSources = props.dataSources,
2550
+ loading = props.loading,
2551
+ options = props.options,
2552
+ height = props.height,
2553
+ width = props.width;
2554
+ var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
2555
+ 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);
2556
+ var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
2557
+ var iconColor = variables_1.default.contentColorActive(props);
2558
+
2559
+ if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
2560
+ return React.createElement(IconPlaceholder_1.default, {
2561
+ "data-test": "icon-placeholder",
2562
+ icon: icon,
2563
+ width: width,
2564
+ height: height,
2565
+ backgroundColor: bgColorFromTheme,
2566
+ iconColor: iconColor
2567
+ });
2950
2568
  }
2951
2569
 
2952
- onRequestParamsChange(newParams);
2570
+ return React.createElement(Visualization, Object.assign({}, props));
2953
2571
  };
2954
2572
 
2955
- return {
2956
- isPaging: isPaging,
2957
- current: current,
2958
- totalPages: totalPages,
2959
- onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
2960
- };
2573
+ hocUtils_1.extendStaticWrapperProps({
2574
+ Wrapper: Wrapper,
2575
+ Visualization: Visualization
2576
+ });
2577
+ return Wrapper;
2961
2578
  };
2962
2579
 
2963
- exports.getPaginationParams = getPaginationParams;
2580
+ exports.default = withPlaceholder;
2964
2581
 
2965
2582
  /***/ }),
2966
2583
 
2967
- /***/ 3:
2584
+ /***/ 44:
2968
2585
  /***/ (function(module, exports) {
2969
2586
 
2970
- module.exports = require("lodash");
2587
+ module.exports = require("@splunk/visualization-icons/placeholders");
2971
2588
 
2972
2589
  /***/ }),
2973
2590
 
2974
- /***/ 30:
2975
- /***/ (function(module, exports, __webpack_require__) {
2976
-
2977
- "use strict";
2978
-
2979
-
2980
- Object.defineProperty(exports, "__esModule", {
2981
- value: true
2982
- });
2983
- exports.VizCategory = void 0;
2984
- var VizCategory;
2591
+ /***/ 45:
2592
+ /***/ (function(module, exports) {
2985
2593
 
2986
- (function (VizCategory) {
2987
- VizCategory["SINGLE_VALUE"] = "Single Value";
2988
- VizCategory["TRENDS"] = "Trends";
2989
- VizCategory["COMPARISONS"] = "Comparisons";
2990
- VizCategory["TABLE"] = "Table";
2991
- VizCategory["GAUGE"] = "Gauge";
2992
- VizCategory["DISTRIBUTIONS"] = "Distributions";
2993
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
2994
- VizCategory["SHAPES"] = "Shapes";
2995
- VizCategory["MISC"] = "misc";
2996
- VizCategory["FLOW"] = "Flow";
2997
- VizCategory["CORRELATION"] = "Correlation";
2998
- VizCategory["SPATIAL"] = "Spatial";
2999
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
2594
+ module.exports = require("@splunk/visualizations-shared/colorConstants");
3000
2595
 
3001
2596
  /***/ }),
3002
2597
 
3003
- /***/ 31:
2598
+ /***/ 454:
3004
2599
  /***/ (function(module, exports, __webpack_require__) {
3005
2600
 
3006
2601
  "use strict";
@@ -3009,763 +2604,1182 @@ var VizCategory;
3009
2604
  Object.defineProperty(exports, "__esModule", {
3010
2605
  value: true
3011
2606
  });
2607
+ exports.PureSingleValueRadialThemes = exports.PureSingleValueRadial = exports.config = void 0;
3012
2608
 
3013
- var React = __webpack_require__(1);
3014
-
3015
- var lodash_1 = __webpack_require__(3);
3016
-
3017
- var getSettingsFromThemedProps_1 = __webpack_require__(32);
3018
-
3019
- var Options_1 = __webpack_require__(33);
3020
-
3021
- var SanitizeProps_1 = __webpack_require__(34);
2609
+ var SingleValueRadial_1 = __webpack_require__(471);
3022
2610
 
3023
- var TimezoneContext_1 = __webpack_require__(22);
2611
+ var withDashboardViz_1 = __webpack_require__(32);
3024
2612
 
3025
- var moment_1 = __webpack_require__(35);
2613
+ var config_1 = __webpack_require__(455);
3026
2614
 
3027
- var styled_components_1 = __webpack_require__(4);
2615
+ exports.config = config_1.default;
2616
+ exports.PureSingleValueRadial = SingleValueRadial_1.default; // TODO: proper theming support for SVR when we come back to SVR viz
3028
2617
 
3029
- var hocUtils_1 = __webpack_require__(24);
2618
+ exports.PureSingleValueRadialThemes = {};
2619
+ exports.default = withDashboardViz_1.default({
2620
+ ReactViz: SingleValueRadial_1.default,
2621
+ vizConfig: config_1.default
2622
+ });
3030
2623
 
3031
- var JSONSchemaUtils_1 = __webpack_require__(25);
2624
+ /***/ }),
3032
2625
 
3033
- var SplunkVisualization_1 = __webpack_require__(36);
2626
+ /***/ 455:
2627
+ /***/ (function(module, exports, __webpack_require__) {
3034
2628
 
3035
- var VizBehavior_1 = __webpack_require__(5);
2629
+ "use strict";
3036
2630
 
3037
- var getSorting_1 = __webpack_require__(28);
3038
2631
 
3039
- var getPagination_1 = __webpack_require__(29);
2632
+ Object.defineProperty(exports, "__esModule", {
2633
+ value: true
2634
+ });
3040
2635
 
3041
- var useDeepMemo_1 = __webpack_require__(39);
2636
+ var i18n_1 = __webpack_require__(2);
3042
2637
 
3043
- var MissingPropsMessage_1 = __webpack_require__(40);
2638
+ var schemaUtils_1 = __webpack_require__(16);
3044
2639
 
3045
- var withEditModeCover_1 = __webpack_require__(41);
2640
+ var pick_1 = __webpack_require__(21);
3046
2641
 
3047
- var withPlaceholder_1 = __webpack_require__(42);
3048
- /**
3049
- * hoc that wraps a pure react visualization in a Dashboard visualization
3050
- * @param {DashboardVizOpts} opts
3051
- * @returns {HOC}
3052
- */
2642
+ var variables_1 = __webpack_require__(9);
3053
2643
 
2644
+ var PresetPalettes_1 = __webpack_require__(54);
3054
2645
 
3055
- var withDashboardViz = function withDashboardViz(opts) {
3056
- var ReactViz = opts.ReactViz,
3057
- vizConfig = opts.vizConfig,
3058
- _opts$computeVizProps = opts.computeVizProps,
3059
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
3060
- disableEditModeCover = opts.disableEditModeCover,
3061
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
2646
+ var visualization_icons_1 = __webpack_require__(47);
3062
2647
 
3063
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
3064
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
2648
+ var placeholders_1 = __webpack_require__(44);
3065
2649
 
3066
- var DashboardViz = function DashboardViz(props) {
3067
- var mode = props.mode,
3068
- hasEventHandlers = props.hasEventHandlers,
3069
- dataSources = props.dataSources,
3070
- options = props.options,
3071
- _props$context = props.context,
3072
- context = _props$context === void 0 ? {} : _props$context,
3073
- width = props.width,
3074
- height = props.height,
3075
- onComputedProps = props.onComputedProps,
3076
- onEventTrigger = props.onEventTrigger,
3077
- theme = props.theme,
3078
- onRequestParamsChange = props.onRequestParamsChange;
2650
+ var VizBehavior_1 = __webpack_require__(6);
3079
2651
 
3080
- var _React$useContext = React.useContext(TimezoneContext_1.default),
3081
- serializedTimezone = _React$useContext.serializedTimezone;
2652
+ var configUtils_1 = __webpack_require__(17);
3082
2653
 
3083
- if (serializedTimezone) {
3084
- /*
3085
- @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
3086
- This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
3087
- will use it.
3088
- @TODO(pwied):
3089
- - remove when we moved away from @splunk/moment
3090
- - provide timezone context to dynamic option evaluation phase
3091
- */
3092
- if (!moment_1.default.getDefaultSplunkTimezone()) {
3093
- moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
3094
- }
2654
+ var VizCategory_1 = __webpack_require__(31);
2655
+
2656
+ var DynamicMajorColorEditor_1 = __webpack_require__(88);
2657
+
2658
+ var DynamicTrendColorEditor_1 = __webpack_require__(89);
2659
+
2660
+ var DynamicBackgroundColorEditor_1 = __webpack_require__(90);
2661
+
2662
+ var StaticMajorColorEditor_1 = __webpack_require__(91);
2663
+
2664
+ var StaticTrendColorEditor_1 = __webpack_require__(92);
2665
+
2666
+ var StaticBackgroundColorEditor_1 = __webpack_require__(78);
2667
+
2668
+ var RadialBackgroundColor_1 = __webpack_require__(456);
2669
+
2670
+ var dataContract = {
2671
+ requiredDataSources: [{
2672
+ name: 'primary',
2673
+ description: 'DataSource that powers the visualization'
2674
+ }],
2675
+ optionalDataSources: [],
2676
+ initialRequestParams: {
2677
+ primary: {
2678
+ offset: 0,
2679
+ count: 10000
2680
+ }
2681
+ }
2682
+ };
2683
+ var size = {
2684
+ initialWidth: 250,
2685
+ initialHeight: 250
2686
+ };
2687
+ var defaultContext = {
2688
+ trendColorConfig: [{
2689
+ to: 0,
2690
+ value: '#9E2520'
2691
+ }, {
2692
+ from: 0,
2693
+ value: '#1C6B2D'
2694
+ }],
2695
+ majorColorConfig: [{
2696
+ to: 20,
2697
+ value: '#D41F1F'
2698
+ }, {
2699
+ from: 20,
2700
+ to: 40,
2701
+ value: '#D94E17'
2702
+ }, {
2703
+ from: 40,
2704
+ to: 60,
2705
+ value: '#CBA700'
2706
+ }, {
2707
+ from: 60,
2708
+ to: 80,
2709
+ value: '#669922'
2710
+ }, {
2711
+ from: 80,
2712
+ value: '#118832'
2713
+ }],
2714
+ majorColorMatchConfig: [{
2715
+ match: '',
2716
+ value: '#5C33FF'
2717
+ }]
2718
+ };
2719
+ var optionsSchema = {
2720
+ backgroundColor: {
2721
+ default: '> themes.defaultBackgroundColor',
2722
+ description: 'Specify the color for the background. The hex value format should be “#ffffff”. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
2723
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2724
+ type: 'string'
2725
+ },
2726
+ majorColor: {
2727
+ default: '> themes.defaultFontColor',
2728
+ 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)".',
2729
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2730
+ type: 'string'
2731
+ },
2732
+ majorValue: {
2733
+ default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | lastPoint()',
2734
+ description: 'Specify the dataSource applied to the major value.',
2735
+ type: ['string', 'number']
2736
+ },
2737
+ majorValueField: {
2738
+ default: '> majorValue | getField()',
2739
+ description: 'Specify the field that should be mapped to the major value.',
2740
+ type: 'string'
2741
+ },
2742
+ maxValue: {
2743
+ default: 100,
2744
+ description: 'Specify the value the radial fills up to.',
2745
+ type: 'number'
2746
+ },
2747
+ numberPrecision: {
2748
+ default: 0,
2749
+ maximum: 20,
2750
+ minimum: 0,
2751
+ description: 'Specify the number of decimal places to display. For example, to display 3 decimal places, use a value of 3. The maximum value is 20.',
2752
+ type: 'number'
2753
+ },
2754
+ radialBackgroundColor: {
2755
+ default: '> themes.defaultRadialBackgroundColor',
2756
+ description: 'Specify the color for the radial background. The hex value format should be “#ffffff”. The default for enterprise light is "rgba(0, 0, 0, 0.1)". The default for enterprise dark is "rgba(255, 255, 255, 0.15)". The default for prisma dark is "rgba(255, 255, 255, 0.15)".',
2757
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2758
+ type: 'string'
2759
+ },
2760
+ radialStrokeColor: {
2761
+ default: '> majorColor',
2762
+ description: 'Specify the color for the radial. 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)".',
2763
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2764
+ type: 'string'
2765
+ },
2766
+ shouldAbbreviateTrendValue: {
2767
+ default: false,
2768
+ description: 'Specify whether to abbreviate the trend value to 2 decimal points. A magnitude unit will be displayed.',
2769
+ type: 'boolean'
2770
+ },
2771
+ shouldUseThousandSeparators: {
2772
+ default: true,
2773
+ description: 'Specify whether numeric values use commas as thousandths separaters.',
2774
+ type: 'boolean'
2775
+ },
2776
+ trendColor: {
2777
+ default: '> themes.defaultFontColor',
2778
+ description: 'Specify the color for the trend 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)".',
2779
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
2780
+ type: 'string'
2781
+ },
2782
+ trendDisplay: {
2783
+ default: 'absolute',
2784
+ description: 'Specify how to display the trend value.',
2785
+ pattern: schemaUtils_1.getPattern(['percent', 'absolute', 'off']),
2786
+ type: 'string'
2787
+ },
2788
+ trendValue: {
2789
+ default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | delta(-2)',
2790
+ description: 'Specify the dataSource applied to the trend value.',
2791
+ type: 'number'
2792
+ },
2793
+ underLabel: {
2794
+ description: 'Specify the text that appears below the major value.',
2795
+ type: 'string'
2796
+ },
2797
+ unit: {
2798
+ description: 'Specify text to show next to the major value.',
2799
+ type: 'string'
2800
+ },
2801
+ unitPosition: {
2802
+ default: 'after',
2803
+ description: 'Specify whether the unit text should appear before or after the major value.',
2804
+ pattern: schemaUtils_1.getPattern(['before', 'after']),
2805
+ type: 'string'
2806
+ }
2807
+ };
2808
+ var basePresetContext = {
2809
+ majorColorEditorConfig: undefined,
2810
+ trendColorEditorConfig: undefined,
2811
+ backgroundColorEditorConfig: undefined
2812
+ };
2813
+ var basePresetOptions = {
2814
+ majorColor: undefined,
2815
+ trendColor: undefined,
2816
+ backgroundColor: undefined
2817
+ };
2818
+ var presets = [{
2819
+ // dummy context variables to allow for resetting of unused context states
2820
+ label: i18n_1._('None'),
2821
+ name: 'singleValueRadial.none',
2822
+ value: {
2823
+ context: Object.assign({}, basePresetContext),
2824
+ options: Object.assign({}, basePresetOptions)
2825
+ }
2826
+ }, {
2827
+ label: i18n_1._('Major Value'),
2828
+ name: 'singleValueRadial.majorValue',
2829
+ value: {
2830
+ context: Object.assign(Object.assign({}, basePresetContext), {
2831
+ majorColorEditorConfig: defaultContext.majorColorConfig
2832
+ }),
2833
+ options: Object.assign(Object.assign({}, basePresetOptions), {
2834
+ majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
2835
+ })
2836
+ }
2837
+ }, {
2838
+ label: i18n_1._('Major Value & Trend'),
2839
+ name: 'singleValueRadial.majorValueAndTrend',
2840
+ value: {
2841
+ context: Object.assign(Object.assign({}, basePresetContext), {
2842
+ majorColorEditorConfig: defaultContext.majorColorConfig,
2843
+ trendColorEditorConfig: defaultContext.trendColorConfig
2844
+ }),
2845
+ options: Object.assign(Object.assign({}, basePresetOptions), {
2846
+ majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
2847
+ trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
2848
+ })
2849
+ }
2850
+ }, {
2851
+ label: i18n_1._('Trend'),
2852
+ name: 'singleValueRadial.trend',
2853
+ value: {
2854
+ context: Object.assign(Object.assign({}, basePresetContext), {
2855
+ trendColorEditorConfig: defaultContext.trendColorConfig
2856
+ }),
2857
+ options: Object.assign(Object.assign({}, basePresetOptions), {
2858
+ trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
2859
+ })
2860
+ }
2861
+ }, {
2862
+ label: i18n_1._('Background'),
2863
+ name: 'singleValueRadial.background',
2864
+ value: {
2865
+ context: Object.assign(Object.assign({}, basePresetContext), {
2866
+ backgroundColorEditorConfig: defaultContext.majorColorConfig
2867
+ }),
2868
+ options: Object.assign(Object.assign({}, basePresetOptions), {
2869
+ backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
2870
+ })
2871
+ }
2872
+ }];
2873
+ var themes = {
2874
+ defaultFontColor: function defaultFontColor(props) {
2875
+ return pick_1.default({
2876
+ enterprise: {
2877
+ dark: variables_1.default.white(props),
2878
+ light: variables_1.default.black(props)
2879
+ },
2880
+ prisma: variables_1.default.contentColorActive(props)
2881
+ })(props);
2882
+ },
2883
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
2884
+ return pick_1.default({
2885
+ enterprise: {
2886
+ dark: variables_1.default.black(props),
2887
+ light: variables_1.default.white(props)
2888
+ },
2889
+ prisma: variables_1.default.backgroundColorSidebar(props)
2890
+ })(props);
2891
+ },
2892
+ defaultRadialBackgroundColor: function defaultRadialBackgroundColor(props) {
2893
+ return pick_1.default({
2894
+ enterprise: {
2895
+ dark: 'rgba(255, 255, 255, 0.15)',
2896
+ light: 'rgba(0, 0, 0, 0.1)'
2897
+ },
2898
+ prisma: variables_1.default.interactiveColorBackgroundDisabled(props)
2899
+ })(props);
2900
+ }
2901
+ };
2902
+ var editorConfig = [{
2903
+ label: i18n_1._('Major Value & Trend'),
2904
+ layout: [[{
2905
+ label: 'Unit Position',
2906
+ option: 'unitPosition',
2907
+ editor: 'editor.select',
2908
+ editorProps: {
2909
+ values: [{
2910
+ label: i18n_1._('Before'),
2911
+ value: 'before'
2912
+ }, {
2913
+ label: i18n_1._('After'),
2914
+ value: 'after'
2915
+ }]
3095
2916
  }
3096
-
3097
- var themeFunc = function themeFunc(themeVar) {
3098
- var _a, _b;
3099
-
3100
- return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
3101
- };
3102
-
3103
- var bgColorFromTheme = themeFunc('defaultBackgroundColor');
3104
-
3105
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
3106
- theme: theme
3107
- }),
3108
- currentThemeFamily = _getSettingsFromTheme.family,
3109
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
3110
- currentThemeDensity = _getSettingsFromTheme.density;
3111
-
3112
- var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
3113
-
3114
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
3115
- try {
3116
- return Options_1.Options.evaluate({
3117
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
3118
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
3119
- }, dataSources, themeFunc);
3120
- } catch (e) {
3121
- // eslint-disable-next-line no-console
3122
- console.error("unexpected error evaluating options: + ".concat(e.message));
3123
- return {};
2917
+ }, {
2918
+ label: i18n_1._('Unit Label'),
2919
+ option: 'unit',
2920
+ editor: 'editor.text'
2921
+ }], [{
2922
+ label: i18n_1._('Precision'),
2923
+ option: 'numberPrecision',
2924
+ editor: 'editor.number',
2925
+ editorProps: {
2926
+ min: 0,
2927
+ max: 20
2928
+ }
2929
+ }, {
2930
+ label: i18n_1._('Trend Display'),
2931
+ option: 'trendDisplay',
2932
+ editor: 'editor.select',
2933
+ editorProps: {
2934
+ values: [{
2935
+ label: i18n_1._('Percent'),
2936
+ value: 'percent'
2937
+ }, {
2938
+ label: i18n_1._('Absolute'),
2939
+ value: 'absolute'
2940
+ }, {
2941
+ label: i18n_1._('Off'),
2942
+ value: 'off'
2943
+ }]
2944
+ }
2945
+ }]]
2946
+ }, {
2947
+ label: i18n_1._('Coloring'),
2948
+ layout: [[{
2949
+ label: 'Dynamic Elements',
2950
+ key: 'presetSelector',
2951
+ editor: 'editor.presetSelector',
2952
+ editorProps: {
2953
+ presets: presets,
2954
+ value: function value(_ref) {
2955
+ var context = _ref.context,
2956
+ options = _ref.options;
2957
+ var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
2958
+ return initialPreset && initialPreset.label || null;
3124
2959
  }
3125
- }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
3126
- // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
3127
-
3128
- React.useEffect(function () {
3129
- onComputedProps(evaluatedOptions);
3130
- }); // present warning message if any required props are missing
3131
-
3132
- var _vizConfig$requiredPr = vizConfig.requiredProps,
3133
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
3134
- supports = vizConfig.supports;
3135
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptions);
3136
-
3137
- if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER)) {
3138
- return React.createElement(MissingPropsMessage_1.default, {
3139
- "data-test": "missing-props-message",
3140
- width: width,
3141
- height: height,
3142
- missingProps: missing,
3143
- backgroundColor: bgColorFromTheme
3144
- });
3145
- } // events
3146
-
3147
-
3148
- var eventCallbackProps = {};
3149
-
3150
- if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
3151
- var supportedEvents = vizConfig.events;
3152
- Object.keys(supportedEvents).forEach(function (eventName) {
3153
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
3154
- eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
3155
- // then remove these lines
3156
-
3157
- var payloadKeys = supportedEvents[eventName].payloadKeys;
3158
- var payload = {};
3159
-
3160
- if (Array.isArray(payloadKeys) && payloadKeys.length) {
3161
- payloadKeys.forEach(function (p) {
3162
- payload[p] = evaluatedOptions[p];
3163
- });
3164
- }
3165
-
3166
- eventCallbackProps[eventCallbackPropName] = function (ev) {
3167
- if (ev && ev.payload) {
3168
- payload = ev.payload;
3169
- }
3170
-
3171
- return onEventTrigger({
3172
- originalEvent: ev,
3173
- payload: payload,
3174
- type: eventName
3175
- });
3176
- };
3177
- });
3178
- } // compute pure viz props which are not from options
3179
-
3180
-
3181
- var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptions), eventCallbackProps), {
3182
- themeFunc: themeFunc
3183
- }));
3184
- /**
3185
- * PAGE_AND_SORT behavior
3186
- *
3187
- * Some visualizations, like table, requires metadata about the datasource,
3188
- * like total number of results, current count, offset, and sort, for rendering
3189
- * paginator and sorting direction. In this approach, the visualization
3190
- * allow users to set 'paginateDataSourceKey' to select which datasource
3191
- * should the visualization extract the metadata from. It defaults to 'primary' datasource.
3192
- * The visualization config should set the PAGE_AND_SORT behavior to receive
3193
- * 'requestParams', 'meta' and onRequestParams callback as props.
3194
- *
3195
- * In future, we could automatically detect which all datasources are being used
3196
- * and bind those magically to pagination/sorting behavior.
3197
- */
3198
-
3199
- var dataSourceMetadata = {};
3200
- var OptionKey = 'paginateDataSourceKey';
3201
- var paginateDataSourceKey = lodash_1.has(evaluatedOptions, OptionKey) && evaluatedOptions[OptionKey] || 'primary';
3202
-
3203
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
3204
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
3205
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
3206
-
3207
- var handleRequestParamsChange = function handleRequestParamsChange(payload) {
3208
- return onRequestParamsChange(paginateDataSourceKey, payload);
3209
- };
3210
-
3211
- var sortParams = getSorting_1.getSortingParams({
3212
- requestParams: requestParams,
3213
- meta: meta,
3214
- onRequestParamsChange: handleRequestParamsChange
3215
- });
3216
- var paginatorParams = getPagination_1.getPaginationParams({
3217
- requestParams: requestParams,
3218
- meta: meta,
3219
- onRequestParamsChange: handleRequestParamsChange
3220
- });
3221
- dataSourceMetadata = {
3222
- sortParams: sortParams,
3223
- paginatorParams: paginatorParams
3224
- };
3225
2960
  }
2961
+ }], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
2962
+ editorProps: {
2963
+ labelPosition: 'left',
2964
+ themes: themes
2965
+ }
2966
+ })], [DynamicMajorColorEditor_1.getDynamicMajorColorEditor({
2967
+ defaultContext: defaultContext,
2968
+ defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
2969
+ })], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
2970
+ editorProps: {
2971
+ labelPosition: 'left',
2972
+ themes: themes
2973
+ }
2974
+ })], [DynamicTrendColorEditor_1.getDynamicTrendColorEditor({
2975
+ defaultContext: defaultContext,
2976
+ defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
2977
+ })], RadialBackgroundColor_1.default({
2978
+ labelPosition: 'left',
2979
+ themes: themes
2980
+ }), [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
2981
+ editorProps: {
2982
+ labelPosition: 'left',
2983
+ themes: themes
2984
+ }
2985
+ })], [DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor({
2986
+ defaultContext: defaultContext,
2987
+ defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
2988
+ })]]
2989
+ }];
2990
+ /**
2991
+ * visualization configuration
2992
+ */
3226
2993
 
3227
- return React.createElement(SanitizedReactViz, Object.assign({
3228
- mode: mode,
3229
- width: width,
3230
- height: height
3231
- }, evaluatedOptions, computedVizProps, eventCallbackProps, dataSourceMetadata));
3232
- };
3233
-
3234
- DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
3235
- DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
3236
- // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
3237
- theme: {}
3238
- }); // attach viz config
2994
+ var config = {
2995
+ /**
2996
+ * unique viz key
2997
+ */
2998
+ key: 'splunk.singlevalueradial',
3239
2999
 
3240
- DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
3000
+ /**
3001
+ * viz name
3002
+ */
3003
+ name: 'Single Value Radial',
3004
+ category: VizCategory_1.VizCategory.SINGLE_VALUE,
3241
3005
 
3242
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
3006
+ /**
3007
+ * viz icon
3008
+ */
3009
+ icon: visualization_icons_1.SingleValueRadial,
3010
+ placeholderIcon: placeholders_1.SingleValueRadial,
3011
+ dataContract: dataContract,
3012
+ size: size,
3013
+ defaultContext: defaultContext,
3014
+ optionsSchema: optionsSchema,
3015
+ editorConfig: editorConfig,
3016
+ events: {
3017
+ 'value.click': {
3018
+ description: 'trigger when user clicks major value',
3019
+ payloadKeys: ['majorValue', 'trendValue']
3020
+ }
3021
+ },
3022
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
3023
+ themes: themes
3243
3024
  };
3244
-
3245
- exports.default = withDashboardViz;
3025
+ exports.default = configUtils_1.enhanceConfig(config);
3246
3026
 
3247
3027
  /***/ }),
3248
3028
 
3249
- /***/ 32:
3250
- /***/ (function(module, exports) {
3251
-
3252
- module.exports = require("@splunk/themes/getSettingsFromThemedProps");
3029
+ /***/ 456:
3030
+ /***/ (function(module, exports, __webpack_require__) {
3253
3031
 
3254
- /***/ }),
3032
+ "use strict";
3255
3033
 
3256
- /***/ 33:
3257
- /***/ (function(module, exports) {
3258
3034
 
3259
- module.exports = require("@splunk/visualization-encoding/Options");
3035
+ Object.defineProperty(exports, "__esModule", {
3036
+ value: true
3037
+ });
3260
3038
 
3261
- /***/ }),
3039
+ var i18n_1 = __webpack_require__(2);
3262
3040
 
3263
- /***/ 34:
3264
- /***/ (function(module, exports) {
3041
+ var radialBackground = function radialBackground(_ref) {
3042
+ var label = _ref.label,
3043
+ themes = _ref.themes,
3044
+ labelPosition = _ref.labelPosition;
3045
+ return [{
3046
+ label: i18n_1._(label || 'Radial Background'),
3047
+ option: 'radialBackgroundColor',
3048
+ editor: 'editor.color',
3049
+ editorProps: {
3050
+ labelPosition: labelPosition || 'top',
3051
+ themes: themes
3052
+ }
3053
+ }];
3054
+ };
3265
3055
 
3266
- module.exports = require("@splunk/visualizations-shared/SanitizeProps");
3056
+ exports.default = radialBackground;
3267
3057
 
3268
3058
  /***/ }),
3269
3059
 
3270
- /***/ 35:
3060
+ /***/ 47:
3271
3061
  /***/ (function(module, exports) {
3272
3062
 
3273
- module.exports = require("@splunk/moment");
3063
+ module.exports = require("@splunk/visualization-icons");
3274
3064
 
3275
3065
  /***/ }),
3276
3066
 
3277
- /***/ 36:
3278
- /***/ (function(module, exports, __webpack_require__) {
3067
+ /***/ 471:
3068
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
3279
3069
 
3280
3070
  "use strict";
3071
+ // ESM COMPAT FLAG
3072
+ __webpack_require__.r(__webpack_exports__);
3281
3073
 
3074
+ // EXTERNAL MODULE: external "@babel/runtime/helpers/extends"
3075
+ var extends_ = __webpack_require__(48);
3076
+ var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
3282
3077
 
3283
- var _classCallCheck = __webpack_require__(10);
3078
+ // EXTERNAL MODULE: external "react"
3079
+ var external_react_ = __webpack_require__(0);
3080
+ var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
3284
3081
 
3285
- Object.defineProperty(exports, "__esModule", {
3286
- value: true
3287
- });
3288
- exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
3289
- /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
3082
+ // EXTERNAL MODULE: external "prop-types"
3083
+ var external_prop_types_ = __webpack_require__(1);
3084
+ var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
3290
3085
 
3291
- var T = __webpack_require__(0);
3086
+ // EXTERNAL MODULE: external "@splunk/themes/pick"
3087
+ var pick_ = __webpack_require__(21);
3088
+ var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
3292
3089
 
3293
- var lodash_1 = __webpack_require__(3);
3090
+ // EXTERNAL MODULE: external "@splunk/themes/variables"
3091
+ var variables_ = __webpack_require__(9);
3092
+ var variables_default = /*#__PURE__*/__webpack_require__.n(variables_);
3294
3093
 
3295
- var VizActionHandler_1 = __webpack_require__(37); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
3094
+ // EXTERNAL MODULE: external "styled-components"
3095
+ var external_styled_components_ = __webpack_require__(4);
3096
+ var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
3296
3097
 
3098
+ // EXTERNAL MODULE: external "lodash/pick"
3099
+ var external_lodash_pick_ = __webpack_require__(71);
3100
+ var external_lodash_pick_default = /*#__PURE__*/__webpack_require__.n(external_lodash_pick_);
3297
3101
 
3298
- exports.INITIAL_WIDTH = 250;
3299
- exports.INITIAL_HEIGHT = 250;
3300
- /**
3301
- * A Splunk visualization
3302
- */
3102
+ // EXTERNAL MODULE: external "lodash/isEmpty"
3103
+ var isEmpty_ = __webpack_require__(72);
3104
+ var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
3303
3105
 
3304
- var SplunkVisualization = function SplunkVisualization() {
3305
- _classCallCheck(this, SplunkVisualization);
3306
- };
3106
+ // EXTERNAL MODULE: external "@splunk/visualizations-shared/style"
3107
+ var style_ = __webpack_require__(15);
3307
3108
 
3308
- SplunkVisualization.propTypes = {
3309
- /**
3310
- * display mode
3311
- */
3312
- mode: T.oneOf(['view', 'edit', 'export']).isRequired,
3109
+ // EXTERNAL MODULE: external "@splunk/visualizations-shared/SizeAwareWrapper"
3110
+ var SizeAwareWrapper_ = __webpack_require__(20);
3111
+ var SizeAwareWrapper_default = /*#__PURE__*/__webpack_require__.n(SizeAwareWrapper_);
3313
3112
 
3314
- /**
3315
- * width in pixel or string, defaults to 100%
3316
- */
3317
- width: T.oneOfType([T.string, T.number]).isRequired,
3113
+ // EXTERNAL MODULE: ./src/common/components/VizStyleWrapper.jsx
3114
+ var VizStyleWrapper = __webpack_require__(63);
3318
3115
 
3319
- /**
3320
- * height in pixel or string
3321
- */
3322
- height: T.oneOfType([T.string, T.number]).isRequired,
3116
+ // EXTERNAL MODULE: external "@babel/runtime/helpers/defineProperty"
3117
+ var defineProperty_ = __webpack_require__(7);
3118
+ var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
3323
3119
 
3324
- /**
3325
- * visualization context used for dynamic option evaluation
3326
- */
3327
- context: T.object,
3120
+ // EXTERNAL MODULE: ./src/SingleValueBasic/SingleValueBasic.jsx + 2 modules
3121
+ var SingleValueBasic = __webpack_require__(70);
3328
3122
 
3329
- /**
3330
- * visualization formatting options
3331
- */
3332
- options: T.object,
3123
+ // EXTERNAL MODULE: external "@splunk/visualizations-shared/colorConstants"
3124
+ var colorConstants_ = __webpack_require__(45);
3333
3125
 
3334
- /**
3335
- * A callback to update formatting options
3336
- */
3337
- onOptionsChange: T.func,
3126
+ // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialGraph.jsx
3338
3127
 
3339
- /**
3340
- * datasource state which include data and request params, object key indicate the datasource type.
3341
- */
3342
- dataSources: T.objectOf(T.shape({
3343
- /**
3344
- * current request params
3345
- */
3346
- requestParams: T.object,
3347
3128
 
3348
- /**
3349
- * current dataset
3350
- */
3351
- data: T.shape({
3352
- fields: T.array,
3353
- columns: T.array
3354
- }),
3355
3129
 
3356
- /**
3357
- * error
3358
- */
3359
- error: T.shape({
3360
- level: T.string,
3361
- message: T.string
3362
- }),
3363
3130
 
3364
- /**
3365
- * meta data that came with the dataset
3366
- */
3367
- meta: T.object
3368
- })),
3131
+ var RadialGraph_RadialGraph = function RadialGraph(_ref) {
3132
+ var progress = _ref.progress,
3133
+ strokeWidth = _ref.strokeWidth,
3134
+ _ref$backgroundColor = _ref.backgroundColor,
3135
+ backgroundColor = _ref$backgroundColor === void 0 ? colorConstants_["RADIAL_BACKGROUND_COLOR"] : _ref$backgroundColor,
3136
+ _ref$progressColor = _ref.progressColor,
3137
+ progressColor = _ref$progressColor === void 0 ? colorConstants_["RADIAL_STROKE_COLOR"] : _ref$progressColor,
3138
+ _ref$width = _ref.width,
3139
+ width = _ref$width === void 0 ? 200 : _ref$width,
3140
+ _ref$height = _ref.height,
3141
+ height = _ref$height === void 0 ? 200 : _ref$height;
3142
+ var semicircleRadius = height - strokeWidth / 2;
3143
+ var circumference = semicircleRadius * 2 * Math.PI;
3144
+ var bgCircleOffset = 0.5 * circumference;
3145
+ var progress50 = progress / 100 * 50;
3146
+ var progressWidth = progress50 / 100 * circumference;
3147
+ var strokeDashoffset = circumference * 0.5;
3148
+ return /*#__PURE__*/external_react_default.a.createElement("svg", {
3149
+ height: height,
3150
+ width: width,
3151
+ "data-test": "radial-visualization"
3152
+ }, /*#__PURE__*/external_react_default.a.createElement("g", null, /*#__PURE__*/external_react_default.a.createElement("circle", {
3153
+ "data-test": "background-radial",
3154
+ stroke: backgroundColor,
3155
+ fill: "transparent",
3156
+ strokeWidth: strokeWidth,
3157
+ strokeDasharray: "".concat(bgCircleOffset, " ").concat(circumference - bgCircleOffset),
3158
+ style: {
3159
+ strokeDashoffset: strokeDashoffset
3160
+ },
3161
+ r: semicircleRadius,
3162
+ cx: width / 2,
3163
+ cy: semicircleRadius + strokeWidth / 2
3164
+ }), /*#__PURE__*/external_react_default.a.createElement("circle", {
3165
+ "data-test": "progress-radial",
3166
+ stroke: progressColor,
3167
+ fill: "transparent",
3168
+ strokeWidth: strokeWidth,
3169
+ strokeDasharray: "".concat(progressWidth, " ").concat(circumference - progressWidth),
3170
+ style: {
3171
+ strokeDashoffset: strokeDashoffset
3172
+ },
3173
+ r: semicircleRadius,
3174
+ cx: width / 2,
3175
+ cy: semicircleRadius + strokeWidth / 2
3176
+ })));
3177
+ };
3369
3178
 
3370
- /**
3371
- * A callback to trigger event
3372
- */
3373
- onEventTrigger: T.func,
3179
+ RadialGraph_RadialGraph.propTypes = {
3180
+ progress: external_prop_types_default.a.number,
3181
+ strokeWidth: external_prop_types_default.a.number,
3182
+ backgroundColor: external_prop_types_default.a.string,
3183
+ progressColor: external_prop_types_default.a.string,
3184
+ width: external_prop_types_default.a.number,
3185
+ height: external_prop_types_default.a.number
3186
+ };
3187
+ RadialGraph_RadialGraph.defaultProps = {
3188
+ progress: 0,
3189
+ strokeWidth: 12
3190
+ };
3191
+ /* harmony default export */ var PureSingleValueRadial_RadialGraph = (RadialGraph_RadialGraph);
3192
+ // EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
3193
+ var singleValueUtils = __webpack_require__(22);
3374
3194
 
3375
- /**
3376
- * Inform viz if there are handlers listening to events
3377
- */
3378
- hasEventHandlers: T.bool,
3195
+ // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/displayUtils.js
3379
3196
 
3380
- /**
3381
- * A callback to communicate computed props to a consumer
3382
- */
3383
- onComputedProps: T.func,
3384
3197
 
3385
- /**
3386
- * A callback to obtain visualization api
3387
- */
3388
- vizActionHandlerRef: T.func,
3389
- loading: T.bool,
3390
- theme: T.object,
3198
+ var VALID_TREND_POSITIONS = ['standard', 'below', 'outside'];
3199
+ var MAJOR_FONT_THRESHOLD = 25;
3200
+ var TREND_FONT_THRESHOLD = 12;
3201
+ var DEFAULT_RADIAL_STROKE_WIDTH = 16;
3202
+ var SMALL_RADIAL_STROKE_WIDTH = 6;
3203
+ /**
3204
+ * Get the colors for a radial graph based on severity
3205
+ * @method getRadialColors
3206
+ * @param {Object} props
3207
+ * @param {Bool} props.backgroundEnabled
3208
+ * @param {String} props.backgroundColor
3209
+ * @returns {Object} { background, stroke } colors
3210
+ */
3211
+
3212
+ var displayUtils_getRadialColors = function getRadialColors(_ref) {
3213
+ var backgroundEnabled = _ref.backgroundEnabled,
3214
+ backgroundColor = _ref.backgroundColor;
3215
+ return Object(singleValueUtils["getGraphColors"])({
3216
+ backgroundEnabled: backgroundEnabled,
3217
+ backgroundColor: backgroundColor,
3218
+ defaultColors: colorConstants_["RADIAL_SEVERITY_COLORS"],
3219
+ customColorFormatter: function customColorFormatter(color) {
3220
+ return {
3221
+ background: Object(singleValueUtils["lighten"])(color),
3222
+ stroke: Object(singleValueUtils["darken"])(color)
3223
+ };
3224
+ }
3225
+ });
3226
+ };
3227
+ /**
3228
+ * Figure out the dimensions of the graph
3229
+ * @method getRadialGraphDimensions
3230
+ * @param {Object} props
3231
+ * @param {Number} props.width // Width of the container
3232
+ * @param {Number} props.height // Height of the container
3233
+ * @returns {Number} width and height of the graph
3234
+ */
3235
+
3236
+ var displayUtils_getRadialGraphDimensions = function getRadialGraphDimensions(_ref2) {
3237
+ var width = _ref2.width,
3238
+ height = _ref2.height; // height * 2 because we are fitting only half of a circle inside the container
3391
3239
 
3392
- /**
3393
- * A callback to request new data with updated request params
3394
- */
3395
- onRequestParamsChange: T.func
3240
+ var radius = Math.min(width, height * 2) / 2;
3241
+ return {
3242
+ width: width - singleValueUtils["SVR_PADDING"].left - singleValueUtils["SVR_PADDING"].right,
3243
+ height: radius - singleValueUtils["SVR_PADDING"].top - singleValueUtils["SVR_PADDING"].bottom
3244
+ };
3396
3245
  };
3397
3246
  /**
3398
- *
3247
+ * Figure out the dimensions of the content container for SVR
3248
+ * @method getRadialHelperDimensions
3249
+ * @param {Object} props
3250
+ * @param {Number} props.width // Width of the visualization space
3251
+ * @param {Number} props.height // Height of the visualization space
3252
+ * @returns {Number} width and height of the content graph
3399
3253
  */
3400
3254
 
3401
- SplunkVisualization.defaultProps = {
3402
- // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
3403
- width: '100%',
3404
- height: exports.INITIAL_HEIGHT,
3405
- dataSources: {},
3406
- onEventTrigger: function onEventTrigger() {
3407
- return {};
3408
- },
3409
- mode: 'view',
3410
- hasEventHandlers: false,
3411
- options: {},
3412
- context: {},
3413
- onOptionsChange: function onOptionsChange() {
3414
- return {};
3415
- },
3416
- vizActionHandlerRef: function vizActionHandlerRef() {
3417
- return new VizActionHandler_1.DefaultVizActionHandler();
3418
- },
3419
- onComputedProps: function onComputedProps() {
3420
- return {};
3421
- },
3422
- loading: false,
3423
- onRequestParamsChange: lodash_1.noop
3424
- };
3425
- exports.default = SplunkVisualization;
3426
-
3427
- /***/ }),
3428
-
3429
- /***/ 37:
3430
- /***/ (function(module, exports, __webpack_require__) {
3431
-
3432
- "use strict";
3255
+ var getRadialHelperDimensions = function getRadialHelperDimensions(_ref3) {
3256
+ var height = _ref3.height,
3257
+ _ref3$strokeWidth = _ref3.strokeWidth,
3258
+ strokeWidth = _ref3$strokeWidth === void 0 ? DEFAULT_RADIAL_STROKE_WIDTH : _ref3$strokeWidth; // The radius of the visualization is equal to the height
3433
3259
 
3260
+ var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
3434
3261
 
3435
- var _classCallCheck = __webpack_require__(10);
3262
+ var innerArcRadius = semicircleRadius * 0.9;
3263
+ var halfContentWidth = innerArcRadius * 0.7;
3264
+ var contentHeight = Math.floor(Math.sqrt(Math.pow(innerArcRadius, 2) - Math.pow(halfContentWidth, 2)));
3265
+ return {
3266
+ contentWidth: halfContentWidth * 2,
3267
+ contentHeight: contentHeight,
3268
+ helperArcRadius: innerArcRadius,
3269
+ semicircleRadius: semicircleRadius
3270
+ };
3271
+ };
3272
+ /**
3273
+ * Get the maximum size of the container that holds the graph text
3274
+ * @method getValueContentSize
3275
+ * @param {Object} props
3276
+ * @param {Number} props.graphSize
3277
+ * @param {Number} props.radialStrokeWidth // Stroke width of the graph
3278
+ * @returns {Number} content size for showing major and trend values in radial graph
3279
+ */
3436
3280
 
3437
- var _createClass = __webpack_require__(18);
3281
+ var getValueContentSize = function getValueContentSize(_ref4) {
3282
+ var graphSize = _ref4.graphSize,
3283
+ radialStrokeWidth = _ref4.radialStrokeWidth; // Account for the graph's stroke width
3438
3284
 
3439
- Object.defineProperty(exports, "__esModule", {
3440
- value: true
3441
- });
3442
- exports.DefaultVizActionHandler = void 0;
3285
+ var diameter = graphSize - radialStrokeWidth; // Use pythagoreum theorum with circle diameter
3286
+ // to calculate the size of the sides of the square inside the circle
3443
3287
 
3444
- var DefaultVizActionHandler = /*#__PURE__*/function () {
3445
- function DefaultVizActionHandler() {
3446
- _classCallCheck(this, DefaultVizActionHandler);
3447
- }
3288
+ return Math.floor(Math.sqrt(Math.pow(diameter, 2) / 2));
3289
+ };
3290
+ /*
3291
+ * @method getRadialStrokeWidth
3292
+ * @param {Number} graphHeight
3293
+ * @returns {Number} radial stroke width
3294
+ */
3448
3295
 
3449
- _createClass(DefaultVizActionHandler, [{
3450
- key: "focus",
3451
- value: function focus() {// noop
3452
- }
3453
- }, {
3454
- key: "snapshot",
3455
- value: function snapshot() {
3456
- return null; // noop
3457
- }
3458
- }]);
3296
+ var getRadialStrokeWidth = function getRadialStrokeWidth(graphHeight) {
3297
+ return graphHeight >= 90 ? DEFAULT_RADIAL_STROKE_WIDTH : SMALL_RADIAL_STROKE_WIDTH;
3298
+ };
3299
+ /*
3300
+ * @method isValidPosition
3301
+ * @param {String} position
3302
+ * @returns {Bool}
3303
+ */
3459
3304
 
3460
- return DefaultVizActionHandler;
3461
- }();
3305
+ var isValidPosition = function isValidPosition(position) {
3306
+ return VALID_TREND_POSITIONS.indexOf(position) > -1;
3307
+ };
3308
+ /*
3309
+ * @method showTrendPositionStandard
3310
+ * @param {Object} props
3311
+ * @param {Bool} props.showTrendIndicator
3312
+ * @param {String} props.position
3313
+ * @returns {Bool}
3314
+ */
3462
3315
 
3463
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
3316
+ var showTrendPositionStandard = function showTrendPositionStandard(_ref5) {
3317
+ var showTrendIndicator = _ref5.showTrendIndicator,
3318
+ position = _ref5.position;
3319
+ return showTrendIndicator && position === 'standard';
3320
+ };
3321
+ /*
3322
+ * @method showTrendPositionBelow
3323
+ * @param {Object} props
3324
+ * @param {Bool} props.showTrendIndicator
3325
+ * @param {String} props.position
3326
+ * @returns {Bool}
3327
+ */
3464
3328
 
3465
- /***/ }),
3329
+ var showTrendPositionBelow = function showTrendPositionBelow(_ref6) {
3330
+ var showTrendIndicator = _ref6.showTrendIndicator,
3331
+ position = _ref6.position;
3332
+ return showTrendIndicator && position === 'below';
3333
+ };
3334
+ /*
3335
+ * @method showTrendPositionOutside
3336
+ * @param {Object} props
3337
+ * @param {Bool} props.showTrendIndicator
3338
+ * @param {String} props.position
3339
+ * @returns {Bool}
3340
+ */
3466
3341
 
3467
- /***/ 38:
3468
- /***/ (function(module, exports, __webpack_require__) {
3342
+ var showTrendPositionOutside = function showTrendPositionOutside(_ref7) {
3343
+ var showTrendIndicator = _ref7.showTrendIndicator,
3344
+ position = _ref7.position;
3345
+ return showTrendIndicator && position === 'outside';
3346
+ };
3347
+ /*
3348
+ * need to handle max and min
3349
+ * @method getRadialProgress
3350
+ * @param {Number} majorValue
3351
+ * @returns {Number} progress bar in radial graph
3352
+ */
3469
3353
 
3470
- "use strict";
3354
+ var getRadialProgress = function getRadialProgress(majorValue, maxValue) {
3355
+ return Number.isNaN(Number(majorValue)) || Number.isNaN(Number(maxValue)) || majorValue < 0 && majorValue < maxValue ? 0 : majorValue / maxValue * 100;
3356
+ };
3357
+ // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
3471
3358
 
3472
3359
 
3473
- Object.defineProperty(exports, "__esModule", {
3474
- value: true
3475
- });
3476
- exports.validSortDirs = void 0;
3477
- exports.validSortDirs = ['asc', 'desc', 'none'];
3478
3360
 
3479
- /***/ }),
3361
+ function ownKeys(object, enumerableOnly) {
3362
+ var keys = Object.keys(object);
3480
3363
 
3481
- /***/ 39:
3482
- /***/ (function(module, exports, __webpack_require__) {
3364
+ if (Object.getOwnPropertySymbols) {
3365
+ var symbols = Object.getOwnPropertySymbols(object);
3366
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
3367
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
3368
+ });
3369
+ keys.push.apply(keys, symbols);
3370
+ }
3483
3371
 
3484
- "use strict";
3372
+ return keys;
3373
+ }
3485
3374
 
3375
+ function _objectSpread(target) {
3376
+ for (var i = 1; i < arguments.length; i++) {
3377
+ var source = arguments[i] != null ? arguments[i] : {};
3486
3378
 
3487
- Object.defineProperty(exports, "__esModule", {
3488
- value: true
3489
- });
3490
- exports.useDeepMemo = void 0;
3379
+ if (i % 2) {
3380
+ ownKeys(Object(source), true).forEach(function (key) {
3381
+ defineProperty_default()(target, key, source[key]);
3382
+ });
3383
+ } else if (Object.getOwnPropertyDescriptors) {
3384
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
3385
+ } else {
3386
+ ownKeys(Object(source)).forEach(function (key) {
3387
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
3388
+ });
3389
+ }
3390
+ }
3491
3391
 
3492
- var react_1 = __webpack_require__(1);
3392
+ return target;
3393
+ }
3493
3394
 
3494
- var lodash_1 = __webpack_require__(3);
3495
- /**
3496
- * This hook evaluates and stores the result of a passed function and only
3497
- * re-evaluates the function when passed dependencies change.
3498
- *
3499
- * It is different from the internal React useMemo in the following aspects:
3500
- * - it only stores the last evaluated result
3501
- * - it uses a deep equality check to determine if dependencies have changed
3502
- *
3503
- * Inspired by apollo-client's useDeepMemo
3504
- *
3505
- * @param fn the function to be executed and
3506
- * @param dependencies an array of dependencies
3507
- */
3508
3395
 
3509
3396
 
3510
- var useDeepMemo = function useDeepMemo(fn, dependencies) {
3511
- var ref = react_1.useRef();
3512
3397
 
3513
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
3514
- ref.current = {
3515
- dependencies: dependencies,
3516
- value: fn()
3517
- };
3518
- }
3519
3398
 
3520
- return ref.current.value;
3521
- };
3522
3399
 
3523
- exports.useDeepMemo = useDeepMemo;
3524
3400
 
3525
- /***/ }),
3401
+ var TextContainer = external_styled_components_default.a.div.withConfig({
3402
+ displayName: "RadialLayout__TextContainer",
3403
+ componentId: "sc-13x2rjt-0"
3404
+ })(["position:", ";left:0;bottom:0;width:100%;display:flex;align-items:", ";justify-content:center;flex-direction:column;[data-test='majorValue']{", "::before{font-size:inherit;vertical-align:unset;top:unset;}::after{font-size:inherit;vertical-align:unset;top:unset;}}[data-test='trendValueIndicator']{align-items:flex-end;", "}[data-test='trendValue']{", "}div[class^='TrendValue__Column']{", "}"], function (props) {
3405
+ return props.smallViz ? 'relative' : 'absolute';
3406
+ }, function (props) {
3407
+ return props.align || 'center';
3408
+ }, function (props) {
3409
+ return !props.smallViz && {
3410
+ lineHeight: 'normal'
3411
+ };
3412
+ }, function (props) {
3413
+ return props.smallViz && {
3414
+ marginLeft: '1px'
3415
+ };
3416
+ }, function (props) {
3417
+ return props.smallViz && {
3418
+ marginLeft: '1px'
3419
+ };
3420
+ }, function (props) {
3421
+ return props.smallViz && {
3422
+ margin: '0 1px'
3423
+ };
3424
+ });
3425
+ var GraphContainer = external_styled_components_default.a.div.withConfig({
3426
+ displayName: "RadialLayout__GraphContainer",
3427
+ componentId: "sc-13x2rjt-1"
3428
+ })(["position:relative;margin:0 auto;width:", "px;height:", "px;display:flex;justify-content:center;align-items:center;flex-direction:column;"], function (props) {
3429
+ return props.width;
3430
+ }, function (props) {
3431
+ return props.height;
3432
+ });
3433
+ var UnderLabelContainer = external_styled_components_default.a.div.withConfig({
3434
+ displayName: "RadialLayout__UnderLabelContainer",
3435
+ componentId: "sc-13x2rjt-2"
3436
+ })(["display:flex;flex:0 0 ", "px;align-items:flex-end;"], function (props) {
3437
+ return props.underLabelHeight;
3438
+ });
3439
+ var UnderLabelText = external_styled_components_default.a.span.withConfig({
3440
+ displayName: "RadialLayout__UnderLabelText",
3441
+ componentId: "sc-13x2rjt-3"
3442
+ })(["color:", ";-webkit-text-stroke:0.5px ", ";font-size:12px;max-width:", "px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], function (props) {
3443
+ return props.color;
3444
+ }, function (props) {
3445
+ return props.strokeColor;
3446
+ }, function (props) {
3447
+ return props.maxWidth;
3448
+ });
3526
3449
 
3527
- /***/ 4:
3528
- /***/ (function(module, exports) {
3450
+ var RadialLayout_RadialContent = function RadialContent(_ref) {
3451
+ var props = extends_default()({}, _ref);
3529
3452
 
3530
- module.exports = require("styled-components");
3453
+ var majorColor = props.majorColor,
3454
+ majorText = props.majorText,
3455
+ majorTextFontSize = props.majorTextFontSize,
3456
+ majorValueTitle = props.majorValueTitle,
3457
+ trendColor = props.trendColor,
3458
+ trendText = props.trendText,
3459
+ trendTextFontSize = props.trendTextFontSize,
3460
+ showTrendIndicator = props.showTrendIndicator,
3461
+ unit = props.unit,
3462
+ unitPosition = props.unitPosition,
3463
+ underLabelColor = props.underLabelColor,
3464
+ underLabel = props.underLabel,
3465
+ onValueClick = props.onValueClick,
3466
+ showRadialGraph = props.showRadialGraph,
3467
+ progress = props.progress,
3468
+ radialBackgroundColor = props.radialBackgroundColor,
3469
+ radialStrokeColor = props.radialStrokeColor,
3470
+ radialStrokeWidth = props.radialStrokeWidth,
3471
+ graphWidth = props.graphWidth,
3472
+ graphHeight = props.graphHeight,
3473
+ underLabelStrokeColor = props.underLabelStrokeColor;
3531
3474
 
3532
- /***/ }),
3475
+ var _getRadialHelperDimen = getRadialHelperDimensions({
3476
+ height: graphHeight,
3477
+ strokeWidth: radialStrokeWidth
3478
+ }),
3479
+ semicircleRadius = _getRadialHelperDimen.semicircleRadius,
3480
+ helperArcRadius = _getRadialHelperDimen.helperArcRadius; // Two cases for filling underLabel space: either the semicircle radius is insufficiently sized for text
3481
+ // or the radial visualization has been disabled (first condition reached first when making smaller).
3533
3482
 
3534
- /***/ 40:
3535
- /***/ (function(module, exports, __webpack_require__) {
3536
3483
 
3537
- "use strict";
3484
+ var fillVacantSpace = semicircleRadius < 50 || !showRadialGraph; // If filling the vacant space, no height on underLabel container. Otherwise, the underLabel height is 20% of the helperArcRadius (min 20px).
3538
3485
 
3486
+ var underLabelHeight = fillVacantSpace ? 0 : Math.max(helperArcRadius * 0.2, 20);
3487
+ var underLabelWidth = helperArcRadius * 2;
3488
+ var basicSingleValues = /*#__PURE__*/external_react_default.a.createElement(SingleValueBasic["default"], {
3489
+ majorColor: majorColor,
3490
+ majorText: majorText,
3491
+ majorTextFontSize: majorTextFontSize,
3492
+ majorValueTitle: majorValueTitle,
3493
+ trendColor: trendColor,
3494
+ trendText: trendText,
3495
+ trendTextFontSize: trendTextFontSize,
3496
+ showTrendIndicator: showTrendIndicator,
3497
+ unit: unit,
3498
+ unitPosition: unitPosition,
3499
+ onValueClick: onValueClick
3500
+ });
3501
+ var radialGraph = showRadialGraph ? /*#__PURE__*/external_react_default.a.createElement(PureSingleValueRadial_RadialGraph, {
3502
+ progress: progress,
3503
+ backgroundColor: radialBackgroundColor,
3504
+ progressColor: radialStrokeColor,
3505
+ strokeWidth: radialStrokeWidth,
3506
+ width: graphWidth,
3507
+ height: graphHeight
3508
+ }) : null;
3509
+ var underLabelComponent = /*#__PURE__*/external_react_default.a.createElement(UnderLabelContainer, {
3510
+ underLabelHeight: underLabelHeight
3511
+ }, !fillVacantSpace && underLabel && /*#__PURE__*/external_react_default.a.createElement(UnderLabelText, {
3512
+ "data-test": "underLabel",
3513
+ maxWidth: underLabelWidth * 0.9 // buffer for overflow ellipses
3514
+ ,
3515
+ color: underLabelColor,
3516
+ strokeColor: underLabelStrokeColor,
3517
+ title: underLabel
3518
+ }, underLabel));
3519
+ return /*#__PURE__*/external_react_default.a.createElement(GraphContainer, {
3520
+ width: graphWidth,
3521
+ height: graphHeight
3522
+ }, radialGraph, /*#__PURE__*/external_react_default.a.createElement(TextContainer, {
3523
+ smallViz: !showRadialGraph,
3524
+ height: graphHeight
3525
+ }, basicSingleValues, underLabelComponent));
3526
+ };
3539
3527
 
3540
- Object.defineProperty(exports, "__esModule", {
3541
- value: true
3528
+ RadialLayout_RadialContent.propTypes = _objectSpread(_objectSpread({}, SingleValueBasic["default"].propTypes), {}, {
3529
+ trendPosition: external_prop_types_default.a.string,
3530
+ showRadialGraph: external_prop_types_default.a.bool,
3531
+ progress: external_prop_types_default.a.number,
3532
+ radialBackgroundColor: external_prop_types_default.a.string,
3533
+ radialStrokeColor: external_prop_types_default.a.string,
3534
+ radialStrokeWidth: external_prop_types_default.a.number,
3535
+ graphWidth: external_prop_types_default.a.number,
3536
+ graphHeight: external_prop_types_default.a.number,
3537
+ underLabelStrokeColor: external_prop_types_default.a.string
3542
3538
  });
3543
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
3544
-
3545
- var React = __webpack_require__(1);
3546
-
3547
- var T = __webpack_require__(0);
3548
-
3549
- var i18n_1 = __webpack_require__(2);
3539
+ /* harmony default export */ var RadialLayout = (RadialLayout_RadialContent);
3540
+ // CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/SingleValueRadial.jsx
3550
3541
 
3551
- var Message_1 = __webpack_require__(9);
3552
3542
 
3553
- var FixedSizeContainer_1 = __webpack_require__(12);
3554
- /**
3555
- * @method isMissing
3556
- * @param {any} v
3557
- * @returns {boolean} true if the input value === null or undefined
3558
- */
3559
3543
 
3560
3544
 
3561
- var isMissing = function isMissing(v) {
3562
- return v === null || v === undefined;
3563
- };
3564
3545
 
3565
- exports.isMissing = isMissing;
3566
- /**
3567
- * @method misskingKeys
3568
- * @param {string[]} keys
3569
- * @param {object} target
3570
- * @returns {string[]} the keys of missing required props
3571
- */
3572
3546
 
3573
- var missingKeys = function missingKeys(keys, target) {
3574
- return keys.filter(function (k) {
3575
- return exports.isMissing(target[k]);
3576
- });
3577
- };
3578
3547
 
3579
- exports.missingKeys = missingKeys;
3580
- var propTypes = {
3581
- width: T.oneOfType([T.string, T.number]),
3582
- height: T.oneOfType([T.string, T.number]),
3583
- // eslint-disable-next-line react/no-unused-prop-types
3584
- backgroundColor: T.string,
3585
- missingProps: T.arrayOf(T.string)
3586
- };
3587
- /**
3588
- * @method MissingPropsMessage
3589
- * @param {MissingPropsProps} props
3590
- * @returns {React.ReactElement}
3591
- */
3592
3548
 
3593
- var MissingPropsMessage = function MissingPropsMessage(props) {
3594
- var width = props.width,
3595
- height = props.height,
3596
- missingProps = props.missingProps;
3597
- return React.createElement(Message_1.default, {
3598
- "data-test": "message",
3599
- width: width,
3600
- height: height,
3601
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
3602
- });
3603
- };
3604
3549
 
3605
- exports.MissingPropsMessage = MissingPropsMessage;
3606
- exports.MissingPropsMessage.propTypes = propTypes;
3607
- exports.MissingPropsMessage.defaultProps = {
3608
- width: '100%',
3609
- height: 250
3610
- };
3611
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
3612
3550
 
3613
- /***/ }),
3614
3551
 
3615
- /***/ 41:
3616
- /***/ (function(module, exports, __webpack_require__) {
3617
3552
 
3618
- "use strict";
3619
3553
 
3620
3554
 
3621
- Object.defineProperty(exports, "__esModule", {
3622
- value: true
3555
+ var Container = external_styled_components_default.a.div.withConfig({
3556
+ displayName: "SingleValueRadial__Container",
3557
+ componentId: "sc-404dvw-0"
3558
+ })(["overflow:hidden;", ";"], function (props) {
3559
+ return Object(style_["toDimension"])(external_lodash_pick_default()(props, ['width', 'height']));
3623
3560
  });
3624
3561
 
3625
- var React = __webpack_require__(1);
3626
-
3627
- var styled_components_1 = __webpack_require__(4);
3628
-
3629
- var hocUtils_1 = __webpack_require__(13);
3562
+ var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
3563
+ var props = extends_default()({}, _ref);
3630
3564
 
3631
- var Cover = styled_components_1.default.div.withConfig({
3632
- displayName: "withEditModeCover__Cover",
3633
- componentId: "sc-1gsbnxb-0"
3634
- })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3635
- var Blocker = styled_components_1.default.div.attrs({
3636
- 'data-splunk-visualization-version': "25.1.0 - 812a9a4d8"
3637
- }).withConfig({
3638
- displayName: "withEditModeCover__Blocker",
3639
- componentId: "sc-1gsbnxb-1"
3640
- })(["position:relative;width:100%;height:100%;"]);
3641
- /**
3642
- * HOC that renders a cover layer in edit mode
3643
- * @method withEditModeCover
3644
- * @param {ExtendedDashViz} Visualization
3645
- * @returns {ExtendedDashViz} Wrapper
3646
- */
3565
+ var width = props.width,
3566
+ _props$height = props.height,
3567
+ height = _props$height === void 0 ? 250 : _props$height,
3568
+ style = props.style,
3569
+ majorFontSize = props.majorFontSize,
3570
+ majorValue = props.majorValue,
3571
+ majorValueField = props.majorValueField,
3572
+ maxValue = props.maxValue,
3573
+ trendValue = props.trendValue,
3574
+ trendFontSize = props.trendFontSize,
3575
+ unitPosition = props.unitPosition,
3576
+ numberPrecision = props.numberPrecision,
3577
+ shouldUseThousandSeparators = props.shouldUseThousandSeparators,
3578
+ shouldAbbreviateTrendValue = props.shouldAbbreviateTrendValue,
3579
+ onValueClick = props.onValueClick; // calculate colors
3647
3580
 
3648
- var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
3649
- var Wrapper = function Wrapper(props) {
3650
- var mode = props.mode;
3651
- var showEditCover = mode === 'edit' && !disableEditModeCover;
3652
- return React.createElement(Blocker, null, React.createElement(Visualization, Object.assign({}, props)), showEditCover && React.createElement(Cover, {
3653
- "data-test": "edit-mode-cover"
3654
- }));
3581
+ var defaultColors = {
3582
+ defaultFontColor: pick_default()({
3583
+ enterprise: {
3584
+ dark: variables_default.a.textColor(props),
3585
+ light: variables_default.a.gray20(props)
3586
+ },
3587
+ prisma: variables_default.a.contentColorActive(props)
3588
+ })(props),
3589
+ defaultBlockFontColor: pick_default()({
3590
+ enterprise: variables_default.a.white(props),
3591
+ prisma: variables_default.a.contentColorActive(props)
3592
+ })(props)
3655
3593
  };
3656
3594
 
3657
- hocUtils_1.extendStaticWrapperProps({
3658
- Wrapper: Wrapper,
3659
- Visualization: Visualization
3660
- });
3661
- return Wrapper;
3662
- };
3663
-
3664
- exports.default = withEditModeCover;
3665
-
3666
- /***/ }),
3667
-
3668
- /***/ 42:
3669
- /***/ (function(module, exports, __webpack_require__) {
3595
+ var _computeColors = Object(singleValueUtils["computeColors"])(props, defaultColors),
3596
+ backgroundEnabled = _computeColors.backgroundEnabled,
3597
+ backgroundColor = _computeColors.backgroundColor,
3598
+ majorColor = _computeColors.majorColor,
3599
+ trendColor = _computeColors.trendColor,
3600
+ underLabelColor = _computeColors.underLabelColor;
3670
3601
 
3671
- "use strict";
3602
+ var radialColors = displayUtils_getRadialColors({
3603
+ backgroundEnabled: backgroundEnabled,
3604
+ backgroundColor: backgroundColor
3605
+ });
3606
+ var radialBackgroundColor = props.radialBackgroundColor || radialColors.background;
3607
+ var radialStrokeColor = props.radialStrokeColor || radialColors.stroke;
3608
+ var underLabelStrokeColor = backgroundEnabled ? backgroundColor : 'transparent';
3609
+ var handleValueClick = Object(external_react_["useCallback"])(function (ev) {
3610
+ return Object(singleValueUtils["handleValueClickCallback"])(ev, majorValue, majorValueField, trendValue, onValueClick);
3611
+ }, [onValueClick, majorValue, majorValueField, trendValue]);
3672
3612
 
3613
+ var renderVisualization = function renderVisualization(_ref2) {
3614
+ var containerWidth = _ref2.width,
3615
+ containerHeight = _ref2.height;
3616
+ var underLabel = props.underLabel;
3617
+ var trendDisplay = props.trendDisplay,
3618
+ unit = props.unit; // calculate radial graph dimensions, strokewidth, and major and trend content dimensions
3673
3619
 
3674
- Object.defineProperty(exports, "__esModule", {
3675
- value: true
3676
- });
3620
+ var _getRadialGraphDimens = displayUtils_getRadialGraphDimensions({
3621
+ width: containerWidth,
3622
+ height: containerHeight
3623
+ }),
3624
+ graphWidth = _getRadialGraphDimens.width,
3625
+ graphHeight = _getRadialGraphDimens.height; // Radial stroke width is stepped to lower value at lower sizes.
3677
3626
 
3678
- var React = __webpack_require__(1);
3679
3627
 
3680
- var colorUtils_1 = __webpack_require__(11);
3628
+ var radialStrokeWidth = getRadialStrokeWidth(graphHeight);
3681
3629
 
3682
- var variables_1 = __webpack_require__(8);
3630
+ var _getRadialHelperDimen = getRadialHelperDimensions({
3631
+ height: graphHeight - radialStrokeWidth / 2,
3632
+ strokeWidth: radialStrokeWidth
3633
+ }),
3634
+ contentWidth = _getRadialHelperDimen.contentWidth,
3635
+ contentHeight = _getRadialHelperDimen.contentHeight; // Subtract half of the stroke width for the exact internal radius.
3683
3636
 
3684
- var IconPlaceholder_1 = __webpack_require__(27);
3685
3637
 
3686
- var VizBehavior_1 = __webpack_require__(5);
3638
+ var semicircleRadius = graphHeight - radialStrokeWidth / 2; // 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.
3687
3639
 
3688
- var hocUtils_1 = __webpack_require__(13);
3640
+ var showRadialGraph = semicircleRadius >= 20; // If not showing the radial graph, then can forgo padding logic and use original container dimensions for content sizing computation.
3689
3641
 
3690
- var withPlaceholder = function withPlaceholder(Visualization) {
3691
- var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
3692
- var config = Visualization.config;
3693
- var themes = config.themes;
3642
+ if (!showRadialGraph) {
3643
+ graphWidth = containerWidth;
3644
+ contentWidth = containerWidth;
3645
+ graphHeight = containerHeight;
3646
+ contentHeight = containerHeight;
3647
+ }
3694
3648
 
3695
- var Wrapper = function Wrapper(props) {
3696
- var _a, _b;
3649
+ var _computeSingleValueRa = Object(singleValueUtils["computeSingleValueRadialContent"])({
3650
+ majorValue: majorValue,
3651
+ trendValue: trendValue,
3652
+ majorFontSize: majorFontSize,
3653
+ trendFontSize: trendFontSize,
3654
+ trendDisplay: trendDisplay,
3655
+ contentWidth: contentWidth,
3656
+ contentHeight: contentHeight,
3657
+ // buffer for height of div
3658
+ containerWidth: containerWidth * 0.9,
3659
+ containerHeight: containerHeight * 0.9,
3660
+ unit: unit,
3661
+ numberPrecision: numberPrecision,
3662
+ shouldUseThousandSeparators: shouldUseThousandSeparators,
3663
+ shouldAbbreviateTrendValue: shouldAbbreviateTrendValue,
3664
+ smallViz: !showRadialGraph
3665
+ }),
3666
+ majorText = _computeSingleValueRa.majorText,
3667
+ trendText = _computeSingleValueRa.trendText,
3668
+ majorTextFontSize = _computeSingleValueRa.majorTextFontSize,
3669
+ trendTextFontSize = _computeSingleValueRa.trendTextFontSize,
3670
+ majorValueTitle = _computeSingleValueRa.majorValueTitle,
3671
+ smallVizProps = _computeSingleValueRa.smallVizProps;
3697
3672
 
3698
- var dataSources = props.dataSources,
3699
- loading = props.loading,
3700
- options = props.options,
3701
- height = props.height,
3702
- width = props.width;
3703
- var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
3704
- 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);
3705
- var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
3706
- var iconColor = variables_1.default.contentColorActive(props);
3673
+ if (!isEmpty_default()(smallVizProps)) {
3674
+ trendDisplay = smallVizProps.trendDisplay;
3675
+ unit = smallVizProps.unit;
3676
+ } // calculate radial progress
3707
3677
 
3708
- if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
3709
- return React.createElement(IconPlaceholder_1.default, {
3710
- "data-test": "icon-placeholder",
3711
- icon: icon,
3712
- width: width,
3713
- height: height,
3714
- backgroundColor: bgColorFromTheme,
3715
- iconColor: iconColor
3716
- });
3717
- }
3718
3678
 
3719
- return React.createElement(Visualization, Object.assign({}, props));
3679
+ var progress = getRadialProgress(majorValue, maxValue);
3680
+ return /*#__PURE__*/external_react_default.a.createElement(VizStyleWrapper["default"], {
3681
+ backgroundColor: backgroundColor,
3682
+ style: style,
3683
+ dataTestKey: "SingleValueRadialWrapper"
3684
+ }, /*#__PURE__*/external_react_default.a.createElement(RadialLayout, {
3685
+ "data-test": "RadialLayout",
3686
+ majorColor: majorColor,
3687
+ majorText: majorText,
3688
+ majorTextFontSize: majorTextFontSize,
3689
+ majorValueTitle: majorValueTitle,
3690
+ trendColor: trendColor,
3691
+ trendText: trendText,
3692
+ trendTextFontSize: trendTextFontSize,
3693
+ showTrendIndicator: Object(singleValueUtils["shouldShowTrend"])(trendDisplay),
3694
+ unit: unit,
3695
+ unitPosition: unitPosition,
3696
+ underLabelColor: underLabelColor,
3697
+ underLabel: underLabel,
3698
+ onValueClick: handleValueClick,
3699
+ showRadialGraph: showRadialGraph,
3700
+ progress: progress,
3701
+ radialBackgroundColor: radialBackgroundColor,
3702
+ radialStrokeColor: radialStrokeColor,
3703
+ radialStrokeWidth: radialStrokeWidth,
3704
+ graphWidth: graphWidth,
3705
+ graphHeight: graphHeight,
3706
+ underLabelStrokeColor: underLabelStrokeColor
3707
+ }));
3720
3708
  };
3721
3709
 
3722
- hocUtils_1.extendStaticWrapperProps({
3723
- Wrapper: Wrapper,
3724
- Visualization: Visualization
3725
- });
3726
- return Wrapper;
3710
+ return /*#__PURE__*/external_react_default.a.createElement(Container, {
3711
+ width: width,
3712
+ height: height
3713
+ }, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
3714
+ return renderVisualization(containerDimension);
3715
+ }));
3727
3716
  };
3728
3717
 
3729
- exports.default = withPlaceholder;
3730
-
3731
- /***/ }),
3732
-
3733
- /***/ 43:
3734
- /***/ (function(module, exports) {
3735
-
3736
- module.exports = require("@splunk/visualizations-shared/colorConstants");
3737
-
3738
- /***/ }),
3739
-
3740
- /***/ 45:
3741
- /***/ (function(module, exports) {
3742
-
3743
- module.exports = require("@splunk/visualization-icons/placeholders");
3718
+ SingleValueRadial_SingleValueRadial.propTypes = {
3719
+ width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
3720
+ height: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
3721
+ style: external_prop_types_default.a.object,
3722
+ majorValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
3723
+ majorValueField: external_prop_types_default.a.string,
3724
+ majorColor: external_prop_types_default.a.string,
3725
+ majorFontSize: external_prop_types_default.a.number,
3726
+ maxValue: external_prop_types_default.a.number,
3727
+ trendValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
3728
+ trendColor: external_prop_types_default.a.string,
3729
+ trendFontSize: external_prop_types_default.a.number,
3730
+ trendDisplay: external_prop_types_default.a.string,
3731
+ trendIndicatorPosition: external_prop_types_default.a.oneOf(['standard', 'below', 'outside']),
3732
+ shouldAbbreviateTrendValue: external_prop_types_default.a.bool,
3733
+ backgroundColor: external_prop_types_default.a.string,
3734
+ unit: external_prop_types_default.a.string,
3735
+ unitPosition: external_prop_types_default.a.string,
3736
+ underLabel: external_prop_types_default.a.string,
3737
+ numberPrecision: external_prop_types_default.a.number,
3738
+ shouldUseThousandSeparators: external_prop_types_default.a.bool,
3739
+ radialBackgroundColor: external_prop_types_default.a.string,
3740
+ radialStrokeColor: external_prop_types_default.a.string,
3741
+ onValueClick: external_prop_types_default.a.func
3742
+ };
3743
+ SingleValueRadial_SingleValueRadial.defaultProps = {
3744
+ width: '100%',
3745
+ height: 250,
3746
+ majorValue: 'N/A',
3747
+ majorValueField: '',
3748
+ maxValue: 100,
3749
+ trendDisplay: 'absolute',
3750
+ trendIndicatorPosition: 'standard',
3751
+ shouldAbbreviateTrendValue: false,
3752
+ unitPosition: 'after',
3753
+ numberPrecision: 0,
3754
+ shouldUseThousandSeparators: true,
3755
+ onValueClick: function onValueClick() {}
3756
+ };
3757
+ /* harmony default export */ var PureSingleValueRadial_SingleValueRadial = __webpack_exports__["default"] = (Object(external_styled_components_["withTheme"])(SingleValueRadial_SingleValueRadial));
3744
3758
 
3745
3759
  /***/ }),
3746
3760
 
3747
- /***/ 46:
3761
+ /***/ 48:
3748
3762
  /***/ (function(module, exports) {
3749
3763
 
3750
- module.exports = require("@splunk/visualization-icons");
3764
+ module.exports = require("@babel/runtime/helpers/extends");
3751
3765
 
3752
3766
  /***/ }),
3753
3767
 
3754
- /***/ 47:
3768
+ /***/ 49:
3755
3769
  /***/ (function(module, exports) {
3756
3770
 
3757
- module.exports = require("@babel/runtime/helpers/extends");
3771
+ module.exports = require("@splunk/visualizations-shared/domUtils");
3758
3772
 
3759
3773
  /***/ }),
3760
3774
 
3761
- /***/ 48:
3775
+ /***/ 54:
3762
3776
  /***/ (function(module, exports) {
3763
3777
 
3764
- module.exports = require("@splunk/visualizations-shared/domUtils");
3778
+ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
3765
3779
 
3766
3780
  /***/ }),
3767
3781
 
3768
- /***/ 5:
3782
+ /***/ 6:
3769
3783
  /***/ (function(module, exports, __webpack_require__) {
3770
3784
 
3771
3785
  "use strict";
@@ -3803,21 +3817,7 @@ var VizBehavior;
3803
3817
 
3804
3818
  /***/ }),
3805
3819
 
3806
- /***/ 53:
3807
- /***/ (function(module, exports) {
3808
-
3809
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
3810
-
3811
- /***/ }),
3812
-
3813
- /***/ 6:
3814
- /***/ (function(module, exports) {
3815
-
3816
- module.exports = require("@babel/runtime/helpers/defineProperty");
3817
-
3818
- /***/ }),
3819
-
3820
- /***/ 62:
3820
+ /***/ 63:
3821
3821
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3822
3822
 
3823
3823
  "use strict";
@@ -3841,7 +3841,14 @@ VizStyleWrapper.displayName = 'VizStyleWrapper';
3841
3841
 
3842
3842
  /***/ }),
3843
3843
 
3844
- /***/ 68:
3844
+ /***/ 7:
3845
+ /***/ (function(module, exports) {
3846
+
3847
+ module.exports = require("@babel/runtime/helpers/defineProperty");
3848
+
3849
+ /***/ }),
3850
+
3851
+ /***/ 70:
3845
3852
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
3846
3853
 
3847
3854
  "use strict";
@@ -3852,15 +3859,15 @@ __webpack_require__.r(__webpack_exports__);
3852
3859
  __webpack_require__.d(__webpack_exports__, "SingleValueTrendValue", function() { return /* binding */ SingleValueTrendValue; });
3853
3860
 
3854
3861
  // EXTERNAL MODULE: external "@babel/runtime/helpers/extends"
3855
- var extends_ = __webpack_require__(47);
3862
+ var extends_ = __webpack_require__(48);
3856
3863
  var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
3857
3864
 
3858
3865
  // EXTERNAL MODULE: external "react"
3859
- var external_react_ = __webpack_require__(1);
3866
+ var external_react_ = __webpack_require__(0);
3860
3867
  var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
3861
3868
 
3862
3869
  // EXTERNAL MODULE: external "prop-types"
3863
- var external_prop_types_ = __webpack_require__(0);
3870
+ var external_prop_types_ = __webpack_require__(1);
3864
3871
  var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
3865
3872
 
3866
3873
  // EXTERNAL MODULE: external "styled-components"
@@ -3868,14 +3875,14 @@ var external_styled_components_ = __webpack_require__(4);
3868
3875
  var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
3869
3876
 
3870
3877
  // EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
3871
- var singleValueUtils = __webpack_require__(20);
3878
+ var singleValueUtils = __webpack_require__(22);
3872
3879
 
3873
3880
  // EXTERNAL MODULE: external "@splunk/react-icons/ArrowUp"
3874
- var ArrowUp_ = __webpack_require__(72);
3881
+ var ArrowUp_ = __webpack_require__(73);
3875
3882
  var ArrowUp_default = /*#__PURE__*/__webpack_require__.n(ArrowUp_);
3876
3883
 
3877
3884
  // EXTERNAL MODULE: external "@splunk/react-icons/ArrowDown"
3878
- var ArrowDown_ = __webpack_require__(73);
3885
+ var ArrowDown_ = __webpack_require__(74);
3879
3886
  var ArrowDown_default = /*#__PURE__*/__webpack_require__.n(ArrowDown_);
3880
3887
 
3881
3888
  // CONCATENATED MODULE: ./src/SingleValueBasic/TrendValue.jsx
@@ -3945,7 +3952,7 @@ TrendValue_SingleValueContent.propTypes = {
3945
3952
  };
3946
3953
  /* harmony default export */ var TrendValue = (TrendValue_SingleValueContent);
3947
3954
  // EXTERNAL MODULE: external "cssesc"
3948
- var external_cssesc_ = __webpack_require__(74);
3955
+ var external_cssesc_ = __webpack_require__(75);
3949
3956
  var external_cssesc_default = /*#__PURE__*/__webpack_require__.n(external_cssesc_);
3950
3957
 
3951
3958
  // CONCATENATED MODULE: ./src/SingleValueBasic/MajorValue.jsx
@@ -3957,7 +3964,7 @@ var external_cssesc_default = /*#__PURE__*/__webpack_require__.n(external_cssesc
3957
3964
  var Row = external_styled_components_default.a.div.withConfig({
3958
3965
  displayName: "MajorValue__Row",
3959
3966
  componentId: "shlzpv-0"
3960
- })(["display:flex;flex-direction:row;align:flex-start;align-items:flex-end;justify:left;justify-content:left;line-height:", "px;height:", "px;"], function (props) {
3967
+ })(["display:flex;flex-direction:row;align-items:flex-end;justify-content:left;height:", "px;line-height:", "px;"], function (props) {
3961
3968
  return props.size;
3962
3969
  }, function (props) {
3963
3970
  return props.size;
@@ -3965,7 +3972,7 @@ var Row = external_styled_components_default.a.div.withConfig({
3965
3972
  var MajorValue_Text = external_styled_components_default.a.div.withConfig({
3966
3973
  displayName: "MajorValue__Text",
3967
3974
  componentId: "shlzpv-1"
3968
- })(["white-space:nowrap;font-size:", "px;color:", ";font-family:", ";font-weight:bold;&:hover{text-decoration:", ";cursor:", ";}", ""], function (props) {
3975
+ })(["white-space:nowrap;height:100%;font-size:", "px;color:", ";font-family:", ";font-weight:bold;&:hover{text-decoration:", ";cursor:", ";}", ""], function (props) {
3969
3976
  return props.size || 12;
3970
3977
  }, function (props) {
3971
3978
  return props.color;
@@ -3978,7 +3985,7 @@ var MajorValue_Text = external_styled_components_default.a.div.withConfig({
3978
3985
  return '';
3979
3986
  }
3980
3987
 
3981
- return "&:".concat(props.pseudoContentPosition, " {\n // by default this pseudo element would inherit text-decoration from main element\n // and text-decoration could not be overwritten.\n // adding display: inline-block makes text decoration independent from main element.\n // => the unit will not be underlined if a user hovers over the main value\n display: inline-block;\n font-size: ").concat(props.pseudoContentFontSize, "px;\n vertical-align: text-top;\n position: relative;\n top: 5px; // magic number to tweak vertical alignment of unit\n font-weight: normal;\n content: ").concat(props.pseudoContent, ";\n }");
3988
+ return "&:".concat(props.pseudoContentPosition, " {\n // by default this pseudo element would inherit text-decoration from main element\n // and text-decoration could not be overwritten.\n // adding display: inline-block makes text decoration independent from main element.\n // => the unit will not be underlined if a user hovers over the main value\n display: inline-block;\n font-size: ").concat(props.pseudoContentFontSize, "px;\n position: relative;\n font-weight: normal;\n content: ").concat(props.pseudoContent, ";\n }");
3982
3989
  });
3983
3990
  var validUnitPositions = ['before', 'after'];
3984
3991
 
@@ -4142,56 +4149,49 @@ var SingleValueTrendValue = TrendValue;
4142
4149
 
4143
4150
  /***/ }),
4144
4151
 
4145
- /***/ 7:
4146
- /***/ (function(module, exports) {
4147
-
4148
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
4149
-
4150
- /***/ }),
4151
-
4152
- /***/ 70:
4152
+ /***/ 71:
4153
4153
  /***/ (function(module, exports) {
4154
4154
 
4155
4155
  module.exports = require("lodash/pick");
4156
4156
 
4157
4157
  /***/ }),
4158
4158
 
4159
- /***/ 71:
4159
+ /***/ 72:
4160
4160
  /***/ (function(module, exports) {
4161
4161
 
4162
4162
  module.exports = require("lodash/isEmpty");
4163
4163
 
4164
4164
  /***/ }),
4165
4165
 
4166
- /***/ 72:
4166
+ /***/ 73:
4167
4167
  /***/ (function(module, exports) {
4168
4168
 
4169
4169
  module.exports = require("@splunk/react-icons/ArrowUp");
4170
4170
 
4171
4171
  /***/ }),
4172
4172
 
4173
- /***/ 73:
4173
+ /***/ 74:
4174
4174
  /***/ (function(module, exports) {
4175
4175
 
4176
4176
  module.exports = require("@splunk/react-icons/ArrowDown");
4177
4177
 
4178
4178
  /***/ }),
4179
4179
 
4180
- /***/ 74:
4180
+ /***/ 75:
4181
4181
  /***/ (function(module, exports) {
4182
4182
 
4183
4183
  module.exports = require("cssesc");
4184
4184
 
4185
4185
  /***/ }),
4186
4186
 
4187
- /***/ 77:
4187
+ /***/ 78:
4188
4188
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4189
4189
 
4190
4190
  "use strict";
4191
4191
  __webpack_require__.r(__webpack_exports__);
4192
4192
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4193
4193
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4194
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4194
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4195
4195
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4196
4196
 
4197
4197
 
@@ -4211,11 +4211,11 @@ var StaticBackgroundColorEditor = {
4211
4211
  /***/ 8:
4212
4212
  /***/ (function(module, exports) {
4213
4213
 
4214
- module.exports = require("@splunk/themes/variables");
4214
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
4215
4215
 
4216
4216
  /***/ }),
4217
4217
 
4218
- /***/ 83:
4218
+ /***/ 88:
4219
4219
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4220
4220
 
4221
4221
  "use strict";
@@ -4223,7 +4223,7 @@ __webpack_require__.r(__webpack_exports__);
4223
4223
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicMajorColorEditor", function() { return getDynamicMajorColorEditor; });
4224
4224
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4225
4225
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4226
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4226
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4227
4227
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4228
4228
 
4229
4229
 
@@ -4266,7 +4266,7 @@ var getDynamicMajorColorEditor = function getDynamicMajorColorEditor(_ref) {
4266
4266
 
4267
4267
  /***/ }),
4268
4268
 
4269
- /***/ 84:
4269
+ /***/ 89:
4270
4270
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4271
4271
 
4272
4272
  "use strict";
@@ -4274,7 +4274,7 @@ __webpack_require__.r(__webpack_exports__);
4274
4274
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
4275
4275
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4276
4276
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4277
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4277
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4278
4278
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4279
4279
 
4280
4280
 
@@ -4311,7 +4311,14 @@ var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
4311
4311
 
4312
4312
  /***/ }),
4313
4313
 
4314
- /***/ 85:
4314
+ /***/ 9:
4315
+ /***/ (function(module, exports) {
4316
+
4317
+ module.exports = require("@splunk/themes/variables");
4318
+
4319
+ /***/ }),
4320
+
4321
+ /***/ 90:
4315
4322
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4316
4323
 
4317
4324
  "use strict";
@@ -4319,7 +4326,7 @@ __webpack_require__.r(__webpack_exports__);
4319
4326
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicBackgroundColorEditor", function() { return getDynamicBackgroundColorEditor; });
4320
4327
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4321
4328
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4322
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4329
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4323
4330
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4324
4331
 
4325
4332
 
@@ -4366,14 +4373,14 @@ var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_
4366
4373
 
4367
4374
  /***/ }),
4368
4375
 
4369
- /***/ 86:
4376
+ /***/ 91:
4370
4377
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4371
4378
 
4372
4379
  "use strict";
4373
4380
  __webpack_require__.r(__webpack_exports__);
4374
4381
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4375
4382
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4376
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4383
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4377
4384
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4378
4385
 
4379
4386
 
@@ -4390,14 +4397,14 @@ var StaticMajorColorEditor = {
4390
4397
 
4391
4398
  /***/ }),
4392
4399
 
4393
- /***/ 87:
4400
+ /***/ 92:
4394
4401
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
4395
4402
 
4396
4403
  "use strict";
4397
4404
  __webpack_require__.r(__webpack_exports__);
4398
4405
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
4399
4406
  /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
4400
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(17);
4407
+ /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
4401
4408
  /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
4402
4409
 
4403
4410
 
@@ -4416,13 +4423,6 @@ var StaticTrendColorEditor = {
4416
4423
  };
4417
4424
  /* harmony default export */ __webpack_exports__["default"] = (StaticTrendColorEditor);
4418
4425
 
4419
- /***/ }),
4420
-
4421
- /***/ 9:
4422
- /***/ (function(module, exports) {
4423
-
4424
- module.exports = require("@splunk/visualizations-shared/Message");
4425
-
4426
4426
  /***/ })
4427
4427
 
4428
4428
  /******/ });