@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/MarkerGauge.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 = 399);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -109,11 +109,18 @@ module.exports = require("react");
|
|
|
109
109
|
/***/ 10:
|
|
110
110
|
/***/ (function(module, exports) {
|
|
111
111
|
|
|
112
|
+
module.exports = require("@splunk/visualizations-shared/Message");
|
|
113
|
+
|
|
114
|
+
/***/ }),
|
|
115
|
+
|
|
116
|
+
/***/ 11:
|
|
117
|
+
/***/ (function(module, exports) {
|
|
118
|
+
|
|
112
119
|
module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
113
120
|
|
|
114
121
|
/***/ }),
|
|
115
122
|
|
|
116
|
-
/***/
|
|
123
|
+
/***/ 110:
|
|
117
124
|
/***/ (function(module, exports, __webpack_require__) {
|
|
118
125
|
|
|
119
126
|
"use strict";
|
|
@@ -178,14 +185,14 @@ exports.default = gauge;
|
|
|
178
185
|
|
|
179
186
|
/***/ }),
|
|
180
187
|
|
|
181
|
-
/***/
|
|
188
|
+
/***/ 111:
|
|
182
189
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
183
190
|
|
|
184
191
|
"use strict";
|
|
185
192
|
__webpack_require__.r(__webpack_exports__);
|
|
186
193
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MajorTick", function() { return MajorTick; });
|
|
187
194
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionMajorTick", function() { return positionMajorTick; });
|
|
188
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
195
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
|
189
196
|
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
190
197
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
191
198
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
@@ -193,7 +200,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
193
200
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
194
201
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
195
202
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
196
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
203
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
|
|
197
204
|
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
198
205
|
|
|
199
206
|
|
|
@@ -433,14 +440,14 @@ MajorTicks.defaultProps = {
|
|
|
433
440
|
|
|
434
441
|
/***/ }),
|
|
435
442
|
|
|
436
|
-
/***/
|
|
443
|
+
/***/ 112:
|
|
437
444
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
438
445
|
|
|
439
446
|
"use strict";
|
|
440
447
|
__webpack_require__.r(__webpack_exports__);
|
|
441
448
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionValueMarkerRect", function() { return positionValueMarkerRect; });
|
|
442
449
|
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionLabel", function() { return positionLabel; });
|
|
443
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(
|
|
450
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48);
|
|
444
451
|
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
445
452
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
446
453
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
@@ -448,7 +455,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
448
455
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
449
456
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
450
457
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
451
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
458
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(30);
|
|
452
459
|
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
453
460
|
|
|
454
461
|
|
|
@@ -635,14 +642,14 @@ ValueMarker.defaultProps = {
|
|
|
635
642
|
|
|
636
643
|
/***/ }),
|
|
637
644
|
|
|
638
|
-
/***/
|
|
645
|
+
/***/ 12:
|
|
639
646
|
/***/ (function(module, exports) {
|
|
640
647
|
|
|
641
648
|
module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
642
649
|
|
|
643
650
|
/***/ }),
|
|
644
651
|
|
|
645
|
-
/***/
|
|
652
|
+
/***/ 13:
|
|
646
653
|
/***/ (function(module, exports, __webpack_require__) {
|
|
647
654
|
|
|
648
655
|
"use strict";
|
|
@@ -656,11 +663,11 @@ var React = __webpack_require__(1);
|
|
|
656
663
|
|
|
657
664
|
var styled_components_1 = __webpack_require__(4);
|
|
658
665
|
|
|
659
|
-
var SizeAwareWrapper_1 = __webpack_require__(
|
|
666
|
+
var SizeAwareWrapper_1 = __webpack_require__(20);
|
|
660
667
|
|
|
661
|
-
var style_1 = __webpack_require__(
|
|
668
|
+
var style_1 = __webpack_require__(15);
|
|
662
669
|
|
|
663
|
-
var colorUtils_1 = __webpack_require__(
|
|
670
|
+
var colorUtils_1 = __webpack_require__(12);
|
|
664
671
|
|
|
665
672
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
666
673
|
var width = _ref.width;
|
|
@@ -717,7 +724,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
717
724
|
|
|
718
725
|
return React.createElement(FixSizeItem, {
|
|
719
726
|
"data-test": "fix-size-item",
|
|
720
|
-
"data-splunk-visualization-version": "25.
|
|
727
|
+
"data-splunk-visualization-version": "25.2.0 - 4373c5a66",
|
|
721
728
|
width: width,
|
|
722
729
|
height: height,
|
|
723
730
|
backgroundColor: backgroundColor
|
|
@@ -739,7 +746,7 @@ exports.default = withFixedSizeContainer;
|
|
|
739
746
|
|
|
740
747
|
/***/ }),
|
|
741
748
|
|
|
742
|
-
/***/
|
|
749
|
+
/***/ 14:
|
|
743
750
|
/***/ (function(module, exports, __webpack_require__) {
|
|
744
751
|
|
|
745
752
|
"use strict";
|
|
@@ -772,7 +779,7 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
|
772
779
|
|
|
773
780
|
/***/ }),
|
|
774
781
|
|
|
775
|
-
/***/
|
|
782
|
+
/***/ 144:
|
|
776
783
|
/***/ (function(module, exports, __webpack_require__) {
|
|
777
784
|
|
|
778
785
|
"use strict";
|
|
@@ -798,15 +805,15 @@ exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
|
|
|
798
805
|
|
|
799
806
|
var lodash_1 = __webpack_require__(3);
|
|
800
807
|
|
|
801
|
-
var MarkerGauge_1 = __webpack_require__(
|
|
808
|
+
var MarkerGauge_1 = __webpack_require__(400);
|
|
802
809
|
|
|
803
|
-
var config_1 = __webpack_require__(
|
|
810
|
+
var config_1 = __webpack_require__(402);
|
|
804
811
|
|
|
805
812
|
exports.config = config_1.default;
|
|
806
813
|
|
|
807
|
-
var withDashboardViz_1 = __webpack_require__(
|
|
814
|
+
var withDashboardViz_1 = __webpack_require__(32);
|
|
808
815
|
|
|
809
|
-
var gaugeUtils_1 = __webpack_require__(
|
|
816
|
+
var gaugeUtils_1 = __webpack_require__(84);
|
|
810
817
|
|
|
811
818
|
exports.PureMarkerGauge = MarkerGauge_1.default;
|
|
812
819
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
@@ -835,29 +842,29 @@ exports.default = viz;
|
|
|
835
842
|
|
|
836
843
|
/***/ }),
|
|
837
844
|
|
|
838
|
-
/***/
|
|
845
|
+
/***/ 15:
|
|
839
846
|
/***/ (function(module, exports) {
|
|
840
847
|
|
|
841
848
|
module.exports = require("@splunk/visualizations-shared/style");
|
|
842
849
|
|
|
843
850
|
/***/ }),
|
|
844
851
|
|
|
845
|
-
/***/
|
|
852
|
+
/***/ 16:
|
|
846
853
|
/***/ (function(module, exports) {
|
|
847
854
|
|
|
848
855
|
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
849
856
|
|
|
850
857
|
/***/ }),
|
|
851
858
|
|
|
852
|
-
/***/
|
|
859
|
+
/***/ 17:
|
|
853
860
|
/***/ (function(module, exports, __webpack_require__) {
|
|
854
861
|
|
|
855
862
|
"use strict";
|
|
856
863
|
|
|
857
864
|
|
|
858
|
-
var _toConsumableArray = __webpack_require__(
|
|
865
|
+
var _toConsumableArray = __webpack_require__(8);
|
|
859
866
|
|
|
860
|
-
var _defineProperty = __webpack_require__(
|
|
867
|
+
var _defineProperty = __webpack_require__(7);
|
|
861
868
|
|
|
862
869
|
var __rest = this && this.__rest || function (s, e) {
|
|
863
870
|
var t = {};
|
|
@@ -879,9 +886,9 @@ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig
|
|
|
879
886
|
|
|
880
887
|
var lodash_1 = __webpack_require__(3);
|
|
881
888
|
|
|
882
|
-
var schemaUtils_1 = __webpack_require__(
|
|
889
|
+
var schemaUtils_1 = __webpack_require__(16);
|
|
883
890
|
|
|
884
|
-
var VizBehavior_1 = __webpack_require__(
|
|
891
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
885
892
|
|
|
886
893
|
var dynamicOptionsDSLType = {
|
|
887
894
|
type: 'string',
|
|
@@ -1086,24 +1093,24 @@ exports.insertLayout = insertLayout;
|
|
|
1086
1093
|
|
|
1087
1094
|
/***/ }),
|
|
1088
1095
|
|
|
1089
|
-
/***/
|
|
1096
|
+
/***/ 19:
|
|
1090
1097
|
/***/ (function(module, exports) {
|
|
1091
1098
|
|
|
1092
1099
|
module.exports = require("@babel/runtime/helpers/createClass");
|
|
1093
1100
|
|
|
1094
1101
|
/***/ }),
|
|
1095
1102
|
|
|
1096
|
-
/***/
|
|
1103
|
+
/***/ 2:
|
|
1097
1104
|
/***/ (function(module, exports) {
|
|
1098
1105
|
|
|
1099
|
-
module.exports = require("@splunk/
|
|
1106
|
+
module.exports = require("@splunk/ui-utils/i18n");
|
|
1100
1107
|
|
|
1101
1108
|
/***/ }),
|
|
1102
1109
|
|
|
1103
|
-
/***/
|
|
1110
|
+
/***/ 20:
|
|
1104
1111
|
/***/ (function(module, exports) {
|
|
1105
1112
|
|
|
1106
|
-
module.exports = require("@splunk/
|
|
1113
|
+
module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
1107
1114
|
|
|
1108
1115
|
/***/ }),
|
|
1109
1116
|
|
|
@@ -1114,428 +1121,191 @@ module.exports = require("@splunk/themes/pick");
|
|
|
1114
1121
|
|
|
1115
1122
|
/***/ }),
|
|
1116
1123
|
|
|
1117
|
-
/***/
|
|
1118
|
-
/***/ (function(module, exports
|
|
1119
|
-
|
|
1120
|
-
"use strict";
|
|
1124
|
+
/***/ 23:
|
|
1125
|
+
/***/ (function(module, exports) {
|
|
1121
1126
|
|
|
1127
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
1122
1128
|
|
|
1123
|
-
|
|
1124
|
-
if (k2 === undefined) k2 = k;
|
|
1125
|
-
Object.defineProperty(o, k2, {
|
|
1126
|
-
enumerable: true,
|
|
1127
|
-
get: function get() {
|
|
1128
|
-
return m[k];
|
|
1129
|
-
}
|
|
1130
|
-
});
|
|
1131
|
-
} : function (o, m, k, k2) {
|
|
1132
|
-
if (k2 === undefined) k2 = k;
|
|
1133
|
-
o[k2] = m[k];
|
|
1134
|
-
});
|
|
1129
|
+
/***/ }),
|
|
1135
1130
|
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1139
|
-
}
|
|
1140
|
-
};
|
|
1131
|
+
/***/ 25:
|
|
1132
|
+
/***/ (function(module, exports) {
|
|
1141
1133
|
|
|
1142
|
-
|
|
1143
|
-
value: true
|
|
1144
|
-
});
|
|
1145
|
-
exports.default = void 0;
|
|
1134
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
1146
1135
|
|
|
1147
|
-
|
|
1136
|
+
/***/ }),
|
|
1148
1137
|
|
|
1149
|
-
|
|
1138
|
+
/***/ 26:
|
|
1139
|
+
/***/ (function(module, exports) {
|
|
1150
1140
|
|
|
1151
|
-
|
|
1152
|
-
enumerable: true,
|
|
1153
|
-
get: function get() {
|
|
1154
|
-
return MarkerGauge_1.default;
|
|
1155
|
-
}
|
|
1156
|
-
});
|
|
1141
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
1157
1142
|
|
|
1158
1143
|
/***/ }),
|
|
1159
1144
|
|
|
1160
|
-
/***/
|
|
1145
|
+
/***/ 27:
|
|
1161
1146
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1162
1147
|
|
|
1163
1148
|
"use strict";
|
|
1164
1149
|
|
|
1165
1150
|
|
|
1166
|
-
var __rest = this && this.__rest || function (s, e) {
|
|
1167
|
-
var t = {};
|
|
1168
|
-
|
|
1169
|
-
for (var p in s) {
|
|
1170
|
-
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1173
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1174
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1175
|
-
}
|
|
1176
|
-
return t;
|
|
1177
|
-
};
|
|
1178
|
-
|
|
1179
1151
|
Object.defineProperty(exports, "__esModule", {
|
|
1180
1152
|
value: true
|
|
1181
1153
|
});
|
|
1154
|
+
exports.shouldShowIconPlaceholder = void 0;
|
|
1182
1155
|
|
|
1183
1156
|
var React = __webpack_require__(1);
|
|
1184
1157
|
|
|
1185
|
-
var react_1 = __webpack_require__(1);
|
|
1186
|
-
|
|
1187
1158
|
var T = __webpack_require__(0);
|
|
1188
1159
|
|
|
1189
|
-
var styled_components_1 = __webpack_require__(4);
|
|
1190
|
-
|
|
1191
1160
|
var lodash_1 = __webpack_require__(3);
|
|
1192
1161
|
|
|
1193
1162
|
var i18n_1 = __webpack_require__(2);
|
|
1194
1163
|
|
|
1195
|
-
var
|
|
1196
|
-
|
|
1197
|
-
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
1198
|
-
|
|
1199
|
-
var Message_1 = __webpack_require__(9);
|
|
1200
|
-
|
|
1201
|
-
var id_1 = __webpack_require__(218);
|
|
1164
|
+
var Message_1 = __webpack_require__(10);
|
|
1202
1165
|
|
|
1203
|
-
var
|
|
1204
|
-
|
|
1205
|
-
|
|
1166
|
+
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1167
|
+
/**
|
|
1168
|
+
* @method shouldShowIconPlaceholder
|
|
1169
|
+
* @param {object} dataSources
|
|
1170
|
+
* @param {boolean} loading
|
|
1171
|
+
* @returns {boolean}
|
|
1172
|
+
*/
|
|
1206
1173
|
|
|
1207
|
-
var GaugeValueMarker_1 = __webpack_require__(104);
|
|
1208
1174
|
|
|
1209
|
-
var
|
|
1210
|
-
var
|
|
1211
|
-
var
|
|
1212
|
-
var
|
|
1213
|
-
var
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
}
|
|
1217
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1218
|
-
}, function (props) {
|
|
1219
|
-
return props.backgroundColor;
|
|
1220
|
-
});
|
|
1221
|
-
var MarkerGaugeWrapper = styled_components_1.default.div.withConfig({
|
|
1222
|
-
displayName: "MarkerGauge__MarkerGaugeWrapper",
|
|
1223
|
-
componentId: "sc-10z02va-1"
|
|
1224
|
-
})(["display:flex;justify-content:center;flex-direction:row;width:100%;height:100%;background-color:", ";"], function (props) {
|
|
1225
|
-
return props.backgroundColor;
|
|
1226
|
-
});
|
|
1227
|
-
var MarkerGaugeContainer = styled_components_1.default.div.withConfig({
|
|
1228
|
-
displayName: "MarkerGauge__MarkerGaugeContainer",
|
|
1229
|
-
componentId: "sc-10z02va-2"
|
|
1230
|
-
})(["overflow:hidden;position:relative;", ";"], function (props) {
|
|
1231
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1232
|
-
});
|
|
1233
|
-
var MarkerGaugeSVG = styled_components_1.default.svg.withConfig({
|
|
1234
|
-
displayName: "MarkerGauge__MarkerGaugeSVG",
|
|
1235
|
-
componentId: "sc-10z02va-3"
|
|
1236
|
-
})(["", ";"], function (props) {
|
|
1237
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1238
|
-
});
|
|
1239
|
-
var BackgroundBar = styled_components_1.default.rect.attrs({
|
|
1240
|
-
'data-test': 'background-bar-rect'
|
|
1241
|
-
}).withConfig({
|
|
1242
|
-
displayName: "MarkerGauge__BackgroundBar",
|
|
1243
|
-
componentId: "sc-10z02va-4"
|
|
1244
|
-
})(["fill:", ";"], function (props) {
|
|
1245
|
-
return props.fillColor;
|
|
1246
|
-
});
|
|
1247
|
-
var MarkerBar = styled_components_1.default.rect.attrs({
|
|
1248
|
-
'data-test': 'marker-bar-rect'
|
|
1249
|
-
}).withConfig({
|
|
1250
|
-
displayName: "MarkerGauge__MarkerBar",
|
|
1251
|
-
componentId: "sc-10z02va-5"
|
|
1252
|
-
})([""]);
|
|
1175
|
+
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1176
|
+
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1177
|
+
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1178
|
+
var noData = data === undefined;
|
|
1179
|
+
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1180
|
+
var noFields = fields === undefined;
|
|
1181
|
+
return loading || noData || noFields;
|
|
1182
|
+
};
|
|
1253
1183
|
|
|
1254
|
-
|
|
1255
|
-
|
|
1184
|
+
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1185
|
+
var propTypes = {
|
|
1186
|
+
icon: T.func,
|
|
1187
|
+
width: T.oneOfType([T.string, T.number]),
|
|
1188
|
+
height: T.oneOfType([T.string, T.number]),
|
|
1189
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
1190
|
+
backgroundColor: T.string,
|
|
1191
|
+
iconColor: T.string
|
|
1192
|
+
};
|
|
1193
|
+
/**
|
|
1194
|
+
* @method IconPlaceholder
|
|
1195
|
+
* @param {IconPlaceholderProps} props
|
|
1196
|
+
* @returns {React.ReactElement}
|
|
1197
|
+
*/
|
|
1256
1198
|
|
|
1199
|
+
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1257
1200
|
var width = props.width,
|
|
1258
1201
|
height = props.height,
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
majorUnit = props.majorUnit,
|
|
1262
|
-
showLabels = props.showLabels,
|
|
1263
|
-
showValue = props.showValue,
|
|
1264
|
-
usePercentageRange = props.usePercentageRange,
|
|
1265
|
-
usePercentageValue = props.usePercentageValue,
|
|
1266
|
-
backgroundColor = props.backgroundColor,
|
|
1267
|
-
fillColor = props.fillColor,
|
|
1268
|
-
ranges = props.ranges,
|
|
1269
|
-
majorTickFillColor = props.majorTickFillColor,
|
|
1270
|
-
majorTickStrokeColor = props.majorTickStrokeColor,
|
|
1271
|
-
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
1272
|
-
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
1273
|
-
/**
|
|
1274
|
-
* Standard error message render
|
|
1275
|
-
*/
|
|
1202
|
+
icon = props.icon,
|
|
1203
|
+
iconColor = props.iconColor;
|
|
1276
1204
|
|
|
1277
|
-
|
|
1278
|
-
return React.createElement(
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1205
|
+
if (icon) {
|
|
1206
|
+
return React.createElement(icon, {
|
|
1207
|
+
style: {
|
|
1208
|
+
left: '50%',
|
|
1209
|
+
top: '50%',
|
|
1210
|
+
color: iconColor,
|
|
1211
|
+
opacity: 0.15,
|
|
1212
|
+
position: 'absolute',
|
|
1213
|
+
transform: 'translate(-50%, -50%)'
|
|
1214
|
+
},
|
|
1215
|
+
width: '50%',
|
|
1216
|
+
height: '50%'
|
|
1284
1217
|
});
|
|
1285
|
-
}
|
|
1286
|
-
var errorId = react_1.useMemo(function () {
|
|
1287
|
-
return id_1.createDOMID();
|
|
1288
|
-
}, []);
|
|
1289
|
-
/**
|
|
1290
|
-
* Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
|
|
1291
|
-
*/
|
|
1218
|
+
}
|
|
1292
1219
|
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
}
|
|
1220
|
+
return React.createElement(Message_1.default, {
|
|
1221
|
+
width: width,
|
|
1222
|
+
height: height,
|
|
1223
|
+
level: "warning",
|
|
1224
|
+
message: i18n_1._('No DataSource Connected')
|
|
1225
|
+
});
|
|
1226
|
+
};
|
|
1299
1227
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1228
|
+
IconPlaceholder.propTypes = propTypes;
|
|
1229
|
+
IconPlaceholder.defaultProps = {
|
|
1230
|
+
width: '100%',
|
|
1231
|
+
height: 250
|
|
1232
|
+
};
|
|
1233
|
+
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1305
1234
|
|
|
1306
|
-
|
|
1307
|
-
return id_1.createDOMID('marker');
|
|
1308
|
-
}, []);
|
|
1309
|
-
var linearGradient = react_1.useMemo(function () {
|
|
1310
|
-
var stops = gaugeUtils_1.getGradientStops({
|
|
1311
|
-
ranges: sortedRanges,
|
|
1312
|
-
orientation: orientation
|
|
1313
|
-
});
|
|
1235
|
+
/***/ }),
|
|
1314
1236
|
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
y1 = _gaugeUtils_1$getGrad.y1,
|
|
1318
|
-
x2 = _gaugeUtils_1$getGrad.x2,
|
|
1319
|
-
y2 = _gaugeUtils_1$getGrad.y2;
|
|
1237
|
+
/***/ 28:
|
|
1238
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1320
1239
|
|
|
1321
|
-
|
|
1322
|
-
return React.createElement("stop", {
|
|
1323
|
-
key: "".concat(stop.offset, "_").concat(stop.stopColor),
|
|
1324
|
-
offset: stop.offset,
|
|
1325
|
-
stopColor: stop.stopColor
|
|
1326
|
-
});
|
|
1327
|
-
});
|
|
1328
|
-
return React.createElement("linearGradient", {
|
|
1329
|
-
id: linearGradientId,
|
|
1330
|
-
x1: x1,
|
|
1331
|
-
y1: y1,
|
|
1332
|
-
x2: x2,
|
|
1333
|
-
y2: y2
|
|
1334
|
-
}, linearGradientStops);
|
|
1335
|
-
}, [sortedRanges, orientation, linearGradientId]);
|
|
1336
|
-
/**
|
|
1337
|
-
* Calculate marker gauge dimensions
|
|
1338
|
-
*/
|
|
1240
|
+
"use strict";
|
|
1339
1241
|
|
|
1340
|
-
var calculateMarkerGaugeDimensions = react_1.useCallback(function (containerWidth, containerHeight) {
|
|
1341
|
-
var _gaugeUtils_1$getGaug = gaugeUtils_1.getGaugeDimensions({
|
|
1342
|
-
containerWidth: containerWidth,
|
|
1343
|
-
containerHeight: containerHeight,
|
|
1344
|
-
orientation: orientation
|
|
1345
|
-
}),
|
|
1346
|
-
gaugeLength = _gaugeUtils_1$getGaug.gaugeLength,
|
|
1347
|
-
gaugeStartX = _gaugeUtils_1$getGaug.gaugeStartX,
|
|
1348
|
-
gaugeStartY = _gaugeUtils_1$getGaug.gaugeStartY,
|
|
1349
|
-
gaugeWidth = _gaugeUtils_1$getGaug.gaugeWidth,
|
|
1350
|
-
gaugeHeight = _gaugeUtils_1$getGaug.gaugeHeight;
|
|
1351
1242
|
|
|
1352
|
-
|
|
1353
|
-
gaugeLength: gaugeLength,
|
|
1354
|
-
gaugeStartX: gaugeStartX,
|
|
1355
|
-
gaugeStartY: gaugeStartY,
|
|
1356
|
-
gaugeWidth: gaugeWidth,
|
|
1357
|
-
gaugeHeight: gaugeHeight,
|
|
1358
|
-
orientation: orientation
|
|
1359
|
-
}),
|
|
1360
|
-
markerBarLength = _gaugeUtils_1$getMark.markerBarLength,
|
|
1361
|
-
markerBarX = _gaugeUtils_1$getMark.markerBarX,
|
|
1362
|
-
markerBarY = _gaugeUtils_1$getMark.markerBarY,
|
|
1363
|
-
markerBarWidth = _gaugeUtils_1$getMark.markerBarWidth,
|
|
1364
|
-
markerBarHeight = _gaugeUtils_1$getMark.markerBarHeight;
|
|
1243
|
+
var _defineProperty = __webpack_require__(7);
|
|
1365
1244
|
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
markerBarLength: markerBarLength,
|
|
1371
|
-
orientation: orientation,
|
|
1372
|
-
value: value,
|
|
1373
|
-
min: min,
|
|
1374
|
-
max: max
|
|
1375
|
-
}),
|
|
1376
|
-
valueMarkerX = _gaugeUtils_1$getMark2.valueMarkerX,
|
|
1377
|
-
valueMarkerY = _gaugeUtils_1$getMark2.valueMarkerY;
|
|
1245
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1246
|
+
value: true
|
|
1247
|
+
});
|
|
1248
|
+
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1378
1249
|
|
|
1379
|
-
|
|
1380
|
-
markerBarX: markerBarX,
|
|
1381
|
-
markerBarY: markerBarY,
|
|
1382
|
-
markerBarWidth: markerBarWidth,
|
|
1383
|
-
markerBarHeight: markerBarHeight,
|
|
1384
|
-
valueMarkerX: valueMarkerX,
|
|
1385
|
-
valueMarkerY: valueMarkerY,
|
|
1386
|
-
gaugeStartX: gaugeStartX,
|
|
1387
|
-
gaugeStartY: gaugeStartY,
|
|
1388
|
-
gaugeWidth: gaugeWidth,
|
|
1389
|
-
gaugeHeight: gaugeHeight
|
|
1390
|
-
};
|
|
1391
|
-
}, [orientation, value, min, max]);
|
|
1392
|
-
var renderVisualization = react_1.useCallback(function (_ref) {
|
|
1393
|
-
var containerWidth = _ref.width,
|
|
1394
|
-
containerHeight = _ref.height;
|
|
1250
|
+
var T = __webpack_require__(0);
|
|
1395
1251
|
|
|
1396
|
-
|
|
1397
|
-
// 58 is the title & description header height in dashboard visualization
|
|
1398
|
-
if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
|
|
1399
|
-
return errorMessage(containerWidth, containerHeight, i18n_1._('Too small to render content'), errorId);
|
|
1400
|
-
}
|
|
1252
|
+
var lodash_1 = __webpack_require__(3);
|
|
1401
1253
|
|
|
1402
|
-
|
|
1403
|
-
return errorMessage(containerWidth, containerHeight, error, errorId);
|
|
1404
|
-
}
|
|
1254
|
+
var DataSource_1 = __webpack_require__(39);
|
|
1405
1255
|
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
valueMarkerX = _calculateMarkerGauge.valueMarkerX,
|
|
1412
|
-
valueMarkerY = _calculateMarkerGauge.valueMarkerY,
|
|
1413
|
-
gaugeStartX = _calculateMarkerGauge.gaugeStartX,
|
|
1414
|
-
gaugeStartY = _calculateMarkerGauge.gaugeStartY,
|
|
1415
|
-
gaugeWidth = _calculateMarkerGauge.gaugeWidth,
|
|
1416
|
-
gaugeHeight = _calculateMarkerGauge.gaugeHeight;
|
|
1256
|
+
exports.SortParamsPropTypes = T.shape({
|
|
1257
|
+
currentSortKey: T.string,
|
|
1258
|
+
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
1259
|
+
onSort: T.func
|
|
1260
|
+
});
|
|
1417
1261
|
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
width: gaugeWidth,
|
|
1430
|
-
height: gaugeHeight,
|
|
1431
|
-
fillColor: fillColor
|
|
1432
|
-
}), React.createElement(GaugeMajorTicks_1.default, {
|
|
1433
|
-
width: gaugeWidth,
|
|
1434
|
-
height: gaugeHeight,
|
|
1435
|
-
startX: gaugeStartX,
|
|
1436
|
-
startY: gaugeStartY,
|
|
1437
|
-
min: min,
|
|
1438
|
-
max: max,
|
|
1439
|
-
majorUnit: majorUnit,
|
|
1440
|
-
orientation: orientation,
|
|
1441
|
-
showLabels: showLabels,
|
|
1442
|
-
usePercentageRange: usePercentageRange,
|
|
1443
|
-
majorTickFillColor: majorTickFillColor,
|
|
1444
|
-
majorTickStrokeColor: majorTickStrokeColor
|
|
1445
|
-
}), React.createElement(MarkerBar, {
|
|
1446
|
-
x: markerBarX,
|
|
1447
|
-
y: markerBarY,
|
|
1448
|
-
width: markerBarWidth,
|
|
1449
|
-
height: markerBarHeight,
|
|
1450
|
-
fill: "url(#".concat(linearGradientId, ")")
|
|
1451
|
-
}), React.createElement(GaugeValueMarker_1.default, {
|
|
1452
|
-
x: valueMarkerX,
|
|
1453
|
-
y: valueMarkerY,
|
|
1454
|
-
length: gaugeUtils_1.GAUGE_THICKNESS,
|
|
1455
|
-
min: min,
|
|
1456
|
-
max: max,
|
|
1457
|
-
value: value,
|
|
1458
|
-
orientation: orientation,
|
|
1459
|
-
showValue: showValue,
|
|
1460
|
-
usePercentageValue: usePercentageValue,
|
|
1461
|
-
valueMarkerFillColor: valueMarkerFillColor,
|
|
1462
|
-
valueMarkerLabelFillColor: valueMarkerLabelFillColor
|
|
1463
|
-
}))));
|
|
1464
|
-
}, [orientation, error, calculateMarkerGaugeDimensions, backgroundColor, linearGradient, fillColor, min, max, majorUnit, showLabels, usePercentageRange, majorTickFillColor, majorTickStrokeColor, linearGradientId, value, showValue, usePercentageValue, valueMarkerFillColor, valueMarkerLabelFillColor, errorMessage, errorId]);
|
|
1465
|
-
return React.createElement(Container, {
|
|
1466
|
-
width: width,
|
|
1467
|
-
height: height,
|
|
1468
|
-
backgroundColor: backgroundColor
|
|
1469
|
-
}, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
|
|
1470
|
-
return renderVisualization(containerDimension);
|
|
1471
|
-
}));
|
|
1472
|
-
};
|
|
1262
|
+
var getSortingParams = function getSortingParams(_ref) {
|
|
1263
|
+
var requestParams = _ref.requestParams,
|
|
1264
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1265
|
+
var currentSortKey;
|
|
1266
|
+
var currentSortDir;
|
|
1267
|
+
var nextSortDirMap = {
|
|
1268
|
+
asc: 'desc',
|
|
1269
|
+
desc: 'asc',
|
|
1270
|
+
none: 'asc'
|
|
1271
|
+
};
|
|
1272
|
+
var onSort;
|
|
1473
1273
|
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
orientation: T.oneOf(['horizontal', 'vertical']),
|
|
1480
|
-
majorUnit: T.oneOfType([T.string, T.number]),
|
|
1481
|
-
showLabels: T.bool,
|
|
1482
|
-
showValue: T.bool,
|
|
1483
|
-
usePercentageRange: T.bool,
|
|
1484
|
-
usePercentageValue: T.bool,
|
|
1485
|
-
backgroundColor: T.string,
|
|
1486
|
-
fillColor: T.string,
|
|
1487
|
-
ranges: T.arrayOf(T.shape({
|
|
1488
|
-
from: T.number.isRequired,
|
|
1489
|
-
to: T.number.isRequired,
|
|
1490
|
-
value: T.string.isRequired
|
|
1491
|
-
})),
|
|
1492
|
-
majorTickFillColor: T.string,
|
|
1493
|
-
majorTickStrokeColor: T.string,
|
|
1494
|
-
valueMarkerFillColor: T.string,
|
|
1495
|
-
valueMarkerLabelFillColor: T.string
|
|
1496
|
-
};
|
|
1497
|
-
MarkerGauge.defaultProps = {
|
|
1498
|
-
width: '100%',
|
|
1499
|
-
height: 250,
|
|
1500
|
-
orientation: 'vertical',
|
|
1501
|
-
majorUnit: 'auto',
|
|
1502
|
-
showLabels: true,
|
|
1503
|
-
showValue: true,
|
|
1504
|
-
usePercentageRange: false,
|
|
1505
|
-
usePercentageValue: false,
|
|
1506
|
-
backgroundColor: 'transparent',
|
|
1507
|
-
value: 0,
|
|
1508
|
-
fillColor: '#f2f4f5',
|
|
1509
|
-
majorTickFillColor: '#3c444d',
|
|
1510
|
-
majorTickStrokeColor: '#6b7785',
|
|
1511
|
-
valueMarkerFillColor: '#3c444d',
|
|
1512
|
-
valueMarkerLabelFillColor: '#f2f4f5',
|
|
1513
|
-
ranges: [{
|
|
1514
|
-
from: 0,
|
|
1515
|
-
to: 50,
|
|
1516
|
-
value: '#4BEBA8'
|
|
1517
|
-
}, {
|
|
1518
|
-
from: 50,
|
|
1519
|
-
to: 90,
|
|
1520
|
-
value: '#F4DF7A'
|
|
1521
|
-
}, {
|
|
1522
|
-
from: 90,
|
|
1523
|
-
to: 100,
|
|
1524
|
-
value: '#CB3B43'
|
|
1525
|
-
}]
|
|
1526
|
-
};
|
|
1527
|
-
exports.default = MarkerGauge;
|
|
1274
|
+
if (lodash_1.isFunction(onRequestParamsChange)) {
|
|
1275
|
+
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
1276
|
+
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
1277
|
+
currentSortDir = requestParams.sort[currentSortKey];
|
|
1278
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1528
1279
|
|
|
1529
|
-
/***/ }),
|
|
1530
1280
|
|
|
1531
|
-
|
|
1532
|
-
|
|
1281
|
+
onSort = function onSort(e, _ref2) {
|
|
1282
|
+
var sortKey = _ref2.sortKey,
|
|
1283
|
+
sortDir = _ref2.sortDir;
|
|
1533
1284
|
|
|
1534
|
-
|
|
1285
|
+
if (typeof sortKey === 'string') {
|
|
1286
|
+
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1287
|
+
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
1288
|
+
offset: 0,
|
|
1289
|
+
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
1290
|
+
}));
|
|
1291
|
+
} else {
|
|
1292
|
+
onRequestParamsChange(requestParams);
|
|
1293
|
+
}
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
|
|
1297
|
+
return {
|
|
1298
|
+
currentSortKey: currentSortKey,
|
|
1299
|
+
currentSortDir: currentSortDir,
|
|
1300
|
+
onSort: onSort
|
|
1301
|
+
};
|
|
1302
|
+
};
|
|
1303
|
+
|
|
1304
|
+
exports.getSortingParams = getSortingParams;
|
|
1535
1305
|
|
|
1536
1306
|
/***/ }),
|
|
1537
1307
|
|
|
1538
|
-
/***/
|
|
1308
|
+
/***/ 29:
|
|
1539
1309
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1540
1310
|
|
|
1541
1311
|
"use strict";
|
|
@@ -1544,519 +1314,77 @@ module.exports = require("@splunk/ui-utils/id");
|
|
|
1544
1314
|
Object.defineProperty(exports, "__esModule", {
|
|
1545
1315
|
value: true
|
|
1546
1316
|
});
|
|
1317
|
+
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1547
1318
|
|
|
1548
|
-
var
|
|
1549
|
-
|
|
1550
|
-
var GaugeMarker_1 = __webpack_require__(220);
|
|
1551
|
-
|
|
1552
|
-
var placeholders_1 = __webpack_require__(45);
|
|
1553
|
-
|
|
1554
|
-
var schemaUtils_1 = __webpack_require__(15);
|
|
1555
|
-
|
|
1556
|
-
var variables_1 = __webpack_require__(8);
|
|
1319
|
+
var T = __webpack_require__(0);
|
|
1557
1320
|
|
|
1558
|
-
var
|
|
1321
|
+
var lodash_1 = __webpack_require__(3);
|
|
1559
1322
|
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1323
|
+
exports.PaginatorParamsPropTypes = T.shape({
|
|
1324
|
+
isPaging: T.bool,
|
|
1325
|
+
current: T.number,
|
|
1326
|
+
totalPages: T.number,
|
|
1327
|
+
onChange: T.func
|
|
1328
|
+
});
|
|
1565
1329
|
|
|
1566
|
-
var
|
|
1330
|
+
var getPaginationParams = function getPaginationParams(_ref) {
|
|
1331
|
+
var requestParams = _ref.requestParams,
|
|
1332
|
+
meta = _ref.meta,
|
|
1333
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1334
|
+
var totalCount = meta && meta.totalCount || 0;
|
|
1335
|
+
var offset = requestParams && requestParams.offset || 0;
|
|
1336
|
+
var count = requestParams && requestParams.count;
|
|
1337
|
+
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
1338
|
+
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
1339
|
+
var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
|
|
1567
1340
|
|
|
1568
|
-
var
|
|
1341
|
+
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1342
|
+
var page = _ref2.page,
|
|
1343
|
+
countArg = _ref2.count;
|
|
1344
|
+
var newParams = lodash_1.cloneDeep(requestParams);
|
|
1569
1345
|
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
description: 'DataSource that powers the visualization'
|
|
1574
|
-
}],
|
|
1575
|
-
optionalDataSources: [],
|
|
1576
|
-
initialRequestParams: {
|
|
1577
|
-
primary: {
|
|
1578
|
-
offset: 0,
|
|
1579
|
-
count: 10000
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
};
|
|
1583
|
-
var size = {
|
|
1584
|
-
initialWidth: 300,
|
|
1585
|
-
initialHeight: 300
|
|
1586
|
-
};
|
|
1587
|
-
var defaultContext = {};
|
|
1588
|
-
var optionsSchema = {
|
|
1589
|
-
backgroundColor: {
|
|
1590
|
-
description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
|
|
1591
|
-
type: 'string',
|
|
1592
|
-
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
1593
|
-
default: '> themes.defaultBackgroundColor'
|
|
1594
|
-
},
|
|
1595
|
-
gaugeRanges: {
|
|
1596
|
-
description: 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{"from": 0, "to": 20, "value": "#4BEBA8"}, {"from": 20, "to": 50, "value": "#F4DF7A"}].',
|
|
1597
|
-
default: [{
|
|
1598
|
-
from: 0,
|
|
1599
|
-
to: 50,
|
|
1600
|
-
value: '#118832'
|
|
1601
|
-
}, {
|
|
1602
|
-
from: 50,
|
|
1603
|
-
to: 90,
|
|
1604
|
-
value: '#CBA700'
|
|
1605
|
-
}, {
|
|
1606
|
-
from: 90,
|
|
1607
|
-
to: 100,
|
|
1608
|
-
value: '#D41F1F'
|
|
1609
|
-
}],
|
|
1610
|
-
type: 'array',
|
|
1611
|
-
items: {
|
|
1612
|
-
type: 'object',
|
|
1613
|
-
properties: {
|
|
1614
|
-
from: {
|
|
1615
|
-
type: 'number',
|
|
1616
|
-
description: 'Starting value for range.'
|
|
1617
|
-
},
|
|
1618
|
-
to: {
|
|
1619
|
-
type: 'number',
|
|
1620
|
-
description: 'Ending value for range.'
|
|
1621
|
-
},
|
|
1622
|
-
value: {
|
|
1623
|
-
description: 'Color for sub range.',
|
|
1624
|
-
type: 'string',
|
|
1625
|
-
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
|
|
1626
|
-
}
|
|
1627
|
-
},
|
|
1628
|
-
required: ['from', 'to', 'value'],
|
|
1629
|
-
additionalProperties: false
|
|
1346
|
+
if (typeof countArg === 'number') {
|
|
1347
|
+
newParams.count = countArg;
|
|
1348
|
+
newParams.offset = 0;
|
|
1630
1349
|
}
|
|
1631
|
-
},
|
|
1632
|
-
labelDisplay: {
|
|
1633
|
-
description: 'Specify whether to display the labels as numbers, percentages, or off.',
|
|
1634
|
-
default: 'number',
|
|
1635
|
-
type: 'string',
|
|
1636
|
-
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
1637
|
-
},
|
|
1638
|
-
majorTickInterval: {
|
|
1639
|
-
description: 'Specify, in pixels, the spacing between major tick marks.',
|
|
1640
|
-
default: 'auto',
|
|
1641
|
-
type: ['string', 'number']
|
|
1642
|
-
},
|
|
1643
|
-
orientation: {
|
|
1644
|
-
description: 'Specify the axis orientation of the gauge.',
|
|
1645
|
-
default: 'vertical',
|
|
1646
|
-
type: 'string',
|
|
1647
|
-
pattern: schemaUtils_1.getPattern(['horizontal', 'vertical'])
|
|
1648
|
-
},
|
|
1649
|
-
value: {
|
|
1650
|
-
description: 'Specify the dataSource applied to the value of the marker gauge.',
|
|
1651
|
-
type: 'string',
|
|
1652
|
-
default: '> primary | seriesByType("number") | lastPoint()'
|
|
1653
|
-
},
|
|
1654
|
-
valueDisplay: {
|
|
1655
|
-
description: 'Specify whether to display the value as a number, percentage, or off.',
|
|
1656
|
-
default: 'number',
|
|
1657
|
-
type: 'string',
|
|
1658
|
-
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
1659
|
-
}
|
|
1660
|
-
};
|
|
1661
|
-
var themes = {
|
|
1662
|
-
defaultFillColor: function defaultFillColor(props) {
|
|
1663
|
-
return pick_1.default({
|
|
1664
|
-
enterprise: variables_1.default.backgroundColorHover(props),
|
|
1665
|
-
prisma: variables_1.default.neutral100(props)
|
|
1666
|
-
})(props);
|
|
1667
|
-
},
|
|
1668
|
-
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
1669
|
-
return pick_1.default({
|
|
1670
|
-
enterprise: {
|
|
1671
|
-
dark: variables_1.default.black(props),
|
|
1672
|
-
light: variables_1.default.backgroundColor(props)
|
|
1673
|
-
},
|
|
1674
|
-
prisma: variables_1.default.backgroundColorSidebar(props)
|
|
1675
|
-
})(props);
|
|
1676
|
-
},
|
|
1677
|
-
majorTickFillColor: function majorTickFillColor(props) {
|
|
1678
|
-
return pick_1.default({
|
|
1679
|
-
enterprise: {
|
|
1680
|
-
light: variables_1.default.gray30(props),
|
|
1681
|
-
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
1682
1350
|
|
|
1683
|
-
|
|
1684
|
-
prisma: {
|
|
1685
|
-
// TODO: missed colors :(
|
|
1686
|
-
light: variables_1.default.neutral100(props),
|
|
1687
|
-
dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
|
|
1688
|
-
|
|
1689
|
-
}
|
|
1690
|
-
})(props);
|
|
1691
|
-
},
|
|
1692
|
-
majorTickStrokeColor: function majorTickStrokeColor(props) {
|
|
1693
|
-
return pick_1.default({
|
|
1694
|
-
enterprise: {
|
|
1695
|
-
light: variables_1.default.textGray(props),
|
|
1696
|
-
dark: variables_1.default.contentColorMuted(props)
|
|
1697
|
-
},
|
|
1698
|
-
prisma: variables_1.default.contentColorMuted(props)
|
|
1699
|
-
})(props);
|
|
1700
|
-
},
|
|
1701
|
-
valueMarkerFillColor: function valueMarkerFillColor(props) {
|
|
1702
|
-
return pick_1.default({
|
|
1703
|
-
enterprise: variables_1.default.textColor(props),
|
|
1704
|
-
prisma: {
|
|
1705
|
-
dark: variables_1.default.white(props),
|
|
1706
|
-
light: variables_1.default.black(props)
|
|
1707
|
-
}
|
|
1708
|
-
})(props);
|
|
1709
|
-
},
|
|
1710
|
-
valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
|
|
1711
|
-
return pick_1.default({
|
|
1712
|
-
enterprise: {
|
|
1713
|
-
light: variables_1.default.gray96(props),
|
|
1714
|
-
dark: variables_1.default.black(props)
|
|
1715
|
-
},
|
|
1716
|
-
prisma: variables_1.default.black(props)
|
|
1717
|
-
})(props);
|
|
1718
|
-
}
|
|
1719
|
-
};
|
|
1720
|
-
var editorConfig = [{
|
|
1721
|
-
label: i18n_1._('Select Data Field'),
|
|
1722
|
-
layout: [[{
|
|
1723
|
-
label: i18n_1._('Data field'),
|
|
1724
|
-
editor: 'editor.columnSelector',
|
|
1725
|
-
option: 'value',
|
|
1726
|
-
context: 'defaultContext',
|
|
1727
|
-
editorProps: {
|
|
1728
|
-
dataSourceKey: 'primary',
|
|
1729
|
-
prepareValue: function prepareValue(definition) {
|
|
1730
|
-
var value = definition.options.value;
|
|
1731
|
-
return {
|
|
1732
|
-
context: {},
|
|
1733
|
-
options: {
|
|
1734
|
-
value: "".concat(value, " | lastPoint()")
|
|
1735
|
-
}
|
|
1736
|
-
};
|
|
1737
|
-
}
|
|
1738
|
-
}
|
|
1739
|
-
}]]
|
|
1740
|
-
}, Gauge_1.default, {
|
|
1741
|
-
label: i18n_1._('Coloring'),
|
|
1742
|
-
layout: [[{
|
|
1743
|
-
label: i18n_1._('Gauge Ranges'),
|
|
1744
|
-
option: 'gaugeRanges',
|
|
1745
|
-
editor: 'editor.threshold',
|
|
1746
|
-
editorProps: {
|
|
1747
|
-
openRanges: false,
|
|
1748
|
-
isTogglable: false // Can not disable thresholds
|
|
1351
|
+
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
1749
1352
|
|
|
1353
|
+
if (typeof page === 'number' && page > 0) {
|
|
1354
|
+
newParams.count = pageCount;
|
|
1355
|
+
newParams.offset = (page - 1) * pageCount;
|
|
1750
1356
|
}
|
|
1751
|
-
}], BackgroundColor_1.default({
|
|
1752
|
-
themes: themes,
|
|
1753
|
-
labelPosition: 'top'
|
|
1754
|
-
})]
|
|
1755
|
-
}];
|
|
1756
|
-
/**
|
|
1757
|
-
* visualization configuration
|
|
1758
|
-
*/
|
|
1759
|
-
|
|
1760
|
-
var config = {
|
|
1761
|
-
/**
|
|
1762
|
-
* unique viz key
|
|
1763
|
-
*/
|
|
1764
|
-
key: 'splunk.markergauge',
|
|
1765
1357
|
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
*/
|
|
1769
|
-
name: 'MarkerGauge',
|
|
1770
|
-
category: VizCategory_1.VizCategory.GAUGE,
|
|
1358
|
+
onRequestParamsChange(newParams);
|
|
1359
|
+
};
|
|
1771
1360
|
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
size: size,
|
|
1779
|
-
defaultContext: defaultContext,
|
|
1780
|
-
optionsSchema: optionsSchema,
|
|
1781
|
-
editorConfig: editorConfig,
|
|
1782
|
-
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
|
|
1783
|
-
themes: themes
|
|
1361
|
+
return {
|
|
1362
|
+
isPaging: isPaging,
|
|
1363
|
+
current: current,
|
|
1364
|
+
totalPages: totalPages,
|
|
1365
|
+
onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
|
|
1366
|
+
};
|
|
1784
1367
|
};
|
|
1785
|
-
|
|
1368
|
+
|
|
1369
|
+
exports.getPaginationParams = getPaginationParams;
|
|
1786
1370
|
|
|
1787
1371
|
/***/ }),
|
|
1788
1372
|
|
|
1789
|
-
/***/
|
|
1373
|
+
/***/ 3:
|
|
1790
1374
|
/***/ (function(module, exports) {
|
|
1791
1375
|
|
|
1792
|
-
module.exports = require("
|
|
1376
|
+
module.exports = require("lodash");
|
|
1793
1377
|
|
|
1794
1378
|
/***/ }),
|
|
1795
1379
|
|
|
1796
|
-
/***/
|
|
1380
|
+
/***/ 30:
|
|
1797
1381
|
/***/ (function(module, exports) {
|
|
1798
1382
|
|
|
1799
|
-
module.exports = require("@splunk/
|
|
1383
|
+
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
1800
1384
|
|
|
1801
1385
|
/***/ }),
|
|
1802
1386
|
|
|
1803
|
-
/***/
|
|
1804
|
-
/***/ (function(module, exports) {
|
|
1805
|
-
|
|
1806
|
-
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
1807
|
-
|
|
1808
|
-
/***/ }),
|
|
1809
|
-
|
|
1810
|
-
/***/ 25:
|
|
1811
|
-
/***/ (function(module, exports) {
|
|
1812
|
-
|
|
1813
|
-
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
1814
|
-
|
|
1815
|
-
/***/ }),
|
|
1816
|
-
|
|
1817
|
-
/***/ 26:
|
|
1818
|
-
/***/ (function(module, exports) {
|
|
1819
|
-
|
|
1820
|
-
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
1821
|
-
|
|
1822
|
-
/***/ }),
|
|
1823
|
-
|
|
1824
|
-
/***/ 27:
|
|
1825
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1826
|
-
|
|
1827
|
-
"use strict";
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1831
|
-
value: true
|
|
1832
|
-
});
|
|
1833
|
-
exports.shouldShowIconPlaceholder = void 0;
|
|
1834
|
-
|
|
1835
|
-
var React = __webpack_require__(1);
|
|
1836
|
-
|
|
1837
|
-
var T = __webpack_require__(0);
|
|
1838
|
-
|
|
1839
|
-
var lodash_1 = __webpack_require__(3);
|
|
1840
|
-
|
|
1841
|
-
var i18n_1 = __webpack_require__(2);
|
|
1842
|
-
|
|
1843
|
-
var Message_1 = __webpack_require__(9);
|
|
1844
|
-
|
|
1845
|
-
var FixedSizeContainer_1 = __webpack_require__(12);
|
|
1846
|
-
/**
|
|
1847
|
-
* @method shouldShowIconPlaceholder
|
|
1848
|
-
* @param {object} dataSources
|
|
1849
|
-
* @param {boolean} loading
|
|
1850
|
-
* @returns {boolean}
|
|
1851
|
-
*/
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1855
|
-
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1856
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1857
|
-
var noData = data === undefined;
|
|
1858
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1859
|
-
var noFields = fields === undefined;
|
|
1860
|
-
return loading || noData || noFields;
|
|
1861
|
-
};
|
|
1862
|
-
|
|
1863
|
-
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1864
|
-
var propTypes = {
|
|
1865
|
-
icon: T.func,
|
|
1866
|
-
width: T.oneOfType([T.string, T.number]),
|
|
1867
|
-
height: T.oneOfType([T.string, T.number]),
|
|
1868
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
1869
|
-
backgroundColor: T.string,
|
|
1870
|
-
iconColor: T.string
|
|
1871
|
-
};
|
|
1872
|
-
/**
|
|
1873
|
-
* @method IconPlaceholder
|
|
1874
|
-
* @param {IconPlaceholderProps} props
|
|
1875
|
-
* @returns {React.ReactElement}
|
|
1876
|
-
*/
|
|
1877
|
-
|
|
1878
|
-
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1879
|
-
var width = props.width,
|
|
1880
|
-
height = props.height,
|
|
1881
|
-
icon = props.icon,
|
|
1882
|
-
iconColor = props.iconColor;
|
|
1883
|
-
|
|
1884
|
-
if (icon) {
|
|
1885
|
-
return React.createElement(icon, {
|
|
1886
|
-
style: {
|
|
1887
|
-
left: '50%',
|
|
1888
|
-
top: '50%',
|
|
1889
|
-
color: iconColor,
|
|
1890
|
-
opacity: 0.15,
|
|
1891
|
-
position: 'absolute',
|
|
1892
|
-
transform: 'translate(-50%, -50%)'
|
|
1893
|
-
},
|
|
1894
|
-
width: '50%',
|
|
1895
|
-
height: '50%'
|
|
1896
|
-
});
|
|
1897
|
-
}
|
|
1898
|
-
|
|
1899
|
-
return React.createElement(Message_1.default, {
|
|
1900
|
-
width: width,
|
|
1901
|
-
height: height,
|
|
1902
|
-
level: "warning",
|
|
1903
|
-
message: i18n_1._('No DataSource Connected')
|
|
1904
|
-
});
|
|
1905
|
-
};
|
|
1906
|
-
|
|
1907
|
-
IconPlaceholder.propTypes = propTypes;
|
|
1908
|
-
IconPlaceholder.defaultProps = {
|
|
1909
|
-
width: '100%',
|
|
1910
|
-
height: 250
|
|
1911
|
-
};
|
|
1912
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1913
|
-
|
|
1914
|
-
/***/ }),
|
|
1915
|
-
|
|
1916
|
-
/***/ 28:
|
|
1917
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1918
|
-
|
|
1919
|
-
"use strict";
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
var _defineProperty = __webpack_require__(6);
|
|
1923
|
-
|
|
1924
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1925
|
-
value: true
|
|
1926
|
-
});
|
|
1927
|
-
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
1928
|
-
|
|
1929
|
-
var T = __webpack_require__(0);
|
|
1930
|
-
|
|
1931
|
-
var lodash_1 = __webpack_require__(3);
|
|
1932
|
-
|
|
1933
|
-
var DataSource_1 = __webpack_require__(38);
|
|
1934
|
-
|
|
1935
|
-
exports.SortParamsPropTypes = T.shape({
|
|
1936
|
-
currentSortKey: T.string,
|
|
1937
|
-
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
1938
|
-
onSort: T.func
|
|
1939
|
-
});
|
|
1940
|
-
|
|
1941
|
-
var getSortingParams = function getSortingParams(_ref) {
|
|
1942
|
-
var requestParams = _ref.requestParams,
|
|
1943
|
-
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
1944
|
-
var currentSortKey;
|
|
1945
|
-
var currentSortDir;
|
|
1946
|
-
var nextSortDirMap = {
|
|
1947
|
-
asc: 'desc',
|
|
1948
|
-
desc: 'asc',
|
|
1949
|
-
none: 'asc'
|
|
1950
|
-
};
|
|
1951
|
-
var onSort;
|
|
1952
|
-
|
|
1953
|
-
if (lodash_1.isFunction(onRequestParamsChange)) {
|
|
1954
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
1955
|
-
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
1956
|
-
currentSortDir = requestParams.sort[currentSortKey];
|
|
1957
|
-
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
1958
|
-
|
|
1959
|
-
|
|
1960
|
-
onSort = function onSort(e, _ref2) {
|
|
1961
|
-
var sortKey = _ref2.sortKey,
|
|
1962
|
-
sortDir = _ref2.sortDir;
|
|
1963
|
-
|
|
1964
|
-
if (typeof sortKey === 'string') {
|
|
1965
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1966
|
-
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
1967
|
-
offset: 0,
|
|
1968
|
-
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
1969
|
-
}));
|
|
1970
|
-
} else {
|
|
1971
|
-
onRequestParamsChange(requestParams);
|
|
1972
|
-
}
|
|
1973
|
-
};
|
|
1974
|
-
}
|
|
1975
|
-
|
|
1976
|
-
return {
|
|
1977
|
-
currentSortKey: currentSortKey,
|
|
1978
|
-
currentSortDir: currentSortDir,
|
|
1979
|
-
onSort: onSort
|
|
1980
|
-
};
|
|
1981
|
-
};
|
|
1982
|
-
|
|
1983
|
-
exports.getSortingParams = getSortingParams;
|
|
1984
|
-
|
|
1985
|
-
/***/ }),
|
|
1986
|
-
|
|
1987
|
-
/***/ 29:
|
|
1988
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1989
|
-
|
|
1990
|
-
"use strict";
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1994
|
-
value: true
|
|
1995
|
-
});
|
|
1996
|
-
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
1997
|
-
|
|
1998
|
-
var T = __webpack_require__(0);
|
|
1999
|
-
|
|
2000
|
-
var lodash_1 = __webpack_require__(3);
|
|
2001
|
-
|
|
2002
|
-
exports.PaginatorParamsPropTypes = T.shape({
|
|
2003
|
-
isPaging: T.bool,
|
|
2004
|
-
current: T.number,
|
|
2005
|
-
totalPages: T.number,
|
|
2006
|
-
onChange: T.func
|
|
2007
|
-
});
|
|
2008
|
-
|
|
2009
|
-
var getPaginationParams = function getPaginationParams(_ref) {
|
|
2010
|
-
var requestParams = _ref.requestParams,
|
|
2011
|
-
meta = _ref.meta,
|
|
2012
|
-
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
2013
|
-
var totalCount = meta && meta.totalCount || 0;
|
|
2014
|
-
var offset = requestParams && requestParams.offset || 0;
|
|
2015
|
-
var count = requestParams && requestParams.count;
|
|
2016
|
-
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
2017
|
-
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
2018
|
-
var isPaging = totalPages > 1 && lodash_1.isFunction(onRequestParamsChange);
|
|
2019
|
-
|
|
2020
|
-
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
2021
|
-
var page = _ref2.page,
|
|
2022
|
-
countArg = _ref2.count;
|
|
2023
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
2024
|
-
|
|
2025
|
-
if (typeof countArg === 'number') {
|
|
2026
|
-
newParams.count = countArg;
|
|
2027
|
-
newParams.offset = 0;
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
2031
|
-
|
|
2032
|
-
if (typeof page === 'number' && page > 0) {
|
|
2033
|
-
newParams.count = pageCount;
|
|
2034
|
-
newParams.offset = (page - 1) * pageCount;
|
|
2035
|
-
}
|
|
2036
|
-
|
|
2037
|
-
onRequestParamsChange(newParams);
|
|
2038
|
-
};
|
|
2039
|
-
|
|
2040
|
-
return {
|
|
2041
|
-
isPaging: isPaging,
|
|
2042
|
-
current: current,
|
|
2043
|
-
totalPages: totalPages,
|
|
2044
|
-
onChange: lodash_1.isFunction(onRequestParamsChange) ? onChangeHandler : lodash_1.noop
|
|
2045
|
-
};
|
|
2046
|
-
};
|
|
2047
|
-
|
|
2048
|
-
exports.getPaginationParams = getPaginationParams;
|
|
2049
|
-
|
|
2050
|
-
/***/ }),
|
|
2051
|
-
|
|
2052
|
-
/***/ 3:
|
|
2053
|
-
/***/ (function(module, exports) {
|
|
2054
|
-
|
|
2055
|
-
module.exports = require("lodash");
|
|
2056
|
-
|
|
2057
|
-
/***/ }),
|
|
2058
|
-
|
|
2059
|
-
/***/ 30:
|
|
1387
|
+
/***/ 31:
|
|
2060
1388
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2061
1389
|
|
|
2062
1390
|
"use strict";
|
|
@@ -2085,7 +1413,7 @@ var VizCategory;
|
|
|
2085
1413
|
|
|
2086
1414
|
/***/ }),
|
|
2087
1415
|
|
|
2088
|
-
/***/
|
|
1416
|
+
/***/ 32:
|
|
2089
1417
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2090
1418
|
|
|
2091
1419
|
"use strict";
|
|
@@ -2099,37 +1427,37 @@ var React = __webpack_require__(1);
|
|
|
2099
1427
|
|
|
2100
1428
|
var lodash_1 = __webpack_require__(3);
|
|
2101
1429
|
|
|
2102
|
-
var getSettingsFromThemedProps_1 = __webpack_require__(
|
|
1430
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(33);
|
|
2103
1431
|
|
|
2104
|
-
var Options_1 = __webpack_require__(
|
|
1432
|
+
var Options_1 = __webpack_require__(34);
|
|
2105
1433
|
|
|
2106
|
-
var SanitizeProps_1 = __webpack_require__(
|
|
1434
|
+
var SanitizeProps_1 = __webpack_require__(35);
|
|
2107
1435
|
|
|
2108
|
-
var TimezoneContext_1 = __webpack_require__(
|
|
1436
|
+
var TimezoneContext_1 = __webpack_require__(23);
|
|
2109
1437
|
|
|
2110
|
-
var moment_1 = __webpack_require__(
|
|
1438
|
+
var moment_1 = __webpack_require__(36);
|
|
2111
1439
|
|
|
2112
1440
|
var styled_components_1 = __webpack_require__(4);
|
|
2113
1441
|
|
|
2114
|
-
var hocUtils_1 = __webpack_require__(
|
|
1442
|
+
var hocUtils_1 = __webpack_require__(25);
|
|
2115
1443
|
|
|
2116
|
-
var JSONSchemaUtils_1 = __webpack_require__(
|
|
1444
|
+
var JSONSchemaUtils_1 = __webpack_require__(26);
|
|
2117
1445
|
|
|
2118
|
-
var SplunkVisualization_1 = __webpack_require__(
|
|
1446
|
+
var SplunkVisualization_1 = __webpack_require__(37);
|
|
2119
1447
|
|
|
2120
|
-
var VizBehavior_1 = __webpack_require__(
|
|
1448
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
2121
1449
|
|
|
2122
1450
|
var getSorting_1 = __webpack_require__(28);
|
|
2123
1451
|
|
|
2124
1452
|
var getPagination_1 = __webpack_require__(29);
|
|
2125
1453
|
|
|
2126
|
-
var useDeepMemo_1 = __webpack_require__(
|
|
1454
|
+
var useDeepMemo_1 = __webpack_require__(40);
|
|
2127
1455
|
|
|
2128
|
-
var MissingPropsMessage_1 = __webpack_require__(
|
|
1456
|
+
var MissingPropsMessage_1 = __webpack_require__(41);
|
|
2129
1457
|
|
|
2130
|
-
var withEditModeCover_1 = __webpack_require__(
|
|
1458
|
+
var withEditModeCover_1 = __webpack_require__(42);
|
|
2131
1459
|
|
|
2132
|
-
var withPlaceholder_1 = __webpack_require__(
|
|
1460
|
+
var withPlaceholder_1 = __webpack_require__(43);
|
|
2133
1461
|
/**
|
|
2134
1462
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
2135
1463
|
* @param {DashboardVizOpts} opts
|
|
@@ -2331,292 +1659,971 @@ exports.default = withDashboardViz;
|
|
|
2331
1659
|
|
|
2332
1660
|
/***/ }),
|
|
2333
1661
|
|
|
2334
|
-
/***/
|
|
1662
|
+
/***/ 33:
|
|
2335
1663
|
/***/ (function(module, exports) {
|
|
2336
1664
|
|
|
2337
1665
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
2338
1666
|
|
|
2339
1667
|
/***/ }),
|
|
2340
1668
|
|
|
2341
|
-
/***/
|
|
1669
|
+
/***/ 34:
|
|
2342
1670
|
/***/ (function(module, exports) {
|
|
2343
1671
|
|
|
2344
1672
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
2345
1673
|
|
|
2346
1674
|
/***/ }),
|
|
2347
1675
|
|
|
2348
|
-
/***/
|
|
1676
|
+
/***/ 35:
|
|
1677
|
+
/***/ (function(module, exports) {
|
|
1678
|
+
|
|
1679
|
+
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1680
|
+
|
|
1681
|
+
/***/ }),
|
|
1682
|
+
|
|
1683
|
+
/***/ 36:
|
|
2349
1684
|
/***/ (function(module, exports) {
|
|
2350
1685
|
|
|
2351
|
-
module.exports = require("@splunk/
|
|
1686
|
+
module.exports = require("@splunk/moment");
|
|
1687
|
+
|
|
1688
|
+
/***/ }),
|
|
1689
|
+
|
|
1690
|
+
/***/ 37:
|
|
1691
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1692
|
+
|
|
1693
|
+
"use strict";
|
|
1694
|
+
|
|
1695
|
+
|
|
1696
|
+
var _classCallCheck = __webpack_require__(11);
|
|
1697
|
+
|
|
1698
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1699
|
+
value: true
|
|
1700
|
+
});
|
|
1701
|
+
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1702
|
+
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1703
|
+
|
|
1704
|
+
var T = __webpack_require__(0);
|
|
1705
|
+
|
|
1706
|
+
var lodash_1 = __webpack_require__(3);
|
|
1707
|
+
|
|
1708
|
+
var VizActionHandler_1 = __webpack_require__(38); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1709
|
+
|
|
1710
|
+
|
|
1711
|
+
exports.INITIAL_WIDTH = 250;
|
|
1712
|
+
exports.INITIAL_HEIGHT = 250;
|
|
1713
|
+
/**
|
|
1714
|
+
* A Splunk visualization
|
|
1715
|
+
*/
|
|
1716
|
+
|
|
1717
|
+
var SplunkVisualization = function SplunkVisualization() {
|
|
1718
|
+
_classCallCheck(this, SplunkVisualization);
|
|
1719
|
+
};
|
|
1720
|
+
|
|
1721
|
+
SplunkVisualization.propTypes = {
|
|
1722
|
+
/**
|
|
1723
|
+
* display mode
|
|
1724
|
+
*/
|
|
1725
|
+
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1726
|
+
|
|
1727
|
+
/**
|
|
1728
|
+
* width in pixel or string, defaults to 100%
|
|
1729
|
+
*/
|
|
1730
|
+
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1731
|
+
|
|
1732
|
+
/**
|
|
1733
|
+
* height in pixel or string
|
|
1734
|
+
*/
|
|
1735
|
+
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1736
|
+
|
|
1737
|
+
/**
|
|
1738
|
+
* visualization context used for dynamic option evaluation
|
|
1739
|
+
*/
|
|
1740
|
+
context: T.object,
|
|
1741
|
+
|
|
1742
|
+
/**
|
|
1743
|
+
* visualization formatting options
|
|
1744
|
+
*/
|
|
1745
|
+
options: T.object,
|
|
1746
|
+
|
|
1747
|
+
/**
|
|
1748
|
+
* A callback to update formatting options
|
|
1749
|
+
*/
|
|
1750
|
+
onOptionsChange: T.func,
|
|
1751
|
+
|
|
1752
|
+
/**
|
|
1753
|
+
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1754
|
+
*/
|
|
1755
|
+
dataSources: T.objectOf(T.shape({
|
|
1756
|
+
/**
|
|
1757
|
+
* current request params
|
|
1758
|
+
*/
|
|
1759
|
+
requestParams: T.object,
|
|
1760
|
+
|
|
1761
|
+
/**
|
|
1762
|
+
* current dataset
|
|
1763
|
+
*/
|
|
1764
|
+
data: T.shape({
|
|
1765
|
+
fields: T.array,
|
|
1766
|
+
columns: T.array
|
|
1767
|
+
}),
|
|
1768
|
+
|
|
1769
|
+
/**
|
|
1770
|
+
* error
|
|
1771
|
+
*/
|
|
1772
|
+
error: T.shape({
|
|
1773
|
+
level: T.string,
|
|
1774
|
+
message: T.string
|
|
1775
|
+
}),
|
|
1776
|
+
|
|
1777
|
+
/**
|
|
1778
|
+
* meta data that came with the dataset
|
|
1779
|
+
*/
|
|
1780
|
+
meta: T.object
|
|
1781
|
+
})),
|
|
1782
|
+
|
|
1783
|
+
/**
|
|
1784
|
+
* A callback to trigger event
|
|
1785
|
+
*/
|
|
1786
|
+
onEventTrigger: T.func,
|
|
1787
|
+
|
|
1788
|
+
/**
|
|
1789
|
+
* Inform viz if there are handlers listening to events
|
|
1790
|
+
*/
|
|
1791
|
+
hasEventHandlers: T.bool,
|
|
1792
|
+
|
|
1793
|
+
/**
|
|
1794
|
+
* A callback to communicate computed props to a consumer
|
|
1795
|
+
*/
|
|
1796
|
+
onComputedProps: T.func,
|
|
1797
|
+
|
|
1798
|
+
/**
|
|
1799
|
+
* A callback to obtain visualization api
|
|
1800
|
+
*/
|
|
1801
|
+
vizActionHandlerRef: T.func,
|
|
1802
|
+
loading: T.bool,
|
|
1803
|
+
theme: T.object,
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* A callback to request new data with updated request params
|
|
1807
|
+
*/
|
|
1808
|
+
onRequestParamsChange: T.func
|
|
1809
|
+
};
|
|
1810
|
+
/**
|
|
1811
|
+
*
|
|
1812
|
+
*/
|
|
1813
|
+
|
|
1814
|
+
SplunkVisualization.defaultProps = {
|
|
1815
|
+
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1816
|
+
width: '100%',
|
|
1817
|
+
height: exports.INITIAL_HEIGHT,
|
|
1818
|
+
dataSources: {},
|
|
1819
|
+
onEventTrigger: function onEventTrigger() {
|
|
1820
|
+
return {};
|
|
1821
|
+
},
|
|
1822
|
+
mode: 'view',
|
|
1823
|
+
hasEventHandlers: false,
|
|
1824
|
+
options: {},
|
|
1825
|
+
context: {},
|
|
1826
|
+
onOptionsChange: function onOptionsChange() {
|
|
1827
|
+
return {};
|
|
1828
|
+
},
|
|
1829
|
+
vizActionHandlerRef: function vizActionHandlerRef() {
|
|
1830
|
+
return new VizActionHandler_1.DefaultVizActionHandler();
|
|
1831
|
+
},
|
|
1832
|
+
onComputedProps: function onComputedProps() {
|
|
1833
|
+
return {};
|
|
1834
|
+
},
|
|
1835
|
+
loading: false,
|
|
1836
|
+
onRequestParamsChange: lodash_1.noop
|
|
1837
|
+
};
|
|
1838
|
+
exports.default = SplunkVisualization;
|
|
1839
|
+
|
|
1840
|
+
/***/ }),
|
|
1841
|
+
|
|
1842
|
+
/***/ 38:
|
|
1843
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1844
|
+
|
|
1845
|
+
"use strict";
|
|
1846
|
+
|
|
1847
|
+
|
|
1848
|
+
var _classCallCheck = __webpack_require__(11);
|
|
1849
|
+
|
|
1850
|
+
var _createClass = __webpack_require__(19);
|
|
1851
|
+
|
|
1852
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1853
|
+
value: true
|
|
1854
|
+
});
|
|
1855
|
+
exports.DefaultVizActionHandler = void 0;
|
|
1856
|
+
|
|
1857
|
+
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1858
|
+
function DefaultVizActionHandler() {
|
|
1859
|
+
_classCallCheck(this, DefaultVizActionHandler);
|
|
1860
|
+
}
|
|
1861
|
+
|
|
1862
|
+
_createClass(DefaultVizActionHandler, [{
|
|
1863
|
+
key: "focus",
|
|
1864
|
+
value: function focus() {// noop
|
|
1865
|
+
}
|
|
1866
|
+
}, {
|
|
1867
|
+
key: "snapshot",
|
|
1868
|
+
value: function snapshot() {
|
|
1869
|
+
return null; // noop
|
|
1870
|
+
}
|
|
1871
|
+
}]);
|
|
1872
|
+
|
|
1873
|
+
return DefaultVizActionHandler;
|
|
1874
|
+
}();
|
|
1875
|
+
|
|
1876
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1877
|
+
|
|
1878
|
+
/***/ }),
|
|
1879
|
+
|
|
1880
|
+
/***/ 39:
|
|
1881
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1882
|
+
|
|
1883
|
+
"use strict";
|
|
1884
|
+
|
|
1885
|
+
|
|
1886
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1887
|
+
value: true
|
|
1888
|
+
});
|
|
1889
|
+
exports.validSortDirs = void 0;
|
|
1890
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1891
|
+
|
|
1892
|
+
/***/ }),
|
|
1893
|
+
|
|
1894
|
+
/***/ 399:
|
|
1895
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1896
|
+
|
|
1897
|
+
"use strict";
|
|
1898
|
+
|
|
1899
|
+
|
|
1900
|
+
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1901
|
+
if (k2 === undefined) k2 = k;
|
|
1902
|
+
Object.defineProperty(o, k2, {
|
|
1903
|
+
enumerable: true,
|
|
1904
|
+
get: function get() {
|
|
1905
|
+
return m[k];
|
|
1906
|
+
}
|
|
1907
|
+
});
|
|
1908
|
+
} : function (o, m, k, k2) {
|
|
1909
|
+
if (k2 === undefined) k2 = k;
|
|
1910
|
+
o[k2] = m[k];
|
|
1911
|
+
});
|
|
1912
|
+
|
|
1913
|
+
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
1914
|
+
for (var p in m) {
|
|
1915
|
+
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
1916
|
+
}
|
|
1917
|
+
};
|
|
1918
|
+
|
|
1919
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1920
|
+
value: true
|
|
1921
|
+
});
|
|
1922
|
+
exports.default = void 0;
|
|
1923
|
+
|
|
1924
|
+
__exportStar(__webpack_require__(144), exports);
|
|
1925
|
+
|
|
1926
|
+
var MarkerGauge_1 = __webpack_require__(144);
|
|
1927
|
+
|
|
1928
|
+
Object.defineProperty(exports, "default", {
|
|
1929
|
+
enumerable: true,
|
|
1930
|
+
get: function get() {
|
|
1931
|
+
return MarkerGauge_1.default;
|
|
1932
|
+
}
|
|
1933
|
+
});
|
|
1934
|
+
|
|
1935
|
+
/***/ }),
|
|
1936
|
+
|
|
1937
|
+
/***/ 4:
|
|
1938
|
+
/***/ (function(module, exports) {
|
|
1939
|
+
|
|
1940
|
+
module.exports = require("styled-components");
|
|
1941
|
+
|
|
1942
|
+
/***/ }),
|
|
1943
|
+
|
|
1944
|
+
/***/ 40:
|
|
1945
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1946
|
+
|
|
1947
|
+
"use strict";
|
|
1948
|
+
|
|
1949
|
+
|
|
1950
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1951
|
+
value: true
|
|
1952
|
+
});
|
|
1953
|
+
exports.useDeepMemo = void 0;
|
|
1954
|
+
|
|
1955
|
+
var react_1 = __webpack_require__(1);
|
|
1956
|
+
|
|
1957
|
+
var lodash_1 = __webpack_require__(3);
|
|
1958
|
+
/**
|
|
1959
|
+
* This hook evaluates and stores the result of a passed function and only
|
|
1960
|
+
* re-evaluates the function when passed dependencies change.
|
|
1961
|
+
*
|
|
1962
|
+
* It is different from the internal React useMemo in the following aspects:
|
|
1963
|
+
* - it only stores the last evaluated result
|
|
1964
|
+
* - it uses a deep equality check to determine if dependencies have changed
|
|
1965
|
+
*
|
|
1966
|
+
* Inspired by apollo-client's useDeepMemo
|
|
1967
|
+
*
|
|
1968
|
+
* @param fn the function to be executed and
|
|
1969
|
+
* @param dependencies an array of dependencies
|
|
1970
|
+
*/
|
|
1971
|
+
|
|
1972
|
+
|
|
1973
|
+
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1974
|
+
var ref = react_1.useRef();
|
|
1975
|
+
|
|
1976
|
+
if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
|
|
1977
|
+
ref.current = {
|
|
1978
|
+
dependencies: dependencies,
|
|
1979
|
+
value: fn()
|
|
1980
|
+
};
|
|
1981
|
+
}
|
|
1982
|
+
|
|
1983
|
+
return ref.current.value;
|
|
1984
|
+
};
|
|
1985
|
+
|
|
1986
|
+
exports.useDeepMemo = useDeepMemo;
|
|
1987
|
+
|
|
1988
|
+
/***/ }),
|
|
1989
|
+
|
|
1990
|
+
/***/ 400:
|
|
1991
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1992
|
+
|
|
1993
|
+
"use strict";
|
|
1994
|
+
|
|
1995
|
+
|
|
1996
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
1997
|
+
var t = {};
|
|
1998
|
+
|
|
1999
|
+
for (var p in s) {
|
|
2000
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2001
|
+
}
|
|
2002
|
+
|
|
2003
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2004
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2005
|
+
}
|
|
2006
|
+
return t;
|
|
2007
|
+
};
|
|
2008
|
+
|
|
2009
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2010
|
+
value: true
|
|
2011
|
+
});
|
|
2012
|
+
|
|
2013
|
+
var React = __webpack_require__(1);
|
|
2014
|
+
|
|
2015
|
+
var react_1 = __webpack_require__(1);
|
|
2016
|
+
|
|
2017
|
+
var T = __webpack_require__(0);
|
|
2018
|
+
|
|
2019
|
+
var styled_components_1 = __webpack_require__(4);
|
|
2020
|
+
|
|
2021
|
+
var lodash_1 = __webpack_require__(3);
|
|
2022
|
+
|
|
2023
|
+
var i18n_1 = __webpack_require__(2);
|
|
2024
|
+
|
|
2025
|
+
var style_1 = __webpack_require__(15);
|
|
2026
|
+
|
|
2027
|
+
var SizeAwareWrapper_1 = __webpack_require__(20);
|
|
2028
|
+
|
|
2029
|
+
var Message_1 = __webpack_require__(10);
|
|
2030
|
+
|
|
2031
|
+
var id_1 = __webpack_require__(401);
|
|
2032
|
+
|
|
2033
|
+
var gaugeUtils_1 = __webpack_require__(84);
|
|
2034
|
+
|
|
2035
|
+
var GaugeMajorTicks_1 = __webpack_require__(111);
|
|
2036
|
+
|
|
2037
|
+
var GaugeValueMarker_1 = __webpack_require__(112);
|
|
2038
|
+
|
|
2039
|
+
var MAX_VERTICAL_CONTAINER_WIDTH = 200;
|
|
2040
|
+
var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
|
|
2041
|
+
var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
|
|
2042
|
+
var MIN_HORIZONTAL_CONTAINER_HEIGHT = 100;
|
|
2043
|
+
var Container = styled_components_1.default.div.withConfig({
|
|
2044
|
+
displayName: "MarkerGauge__Container",
|
|
2045
|
+
componentId: "sc-10z02va-0"
|
|
2046
|
+
})(["overflow:hidden;", ";background-color:", ";"], function (props) {
|
|
2047
|
+
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
2048
|
+
}, function (props) {
|
|
2049
|
+
return props.backgroundColor;
|
|
2050
|
+
});
|
|
2051
|
+
var MarkerGaugeWrapper = styled_components_1.default.div.withConfig({
|
|
2052
|
+
displayName: "MarkerGauge__MarkerGaugeWrapper",
|
|
2053
|
+
componentId: "sc-10z02va-1"
|
|
2054
|
+
})(["display:flex;justify-content:center;flex-direction:row;width:100%;height:100%;background-color:", ";"], function (props) {
|
|
2055
|
+
return props.backgroundColor;
|
|
2056
|
+
});
|
|
2057
|
+
var MarkerGaugeContainer = styled_components_1.default.div.withConfig({
|
|
2058
|
+
displayName: "MarkerGauge__MarkerGaugeContainer",
|
|
2059
|
+
componentId: "sc-10z02va-2"
|
|
2060
|
+
})(["overflow:hidden;position:relative;", ";"], function (props) {
|
|
2061
|
+
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
2062
|
+
});
|
|
2063
|
+
var MarkerGaugeSVG = styled_components_1.default.svg.withConfig({
|
|
2064
|
+
displayName: "MarkerGauge__MarkerGaugeSVG",
|
|
2065
|
+
componentId: "sc-10z02va-3"
|
|
2066
|
+
})(["", ";"], function (props) {
|
|
2067
|
+
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
2068
|
+
});
|
|
2069
|
+
var BackgroundBar = styled_components_1.default.rect.attrs({
|
|
2070
|
+
'data-test': 'background-bar-rect'
|
|
2071
|
+
}).withConfig({
|
|
2072
|
+
displayName: "MarkerGauge__BackgroundBar",
|
|
2073
|
+
componentId: "sc-10z02va-4"
|
|
2074
|
+
})(["fill:", ";"], function (props) {
|
|
2075
|
+
return props.fillColor;
|
|
2076
|
+
});
|
|
2077
|
+
var MarkerBar = styled_components_1.default.rect.attrs({
|
|
2078
|
+
'data-test': 'marker-bar-rect'
|
|
2079
|
+
}).withConfig({
|
|
2080
|
+
displayName: "MarkerGauge__MarkerBar",
|
|
2081
|
+
componentId: "sc-10z02va-5"
|
|
2082
|
+
})([""]);
|
|
2083
|
+
|
|
2084
|
+
var MarkerGauge = function MarkerGauge(_a) {
|
|
2085
|
+
var props = __rest(_a, []);
|
|
2086
|
+
|
|
2087
|
+
var width = props.width,
|
|
2088
|
+
height = props.height,
|
|
2089
|
+
value = props.value,
|
|
2090
|
+
orientation = props.orientation,
|
|
2091
|
+
majorUnit = props.majorUnit,
|
|
2092
|
+
showLabels = props.showLabels,
|
|
2093
|
+
showValue = props.showValue,
|
|
2094
|
+
usePercentageRange = props.usePercentageRange,
|
|
2095
|
+
usePercentageValue = props.usePercentageValue,
|
|
2096
|
+
backgroundColor = props.backgroundColor,
|
|
2097
|
+
fillColor = props.fillColor,
|
|
2098
|
+
ranges = props.ranges,
|
|
2099
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
2100
|
+
majorTickStrokeColor = props.majorTickStrokeColor,
|
|
2101
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
2102
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
2103
|
+
/**
|
|
2104
|
+
* Standard error message render
|
|
2105
|
+
*/
|
|
2106
|
+
|
|
2107
|
+
var errorMessage = react_1.useCallback(function (containerWidth, containerHeight, err, errID) {
|
|
2108
|
+
return React.createElement(Message_1.default, {
|
|
2109
|
+
width: containerWidth,
|
|
2110
|
+
height: containerHeight,
|
|
2111
|
+
message: err,
|
|
2112
|
+
level: "info",
|
|
2113
|
+
id: errID
|
|
2114
|
+
});
|
|
2115
|
+
}, []);
|
|
2116
|
+
var errorId = react_1.useMemo(function () {
|
|
2117
|
+
return id_1.createDOMID();
|
|
2118
|
+
}, []);
|
|
2119
|
+
/**
|
|
2120
|
+
* Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
|
|
2121
|
+
*/
|
|
2122
|
+
|
|
2123
|
+
var error = react_1.useMemo(function () {
|
|
2124
|
+
return gaugeUtils_1.validateRanges(ranges);
|
|
2125
|
+
}, [ranges]);
|
|
2126
|
+
var sortedRanges = react_1.useMemo(function () {
|
|
2127
|
+
return gaugeUtils_1.getSortedRanges(ranges);
|
|
2128
|
+
}, [ranges]);
|
|
2129
|
+
|
|
2130
|
+
var _react_1$useMemo = react_1.useMemo(function () {
|
|
2131
|
+
return gaugeUtils_1.getGaugeRange(sortedRanges);
|
|
2132
|
+
}, [sortedRanges]),
|
|
2133
|
+
min = _react_1$useMemo.min,
|
|
2134
|
+
max = _react_1$useMemo.max;
|
|
2135
|
+
|
|
2136
|
+
var linearGradientId = react_1.useMemo(function () {
|
|
2137
|
+
return id_1.createDOMID('marker');
|
|
2138
|
+
}, []);
|
|
2139
|
+
var linearGradient = react_1.useMemo(function () {
|
|
2140
|
+
var stops = gaugeUtils_1.getGradientStops({
|
|
2141
|
+
ranges: sortedRanges,
|
|
2142
|
+
orientation: orientation
|
|
2143
|
+
});
|
|
2144
|
+
|
|
2145
|
+
var _gaugeUtils_1$getGrad = gaugeUtils_1.getGradientDimensions(orientation),
|
|
2146
|
+
x1 = _gaugeUtils_1$getGrad.x1,
|
|
2147
|
+
y1 = _gaugeUtils_1$getGrad.y1,
|
|
2148
|
+
x2 = _gaugeUtils_1$getGrad.x2,
|
|
2149
|
+
y2 = _gaugeUtils_1$getGrad.y2;
|
|
2150
|
+
|
|
2151
|
+
var linearGradientStops = stops.map(function (stop) {
|
|
2152
|
+
return React.createElement("stop", {
|
|
2153
|
+
key: "".concat(stop.offset, "_").concat(stop.stopColor),
|
|
2154
|
+
offset: stop.offset,
|
|
2155
|
+
stopColor: stop.stopColor
|
|
2156
|
+
});
|
|
2157
|
+
});
|
|
2158
|
+
return React.createElement("linearGradient", {
|
|
2159
|
+
id: linearGradientId,
|
|
2160
|
+
x1: x1,
|
|
2161
|
+
y1: y1,
|
|
2162
|
+
x2: x2,
|
|
2163
|
+
y2: y2
|
|
2164
|
+
}, linearGradientStops);
|
|
2165
|
+
}, [sortedRanges, orientation, linearGradientId]);
|
|
2166
|
+
/**
|
|
2167
|
+
* Calculate marker gauge dimensions
|
|
2168
|
+
*/
|
|
2169
|
+
|
|
2170
|
+
var calculateMarkerGaugeDimensions = react_1.useCallback(function (containerWidth, containerHeight) {
|
|
2171
|
+
var _gaugeUtils_1$getGaug = gaugeUtils_1.getGaugeDimensions({
|
|
2172
|
+
containerWidth: containerWidth,
|
|
2173
|
+
containerHeight: containerHeight,
|
|
2174
|
+
orientation: orientation
|
|
2175
|
+
}),
|
|
2176
|
+
gaugeLength = _gaugeUtils_1$getGaug.gaugeLength,
|
|
2177
|
+
gaugeStartX = _gaugeUtils_1$getGaug.gaugeStartX,
|
|
2178
|
+
gaugeStartY = _gaugeUtils_1$getGaug.gaugeStartY,
|
|
2179
|
+
gaugeWidth = _gaugeUtils_1$getGaug.gaugeWidth,
|
|
2180
|
+
gaugeHeight = _gaugeUtils_1$getGaug.gaugeHeight;
|
|
2181
|
+
|
|
2182
|
+
var _gaugeUtils_1$getMark = gaugeUtils_1.getMarkerBarDimensions({
|
|
2183
|
+
gaugeLength: gaugeLength,
|
|
2184
|
+
gaugeStartX: gaugeStartX,
|
|
2185
|
+
gaugeStartY: gaugeStartY,
|
|
2186
|
+
gaugeWidth: gaugeWidth,
|
|
2187
|
+
gaugeHeight: gaugeHeight,
|
|
2188
|
+
orientation: orientation
|
|
2189
|
+
}),
|
|
2190
|
+
markerBarLength = _gaugeUtils_1$getMark.markerBarLength,
|
|
2191
|
+
markerBarX = _gaugeUtils_1$getMark.markerBarX,
|
|
2192
|
+
markerBarY = _gaugeUtils_1$getMark.markerBarY,
|
|
2193
|
+
markerBarWidth = _gaugeUtils_1$getMark.markerBarWidth,
|
|
2194
|
+
markerBarHeight = _gaugeUtils_1$getMark.markerBarHeight;
|
|
2195
|
+
|
|
2196
|
+
var _gaugeUtils_1$getMark2 = gaugeUtils_1.getMarkerGaugeValueMarkerPositions({
|
|
2197
|
+
markerBarX: markerBarX,
|
|
2198
|
+
markerBarY: markerBarY,
|
|
2199
|
+
markerBarHeight: markerBarHeight,
|
|
2200
|
+
markerBarLength: markerBarLength,
|
|
2201
|
+
orientation: orientation,
|
|
2202
|
+
value: value,
|
|
2203
|
+
min: min,
|
|
2204
|
+
max: max
|
|
2205
|
+
}),
|
|
2206
|
+
valueMarkerX = _gaugeUtils_1$getMark2.valueMarkerX,
|
|
2207
|
+
valueMarkerY = _gaugeUtils_1$getMark2.valueMarkerY;
|
|
2208
|
+
|
|
2209
|
+
return {
|
|
2210
|
+
markerBarX: markerBarX,
|
|
2211
|
+
markerBarY: markerBarY,
|
|
2212
|
+
markerBarWidth: markerBarWidth,
|
|
2213
|
+
markerBarHeight: markerBarHeight,
|
|
2214
|
+
valueMarkerX: valueMarkerX,
|
|
2215
|
+
valueMarkerY: valueMarkerY,
|
|
2216
|
+
gaugeStartX: gaugeStartX,
|
|
2217
|
+
gaugeStartY: gaugeStartY,
|
|
2218
|
+
gaugeWidth: gaugeWidth,
|
|
2219
|
+
gaugeHeight: gaugeHeight
|
|
2220
|
+
};
|
|
2221
|
+
}, [orientation, value, min, max]);
|
|
2222
|
+
var renderVisualization = react_1.useCallback(function (_ref) {
|
|
2223
|
+
var containerWidth = _ref.width,
|
|
2224
|
+
containerHeight = _ref.height;
|
|
2225
|
+
|
|
2226
|
+
// todo: need change the size when get design for smaller space
|
|
2227
|
+
// 58 is the title & description header height in dashboard visualization
|
|
2228
|
+
if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
|
|
2229
|
+
return errorMessage(containerWidth, containerHeight, i18n_1._('Too small to render content'), errorId);
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
if (error) {
|
|
2233
|
+
return errorMessage(containerWidth, containerHeight, error, errorId);
|
|
2234
|
+
}
|
|
2235
|
+
|
|
2236
|
+
var _calculateMarkerGauge = calculateMarkerGaugeDimensions(containerWidth, containerHeight),
|
|
2237
|
+
markerBarX = _calculateMarkerGauge.markerBarX,
|
|
2238
|
+
markerBarY = _calculateMarkerGauge.markerBarY,
|
|
2239
|
+
markerBarWidth = _calculateMarkerGauge.markerBarWidth,
|
|
2240
|
+
markerBarHeight = _calculateMarkerGauge.markerBarHeight,
|
|
2241
|
+
valueMarkerX = _calculateMarkerGauge.valueMarkerX,
|
|
2242
|
+
valueMarkerY = _calculateMarkerGauge.valueMarkerY,
|
|
2243
|
+
gaugeStartX = _calculateMarkerGauge.gaugeStartX,
|
|
2244
|
+
gaugeStartY = _calculateMarkerGauge.gaugeStartY,
|
|
2245
|
+
gaugeWidth = _calculateMarkerGauge.gaugeWidth,
|
|
2246
|
+
gaugeHeight = _calculateMarkerGauge.gaugeHeight;
|
|
2247
|
+
|
|
2248
|
+
return React.createElement(MarkerGaugeWrapper, {
|
|
2249
|
+
backgroundColor: backgroundColor
|
|
2250
|
+
}, React.createElement(MarkerGaugeContainer, {
|
|
2251
|
+
width: containerWidth,
|
|
2252
|
+
height: containerHeight
|
|
2253
|
+
}, React.createElement(MarkerGaugeSVG, {
|
|
2254
|
+
width: containerWidth,
|
|
2255
|
+
height: containerHeight
|
|
2256
|
+
}, linearGradient, React.createElement(BackgroundBar, {
|
|
2257
|
+
x: gaugeStartX,
|
|
2258
|
+
y: gaugeStartY,
|
|
2259
|
+
width: gaugeWidth,
|
|
2260
|
+
height: gaugeHeight,
|
|
2261
|
+
fillColor: fillColor
|
|
2262
|
+
}), React.createElement(GaugeMajorTicks_1.default, {
|
|
2263
|
+
width: gaugeWidth,
|
|
2264
|
+
height: gaugeHeight,
|
|
2265
|
+
startX: gaugeStartX,
|
|
2266
|
+
startY: gaugeStartY,
|
|
2267
|
+
min: min,
|
|
2268
|
+
max: max,
|
|
2269
|
+
majorUnit: majorUnit,
|
|
2270
|
+
orientation: orientation,
|
|
2271
|
+
showLabels: showLabels,
|
|
2272
|
+
usePercentageRange: usePercentageRange,
|
|
2273
|
+
majorTickFillColor: majorTickFillColor,
|
|
2274
|
+
majorTickStrokeColor: majorTickStrokeColor
|
|
2275
|
+
}), React.createElement(MarkerBar, {
|
|
2276
|
+
x: markerBarX,
|
|
2277
|
+
y: markerBarY,
|
|
2278
|
+
width: markerBarWidth,
|
|
2279
|
+
height: markerBarHeight,
|
|
2280
|
+
fill: "url(#".concat(linearGradientId, ")")
|
|
2281
|
+
}), React.createElement(GaugeValueMarker_1.default, {
|
|
2282
|
+
x: valueMarkerX,
|
|
2283
|
+
y: valueMarkerY,
|
|
2284
|
+
length: gaugeUtils_1.GAUGE_THICKNESS,
|
|
2285
|
+
min: min,
|
|
2286
|
+
max: max,
|
|
2287
|
+
value: value,
|
|
2288
|
+
orientation: orientation,
|
|
2289
|
+
showValue: showValue,
|
|
2290
|
+
usePercentageValue: usePercentageValue,
|
|
2291
|
+
valueMarkerFillColor: valueMarkerFillColor,
|
|
2292
|
+
valueMarkerLabelFillColor: valueMarkerLabelFillColor
|
|
2293
|
+
}))));
|
|
2294
|
+
}, [orientation, error, calculateMarkerGaugeDimensions, backgroundColor, linearGradient, fillColor, min, max, majorUnit, showLabels, usePercentageRange, majorTickFillColor, majorTickStrokeColor, linearGradientId, value, showValue, usePercentageValue, valueMarkerFillColor, valueMarkerLabelFillColor, errorMessage, errorId]);
|
|
2295
|
+
return React.createElement(Container, {
|
|
2296
|
+
width: width,
|
|
2297
|
+
height: height,
|
|
2298
|
+
backgroundColor: backgroundColor
|
|
2299
|
+
}, React.createElement(SizeAwareWrapper_1.default, null, function (containerDimension) {
|
|
2300
|
+
return renderVisualization(containerDimension);
|
|
2301
|
+
}));
|
|
2302
|
+
};
|
|
2303
|
+
|
|
2304
|
+
MarkerGauge.propTypes = {
|
|
2305
|
+
width: T.oneOfType([T.string, T.number]),
|
|
2306
|
+
height: T.oneOfType([T.string, T.number]),
|
|
2307
|
+
value: T.number,
|
|
2308
|
+
// valueFieldName: T.string, // todo: need add it back when displaying name later
|
|
2309
|
+
orientation: T.oneOf(['horizontal', 'vertical']),
|
|
2310
|
+
majorUnit: T.oneOfType([T.string, T.number]),
|
|
2311
|
+
showLabels: T.bool,
|
|
2312
|
+
showValue: T.bool,
|
|
2313
|
+
usePercentageRange: T.bool,
|
|
2314
|
+
usePercentageValue: T.bool,
|
|
2315
|
+
backgroundColor: T.string,
|
|
2316
|
+
fillColor: T.string,
|
|
2317
|
+
ranges: T.arrayOf(T.shape({
|
|
2318
|
+
from: T.number.isRequired,
|
|
2319
|
+
to: T.number.isRequired,
|
|
2320
|
+
value: T.string.isRequired
|
|
2321
|
+
})),
|
|
2322
|
+
majorTickFillColor: T.string,
|
|
2323
|
+
majorTickStrokeColor: T.string,
|
|
2324
|
+
valueMarkerFillColor: T.string,
|
|
2325
|
+
valueMarkerLabelFillColor: T.string
|
|
2326
|
+
};
|
|
2327
|
+
MarkerGauge.defaultProps = {
|
|
2328
|
+
width: '100%',
|
|
2329
|
+
height: 250,
|
|
2330
|
+
orientation: 'vertical',
|
|
2331
|
+
majorUnit: 'auto',
|
|
2332
|
+
showLabels: true,
|
|
2333
|
+
showValue: true,
|
|
2334
|
+
usePercentageRange: false,
|
|
2335
|
+
usePercentageValue: false,
|
|
2336
|
+
backgroundColor: 'transparent',
|
|
2337
|
+
value: 0,
|
|
2338
|
+
fillColor: '#f2f4f5',
|
|
2339
|
+
majorTickFillColor: '#3c444d',
|
|
2340
|
+
majorTickStrokeColor: '#6b7785',
|
|
2341
|
+
valueMarkerFillColor: '#3c444d',
|
|
2342
|
+
valueMarkerLabelFillColor: '#f2f4f5',
|
|
2343
|
+
ranges: [{
|
|
2344
|
+
from: 0,
|
|
2345
|
+
to: 50,
|
|
2346
|
+
value: '#4BEBA8'
|
|
2347
|
+
}, {
|
|
2348
|
+
from: 50,
|
|
2349
|
+
to: 90,
|
|
2350
|
+
value: '#F4DF7A'
|
|
2351
|
+
}, {
|
|
2352
|
+
from: 90,
|
|
2353
|
+
to: 100,
|
|
2354
|
+
value: '#CB3B43'
|
|
2355
|
+
}]
|
|
2356
|
+
};
|
|
2357
|
+
exports.default = MarkerGauge;
|
|
2352
2358
|
|
|
2353
2359
|
/***/ }),
|
|
2354
2360
|
|
|
2355
|
-
/***/
|
|
2361
|
+
/***/ 401:
|
|
2356
2362
|
/***/ (function(module, exports) {
|
|
2357
2363
|
|
|
2358
|
-
module.exports = require("@splunk/
|
|
2364
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
2359
2365
|
|
|
2360
2366
|
/***/ }),
|
|
2361
2367
|
|
|
2362
|
-
/***/
|
|
2368
|
+
/***/ 402:
|
|
2363
2369
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2364
2370
|
|
|
2365
2371
|
"use strict";
|
|
2366
2372
|
|
|
2367
2373
|
|
|
2368
|
-
var _classCallCheck = __webpack_require__(10);
|
|
2369
|
-
|
|
2370
2374
|
Object.defineProperty(exports, "__esModule", {
|
|
2371
2375
|
value: true
|
|
2372
2376
|
});
|
|
2373
|
-
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
2374
|
-
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
2375
|
-
|
|
2376
|
-
var T = __webpack_require__(0);
|
|
2377
|
-
|
|
2378
|
-
var lodash_1 = __webpack_require__(3);
|
|
2379
|
-
|
|
2380
|
-
var VizActionHandler_1 = __webpack_require__(37); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
exports.INITIAL_WIDTH = 250;
|
|
2384
|
-
exports.INITIAL_HEIGHT = 250;
|
|
2385
|
-
/**
|
|
2386
|
-
* A Splunk visualization
|
|
2387
|
-
*/
|
|
2388
|
-
|
|
2389
|
-
var SplunkVisualization = function SplunkVisualization() {
|
|
2390
|
-
_classCallCheck(this, SplunkVisualization);
|
|
2391
|
-
};
|
|
2392
|
-
|
|
2393
|
-
SplunkVisualization.propTypes = {
|
|
2394
|
-
/**
|
|
2395
|
-
* display mode
|
|
2396
|
-
*/
|
|
2397
|
-
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
2398
|
-
|
|
2399
|
-
/**
|
|
2400
|
-
* width in pixel or string, defaults to 100%
|
|
2401
|
-
*/
|
|
2402
|
-
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
2403
|
-
|
|
2404
|
-
/**
|
|
2405
|
-
* height in pixel or string
|
|
2406
|
-
*/
|
|
2407
|
-
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
2408
2377
|
|
|
2409
|
-
|
|
2410
|
-
* visualization context used for dynamic option evaluation
|
|
2411
|
-
*/
|
|
2412
|
-
context: T.object,
|
|
2378
|
+
var i18n_1 = __webpack_require__(2);
|
|
2413
2379
|
|
|
2414
|
-
|
|
2415
|
-
* visualization formatting options
|
|
2416
|
-
*/
|
|
2417
|
-
options: T.object,
|
|
2380
|
+
var GaugeMarker_1 = __webpack_require__(403);
|
|
2418
2381
|
|
|
2419
|
-
|
|
2420
|
-
* A callback to update formatting options
|
|
2421
|
-
*/
|
|
2422
|
-
onOptionsChange: T.func,
|
|
2382
|
+
var placeholders_1 = __webpack_require__(44);
|
|
2423
2383
|
|
|
2424
|
-
|
|
2425
|
-
* datasource state which include data and request params, object key indicate the datasource type.
|
|
2426
|
-
*/
|
|
2427
|
-
dataSources: T.objectOf(T.shape({
|
|
2428
|
-
/**
|
|
2429
|
-
* current request params
|
|
2430
|
-
*/
|
|
2431
|
-
requestParams: T.object,
|
|
2384
|
+
var schemaUtils_1 = __webpack_require__(16);
|
|
2432
2385
|
|
|
2433
|
-
|
|
2434
|
-
* current dataset
|
|
2435
|
-
*/
|
|
2436
|
-
data: T.shape({
|
|
2437
|
-
fields: T.array,
|
|
2438
|
-
columns: T.array
|
|
2439
|
-
}),
|
|
2386
|
+
var variables_1 = __webpack_require__(9);
|
|
2440
2387
|
|
|
2441
|
-
|
|
2442
|
-
* error
|
|
2443
|
-
*/
|
|
2444
|
-
error: T.shape({
|
|
2445
|
-
level: T.string,
|
|
2446
|
-
message: T.string
|
|
2447
|
-
}),
|
|
2388
|
+
var pick_1 = __webpack_require__(21);
|
|
2448
2389
|
|
|
2449
|
-
|
|
2450
|
-
* meta data that came with the dataset
|
|
2451
|
-
*/
|
|
2452
|
-
meta: T.object
|
|
2453
|
-
})),
|
|
2390
|
+
var Gauge_1 = __webpack_require__(110);
|
|
2454
2391
|
|
|
2455
|
-
|
|
2456
|
-
* A callback to trigger event
|
|
2457
|
-
*/
|
|
2458
|
-
onEventTrigger: T.func,
|
|
2392
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
2459
2393
|
|
|
2460
|
-
|
|
2461
|
-
* Inform viz if there are handlers listening to events
|
|
2462
|
-
*/
|
|
2463
|
-
hasEventHandlers: T.bool,
|
|
2394
|
+
var VizCategory_1 = __webpack_require__(31);
|
|
2464
2395
|
|
|
2465
|
-
|
|
2466
|
-
* A callback to communicate computed props to a consumer
|
|
2467
|
-
*/
|
|
2468
|
-
onComputedProps: T.func,
|
|
2396
|
+
var configUtils_1 = __webpack_require__(17);
|
|
2469
2397
|
|
|
2470
|
-
|
|
2471
|
-
* A callback to obtain visualization api
|
|
2472
|
-
*/
|
|
2473
|
-
vizActionHandlerRef: T.func,
|
|
2474
|
-
loading: T.bool,
|
|
2475
|
-
theme: T.object,
|
|
2398
|
+
var BackgroundColor_1 = __webpack_require__(50);
|
|
2476
2399
|
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2400
|
+
var dataContract = {
|
|
2401
|
+
requiredDataSources: [{
|
|
2402
|
+
name: 'primary',
|
|
2403
|
+
description: 'DataSource that powers the visualization'
|
|
2404
|
+
}],
|
|
2405
|
+
optionalDataSources: [],
|
|
2406
|
+
initialRequestParams: {
|
|
2407
|
+
primary: {
|
|
2408
|
+
offset: 0,
|
|
2409
|
+
count: 10000
|
|
2410
|
+
}
|
|
2411
|
+
}
|
|
2481
2412
|
};
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2413
|
+
var size = {
|
|
2414
|
+
initialWidth: 300,
|
|
2415
|
+
initialHeight: 300
|
|
2416
|
+
};
|
|
2417
|
+
var defaultContext = {};
|
|
2418
|
+
var optionsSchema = {
|
|
2419
|
+
backgroundColor: {
|
|
2420
|
+
description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
|
|
2421
|
+
type: 'string',
|
|
2422
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
|
|
2423
|
+
default: '> themes.defaultBackgroundColor'
|
|
2493
2424
|
},
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2425
|
+
gaugeRanges: {
|
|
2426
|
+
description: 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{"from": 0, "to": 20, "value": "#4BEBA8"}, {"from": 20, "to": 50, "value": "#F4DF7A"}].',
|
|
2427
|
+
default: [{
|
|
2428
|
+
from: 0,
|
|
2429
|
+
to: 50,
|
|
2430
|
+
value: '#118832'
|
|
2431
|
+
}, {
|
|
2432
|
+
from: 50,
|
|
2433
|
+
to: 90,
|
|
2434
|
+
value: '#CBA700'
|
|
2435
|
+
}, {
|
|
2436
|
+
from: 90,
|
|
2437
|
+
to: 100,
|
|
2438
|
+
value: '#D41F1F'
|
|
2439
|
+
}],
|
|
2440
|
+
type: 'array',
|
|
2441
|
+
items: {
|
|
2442
|
+
type: 'object',
|
|
2443
|
+
properties: {
|
|
2444
|
+
from: {
|
|
2445
|
+
type: 'number',
|
|
2446
|
+
description: 'Starting value for range.'
|
|
2447
|
+
},
|
|
2448
|
+
to: {
|
|
2449
|
+
type: 'number',
|
|
2450
|
+
description: 'Ending value for range.'
|
|
2451
|
+
},
|
|
2452
|
+
value: {
|
|
2453
|
+
description: 'Color for sub range.',
|
|
2454
|
+
type: 'string',
|
|
2455
|
+
pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA
|
|
2456
|
+
}
|
|
2457
|
+
},
|
|
2458
|
+
required: ['from', 'to', 'value'],
|
|
2459
|
+
additionalProperties: false
|
|
2460
|
+
}
|
|
2461
|
+
},
|
|
2462
|
+
labelDisplay: {
|
|
2463
|
+
description: 'Specify whether to display the labels as numbers, percentages, or off.',
|
|
2464
|
+
default: 'number',
|
|
2465
|
+
type: 'string',
|
|
2466
|
+
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
2500
2467
|
},
|
|
2501
|
-
|
|
2502
|
-
|
|
2468
|
+
majorTickInterval: {
|
|
2469
|
+
description: 'Specify, in pixels, the spacing between major tick marks.',
|
|
2470
|
+
default: 'auto',
|
|
2471
|
+
type: ['string', 'number']
|
|
2503
2472
|
},
|
|
2504
|
-
|
|
2505
|
-
|
|
2473
|
+
orientation: {
|
|
2474
|
+
description: 'Specify the axis orientation of the gauge.',
|
|
2475
|
+
default: 'vertical',
|
|
2476
|
+
type: 'string',
|
|
2477
|
+
pattern: schemaUtils_1.getPattern(['horizontal', 'vertical'])
|
|
2506
2478
|
},
|
|
2507
|
-
|
|
2508
|
-
|
|
2479
|
+
value: {
|
|
2480
|
+
description: 'Specify the dataSource applied to the value of the marker gauge.',
|
|
2481
|
+
type: 'string',
|
|
2482
|
+
default: '> primary | seriesByType("number") | lastPoint()'
|
|
2483
|
+
},
|
|
2484
|
+
valueDisplay: {
|
|
2485
|
+
description: 'Specify whether to display the value as a number, percentage, or off.',
|
|
2486
|
+
default: 'number',
|
|
2487
|
+
type: 'string',
|
|
2488
|
+
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
2489
|
+
}
|
|
2509
2490
|
};
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2491
|
+
var themes = {
|
|
2492
|
+
defaultFillColor: function defaultFillColor(props) {
|
|
2493
|
+
return pick_1.default({
|
|
2494
|
+
enterprise: variables_1.default.backgroundColorHover(props),
|
|
2495
|
+
prisma: variables_1.default.neutral100(props)
|
|
2496
|
+
})(props);
|
|
2497
|
+
},
|
|
2498
|
+
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
2499
|
+
return pick_1.default({
|
|
2500
|
+
enterprise: {
|
|
2501
|
+
dark: variables_1.default.black(props),
|
|
2502
|
+
light: variables_1.default.backgroundColor(props)
|
|
2503
|
+
},
|
|
2504
|
+
prisma: variables_1.default.backgroundColorSidebar(props)
|
|
2505
|
+
})(props);
|
|
2506
|
+
},
|
|
2507
|
+
majorTickFillColor: function majorTickFillColor(props) {
|
|
2508
|
+
return pick_1.default({
|
|
2509
|
+
enterprise: {
|
|
2510
|
+
light: variables_1.default.gray30(props),
|
|
2511
|
+
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
2523
2512
|
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2513
|
+
},
|
|
2514
|
+
prisma: {
|
|
2515
|
+
// TODO: missed colors :(
|
|
2516
|
+
light: variables_1.default.neutral100(props),
|
|
2517
|
+
dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
|
|
2528
2518
|
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2519
|
+
}
|
|
2520
|
+
})(props);
|
|
2521
|
+
},
|
|
2522
|
+
majorTickStrokeColor: function majorTickStrokeColor(props) {
|
|
2523
|
+
return pick_1.default({
|
|
2524
|
+
enterprise: {
|
|
2525
|
+
light: variables_1.default.textGray(props),
|
|
2526
|
+
dark: variables_1.default.contentColorMuted(props)
|
|
2527
|
+
},
|
|
2528
|
+
prisma: variables_1.default.contentColorMuted(props)
|
|
2529
|
+
})(props);
|
|
2530
|
+
},
|
|
2531
|
+
valueMarkerFillColor: function valueMarkerFillColor(props) {
|
|
2532
|
+
return pick_1.default({
|
|
2533
|
+
enterprise: variables_1.default.textColor(props),
|
|
2534
|
+
prisma: {
|
|
2535
|
+
dark: variables_1.default.white(props),
|
|
2536
|
+
light: variables_1.default.black(props)
|
|
2537
|
+
}
|
|
2538
|
+
})(props);
|
|
2539
|
+
},
|
|
2540
|
+
valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
|
|
2541
|
+
return pick_1.default({
|
|
2542
|
+
enterprise: {
|
|
2543
|
+
light: variables_1.default.gray96(props),
|
|
2544
|
+
dark: variables_1.default.black(props)
|
|
2545
|
+
},
|
|
2546
|
+
prisma: variables_1.default.black(props)
|
|
2547
|
+
})(props);
|
|
2532
2548
|
}
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2549
|
+
};
|
|
2550
|
+
var editorConfig = [{
|
|
2551
|
+
label: i18n_1._('Select Data Field'),
|
|
2552
|
+
layout: [[{
|
|
2553
|
+
label: i18n_1._('Data field'),
|
|
2554
|
+
editor: 'editor.columnSelector',
|
|
2555
|
+
option: 'value',
|
|
2556
|
+
context: 'defaultContext',
|
|
2557
|
+
editorProps: {
|
|
2558
|
+
dataSourceKey: 'primary',
|
|
2559
|
+
prepareValue: function prepareValue(definition) {
|
|
2560
|
+
var value = definition.options.value;
|
|
2561
|
+
return {
|
|
2562
|
+
context: {},
|
|
2563
|
+
options: {
|
|
2564
|
+
value: "".concat(value, " | lastPoint()")
|
|
2565
|
+
}
|
|
2566
|
+
};
|
|
2567
|
+
}
|
|
2542
2568
|
}
|
|
2543
|
-
}]
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2549
|
-
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
2554
|
-
|
|
2555
|
-
"use strict";
|
|
2556
|
-
|
|
2557
|
-
|
|
2558
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2559
|
-
value: true
|
|
2560
|
-
});
|
|
2561
|
-
exports.validSortDirs = void 0;
|
|
2562
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
2563
|
-
|
|
2564
|
-
/***/ }),
|
|
2565
|
-
|
|
2566
|
-
/***/ 39:
|
|
2567
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
2568
|
-
|
|
2569
|
-
"use strict";
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2573
|
-
value: true
|
|
2574
|
-
});
|
|
2575
|
-
exports.useDeepMemo = void 0;
|
|
2576
|
-
|
|
2577
|
-
var react_1 = __webpack_require__(1);
|
|
2569
|
+
}]]
|
|
2570
|
+
}, Gauge_1.default, {
|
|
2571
|
+
label: i18n_1._('Coloring'),
|
|
2572
|
+
layout: [[{
|
|
2573
|
+
label: i18n_1._('Gauge Ranges'),
|
|
2574
|
+
option: 'gaugeRanges',
|
|
2575
|
+
editor: 'editor.threshold',
|
|
2576
|
+
editorProps: {
|
|
2577
|
+
openRanges: false,
|
|
2578
|
+
isTogglable: false // Can not disable thresholds
|
|
2578
2579
|
|
|
2579
|
-
|
|
2580
|
+
}
|
|
2581
|
+
}], BackgroundColor_1.default({
|
|
2582
|
+
themes: themes,
|
|
2583
|
+
labelPosition: 'top'
|
|
2584
|
+
})]
|
|
2585
|
+
}];
|
|
2580
2586
|
/**
|
|
2581
|
-
*
|
|
2582
|
-
* re-evaluates the function when passed dependencies change.
|
|
2583
|
-
*
|
|
2584
|
-
* It is different from the internal React useMemo in the following aspects:
|
|
2585
|
-
* - it only stores the last evaluated result
|
|
2586
|
-
* - it uses a deep equality check to determine if dependencies have changed
|
|
2587
|
-
*
|
|
2588
|
-
* Inspired by apollo-client's useDeepMemo
|
|
2589
|
-
*
|
|
2590
|
-
* @param fn the function to be executed and
|
|
2591
|
-
* @param dependencies an array of dependencies
|
|
2587
|
+
* visualization configuration
|
|
2592
2588
|
*/
|
|
2593
2589
|
|
|
2590
|
+
var config = {
|
|
2591
|
+
/**
|
|
2592
|
+
* unique viz key
|
|
2593
|
+
*/
|
|
2594
|
+
key: 'splunk.markergauge',
|
|
2594
2595
|
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
dependencies: dependencies,
|
|
2601
|
-
value: fn()
|
|
2602
|
-
};
|
|
2603
|
-
}
|
|
2596
|
+
/**
|
|
2597
|
+
* viz name
|
|
2598
|
+
*/
|
|
2599
|
+
name: 'MarkerGauge',
|
|
2600
|
+
category: VizCategory_1.VizCategory.GAUGE,
|
|
2604
2601
|
|
|
2605
|
-
|
|
2602
|
+
/**
|
|
2603
|
+
* viz icon
|
|
2604
|
+
*/
|
|
2605
|
+
icon: GaugeMarker_1.default,
|
|
2606
|
+
placeholderIcon: placeholders_1.MarkerGauge,
|
|
2607
|
+
dataContract: dataContract,
|
|
2608
|
+
size: size,
|
|
2609
|
+
defaultContext: defaultContext,
|
|
2610
|
+
optionsSchema: optionsSchema,
|
|
2611
|
+
editorConfig: editorConfig,
|
|
2612
|
+
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
|
|
2613
|
+
themes: themes
|
|
2606
2614
|
};
|
|
2607
|
-
|
|
2608
|
-
exports.useDeepMemo = useDeepMemo;
|
|
2615
|
+
exports.default = configUtils_1.enhanceConfig(config);
|
|
2609
2616
|
|
|
2610
2617
|
/***/ }),
|
|
2611
2618
|
|
|
2612
|
-
/***/
|
|
2619
|
+
/***/ 403:
|
|
2613
2620
|
/***/ (function(module, exports) {
|
|
2614
2621
|
|
|
2615
|
-
module.exports = require("
|
|
2622
|
+
module.exports = require("@splunk/react-icons/GaugeMarker");
|
|
2616
2623
|
|
|
2617
2624
|
/***/ }),
|
|
2618
2625
|
|
|
2619
|
-
/***/
|
|
2626
|
+
/***/ 41:
|
|
2620
2627
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2621
2628
|
|
|
2622
2629
|
"use strict";
|
|
@@ -2633,9 +2640,9 @@ var T = __webpack_require__(0);
|
|
|
2633
2640
|
|
|
2634
2641
|
var i18n_1 = __webpack_require__(2);
|
|
2635
2642
|
|
|
2636
|
-
var Message_1 = __webpack_require__(
|
|
2643
|
+
var Message_1 = __webpack_require__(10);
|
|
2637
2644
|
|
|
2638
|
-
var FixedSizeContainer_1 = __webpack_require__(
|
|
2645
|
+
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
2639
2646
|
/**
|
|
2640
2647
|
* @method isMissing
|
|
2641
2648
|
* @param {any} v
|
|
@@ -2697,7 +2704,7 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
|
2697
2704
|
|
|
2698
2705
|
/***/ }),
|
|
2699
2706
|
|
|
2700
|
-
/***/
|
|
2707
|
+
/***/ 42:
|
|
2701
2708
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2702
2709
|
|
|
2703
2710
|
"use strict";
|
|
@@ -2711,14 +2718,14 @@ var React = __webpack_require__(1);
|
|
|
2711
2718
|
|
|
2712
2719
|
var styled_components_1 = __webpack_require__(4);
|
|
2713
2720
|
|
|
2714
|
-
var hocUtils_1 = __webpack_require__(
|
|
2721
|
+
var hocUtils_1 = __webpack_require__(14);
|
|
2715
2722
|
|
|
2716
2723
|
var Cover = styled_components_1.default.div.withConfig({
|
|
2717
2724
|
displayName: "withEditModeCover__Cover",
|
|
2718
2725
|
componentId: "sc-1gsbnxb-0"
|
|
2719
2726
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
2720
2727
|
var Blocker = styled_components_1.default.div.attrs({
|
|
2721
|
-
'data-splunk-visualization-version': "25.
|
|
2728
|
+
'data-splunk-visualization-version': "25.2.0 - 4373c5a66"
|
|
2722
2729
|
}).withConfig({
|
|
2723
2730
|
displayName: "withEditModeCover__Blocker",
|
|
2724
2731
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -2750,7 +2757,7 @@ exports.default = withEditModeCover;
|
|
|
2750
2757
|
|
|
2751
2758
|
/***/ }),
|
|
2752
2759
|
|
|
2753
|
-
/***/
|
|
2760
|
+
/***/ 43:
|
|
2754
2761
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2755
2762
|
|
|
2756
2763
|
"use strict";
|
|
@@ -2762,15 +2769,15 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2762
2769
|
|
|
2763
2770
|
var React = __webpack_require__(1);
|
|
2764
2771
|
|
|
2765
|
-
var colorUtils_1 = __webpack_require__(
|
|
2772
|
+
var colorUtils_1 = __webpack_require__(12);
|
|
2766
2773
|
|
|
2767
|
-
var variables_1 = __webpack_require__(
|
|
2774
|
+
var variables_1 = __webpack_require__(9);
|
|
2768
2775
|
|
|
2769
2776
|
var IconPlaceholder_1 = __webpack_require__(27);
|
|
2770
2777
|
|
|
2771
|
-
var VizBehavior_1 = __webpack_require__(
|
|
2778
|
+
var VizBehavior_1 = __webpack_require__(6);
|
|
2772
2779
|
|
|
2773
|
-
var hocUtils_1 = __webpack_require__(
|
|
2780
|
+
var hocUtils_1 = __webpack_require__(14);
|
|
2774
2781
|
|
|
2775
2782
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
2776
2783
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
@@ -2815,28 +2822,28 @@ exports.default = withPlaceholder;
|
|
|
2815
2822
|
|
|
2816
2823
|
/***/ }),
|
|
2817
2824
|
|
|
2818
|
-
/***/
|
|
2825
|
+
/***/ 44:
|
|
2819
2826
|
/***/ (function(module, exports) {
|
|
2820
2827
|
|
|
2821
|
-
module.exports = require("@splunk/
|
|
2828
|
+
module.exports = require("@splunk/visualization-icons/placeholders");
|
|
2822
2829
|
|
|
2823
2830
|
/***/ }),
|
|
2824
2831
|
|
|
2825
2832
|
/***/ 45:
|
|
2826
2833
|
/***/ (function(module, exports) {
|
|
2827
2834
|
|
|
2828
|
-
module.exports = require("@splunk/
|
|
2835
|
+
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
2829
2836
|
|
|
2830
2837
|
/***/ }),
|
|
2831
2838
|
|
|
2832
|
-
/***/
|
|
2839
|
+
/***/ 48:
|
|
2833
2840
|
/***/ (function(module, exports) {
|
|
2834
2841
|
|
|
2835
2842
|
module.exports = require("@babel/runtime/helpers/extends");
|
|
2836
2843
|
|
|
2837
2844
|
/***/ }),
|
|
2838
2845
|
|
|
2839
|
-
/***/
|
|
2846
|
+
/***/ 50:
|
|
2840
2847
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2841
2848
|
|
|
2842
2849
|
"use strict";
|
|
@@ -2867,7 +2874,7 @@ exports.default = background;
|
|
|
2867
2874
|
|
|
2868
2875
|
/***/ }),
|
|
2869
2876
|
|
|
2870
|
-
/***/
|
|
2877
|
+
/***/ 6:
|
|
2871
2878
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2872
2879
|
|
|
2873
2880
|
"use strict";
|
|
@@ -2905,34 +2912,27 @@ var VizBehavior;
|
|
|
2905
2912
|
|
|
2906
2913
|
/***/ }),
|
|
2907
2914
|
|
|
2908
|
-
/***/ 6:
|
|
2909
|
-
/***/ (function(module, exports) {
|
|
2910
|
-
|
|
2911
|
-
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
2912
|
-
|
|
2913
|
-
/***/ }),
|
|
2914
|
-
|
|
2915
2915
|
/***/ 7:
|
|
2916
2916
|
/***/ (function(module, exports) {
|
|
2917
2917
|
|
|
2918
|
-
module.exports = require("@babel/runtime/helpers/
|
|
2918
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
2919
2919
|
|
|
2920
2920
|
/***/ }),
|
|
2921
2921
|
|
|
2922
2922
|
/***/ 8:
|
|
2923
2923
|
/***/ (function(module, exports) {
|
|
2924
2924
|
|
|
2925
|
-
module.exports = require("@
|
|
2925
|
+
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
2926
2926
|
|
|
2927
2927
|
/***/ }),
|
|
2928
2928
|
|
|
2929
|
-
/***/
|
|
2929
|
+
/***/ 84:
|
|
2930
2930
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2931
2931
|
|
|
2932
2932
|
"use strict";
|
|
2933
2933
|
|
|
2934
2934
|
|
|
2935
|
-
var _toConsumableArray = __webpack_require__(
|
|
2935
|
+
var _toConsumableArray = __webpack_require__(8);
|
|
2936
2936
|
|
|
2937
2937
|
Object.defineProperty(exports, "__esModule", {
|
|
2938
2938
|
value: true
|
|
@@ -2941,7 +2941,7 @@ exports.convertToGaugeProperties = exports.mapValueLabelDisplay = exports.mapToO
|
|
|
2941
2941
|
|
|
2942
2942
|
var lodash_1 = __webpack_require__(3);
|
|
2943
2943
|
|
|
2944
|
-
var colorConstants_1 = __webpack_require__(
|
|
2944
|
+
var colorConstants_1 = __webpack_require__(45);
|
|
2945
2945
|
|
|
2946
2946
|
var i18n_1 = __webpack_require__(2);
|
|
2947
2947
|
|
|
@@ -3698,7 +3698,7 @@ exports.convertToGaugeProperties = convertToGaugeProperties;
|
|
|
3698
3698
|
/***/ 9:
|
|
3699
3699
|
/***/ (function(module, exports) {
|
|
3700
3700
|
|
|
3701
|
-
module.exports = require("@splunk/
|
|
3701
|
+
module.exports = require("@splunk/themes/variables");
|
|
3702
3702
|
|
|
3703
3703
|
/***/ })
|
|
3704
3704
|
|