@splunk/visualizations 25.13.1 → 26.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +216 -216
- package/Area.config.js.map +1 -1
- package/Area.js +529 -561
- package/Area.js.map +1 -1
- package/Bar.config.js +213 -213
- package/Bar.config.js.map +1 -1
- package/Bar.js +394 -386
- package/Bar.js.map +1 -1
- package/Bubble.config.js +140 -140
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +313 -305
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +15 -15
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +149 -144
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +205 -205
- package/Column.config.js.map +1 -1
- package/Column.js +387 -379
- package/Column.js.map +1 -1
- package/Ellipse.config.js +45 -45
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +157 -144
- package/Ellipse.js.map +1 -1
- package/Events.config.js +11 -11
- package/Events.config.js.map +1 -1
- package/Events.js +273 -261
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +46 -46
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +267 -262
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +8 -8
- package/Image.config.js.map +1 -1
- package/Image.js +110 -104
- package/Image.js.map +1 -1
- package/Line.config.js +220 -220
- package/Line.config.js.map +1 -1
- package/Line.js +404 -396
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +27 -27
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +557 -548
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +71 -71
- package/Map.config.js.map +1 -1
- package/Map.js +471 -465
- package/Map.js.map +1 -1
- package/Markdown.config.js +23 -23
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +151 -145
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +84 -84
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +295 -289
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +23 -23
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +164 -162
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +24 -24
- package/Pie.config.js.map +1 -1
- package/Pie.js +233 -228
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +33 -33
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +278 -279
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +46 -46
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +154 -142
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +19 -19
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +281 -275
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +135 -135
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +304 -299
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +119 -119
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +359 -341
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +14 -14
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +117 -117
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +373 -371
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +157 -115
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1114 -540
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +50 -20
- package/SparkLine.js.map +1 -1
- package/Table.config.js +54 -54
- package/Table.config.js.map +1 -1
- package/Table.js +302 -286
- package/Table.js.map +1 -1
- package/common/Charting.js +41 -41
- package/common/Charting.js.map +1 -1
- package/common/EventsDoc.js +15 -14
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +2 -2
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +2 -2
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +22 -22
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +32 -27
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +4 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +2 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +14 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +12 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +4 -4
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +112 -112
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +21 -15
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +10 -9
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +2 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +2 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +2 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +84 -80
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +2 -2
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +27 -9
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +26 -26
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +107 -104
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +19 -19
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 = 427);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -127,7 +127,7 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
127
127
|
|
|
128
128
|
/***/ }),
|
|
129
129
|
|
|
130
|
-
/***/
|
|
130
|
+
/***/ 126:
|
|
131
131
|
/***/ (function(module, exports, __webpack_require__) {
|
|
132
132
|
|
|
133
133
|
"use strict";
|
|
@@ -138,49 +138,49 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
138
138
|
});
|
|
139
139
|
var i18n_1 = __webpack_require__(2);
|
|
140
140
|
var gauge = {
|
|
141
|
-
label: i18n_1._('Data display'),
|
|
141
|
+
label: (0, i18n_1._)('Data display'),
|
|
142
142
|
layout: [[{
|
|
143
|
-
label: i18n_1._('Value display'),
|
|
143
|
+
label: (0, i18n_1._)('Value display'),
|
|
144
144
|
option: 'valueDisplay',
|
|
145
145
|
editor: 'editor.radioBar',
|
|
146
146
|
editorProps: {
|
|
147
147
|
values: [{
|
|
148
|
-
label: i18n_1._('Number'),
|
|
148
|
+
label: (0, i18n_1._)('Number'),
|
|
149
149
|
value: 'number'
|
|
150
150
|
}, {
|
|
151
|
-
label: i18n_1._('Percentage'),
|
|
151
|
+
label: (0, i18n_1._)('Percentage'),
|
|
152
152
|
value: 'percentage'
|
|
153
153
|
}, {
|
|
154
|
-
label: i18n_1._('Off'),
|
|
154
|
+
label: (0, i18n_1._)('Off'),
|
|
155
155
|
value: 'off'
|
|
156
156
|
}]
|
|
157
157
|
}
|
|
158
158
|
}], [{
|
|
159
|
-
label: i18n_1._('Label display'),
|
|
159
|
+
label: (0, i18n_1._)('Label display'),
|
|
160
160
|
option: 'labelDisplay',
|
|
161
161
|
editor: 'editor.radioBar',
|
|
162
162
|
editorProps: {
|
|
163
163
|
values: [{
|
|
164
|
-
label: i18n_1._('Numbers'),
|
|
164
|
+
label: (0, i18n_1._)('Numbers'),
|
|
165
165
|
value: 'number'
|
|
166
166
|
}, {
|
|
167
|
-
label: i18n_1._('Percentages'),
|
|
167
|
+
label: (0, i18n_1._)('Percentages'),
|
|
168
168
|
value: 'percentage'
|
|
169
169
|
}, {
|
|
170
|
-
label: i18n_1._('Off'),
|
|
170
|
+
label: (0, i18n_1._)('Off'),
|
|
171
171
|
value: 'off'
|
|
172
172
|
}]
|
|
173
173
|
}
|
|
174
174
|
}], [{
|
|
175
|
-
label: i18n_1._('Orientation'),
|
|
175
|
+
label: (0, i18n_1._)('Orientation'),
|
|
176
176
|
option: 'orientation',
|
|
177
177
|
editor: 'editor.radioBar',
|
|
178
178
|
editorProps: {
|
|
179
179
|
values: [{
|
|
180
|
-
label: i18n_1._('Vertical'),
|
|
180
|
+
label: (0, i18n_1._)('Vertical'),
|
|
181
181
|
value: 'vertical'
|
|
182
182
|
}, {
|
|
183
|
-
label: i18n_1._('Horizontal'),
|
|
183
|
+
label: (0, i18n_1._)('Horizontal'),
|
|
184
184
|
value: 'horizontal'
|
|
185
185
|
}]
|
|
186
186
|
}
|
|
@@ -190,7 +190,7 @@ exports.default = gauge;
|
|
|
190
190
|
|
|
191
191
|
/***/ }),
|
|
192
192
|
|
|
193
|
-
/***/
|
|
193
|
+
/***/ 127:
|
|
194
194
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
195
195
|
|
|
196
196
|
"use strict";
|
|
@@ -205,7 +205,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205
205
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
206
206
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
207
207
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
208
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
208
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
|
|
209
209
|
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
210
210
|
|
|
211
211
|
|
|
@@ -435,7 +435,7 @@ MajorTicks.defaultProps = {
|
|
|
435
435
|
|
|
436
436
|
/***/ }),
|
|
437
437
|
|
|
438
|
-
/***/
|
|
438
|
+
/***/ 128:
|
|
439
439
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
440
440
|
|
|
441
441
|
"use strict";
|
|
@@ -450,7 +450,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
450
450
|
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
451
451
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
452
452
|
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
453
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(
|
|
453
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(31);
|
|
454
454
|
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
455
455
|
|
|
456
456
|
|
|
@@ -656,14 +656,14 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
656
656
|
var width = _ref.width;
|
|
657
657
|
return {
|
|
658
658
|
style: {
|
|
659
|
-
width: style_1.toPx(width)
|
|
659
|
+
width: (0, style_1.toPx)(width)
|
|
660
660
|
}
|
|
661
661
|
};
|
|
662
662
|
}).withConfig({
|
|
663
663
|
displayName: "FixedSizeContainer__Item",
|
|
664
664
|
componentId: "sc-1yhgpod-0"
|
|
665
665
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
666
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
666
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
667
667
|
});
|
|
668
668
|
// Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
669
669
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
@@ -671,16 +671,16 @@ var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
|
671
671
|
height = _ref2.height;
|
|
672
672
|
return {
|
|
673
673
|
style: Object.assign(Object.assign({}, width && {
|
|
674
|
-
width: style_1.toPx(width)
|
|
674
|
+
width: (0, style_1.toPx)(width)
|
|
675
675
|
}), height && {
|
|
676
|
-
height: style_1.toPx(height)
|
|
676
|
+
height: (0, style_1.toPx)(height)
|
|
677
677
|
})
|
|
678
678
|
};
|
|
679
679
|
}).withConfig({
|
|
680
680
|
displayName: "FixedSizeContainer__FixSizeItem",
|
|
681
681
|
componentId: "sc-1yhgpod-1"
|
|
682
682
|
})(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
|
|
683
|
-
return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
683
|
+
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
684
684
|
});
|
|
685
685
|
var ItemContent = styled_components_1.default.div.withConfig({
|
|
686
686
|
displayName: "FixedSizeContainer__ItemContent",
|
|
@@ -704,7 +704,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
704
704
|
}
|
|
705
705
|
return React.createElement(FixSizeItem, {
|
|
706
706
|
"data-test": "fix-size-item",
|
|
707
|
-
"data-splunk-visualization-version": "
|
|
707
|
+
"data-splunk-visualization-version": "26.0.0 - 2f7458907",
|
|
708
708
|
width: width,
|
|
709
709
|
height: height,
|
|
710
710
|
backgroundColor: backgroundColor
|
|
@@ -762,7 +762,14 @@ exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
|
762
762
|
|
|
763
763
|
/***/ }),
|
|
764
764
|
|
|
765
|
-
/***/
|
|
765
|
+
/***/ 16:
|
|
766
|
+
/***/ (function(module, exports) {
|
|
767
|
+
|
|
768
|
+
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
769
|
+
|
|
770
|
+
/***/ }),
|
|
771
|
+
|
|
772
|
+
/***/ 162:
|
|
766
773
|
/***/ (function(module, exports, __webpack_require__) {
|
|
767
774
|
|
|
768
775
|
"use strict";
|
|
@@ -783,16 +790,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
783
790
|
});
|
|
784
791
|
exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
|
|
785
792
|
var lodash_1 = __webpack_require__(3);
|
|
786
|
-
var MarkerGauge_1 = __webpack_require__(
|
|
787
|
-
var config_1 = __webpack_require__(
|
|
793
|
+
var MarkerGauge_1 = __webpack_require__(428);
|
|
794
|
+
var config_1 = __webpack_require__(429);
|
|
788
795
|
exports.config = config_1.default;
|
|
789
796
|
var withDashboardViz_1 = __webpack_require__(36);
|
|
790
|
-
var gaugeUtils_1 = __webpack_require__(
|
|
797
|
+
var gaugeUtils_1 = __webpack_require__(98);
|
|
791
798
|
exports.PureMarkerGauge = MarkerGauge_1.default;
|
|
792
799
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
793
800
|
var computeVizProps = function computeVizProps(_a) {
|
|
794
801
|
var props = __rest(_a, []);
|
|
795
|
-
var options = lodash_1.chain(props).pick(validOptions).thru(gaugeUtils_1.convertToGaugeProperties).value();
|
|
802
|
+
var options = (0, lodash_1.chain)(props).pick(validOptions).thru(gaugeUtils_1.convertToGaugeProperties).value();
|
|
796
803
|
var defaultColors = {
|
|
797
804
|
fillColor: config_1.default.themes.defaultFillColor(props),
|
|
798
805
|
majorTickFillColor: config_1.default.themes.majorTickFillColor(props),
|
|
@@ -803,7 +810,7 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
803
810
|
return Object.assign(Object.assign({}, options), defaultColors);
|
|
804
811
|
};
|
|
805
812
|
exports.computeVizProps = computeVizProps;
|
|
806
|
-
var viz = withDashboardViz_1.default({
|
|
813
|
+
var viz = (0, withDashboardViz_1.default)({
|
|
807
814
|
ReactViz: MarkerGauge_1.default,
|
|
808
815
|
computeVizProps: exports.computeVizProps,
|
|
809
816
|
vizConfig: config_1.default
|
|
@@ -812,13 +819,6 @@ exports.default = viz;
|
|
|
812
819
|
|
|
813
820
|
/***/ }),
|
|
814
821
|
|
|
815
|
-
/***/ 16:
|
|
816
|
-
/***/ (function(module, exports) {
|
|
817
|
-
|
|
818
|
-
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
819
|
-
|
|
820
|
-
/***/ }),
|
|
821
|
-
|
|
822
822
|
/***/ 17:
|
|
823
823
|
/***/ (function(module, exports) {
|
|
824
824
|
|
|
@@ -1007,8 +1007,8 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
1007
1007
|
*/
|
|
1008
1008
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
1009
1009
|
return presets.find(function (preset) {
|
|
1010
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
1011
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
1010
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
1011
|
+
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
1012
1012
|
var presetContextKeys = Object.keys(presetContext);
|
|
1013
1013
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
1014
1014
|
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
@@ -1025,7 +1025,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
1025
1025
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
1026
1026
|
*/
|
|
1027
1027
|
function generatePrecisionValues(numPrecisionValues) {
|
|
1028
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
1028
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
1029
1029
|
return {
|
|
1030
1030
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
1031
1031
|
value: i
|
|
@@ -1068,28 +1068,28 @@ module.exports = require("@splunk/themes/pick");
|
|
|
1068
1068
|
/***/ 25:
|
|
1069
1069
|
/***/ (function(module, exports) {
|
|
1070
1070
|
|
|
1071
|
-
module.exports = require("@splunk/
|
|
1071
|
+
module.exports = require("@splunk/ui-utils/id");
|
|
1072
1072
|
|
|
1073
1073
|
/***/ }),
|
|
1074
1074
|
|
|
1075
1075
|
/***/ 26:
|
|
1076
1076
|
/***/ (function(module, exports) {
|
|
1077
1077
|
|
|
1078
|
-
module.exports = require("@splunk/
|
|
1078
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
1079
1079
|
|
|
1080
1080
|
/***/ }),
|
|
1081
1081
|
|
|
1082
1082
|
/***/ 27:
|
|
1083
1083
|
/***/ (function(module, exports) {
|
|
1084
1084
|
|
|
1085
|
-
module.exports = require("@splunk/visualizations-shared/
|
|
1085
|
+
module.exports = require("@splunk/visualizations-shared/hocUtils");
|
|
1086
1086
|
|
|
1087
1087
|
/***/ }),
|
|
1088
1088
|
|
|
1089
|
-
/***/
|
|
1089
|
+
/***/ 28:
|
|
1090
1090
|
/***/ (function(module, exports) {
|
|
1091
1091
|
|
|
1092
|
-
module.exports = require("@splunk/
|
|
1092
|
+
module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
|
|
1093
1093
|
|
|
1094
1094
|
/***/ }),
|
|
1095
1095
|
|
|
@@ -1103,11 +1103,18 @@ module.exports = require("lodash");
|
|
|
1103
1103
|
/***/ 30:
|
|
1104
1104
|
/***/ (function(module, exports) {
|
|
1105
1105
|
|
|
1106
|
-
module.exports = require("@splunk/
|
|
1106
|
+
module.exports = require("@splunk/visualization-encoding/Options");
|
|
1107
1107
|
|
|
1108
1108
|
/***/ }),
|
|
1109
1109
|
|
|
1110
1110
|
/***/ 31:
|
|
1111
|
+
/***/ (function(module, exports) {
|
|
1112
|
+
|
|
1113
|
+
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
1114
|
+
|
|
1115
|
+
/***/ }),
|
|
1116
|
+
|
|
1117
|
+
/***/ 32:
|
|
1111
1118
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1112
1119
|
|
|
1113
1120
|
"use strict";
|
|
@@ -1131,9 +1138,9 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
1131
1138
|
*/
|
|
1132
1139
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1133
1140
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1134
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1141
|
+
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
1135
1142
|
var noData = data === undefined;
|
|
1136
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1143
|
+
var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
|
|
1137
1144
|
var noFields = fields === undefined;
|
|
1138
1145
|
return loading || noData || noFields;
|
|
1139
1146
|
};
|
|
@@ -1174,7 +1181,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
1174
1181
|
width: width,
|
|
1175
1182
|
height: height,
|
|
1176
1183
|
level: "warning",
|
|
1177
|
-
message: i18n_1._('No DataSource Connected')
|
|
1184
|
+
message: (0, i18n_1._)('No DataSource Connected')
|
|
1178
1185
|
});
|
|
1179
1186
|
};
|
|
1180
1187
|
IconPlaceholder.propTypes = propTypes;
|
|
@@ -1182,14 +1189,7 @@ IconPlaceholder.defaultProps = {
|
|
|
1182
1189
|
width: '100%',
|
|
1183
1190
|
height: 250
|
|
1184
1191
|
};
|
|
1185
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1186
|
-
|
|
1187
|
-
/***/ }),
|
|
1188
|
-
|
|
1189
|
-
/***/ 32:
|
|
1190
|
-
/***/ (function(module, exports) {
|
|
1191
|
-
|
|
1192
|
-
module.exports = require("@splunk/ui-utils/id");
|
|
1192
|
+
exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
1193
1193
|
|
|
1194
1194
|
/***/ }),
|
|
1195
1195
|
|
|
@@ -1224,7 +1224,7 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1224
1224
|
};
|
|
1225
1225
|
var onSort;
|
|
1226
1226
|
if (typeof onRequestParamsChange === 'function') {
|
|
1227
|
-
if (requestParams && lodash_1.has(requestParams, 'sort')) {
|
|
1227
|
+
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
1228
1228
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
1229
1229
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
1230
1230
|
}
|
|
@@ -1233,7 +1233,7 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
1233
1233
|
var sortKey = _ref2.sortKey,
|
|
1234
1234
|
sortDir = _ref2.sortDir;
|
|
1235
1235
|
if (typeof sortKey === 'string') {
|
|
1236
|
-
var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1236
|
+
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
1237
1237
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
1238
1238
|
offset: 0,
|
|
1239
1239
|
sort: _defineProperty({}, sortKey, nextSortDir)
|
|
@@ -1284,7 +1284,7 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
1284
1284
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
1285
1285
|
var page = _ref2.page,
|
|
1286
1286
|
countArg = _ref2.count;
|
|
1287
|
-
var newParams = lodash_1.cloneDeep(requestParams);
|
|
1287
|
+
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
1288
1288
|
if (typeof countArg === 'number') {
|
|
1289
1289
|
newParams.count = countArg;
|
|
1290
1290
|
newParams.offset = 0;
|
|
@@ -1348,16 +1348,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1348
1348
|
var React = __webpack_require__(1);
|
|
1349
1349
|
var lodash_1 = __webpack_require__(3);
|
|
1350
1350
|
var getSettingsFromThemedProps_1 = __webpack_require__(37);
|
|
1351
|
-
var Options_1 = __webpack_require__(
|
|
1351
|
+
var Options_1 = __webpack_require__(30);
|
|
1352
1352
|
var SanitizeProps_1 = __webpack_require__(38);
|
|
1353
|
-
var TimezoneContext_1 = __webpack_require__(
|
|
1353
|
+
var TimezoneContext_1 = __webpack_require__(26);
|
|
1354
1354
|
var moment_1 = __webpack_require__(39);
|
|
1355
1355
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
1356
1356
|
var styled_components_1 = __webpack_require__(4);
|
|
1357
|
-
var hocUtils_1 = __webpack_require__(
|
|
1358
|
-
var JSONSchemaUtils_1 = __webpack_require__(
|
|
1357
|
+
var hocUtils_1 = __webpack_require__(27);
|
|
1358
|
+
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
1359
1359
|
var async_dynamic_options_evaluator_1 = __webpack_require__(40);
|
|
1360
|
-
var id_1 = __webpack_require__(
|
|
1360
|
+
var id_1 = __webpack_require__(25);
|
|
1361
1361
|
var SplunkVisualization_1 = __webpack_require__(41);
|
|
1362
1362
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1363
1363
|
var getSorting_1 = __webpack_require__(33);
|
|
@@ -1378,8 +1378,8 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1378
1378
|
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
1379
1379
|
disableEditModeCover = opts.disableEditModeCover,
|
|
1380
1380
|
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
1381
|
-
var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
|
|
1382
|
-
var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
|
|
1381
|
+
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
1382
|
+
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
1383
1383
|
var DashboardViz = function DashboardViz(props) {
|
|
1384
1384
|
var _a;
|
|
1385
1385
|
var mode = props.mode,
|
|
@@ -1414,19 +1414,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1414
1414
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
1415
1415
|
};
|
|
1416
1416
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1417
|
-
var
|
|
1417
|
+
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
1418
1418
|
theme: theme
|
|
1419
1419
|
}),
|
|
1420
|
-
currentThemeFamily =
|
|
1421
|
-
currentThemeColorScheme =
|
|
1422
|
-
currentThemeDensity =
|
|
1420
|
+
currentThemeFamily = _ref.family,
|
|
1421
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1422
|
+
currentThemeDensity = _ref.density;
|
|
1423
1423
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1424
1424
|
var _React$useState = React.useState({}),
|
|
1425
1425
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1426
1426
|
evaluatedOptionsAsync = _React$useState2[0],
|
|
1427
1427
|
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1428
1428
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1429
|
-
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
|
|
1429
|
+
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
1430
1430
|
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1431
1431
|
visualizationID = _React$useState4[0];
|
|
1432
1432
|
var _React$useState5 = React.useState({}),
|
|
@@ -1437,16 +1437,17 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1437
1437
|
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1438
1438
|
dataFramesInState = _React$useState8[0],
|
|
1439
1439
|
setDataFramesInState = _React$useState8[1];
|
|
1440
|
-
var _React$useState9 = React.useState(Boolean(featureFlagContext
|
|
1440
|
+
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
1441
1441
|
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1442
1442
|
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1443
1443
|
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1444
|
-
|
|
1444
|
+
var isMounted = React.useRef(true);
|
|
1445
|
+
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
1445
1446
|
try {
|
|
1446
1447
|
if (useAsyncEvaluatedOptions) {
|
|
1447
1448
|
var optionsToEvaluate = {
|
|
1448
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1449
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1449
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1450
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1450
1451
|
};
|
|
1451
1452
|
var asyncDynamicOptionsEvaluatorParams = {
|
|
1452
1453
|
visualizationID: visualizationID,
|
|
@@ -1457,10 +1458,10 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1457
1458
|
};
|
|
1458
1459
|
async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
|
|
1459
1460
|
setEvaluatedOptionsAsync(results.results);
|
|
1460
|
-
}).catch(function (
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1461
|
+
}).catch(function () {
|
|
1462
|
+
if (isMounted.current) {
|
|
1463
|
+
setUseAsyncEvaluatedOptions(false);
|
|
1464
|
+
}
|
|
1464
1465
|
});
|
|
1465
1466
|
} else {
|
|
1466
1467
|
var dataFrames = dataFramesInState;
|
|
@@ -1470,8 +1471,8 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1470
1471
|
setDataFramesInState(dataFrames);
|
|
1471
1472
|
}
|
|
1472
1473
|
return Options_1.Options.evaluate({
|
|
1473
|
-
context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
|
|
1474
|
-
options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
|
|
1474
|
+
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
1475
|
+
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
1475
1476
|
}, dataSources, themeFunc, dataFrames);
|
|
1476
1477
|
}
|
|
1477
1478
|
} catch (e) {
|
|
@@ -1500,6 +1501,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1500
1501
|
React.useEffect(function () {
|
|
1501
1502
|
return function () {
|
|
1502
1503
|
if (useAsyncEvaluatedOptions) {
|
|
1504
|
+
isMounted.current = false;
|
|
1503
1505
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
1504
1506
|
}
|
|
1505
1507
|
};
|
|
@@ -1509,7 +1511,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1509
1511
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
1510
1512
|
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1511
1513
|
supports = vizConfig.supports;
|
|
1512
|
-
var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
|
|
1514
|
+
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1513
1515
|
if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
|
|
1514
1516
|
) {
|
|
1515
1517
|
return React.createElement(MissingPropsMessage_1.default, {
|
|
@@ -1525,7 +1527,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1525
1527
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1526
1528
|
var supportedEvents = vizConfig.events;
|
|
1527
1529
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1528
|
-
var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
|
|
1530
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1529
1531
|
eventCallbackProps[eventCallbackPropName] = null;
|
|
1530
1532
|
// todo: refactor single value and single value icon to send payload from viz
|
|
1531
1533
|
// then remove these lines
|
|
@@ -1568,19 +1570,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1568
1570
|
*/
|
|
1569
1571
|
var dataSourceMetadata = {};
|
|
1570
1572
|
var OptionKey = 'paginateDataSourceKey';
|
|
1571
|
-
var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1572
|
-
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
|
|
1573
|
-
var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1574
|
-
var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1573
|
+
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1574
|
+
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1575
|
+
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1576
|
+
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1575
1577
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1576
1578
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1577
1579
|
};
|
|
1578
|
-
var sortParams = getSorting_1.getSortingParams({
|
|
1580
|
+
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1579
1581
|
requestParams: requestParams,
|
|
1580
1582
|
meta: meta,
|
|
1581
1583
|
onRequestParamsChange: handleRequestParamsChange
|
|
1582
1584
|
});
|
|
1583
|
-
var paginatorParams = getPagination_1.getPaginationParams({
|
|
1585
|
+
var paginatorParams = (0, getPagination_1.getPaginationParams)({
|
|
1584
1586
|
requestParams: requestParams,
|
|
1585
1587
|
meta: meta,
|
|
1586
1588
|
onRequestParamsChange: handleRequestParamsChange
|
|
@@ -1608,7 +1610,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1608
1610
|
// attach viz config
|
|
1609
1611
|
DashboardViz.config = vizConfig;
|
|
1610
1612
|
// @ts-ignore: TODO fix sc upgrade TS issues
|
|
1611
|
-
return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1613
|
+
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1612
1614
|
};
|
|
1613
1615
|
exports.default = withDashboardViz;
|
|
1614
1616
|
|
|
@@ -1812,7 +1814,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1812
1814
|
|
|
1813
1815
|
/***/ }),
|
|
1814
1816
|
|
|
1815
|
-
/***/
|
|
1817
|
+
/***/ 427:
|
|
1816
1818
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1817
1819
|
|
|
1818
1820
|
"use strict";
|
|
@@ -1820,12 +1822,16 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1820
1822
|
|
|
1821
1823
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
1822
1824
|
if (k2 === undefined) k2 = k;
|
|
1823
|
-
Object.
|
|
1824
|
-
|
|
1825
|
-
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1825
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
1826
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
1827
|
+
desc = {
|
|
1828
|
+
enumerable: true,
|
|
1829
|
+
get: function get() {
|
|
1830
|
+
return m[k];
|
|
1831
|
+
}
|
|
1832
|
+
};
|
|
1833
|
+
}
|
|
1834
|
+
Object.defineProperty(o, k2, desc);
|
|
1829
1835
|
} : function (o, m, k, k2) {
|
|
1830
1836
|
if (k2 === undefined) k2 = k;
|
|
1831
1837
|
o[k2] = m[k];
|
|
@@ -1839,8 +1845,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1839
1845
|
value: true
|
|
1840
1846
|
});
|
|
1841
1847
|
exports.default = void 0;
|
|
1842
|
-
__exportStar(__webpack_require__(
|
|
1843
|
-
var MarkerGauge_1 = __webpack_require__(
|
|
1848
|
+
__exportStar(__webpack_require__(162), exports);
|
|
1849
|
+
var MarkerGauge_1 = __webpack_require__(162);
|
|
1844
1850
|
Object.defineProperty(exports, "default", {
|
|
1845
1851
|
enumerable: true,
|
|
1846
1852
|
get: function get() {
|
|
@@ -1850,7 +1856,7 @@ Object.defineProperty(exports, "default", {
|
|
|
1850
1856
|
|
|
1851
1857
|
/***/ }),
|
|
1852
1858
|
|
|
1853
|
-
/***/
|
|
1859
|
+
/***/ 428:
|
|
1854
1860
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1855
1861
|
|
|
1856
1862
|
"use strict";
|
|
@@ -1878,10 +1884,10 @@ var i18n_1 = __webpack_require__(2);
|
|
|
1878
1884
|
var style_1 = __webpack_require__(14);
|
|
1879
1885
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
1880
1886
|
var Message_1 = __webpack_require__(10);
|
|
1881
|
-
var id_1 = __webpack_require__(
|
|
1882
|
-
var gaugeUtils_1 = __webpack_require__(
|
|
1883
|
-
var GaugeMajorTicks_1 = __webpack_require__(
|
|
1884
|
-
var GaugeValueMarker_1 = __webpack_require__(
|
|
1887
|
+
var id_1 = __webpack_require__(25);
|
|
1888
|
+
var gaugeUtils_1 = __webpack_require__(98);
|
|
1889
|
+
var GaugeMajorTicks_1 = __webpack_require__(127);
|
|
1890
|
+
var GaugeValueMarker_1 = __webpack_require__(128);
|
|
1885
1891
|
var MAX_VERTICAL_CONTAINER_WIDTH = 200;
|
|
1886
1892
|
var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
|
|
1887
1893
|
var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
|
|
@@ -1890,7 +1896,7 @@ var Container = styled_components_1.default.div.withConfig({
|
|
|
1890
1896
|
displayName: "MarkerGauge__Container",
|
|
1891
1897
|
componentId: "sc-10z02va-0"
|
|
1892
1898
|
})(["overflow:hidden;", ";background-color:", ";"], function (props) {
|
|
1893
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1899
|
+
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
1894
1900
|
}, function (props) {
|
|
1895
1901
|
return props.backgroundColor;
|
|
1896
1902
|
});
|
|
@@ -1904,13 +1910,13 @@ var MarkerGaugeContainer = styled_components_1.default.div.withConfig({
|
|
|
1904
1910
|
displayName: "MarkerGauge__MarkerGaugeContainer",
|
|
1905
1911
|
componentId: "sc-10z02va-2"
|
|
1906
1912
|
})(["overflow:hidden;position:relative;", ";"], function (props) {
|
|
1907
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1913
|
+
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
1908
1914
|
});
|
|
1909
1915
|
var MarkerGaugeSVG = styled_components_1.default.svg.withConfig({
|
|
1910
1916
|
displayName: "MarkerGauge__MarkerGaugeSVG",
|
|
1911
1917
|
componentId: "sc-10z02va-3"
|
|
1912
1918
|
})(["", ";"], function (props) {
|
|
1913
|
-
return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
|
|
1919
|
+
return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
|
|
1914
1920
|
});
|
|
1915
1921
|
var BackgroundBar = styled_components_1.default.rect.attrs({
|
|
1916
1922
|
'data-test': 'background-bar-rect'
|
|
@@ -1947,7 +1953,7 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
1947
1953
|
/**
|
|
1948
1954
|
* Standard error message render
|
|
1949
1955
|
*/
|
|
1950
|
-
var errorMessage = react_1.useCallback(function (containerWidth, containerHeight, err, errID) {
|
|
1956
|
+
var errorMessage = (0, react_1.useCallback)(function (containerWidth, containerHeight, err, errID) {
|
|
1951
1957
|
return React.createElement(Message_1.default, {
|
|
1952
1958
|
width: containerWidth,
|
|
1953
1959
|
height: containerHeight,
|
|
@@ -1956,36 +1962,36 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
1956
1962
|
id: errID
|
|
1957
1963
|
});
|
|
1958
1964
|
}, []);
|
|
1959
|
-
var errorId = react_1.useMemo(function () {
|
|
1960
|
-
return id_1.createDOMID();
|
|
1965
|
+
var errorId = (0, react_1.useMemo)(function () {
|
|
1966
|
+
return (0, id_1.createDOMID)();
|
|
1961
1967
|
}, []);
|
|
1962
1968
|
/**
|
|
1963
1969
|
* Pre-calculate linearGradientId, error, sortedRanges, gauge range and linear gradient
|
|
1964
1970
|
*/
|
|
1965
|
-
var error = react_1.useMemo(function () {
|
|
1966
|
-
return gaugeUtils_1.validateRanges(ranges);
|
|
1971
|
+
var error = (0, react_1.useMemo)(function () {
|
|
1972
|
+
return (0, gaugeUtils_1.validateRanges)(ranges);
|
|
1967
1973
|
}, [ranges]);
|
|
1968
|
-
var sortedRanges = react_1.useMemo(function () {
|
|
1969
|
-
return gaugeUtils_1.getSortedRanges(ranges);
|
|
1974
|
+
var sortedRanges = (0, react_1.useMemo)(function () {
|
|
1975
|
+
return (0, gaugeUtils_1.getSortedRanges)(ranges);
|
|
1970
1976
|
}, [ranges]);
|
|
1971
|
-
var
|
|
1972
|
-
return gaugeUtils_1.getGaugeRange(sortedRanges);
|
|
1977
|
+
var _ref = (0, react_1.useMemo)(function () {
|
|
1978
|
+
return (0, gaugeUtils_1.getGaugeRange)(sortedRanges);
|
|
1973
1979
|
}, [sortedRanges]),
|
|
1974
|
-
min =
|
|
1975
|
-
max =
|
|
1976
|
-
var linearGradientId = react_1.useMemo(function () {
|
|
1977
|
-
return id_1.createDOMID('marker');
|
|
1980
|
+
min = _ref.min,
|
|
1981
|
+
max = _ref.max;
|
|
1982
|
+
var linearGradientId = (0, react_1.useMemo)(function () {
|
|
1983
|
+
return (0, id_1.createDOMID)('marker');
|
|
1978
1984
|
}, []);
|
|
1979
|
-
var linearGradient = react_1.useMemo(function () {
|
|
1980
|
-
var stops = gaugeUtils_1.getGradientStops({
|
|
1985
|
+
var linearGradient = (0, react_1.useMemo)(function () {
|
|
1986
|
+
var stops = (0, gaugeUtils_1.getGradientStops)({
|
|
1981
1987
|
ranges: sortedRanges,
|
|
1982
1988
|
orientation: orientation
|
|
1983
1989
|
});
|
|
1984
|
-
var
|
|
1985
|
-
x1 =
|
|
1986
|
-
y1 =
|
|
1987
|
-
x2 =
|
|
1988
|
-
y2 =
|
|
1990
|
+
var _ref2 = (0, gaugeUtils_1.getGradientDimensions)(orientation),
|
|
1991
|
+
x1 = _ref2.x1,
|
|
1992
|
+
y1 = _ref2.y1,
|
|
1993
|
+
x2 = _ref2.x2,
|
|
1994
|
+
y2 = _ref2.y2;
|
|
1989
1995
|
var linearGradientStops = stops.map(function (stop) {
|
|
1990
1996
|
return React.createElement("stop", {
|
|
1991
1997
|
key: "".concat(stop.offset, "_").concat(stop.stopColor),
|
|
@@ -2004,18 +2010,18 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2004
2010
|
/**
|
|
2005
2011
|
* Calculate marker gauge dimensions
|
|
2006
2012
|
*/
|
|
2007
|
-
var calculateMarkerGaugeDimensions = react_1.useCallback(function (containerWidth, containerHeight) {
|
|
2008
|
-
var
|
|
2013
|
+
var calculateMarkerGaugeDimensions = (0, react_1.useCallback)(function (containerWidth, containerHeight) {
|
|
2014
|
+
var _ref3 = (0, gaugeUtils_1.getGaugeDimensions)({
|
|
2009
2015
|
containerWidth: containerWidth,
|
|
2010
2016
|
containerHeight: containerHeight,
|
|
2011
2017
|
orientation: orientation
|
|
2012
2018
|
}),
|
|
2013
|
-
gaugeLength =
|
|
2014
|
-
gaugeStartX =
|
|
2015
|
-
gaugeStartY =
|
|
2016
|
-
gaugeWidth =
|
|
2017
|
-
gaugeHeight =
|
|
2018
|
-
var
|
|
2019
|
+
gaugeLength = _ref3.gaugeLength,
|
|
2020
|
+
gaugeStartX = _ref3.gaugeStartX,
|
|
2021
|
+
gaugeStartY = _ref3.gaugeStartY,
|
|
2022
|
+
gaugeWidth = _ref3.gaugeWidth,
|
|
2023
|
+
gaugeHeight = _ref3.gaugeHeight;
|
|
2024
|
+
var _ref4 = (0, gaugeUtils_1.getMarkerBarDimensions)({
|
|
2019
2025
|
gaugeLength: gaugeLength,
|
|
2020
2026
|
gaugeStartX: gaugeStartX,
|
|
2021
2027
|
gaugeStartY: gaugeStartY,
|
|
@@ -2023,12 +2029,12 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2023
2029
|
gaugeHeight: gaugeHeight,
|
|
2024
2030
|
orientation: orientation
|
|
2025
2031
|
}),
|
|
2026
|
-
markerBarLength =
|
|
2027
|
-
markerBarX =
|
|
2028
|
-
markerBarY =
|
|
2029
|
-
markerBarWidth =
|
|
2030
|
-
markerBarHeight =
|
|
2031
|
-
var
|
|
2032
|
+
markerBarLength = _ref4.markerBarLength,
|
|
2033
|
+
markerBarX = _ref4.markerBarX,
|
|
2034
|
+
markerBarY = _ref4.markerBarY,
|
|
2035
|
+
markerBarWidth = _ref4.markerBarWidth,
|
|
2036
|
+
markerBarHeight = _ref4.markerBarHeight;
|
|
2037
|
+
var _ref5 = (0, gaugeUtils_1.getMarkerGaugeValueMarkerPositions)({
|
|
2032
2038
|
markerBarX: markerBarX,
|
|
2033
2039
|
markerBarY: markerBarY,
|
|
2034
2040
|
markerBarHeight: markerBarHeight,
|
|
@@ -2038,8 +2044,8 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2038
2044
|
min: min,
|
|
2039
2045
|
max: max
|
|
2040
2046
|
}),
|
|
2041
|
-
valueMarkerX =
|
|
2042
|
-
valueMarkerY =
|
|
2047
|
+
valueMarkerX = _ref5.valueMarkerX,
|
|
2048
|
+
valueMarkerY = _ref5.valueMarkerY;
|
|
2043
2049
|
return {
|
|
2044
2050
|
markerBarX: markerBarX,
|
|
2045
2051
|
markerBarY: markerBarY,
|
|
@@ -2053,13 +2059,13 @@ var MarkerGauge = function MarkerGauge(_a) {
|
|
|
2053
2059
|
gaugeHeight: gaugeHeight
|
|
2054
2060
|
};
|
|
2055
2061
|
}, [orientation, value, min, max]);
|
|
2056
|
-
var renderVisualization = react_1.useCallback(function (
|
|
2057
|
-
var containerWidth =
|
|
2058
|
-
containerHeight =
|
|
2062
|
+
var renderVisualization = (0, react_1.useCallback)(function (_ref6) {
|
|
2063
|
+
var containerWidth = _ref6.width,
|
|
2064
|
+
containerHeight = _ref6.height;
|
|
2059
2065
|
// todo: need change the size when get design for smaller space
|
|
2060
2066
|
// 58 is the title & description header height in dashboard visualization
|
|
2061
2067
|
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') {
|
|
2062
|
-
return errorMessage(containerWidth, containerHeight, i18n_1._('Too small to render content'), errorId);
|
|
2068
|
+
return errorMessage(containerWidth, containerHeight, (0, i18n_1._)('Too small to render content'), errorId);
|
|
2063
2069
|
}
|
|
2064
2070
|
if (error) {
|
|
2065
2071
|
return errorMessage(containerWidth, containerHeight, error, errorId);
|
|
@@ -2188,7 +2194,7 @@ exports.default = MarkerGauge;
|
|
|
2188
2194
|
|
|
2189
2195
|
/***/ }),
|
|
2190
2196
|
|
|
2191
|
-
/***/
|
|
2197
|
+
/***/ 429:
|
|
2192
2198
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2193
2199
|
|
|
2194
2200
|
"use strict";
|
|
@@ -2198,12 +2204,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2198
2204
|
value: true
|
|
2199
2205
|
});
|
|
2200
2206
|
var i18n_1 = __webpack_require__(2);
|
|
2201
|
-
var GaugeMarker_1 = __webpack_require__(
|
|
2202
|
-
var placeholders_1 = __webpack_require__(
|
|
2207
|
+
var GaugeMarker_1 = __webpack_require__(430);
|
|
2208
|
+
var placeholders_1 = __webpack_require__(50);
|
|
2203
2209
|
var schemaUtils_1 = __webpack_require__(16);
|
|
2204
2210
|
var variables_1 = __webpack_require__(11);
|
|
2205
2211
|
var pick_1 = __webpack_require__(23);
|
|
2206
|
-
var Gauge_1 = __webpack_require__(
|
|
2212
|
+
var Gauge_1 = __webpack_require__(126);
|
|
2207
2213
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2208
2214
|
var VizCategory_1 = __webpack_require__(35);
|
|
2209
2215
|
var configUtils_1 = __webpack_require__(20);
|
|
@@ -2274,7 +2280,7 @@ var optionsSchema = {
|
|
|
2274
2280
|
description: 'Specify whether to display the labels as numbers, percentages, or off. The label center aligns to the value.',
|
|
2275
2281
|
default: 'number',
|
|
2276
2282
|
type: 'string',
|
|
2277
|
-
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
2283
|
+
pattern: (0, schemaUtils_1.getPattern)(['number', 'percentage', 'off'])
|
|
2278
2284
|
},
|
|
2279
2285
|
majorTickInterval: {
|
|
2280
2286
|
description: 'Specify, in pixels, the spacing between major tick marks.',
|
|
@@ -2285,7 +2291,7 @@ var optionsSchema = {
|
|
|
2285
2291
|
description: 'Specify the axis orientation of the gauge.',
|
|
2286
2292
|
default: 'vertical',
|
|
2287
2293
|
type: 'string',
|
|
2288
|
-
pattern: schemaUtils_1.getPattern(['horizontal', 'vertical'])
|
|
2294
|
+
pattern: (0, schemaUtils_1.getPattern)(['horizontal', 'vertical'])
|
|
2289
2295
|
},
|
|
2290
2296
|
value: {
|
|
2291
2297
|
description: 'Specify the dataSource applied to the value of the marker gauge.',
|
|
@@ -2296,18 +2302,18 @@ var optionsSchema = {
|
|
|
2296
2302
|
description: 'Specify whether to display the value as a number, percentage, or off.',
|
|
2297
2303
|
default: 'number',
|
|
2298
2304
|
type: 'string',
|
|
2299
|
-
pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off'])
|
|
2305
|
+
pattern: (0, schemaUtils_1.getPattern)(['number', 'percentage', 'off'])
|
|
2300
2306
|
}
|
|
2301
2307
|
};
|
|
2302
2308
|
var themes = {
|
|
2303
2309
|
defaultFillColor: function defaultFillColor(props) {
|
|
2304
|
-
return pick_1.default({
|
|
2310
|
+
return (0, pick_1.default)({
|
|
2305
2311
|
enterprise: variables_1.default.backgroundColorHover(props),
|
|
2306
2312
|
prisma: variables_1.default.neutral100(props)
|
|
2307
2313
|
})(props);
|
|
2308
2314
|
},
|
|
2309
2315
|
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
2310
|
-
return pick_1.default({
|
|
2316
|
+
return (0, pick_1.default)({
|
|
2311
2317
|
enterprise: {
|
|
2312
2318
|
dark: variables_1.default.black(props),
|
|
2313
2319
|
light: variables_1.default.backgroundColor(props)
|
|
@@ -2316,7 +2322,7 @@ var themes = {
|
|
|
2316
2322
|
})(props);
|
|
2317
2323
|
},
|
|
2318
2324
|
majorTickFillColor: function majorTickFillColor(props) {
|
|
2319
|
-
return pick_1.default({
|
|
2325
|
+
return (0, pick_1.default)({
|
|
2320
2326
|
enterprise: {
|
|
2321
2327
|
light: variables_1.default.gray30(props),
|
|
2322
2328
|
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
@@ -2330,7 +2336,7 @@ var themes = {
|
|
|
2330
2336
|
})(props);
|
|
2331
2337
|
},
|
|
2332
2338
|
majorTickStrokeColor: function majorTickStrokeColor(props) {
|
|
2333
|
-
return pick_1.default({
|
|
2339
|
+
return (0, pick_1.default)({
|
|
2334
2340
|
enterprise: {
|
|
2335
2341
|
light: variables_1.default.textGray(props),
|
|
2336
2342
|
dark: variables_1.default.contentColorMuted(props)
|
|
@@ -2339,7 +2345,7 @@ var themes = {
|
|
|
2339
2345
|
})(props);
|
|
2340
2346
|
},
|
|
2341
2347
|
valueMarkerFillColor: function valueMarkerFillColor(props) {
|
|
2342
|
-
return pick_1.default({
|
|
2348
|
+
return (0, pick_1.default)({
|
|
2343
2349
|
enterprise: variables_1.default.textColor(props),
|
|
2344
2350
|
prisma: {
|
|
2345
2351
|
dark: variables_1.default.white(props),
|
|
@@ -2348,7 +2354,7 @@ var themes = {
|
|
|
2348
2354
|
})(props);
|
|
2349
2355
|
},
|
|
2350
2356
|
valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
|
|
2351
|
-
return pick_1.default({
|
|
2357
|
+
return (0, pick_1.default)({
|
|
2352
2358
|
enterprise: {
|
|
2353
2359
|
light: variables_1.default.gray96(props),
|
|
2354
2360
|
dark: variables_1.default.black(props)
|
|
@@ -2358,9 +2364,9 @@ var themes = {
|
|
|
2358
2364
|
}
|
|
2359
2365
|
};
|
|
2360
2366
|
var editorConfig = [{
|
|
2361
|
-
label: i18n_1._('Data configurations'),
|
|
2367
|
+
label: (0, i18n_1._)('Data configurations'),
|
|
2362
2368
|
layout: [[{
|
|
2363
|
-
label: i18n_1._('Value'),
|
|
2369
|
+
label: (0, i18n_1._)('Value'),
|
|
2364
2370
|
editor: 'editor.columnSelector',
|
|
2365
2371
|
option: 'value',
|
|
2366
2372
|
context: 'defaultContext',
|
|
@@ -2378,16 +2384,16 @@ var editorConfig = [{
|
|
|
2378
2384
|
}
|
|
2379
2385
|
}]]
|
|
2380
2386
|
}, Gauge_1.default, {
|
|
2381
|
-
label: i18n_1._('Color and style'),
|
|
2387
|
+
label: (0, i18n_1._)('Color and style'),
|
|
2382
2388
|
layout: [[{
|
|
2383
|
-
label: i18n_1._('Gauge ranges'),
|
|
2389
|
+
label: (0, i18n_1._)('Gauge ranges'),
|
|
2384
2390
|
option: 'gaugeRanges',
|
|
2385
2391
|
editor: 'editor.threshold',
|
|
2386
2392
|
editorProps: {
|
|
2387
2393
|
openRanges: false,
|
|
2388
2394
|
isTogglable: false // Can not disable thresholds
|
|
2389
2395
|
}
|
|
2390
|
-
}], BackgroundColor_1.default({
|
|
2396
|
+
}], (0, BackgroundColor_1.default)({
|
|
2391
2397
|
themes: themes,
|
|
2392
2398
|
labelPosition: 'top'
|
|
2393
2399
|
})]
|
|
@@ -2403,7 +2409,7 @@ var config = {
|
|
|
2403
2409
|
/**
|
|
2404
2410
|
* viz name
|
|
2405
2411
|
*/
|
|
2406
|
-
name: i18n_1._('Marker gauge'),
|
|
2412
|
+
name: (0, i18n_1._)('Marker gauge'),
|
|
2407
2413
|
category: VizCategory_1.VizCategory.GAUGE,
|
|
2408
2414
|
/**
|
|
2409
2415
|
* viz icon
|
|
@@ -2418,14 +2424,7 @@ var config = {
|
|
|
2418
2424
|
supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
|
|
2419
2425
|
themes: themes
|
|
2420
2426
|
};
|
|
2421
|
-
exports.default = configUtils_1.enhanceConfig(config);
|
|
2422
|
-
|
|
2423
|
-
/***/ }),
|
|
2424
|
-
|
|
2425
|
-
/***/ 427:
|
|
2426
|
-
/***/ (function(module, exports) {
|
|
2427
|
-
|
|
2428
|
-
module.exports = require("@splunk/react-icons/enterprise/GaugeMarker");
|
|
2427
|
+
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
2429
2428
|
|
|
2430
2429
|
/***/ }),
|
|
2431
2430
|
|
|
@@ -2443,6 +2442,13 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
|
2443
2442
|
|
|
2444
2443
|
/***/ }),
|
|
2445
2444
|
|
|
2445
|
+
/***/ 430:
|
|
2446
|
+
/***/ (function(module, exports) {
|
|
2447
|
+
|
|
2448
|
+
module.exports = require("@splunk/react-icons/enterprise/GaugeMarker");
|
|
2449
|
+
|
|
2450
|
+
/***/ }),
|
|
2451
|
+
|
|
2446
2452
|
/***/ 44:
|
|
2447
2453
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2448
2454
|
|
|
@@ -2469,8 +2475,8 @@ var lodash_1 = __webpack_require__(3);
|
|
|
2469
2475
|
* @param dependencies an array of dependencies
|
|
2470
2476
|
*/
|
|
2471
2477
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
2472
|
-
var ref = react_1.useRef();
|
|
2473
|
-
if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
|
|
2478
|
+
var ref = (0, react_1.useRef)();
|
|
2479
|
+
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
2474
2480
|
ref.current = {
|
|
2475
2481
|
dependencies: dependencies,
|
|
2476
2482
|
value: fn()
|
|
@@ -2514,7 +2520,7 @@ exports.isMissing = isMissing;
|
|
|
2514
2520
|
*/
|
|
2515
2521
|
var missingKeys = function missingKeys(keys, target) {
|
|
2516
2522
|
return keys.filter(function (k) {
|
|
2517
|
-
return exports.isMissing(target[k]);
|
|
2523
|
+
return (0, exports.isMissing)(target[k]);
|
|
2518
2524
|
});
|
|
2519
2525
|
};
|
|
2520
2526
|
exports.missingKeys = missingKeys;
|
|
@@ -2538,7 +2544,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
2538
2544
|
"data-test": "message",
|
|
2539
2545
|
width: width,
|
|
2540
2546
|
height: height,
|
|
2541
|
-
message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
|
|
2547
|
+
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
2542
2548
|
});
|
|
2543
2549
|
};
|
|
2544
2550
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
@@ -2547,7 +2553,7 @@ exports.MissingPropsMessage.defaultProps = {
|
|
|
2547
2553
|
width: '100%',
|
|
2548
2554
|
height: 250
|
|
2549
2555
|
};
|
|
2550
|
-
exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
2556
|
+
exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
|
|
2551
2557
|
|
|
2552
2558
|
/***/ }),
|
|
2553
2559
|
|
|
@@ -2568,7 +2574,7 @@ var Cover = styled_components_1.default.div.withConfig({
|
|
|
2568
2574
|
componentId: "sc-1gsbnxb-0"
|
|
2569
2575
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
2570
2576
|
var Blocker = styled_components_1.default.div.attrs({
|
|
2571
|
-
'data-splunk-visualization-version': "
|
|
2577
|
+
'data-splunk-visualization-version': "26.0.0 - 2f7458907"
|
|
2572
2578
|
}).withConfig({
|
|
2573
2579
|
displayName: "withEditModeCover__Blocker",
|
|
2574
2580
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -2587,7 +2593,7 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
2587
2593
|
"data-test": "edit-mode-cover"
|
|
2588
2594
|
}));
|
|
2589
2595
|
};
|
|
2590
|
-
hocUtils_1.extendStaticWrapperProps({
|
|
2596
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2591
2597
|
Wrapper: Wrapper,
|
|
2592
2598
|
Visualization: Visualization
|
|
2593
2599
|
});
|
|
@@ -2609,7 +2615,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2609
2615
|
var React = __webpack_require__(1);
|
|
2610
2616
|
var colorUtils_1 = __webpack_require__(12);
|
|
2611
2617
|
var variables_1 = __webpack_require__(11);
|
|
2612
|
-
var IconPlaceholder_1 = __webpack_require__(
|
|
2618
|
+
var IconPlaceholder_1 = __webpack_require__(32);
|
|
2613
2619
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2614
2620
|
var hocUtils_1 = __webpack_require__(15);
|
|
2615
2621
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
@@ -2624,7 +2630,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2624
2630
|
height = props.height,
|
|
2625
2631
|
width = props.width;
|
|
2626
2632
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
2627
|
-
var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
2633
|
+
var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
2628
2634
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
2629
2635
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
2630
2636
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
@@ -2639,7 +2645,7 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
2639
2645
|
}
|
|
2640
2646
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
2641
2647
|
};
|
|
2642
|
-
hocUtils_1.extendStaticWrapperProps({
|
|
2648
|
+
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
2643
2649
|
Wrapper: Wrapper,
|
|
2644
2650
|
Visualization: Visualization
|
|
2645
2651
|
});
|
|
@@ -2659,14 +2665,14 @@ module.exports = require("@babel/runtime/helpers/extends");
|
|
|
2659
2665
|
/***/ 49:
|
|
2660
2666
|
/***/ (function(module, exports) {
|
|
2661
2667
|
|
|
2662
|
-
module.exports = require("@splunk/
|
|
2668
|
+
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
2663
2669
|
|
|
2664
2670
|
/***/ }),
|
|
2665
2671
|
|
|
2666
2672
|
/***/ 50:
|
|
2667
2673
|
/***/ (function(module, exports) {
|
|
2668
2674
|
|
|
2669
|
-
module.exports = require("@splunk/
|
|
2675
|
+
module.exports = require("@splunk/visualization-icons/placeholders");
|
|
2670
2676
|
|
|
2671
2677
|
/***/ }),
|
|
2672
2678
|
|
|
@@ -2685,7 +2691,7 @@ var background = function background(_ref) {
|
|
|
2685
2691
|
themes = _ref.themes,
|
|
2686
2692
|
labelPosition = _ref.labelPosition;
|
|
2687
2693
|
return [{
|
|
2688
|
-
label: i18n_1._(label || 'Background'),
|
|
2694
|
+
label: (0, i18n_1._)(label || 'Background'),
|
|
2689
2695
|
option: 'backgroundColor',
|
|
2690
2696
|
editor: 'editor.color',
|
|
2691
2697
|
editorProps: {
|
|
@@ -2756,7 +2762,7 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
|
2756
2762
|
|
|
2757
2763
|
/***/ }),
|
|
2758
2764
|
|
|
2759
|
-
/***/
|
|
2765
|
+
/***/ 98:
|
|
2760
2766
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2761
2767
|
|
|
2762
2768
|
"use strict";
|
|
@@ -2768,7 +2774,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
2768
2774
|
});
|
|
2769
2775
|
exports.convertToGaugeProperties = exports.mapValueLabelDisplay = exports.mapToOldKey = exports.getGradientDimensions = exports.getGradientStops = exports.getGradientStopColors = exports.getGradientStopOffsets = exports.getGaugeRange = exports.validateRanges = exports.getSortedRanges = exports.getMarkerGaugeValueMarkerPositions = exports.getMarkerBarDimensions = exports.getFillerGaugeValueMarkerPositions = exports.getFillBarDimensions = exports.getGaugeBarHeight = exports.getGaugeBarWidth = exports.getGaugeBarStartPositions = exports.getGaugeBarLength = exports.assignGaugeColor = exports.getGaugeDimensions = exports.getGaugeStartPosition = exports.getGaugeLength = exports.getGaugeHeight = exports.getGaugeWidth = exports.FILL_THICKNESS = exports.GAUGE_THICKNESS = void 0;
|
|
2770
2776
|
var lodash_1 = __webpack_require__(3);
|
|
2771
|
-
var colorConstants_1 = __webpack_require__(
|
|
2777
|
+
var colorConstants_1 = __webpack_require__(49);
|
|
2772
2778
|
var i18n_1 = __webpack_require__(2);
|
|
2773
2779
|
exports.GAUGE_THICKNESS = 50;
|
|
2774
2780
|
exports.FILL_THICKNESS = 38;
|
|
@@ -2816,10 +2822,10 @@ var getGaugeLength = function getGaugeLength(_ref3) {
|
|
|
2816
2822
|
var containerWidth = _ref3.containerWidth,
|
|
2817
2823
|
containerHeight = _ref3.containerHeight,
|
|
2818
2824
|
orientation = _ref3.orientation;
|
|
2819
|
-
return orientation === 'vertical' ? exports.getGaugeHeight({
|
|
2825
|
+
return orientation === 'vertical' ? (0, exports.getGaugeHeight)({
|
|
2820
2826
|
containerHeight: containerHeight,
|
|
2821
2827
|
orientation: orientation
|
|
2822
|
-
}) : exports.getGaugeWidth({
|
|
2828
|
+
}) : (0, exports.getGaugeWidth)({
|
|
2823
2829
|
containerWidth: containerWidth,
|
|
2824
2830
|
orientation: orientation
|
|
2825
2831
|
});
|
|
@@ -2874,24 +2880,24 @@ var getGaugeDimensions = function getGaugeDimensions(_ref5) {
|
|
|
2874
2880
|
var containerWidth = _ref5.containerWidth,
|
|
2875
2881
|
containerHeight = _ref5.containerHeight,
|
|
2876
2882
|
orientation = _ref5.orientation;
|
|
2877
|
-
var gaugeLength = exports.getGaugeLength({
|
|
2883
|
+
var gaugeLength = (0, exports.getGaugeLength)({
|
|
2878
2884
|
containerWidth: containerWidth,
|
|
2879
2885
|
containerHeight: containerHeight,
|
|
2880
2886
|
orientation: orientation
|
|
2881
2887
|
});
|
|
2882
|
-
var
|
|
2888
|
+
var _ref6 = (0, exports.getGaugeStartPosition)({
|
|
2883
2889
|
containerWidth: containerWidth,
|
|
2884
2890
|
containerHeight: containerHeight,
|
|
2885
2891
|
gaugeLength: gaugeLength,
|
|
2886
2892
|
orientation: orientation
|
|
2887
2893
|
}),
|
|
2888
|
-
gaugeStartX =
|
|
2889
|
-
gaugeStartY =
|
|
2890
|
-
var gaugeWidth = exports.getGaugeWidth({
|
|
2894
|
+
gaugeStartX = _ref6.gaugeStartX,
|
|
2895
|
+
gaugeStartY = _ref6.gaugeStartY;
|
|
2896
|
+
var gaugeWidth = (0, exports.getGaugeWidth)({
|
|
2891
2897
|
containerWidth: containerWidth,
|
|
2892
2898
|
orientation: orientation
|
|
2893
2899
|
});
|
|
2894
|
-
var gaugeHeight = exports.getGaugeHeight({
|
|
2900
|
+
var gaugeHeight = (0, exports.getGaugeHeight)({
|
|
2895
2901
|
containerHeight: containerHeight,
|
|
2896
2902
|
orientation: orientation
|
|
2897
2903
|
});
|
|
@@ -2910,10 +2916,10 @@ exports.getGaugeDimensions = getGaugeDimensions;
|
|
|
2910
2916
|
* @method assignGaugeColor
|
|
2911
2917
|
* @params
|
|
2912
2918
|
* */
|
|
2913
|
-
var assignGaugeColor = function assignGaugeColor(
|
|
2914
|
-
var value =
|
|
2915
|
-
min =
|
|
2916
|
-
max =
|
|
2919
|
+
var assignGaugeColor = function assignGaugeColor(_ref7) {
|
|
2920
|
+
var value = _ref7.value,
|
|
2921
|
+
min = _ref7.min,
|
|
2922
|
+
max = _ref7.max;
|
|
2917
2923
|
var rate = (value - min) / (max - min);
|
|
2918
2924
|
if (rate <= 0.3) {
|
|
2919
2925
|
return colorConstants_1.SEMANTIC_SUCCESS;
|
|
@@ -2934,11 +2940,11 @@ exports.assignGaugeColor = assignGaugeColor;
|
|
|
2934
2940
|
* @param {Number} input.max
|
|
2935
2941
|
* @return {Number} gaugeBarLength
|
|
2936
2942
|
*/
|
|
2937
|
-
var getGaugeBarLength = function getGaugeBarLength(
|
|
2938
|
-
var gaugeLength =
|
|
2939
|
-
value =
|
|
2940
|
-
min =
|
|
2941
|
-
max =
|
|
2943
|
+
var getGaugeBarLength = function getGaugeBarLength(_ref8) {
|
|
2944
|
+
var gaugeLength = _ref8.gaugeLength,
|
|
2945
|
+
value = _ref8.value,
|
|
2946
|
+
min = _ref8.min,
|
|
2947
|
+
max = _ref8.max;
|
|
2942
2948
|
if (max < min) {
|
|
2943
2949
|
return null;
|
|
2944
2950
|
}
|
|
@@ -2965,13 +2971,13 @@ exports.getGaugeBarLength = getGaugeBarLength;
|
|
|
2965
2971
|
* @return {Number} position.gaugeBarX
|
|
2966
2972
|
* @return {Number} position.gaugeBarY
|
|
2967
2973
|
*/
|
|
2968
|
-
var getGaugeBarStartPositions = function getGaugeBarStartPositions(
|
|
2969
|
-
var gaugeStartX =
|
|
2970
|
-
gaugeStartY =
|
|
2971
|
-
gaugeWidth =
|
|
2972
|
-
gaugeHeight =
|
|
2973
|
-
gaugeBarLength =
|
|
2974
|
-
orientation =
|
|
2974
|
+
var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref9) {
|
|
2975
|
+
var gaugeStartX = _ref9.gaugeStartX,
|
|
2976
|
+
gaugeStartY = _ref9.gaugeStartY,
|
|
2977
|
+
gaugeWidth = _ref9.gaugeWidth,
|
|
2978
|
+
gaugeHeight = _ref9.gaugeHeight,
|
|
2979
|
+
gaugeBarLength = _ref9.gaugeBarLength,
|
|
2980
|
+
orientation = _ref9.orientation;
|
|
2975
2981
|
var gaugeBarX = gaugeStartX;
|
|
2976
2982
|
var gaugeBarY = gaugeStartY;
|
|
2977
2983
|
if (orientation === 'vertical') {
|
|
@@ -2994,9 +3000,9 @@ exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
|
|
|
2994
3000
|
* @param {String} orientation
|
|
2995
3001
|
* @return {Number} gaugeBarWidth
|
|
2996
3002
|
*/
|
|
2997
|
-
var getGaugeBarWidth = function getGaugeBarWidth(
|
|
2998
|
-
var gaugeBarLength =
|
|
2999
|
-
orientation =
|
|
3003
|
+
var getGaugeBarWidth = function getGaugeBarWidth(_ref10) {
|
|
3004
|
+
var gaugeBarLength = _ref10.gaugeBarLength,
|
|
3005
|
+
orientation = _ref10.orientation;
|
|
3000
3006
|
return orientation === 'vertical' ? exports.FILL_THICKNESS : gaugeBarLength;
|
|
3001
3007
|
};
|
|
3002
3008
|
exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
@@ -3008,9 +3014,9 @@ exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
|
3008
3014
|
* @param {String} orientation
|
|
3009
3015
|
* @return {Number} gaugeBarHeight
|
|
3010
3016
|
*/
|
|
3011
|
-
var getGaugeBarHeight = function getGaugeBarHeight(
|
|
3012
|
-
var gaugeBarLength =
|
|
3013
|
-
orientation =
|
|
3017
|
+
var getGaugeBarHeight = function getGaugeBarHeight(_ref11) {
|
|
3018
|
+
var gaugeBarLength = _ref11.gaugeBarLength,
|
|
3019
|
+
orientation = _ref11.orientation;
|
|
3014
3020
|
return orientation === 'vertical' ? gaugeBarLength : exports.FILL_THICKNESS;
|
|
3015
3021
|
};
|
|
3016
3022
|
exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
@@ -3034,23 +3040,23 @@ exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
|
3034
3040
|
* @return {Number} fillBarDimensions.fillBarWidth
|
|
3035
3041
|
* @return {Number} fillBarDimensions.fillBarHeight
|
|
3036
3042
|
*/
|
|
3037
|
-
var getFillBarDimensions = function getFillBarDimensions(
|
|
3038
|
-
var gaugeLength =
|
|
3039
|
-
gaugeStartX =
|
|
3040
|
-
gaugeStartY =
|
|
3041
|
-
gaugeWidth =
|
|
3042
|
-
gaugeHeight =
|
|
3043
|
-
value =
|
|
3044
|
-
min =
|
|
3045
|
-
max =
|
|
3046
|
-
orientation =
|
|
3047
|
-
var gaugeBarLength = exports.getGaugeBarLength({
|
|
3043
|
+
var getFillBarDimensions = function getFillBarDimensions(_ref12) {
|
|
3044
|
+
var gaugeLength = _ref12.gaugeLength,
|
|
3045
|
+
gaugeStartX = _ref12.gaugeStartX,
|
|
3046
|
+
gaugeStartY = _ref12.gaugeStartY,
|
|
3047
|
+
gaugeWidth = _ref12.gaugeWidth,
|
|
3048
|
+
gaugeHeight = _ref12.gaugeHeight,
|
|
3049
|
+
value = _ref12.value,
|
|
3050
|
+
min = _ref12.min,
|
|
3051
|
+
max = _ref12.max,
|
|
3052
|
+
orientation = _ref12.orientation;
|
|
3053
|
+
var gaugeBarLength = (0, exports.getGaugeBarLength)({
|
|
3048
3054
|
gaugeLength: gaugeLength,
|
|
3049
3055
|
value: value,
|
|
3050
3056
|
max: max,
|
|
3051
3057
|
min: min
|
|
3052
3058
|
});
|
|
3053
|
-
var
|
|
3059
|
+
var _ref13 = (0, exports.getGaugeBarStartPositions)({
|
|
3054
3060
|
gaugeStartX: gaugeStartX,
|
|
3055
3061
|
gaugeStartY: gaugeStartY,
|
|
3056
3062
|
gaugeWidth: gaugeWidth,
|
|
@@ -3058,13 +3064,13 @@ var getFillBarDimensions = function getFillBarDimensions(_ref11) {
|
|
|
3058
3064
|
gaugeBarLength: gaugeBarLength,
|
|
3059
3065
|
orientation: orientation
|
|
3060
3066
|
}),
|
|
3061
|
-
fillBarX =
|
|
3062
|
-
fillBarY =
|
|
3063
|
-
var fillBarWidth = exports.getGaugeBarWidth({
|
|
3067
|
+
fillBarX = _ref13.gaugeBarX,
|
|
3068
|
+
fillBarY = _ref13.gaugeBarY;
|
|
3069
|
+
var fillBarWidth = (0, exports.getGaugeBarWidth)({
|
|
3064
3070
|
gaugeBarLength: gaugeBarLength,
|
|
3065
3071
|
orientation: orientation
|
|
3066
3072
|
});
|
|
3067
|
-
var fillBarHeight = exports.getGaugeBarHeight({
|
|
3073
|
+
var fillBarHeight = (0, exports.getGaugeBarHeight)({
|
|
3068
3074
|
gaugeBarLength: gaugeBarLength,
|
|
3069
3075
|
orientation: orientation
|
|
3070
3076
|
});
|
|
@@ -3089,11 +3095,11 @@ exports.getFillBarDimensions = getFillBarDimensions;
|
|
|
3089
3095
|
* @return {Number} position.valueMarkerX
|
|
3090
3096
|
* @return {Number} position.valueMarkerY
|
|
3091
3097
|
*/
|
|
3092
|
-
var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(
|
|
3093
|
-
var fillBarX =
|
|
3094
|
-
fillBarY =
|
|
3095
|
-
fillBarLength =
|
|
3096
|
-
orientation =
|
|
3098
|
+
var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref14) {
|
|
3099
|
+
var fillBarX = _ref14.fillBarX,
|
|
3100
|
+
fillBarY = _ref14.fillBarY,
|
|
3101
|
+
fillBarLength = _ref14.fillBarLength,
|
|
3102
|
+
orientation = _ref14.orientation;
|
|
3097
3103
|
var valueMarkerX = fillBarX;
|
|
3098
3104
|
var valueMarkerY = fillBarY;
|
|
3099
3105
|
if (orientation === 'vertical') {
|
|
@@ -3125,15 +3131,15 @@ exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
|
|
|
3125
3131
|
* @return {Number} markerBarDimensions.markerBarWidth
|
|
3126
3132
|
* @return {Number} markerBarDimensions.markerBarHeight
|
|
3127
3133
|
*/
|
|
3128
|
-
var getMarkerBarDimensions = function getMarkerBarDimensions(
|
|
3129
|
-
var gaugeLength =
|
|
3130
|
-
gaugeStartX =
|
|
3131
|
-
gaugeStartY =
|
|
3132
|
-
gaugeWidth =
|
|
3133
|
-
gaugeHeight =
|
|
3134
|
-
orientation =
|
|
3134
|
+
var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
|
|
3135
|
+
var gaugeLength = _ref15.gaugeLength,
|
|
3136
|
+
gaugeStartX = _ref15.gaugeStartX,
|
|
3137
|
+
gaugeStartY = _ref15.gaugeStartY,
|
|
3138
|
+
gaugeWidth = _ref15.gaugeWidth,
|
|
3139
|
+
gaugeHeight = _ref15.gaugeHeight,
|
|
3140
|
+
orientation = _ref15.orientation;
|
|
3135
3141
|
var gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge
|
|
3136
|
-
var
|
|
3142
|
+
var _ref16 = (0, exports.getGaugeBarStartPositions)({
|
|
3137
3143
|
gaugeStartX: gaugeStartX,
|
|
3138
3144
|
gaugeStartY: gaugeStartY,
|
|
3139
3145
|
gaugeWidth: gaugeWidth,
|
|
@@ -3141,13 +3147,13 @@ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref13) {
|
|
|
3141
3147
|
gaugeBarLength: gaugeBarLength,
|
|
3142
3148
|
orientation: orientation
|
|
3143
3149
|
}),
|
|
3144
|
-
markerBarX =
|
|
3145
|
-
markerBarY =
|
|
3146
|
-
var markerBarWidth = exports.getGaugeBarWidth({
|
|
3150
|
+
markerBarX = _ref16.gaugeBarX,
|
|
3151
|
+
markerBarY = _ref16.gaugeBarY;
|
|
3152
|
+
var markerBarWidth = (0, exports.getGaugeBarWidth)({
|
|
3147
3153
|
gaugeBarLength: gaugeBarLength,
|
|
3148
3154
|
orientation: orientation
|
|
3149
3155
|
});
|
|
3150
|
-
var markerBarHeight = exports.getGaugeBarHeight({
|
|
3156
|
+
var markerBarHeight = (0, exports.getGaugeBarHeight)({
|
|
3151
3157
|
gaugeBarLength: gaugeBarLength,
|
|
3152
3158
|
orientation: orientation
|
|
3153
3159
|
});
|
|
@@ -3176,19 +3182,19 @@ exports.getMarkerBarDimensions = getMarkerBarDimensions;
|
|
|
3176
3182
|
* @return {Number} position.valueMarkerX
|
|
3177
3183
|
* @return {Number} position.valueMarkerY
|
|
3178
3184
|
*/
|
|
3179
|
-
var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(
|
|
3180
|
-
var markerBarX =
|
|
3181
|
-
markerBarY =
|
|
3182
|
-
markerBarHeight =
|
|
3183
|
-
gaugeLength =
|
|
3184
|
-
orientation =
|
|
3185
|
-
value =
|
|
3186
|
-
min =
|
|
3187
|
-
max =
|
|
3185
|
+
var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref17) {
|
|
3186
|
+
var markerBarX = _ref17.markerBarX,
|
|
3187
|
+
markerBarY = _ref17.markerBarY,
|
|
3188
|
+
markerBarHeight = _ref17.markerBarHeight,
|
|
3189
|
+
gaugeLength = _ref17.markerBarLength,
|
|
3190
|
+
orientation = _ref17.orientation,
|
|
3191
|
+
value = _ref17.value,
|
|
3192
|
+
min = _ref17.min,
|
|
3193
|
+
max = _ref17.max;
|
|
3188
3194
|
var valueMarkerX = markerBarX;
|
|
3189
3195
|
var valueMarkerY = markerBarY;
|
|
3190
3196
|
if (orientation === 'vertical') {
|
|
3191
|
-
valueMarkerY += markerBarHeight - exports.getGaugeBarLength({
|
|
3197
|
+
valueMarkerY += markerBarHeight - (0, exports.getGaugeBarLength)({
|
|
3192
3198
|
gaugeLength: gaugeLength,
|
|
3193
3199
|
value: value,
|
|
3194
3200
|
max: max,
|
|
@@ -3196,7 +3202,7 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
|
|
|
3196
3202
|
});
|
|
3197
3203
|
valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
3198
3204
|
} else {
|
|
3199
|
-
valueMarkerX += exports.getGaugeBarLength({
|
|
3205
|
+
valueMarkerX += (0, exports.getGaugeBarLength)({
|
|
3200
3206
|
gaugeLength: gaugeLength,
|
|
3201
3207
|
value: value,
|
|
3202
3208
|
max: max,
|
|
@@ -3230,23 +3236,23 @@ exports.getSortedRanges = getSortedRanges;
|
|
|
3230
3236
|
*/
|
|
3231
3237
|
var validateRanges = function validateRanges(ranges) {
|
|
3232
3238
|
if (!ranges.length) {
|
|
3233
|
-
return i18n_1._('Prop "ranges" is missing entries');
|
|
3239
|
+
return (0, i18n_1._)('Prop "ranges" is missing entries');
|
|
3234
3240
|
}
|
|
3235
3241
|
// check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
|
|
3236
3242
|
if (ranges.some(function (range) {
|
|
3237
3243
|
return range.from >= range.to;
|
|
3238
3244
|
})) {
|
|
3239
|
-
return i18n_1._('Prop "ranges" has invalid entries: invalid range');
|
|
3245
|
+
return (0, i18n_1._)('Prop "ranges" has invalid entries: invalid range');
|
|
3240
3246
|
}
|
|
3241
3247
|
// check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
|
|
3242
|
-
if (ranges.length !== lodash_1.uniqBy(ranges, 'to').length || ranges.length !== lodash_1.uniqBy(ranges, 'from').length) {
|
|
3243
|
-
return i18n_1._('Prop "ranges" has invalid entries: duplicate values');
|
|
3248
|
+
if (ranges.length !== (0, lodash_1.uniqBy)(ranges, 'to').length || ranges.length !== (0, lodash_1.uniqBy)(ranges, 'from').length) {
|
|
3249
|
+
return (0, i18n_1._)('Prop "ranges" has invalid entries: duplicate values');
|
|
3244
3250
|
}
|
|
3245
|
-
var sortedRanges = exports.getSortedRanges(ranges);
|
|
3251
|
+
var sortedRanges = (0, exports.getSortedRanges)(ranges);
|
|
3246
3252
|
// check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
|
|
3247
3253
|
for (var i = 1; i < sortedRanges.length; i += 1) {
|
|
3248
3254
|
if (sortedRanges[i].from !== sortedRanges[i - 1].to) {
|
|
3249
|
-
return i18n_1._('Prop "ranges" has invalid entries: discontinuous ranges');
|
|
3255
|
+
return (0, i18n_1._)('Prop "ranges" has invalid entries: discontinuous ranges');
|
|
3250
3256
|
}
|
|
3251
3257
|
}
|
|
3252
3258
|
return null;
|
|
@@ -3280,12 +3286,12 @@ exports.getGaugeRange = getGaugeRange;
|
|
|
3280
3286
|
* @param {String} orientation
|
|
3281
3287
|
* @return {Array} cumulativeOffsets
|
|
3282
3288
|
*/
|
|
3283
|
-
var getGradientStopOffsets = function getGradientStopOffsets(
|
|
3284
|
-
var ranges =
|
|
3285
|
-
orientation =
|
|
3286
|
-
var
|
|
3287
|
-
min =
|
|
3288
|
-
max =
|
|
3289
|
+
var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
|
|
3290
|
+
var ranges = _ref18.ranges,
|
|
3291
|
+
orientation = _ref18.orientation;
|
|
3292
|
+
var _ref19 = (0, exports.getGaugeRange)(ranges),
|
|
3293
|
+
min = _ref19.min,
|
|
3294
|
+
max = _ref19.max;
|
|
3289
3295
|
var offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);
|
|
3290
3296
|
var offsets = ranges.map(function (range) {
|
|
3291
3297
|
return Math.abs(range.from - range.to) * offsetScale;
|
|
@@ -3307,9 +3313,9 @@ exports.getGradientStopOffsets = getGradientStopOffsets;
|
|
|
3307
3313
|
* @param {String} orientation
|
|
3308
3314
|
* @return {Array} stopColors
|
|
3309
3315
|
*/
|
|
3310
|
-
var getGradientStopColors = function getGradientStopColors(
|
|
3311
|
-
var ranges =
|
|
3312
|
-
orientation =
|
|
3316
|
+
var getGradientStopColors = function getGradientStopColors(_ref20) {
|
|
3317
|
+
var ranges = _ref20.ranges,
|
|
3318
|
+
orientation = _ref20.orientation;
|
|
3313
3319
|
var stopColors = ranges.map(function (range) {
|
|
3314
3320
|
return range.value;
|
|
3315
3321
|
});
|
|
@@ -3325,15 +3331,15 @@ exports.getGradientStopColors = getGradientStopColors;
|
|
|
3325
3331
|
* @param {String} orientation
|
|
3326
3332
|
* @return {Array} stops
|
|
3327
3333
|
*/
|
|
3328
|
-
var getGradientStops = function getGradientStops(
|
|
3329
|
-
var ranges =
|
|
3330
|
-
orientation =
|
|
3334
|
+
var getGradientStops = function getGradientStops(_ref21) {
|
|
3335
|
+
var ranges = _ref21.ranges,
|
|
3336
|
+
orientation = _ref21.orientation;
|
|
3331
3337
|
var stops = [];
|
|
3332
|
-
var offsets = exports.getGradientStopOffsets({
|
|
3338
|
+
var offsets = (0, exports.getGradientStopOffsets)({
|
|
3333
3339
|
ranges: ranges,
|
|
3334
3340
|
orientation: orientation
|
|
3335
3341
|
});
|
|
3336
|
-
var stopColors = exports.getGradientStopColors({
|
|
3342
|
+
var stopColors = (0, exports.getGradientStopColors)({
|
|
3337
3343
|
ranges: ranges,
|
|
3338
3344
|
orientation: orientation
|
|
3339
3345
|
});
|
|
@@ -3391,7 +3397,7 @@ var gaugeOptionsMapping = {
|
|
|
3391
3397
|
* @returns {Object}
|
|
3392
3398
|
*/
|
|
3393
3399
|
var mapToOldKey = function mapToOldKey(options) {
|
|
3394
|
-
return lodash_1.mapKeys(options, function (val, key) {
|
|
3400
|
+
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
3395
3401
|
return gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key;
|
|
3396
3402
|
});
|
|
3397
3403
|
};
|
|
@@ -3421,7 +3427,7 @@ var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options)
|
|
|
3421
3427
|
newOptions[percentKey] = false;
|
|
3422
3428
|
}
|
|
3423
3429
|
}
|
|
3424
|
-
return lodash_1.omit(newOptions, [optionString]);
|
|
3430
|
+
return (0, lodash_1.omit)(newOptions, [optionString]);
|
|
3425
3431
|
};
|
|
3426
3432
|
exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
3427
3433
|
/**
|
|
@@ -3432,10 +3438,10 @@ exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
|
3432
3438
|
* @returns {Object}
|
|
3433
3439
|
*/
|
|
3434
3440
|
var convertToGaugeProperties = function convertToGaugeProperties(originalOptions) {
|
|
3435
|
-
return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(function (options) {
|
|
3436
|
-
return exports.mapValueLabelDisplay('label', options);
|
|
3441
|
+
return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru(function (options) {
|
|
3442
|
+
return (0, exports.mapValueLabelDisplay)('label', options);
|
|
3437
3443
|
}).thru(function (options) {
|
|
3438
|
-
return exports.mapValueLabelDisplay('value', options);
|
|
3444
|
+
return (0, exports.mapValueLabelDisplay)('value', options);
|
|
3439
3445
|
}).value();
|
|
3440
3446
|
};
|
|
3441
3447
|
exports.convertToGaugeProperties = convertToGaugeProperties;
|