@splunk/visualizations 25.1.0 → 25.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Background_Color_Red.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_Basic.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_Simulated_Instance.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Actions_for_Numeric_Field_Simulated_Instance.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Dark.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureEvents_FieldSummaryTooltip_Light.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Background_color_cyan.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_after_default.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValueIcon_Unit_specified_Unit_Position_before.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Background_Color_white_Under_Label_and_Unit_specified.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Major_Value_is_null.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_after_default.png +0 -0
- package/.loki/reference/chrome_docker_PureVisualizations_PureSingleValue_Unit_specified_Unit_Position_before.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Events_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
- package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Background_Color_Light_Blue.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Basic_Events.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Event_Actions.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Actions.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Field_Summary_Simulated_Instance.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Footer_Fields_with_Highlight.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Show_Placeholder.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Height.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_Width_Percentage_50.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Events_Events_With_Options.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_LinkGraph_LinkGraph_ES.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_after.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Set_Unit_value_before.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_After.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Radial_Single_Value_Radial_Set_The_Unit_Before.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_After.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Set_Unit_Value_Before.png +0 -0
- package/Area.config.js +14 -14
- package/Area.config.js.map +1 -1
- package/Area.js +171 -160
- package/Area.js.map +1 -1
- package/Bar.config.js +14 -14
- package/Bar.config.js.map +1 -1
- package/Bar.js +171 -160
- package/Bar.js.map +1 -1
- package/Bubble.config.js +18 -11
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +173 -155
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +3 -3
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +158 -148
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +14 -14
- package/Column.config.js.map +1 -1
- package/Column.js +170 -160
- package/Column.js.map +1 -1
- package/Ellipse.js +125 -115
- package/Ellipse.js.map +1 -1
- package/Events.config.js +668 -0
- package/Events.config.js.map +1 -0
- package/Events.js +3116 -0
- package/Events.js.map +1 -0
- package/FillerGauge.config.js +17 -16
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +159 -142
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +2 -2
- package/Image.config.js.map +1 -1
- package/Image.js +109 -109
- package/Image.js.map +1 -1
- package/Line.config.js +17 -16
- package/Line.config.js.map +1 -1
- package/Line.js +180 -163
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +12 -5
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +24318 -387
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +27 -26
- package/Map.config.js.map +1 -1
- package/Map.js +3065 -3126
- package/Map.js.map +1 -1
- package/Markdown.config.js +6 -6
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +332 -332
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +13 -13
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1147 -1147
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +11 -11
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +588 -695
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +13 -13
- package/Pie.config.js.map +1 -1
- package/Pie.js +1164 -1164
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +11 -11
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +2628 -2744
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +4 -4
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +704 -704
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +15 -15
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +3124 -3245
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +21 -13
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +1395 -1388
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +8 -7
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +2136 -2136
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +28 -28
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +8 -7
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +1249 -1390
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +8 -7
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1926 -1926
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +4 -4
- package/Table.config.js.map +1 -1
- package/Table.js +2158 -2155
- package/Table.js.map +1 -1
- package/common/EventsDoc.js +15 -8
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +2 -2
- package/common/GaugeValueMarker.js +2 -2
- package/common/OptionsDoc.js +9 -8
- package/common/OptionsDoc.js.map +1 -1
- package/common/ThemesDoc.js +2 -2
- package/common/utils/dataUtils.js +136 -0
- package/common/utils/dataUtils.js.map +1 -0
- package/common/utils/hocUtils.js +2 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/mapUtils.js +11 -10
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +3 -2
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +8 -8
- package/common/utils/testHelper.js.map +1 -1
- package/common/withDashboardViz.js +2 -2
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +14 -12
package/SingleValueRadial.js
CHANGED
|
@@ -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 =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 448);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -109,18 +109,25 @@ module.exports = require("react");
|
|
|
109
109
|
/***/ 10:
|
|
110
110
|
/***/ (function(module, exports) {
|
|
111
111
|
|
|
112
|
-
module.exports = require("@
|
|
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("@
|
|
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";
|
|
@@ -134,11 +141,11 @@ var React = __webpack_require__(1);
|
|
|
134
141
|
|
|
135
142
|
var styled_components_1 = __webpack_require__(4);
|
|
136
143
|
|
|
137
|
-
var SizeAwareWrapper_1 = __webpack_require__(
|
|
144
|
+
var SizeAwareWrapper_1 = __webpack_require__(20);
|
|
138
145
|
|
|
139
|
-
var style_1 = __webpack_require__(
|
|
146
|
+
var style_1 = __webpack_require__(15);
|
|
140
147
|
|
|
141
|
-
var colorUtils_1 = __webpack_require__(
|
|
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.
|
|
205
|
+
"data-splunk-visualization-version": "25.2.0 - 4373c5a66",
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
274
|
+
/***/ 17:
|
|
268
275
|
/***/ (function(module, exports, __webpack_require__) {
|
|
269
276
|
|
|
270
277
|
"use strict";
|
|
271
278
|
|
|
272
279
|
|
|
273
|
-
var _toConsumableArray = __webpack_require__(
|
|
280
|
+
var _toConsumableArray = __webpack_require__(8);
|
|
274
281
|
|
|
275
|
-
var _defineProperty = __webpack_require__(
|
|
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__(
|
|
304
|
+
var schemaUtils_1 = __webpack_require__(16);
|
|
298
305
|
|
|
299
|
-
var VizBehavior_1 = __webpack_require__(
|
|
306
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
300
307
|
|
|
301
308
|
var dynamicOptionsDSLType = {
|
|
302
309
|
type: 'string',
|
|
@@ -501,35 +508,42 @@ exports.insertLayout = insertLayout;
|
|
|
501
508
|
|
|
502
509
|
/***/ }),
|
|
503
510
|
|
|
504
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
539
|
+
/***/ 21:
|
|
526
540
|
/***/ (function(module, exports) {
|
|
527
541
|
|
|
528
|
-
module.exports = require("@splunk/
|
|
542
|
+
module.exports = require("@splunk/themes/pick");
|
|
529
543
|
|
|
530
544
|
/***/ }),
|
|
531
545
|
|
|
532
|
-
/***/
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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__(
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
1577
|
-
/***/ (function(module, exports) {
|
|
1583
|
+
/***/ 27:
|
|
1584
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1578
1585
|
|
|
1579
|
-
|
|
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__(1);
|
|
1595
|
+
|
|
1596
|
+
var T = __webpack_require__(0);
|
|
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
|
-
/***/
|
|
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.
|
|
1593
|
-
|
|
1594
|
-
var SingleValueRadial_1 = __webpack_require__(282);
|
|
1686
|
+
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1595
1687
|
|
|
1596
|
-
var
|
|
1688
|
+
var T = __webpack_require__(0);
|
|
1597
1689
|
|
|
1598
|
-
var
|
|
1690
|
+
var lodash_1 = __webpack_require__(3);
|
|
1599
1691
|
|
|
1600
|
-
|
|
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.
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
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
|
-
/***/
|
|
1746
|
+
/***/ 29:
|
|
1612
1747
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1613
1748
|
|
|
1614
1749
|
"use strict";
|
|
@@ -1617,2155 +1752,2034 @@ 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
|
|
1757
|
+
var T = __webpack_require__(0);
|
|
1622
1758
|
|
|
1623
|
-
var
|
|
1759
|
+
var lodash_1 = __webpack_require__(3);
|
|
1624
1760
|
|
|
1625
|
-
|
|
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
|
|
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
|
|
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
|
-
|
|
1784
|
+
if (typeof countArg === 'number') {
|
|
1785
|
+
newParams.count = countArg;
|
|
1786
|
+
newParams.offset = 0;
|
|
1787
|
+
}
|
|
1632
1788
|
|
|
1633
|
-
var
|
|
1789
|
+
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1634
1790
|
|
|
1635
|
-
|
|
1791
|
+
if (typeof page === 'number' && page > 0) {
|
|
1792
|
+
newParams.count = pageCount;
|
|
1793
|
+
newParams.offset = (page - 1) * pageCount;
|
|
1794
|
+
}
|
|
1636
1795
|
|
|
1637
|
-
|
|
1796
|
+
onRequestParamsChange(newParams);
|
|
1797
|
+
};
|
|
1638
1798
|
|
|
1639
|
-
|
|
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
|
-
|
|
1807
|
+
exports.getPaginationParams = getPaginationParams;
|
|
1642
1808
|
|
|
1643
|
-
|
|
1809
|
+
/***/ }),
|
|
1644
1810
|
|
|
1645
|
-
|
|
1811
|
+
/***/ 3:
|
|
1812
|
+
/***/ (function(module, exports) {
|
|
1646
1813
|
|
|
1647
|
-
|
|
1814
|
+
module.exports = require("lodash");
|
|
1648
1815
|
|
|
1649
|
-
|
|
1816
|
+
/***/ }),
|
|
1650
1817
|
|
|
1651
|
-
|
|
1818
|
+
/***/ 30:
|
|
1819
|
+
/***/ (function(module, exports) {
|
|
1652
1820
|
|
|
1653
|
-
|
|
1821
|
+
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
1654
1822
|
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
var
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
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
|
-
}];
|
|
1823
|
+
/***/ }),
|
|
1824
|
+
|
|
1825
|
+
/***/ 31:
|
|
1826
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1827
|
+
|
|
1828
|
+
"use strict";
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1832
|
+
value: true
|
|
1833
|
+
});
|
|
1834
|
+
exports.VizCategory = void 0;
|
|
1835
|
+
var VizCategory;
|
|
1836
|
+
|
|
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 = {}));
|
|
1851
|
+
|
|
1852
|
+
/***/ }),
|
|
1853
|
+
|
|
1854
|
+
/***/ 32:
|
|
1855
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1856
|
+
|
|
1857
|
+
"use strict";
|
|
1858
|
+
|
|
1859
|
+
|
|
1860
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1861
|
+
value: true
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
var React = __webpack_require__(1);
|
|
1865
|
+
|
|
1866
|
+
var lodash_1 = __webpack_require__(3);
|
|
1867
|
+
|
|
1868
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(33);
|
|
1869
|
+
|
|
1870
|
+
var Options_1 = __webpack_require__(34);
|
|
1871
|
+
|
|
1872
|
+
var SanitizeProps_1 = __webpack_require__(35);
|
|
1873
|
+
|
|
1874
|
+
var TimezoneContext_1 = __webpack_require__(23);
|
|
1875
|
+
|
|
1876
|
+
var moment_1 = __webpack_require__(36);
|
|
1877
|
+
|
|
1878
|
+
var styled_components_1 = __webpack_require__(4);
|
|
1879
|
+
|
|
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);
|
|
1975
1899
|
/**
|
|
1976
|
-
* visualization
|
|
1900
|
+
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1901
|
+
* @param {DashboardVizOpts} opts
|
|
1902
|
+
* @returns {HOC}
|
|
1977
1903
|
*/
|
|
1978
1904
|
|
|
1979
|
-
var config = {
|
|
1980
|
-
/**
|
|
1981
|
-
* unique viz key
|
|
1982
|
-
*/
|
|
1983
|
-
key: 'splunk.singlevalueradial',
|
|
1984
1905
|
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
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.
|
|
1990
1913
|
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
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);
|
|
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);
|
|
1952
|
+
};
|
|
1953
|
+
|
|
1954
|
+
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1955
|
+
|
|
1956
|
+
var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
|
|
1957
|
+
theme: theme
|
|
1958
|
+
}),
|
|
1959
|
+
currentThemeFamily = _getSettingsFromTheme.family,
|
|
1960
|
+
currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
|
|
1961
|
+
currentThemeDensity = _getSettingsFromTheme.density;
|
|
1962
|
+
|
|
1963
|
+
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1964
|
+
|
|
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
|
|
1978
|
+
|
|
1979
|
+
React.useEffect(function () {
|
|
1980
|
+
onComputedProps(evaluatedOptions);
|
|
1981
|
+
}); // present warning message if any required props are missing
|
|
1982
|
+
|
|
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);
|
|
1987
|
+
|
|
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
|
|
1997
|
+
|
|
1998
|
+
|
|
1999
|
+
var eventCallbackProps = {};
|
|
2000
|
+
|
|
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
|
|
2007
|
+
|
|
2008
|
+
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
2009
|
+
var payload = {};
|
|
2010
|
+
|
|
2011
|
+
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
2012
|
+
payloadKeys.forEach(function (p) {
|
|
2013
|
+
payload[p] = evaluatedOptions[p];
|
|
2014
|
+
});
|
|
2015
|
+
}
|
|
2016
|
+
|
|
2017
|
+
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
2018
|
+
if (ev && ev.payload) {
|
|
2019
|
+
payload = ev.payload;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
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
|
|
2030
|
+
|
|
2031
|
+
|
|
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
|
+
};
|
|
2005
2076
|
}
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
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
|
|
2092
|
+
|
|
2093
|
+
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
2009
2094
|
};
|
|
2010
|
-
|
|
2095
|
+
|
|
2096
|
+
exports.default = withDashboardViz;
|
|
2011
2097
|
|
|
2012
2098
|
/***/ }),
|
|
2013
2099
|
|
|
2014
|
-
/***/
|
|
2015
|
-
/***/ (function(module, exports
|
|
2100
|
+
/***/ 33:
|
|
2101
|
+
/***/ (function(module, exports) {
|
|
2016
2102
|
|
|
2017
|
-
|
|
2103
|
+
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
2018
2104
|
|
|
2105
|
+
/***/ }),
|
|
2019
2106
|
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
});
|
|
2107
|
+
/***/ 34:
|
|
2108
|
+
/***/ (function(module, exports) {
|
|
2023
2109
|
|
|
2024
|
-
|
|
2110
|
+
module.exports = require("@splunk/visualization-encoding/Options");
|
|
2025
2111
|
|
|
2026
|
-
|
|
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
|
-
};
|
|
2112
|
+
/***/ }),
|
|
2040
2113
|
|
|
2041
|
-
|
|
2114
|
+
/***/ 35:
|
|
2115
|
+
/***/ (function(module, exports) {
|
|
2116
|
+
|
|
2117
|
+
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
2042
2118
|
|
|
2043
2119
|
/***/ }),
|
|
2044
2120
|
|
|
2045
|
-
/***/
|
|
2121
|
+
/***/ 36:
|
|
2122
|
+
/***/ (function(module, exports) {
|
|
2123
|
+
|
|
2124
|
+
module.exports = require("@splunk/moment");
|
|
2125
|
+
|
|
2126
|
+
/***/ }),
|
|
2127
|
+
|
|
2128
|
+
/***/ 37:
|
|
2046
2129
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2047
2130
|
|
|
2048
2131
|
"use strict";
|
|
2049
2132
|
|
|
2050
2133
|
|
|
2134
|
+
var _classCallCheck = __webpack_require__(11);
|
|
2135
|
+
|
|
2051
2136
|
Object.defineProperty(exports, "__esModule", {
|
|
2052
2137
|
value: true
|
|
2053
2138
|
});
|
|
2054
|
-
exports.
|
|
2055
|
-
|
|
2056
|
-
var React = __webpack_require__(1);
|
|
2139
|
+
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
2140
|
+
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
2057
2141
|
|
|
2058
2142
|
var T = __webpack_require__(0);
|
|
2059
2143
|
|
|
2060
2144
|
var lodash_1 = __webpack_require__(3);
|
|
2061
2145
|
|
|
2062
|
-
var
|
|
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
|
-
|
|
2146
|
+
var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
2074
2147
|
|
|
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
2148
|
|
|
2084
|
-
exports.
|
|
2085
|
-
|
|
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
|
-
};
|
|
2149
|
+
exports.INITIAL_WIDTH = 250;
|
|
2150
|
+
exports.INITIAL_HEIGHT = 250;
|
|
2093
2151
|
/**
|
|
2094
|
-
*
|
|
2095
|
-
* @param {IconPlaceholderProps} props
|
|
2096
|
-
* @returns {React.ReactElement}
|
|
2152
|
+
* A Splunk visualization
|
|
2097
2153
|
*/
|
|
2098
2154
|
|
|
2099
|
-
var
|
|
2100
|
-
|
|
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
|
-
};
|
|
2127
|
-
|
|
2128
|
-
IconPlaceholder.propTypes = propTypes;
|
|
2129
|
-
IconPlaceholder.defaultProps = {
|
|
2130
|
-
width: '100%',
|
|
2131
|
-
height: 250
|
|
2155
|
+
var SplunkVisualization = function SplunkVisualization() {
|
|
2156
|
+
_classCallCheck(this, SplunkVisualization);
|
|
2132
2157
|
};
|
|
2133
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
2134
|
-
|
|
2135
|
-
/***/ }),
|
|
2136
2158
|
|
|
2137
|
-
|
|
2138
|
-
|
|
2159
|
+
SplunkVisualization.propTypes = {
|
|
2160
|
+
/**
|
|
2161
|
+
* display mode
|
|
2162
|
+
*/
|
|
2163
|
+
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
2139
2164
|
|
|
2140
|
-
|
|
2165
|
+
/**
|
|
2166
|
+
* width in pixel or string, defaults to 100%
|
|
2167
|
+
*/
|
|
2168
|
+
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
2141
2169
|
|
|
2170
|
+
/**
|
|
2171
|
+
* height in pixel or string
|
|
2172
|
+
*/
|
|
2173
|
+
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
2142
2174
|
|
|
2143
|
-
|
|
2175
|
+
/**
|
|
2176
|
+
* visualization context used for dynamic option evaluation
|
|
2177
|
+
*/
|
|
2178
|
+
context: T.object,
|
|
2144
2179
|
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2180
|
+
/**
|
|
2181
|
+
* visualization formatting options
|
|
2182
|
+
*/
|
|
2183
|
+
options: T.object,
|
|
2149
2184
|
|
|
2150
|
-
|
|
2185
|
+
/**
|
|
2186
|
+
* A callback to update formatting options
|
|
2187
|
+
*/
|
|
2188
|
+
onOptionsChange: T.func,
|
|
2151
2189
|
|
|
2152
|
-
|
|
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,
|
|
2153
2198
|
|
|
2154
|
-
|
|
2199
|
+
/**
|
|
2200
|
+
* current dataset
|
|
2201
|
+
*/
|
|
2202
|
+
data: T.shape({
|
|
2203
|
+
fields: T.array,
|
|
2204
|
+
columns: T.array
|
|
2205
|
+
}),
|
|
2155
2206
|
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2207
|
+
/**
|
|
2208
|
+
* error
|
|
2209
|
+
*/
|
|
2210
|
+
error: T.shape({
|
|
2211
|
+
level: T.string,
|
|
2212
|
+
message: T.string
|
|
2213
|
+
}),
|
|
2161
2214
|
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
|
|
2167
|
-
var nextSortDirMap = {
|
|
2168
|
-
asc: 'desc',
|
|
2169
|
-
desc: 'asc',
|
|
2170
|
-
none: 'asc'
|
|
2171
|
-
};
|
|
2172
|
-
var onSort;
|
|
2215
|
+
/**
|
|
2216
|
+
* meta data that came with the dataset
|
|
2217
|
+
*/
|
|
2218
|
+
meta: T.object
|
|
2219
|
+
})),
|
|
2173
2220
|
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
2221
|
+
/**
|
|
2222
|
+
* A callback to trigger event
|
|
2223
|
+
*/
|
|
2224
|
+
onEventTrigger: T.func,
|
|
2179
2225
|
|
|
2226
|
+
/**
|
|
2227
|
+
* Inform viz if there are handlers listening to events
|
|
2228
|
+
*/
|
|
2229
|
+
hasEventHandlers: T.bool,
|
|
2180
2230
|
|
|
2181
|
-
|
|
2182
|
-
|
|
2183
|
-
|
|
2231
|
+
/**
|
|
2232
|
+
* A callback to communicate computed props to a consumer
|
|
2233
|
+
*/
|
|
2234
|
+
onComputedProps: T.func,
|
|
2184
2235
|
|
|
2185
|
-
|
|
2186
|
-
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
} else {
|
|
2192
|
-
onRequestParamsChange(requestParams);
|
|
2193
|
-
}
|
|
2194
|
-
};
|
|
2195
|
-
}
|
|
2236
|
+
/**
|
|
2237
|
+
* A callback to obtain visualization api
|
|
2238
|
+
*/
|
|
2239
|
+
vizActionHandlerRef: T.func,
|
|
2240
|
+
loading: T.bool,
|
|
2241
|
+
theme: T.object,
|
|
2196
2242
|
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
};
|
|
2243
|
+
/**
|
|
2244
|
+
* A callback to request new data with updated request params
|
|
2245
|
+
*/
|
|
2246
|
+
onRequestParamsChange: T.func
|
|
2202
2247
|
};
|
|
2248
|
+
/**
|
|
2249
|
+
*
|
|
2250
|
+
*/
|
|
2203
2251
|
|
|
2204
|
-
|
|
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;
|
|
2205
2277
|
|
|
2206
2278
|
/***/ }),
|
|
2207
2279
|
|
|
2208
|
-
/***/
|
|
2209
|
-
/***/ (function(module,
|
|
2280
|
+
/***/ 38:
|
|
2281
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2210
2282
|
|
|
2211
2283
|
"use strict";
|
|
2212
|
-
// ESM COMPAT FLAG
|
|
2213
|
-
__webpack_require__.r(__webpack_exports__);
|
|
2214
2284
|
|
|
2215
|
-
// EXTERNAL MODULE: external "@babel/runtime/helpers/extends"
|
|
2216
|
-
var extends_ = __webpack_require__(47);
|
|
2217
|
-
var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
|
|
2218
2285
|
|
|
2219
|
-
|
|
2220
|
-
var external_react_ = __webpack_require__(1);
|
|
2221
|
-
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
2286
|
+
var _classCallCheck = __webpack_require__(11);
|
|
2222
2287
|
|
|
2223
|
-
|
|
2224
|
-
var external_prop_types_ = __webpack_require__(0);
|
|
2225
|
-
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
2288
|
+
var _createClass = __webpack_require__(19);
|
|
2226
2289
|
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2290
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2291
|
+
value: true
|
|
2292
|
+
});
|
|
2293
|
+
exports.DefaultVizActionHandler = void 0;
|
|
2230
2294
|
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2295
|
+
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
2296
|
+
function DefaultVizActionHandler() {
|
|
2297
|
+
_classCallCheck(this, DefaultVizActionHandler);
|
|
2298
|
+
}
|
|
2234
2299
|
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
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
|
+
}]);
|
|
2238
2310
|
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
var external_lodash_pick_default = /*#__PURE__*/__webpack_require__.n(external_lodash_pick_);
|
|
2311
|
+
return DefaultVizActionHandler;
|
|
2312
|
+
}();
|
|
2242
2313
|
|
|
2243
|
-
|
|
2244
|
-
var isEmpty_ = __webpack_require__(71);
|
|
2245
|
-
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
|
|
2314
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
2246
2315
|
|
|
2247
|
-
|
|
2248
|
-
var style_ = __webpack_require__(14);
|
|
2316
|
+
/***/ }),
|
|
2249
2317
|
|
|
2250
|
-
|
|
2251
|
-
|
|
2252
|
-
var SizeAwareWrapper_default = /*#__PURE__*/__webpack_require__.n(SizeAwareWrapper_);
|
|
2318
|
+
/***/ 39:
|
|
2319
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2253
2320
|
|
|
2254
|
-
|
|
2255
|
-
var VizStyleWrapper = __webpack_require__(62);
|
|
2321
|
+
"use strict";
|
|
2256
2322
|
|
|
2257
|
-
// EXTERNAL MODULE: external "@babel/runtime/helpers/defineProperty"
|
|
2258
|
-
var defineProperty_ = __webpack_require__(6);
|
|
2259
|
-
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
2260
2323
|
|
|
2261
|
-
|
|
2262
|
-
|
|
2324
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2325
|
+
value: true
|
|
2326
|
+
});
|
|
2327
|
+
exports.validSortDirs = void 0;
|
|
2328
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
2263
2329
|
|
|
2264
|
-
|
|
2265
|
-
var colorConstants_ = __webpack_require__(43);
|
|
2330
|
+
/***/ }),
|
|
2266
2331
|
|
|
2267
|
-
|
|
2332
|
+
/***/ 4:
|
|
2333
|
+
/***/ (function(module, exports) {
|
|
2268
2334
|
|
|
2335
|
+
module.exports = require("styled-components");
|
|
2269
2336
|
|
|
2337
|
+
/***/ }),
|
|
2270
2338
|
|
|
2339
|
+
/***/ 40:
|
|
2340
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2271
2341
|
|
|
2272
|
-
|
|
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
|
-
};
|
|
2342
|
+
"use strict";
|
|
2319
2343
|
|
|
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);
|
|
2335
2344
|
|
|
2336
|
-
|
|
2345
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2346
|
+
value: true
|
|
2347
|
+
});
|
|
2348
|
+
exports.useDeepMemo = void 0;
|
|
2337
2349
|
|
|
2350
|
+
var react_1 = __webpack_require__(1);
|
|
2338
2351
|
|
|
2339
|
-
var
|
|
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;
|
|
2352
|
+
var lodash_1 = __webpack_require__(3);
|
|
2344
2353
|
/**
|
|
2345
|
-
*
|
|
2346
|
-
*
|
|
2347
|
-
*
|
|
2348
|
-
*
|
|
2349
|
-
*
|
|
2350
|
-
*
|
|
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
|
|
2351
2365
|
*/
|
|
2352
2366
|
|
|
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
|
-
*/
|
|
2376
2367
|
|
|
2377
|
-
var
|
|
2378
|
-
var
|
|
2379
|
-
height = _ref2.height; // height * 2 because we are fitting only half of a circle inside the container
|
|
2368
|
+
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
2369
|
+
var ref = react_1.useRef();
|
|
2380
2370
|
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2371
|
+
if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
|
|
2372
|
+
ref.current = {
|
|
2373
|
+
dependencies: dependencies,
|
|
2374
|
+
value: fn()
|
|
2375
|
+
};
|
|
2376
|
+
}
|
|
2377
|
+
|
|
2378
|
+
return ref.current.value;
|
|
2386
2379
|
};
|
|
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
|
-
*/
|
|
2395
2380
|
|
|
2396
|
-
|
|
2397
|
-
|
|
2398
|
-
|
|
2399
|
-
|
|
2381
|
+
exports.useDeepMemo = useDeepMemo;
|
|
2382
|
+
|
|
2383
|
+
/***/ }),
|
|
2384
|
+
|
|
2385
|
+
/***/ 41:
|
|
2386
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2387
|
+
|
|
2388
|
+
"use strict";
|
|
2400
2389
|
|
|
2401
|
-
var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
|
|
2402
2390
|
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
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
|
-
*/
|
|
2391
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2392
|
+
value: true
|
|
2393
|
+
});
|
|
2394
|
+
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
2421
2395
|
|
|
2422
|
-
var
|
|
2423
|
-
var graphSize = _ref4.graphSize,
|
|
2424
|
-
radialStrokeWidth = _ref4.radialStrokeWidth; // Account for the graph's stroke width
|
|
2396
|
+
var React = __webpack_require__(1);
|
|
2425
2397
|
|
|
2426
|
-
|
|
2427
|
-
// to calculate the size of the sides of the square inside the circle
|
|
2398
|
+
var T = __webpack_require__(0);
|
|
2428
2399
|
|
|
2429
|
-
|
|
2430
|
-
};
|
|
2431
|
-
/*
|
|
2432
|
-
* @method getRadialStrokeWidth
|
|
2433
|
-
* @param {Number} graphHeight
|
|
2434
|
-
* @returns {Number} radial stroke width
|
|
2435
|
-
*/
|
|
2400
|
+
var i18n_1 = __webpack_require__(2);
|
|
2436
2401
|
|
|
2437
|
-
var
|
|
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
|
-
*/
|
|
2402
|
+
var Message_1 = __webpack_require__(10);
|
|
2445
2403
|
|
|
2446
|
-
var
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
* @
|
|
2451
|
-
* @param {Object} props
|
|
2452
|
-
* @param {Bool} props.showTrendIndicator
|
|
2453
|
-
* @param {String} props.position
|
|
2454
|
-
* @returns {Bool}
|
|
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
|
|
2455
2409
|
*/
|
|
2456
2410
|
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
return showTrendIndicator && position === 'standard';
|
|
2411
|
+
|
|
2412
|
+
var isMissing = function isMissing(v) {
|
|
2413
|
+
return v === null || v === undefined;
|
|
2461
2414
|
};
|
|
2462
|
-
|
|
2463
|
-
|
|
2464
|
-
|
|
2465
|
-
* @
|
|
2466
|
-
* @param {
|
|
2467
|
-
* @
|
|
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
|
|
2468
2422
|
*/
|
|
2469
2423
|
|
|
2470
|
-
var
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2424
|
+
var missingKeys = function missingKeys(keys, target) {
|
|
2425
|
+
return keys.filter(function (k) {
|
|
2426
|
+
return exports.isMissing(target[k]);
|
|
2427
|
+
});
|
|
2474
2428
|
};
|
|
2475
|
-
/*
|
|
2476
|
-
* @method showTrendPositionOutside
|
|
2477
|
-
* @param {Object} props
|
|
2478
|
-
* @param {Bool} props.showTrendIndicator
|
|
2479
|
-
* @param {String} props.position
|
|
2480
|
-
* @returns {Bool}
|
|
2481
|
-
*/
|
|
2482
2429
|
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
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)
|
|
2487
2437
|
};
|
|
2488
|
-
|
|
2489
|
-
*
|
|
2490
|
-
* @
|
|
2491
|
-
* @
|
|
2492
|
-
* @returns {Number} progress bar in radial graph
|
|
2438
|
+
/**
|
|
2439
|
+
* @method MissingPropsMessage
|
|
2440
|
+
* @param {MissingPropsProps} props
|
|
2441
|
+
* @returns {React.ReactElement}
|
|
2493
2442
|
*/
|
|
2494
2443
|
|
|
2495
|
-
var
|
|
2496
|
-
|
|
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",
|
|
2450
|
+
width: width,
|
|
2451
|
+
height: height,
|
|
2452
|
+
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
2453
|
+
});
|
|
2497
2454
|
};
|
|
2498
|
-
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
|
|
2499
2455
|
|
|
2456
|
+
exports.MissingPropsMessage = MissingPropsMessage;
|
|
2457
|
+
exports.MissingPropsMessage.propTypes = propTypes;
|
|
2458
|
+
exports.MissingPropsMessage.defaultProps = {
|
|
2459
|
+
width: '100%',
|
|
2460
|
+
height: 250
|
|
2461
|
+
};
|
|
2462
|
+
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
2500
2463
|
|
|
2464
|
+
/***/ }),
|
|
2501
2465
|
|
|
2502
|
-
|
|
2503
|
-
|
|
2466
|
+
/***/ 42:
|
|
2467
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2504
2468
|
|
|
2505
|
-
|
|
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
|
-
}
|
|
2469
|
+
"use strict";
|
|
2512
2470
|
|
|
2513
|
-
return keys;
|
|
2514
|
-
}
|
|
2515
2471
|
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2472
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2473
|
+
value: true
|
|
2474
|
+
});
|
|
2519
2475
|
|
|
2520
|
-
|
|
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
|
-
}
|
|
2476
|
+
var React = __webpack_require__(1);
|
|
2532
2477
|
|
|
2533
|
-
|
|
2534
|
-
}
|
|
2478
|
+
var styled_components_1 = __webpack_require__(4);
|
|
2535
2479
|
|
|
2480
|
+
var hocUtils_1 = __webpack_require__(14);
|
|
2536
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.2.0 - 4373c5a66"
|
|
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
|
+
*/
|
|
2537
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
|
+
};
|
|
2538
2507
|
|
|
2508
|
+
hocUtils_1.extendStaticWrapperProps({
|
|
2509
|
+
Wrapper: Wrapper,
|
|
2510
|
+
Visualization: Visualization
|
|
2511
|
+
});
|
|
2512
|
+
return Wrapper;
|
|
2513
|
+
};
|
|
2539
2514
|
|
|
2515
|
+
exports.default = withEditModeCover;
|
|
2540
2516
|
|
|
2517
|
+
/***/ }),
|
|
2541
2518
|
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
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;
|
|
2519
|
+
/***/ 43:
|
|
2520
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2521
|
+
|
|
2522
|
+
"use strict";
|
|
2523
|
+
|
|
2524
|
+
|
|
2525
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2526
|
+
value: true
|
|
2589
2527
|
});
|
|
2590
2528
|
|
|
2591
|
-
var
|
|
2592
|
-
var props = extends_default()({}, _ref);
|
|
2529
|
+
var React = __webpack_require__(1);
|
|
2593
2530
|
|
|
2594
|
-
|
|
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;
|
|
2531
|
+
var colorUtils_1 = __webpack_require__(12);
|
|
2615
2532
|
|
|
2616
|
-
|
|
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).
|
|
2533
|
+
var variables_1 = __webpack_require__(9);
|
|
2623
2534
|
|
|
2535
|
+
var IconPlaceholder_1 = __webpack_require__(27);
|
|
2624
2536
|
|
|
2625
|
-
|
|
2537
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
2626
2538
|
|
|
2627
|
-
|
|
2628
|
-
|
|
2629
|
-
|
|
2630
|
-
|
|
2631
|
-
|
|
2632
|
-
|
|
2633
|
-
|
|
2634
|
-
|
|
2635
|
-
|
|
2636
|
-
|
|
2637
|
-
|
|
2638
|
-
|
|
2639
|
-
|
|
2640
|
-
|
|
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
|
+
});
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
return React.createElement(Visualization, Object.assign({}, props));
|
|
2571
|
+
};
|
|
2572
|
+
|
|
2573
|
+
hocUtils_1.extendStaticWrapperProps({
|
|
2574
|
+
Wrapper: Wrapper,
|
|
2575
|
+
Visualization: Visualization
|
|
2641
2576
|
});
|
|
2642
|
-
|
|
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));
|
|
2577
|
+
return Wrapper;
|
|
2667
2578
|
};
|
|
2668
2579
|
|
|
2669
|
-
|
|
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
|
|
2679
|
-
});
|
|
2680
|
-
/* harmony default export */ var RadialLayout = (RadialLayout_RadialContent);
|
|
2681
|
-
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/SingleValueRadial.jsx
|
|
2682
|
-
|
|
2580
|
+
exports.default = withPlaceholder;
|
|
2683
2581
|
|
|
2582
|
+
/***/ }),
|
|
2684
2583
|
|
|
2584
|
+
/***/ 44:
|
|
2585
|
+
/***/ (function(module, exports) {
|
|
2685
2586
|
|
|
2587
|
+
module.exports = require("@splunk/visualization-icons/placeholders");
|
|
2686
2588
|
|
|
2589
|
+
/***/ }),
|
|
2687
2590
|
|
|
2591
|
+
/***/ 448:
|
|
2592
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2688
2593
|
|
|
2594
|
+
"use strict";
|
|
2689
2595
|
|
|
2690
2596
|
|
|
2597
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2598
|
+
value: true
|
|
2599
|
+
});
|
|
2600
|
+
exports.PureSingleValueRadialThemes = exports.PureSingleValueRadial = exports.config = void 0;
|
|
2691
2601
|
|
|
2602
|
+
var SingleValueRadial_1 = __webpack_require__(465);
|
|
2692
2603
|
|
|
2604
|
+
var withDashboardViz_1 = __webpack_require__(32);
|
|
2693
2605
|
|
|
2606
|
+
var config_1 = __webpack_require__(449);
|
|
2694
2607
|
|
|
2608
|
+
exports.config = config_1.default;
|
|
2609
|
+
exports.PureSingleValueRadial = SingleValueRadial_1.default; // TODO: proper theming support for SVR when we come back to SVR viz
|
|
2695
2610
|
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
return Object(style_["toDimension"])(external_lodash_pick_default()(props, ['width', 'height']));
|
|
2611
|
+
exports.PureSingleValueRadialThemes = {};
|
|
2612
|
+
exports.default = withDashboardViz_1.default({
|
|
2613
|
+
ReactViz: SingleValueRadial_1.default,
|
|
2614
|
+
vizConfig: config_1.default
|
|
2701
2615
|
});
|
|
2702
2616
|
|
|
2703
|
-
|
|
2704
|
-
var props = extends_default()({}, _ref);
|
|
2617
|
+
/***/ }),
|
|
2705
2618
|
|
|
2706
|
-
|
|
2707
|
-
|
|
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
|
|
2619
|
+
/***/ 449:
|
|
2620
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2721
2621
|
|
|
2722
|
-
|
|
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
|
-
};
|
|
2622
|
+
"use strict";
|
|
2735
2623
|
|
|
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;
|
|
2742
2624
|
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
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]);
|
|
2625
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2626
|
+
value: true
|
|
2627
|
+
});
|
|
2753
2628
|
|
|
2754
|
-
|
|
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
|
|
2629
|
+
var i18n_1 = __webpack_require__(2);
|
|
2760
2630
|
|
|
2761
|
-
|
|
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.
|
|
2631
|
+
var schemaUtils_1 = __webpack_require__(16);
|
|
2767
2632
|
|
|
2633
|
+
var pick_1 = __webpack_require__(21);
|
|
2768
2634
|
|
|
2769
|
-
|
|
2635
|
+
var variables_1 = __webpack_require__(9);
|
|
2770
2636
|
|
|
2771
|
-
|
|
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.
|
|
2637
|
+
var PresetPalettes_1 = __webpack_require__(54);
|
|
2777
2638
|
|
|
2639
|
+
var visualization_icons_1 = __webpack_require__(47);
|
|
2778
2640
|
|
|
2779
|
-
|
|
2641
|
+
var placeholders_1 = __webpack_require__(44);
|
|
2780
2642
|
|
|
2781
|
-
|
|
2643
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
2782
2644
|
|
|
2783
|
-
|
|
2784
|
-
graphWidth = containerWidth;
|
|
2785
|
-
contentWidth = containerWidth;
|
|
2786
|
-
graphHeight = containerHeight;
|
|
2787
|
-
contentHeight = containerHeight;
|
|
2788
|
-
}
|
|
2645
|
+
var configUtils_1 = __webpack_require__(17);
|
|
2789
2646
|
|
|
2790
|
-
|
|
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;
|
|
2647
|
+
var VizCategory_1 = __webpack_require__(31);
|
|
2813
2648
|
|
|
2814
|
-
|
|
2815
|
-
trendDisplay = smallVizProps.trendDisplay;
|
|
2816
|
-
unit = smallVizProps.unit;
|
|
2817
|
-
} // calculate radial progress
|
|
2649
|
+
var DynamicMajorColorEditor_1 = __webpack_require__(87);
|
|
2818
2650
|
|
|
2651
|
+
var DynamicTrendColorEditor_1 = __webpack_require__(88);
|
|
2819
2652
|
|
|
2820
|
-
|
|
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
|
-
};
|
|
2653
|
+
var DynamicBackgroundColorEditor_1 = __webpack_require__(89);
|
|
2850
2654
|
|
|
2851
|
-
|
|
2852
|
-
width: width,
|
|
2853
|
-
height: height
|
|
2854
|
-
}, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
|
|
2855
|
-
return renderVisualization(containerDimension);
|
|
2856
|
-
}));
|
|
2857
|
-
};
|
|
2655
|
+
var StaticMajorColorEditor_1 = __webpack_require__(90);
|
|
2858
2656
|
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
|
|
2863
|
-
|
|
2864
|
-
|
|
2865
|
-
|
|
2866
|
-
|
|
2867
|
-
|
|
2868
|
-
|
|
2869
|
-
|
|
2870
|
-
|
|
2871
|
-
|
|
2872
|
-
|
|
2873
|
-
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
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
|
|
2657
|
+
var StaticTrendColorEditor_1 = __webpack_require__(91);
|
|
2658
|
+
|
|
2659
|
+
var StaticBackgroundColorEditor_1 = __webpack_require__(78);
|
|
2660
|
+
|
|
2661
|
+
var RadialBackgroundColor_1 = __webpack_require__(450);
|
|
2662
|
+
|
|
2663
|
+
var dataContract = {
|
|
2664
|
+
requiredDataSources: [{
|
|
2665
|
+
name: 'primary',
|
|
2666
|
+
description: 'DataSource that powers the visualization'
|
|
2667
|
+
}],
|
|
2668
|
+
optionalDataSources: [],
|
|
2669
|
+
initialRequestParams: {
|
|
2670
|
+
primary: {
|
|
2671
|
+
offset: 0,
|
|
2672
|
+
count: 10000
|
|
2673
|
+
}
|
|
2674
|
+
}
|
|
2883
2675
|
};
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2887
|
-
|
|
2888
|
-
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2676
|
+
var size = {
|
|
2677
|
+
initialWidth: 250,
|
|
2678
|
+
initialHeight: 250
|
|
2679
|
+
};
|
|
2680
|
+
var defaultContext = {
|
|
2681
|
+
trendColorConfig: [{
|
|
2682
|
+
to: 0,
|
|
2683
|
+
value: '#9E2520'
|
|
2684
|
+
}, {
|
|
2685
|
+
from: 0,
|
|
2686
|
+
value: '#1C6B2D'
|
|
2687
|
+
}],
|
|
2688
|
+
majorColorConfig: [{
|
|
2689
|
+
to: 20,
|
|
2690
|
+
value: '#D41F1F'
|
|
2691
|
+
}, {
|
|
2692
|
+
from: 20,
|
|
2693
|
+
to: 40,
|
|
2694
|
+
value: '#D94E17'
|
|
2695
|
+
}, {
|
|
2696
|
+
from: 40,
|
|
2697
|
+
to: 60,
|
|
2698
|
+
value: '#CBA700'
|
|
2699
|
+
}, {
|
|
2700
|
+
from: 60,
|
|
2701
|
+
to: 80,
|
|
2702
|
+
value: '#669922'
|
|
2703
|
+
}, {
|
|
2704
|
+
from: 80,
|
|
2705
|
+
value: '#118832'
|
|
2706
|
+
}],
|
|
2707
|
+
majorColorMatchConfig: [{
|
|
2708
|
+
match: '',
|
|
2709
|
+
value: '#5C33FF'
|
|
2710
|
+
}]
|
|
2711
|
+
};
|
|
2712
|
+
var optionsSchema = {
|
|
2713
|
+
backgroundColor: {
|
|
2714
|
+
default: '> themes.defaultBackgroundColor',
|
|
2715
|
+
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".',
|
|
2716
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2717
|
+
type: 'string'
|
|
2718
|
+
},
|
|
2719
|
+
majorColor: {
|
|
2720
|
+
default: '> themes.defaultFontColor',
|
|
2721
|
+
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)".',
|
|
2722
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2723
|
+
type: 'string'
|
|
2724
|
+
},
|
|
2725
|
+
majorValue: {
|
|
2726
|
+
default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | lastPoint()',
|
|
2727
|
+
description: 'Specify the dataSource applied to the major value.',
|
|
2728
|
+
type: ['string', 'number']
|
|
2729
|
+
},
|
|
2730
|
+
majorValueField: {
|
|
2731
|
+
default: '> majorValue | getField()',
|
|
2732
|
+
description: 'Specify the field that should be mapped to the major value.',
|
|
2733
|
+
type: 'string'
|
|
2734
|
+
},
|
|
2735
|
+
maxValue: {
|
|
2736
|
+
default: 100,
|
|
2737
|
+
description: 'Specify the value the radial fills up to.',
|
|
2738
|
+
type: 'number'
|
|
2739
|
+
},
|
|
2740
|
+
numberPrecision: {
|
|
2741
|
+
default: 0,
|
|
2742
|
+
maximum: 20,
|
|
2743
|
+
minimum: 0,
|
|
2744
|
+
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.',
|
|
2745
|
+
type: 'number'
|
|
2746
|
+
},
|
|
2747
|
+
radialBackgroundColor: {
|
|
2748
|
+
default: '> themes.defaultRadialBackgroundColor',
|
|
2749
|
+
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)".',
|
|
2750
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2751
|
+
type: 'string'
|
|
2752
|
+
},
|
|
2753
|
+
radialStrokeColor: {
|
|
2754
|
+
default: '> majorColor',
|
|
2755
|
+
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)".',
|
|
2756
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2757
|
+
type: 'string'
|
|
2758
|
+
},
|
|
2759
|
+
shouldAbbreviateTrendValue: {
|
|
2760
|
+
default: false,
|
|
2761
|
+
description: 'Specify whether to abbreviate the trend value to 2 decimal points. A magnitude unit will be displayed.',
|
|
2762
|
+
type: 'boolean'
|
|
2763
|
+
},
|
|
2764
|
+
shouldUseThousandSeparators: {
|
|
2765
|
+
default: true,
|
|
2766
|
+
description: 'Specify whether numeric values use commas as thousandths separaters.',
|
|
2767
|
+
type: 'boolean'
|
|
2768
|
+
},
|
|
2769
|
+
trendColor: {
|
|
2770
|
+
default: '> themes.defaultFontColor',
|
|
2771
|
+
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)".',
|
|
2772
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2773
|
+
type: 'string'
|
|
2774
|
+
},
|
|
2775
|
+
trendDisplay: {
|
|
2776
|
+
default: 'absolute',
|
|
2777
|
+
description: 'Specify how to display the trend value.',
|
|
2778
|
+
pattern: schemaUtils_1.getPattern(['percent', 'absolute', 'off']),
|
|
2779
|
+
type: 'string'
|
|
2780
|
+
},
|
|
2781
|
+
trendValue: {
|
|
2782
|
+
default: '> primary | seriesByPrioritizedTypes("number", "string", "time") | delta(-2)',
|
|
2783
|
+
description: 'Specify the dataSource applied to the trend value.',
|
|
2784
|
+
type: 'number'
|
|
2785
|
+
},
|
|
2786
|
+
underLabel: {
|
|
2787
|
+
description: 'Specify the text that appears below the major value.',
|
|
2788
|
+
type: 'string'
|
|
2789
|
+
},
|
|
2790
|
+
unit: {
|
|
2791
|
+
description: 'Specify text to show next to the major value.',
|
|
2792
|
+
type: 'string'
|
|
2793
|
+
},
|
|
2794
|
+
unitPosition: {
|
|
2795
|
+
default: 'after',
|
|
2796
|
+
description: 'Specify whether the unit text should appear before or after the major value.',
|
|
2797
|
+
pattern: schemaUtils_1.getPattern(['before', 'after']),
|
|
2798
|
+
type: 'string'
|
|
2799
|
+
}
|
|
2800
|
+
};
|
|
2801
|
+
var basePresetContext = {
|
|
2802
|
+
majorColorEditorConfig: undefined,
|
|
2803
|
+
trendColorEditorConfig: undefined,
|
|
2804
|
+
backgroundColorEditorConfig: undefined
|
|
2805
|
+
};
|
|
2806
|
+
var basePresetOptions = {
|
|
2807
|
+
majorColor: undefined,
|
|
2808
|
+
trendColor: undefined,
|
|
2809
|
+
backgroundColor: undefined
|
|
2810
|
+
};
|
|
2811
|
+
var presets = [{
|
|
2812
|
+
// dummy context variables to allow for resetting of unused context states
|
|
2813
|
+
label: i18n_1._('None'),
|
|
2814
|
+
name: 'singleValueRadial.none',
|
|
2815
|
+
value: {
|
|
2816
|
+
context: Object.assign({}, basePresetContext),
|
|
2817
|
+
options: Object.assign({}, basePresetOptions)
|
|
2818
|
+
}
|
|
2819
|
+
}, {
|
|
2820
|
+
label: i18n_1._('Major Value'),
|
|
2821
|
+
name: 'singleValueRadial.majorValue',
|
|
2822
|
+
value: {
|
|
2823
|
+
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
2824
|
+
majorColorEditorConfig: defaultContext.majorColorConfig
|
|
2825
|
+
}),
|
|
2826
|
+
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
2827
|
+
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
|
|
2828
|
+
})
|
|
2829
|
+
}
|
|
2830
|
+
}, {
|
|
2831
|
+
label: i18n_1._('Major Value & Trend'),
|
|
2832
|
+
name: 'singleValueRadial.majorValueAndTrend',
|
|
2833
|
+
value: {
|
|
2834
|
+
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
2835
|
+
majorColorEditorConfig: defaultContext.majorColorConfig,
|
|
2836
|
+
trendColorEditorConfig: defaultContext.trendColorConfig
|
|
2837
|
+
}),
|
|
2838
|
+
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
2839
|
+
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
|
|
2840
|
+
trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
|
|
2841
|
+
})
|
|
2842
|
+
}
|
|
2843
|
+
}, {
|
|
2844
|
+
label: i18n_1._('Trend'),
|
|
2845
|
+
name: 'singleValueRadial.trend',
|
|
2846
|
+
value: {
|
|
2847
|
+
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
2848
|
+
trendColorEditorConfig: defaultContext.trendColorConfig
|
|
2849
|
+
}),
|
|
2850
|
+
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
2851
|
+
trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
|
|
2852
|
+
})
|
|
2853
|
+
}
|
|
2854
|
+
}, {
|
|
2855
|
+
label: i18n_1._('Background'),
|
|
2856
|
+
name: 'singleValueRadial.background',
|
|
2857
|
+
value: {
|
|
2858
|
+
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
2859
|
+
backgroundColorEditorConfig: defaultContext.majorColorConfig
|
|
2860
|
+
}),
|
|
2861
|
+
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
2862
|
+
backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
|
|
2863
|
+
})
|
|
2864
|
+
}
|
|
2865
|
+
}];
|
|
2866
|
+
var themes = {
|
|
2867
|
+
defaultFontColor: function defaultFontColor(props) {
|
|
2868
|
+
return pick_1.default({
|
|
2869
|
+
enterprise: {
|
|
2870
|
+
dark: variables_1.default.white(props),
|
|
2871
|
+
light: variables_1.default.black(props)
|
|
2872
|
+
},
|
|
2873
|
+
prisma: variables_1.default.contentColorActive(props)
|
|
2874
|
+
})(props);
|
|
2875
|
+
},
|
|
2876
|
+
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
2877
|
+
return pick_1.default({
|
|
2878
|
+
enterprise: {
|
|
2879
|
+
dark: variables_1.default.black(props),
|
|
2880
|
+
light: variables_1.default.white(props)
|
|
2881
|
+
},
|
|
2882
|
+
prisma: variables_1.default.backgroundColorSidebar(props)
|
|
2883
|
+
})(props);
|
|
2884
|
+
},
|
|
2885
|
+
defaultRadialBackgroundColor: function defaultRadialBackgroundColor(props) {
|
|
2886
|
+
return pick_1.default({
|
|
2887
|
+
enterprise: {
|
|
2888
|
+
dark: 'rgba(255, 255, 255, 0.15)',
|
|
2889
|
+
light: 'rgba(0, 0, 0, 0.1)'
|
|
2890
|
+
},
|
|
2891
|
+
prisma: variables_1.default.interactiveColorBackgroundDisabled(props)
|
|
2892
|
+
})(props);
|
|
2893
|
+
}
|
|
2897
2894
|
};
|
|
2898
|
-
|
|
2899
|
-
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
|
|
2912
|
-
|
|
2913
|
-
var T = __webpack_require__(0);
|
|
2914
|
-
|
|
2915
|
-
var lodash_1 = __webpack_require__(3);
|
|
2916
|
-
|
|
2917
|
-
exports.PaginatorParamsPropTypes = T.shape({
|
|
2918
|
-
isPaging: T.bool,
|
|
2919
|
-
current: T.number,
|
|
2920
|
-
totalPages: T.number,
|
|
2921
|
-
onChange: T.func
|
|
2922
|
-
});
|
|
2923
|
-
|
|
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);
|
|
2934
|
-
|
|
2935
|
-
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
2936
|
-
var page = _ref2.page,
|
|
2937
|
-
countArg = _ref2.count;
|
|
2938
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
2939
|
-
|
|
2940
|
-
if (typeof countArg === 'number') {
|
|
2941
|
-
newParams.count = countArg;
|
|
2942
|
-
newParams.offset = 0;
|
|
2943
|
-
}
|
|
2944
|
-
|
|
2945
|
-
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
2946
|
-
|
|
2947
|
-
if (typeof page === 'number' && page > 0) {
|
|
2948
|
-
newParams.count = pageCount;
|
|
2949
|
-
newParams.offset = (page - 1) * pageCount;
|
|
2895
|
+
var editorConfig = [{
|
|
2896
|
+
label: i18n_1._('Major Value & Trend'),
|
|
2897
|
+
layout: [[{
|
|
2898
|
+
label: 'Unit Position',
|
|
2899
|
+
option: 'unitPosition',
|
|
2900
|
+
editor: 'editor.select',
|
|
2901
|
+
editorProps: {
|
|
2902
|
+
values: [{
|
|
2903
|
+
label: i18n_1._('Before'),
|
|
2904
|
+
value: 'before'
|
|
2905
|
+
}, {
|
|
2906
|
+
label: i18n_1._('After'),
|
|
2907
|
+
value: 'after'
|
|
2908
|
+
}]
|
|
2950
2909
|
}
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
exports.getPaginationParams = getPaginationParams;
|
|
2964
|
-
|
|
2965
|
-
/***/ }),
|
|
2966
|
-
|
|
2967
|
-
/***/ 3:
|
|
2968
|
-
/***/ (function(module, exports) {
|
|
2969
|
-
|
|
2970
|
-
module.exports = require("lodash");
|
|
2971
|
-
|
|
2972
|
-
/***/ }),
|
|
2973
|
-
|
|
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;
|
|
2985
|
-
|
|
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 = {}));
|
|
3000
|
-
|
|
3001
|
-
/***/ }),
|
|
3002
|
-
|
|
3003
|
-
/***/ 31:
|
|
3004
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
3005
|
-
|
|
3006
|
-
"use strict";
|
|
3007
|
-
|
|
3008
|
-
|
|
3009
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3010
|
-
value: true
|
|
3011
|
-
});
|
|
3012
|
-
|
|
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);
|
|
3022
|
-
|
|
3023
|
-
var TimezoneContext_1 = __webpack_require__(22);
|
|
3024
|
-
|
|
3025
|
-
var moment_1 = __webpack_require__(35);
|
|
3026
|
-
|
|
3027
|
-
var styled_components_1 = __webpack_require__(4);
|
|
3028
|
-
|
|
3029
|
-
var hocUtils_1 = __webpack_require__(24);
|
|
3030
|
-
|
|
3031
|
-
var JSONSchemaUtils_1 = __webpack_require__(25);
|
|
3032
|
-
|
|
3033
|
-
var SplunkVisualization_1 = __webpack_require__(36);
|
|
3034
|
-
|
|
3035
|
-
var VizBehavior_1 = __webpack_require__(5);
|
|
3036
|
-
|
|
3037
|
-
var getSorting_1 = __webpack_require__(28);
|
|
3038
|
-
|
|
3039
|
-
var getPagination_1 = __webpack_require__(29);
|
|
3040
|
-
|
|
3041
|
-
var useDeepMemo_1 = __webpack_require__(39);
|
|
3042
|
-
|
|
3043
|
-
var MissingPropsMessage_1 = __webpack_require__(40);
|
|
3044
|
-
|
|
3045
|
-
var withEditModeCover_1 = __webpack_require__(41);
|
|
3046
|
-
|
|
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
|
-
*/
|
|
3053
|
-
|
|
3054
|
-
|
|
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.
|
|
3062
|
-
|
|
3063
|
-
var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
|
|
3064
|
-
var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
|
|
3065
|
-
|
|
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;
|
|
3079
|
-
|
|
3080
|
-
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
3081
|
-
serializedTimezone = _React$useContext.serializedTimezone;
|
|
3082
|
-
|
|
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
|
-
}
|
|
2910
|
+
}, {
|
|
2911
|
+
label: i18n_1._('Unit Label'),
|
|
2912
|
+
option: 'unit',
|
|
2913
|
+
editor: 'editor.text'
|
|
2914
|
+
}], [{
|
|
2915
|
+
label: i18n_1._('Precision'),
|
|
2916
|
+
option: 'numberPrecision',
|
|
2917
|
+
editor: 'editor.number',
|
|
2918
|
+
editorProps: {
|
|
2919
|
+
min: 0,
|
|
2920
|
+
max: 20
|
|
3095
2921
|
}
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3104
|
-
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3109
|
-
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
2922
|
+
}, {
|
|
2923
|
+
label: i18n_1._('Trend Display'),
|
|
2924
|
+
option: 'trendDisplay',
|
|
2925
|
+
editor: 'editor.select',
|
|
2926
|
+
editorProps: {
|
|
2927
|
+
values: [{
|
|
2928
|
+
label: i18n_1._('Percent'),
|
|
2929
|
+
value: 'percent'
|
|
2930
|
+
}, {
|
|
2931
|
+
label: i18n_1._('Absolute'),
|
|
2932
|
+
value: 'absolute'
|
|
2933
|
+
}, {
|
|
2934
|
+
label: i18n_1._('Off'),
|
|
2935
|
+
value: 'off'
|
|
2936
|
+
}]
|
|
2937
|
+
}
|
|
2938
|
+
}]]
|
|
2939
|
+
}, {
|
|
2940
|
+
label: i18n_1._('Coloring'),
|
|
2941
|
+
layout: [[{
|
|
2942
|
+
label: 'Dynamic Elements',
|
|
2943
|
+
key: 'presetSelector',
|
|
2944
|
+
editor: 'editor.presetSelector',
|
|
2945
|
+
editorProps: {
|
|
2946
|
+
presets: presets,
|
|
2947
|
+
value: function value(_ref) {
|
|
2948
|
+
var context = _ref.context,
|
|
2949
|
+
options = _ref.options;
|
|
2950
|
+
var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
|
|
2951
|
+
return initialPreset && initialPreset.label || null;
|
|
3124
2952
|
}
|
|
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
2953
|
}
|
|
2954
|
+
}], [Object.assign(Object.assign({}, StaticMajorColorEditor_1.default), {
|
|
2955
|
+
editorProps: {
|
|
2956
|
+
labelPosition: 'left',
|
|
2957
|
+
themes: themes
|
|
2958
|
+
}
|
|
2959
|
+
})], [DynamicMajorColorEditor_1.getDynamicMajorColorEditor({
|
|
2960
|
+
defaultContext: defaultContext,
|
|
2961
|
+
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
2962
|
+
})], [Object.assign(Object.assign({}, StaticTrendColorEditor_1.default), {
|
|
2963
|
+
editorProps: {
|
|
2964
|
+
labelPosition: 'left',
|
|
2965
|
+
themes: themes
|
|
2966
|
+
}
|
|
2967
|
+
})], [DynamicTrendColorEditor_1.getDynamicTrendColorEditor({
|
|
2968
|
+
defaultContext: defaultContext,
|
|
2969
|
+
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
2970
|
+
})], RadialBackgroundColor_1.default({
|
|
2971
|
+
labelPosition: 'left',
|
|
2972
|
+
themes: themes
|
|
2973
|
+
}), [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
|
|
2974
|
+
editorProps: {
|
|
2975
|
+
labelPosition: 'left',
|
|
2976
|
+
themes: themes
|
|
2977
|
+
}
|
|
2978
|
+
})], [DynamicBackgroundColorEditor_1.getDynamicBackgroundColorEditor({
|
|
2979
|
+
defaultContext: defaultContext,
|
|
2980
|
+
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
2981
|
+
})]]
|
|
2982
|
+
}];
|
|
2983
|
+
/**
|
|
2984
|
+
* visualization configuration
|
|
2985
|
+
*/
|
|
3226
2986
|
|
|
3227
|
-
|
|
3228
|
-
|
|
3229
|
-
|
|
3230
|
-
|
|
3231
|
-
|
|
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
|
|
3239
|
-
|
|
3240
|
-
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
3241
|
-
|
|
3242
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
3243
|
-
};
|
|
3244
|
-
|
|
3245
|
-
exports.default = withDashboardViz;
|
|
3246
|
-
|
|
3247
|
-
/***/ }),
|
|
3248
|
-
|
|
3249
|
-
/***/ 32:
|
|
3250
|
-
/***/ (function(module, exports) {
|
|
3251
|
-
|
|
3252
|
-
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
3253
|
-
|
|
3254
|
-
/***/ }),
|
|
3255
|
-
|
|
3256
|
-
/***/ 33:
|
|
3257
|
-
/***/ (function(module, exports) {
|
|
3258
|
-
|
|
3259
|
-
module.exports = require("@splunk/visualization-encoding/Options");
|
|
3260
|
-
|
|
3261
|
-
/***/ }),
|
|
2987
|
+
var config = {
|
|
2988
|
+
/**
|
|
2989
|
+
* unique viz key
|
|
2990
|
+
*/
|
|
2991
|
+
key: 'splunk.singlevalueradial',
|
|
3262
2992
|
|
|
3263
|
-
|
|
3264
|
-
|
|
2993
|
+
/**
|
|
2994
|
+
* viz name
|
|
2995
|
+
*/
|
|
2996
|
+
name: 'Single Value Radial',
|
|
2997
|
+
category: VizCategory_1.VizCategory.SINGLE_VALUE,
|
|
3265
2998
|
|
|
3266
|
-
|
|
2999
|
+
/**
|
|
3000
|
+
* viz icon
|
|
3001
|
+
*/
|
|
3002
|
+
icon: visualization_icons_1.SingleValueRadial,
|
|
3003
|
+
placeholderIcon: placeholders_1.SingleValueRadial,
|
|
3004
|
+
dataContract: dataContract,
|
|
3005
|
+
size: size,
|
|
3006
|
+
defaultContext: defaultContext,
|
|
3007
|
+
optionsSchema: optionsSchema,
|
|
3008
|
+
editorConfig: editorConfig,
|
|
3009
|
+
events: {
|
|
3010
|
+
'value.click': {
|
|
3011
|
+
description: 'trigger when user clicks major value',
|
|
3012
|
+
payloadKeys: ['majorValue', 'trendValue']
|
|
3013
|
+
}
|
|
3014
|
+
},
|
|
3015
|
+
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
|
|
3016
|
+
themes: themes
|
|
3017
|
+
};
|
|
3018
|
+
exports.default = configUtils_1.enhanceConfig(config);
|
|
3267
3019
|
|
|
3268
3020
|
/***/ }),
|
|
3269
3021
|
|
|
3270
|
-
/***/
|
|
3022
|
+
/***/ 45:
|
|
3271
3023
|
/***/ (function(module, exports) {
|
|
3272
3024
|
|
|
3273
|
-
module.exports = require("@splunk/
|
|
3025
|
+
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
3274
3026
|
|
|
3275
3027
|
/***/ }),
|
|
3276
3028
|
|
|
3277
|
-
/***/
|
|
3029
|
+
/***/ 450:
|
|
3278
3030
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3279
3031
|
|
|
3280
3032
|
"use strict";
|
|
3281
3033
|
|
|
3282
3034
|
|
|
3283
|
-
var _classCallCheck = __webpack_require__(10);
|
|
3284
|
-
|
|
3285
3035
|
Object.defineProperty(exports, "__esModule", {
|
|
3286
3036
|
value: true
|
|
3287
3037
|
});
|
|
3288
|
-
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
3289
|
-
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
3290
3038
|
|
|
3291
|
-
var
|
|
3039
|
+
var i18n_1 = __webpack_require__(2);
|
|
3292
3040
|
|
|
3293
|
-
var
|
|
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
|
+
};
|
|
3294
3055
|
|
|
3295
|
-
|
|
3056
|
+
exports.default = radialBackground;
|
|
3296
3057
|
|
|
3058
|
+
/***/ }),
|
|
3297
3059
|
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
/**
|
|
3301
|
-
* A Splunk visualization
|
|
3302
|
-
*/
|
|
3060
|
+
/***/ 465:
|
|
3061
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3303
3062
|
|
|
3304
|
-
|
|
3305
|
-
|
|
3306
|
-
|
|
3063
|
+
"use strict";
|
|
3064
|
+
// ESM COMPAT FLAG
|
|
3065
|
+
__webpack_require__.r(__webpack_exports__);
|
|
3307
3066
|
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
*/
|
|
3312
|
-
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
3067
|
+
// EXTERNAL MODULE: external "@babel/runtime/helpers/extends"
|
|
3068
|
+
var extends_ = __webpack_require__(48);
|
|
3069
|
+
var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
|
|
3313
3070
|
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
3071
|
+
// EXTERNAL MODULE: external "react"
|
|
3072
|
+
var external_react_ = __webpack_require__(1);
|
|
3073
|
+
var external_react_default = /*#__PURE__*/__webpack_require__.n(external_react_);
|
|
3318
3074
|
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
3075
|
+
// EXTERNAL MODULE: external "prop-types"
|
|
3076
|
+
var external_prop_types_ = __webpack_require__(0);
|
|
3077
|
+
var external_prop_types_default = /*#__PURE__*/__webpack_require__.n(external_prop_types_);
|
|
3323
3078
|
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
context: T.object,
|
|
3079
|
+
// EXTERNAL MODULE: external "@splunk/themes/pick"
|
|
3080
|
+
var pick_ = __webpack_require__(21);
|
|
3081
|
+
var pick_default = /*#__PURE__*/__webpack_require__.n(pick_);
|
|
3328
3082
|
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
options: T.object,
|
|
3083
|
+
// EXTERNAL MODULE: external "@splunk/themes/variables"
|
|
3084
|
+
var variables_ = __webpack_require__(9);
|
|
3085
|
+
var variables_default = /*#__PURE__*/__webpack_require__.n(variables_);
|
|
3333
3086
|
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3337
|
-
onOptionsChange: T.func,
|
|
3087
|
+
// EXTERNAL MODULE: external "styled-components"
|
|
3088
|
+
var external_styled_components_ = __webpack_require__(4);
|
|
3089
|
+
var external_styled_components_default = /*#__PURE__*/__webpack_require__.n(external_styled_components_);
|
|
3338
3090
|
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
dataSources: T.objectOf(T.shape({
|
|
3343
|
-
/**
|
|
3344
|
-
* current request params
|
|
3345
|
-
*/
|
|
3346
|
-
requestParams: T.object,
|
|
3091
|
+
// EXTERNAL MODULE: external "lodash/pick"
|
|
3092
|
+
var external_lodash_pick_ = __webpack_require__(71);
|
|
3093
|
+
var external_lodash_pick_default = /*#__PURE__*/__webpack_require__.n(external_lodash_pick_);
|
|
3347
3094
|
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
data: T.shape({
|
|
3352
|
-
fields: T.array,
|
|
3353
|
-
columns: T.array
|
|
3354
|
-
}),
|
|
3095
|
+
// EXTERNAL MODULE: external "lodash/isEmpty"
|
|
3096
|
+
var isEmpty_ = __webpack_require__(72);
|
|
3097
|
+
var isEmpty_default = /*#__PURE__*/__webpack_require__.n(isEmpty_);
|
|
3355
3098
|
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
*/
|
|
3359
|
-
error: T.shape({
|
|
3360
|
-
level: T.string,
|
|
3361
|
-
message: T.string
|
|
3362
|
-
}),
|
|
3099
|
+
// EXTERNAL MODULE: external "@splunk/visualizations-shared/style"
|
|
3100
|
+
var style_ = __webpack_require__(15);
|
|
3363
3101
|
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
meta: T.object
|
|
3368
|
-
})),
|
|
3102
|
+
// EXTERNAL MODULE: external "@splunk/visualizations-shared/SizeAwareWrapper"
|
|
3103
|
+
var SizeAwareWrapper_ = __webpack_require__(20);
|
|
3104
|
+
var SizeAwareWrapper_default = /*#__PURE__*/__webpack_require__.n(SizeAwareWrapper_);
|
|
3369
3105
|
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
*/
|
|
3373
|
-
onEventTrigger: T.func,
|
|
3106
|
+
// EXTERNAL MODULE: ./src/common/components/VizStyleWrapper.jsx
|
|
3107
|
+
var VizStyleWrapper = __webpack_require__(63);
|
|
3374
3108
|
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
hasEventHandlers: T.bool,
|
|
3109
|
+
// EXTERNAL MODULE: external "@babel/runtime/helpers/defineProperty"
|
|
3110
|
+
var defineProperty_ = __webpack_require__(7);
|
|
3111
|
+
var defineProperty_default = /*#__PURE__*/__webpack_require__.n(defineProperty_);
|
|
3379
3112
|
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
*/
|
|
3383
|
-
onComputedProps: T.func,
|
|
3113
|
+
// EXTERNAL MODULE: ./src/SingleValueBasic/SingleValueBasic.jsx + 2 modules
|
|
3114
|
+
var SingleValueBasic = __webpack_require__(70);
|
|
3384
3115
|
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
*/
|
|
3388
|
-
vizActionHandlerRef: T.func,
|
|
3389
|
-
loading: T.bool,
|
|
3390
|
-
theme: T.object,
|
|
3116
|
+
// EXTERNAL MODULE: external "@splunk/visualizations-shared/colorConstants"
|
|
3117
|
+
var colorConstants_ = __webpack_require__(45);
|
|
3391
3118
|
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3119
|
+
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialGraph.jsx
|
|
3120
|
+
|
|
3121
|
+
|
|
3122
|
+
|
|
3123
|
+
|
|
3124
|
+
var RadialGraph_RadialGraph = function RadialGraph(_ref) {
|
|
3125
|
+
var progress = _ref.progress,
|
|
3126
|
+
strokeWidth = _ref.strokeWidth,
|
|
3127
|
+
_ref$backgroundColor = _ref.backgroundColor,
|
|
3128
|
+
backgroundColor = _ref$backgroundColor === void 0 ? colorConstants_["RADIAL_BACKGROUND_COLOR"] : _ref$backgroundColor,
|
|
3129
|
+
_ref$progressColor = _ref.progressColor,
|
|
3130
|
+
progressColor = _ref$progressColor === void 0 ? colorConstants_["RADIAL_STROKE_COLOR"] : _ref$progressColor,
|
|
3131
|
+
_ref$width = _ref.width,
|
|
3132
|
+
width = _ref$width === void 0 ? 200 : _ref$width,
|
|
3133
|
+
_ref$height = _ref.height,
|
|
3134
|
+
height = _ref$height === void 0 ? 200 : _ref$height;
|
|
3135
|
+
var semicircleRadius = height - strokeWidth / 2;
|
|
3136
|
+
var circumference = semicircleRadius * 2 * Math.PI;
|
|
3137
|
+
var bgCircleOffset = 0.5 * circumference;
|
|
3138
|
+
var progress50 = progress / 100 * 50;
|
|
3139
|
+
var progressWidth = progress50 / 100 * circumference;
|
|
3140
|
+
var strokeDashoffset = circumference * 0.5;
|
|
3141
|
+
return /*#__PURE__*/external_react_default.a.createElement("svg", {
|
|
3142
|
+
height: height,
|
|
3143
|
+
width: width,
|
|
3144
|
+
"data-test": "radial-visualization"
|
|
3145
|
+
}, /*#__PURE__*/external_react_default.a.createElement("g", null, /*#__PURE__*/external_react_default.a.createElement("circle", {
|
|
3146
|
+
"data-test": "background-radial",
|
|
3147
|
+
stroke: backgroundColor,
|
|
3148
|
+
fill: "transparent",
|
|
3149
|
+
strokeWidth: strokeWidth,
|
|
3150
|
+
strokeDasharray: "".concat(bgCircleOffset, " ").concat(circumference - bgCircleOffset),
|
|
3151
|
+
style: {
|
|
3152
|
+
strokeDashoffset: strokeDashoffset
|
|
3153
|
+
},
|
|
3154
|
+
r: semicircleRadius,
|
|
3155
|
+
cx: width / 2,
|
|
3156
|
+
cy: semicircleRadius + strokeWidth / 2
|
|
3157
|
+
}), /*#__PURE__*/external_react_default.a.createElement("circle", {
|
|
3158
|
+
"data-test": "progress-radial",
|
|
3159
|
+
stroke: progressColor,
|
|
3160
|
+
fill: "transparent",
|
|
3161
|
+
strokeWidth: strokeWidth,
|
|
3162
|
+
strokeDasharray: "".concat(progressWidth, " ").concat(circumference - progressWidth),
|
|
3163
|
+
style: {
|
|
3164
|
+
strokeDashoffset: strokeDashoffset
|
|
3165
|
+
},
|
|
3166
|
+
r: semicircleRadius,
|
|
3167
|
+
cx: width / 2,
|
|
3168
|
+
cy: semicircleRadius + strokeWidth / 2
|
|
3169
|
+
})));
|
|
3396
3170
|
};
|
|
3397
|
-
/**
|
|
3398
|
-
*
|
|
3399
|
-
*/
|
|
3400
3171
|
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3172
|
+
RadialGraph_RadialGraph.propTypes = {
|
|
3173
|
+
progress: external_prop_types_default.a.number,
|
|
3174
|
+
strokeWidth: external_prop_types_default.a.number,
|
|
3175
|
+
backgroundColor: external_prop_types_default.a.string,
|
|
3176
|
+
progressColor: external_prop_types_default.a.string,
|
|
3177
|
+
width: external_prop_types_default.a.number,
|
|
3178
|
+
height: external_prop_types_default.a.number
|
|
3179
|
+
};
|
|
3180
|
+
RadialGraph_RadialGraph.defaultProps = {
|
|
3181
|
+
progress: 0,
|
|
3182
|
+
strokeWidth: 12
|
|
3183
|
+
};
|
|
3184
|
+
/* harmony default export */ var PureSingleValueRadial_RadialGraph = (RadialGraph_RadialGraph);
|
|
3185
|
+
// EXTERNAL MODULE: ./src/common/utils/singleValueUtils.js
|
|
3186
|
+
var singleValueUtils = __webpack_require__(22);
|
|
3187
|
+
|
|
3188
|
+
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/utils/displayUtils.js
|
|
3189
|
+
|
|
3190
|
+
|
|
3191
|
+
var VALID_TREND_POSITIONS = ['standard', 'below', 'outside'];
|
|
3192
|
+
var MAJOR_FONT_THRESHOLD = 25;
|
|
3193
|
+
var TREND_FONT_THRESHOLD = 12;
|
|
3194
|
+
var DEFAULT_RADIAL_STROKE_WIDTH = 16;
|
|
3195
|
+
var SMALL_RADIAL_STROKE_WIDTH = 6;
|
|
3196
|
+
/**
|
|
3197
|
+
* Get the colors for a radial graph based on severity
|
|
3198
|
+
* @method getRadialColors
|
|
3199
|
+
* @param {Object} props
|
|
3200
|
+
* @param {Bool} props.backgroundEnabled
|
|
3201
|
+
* @param {String} props.backgroundColor
|
|
3202
|
+
* @returns {Object} { background, stroke } colors
|
|
3203
|
+
*/
|
|
3204
|
+
|
|
3205
|
+
var displayUtils_getRadialColors = function getRadialColors(_ref) {
|
|
3206
|
+
var backgroundEnabled = _ref.backgroundEnabled,
|
|
3207
|
+
backgroundColor = _ref.backgroundColor;
|
|
3208
|
+
return Object(singleValueUtils["getGraphColors"])({
|
|
3209
|
+
backgroundEnabled: backgroundEnabled,
|
|
3210
|
+
backgroundColor: backgroundColor,
|
|
3211
|
+
defaultColors: colorConstants_["RADIAL_SEVERITY_COLORS"],
|
|
3212
|
+
customColorFormatter: function customColorFormatter(color) {
|
|
3213
|
+
return {
|
|
3214
|
+
background: Object(singleValueUtils["lighten"])(color),
|
|
3215
|
+
stroke: Object(singleValueUtils["darken"])(color)
|
|
3216
|
+
};
|
|
3217
|
+
}
|
|
3218
|
+
});
|
|
3424
3219
|
};
|
|
3425
|
-
|
|
3220
|
+
/**
|
|
3221
|
+
* Figure out the dimensions of the graph
|
|
3222
|
+
* @method getRadialGraphDimensions
|
|
3223
|
+
* @param {Object} props
|
|
3224
|
+
* @param {Number} props.width // Width of the container
|
|
3225
|
+
* @param {Number} props.height // Height of the container
|
|
3226
|
+
* @returns {Number} width and height of the graph
|
|
3227
|
+
*/
|
|
3426
3228
|
|
|
3427
|
-
|
|
3229
|
+
var displayUtils_getRadialGraphDimensions = function getRadialGraphDimensions(_ref2) {
|
|
3230
|
+
var width = _ref2.width,
|
|
3231
|
+
height = _ref2.height; // height * 2 because we are fitting only half of a circle inside the container
|
|
3428
3232
|
|
|
3429
|
-
|
|
3430
|
-
|
|
3233
|
+
var radius = Math.min(width, height * 2) / 2;
|
|
3234
|
+
return {
|
|
3235
|
+
width: width - singleValueUtils["SVR_PADDING"].left - singleValueUtils["SVR_PADDING"].right,
|
|
3236
|
+
height: radius - singleValueUtils["SVR_PADDING"].top - singleValueUtils["SVR_PADDING"].bottom
|
|
3237
|
+
};
|
|
3238
|
+
};
|
|
3239
|
+
/**
|
|
3240
|
+
* Figure out the dimensions of the content container for SVR
|
|
3241
|
+
* @method getRadialHelperDimensions
|
|
3242
|
+
* @param {Object} props
|
|
3243
|
+
* @param {Number} props.width // Width of the visualization space
|
|
3244
|
+
* @param {Number} props.height // Height of the visualization space
|
|
3245
|
+
* @returns {Number} width and height of the content graph
|
|
3246
|
+
*/
|
|
3431
3247
|
|
|
3432
|
-
|
|
3248
|
+
var getRadialHelperDimensions = function getRadialHelperDimensions(_ref3) {
|
|
3249
|
+
var height = _ref3.height,
|
|
3250
|
+
_ref3$strokeWidth = _ref3.strokeWidth,
|
|
3251
|
+
strokeWidth = _ref3$strokeWidth === void 0 ? DEFAULT_RADIAL_STROKE_WIDTH : _ref3$strokeWidth; // The radius of the visualization is equal to the height
|
|
3433
3252
|
|
|
3253
|
+
var semicircleRadius = height - strokeWidth / 2; // The inner part of the arc is strokeWidth / 2 inset.
|
|
3434
3254
|
|
|
3435
|
-
var
|
|
3255
|
+
var innerArcRadius = semicircleRadius * 0.9;
|
|
3256
|
+
var halfContentWidth = innerArcRadius * 0.7;
|
|
3257
|
+
var contentHeight = Math.floor(Math.sqrt(Math.pow(innerArcRadius, 2) - Math.pow(halfContentWidth, 2)));
|
|
3258
|
+
return {
|
|
3259
|
+
contentWidth: halfContentWidth * 2,
|
|
3260
|
+
contentHeight: contentHeight,
|
|
3261
|
+
helperArcRadius: innerArcRadius,
|
|
3262
|
+
semicircleRadius: semicircleRadius
|
|
3263
|
+
};
|
|
3264
|
+
};
|
|
3265
|
+
/**
|
|
3266
|
+
* Get the maximum size of the container that holds the graph text
|
|
3267
|
+
* @method getValueContentSize
|
|
3268
|
+
* @param {Object} props
|
|
3269
|
+
* @param {Number} props.graphSize
|
|
3270
|
+
* @param {Number} props.radialStrokeWidth // Stroke width of the graph
|
|
3271
|
+
* @returns {Number} content size for showing major and trend values in radial graph
|
|
3272
|
+
*/
|
|
3436
3273
|
|
|
3437
|
-
var
|
|
3274
|
+
var getValueContentSize = function getValueContentSize(_ref4) {
|
|
3275
|
+
var graphSize = _ref4.graphSize,
|
|
3276
|
+
radialStrokeWidth = _ref4.radialStrokeWidth; // Account for the graph's stroke width
|
|
3438
3277
|
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
});
|
|
3442
|
-
exports.DefaultVizActionHandler = void 0;
|
|
3278
|
+
var diameter = graphSize - radialStrokeWidth; // Use pythagoreum theorum with circle diameter
|
|
3279
|
+
// to calculate the size of the sides of the square inside the circle
|
|
3443
3280
|
|
|
3444
|
-
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3281
|
+
return Math.floor(Math.sqrt(Math.pow(diameter, 2) / 2));
|
|
3282
|
+
};
|
|
3283
|
+
/*
|
|
3284
|
+
* @method getRadialStrokeWidth
|
|
3285
|
+
* @param {Number} graphHeight
|
|
3286
|
+
* @returns {Number} radial stroke width
|
|
3287
|
+
*/
|
|
3448
3288
|
|
|
3449
|
-
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3453
|
-
|
|
3454
|
-
|
|
3455
|
-
|
|
3456
|
-
|
|
3457
|
-
}
|
|
3458
|
-
}]);
|
|
3289
|
+
var getRadialStrokeWidth = function getRadialStrokeWidth(graphHeight) {
|
|
3290
|
+
return graphHeight >= 90 ? DEFAULT_RADIAL_STROKE_WIDTH : SMALL_RADIAL_STROKE_WIDTH;
|
|
3291
|
+
};
|
|
3292
|
+
/*
|
|
3293
|
+
* @method isValidPosition
|
|
3294
|
+
* @param {String} position
|
|
3295
|
+
* @returns {Bool}
|
|
3296
|
+
*/
|
|
3459
3297
|
|
|
3460
|
-
|
|
3461
|
-
|
|
3298
|
+
var isValidPosition = function isValidPosition(position) {
|
|
3299
|
+
return VALID_TREND_POSITIONS.indexOf(position) > -1;
|
|
3300
|
+
};
|
|
3301
|
+
/*
|
|
3302
|
+
* @method showTrendPositionStandard
|
|
3303
|
+
* @param {Object} props
|
|
3304
|
+
* @param {Bool} props.showTrendIndicator
|
|
3305
|
+
* @param {String} props.position
|
|
3306
|
+
* @returns {Bool}
|
|
3307
|
+
*/
|
|
3462
3308
|
|
|
3463
|
-
|
|
3309
|
+
var showTrendPositionStandard = function showTrendPositionStandard(_ref5) {
|
|
3310
|
+
var showTrendIndicator = _ref5.showTrendIndicator,
|
|
3311
|
+
position = _ref5.position;
|
|
3312
|
+
return showTrendIndicator && position === 'standard';
|
|
3313
|
+
};
|
|
3314
|
+
/*
|
|
3315
|
+
* @method showTrendPositionBelow
|
|
3316
|
+
* @param {Object} props
|
|
3317
|
+
* @param {Bool} props.showTrendIndicator
|
|
3318
|
+
* @param {String} props.position
|
|
3319
|
+
* @returns {Bool}
|
|
3320
|
+
*/
|
|
3464
3321
|
|
|
3465
|
-
|
|
3322
|
+
var showTrendPositionBelow = function showTrendPositionBelow(_ref6) {
|
|
3323
|
+
var showTrendIndicator = _ref6.showTrendIndicator,
|
|
3324
|
+
position = _ref6.position;
|
|
3325
|
+
return showTrendIndicator && position === 'below';
|
|
3326
|
+
};
|
|
3327
|
+
/*
|
|
3328
|
+
* @method showTrendPositionOutside
|
|
3329
|
+
* @param {Object} props
|
|
3330
|
+
* @param {Bool} props.showTrendIndicator
|
|
3331
|
+
* @param {String} props.position
|
|
3332
|
+
* @returns {Bool}
|
|
3333
|
+
*/
|
|
3466
3334
|
|
|
3467
|
-
|
|
3468
|
-
|
|
3335
|
+
var showTrendPositionOutside = function showTrendPositionOutside(_ref7) {
|
|
3336
|
+
var showTrendIndicator = _ref7.showTrendIndicator,
|
|
3337
|
+
position = _ref7.position;
|
|
3338
|
+
return showTrendIndicator && position === 'outside';
|
|
3339
|
+
};
|
|
3340
|
+
/*
|
|
3341
|
+
* need to handle max and min
|
|
3342
|
+
* @method getRadialProgress
|
|
3343
|
+
* @param {Number} majorValue
|
|
3344
|
+
* @returns {Number} progress bar in radial graph
|
|
3345
|
+
*/
|
|
3469
3346
|
|
|
3470
|
-
|
|
3347
|
+
var getRadialProgress = function getRadialProgress(majorValue, maxValue) {
|
|
3348
|
+
return Number.isNaN(Number(majorValue)) || Number.isNaN(Number(maxValue)) || majorValue < 0 && majorValue < maxValue ? 0 : majorValue / maxValue * 100;
|
|
3349
|
+
};
|
|
3350
|
+
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/RadialLayout.jsx
|
|
3471
3351
|
|
|
3472
3352
|
|
|
3473
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3474
|
-
value: true
|
|
3475
|
-
});
|
|
3476
|
-
exports.validSortDirs = void 0;
|
|
3477
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
3478
3353
|
|
|
3479
|
-
|
|
3354
|
+
function ownKeys(object, enumerableOnly) {
|
|
3355
|
+
var keys = Object.keys(object);
|
|
3480
3356
|
|
|
3481
|
-
|
|
3482
|
-
|
|
3357
|
+
if (Object.getOwnPropertySymbols) {
|
|
3358
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
3359
|
+
if (enumerableOnly) symbols = symbols.filter(function (sym) {
|
|
3360
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
3361
|
+
});
|
|
3362
|
+
keys.push.apply(keys, symbols);
|
|
3363
|
+
}
|
|
3483
3364
|
|
|
3484
|
-
|
|
3365
|
+
return keys;
|
|
3366
|
+
}
|
|
3485
3367
|
|
|
3368
|
+
function _objectSpread(target) {
|
|
3369
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
3370
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
3486
3371
|
|
|
3487
|
-
|
|
3488
|
-
|
|
3489
|
-
|
|
3490
|
-
|
|
3372
|
+
if (i % 2) {
|
|
3373
|
+
ownKeys(Object(source), true).forEach(function (key) {
|
|
3374
|
+
defineProperty_default()(target, key, source[key]);
|
|
3375
|
+
});
|
|
3376
|
+
} else if (Object.getOwnPropertyDescriptors) {
|
|
3377
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
3378
|
+
} else {
|
|
3379
|
+
ownKeys(Object(source)).forEach(function (key) {
|
|
3380
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
3381
|
+
});
|
|
3382
|
+
}
|
|
3383
|
+
}
|
|
3491
3384
|
|
|
3492
|
-
|
|
3385
|
+
return target;
|
|
3386
|
+
}
|
|
3493
3387
|
|
|
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
3388
|
|
|
3509
3389
|
|
|
3510
|
-
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
3511
|
-
var ref = react_1.useRef();
|
|
3512
3390
|
|
|
3513
|
-
if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
|
|
3514
|
-
ref.current = {
|
|
3515
|
-
dependencies: dependencies,
|
|
3516
|
-
value: fn()
|
|
3517
|
-
};
|
|
3518
|
-
}
|
|
3519
3391
|
|
|
3520
|
-
return ref.current.value;
|
|
3521
|
-
};
|
|
3522
3392
|
|
|
3523
|
-
exports.useDeepMemo = useDeepMemo;
|
|
3524
3393
|
|
|
3525
|
-
|
|
3394
|
+
var TextContainer = external_styled_components_default.a.div.withConfig({
|
|
3395
|
+
displayName: "RadialLayout__TextContainer",
|
|
3396
|
+
componentId: "sc-13x2rjt-0"
|
|
3397
|
+
})(["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) {
|
|
3398
|
+
return props.smallViz ? 'relative' : 'absolute';
|
|
3399
|
+
}, function (props) {
|
|
3400
|
+
return props.align || 'center';
|
|
3401
|
+
}, function (props) {
|
|
3402
|
+
return !props.smallViz && {
|
|
3403
|
+
lineHeight: 'normal'
|
|
3404
|
+
};
|
|
3405
|
+
}, function (props) {
|
|
3406
|
+
return props.smallViz && {
|
|
3407
|
+
marginLeft: '1px'
|
|
3408
|
+
};
|
|
3409
|
+
}, function (props) {
|
|
3410
|
+
return props.smallViz && {
|
|
3411
|
+
marginLeft: '1px'
|
|
3412
|
+
};
|
|
3413
|
+
}, function (props) {
|
|
3414
|
+
return props.smallViz && {
|
|
3415
|
+
margin: '0 1px'
|
|
3416
|
+
};
|
|
3417
|
+
});
|
|
3418
|
+
var GraphContainer = external_styled_components_default.a.div.withConfig({
|
|
3419
|
+
displayName: "RadialLayout__GraphContainer",
|
|
3420
|
+
componentId: "sc-13x2rjt-1"
|
|
3421
|
+
})(["position:relative;margin:0 auto;width:", "px;height:", "px;display:flex;justify-content:center;align-items:center;flex-direction:column;"], function (props) {
|
|
3422
|
+
return props.width;
|
|
3423
|
+
}, function (props) {
|
|
3424
|
+
return props.height;
|
|
3425
|
+
});
|
|
3426
|
+
var UnderLabelContainer = external_styled_components_default.a.div.withConfig({
|
|
3427
|
+
displayName: "RadialLayout__UnderLabelContainer",
|
|
3428
|
+
componentId: "sc-13x2rjt-2"
|
|
3429
|
+
})(["display:flex;flex:0 0 ", "px;align-items:flex-end;"], function (props) {
|
|
3430
|
+
return props.underLabelHeight;
|
|
3431
|
+
});
|
|
3432
|
+
var UnderLabelText = external_styled_components_default.a.span.withConfig({
|
|
3433
|
+
displayName: "RadialLayout__UnderLabelText",
|
|
3434
|
+
componentId: "sc-13x2rjt-3"
|
|
3435
|
+
})(["color:", ";-webkit-text-stroke:0.5px ", ";font-size:12px;max-width:", "px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;"], function (props) {
|
|
3436
|
+
return props.color;
|
|
3437
|
+
}, function (props) {
|
|
3438
|
+
return props.strokeColor;
|
|
3439
|
+
}, function (props) {
|
|
3440
|
+
return props.maxWidth;
|
|
3441
|
+
});
|
|
3526
3442
|
|
|
3527
|
-
|
|
3528
|
-
|
|
3443
|
+
var RadialLayout_RadialContent = function RadialContent(_ref) {
|
|
3444
|
+
var props = extends_default()({}, _ref);
|
|
3529
3445
|
|
|
3530
|
-
|
|
3446
|
+
var majorColor = props.majorColor,
|
|
3447
|
+
majorText = props.majorText,
|
|
3448
|
+
majorTextFontSize = props.majorTextFontSize,
|
|
3449
|
+
majorValueTitle = props.majorValueTitle,
|
|
3450
|
+
trendColor = props.trendColor,
|
|
3451
|
+
trendText = props.trendText,
|
|
3452
|
+
trendTextFontSize = props.trendTextFontSize,
|
|
3453
|
+
showTrendIndicator = props.showTrendIndicator,
|
|
3454
|
+
unit = props.unit,
|
|
3455
|
+
unitPosition = props.unitPosition,
|
|
3456
|
+
underLabelColor = props.underLabelColor,
|
|
3457
|
+
underLabel = props.underLabel,
|
|
3458
|
+
onValueClick = props.onValueClick,
|
|
3459
|
+
showRadialGraph = props.showRadialGraph,
|
|
3460
|
+
progress = props.progress,
|
|
3461
|
+
radialBackgroundColor = props.radialBackgroundColor,
|
|
3462
|
+
radialStrokeColor = props.radialStrokeColor,
|
|
3463
|
+
radialStrokeWidth = props.radialStrokeWidth,
|
|
3464
|
+
graphWidth = props.graphWidth,
|
|
3465
|
+
graphHeight = props.graphHeight,
|
|
3466
|
+
underLabelStrokeColor = props.underLabelStrokeColor;
|
|
3531
3467
|
|
|
3532
|
-
|
|
3468
|
+
var _getRadialHelperDimen = getRadialHelperDimensions({
|
|
3469
|
+
height: graphHeight,
|
|
3470
|
+
strokeWidth: radialStrokeWidth
|
|
3471
|
+
}),
|
|
3472
|
+
semicircleRadius = _getRadialHelperDimen.semicircleRadius,
|
|
3473
|
+
helperArcRadius = _getRadialHelperDimen.helperArcRadius; // Two cases for filling underLabel space: either the semicircle radius is insufficiently sized for text
|
|
3474
|
+
// or the radial visualization has been disabled (first condition reached first when making smaller).
|
|
3533
3475
|
|
|
3534
|
-
/***/ 40:
|
|
3535
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
3536
3476
|
|
|
3537
|
-
|
|
3477
|
+
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
3478
|
|
|
3479
|
+
var underLabelHeight = fillVacantSpace ? 0 : Math.max(helperArcRadius * 0.2, 20);
|
|
3480
|
+
var underLabelWidth = helperArcRadius * 2;
|
|
3481
|
+
var basicSingleValues = /*#__PURE__*/external_react_default.a.createElement(SingleValueBasic["default"], {
|
|
3482
|
+
majorColor: majorColor,
|
|
3483
|
+
majorText: majorText,
|
|
3484
|
+
majorTextFontSize: majorTextFontSize,
|
|
3485
|
+
majorValueTitle: majorValueTitle,
|
|
3486
|
+
trendColor: trendColor,
|
|
3487
|
+
trendText: trendText,
|
|
3488
|
+
trendTextFontSize: trendTextFontSize,
|
|
3489
|
+
showTrendIndicator: showTrendIndicator,
|
|
3490
|
+
unit: unit,
|
|
3491
|
+
unitPosition: unitPosition,
|
|
3492
|
+
onValueClick: onValueClick
|
|
3493
|
+
});
|
|
3494
|
+
var radialGraph = showRadialGraph ? /*#__PURE__*/external_react_default.a.createElement(PureSingleValueRadial_RadialGraph, {
|
|
3495
|
+
progress: progress,
|
|
3496
|
+
backgroundColor: radialBackgroundColor,
|
|
3497
|
+
progressColor: radialStrokeColor,
|
|
3498
|
+
strokeWidth: radialStrokeWidth,
|
|
3499
|
+
width: graphWidth,
|
|
3500
|
+
height: graphHeight
|
|
3501
|
+
}) : null;
|
|
3502
|
+
var underLabelComponent = /*#__PURE__*/external_react_default.a.createElement(UnderLabelContainer, {
|
|
3503
|
+
underLabelHeight: underLabelHeight
|
|
3504
|
+
}, !fillVacantSpace && underLabel && /*#__PURE__*/external_react_default.a.createElement(UnderLabelText, {
|
|
3505
|
+
"data-test": "underLabel",
|
|
3506
|
+
maxWidth: underLabelWidth * 0.9 // buffer for overflow ellipses
|
|
3507
|
+
,
|
|
3508
|
+
color: underLabelColor,
|
|
3509
|
+
strokeColor: underLabelStrokeColor,
|
|
3510
|
+
title: underLabel
|
|
3511
|
+
}, underLabel));
|
|
3512
|
+
return /*#__PURE__*/external_react_default.a.createElement(GraphContainer, {
|
|
3513
|
+
width: graphWidth,
|
|
3514
|
+
height: graphHeight
|
|
3515
|
+
}, radialGraph, /*#__PURE__*/external_react_default.a.createElement(TextContainer, {
|
|
3516
|
+
smallViz: !showRadialGraph,
|
|
3517
|
+
height: graphHeight
|
|
3518
|
+
}, basicSingleValues, underLabelComponent));
|
|
3519
|
+
};
|
|
3539
3520
|
|
|
3540
|
-
|
|
3541
|
-
|
|
3521
|
+
RadialLayout_RadialContent.propTypes = _objectSpread(_objectSpread({}, SingleValueBasic["default"].propTypes), {}, {
|
|
3522
|
+
trendPosition: external_prop_types_default.a.string,
|
|
3523
|
+
showRadialGraph: external_prop_types_default.a.bool,
|
|
3524
|
+
progress: external_prop_types_default.a.number,
|
|
3525
|
+
radialBackgroundColor: external_prop_types_default.a.string,
|
|
3526
|
+
radialStrokeColor: external_prop_types_default.a.string,
|
|
3527
|
+
radialStrokeWidth: external_prop_types_default.a.number,
|
|
3528
|
+
graphWidth: external_prop_types_default.a.number,
|
|
3529
|
+
graphHeight: external_prop_types_default.a.number,
|
|
3530
|
+
underLabelStrokeColor: external_prop_types_default.a.string
|
|
3542
3531
|
});
|
|
3543
|
-
|
|
3544
|
-
|
|
3545
|
-
var React = __webpack_require__(1);
|
|
3546
|
-
|
|
3547
|
-
var T = __webpack_require__(0);
|
|
3548
|
-
|
|
3549
|
-
var i18n_1 = __webpack_require__(2);
|
|
3532
|
+
/* harmony default export */ var RadialLayout = (RadialLayout_RadialContent);
|
|
3533
|
+
// CONCATENATED MODULE: ./src/SingleValueRadial/PureSingleValueRadial/SingleValueRadial.jsx
|
|
3550
3534
|
|
|
3551
|
-
var Message_1 = __webpack_require__(9);
|
|
3552
3535
|
|
|
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
3536
|
|
|
3560
3537
|
|
|
3561
|
-
var isMissing = function isMissing(v) {
|
|
3562
|
-
return v === null || v === undefined;
|
|
3563
|
-
};
|
|
3564
3538
|
|
|
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
3539
|
|
|
3573
|
-
var missingKeys = function missingKeys(keys, target) {
|
|
3574
|
-
return keys.filter(function (k) {
|
|
3575
|
-
return exports.isMissing(target[k]);
|
|
3576
|
-
});
|
|
3577
|
-
};
|
|
3578
3540
|
|
|
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
3541
|
|
|
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
3542
|
|
|
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
3543
|
|
|
3613
|
-
/***/ }),
|
|
3614
3544
|
|
|
3615
|
-
/***/ 41:
|
|
3616
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
3617
3545
|
|
|
3618
|
-
"use strict";
|
|
3619
3546
|
|
|
3620
3547
|
|
|
3621
|
-
|
|
3622
|
-
|
|
3548
|
+
var Container = external_styled_components_default.a.div.withConfig({
|
|
3549
|
+
displayName: "SingleValueRadial__Container",
|
|
3550
|
+
componentId: "sc-404dvw-0"
|
|
3551
|
+
})(["overflow:hidden;", ";"], function (props) {
|
|
3552
|
+
return Object(style_["toDimension"])(external_lodash_pick_default()(props, ['width', 'height']));
|
|
3623
3553
|
});
|
|
3624
3554
|
|
|
3625
|
-
var
|
|
3626
|
-
|
|
3627
|
-
var styled_components_1 = __webpack_require__(4);
|
|
3628
|
-
|
|
3629
|
-
var hocUtils_1 = __webpack_require__(13);
|
|
3555
|
+
var SingleValueRadial_SingleValueRadial = function SingleValueRadial(_ref) {
|
|
3556
|
+
var props = extends_default()({}, _ref);
|
|
3630
3557
|
|
|
3631
|
-
var
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3641
|
-
|
|
3642
|
-
|
|
3643
|
-
|
|
3644
|
-
|
|
3645
|
-
|
|
3646
|
-
*/
|
|
3558
|
+
var width = props.width,
|
|
3559
|
+
_props$height = props.height,
|
|
3560
|
+
height = _props$height === void 0 ? 250 : _props$height,
|
|
3561
|
+
style = props.style,
|
|
3562
|
+
majorFontSize = props.majorFontSize,
|
|
3563
|
+
majorValue = props.majorValue,
|
|
3564
|
+
majorValueField = props.majorValueField,
|
|
3565
|
+
maxValue = props.maxValue,
|
|
3566
|
+
trendValue = props.trendValue,
|
|
3567
|
+
trendFontSize = props.trendFontSize,
|
|
3568
|
+
unitPosition = props.unitPosition,
|
|
3569
|
+
numberPrecision = props.numberPrecision,
|
|
3570
|
+
shouldUseThousandSeparators = props.shouldUseThousandSeparators,
|
|
3571
|
+
shouldAbbreviateTrendValue = props.shouldAbbreviateTrendValue,
|
|
3572
|
+
onValueClick = props.onValueClick; // calculate colors
|
|
3647
3573
|
|
|
3648
|
-
var
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3654
|
-
|
|
3574
|
+
var defaultColors = {
|
|
3575
|
+
defaultFontColor: pick_default()({
|
|
3576
|
+
enterprise: {
|
|
3577
|
+
dark: variables_default.a.textColor(props),
|
|
3578
|
+
light: variables_default.a.gray20(props)
|
|
3579
|
+
},
|
|
3580
|
+
prisma: variables_default.a.contentColorActive(props)
|
|
3581
|
+
})(props),
|
|
3582
|
+
defaultBlockFontColor: pick_default()({
|
|
3583
|
+
enterprise: variables_default.a.white(props),
|
|
3584
|
+
prisma: variables_default.a.contentColorActive(props)
|
|
3585
|
+
})(props)
|
|
3655
3586
|
};
|
|
3656
3587
|
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
3662
|
-
|
|
3663
|
-
|
|
3664
|
-
exports.default = withEditModeCover;
|
|
3665
|
-
|
|
3666
|
-
/***/ }),
|
|
3667
|
-
|
|
3668
|
-
/***/ 42:
|
|
3669
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
3588
|
+
var _computeColors = Object(singleValueUtils["computeColors"])(props, defaultColors),
|
|
3589
|
+
backgroundEnabled = _computeColors.backgroundEnabled,
|
|
3590
|
+
backgroundColor = _computeColors.backgroundColor,
|
|
3591
|
+
majorColor = _computeColors.majorColor,
|
|
3592
|
+
trendColor = _computeColors.trendColor,
|
|
3593
|
+
underLabelColor = _computeColors.underLabelColor;
|
|
3670
3594
|
|
|
3671
|
-
|
|
3595
|
+
var radialColors = displayUtils_getRadialColors({
|
|
3596
|
+
backgroundEnabled: backgroundEnabled,
|
|
3597
|
+
backgroundColor: backgroundColor
|
|
3598
|
+
});
|
|
3599
|
+
var radialBackgroundColor = props.radialBackgroundColor || radialColors.background;
|
|
3600
|
+
var radialStrokeColor = props.radialStrokeColor || radialColors.stroke;
|
|
3601
|
+
var underLabelStrokeColor = backgroundEnabled ? backgroundColor : 'transparent';
|
|
3602
|
+
var handleValueClick = Object(external_react_["useCallback"])(function (ev) {
|
|
3603
|
+
return Object(singleValueUtils["handleValueClickCallback"])(ev, majorValue, majorValueField, trendValue, onValueClick);
|
|
3604
|
+
}, [onValueClick, majorValue, majorValueField, trendValue]);
|
|
3672
3605
|
|
|
3606
|
+
var renderVisualization = function renderVisualization(_ref2) {
|
|
3607
|
+
var containerWidth = _ref2.width,
|
|
3608
|
+
containerHeight = _ref2.height;
|
|
3609
|
+
var underLabel = props.underLabel;
|
|
3610
|
+
var trendDisplay = props.trendDisplay,
|
|
3611
|
+
unit = props.unit; // calculate radial graph dimensions, strokewidth, and major and trend content dimensions
|
|
3673
3612
|
|
|
3674
|
-
|
|
3675
|
-
|
|
3676
|
-
|
|
3613
|
+
var _getRadialGraphDimens = displayUtils_getRadialGraphDimensions({
|
|
3614
|
+
width: containerWidth,
|
|
3615
|
+
height: containerHeight
|
|
3616
|
+
}),
|
|
3617
|
+
graphWidth = _getRadialGraphDimens.width,
|
|
3618
|
+
graphHeight = _getRadialGraphDimens.height; // Radial stroke width is stepped to lower value at lower sizes.
|
|
3677
3619
|
|
|
3678
|
-
var React = __webpack_require__(1);
|
|
3679
3620
|
|
|
3680
|
-
var
|
|
3621
|
+
var radialStrokeWidth = getRadialStrokeWidth(graphHeight);
|
|
3681
3622
|
|
|
3682
|
-
var
|
|
3623
|
+
var _getRadialHelperDimen = getRadialHelperDimensions({
|
|
3624
|
+
height: graphHeight - radialStrokeWidth / 2,
|
|
3625
|
+
strokeWidth: radialStrokeWidth
|
|
3626
|
+
}),
|
|
3627
|
+
contentWidth = _getRadialHelperDimen.contentWidth,
|
|
3628
|
+
contentHeight = _getRadialHelperDimen.contentHeight; // Subtract half of the stroke width for the exact internal radius.
|
|
3683
3629
|
|
|
3684
|
-
var IconPlaceholder_1 = __webpack_require__(27);
|
|
3685
3630
|
|
|
3686
|
-
var
|
|
3631
|
+
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
3632
|
|
|
3688
|
-
var
|
|
3633
|
+
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
3634
|
|
|
3690
|
-
|
|
3691
|
-
|
|
3692
|
-
|
|
3693
|
-
|
|
3635
|
+
if (!showRadialGraph) {
|
|
3636
|
+
graphWidth = containerWidth;
|
|
3637
|
+
contentWidth = containerWidth;
|
|
3638
|
+
graphHeight = containerHeight;
|
|
3639
|
+
contentHeight = containerHeight;
|
|
3640
|
+
}
|
|
3694
3641
|
|
|
3695
|
-
|
|
3696
|
-
|
|
3642
|
+
var _computeSingleValueRa = Object(singleValueUtils["computeSingleValueRadialContent"])({
|
|
3643
|
+
majorValue: majorValue,
|
|
3644
|
+
trendValue: trendValue,
|
|
3645
|
+
majorFontSize: majorFontSize,
|
|
3646
|
+
trendFontSize: trendFontSize,
|
|
3647
|
+
trendDisplay: trendDisplay,
|
|
3648
|
+
contentWidth: contentWidth,
|
|
3649
|
+
contentHeight: contentHeight,
|
|
3650
|
+
// buffer for height of div
|
|
3651
|
+
containerWidth: containerWidth * 0.9,
|
|
3652
|
+
containerHeight: containerHeight * 0.9,
|
|
3653
|
+
unit: unit,
|
|
3654
|
+
numberPrecision: numberPrecision,
|
|
3655
|
+
shouldUseThousandSeparators: shouldUseThousandSeparators,
|
|
3656
|
+
shouldAbbreviateTrendValue: shouldAbbreviateTrendValue,
|
|
3657
|
+
smallViz: !showRadialGraph
|
|
3658
|
+
}),
|
|
3659
|
+
majorText = _computeSingleValueRa.majorText,
|
|
3660
|
+
trendText = _computeSingleValueRa.trendText,
|
|
3661
|
+
majorTextFontSize = _computeSingleValueRa.majorTextFontSize,
|
|
3662
|
+
trendTextFontSize = _computeSingleValueRa.trendTextFontSize,
|
|
3663
|
+
majorValueTitle = _computeSingleValueRa.majorValueTitle,
|
|
3664
|
+
smallVizProps = _computeSingleValueRa.smallVizProps;
|
|
3697
3665
|
|
|
3698
|
-
|
|
3699
|
-
|
|
3700
|
-
|
|
3701
|
-
|
|
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);
|
|
3666
|
+
if (!isEmpty_default()(smallVizProps)) {
|
|
3667
|
+
trendDisplay = smallVizProps.trendDisplay;
|
|
3668
|
+
unit = smallVizProps.unit;
|
|
3669
|
+
} // calculate radial progress
|
|
3707
3670
|
|
|
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
3671
|
|
|
3719
|
-
|
|
3672
|
+
var progress = getRadialProgress(majorValue, maxValue);
|
|
3673
|
+
return /*#__PURE__*/external_react_default.a.createElement(VizStyleWrapper["default"], {
|
|
3674
|
+
backgroundColor: backgroundColor,
|
|
3675
|
+
style: style,
|
|
3676
|
+
dataTestKey: "SingleValueRadialWrapper"
|
|
3677
|
+
}, /*#__PURE__*/external_react_default.a.createElement(RadialLayout, {
|
|
3678
|
+
"data-test": "RadialLayout",
|
|
3679
|
+
majorColor: majorColor,
|
|
3680
|
+
majorText: majorText,
|
|
3681
|
+
majorTextFontSize: majorTextFontSize,
|
|
3682
|
+
majorValueTitle: majorValueTitle,
|
|
3683
|
+
trendColor: trendColor,
|
|
3684
|
+
trendText: trendText,
|
|
3685
|
+
trendTextFontSize: trendTextFontSize,
|
|
3686
|
+
showTrendIndicator: Object(singleValueUtils["shouldShowTrend"])(trendDisplay),
|
|
3687
|
+
unit: unit,
|
|
3688
|
+
unitPosition: unitPosition,
|
|
3689
|
+
underLabelColor: underLabelColor,
|
|
3690
|
+
underLabel: underLabel,
|
|
3691
|
+
onValueClick: handleValueClick,
|
|
3692
|
+
showRadialGraph: showRadialGraph,
|
|
3693
|
+
progress: progress,
|
|
3694
|
+
radialBackgroundColor: radialBackgroundColor,
|
|
3695
|
+
radialStrokeColor: radialStrokeColor,
|
|
3696
|
+
radialStrokeWidth: radialStrokeWidth,
|
|
3697
|
+
graphWidth: graphWidth,
|
|
3698
|
+
graphHeight: graphHeight,
|
|
3699
|
+
underLabelStrokeColor: underLabelStrokeColor
|
|
3700
|
+
}));
|
|
3720
3701
|
};
|
|
3721
3702
|
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
})
|
|
3726
|
-
|
|
3703
|
+
return /*#__PURE__*/external_react_default.a.createElement(Container, {
|
|
3704
|
+
width: width,
|
|
3705
|
+
height: height
|
|
3706
|
+
}, /*#__PURE__*/external_react_default.a.createElement(SizeAwareWrapper_default.a, null, function (containerDimension) {
|
|
3707
|
+
return renderVisualization(containerDimension);
|
|
3708
|
+
}));
|
|
3727
3709
|
};
|
|
3728
3710
|
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3711
|
+
SingleValueRadial_SingleValueRadial.propTypes = {
|
|
3712
|
+
width: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
3713
|
+
height: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
3714
|
+
style: external_prop_types_default.a.object,
|
|
3715
|
+
majorValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
3716
|
+
majorValueField: external_prop_types_default.a.string,
|
|
3717
|
+
majorColor: external_prop_types_default.a.string,
|
|
3718
|
+
majorFontSize: external_prop_types_default.a.number,
|
|
3719
|
+
maxValue: external_prop_types_default.a.number,
|
|
3720
|
+
trendValue: external_prop_types_default.a.oneOfType([external_prop_types_default.a.string, external_prop_types_default.a.number]),
|
|
3721
|
+
trendColor: external_prop_types_default.a.string,
|
|
3722
|
+
trendFontSize: external_prop_types_default.a.number,
|
|
3723
|
+
trendDisplay: external_prop_types_default.a.string,
|
|
3724
|
+
trendIndicatorPosition: external_prop_types_default.a.oneOf(['standard', 'below', 'outside']),
|
|
3725
|
+
shouldAbbreviateTrendValue: external_prop_types_default.a.bool,
|
|
3726
|
+
backgroundColor: external_prop_types_default.a.string,
|
|
3727
|
+
unit: external_prop_types_default.a.string,
|
|
3728
|
+
unitPosition: external_prop_types_default.a.string,
|
|
3729
|
+
underLabel: external_prop_types_default.a.string,
|
|
3730
|
+
numberPrecision: external_prop_types_default.a.number,
|
|
3731
|
+
shouldUseThousandSeparators: external_prop_types_default.a.bool,
|
|
3732
|
+
radialBackgroundColor: external_prop_types_default.a.string,
|
|
3733
|
+
radialStrokeColor: external_prop_types_default.a.string,
|
|
3734
|
+
onValueClick: external_prop_types_default.a.func
|
|
3735
|
+
};
|
|
3736
|
+
SingleValueRadial_SingleValueRadial.defaultProps = {
|
|
3737
|
+
width: '100%',
|
|
3738
|
+
height: 250,
|
|
3739
|
+
majorValue: 'N/A',
|
|
3740
|
+
majorValueField: '',
|
|
3741
|
+
maxValue: 100,
|
|
3742
|
+
trendDisplay: 'absolute',
|
|
3743
|
+
trendIndicatorPosition: 'standard',
|
|
3744
|
+
shouldAbbreviateTrendValue: false,
|
|
3745
|
+
unitPosition: 'after',
|
|
3746
|
+
numberPrecision: 0,
|
|
3747
|
+
shouldUseThousandSeparators: true,
|
|
3748
|
+
onValueClick: function onValueClick() {}
|
|
3749
|
+
};
|
|
3750
|
+
/* harmony default export */ var PureSingleValueRadial_SingleValueRadial = __webpack_exports__["default"] = (Object(external_styled_components_["withTheme"])(SingleValueRadial_SingleValueRadial));
|
|
3737
3751
|
|
|
3738
3752
|
/***/ }),
|
|
3739
3753
|
|
|
3740
|
-
/***/
|
|
3754
|
+
/***/ 47:
|
|
3741
3755
|
/***/ (function(module, exports) {
|
|
3742
3756
|
|
|
3743
|
-
module.exports = require("@splunk/visualization-icons
|
|
3757
|
+
module.exports = require("@splunk/visualization-icons");
|
|
3744
3758
|
|
|
3745
3759
|
/***/ }),
|
|
3746
3760
|
|
|
3747
|
-
/***/
|
|
3761
|
+
/***/ 48:
|
|
3748
3762
|
/***/ (function(module, exports) {
|
|
3749
3763
|
|
|
3750
|
-
module.exports = require("@
|
|
3764
|
+
module.exports = require("@babel/runtime/helpers/extends");
|
|
3751
3765
|
|
|
3752
3766
|
/***/ }),
|
|
3753
3767
|
|
|
3754
|
-
/***/
|
|
3768
|
+
/***/ 49:
|
|
3755
3769
|
/***/ (function(module, exports) {
|
|
3756
3770
|
|
|
3757
|
-
module.exports = require("@
|
|
3771
|
+
module.exports = require("@splunk/visualizations-shared/domUtils");
|
|
3758
3772
|
|
|
3759
3773
|
/***/ }),
|
|
3760
3774
|
|
|
3761
|
-
/***/
|
|
3775
|
+
/***/ 54:
|
|
3762
3776
|
/***/ (function(module, exports) {
|
|
3763
3777
|
|
|
3764
|
-
module.exports = require("@splunk/
|
|
3778
|
+
module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
|
|
3765
3779
|
|
|
3766
3780
|
/***/ }),
|
|
3767
3781
|
|
|
3768
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
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,7 +3859,7 @@ __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__(
|
|
3862
|
+
var extends_ = __webpack_require__(48);
|
|
3856
3863
|
var extends_default = /*#__PURE__*/__webpack_require__.n(extends_);
|
|
3857
3864
|
|
|
3858
3865
|
// EXTERNAL MODULE: external "react"
|
|
@@ -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__(
|
|
3878
|
+
var singleValueUtils = __webpack_require__(22);
|
|
3872
3879
|
|
|
3873
3880
|
// EXTERNAL MODULE: external "@splunk/react-icons/ArrowUp"
|
|
3874
|
-
var ArrowUp_ = __webpack_require__(
|
|
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__(
|
|
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__(
|
|
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
|
|
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
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
4159
|
+
/***/ 72:
|
|
4160
4160
|
/***/ (function(module, exports) {
|
|
4161
4161
|
|
|
4162
4162
|
module.exports = require("lodash/isEmpty");
|
|
4163
4163
|
|
|
4164
4164
|
/***/ }),
|
|
4165
4165
|
|
|
4166
|
-
/***/
|
|
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
|
-
/***/
|
|
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
|
-
/***/
|
|
4180
|
+
/***/ 75:
|
|
4181
4181
|
/***/ (function(module, exports) {
|
|
4182
4182
|
|
|
4183
4183
|
module.exports = require("cssesc");
|
|
4184
4184
|
|
|
4185
4185
|
/***/ }),
|
|
4186
4186
|
|
|
4187
|
-
/***/
|
|
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__(
|
|
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("@
|
|
4214
|
+
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
4215
4215
|
|
|
4216
4216
|
/***/ }),
|
|
4217
4217
|
|
|
4218
|
-
/***/
|
|
4218
|
+
/***/ 87:
|
|
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__(
|
|
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
|
-
/***/
|
|
4269
|
+
/***/ 88:
|
|
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__(
|
|
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,7 @@ var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
|
|
|
4311
4311
|
|
|
4312
4312
|
/***/ }),
|
|
4313
4313
|
|
|
4314
|
-
/***/
|
|
4314
|
+
/***/ 89:
|
|
4315
4315
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
4316
4316
|
|
|
4317
4317
|
"use strict";
|
|
@@ -4319,7 +4319,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
4319
4319
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicBackgroundColorEditor", function() { return getDynamicBackgroundColorEditor; });
|
|
4320
4320
|
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(2);
|
|
4321
4321
|
/* 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__(
|
|
4322
|
+
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(18);
|
|
4323
4323
|
/* 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
4324
|
|
|
4325
4325
|
|
|
@@ -4366,14 +4366,21 @@ var getDynamicBackgroundColorEditor = function getDynamicBackgroundColorEditor(_
|
|
|
4366
4366
|
|
|
4367
4367
|
/***/ }),
|
|
4368
4368
|
|
|
4369
|
-
/***/
|
|
4369
|
+
/***/ 9:
|
|
4370
|
+
/***/ (function(module, exports) {
|
|
4371
|
+
|
|
4372
|
+
module.exports = require("@splunk/themes/variables");
|
|
4373
|
+
|
|
4374
|
+
/***/ }),
|
|
4375
|
+
|
|
4376
|
+
/***/ 90:
|
|
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__(
|
|
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
|
-
/***/
|
|
4400
|
+
/***/ 91:
|
|
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__(
|
|
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
|
/******/ });
|