@splunk/visualizations 24.4.0 → 24.5.2
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_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_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_Choropleth_Svg_Choropleth_Svg_Placeholder_If_No_Svg_And_No_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Mostly_null.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Background_Color_af575a.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Basic_Markdown.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Begin_with_Text_Instead_of_Header.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Color_purple.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Markdown_Markdown_Font_Size_extraLarge.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_empty_columns_and_fields.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_invalid_label_data_specified.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_invalid_value_data_specified.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Pie_Pie_Placeholder_if_missing_column.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Icon_Single_Value_Icon_Use_Time_Type_Series_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Single_Value_Single_Value_Use_Time_Type_Series_Data.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Cell_Types.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Header_Visibility_fixed.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparkline_Custom.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Sparklines_Adv.png +0 -0
- package/.loki/reference/chrome_docker_Visualizations_Table_Table_Time_Zone_Time_Formatting.png +0 -0
- package/Area.js +246 -218
- package/Area.js.map +1 -1
- package/Bar.js +238 -210
- package/Bar.js.map +1 -1
- package/Bubble.js +231 -203
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.js +230 -197
- package/ChoroplethSvg.js.map +1 -1
- package/Column.js +238 -210
- package/Column.js.map +1 -1
- package/Ellipse.js +203 -170
- package/Ellipse.js.map +1 -1
- package/FillerGauge.js +222 -189
- package/FillerGauge.js.map +1 -1
- package/Image.js +199 -164
- package/Image.js.map +1 -1
- package/Line.js +239 -211
- package/Line.js.map +1 -1
- package/LinkGraph.js +264 -223
- package/LinkGraph.js.map +1 -1
- package/Map.config.js +39 -25
- package/Map.config.js.map +1 -1
- package/Map.js +460 -334
- package/Map.js.map +1 -1
- package/Markdown.config.js +29 -1
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +513 -267
- package/Markdown.js.map +1 -1
- package/MarkerGauge.js +941 -906
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.js +230 -196
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.js +309 -249
- package/Pie.js.map +1 -1
- package/Punchcard.js +263 -229
- package/Punchcard.js.map +1 -1
- package/Rectangle.js +217 -182
- package/Rectangle.js.map +1 -1
- package/Sankey.js +269 -230
- package/Sankey.js.map +1 -1
- package/Scatter.js +314 -286
- package/Scatter.js.map +1 -1
- package/SingleValue.js +398 -363
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +25 -25
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.js +2821 -2653
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.js +359 -324
- package/SingleValueRadial.js.map +1 -1
- package/Table.config.js +2 -1
- package/Table.config.js.map +1 -1
- package/Table.js +629 -347
- package/Table.js.map +1 -1
- package/common/Charting.js +21 -21
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +2 -2
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +18 -18
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +10 -10
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +10 -10
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +217 -174
- package/common/OptionsDoc.js.map +1 -1
- package/common/SplunkVisualization.js +4 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/ThemesDoc.js +26 -26
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +3 -3
- package/common/chartingUtils.js.map +1 -1
- package/common/gaugeUtils.js +2 -2
- package/common/shapeUtils.js +2 -2
- package/common/withDashboardViz.js +80 -48
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +13 -11
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 = 211);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -113,85 +113,479 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
|
|
|
113
113
|
|
|
114
114
|
/***/ }),
|
|
115
115
|
|
|
116
|
-
/***/
|
|
117
|
-
/***/ (function(module,
|
|
118
|
-
|
|
119
|
-
module.exports = require("@splunk/themes/variables");
|
|
120
|
-
|
|
121
|
-
/***/ }),
|
|
116
|
+
/***/ 100:
|
|
117
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
122
118
|
|
|
123
|
-
|
|
124
|
-
|
|
119
|
+
"use strict";
|
|
120
|
+
__webpack_require__.r(__webpack_exports__);
|
|
121
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MajorTick", function() { return MajorTick; });
|
|
122
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionMajorTick", function() { return positionMajorTick; });
|
|
123
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
124
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
125
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
126
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
127
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
|
128
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
129
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
130
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
131
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23);
|
|
132
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
125
133
|
|
|
126
|
-
module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
127
134
|
|
|
128
|
-
/***/ }),
|
|
129
135
|
|
|
130
|
-
/***/ 129:
|
|
131
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
132
136
|
|
|
133
|
-
"use strict";
|
|
134
137
|
|
|
138
|
+
var DEFAULT_NUM_OF_TICKS = 5;
|
|
139
|
+
var TICK_LENGTH_DELTA = 5;
|
|
140
|
+
var TICK_LABEL_PADDING_FACTOR = 3.2;
|
|
141
|
+
var MajorTickLine = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.line.withConfig({
|
|
142
|
+
displayName: "GaugeMajorTicks__MajorTickLine",
|
|
143
|
+
componentId: "mchiad-0"
|
|
144
|
+
})(["stroke:", ";stroke-width:2px;stroke-dasharray:", ";"], function (props) {
|
|
145
|
+
return props.majorTickStrokeColor;
|
|
146
|
+
}, function (props) {
|
|
147
|
+
return props.index === 0 ? 0 : 3;
|
|
148
|
+
});
|
|
149
|
+
var MajorTickLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.text.withConfig({
|
|
150
|
+
displayName: "GaugeMajorTicks__MajorTickLabel",
|
|
151
|
+
componentId: "mchiad-1"
|
|
152
|
+
})(["font-size:12px;font-family:Splunk Platform Sans,sans-serif;line-height:19px;fill:", ";text-anchor:middle;text-align:center;"], function (props) {
|
|
153
|
+
return props.majorTickFillColor;
|
|
154
|
+
});
|
|
155
|
+
var MajorTick = function MajorTick(_ref) {
|
|
156
|
+
var index = _ref.index,
|
|
157
|
+
x1 = _ref.x1,
|
|
158
|
+
y1 = _ref.y1,
|
|
159
|
+
x2 = _ref.x2,
|
|
160
|
+
y2 = _ref.y2,
|
|
161
|
+
showLabels = _ref.showLabels,
|
|
162
|
+
label = _ref.label,
|
|
163
|
+
labelX = _ref.labelX,
|
|
164
|
+
labelY = _ref.labelY,
|
|
165
|
+
majorTickStrokeColor = _ref.majorTickStrokeColor,
|
|
166
|
+
majorTickFillColor = _ref.majorTickFillColor;
|
|
167
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLine, {
|
|
168
|
+
index: index,
|
|
169
|
+
x1: x1,
|
|
170
|
+
y1: y1,
|
|
171
|
+
x2: x2,
|
|
172
|
+
y2: y2,
|
|
173
|
+
majorTickStrokeColor: majorTickStrokeColor
|
|
174
|
+
}), showLabels && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLabel, {
|
|
175
|
+
x: labelX,
|
|
176
|
+
y: labelY,
|
|
177
|
+
majorTickFillColor: majorTickFillColor
|
|
178
|
+
}, Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["isNumerial"])(label) ? Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["formatNumber"])(label, 0, {
|
|
179
|
+
useThousandSeparators: true,
|
|
180
|
+
useTrendUnits: true
|
|
181
|
+
}) : label));
|
|
182
|
+
};
|
|
183
|
+
MajorTick.propTypes = {
|
|
184
|
+
index: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
185
|
+
x1: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
186
|
+
y1: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
187
|
+
x2: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
188
|
+
y2: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
189
|
+
showLabels: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
190
|
+
label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
|
|
191
|
+
labelX: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
192
|
+
labelY: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
193
|
+
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
194
|
+
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* calculate position for each major tick
|
|
198
|
+
* @method positionMajorTick
|
|
199
|
+
* @param {Object} input
|
|
200
|
+
* @param {Number} input.width
|
|
201
|
+
* @param {Number} input.height
|
|
202
|
+
* @param {Number} input.startX start x for rendering the first major tick
|
|
203
|
+
* @param {Number} input.startY start y for rendering the first major tick
|
|
204
|
+
* @param {String} input.orientation
|
|
205
|
+
* @param {Number} input.numOfTicks how many ticks need to render
|
|
206
|
+
* @param {Number} input.i index of major tick
|
|
207
|
+
* @return {Object} MajorTick positions
|
|
208
|
+
*/
|
|
135
209
|
|
|
136
|
-
var
|
|
137
|
-
var
|
|
210
|
+
var positionMajorTick = function positionMajorTick(_ref2) {
|
|
211
|
+
var width = _ref2.width,
|
|
212
|
+
height = _ref2.height,
|
|
213
|
+
startX = _ref2.startX,
|
|
214
|
+
startY = _ref2.startY,
|
|
215
|
+
orientation = _ref2.orientation,
|
|
216
|
+
numOfTicks = _ref2.numOfTicks,
|
|
217
|
+
i = _ref2.i;
|
|
218
|
+
var x1 = startX;
|
|
219
|
+
var y1 = startY;
|
|
220
|
+
var x2 = startX;
|
|
221
|
+
var y2 = startY;
|
|
222
|
+
var labelX = startX;
|
|
223
|
+
var labelY;
|
|
138
224
|
|
|
139
|
-
|
|
140
|
-
|
|
225
|
+
if (orientation === 'vertical') {
|
|
226
|
+
var y = height / numOfTicks * (numOfTicks - i) + startY;
|
|
227
|
+
x1 -= TICK_LENGTH_DELTA;
|
|
228
|
+
y1 = y;
|
|
229
|
+
x2 += width + TICK_LENGTH_DELTA;
|
|
230
|
+
y2 = y;
|
|
231
|
+
labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR;
|
|
232
|
+
labelY = y;
|
|
233
|
+
} else {
|
|
234
|
+
var x = width / numOfTicks * i + startX;
|
|
235
|
+
x1 = x;
|
|
236
|
+
y1 -= TICK_LENGTH_DELTA;
|
|
237
|
+
x2 = x;
|
|
238
|
+
y2 += height + TICK_LENGTH_DELTA;
|
|
239
|
+
labelX = x;
|
|
240
|
+
labelY = y2 + 16;
|
|
141
241
|
}
|
|
142
242
|
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
243
|
+
return {
|
|
244
|
+
x1: x1,
|
|
245
|
+
y1: y1,
|
|
246
|
+
x2: x2,
|
|
247
|
+
y2: y2,
|
|
248
|
+
labelX: labelX,
|
|
249
|
+
labelY: labelY
|
|
250
|
+
};
|
|
147
251
|
};
|
|
148
252
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
});
|
|
152
|
-
exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
|
|
153
|
-
|
|
154
|
-
var lodash_1 = __webpack_require__(2);
|
|
253
|
+
var MajorTicks = function MajorTicks(_ref3) {
|
|
254
|
+
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
155
255
|
|
|
156
|
-
var
|
|
256
|
+
var width = props.width,
|
|
257
|
+
height = props.height,
|
|
258
|
+
startX = props.startX,
|
|
259
|
+
startY = props.startY,
|
|
260
|
+
min = props.min,
|
|
261
|
+
max = props.max,
|
|
262
|
+
majorUnit = props.majorUnit,
|
|
263
|
+
orientation = props.orientation,
|
|
264
|
+
showLabels = props.showLabels,
|
|
265
|
+
usePercentageRange = props.usePercentageRange,
|
|
266
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
267
|
+
majorTickStrokeColor = props.majorTickStrokeColor;
|
|
268
|
+
var range = max - min;
|
|
269
|
+
var numOfTicks = majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0 ? DEFAULT_NUM_OF_TICKS : range / majorUnit;
|
|
270
|
+
var majorTicks = [];
|
|
157
271
|
|
|
158
|
-
var
|
|
272
|
+
for (var i = 0; i <= numOfTicks; i += 1) {
|
|
273
|
+
var _positionMajorTick = positionMajorTick({
|
|
274
|
+
width: width,
|
|
275
|
+
height: height,
|
|
276
|
+
startX: startX,
|
|
277
|
+
startY: startY,
|
|
278
|
+
orientation: orientation,
|
|
279
|
+
numOfTicks: numOfTicks,
|
|
280
|
+
i: i
|
|
281
|
+
}),
|
|
282
|
+
x1 = _positionMajorTick.x1,
|
|
283
|
+
y1 = _positionMajorTick.y1,
|
|
284
|
+
x2 = _positionMajorTick.x2,
|
|
285
|
+
y2 = _positionMajorTick.y2,
|
|
286
|
+
labelX = _positionMajorTick.labelX,
|
|
287
|
+
labelY = _positionMajorTick.labelY;
|
|
159
288
|
|
|
160
|
-
|
|
289
|
+
var label = usePercentageRange ? "".concat(parseInt((i / numOfTicks - min / range) * 100, 10), "%") : parseInt(min + range / numOfTicks * i, 10);
|
|
290
|
+
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
291
|
+
key: i,
|
|
292
|
+
index: i,
|
|
293
|
+
x1: x1,
|
|
294
|
+
y1: y1,
|
|
295
|
+
x2: x2,
|
|
296
|
+
y2: y2,
|
|
297
|
+
showLabels: showLabels,
|
|
298
|
+
label: label,
|
|
299
|
+
labelX: labelX,
|
|
300
|
+
labelY: labelY,
|
|
301
|
+
majorTickFillColor: majorTickFillColor,
|
|
302
|
+
majorTickStrokeColor: majorTickStrokeColor
|
|
303
|
+
}));
|
|
304
|
+
} // if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
161
305
|
|
|
162
|
-
var withDashboardViz_1 = __webpack_require__(28);
|
|
163
306
|
|
|
164
|
-
|
|
307
|
+
if (!Number.isInteger(numOfTicks)) {
|
|
308
|
+
var extraNumOfTicks = Math.ceil(numOfTicks);
|
|
165
309
|
|
|
166
|
-
|
|
167
|
-
|
|
310
|
+
var _positionMajorTick2 = positionMajorTick({
|
|
311
|
+
width: width,
|
|
312
|
+
height: height,
|
|
313
|
+
startX: startX,
|
|
314
|
+
startY: startY,
|
|
315
|
+
orientation: orientation,
|
|
316
|
+
numOfTicks: extraNumOfTicks,
|
|
317
|
+
i: extraNumOfTicks
|
|
318
|
+
}),
|
|
319
|
+
_x = _positionMajorTick2.x1,
|
|
320
|
+
_y = _positionMajorTick2.y1,
|
|
321
|
+
_x2 = _positionMajorTick2.x2,
|
|
322
|
+
_y2 = _positionMajorTick2.y2,
|
|
323
|
+
_labelX = _positionMajorTick2.labelX,
|
|
324
|
+
_labelY = _positionMajorTick2.labelY;
|
|
168
325
|
|
|
169
|
-
|
|
170
|
-
|
|
326
|
+
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
327
|
+
key: extraNumOfTicks,
|
|
328
|
+
id: extraNumOfTicks,
|
|
329
|
+
x1: _x,
|
|
330
|
+
y1: _y,
|
|
331
|
+
x2: _x2,
|
|
332
|
+
y2: _y2,
|
|
333
|
+
showLabels: showLabels,
|
|
334
|
+
label: usePercentageRange ? '100%' : max,
|
|
335
|
+
labelX: _labelX,
|
|
336
|
+
labelY: _labelY,
|
|
337
|
+
majorTickFillColor: majorTickFillColor,
|
|
338
|
+
majorTickStrokeColor: majorTickStrokeColor
|
|
339
|
+
}));
|
|
340
|
+
}
|
|
171
341
|
|
|
172
|
-
|
|
173
|
-
var defaultColors = {
|
|
174
|
-
fillColor: config_1.default.themes.defaultFillColor(props),
|
|
175
|
-
majorTickFillColor: config_1.default.themes.majorTickFillColor(props),
|
|
176
|
-
majorTickStrokeColor: config_1.default.themes.majorTickStrokeColor(props),
|
|
177
|
-
valueMarkerFillColor: config_1.default.themes.valueMarkerFillColor(props),
|
|
178
|
-
valueMarkerLabelFillColor: config_1.default.themes.valueMarkerLabelFillColor(props)
|
|
179
|
-
};
|
|
180
|
-
return Object.assign(Object.assign({}, options), defaultColors);
|
|
342
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, majorTicks);
|
|
181
343
|
};
|
|
182
344
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
345
|
+
MajorTicks.propTypes = {
|
|
346
|
+
width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
347
|
+
height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
348
|
+
startX: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
349
|
+
startY: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
350
|
+
min: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
351
|
+
max: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
352
|
+
majorUnit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
|
|
353
|
+
orientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
354
|
+
showLabels: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
355
|
+
usePercentageRange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
356
|
+
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
357
|
+
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
358
|
+
};
|
|
359
|
+
MajorTicks.defaultProps = {
|
|
360
|
+
min: 0,
|
|
361
|
+
max: 100,
|
|
362
|
+
majorUnit: 'auto',
|
|
363
|
+
orientation: 'horizontal',
|
|
364
|
+
showLabels: true,
|
|
365
|
+
usePercentageRange: false
|
|
366
|
+
};
|
|
367
|
+
/* harmony default export */ __webpack_exports__["default"] = (MajorTicks);
|
|
368
|
+
|
|
369
|
+
/***/ }),
|
|
370
|
+
|
|
371
|
+
/***/ 101:
|
|
372
|
+
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
373
|
+
|
|
374
|
+
"use strict";
|
|
375
|
+
__webpack_require__.r(__webpack_exports__);
|
|
376
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionValueMarkerRect", function() { return positionValueMarkerRect; });
|
|
377
|
+
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionLabel", function() { return positionLabel; });
|
|
378
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(46);
|
|
379
|
+
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
380
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
381
|
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
382
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
|
383
|
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
384
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
385
|
+
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
386
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(23);
|
|
387
|
+
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
388
|
+
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
|
|
392
|
+
|
|
393
|
+
var MARKER_THICKNESS = 15;
|
|
394
|
+
var MARKER_INNER_LENGTH = 30;
|
|
395
|
+
var MARKER_LABEL_WIDTH = 60;
|
|
396
|
+
var MARKER_LABEL_HEIGHT = 25;
|
|
397
|
+
var RADIUS = 2;
|
|
398
|
+
var DELTA_LENGTH = 12;
|
|
399
|
+
var ValueMarkerRect = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.path.withConfig({
|
|
400
|
+
displayName: "GaugeValueMarker__ValueMarkerRect",
|
|
401
|
+
componentId: "sc-1bxkeao-0"
|
|
402
|
+
})(["stroke-width:2px;fill:", ";"], function (props) {
|
|
403
|
+
return props.valueMarkerFillColor;
|
|
404
|
+
});
|
|
405
|
+
var ValueMarkerLabelRect = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.rect.withConfig({
|
|
406
|
+
displayName: "GaugeValueMarker__ValueMarkerLabelRect",
|
|
407
|
+
componentId: "sc-1bxkeao-1"
|
|
408
|
+
})(["fill:", ";"], function (props) {
|
|
409
|
+
return props.valueMarkerFillColor;
|
|
410
|
+
});
|
|
411
|
+
var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.text.withConfig({
|
|
412
|
+
displayName: "GaugeValueMarker__ValueMarkerLabel",
|
|
413
|
+
componentId: "sc-1bxkeao-2"
|
|
414
|
+
})(["fill:", ";font-size:14px;font-family:Splunk Platform Sans,sans-serif;line-height:16px;text-anchor:middle;text-align:center;dominant-baseline:middle;"], function (props) {
|
|
415
|
+
return props.valueMarkerLabelFillColor;
|
|
416
|
+
});
|
|
417
|
+
/**
|
|
418
|
+
* calculate the path of Value Marker shape
|
|
419
|
+
* @method positionValueMarkerRect
|
|
420
|
+
* @param {Object} input
|
|
421
|
+
* @param {Number} input.x
|
|
422
|
+
* @param {Number} input.y
|
|
423
|
+
* @param {String} input.orientation
|
|
424
|
+
* @param {Number} input.valueMarkerRectLength
|
|
425
|
+
* @return {String} d containing a series of path commands that define the path to be
|
|
426
|
+
*/
|
|
427
|
+
|
|
428
|
+
var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
429
|
+
var x = _ref.x,
|
|
430
|
+
y = _ref.y,
|
|
431
|
+
orientation = _ref.orientation,
|
|
432
|
+
valueMarkerRectLength = _ref.valueMarkerRectLength;
|
|
433
|
+
var hLength = MARKER_THICKNESS;
|
|
434
|
+
var vLength = valueMarkerRectLength;
|
|
435
|
+
var markerStartX = x - MARKER_THICKNESS;
|
|
436
|
+
var markerStartY = y;
|
|
437
|
+
var innerHLength = hLength / 3;
|
|
438
|
+
var innerVLength = MARKER_INNER_LENGTH;
|
|
439
|
+
var innerStartX = markerStartX + innerHLength;
|
|
440
|
+
var innerStartY = markerStartY + 7;
|
|
441
|
+
|
|
442
|
+
if (orientation === 'vertical') {
|
|
443
|
+
hLength = valueMarkerRectLength;
|
|
444
|
+
vLength = MARKER_THICKNESS;
|
|
445
|
+
markerStartX = x;
|
|
446
|
+
innerHLength = MARKER_INNER_LENGTH;
|
|
447
|
+
innerVLength = vLength / 3;
|
|
448
|
+
innerStartX = markerStartX + 7;
|
|
449
|
+
innerStartY = markerStartY + innerVLength;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
return "M".concat(markerStartX, ",").concat(markerStartY, "h").concat(hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(RADIUS, "v").concat(vLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(RADIUS, "h").concat(-hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(-RADIUS, "v").concat(2 * RADIUS - vLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(-RADIUS, "z") + "M".concat(innerStartX, ",").concat(innerStartY, "v").concat(innerVLength - RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(RADIUS, "h").concat(innerHLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(-RADIUS, "v").concat(RADIUS - innerVLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(-RADIUS, "h").concat(2 * RADIUS - innerHLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(RADIUS, "z");
|
|
453
|
+
};
|
|
454
|
+
/**
|
|
455
|
+
* calculate the position of value marker label
|
|
456
|
+
* @method positionLabel
|
|
457
|
+
* @param {Object} input
|
|
458
|
+
* @param {Number} input.x
|
|
459
|
+
* @param {Number} input.y
|
|
460
|
+
* @param {Number} input.length gauge thickness
|
|
461
|
+
* @param {String} input.orientation
|
|
462
|
+
* @return {Object} positions
|
|
463
|
+
* @return {Number} positions.labelRectX x of value marker label rect
|
|
464
|
+
* @return {Number} positions.labelRectY y of value marker label rect
|
|
465
|
+
* @return {Number} positions.labelX x of value marker label text
|
|
466
|
+
* @return {Number} positions.labelY y of value marker label text
|
|
467
|
+
*/
|
|
468
|
+
|
|
469
|
+
var positionLabel = function positionLabel(_ref2) {
|
|
470
|
+
var x = _ref2.x,
|
|
471
|
+
y = _ref2.y,
|
|
472
|
+
length = _ref2.length,
|
|
473
|
+
orientation = _ref2.orientation; // for horizontal view
|
|
474
|
+
|
|
475
|
+
var labelRectX = x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;
|
|
476
|
+
var labelRectY = y + length;
|
|
477
|
+
|
|
478
|
+
if (orientation === 'vertical') {
|
|
479
|
+
labelRectX = x + length;
|
|
480
|
+
labelRectY = y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
var labelX = labelRectX + MARKER_LABEL_WIDTH / 2;
|
|
484
|
+
var labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;
|
|
485
|
+
return {
|
|
486
|
+
labelRectX: labelRectX,
|
|
487
|
+
labelRectY: labelRectY,
|
|
488
|
+
labelX: labelX,
|
|
489
|
+
labelY: labelY
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
|
|
493
|
+
var ValueMarker = function ValueMarker(_ref3) {
|
|
494
|
+
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
495
|
+
|
|
496
|
+
var x = props.x,
|
|
497
|
+
y = props.y,
|
|
498
|
+
length = props.length,
|
|
499
|
+
min = props.min,
|
|
500
|
+
max = props.max,
|
|
501
|
+
value = props.value,
|
|
502
|
+
orientation = props.orientation,
|
|
503
|
+
showValue = props.showValue,
|
|
504
|
+
usePercentageValue = props.usePercentageValue,
|
|
505
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
506
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
507
|
+
var valueMarkerRectLength = length + DELTA_LENGTH;
|
|
508
|
+
|
|
509
|
+
var _positionLabel = positionLabel({
|
|
510
|
+
x: x,
|
|
511
|
+
y: y,
|
|
512
|
+
length: length,
|
|
513
|
+
orientation: orientation
|
|
514
|
+
}),
|
|
515
|
+
labelRectX = _positionLabel.labelRectX,
|
|
516
|
+
labelRectY = _positionLabel.labelRectY,
|
|
517
|
+
labelX = _positionLabel.labelX,
|
|
518
|
+
labelY = _positionLabel.labelY;
|
|
519
|
+
|
|
520
|
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerRect, {
|
|
521
|
+
"data-test": "value-marker-rect",
|
|
522
|
+
d: positionValueMarkerRect({
|
|
523
|
+
x: x,
|
|
524
|
+
y: y,
|
|
525
|
+
orientation: orientation,
|
|
526
|
+
valueMarkerRectLength: valueMarkerRectLength
|
|
527
|
+
}),
|
|
528
|
+
valueMarkerFillColor: valueMarkerFillColor
|
|
529
|
+
}), showValue && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerLabelRect, {
|
|
530
|
+
"data-test": "value-marker-label-rect",
|
|
531
|
+
x: labelRectX,
|
|
532
|
+
y: labelRectY,
|
|
533
|
+
width: MARKER_LABEL_WIDTH,
|
|
534
|
+
height: MARKER_LABEL_HEIGHT,
|
|
535
|
+
rx: RADIUS,
|
|
536
|
+
ry: RADIUS,
|
|
537
|
+
valueMarkerFillColor: valueMarkerFillColor
|
|
538
|
+
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerLabel, {
|
|
539
|
+
"data-test": "value-marker-label",
|
|
540
|
+
x: labelX,
|
|
541
|
+
y: labelY,
|
|
542
|
+
valueMarkerLabelFillColor: valueMarkerLabelFillColor
|
|
543
|
+
}, usePercentageValue ? "".concat((value / (max - min) * 100).toFixed(2), "%") : Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["formatNumber"])(value, 0, {
|
|
544
|
+
useThousandSeparators: true,
|
|
545
|
+
useTrendUnits: true
|
|
546
|
+
}))));
|
|
547
|
+
};
|
|
548
|
+
|
|
549
|
+
ValueMarker.propTypes = {
|
|
550
|
+
x: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
551
|
+
y: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
552
|
+
length: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
553
|
+
min: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
554
|
+
max: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
555
|
+
value: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
556
|
+
orientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
557
|
+
showValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
558
|
+
usePercentageValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
559
|
+
valueMarkerFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
560
|
+
valueMarkerLabelFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
561
|
+
};
|
|
562
|
+
ValueMarker.defaultProps = {
|
|
563
|
+
min: 0,
|
|
564
|
+
max: 100,
|
|
565
|
+
orientation: 'horizontal',
|
|
566
|
+
showValue: true,
|
|
567
|
+
usePercentageValue: false
|
|
568
|
+
};
|
|
569
|
+
/* harmony default export */ __webpack_exports__["default"] = (ValueMarker);
|
|
570
|
+
|
|
571
|
+
/***/ }),
|
|
572
|
+
|
|
573
|
+
/***/ 11:
|
|
574
|
+
/***/ (function(module, exports) {
|
|
575
|
+
|
|
576
|
+
module.exports = require("@splunk/themes/variables");
|
|
577
|
+
|
|
578
|
+
/***/ }),
|
|
579
|
+
|
|
580
|
+
/***/ 12:
|
|
581
|
+
/***/ (function(module, exports) {
|
|
582
|
+
|
|
583
|
+
module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
584
|
+
|
|
585
|
+
/***/ }),
|
|
586
|
+
|
|
587
|
+
/***/ 13:
|
|
588
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
195
589
|
|
|
196
590
|
"use strict";
|
|
197
591
|
|
|
@@ -265,7 +659,7 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
265
659
|
|
|
266
660
|
return React.createElement(FixSizeItem, {
|
|
267
661
|
"data-test": "fix-size-item",
|
|
268
|
-
"data-splunk-visualization-version": "24.
|
|
662
|
+
"data-splunk-visualization-version": "24.5.2 - c5ebe25a8",
|
|
269
663
|
width: width,
|
|
270
664
|
height: height,
|
|
271
665
|
backgroundColor: backgroundColor
|
|
@@ -287,19 +681,82 @@ exports.default = withFixedSizeContainer;
|
|
|
287
681
|
|
|
288
682
|
/***/ }),
|
|
289
683
|
|
|
290
|
-
/***/
|
|
291
|
-
/***/ (function(module, exports) {
|
|
684
|
+
/***/ 131:
|
|
685
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
292
686
|
|
|
293
|
-
|
|
687
|
+
"use strict";
|
|
294
688
|
|
|
295
|
-
/***/ }),
|
|
296
689
|
|
|
297
|
-
|
|
298
|
-
|
|
690
|
+
var __rest = this && this.__rest || function (s, e) {
|
|
691
|
+
var t = {};
|
|
299
692
|
|
|
300
|
-
|
|
693
|
+
for (var p in s) {
|
|
694
|
+
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
695
|
+
}
|
|
301
696
|
|
|
302
|
-
|
|
697
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
698
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
699
|
+
}
|
|
700
|
+
return t;
|
|
701
|
+
};
|
|
702
|
+
|
|
703
|
+
Object.defineProperty(exports, "__esModule", {
|
|
704
|
+
value: true
|
|
705
|
+
});
|
|
706
|
+
exports.config = exports.computeVizProps = exports.PureMarkerGauge = void 0;
|
|
707
|
+
|
|
708
|
+
var lodash_1 = __webpack_require__(2);
|
|
709
|
+
|
|
710
|
+
var MarkerGauge_1 = __webpack_require__(212);
|
|
711
|
+
|
|
712
|
+
var config_1 = __webpack_require__(214);
|
|
713
|
+
|
|
714
|
+
exports.config = config_1.default;
|
|
715
|
+
|
|
716
|
+
var withDashboardViz_1 = __webpack_require__(29);
|
|
717
|
+
|
|
718
|
+
var gaugeUtils_1 = __webpack_require__(76);
|
|
719
|
+
|
|
720
|
+
exports.PureMarkerGauge = MarkerGauge_1.default;
|
|
721
|
+
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
722
|
+
|
|
723
|
+
var computeVizProps = function computeVizProps(_a) {
|
|
724
|
+
var props = __rest(_a, []);
|
|
725
|
+
|
|
726
|
+
var options = lodash_1.chain(props).pick(validOptions).thru(gaugeUtils_1.convertToGaugeProperties).value();
|
|
727
|
+
var defaultColors = {
|
|
728
|
+
fillColor: config_1.default.themes.defaultFillColor(props),
|
|
729
|
+
majorTickFillColor: config_1.default.themes.majorTickFillColor(props),
|
|
730
|
+
majorTickStrokeColor: config_1.default.themes.majorTickStrokeColor(props),
|
|
731
|
+
valueMarkerFillColor: config_1.default.themes.valueMarkerFillColor(props),
|
|
732
|
+
valueMarkerLabelFillColor: config_1.default.themes.valueMarkerLabelFillColor(props)
|
|
733
|
+
};
|
|
734
|
+
return Object.assign(Object.assign({}, options), defaultColors);
|
|
735
|
+
};
|
|
736
|
+
|
|
737
|
+
exports.computeVizProps = computeVizProps;
|
|
738
|
+
var viz = withDashboardViz_1.default({
|
|
739
|
+
ReactViz: MarkerGauge_1.default,
|
|
740
|
+
computeVizProps: exports.computeVizProps,
|
|
741
|
+
vizConfig: config_1.default
|
|
742
|
+
});
|
|
743
|
+
exports.default = viz;
|
|
744
|
+
|
|
745
|
+
/***/ }),
|
|
746
|
+
|
|
747
|
+
/***/ 14:
|
|
748
|
+
/***/ (function(module, exports) {
|
|
749
|
+
|
|
750
|
+
module.exports = require("@splunk/visualizations-shared/style");
|
|
751
|
+
|
|
752
|
+
/***/ }),
|
|
753
|
+
|
|
754
|
+
/***/ 15:
|
|
755
|
+
/***/ (function(module, exports) {
|
|
756
|
+
|
|
757
|
+
module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
758
|
+
|
|
759
|
+
/***/ }),
|
|
303
760
|
|
|
304
761
|
/***/ 16:
|
|
305
762
|
/***/ (function(module, exports) {
|
|
@@ -315,6 +772,13 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
|
315
772
|
|
|
316
773
|
/***/ }),
|
|
317
774
|
|
|
775
|
+
/***/ 19:
|
|
776
|
+
/***/ (function(module, exports) {
|
|
777
|
+
|
|
778
|
+
module.exports = require("@splunk/visualization-context/TimezoneContext");
|
|
779
|
+
|
|
780
|
+
/***/ }),
|
|
781
|
+
|
|
318
782
|
/***/ 2:
|
|
319
783
|
/***/ (function(module, exports) {
|
|
320
784
|
|
|
@@ -322,14 +786,14 @@ module.exports = require("lodash");
|
|
|
322
786
|
|
|
323
787
|
/***/ }),
|
|
324
788
|
|
|
325
|
-
/***/
|
|
789
|
+
/***/ 21:
|
|
326
790
|
/***/ (function(module, exports) {
|
|
327
791
|
|
|
328
792
|
module.exports = require("@babel/runtime/helpers/typeof");
|
|
329
793
|
|
|
330
794
|
/***/ }),
|
|
331
795
|
|
|
332
|
-
/***/
|
|
796
|
+
/***/ 211:
|
|
333
797
|
/***/ (function(module, exports, __webpack_require__) {
|
|
334
798
|
|
|
335
799
|
"use strict";
|
|
@@ -359,9 +823,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
359
823
|
});
|
|
360
824
|
exports.default = void 0;
|
|
361
825
|
|
|
362
|
-
__exportStar(__webpack_require__(
|
|
826
|
+
__exportStar(__webpack_require__(131), exports);
|
|
363
827
|
|
|
364
|
-
var MarkerGauge_1 = __webpack_require__(
|
|
828
|
+
var MarkerGauge_1 = __webpack_require__(131);
|
|
365
829
|
|
|
366
830
|
Object.defineProperty(exports, "default", {
|
|
367
831
|
enumerable: true,
|
|
@@ -372,7 +836,7 @@ Object.defineProperty(exports, "default", {
|
|
|
372
836
|
|
|
373
837
|
/***/ }),
|
|
374
838
|
|
|
375
|
-
/***/
|
|
839
|
+
/***/ 212:
|
|
376
840
|
/***/ (function(module, exports, __webpack_require__) {
|
|
377
841
|
|
|
378
842
|
"use strict";
|
|
@@ -413,13 +877,13 @@ var SizeAwareWrapper_1 = __webpack_require__(17);
|
|
|
413
877
|
|
|
414
878
|
var Message_1 = __webpack_require__(9);
|
|
415
879
|
|
|
416
|
-
var id_1 = __webpack_require__(
|
|
880
|
+
var id_1 = __webpack_require__(213);
|
|
417
881
|
|
|
418
|
-
var gaugeUtils_1 = __webpack_require__(
|
|
882
|
+
var gaugeUtils_1 = __webpack_require__(76);
|
|
419
883
|
|
|
420
|
-
var GaugeMajorTicks_1 = __webpack_require__(
|
|
884
|
+
var GaugeMajorTicks_1 = __webpack_require__(100);
|
|
421
885
|
|
|
422
|
-
var GaugeValueMarker_1 = __webpack_require__(
|
|
886
|
+
var GaugeValueMarker_1 = __webpack_require__(101);
|
|
423
887
|
|
|
424
888
|
var MAX_VERTICAL_CONTAINER_WIDTH = 200;
|
|
425
889
|
var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
|
|
@@ -743,21 +1207,14 @@ exports.default = MarkerGauge;
|
|
|
743
1207
|
|
|
744
1208
|
/***/ }),
|
|
745
1209
|
|
|
746
|
-
/***/
|
|
747
|
-
/***/ (function(module, exports) {
|
|
748
|
-
|
|
749
|
-
module.exports = require("@splunk/themes/pick");
|
|
750
|
-
|
|
751
|
-
/***/ }),
|
|
752
|
-
|
|
753
|
-
/***/ 210:
|
|
1210
|
+
/***/ 213:
|
|
754
1211
|
/***/ (function(module, exports) {
|
|
755
1212
|
|
|
756
1213
|
module.exports = require("@splunk/ui-utils/id");
|
|
757
1214
|
|
|
758
1215
|
/***/ }),
|
|
759
1216
|
|
|
760
|
-
/***/
|
|
1217
|
+
/***/ 214:
|
|
761
1218
|
/***/ (function(module, exports, __webpack_require__) {
|
|
762
1219
|
|
|
763
1220
|
"use strict";
|
|
@@ -769,25 +1226,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
769
1226
|
|
|
770
1227
|
var i18n_1 = __webpack_require__(3);
|
|
771
1228
|
|
|
772
|
-
var GaugeMarker_1 = __webpack_require__(
|
|
1229
|
+
var GaugeMarker_1 = __webpack_require__(215);
|
|
773
1230
|
|
|
774
|
-
var placeholders_1 = __webpack_require__(
|
|
1231
|
+
var placeholders_1 = __webpack_require__(44);
|
|
775
1232
|
|
|
776
1233
|
var schemaUtils_1 = __webpack_require__(15);
|
|
777
1234
|
|
|
778
1235
|
var variables_1 = __webpack_require__(11);
|
|
779
1236
|
|
|
780
|
-
var pick_1 = __webpack_require__(
|
|
1237
|
+
var pick_1 = __webpack_require__(22);
|
|
781
1238
|
|
|
782
|
-
var Gauge_1 = __webpack_require__(
|
|
1239
|
+
var Gauge_1 = __webpack_require__(99);
|
|
783
1240
|
|
|
784
1241
|
var VizBehavior_1 = __webpack_require__(5);
|
|
785
1242
|
|
|
786
|
-
var VizCategory_1 = __webpack_require__(
|
|
1243
|
+
var VizCategory_1 = __webpack_require__(28);
|
|
787
1244
|
|
|
788
1245
|
var configUtils_1 = __webpack_require__(6);
|
|
789
1246
|
|
|
790
|
-
var BackgroundColor_1 = __webpack_require__(
|
|
1247
|
+
var BackgroundColor_1 = __webpack_require__(48);
|
|
791
1248
|
|
|
792
1249
|
var dataContract = {
|
|
793
1250
|
requiredDataSources: [{
|
|
@@ -1010,7 +1467,7 @@ exports.default = configUtils_1.enhanceConfig(config);
|
|
|
1010
1467
|
|
|
1011
1468
|
/***/ }),
|
|
1012
1469
|
|
|
1013
|
-
/***/
|
|
1470
|
+
/***/ 215:
|
|
1014
1471
|
/***/ (function(module, exports) {
|
|
1015
1472
|
|
|
1016
1473
|
module.exports = require("@splunk/react-icons/GaugeMarker");
|
|
@@ -1020,11 +1477,18 @@ module.exports = require("@splunk/react-icons/GaugeMarker");
|
|
|
1020
1477
|
/***/ 22:
|
|
1021
1478
|
/***/ (function(module, exports) {
|
|
1022
1479
|
|
|
1023
|
-
module.exports = require("@splunk/
|
|
1480
|
+
module.exports = require("@splunk/themes/pick");
|
|
1024
1481
|
|
|
1025
1482
|
/***/ }),
|
|
1026
1483
|
|
|
1027
1484
|
/***/ 23:
|
|
1485
|
+
/***/ (function(module, exports) {
|
|
1486
|
+
|
|
1487
|
+
module.exports = require("@splunk/visualizations-shared/numberUtils");
|
|
1488
|
+
|
|
1489
|
+
/***/ }),
|
|
1490
|
+
|
|
1491
|
+
/***/ 24:
|
|
1028
1492
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1029
1493
|
|
|
1030
1494
|
"use strict";
|
|
@@ -1058,13 +1522,105 @@ exports.pickFieldFromJSONSchema = pickFieldFromJSONSchema;
|
|
|
1058
1522
|
|
|
1059
1523
|
/***/ }),
|
|
1060
1524
|
|
|
1061
|
-
/***/
|
|
1525
|
+
/***/ 25:
|
|
1526
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1527
|
+
|
|
1528
|
+
"use strict";
|
|
1529
|
+
|
|
1530
|
+
|
|
1531
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1532
|
+
value: true
|
|
1533
|
+
});
|
|
1534
|
+
exports.shouldShowIconPlaceholder = void 0;
|
|
1535
|
+
|
|
1536
|
+
var React = __webpack_require__(1);
|
|
1537
|
+
|
|
1538
|
+
var T = __webpack_require__(0);
|
|
1539
|
+
|
|
1540
|
+
var lodash_1 = __webpack_require__(2);
|
|
1541
|
+
|
|
1542
|
+
var i18n_1 = __webpack_require__(3);
|
|
1543
|
+
|
|
1544
|
+
var Message_1 = __webpack_require__(9);
|
|
1545
|
+
|
|
1546
|
+
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1547
|
+
/**
|
|
1548
|
+
* @method shouldShowIconPlaceholder
|
|
1549
|
+
* @param {object} dataSources
|
|
1550
|
+
* @param {boolean} loading
|
|
1551
|
+
* @returns {boolean}
|
|
1552
|
+
*/
|
|
1553
|
+
|
|
1554
|
+
|
|
1555
|
+
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
1556
|
+
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1557
|
+
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1558
|
+
var noData = data === undefined;
|
|
1559
|
+
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1560
|
+
var noFields = fields === undefined;
|
|
1561
|
+
return loading || noData || noFields;
|
|
1562
|
+
};
|
|
1563
|
+
|
|
1564
|
+
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
1565
|
+
var propTypes = {
|
|
1566
|
+
icon: T.func,
|
|
1567
|
+
width: T.oneOfType([T.string, T.number]),
|
|
1568
|
+
height: T.oneOfType([T.string, T.number]),
|
|
1569
|
+
// eslint-disable-next-line react/no-unused-prop-types
|
|
1570
|
+
backgroundColor: T.string,
|
|
1571
|
+
iconColor: T.string
|
|
1572
|
+
};
|
|
1573
|
+
/**
|
|
1574
|
+
* @method IconPlaceholder
|
|
1575
|
+
* @param {IconPlaceholderProps} props
|
|
1576
|
+
* @returns {React.ReactElement}
|
|
1577
|
+
*/
|
|
1578
|
+
|
|
1579
|
+
var IconPlaceholder = function IconPlaceholder(props) {
|
|
1580
|
+
var width = props.width,
|
|
1581
|
+
height = props.height,
|
|
1582
|
+
icon = props.icon,
|
|
1583
|
+
iconColor = props.iconColor;
|
|
1584
|
+
|
|
1585
|
+
if (icon) {
|
|
1586
|
+
return React.createElement(icon, {
|
|
1587
|
+
style: {
|
|
1588
|
+
left: '50%',
|
|
1589
|
+
top: '50%',
|
|
1590
|
+
color: iconColor,
|
|
1591
|
+
opacity: 0.15,
|
|
1592
|
+
position: 'absolute',
|
|
1593
|
+
transform: 'translate(-50%, -50%)'
|
|
1594
|
+
},
|
|
1595
|
+
width: '50%',
|
|
1596
|
+
height: '50%'
|
|
1597
|
+
});
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1600
|
+
return React.createElement(Message_1.default, {
|
|
1601
|
+
width: width,
|
|
1602
|
+
height: height,
|
|
1603
|
+
level: "warning",
|
|
1604
|
+
message: i18n_1._('No DataSource Connected')
|
|
1605
|
+
});
|
|
1606
|
+
};
|
|
1607
|
+
|
|
1608
|
+
IconPlaceholder.propTypes = propTypes;
|
|
1609
|
+
IconPlaceholder.defaultProps = {
|
|
1610
|
+
width: '100%',
|
|
1611
|
+
height: 250
|
|
1612
|
+
};
|
|
1613
|
+
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1614
|
+
|
|
1615
|
+
/***/ }),
|
|
1616
|
+
|
|
1617
|
+
/***/ 26:
|
|
1062
1618
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1063
1619
|
|
|
1064
1620
|
"use strict";
|
|
1065
1621
|
|
|
1066
1622
|
|
|
1067
|
-
var _defineProperty = __webpack_require__(
|
|
1623
|
+
var _defineProperty = __webpack_require__(7);
|
|
1068
1624
|
|
|
1069
1625
|
Object.defineProperty(exports, "__esModule", {
|
|
1070
1626
|
value: true
|
|
@@ -1075,7 +1631,7 @@ var T = __webpack_require__(0);
|
|
|
1075
1631
|
|
|
1076
1632
|
var lodash_1 = __webpack_require__(2);
|
|
1077
1633
|
|
|
1078
|
-
var DataSource_1 = __webpack_require__(
|
|
1634
|
+
var DataSource_1 = __webpack_require__(36);
|
|
1079
1635
|
|
|
1080
1636
|
exports.SortParamsPropTypes = T.shape({
|
|
1081
1637
|
currentSortKey: T.string,
|
|
@@ -1129,7 +1685,7 @@ exports.getSortingParams = getSortingParams;
|
|
|
1129
1685
|
|
|
1130
1686
|
/***/ }),
|
|
1131
1687
|
|
|
1132
|
-
/***/
|
|
1688
|
+
/***/ 27:
|
|
1133
1689
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1134
1690
|
|
|
1135
1691
|
"use strict";
|
|
@@ -1194,7 +1750,7 @@ exports.getPaginationParams = getPaginationParams;
|
|
|
1194
1750
|
|
|
1195
1751
|
/***/ }),
|
|
1196
1752
|
|
|
1197
|
-
/***/
|
|
1753
|
+
/***/ 28:
|
|
1198
1754
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1199
1755
|
|
|
1200
1756
|
"use strict";
|
|
@@ -1203,159 +1759,71 @@ exports.getPaginationParams = getPaginationParams;
|
|
|
1203
1759
|
Object.defineProperty(exports, "__esModule", {
|
|
1204
1760
|
value: true
|
|
1205
1761
|
});
|
|
1206
|
-
exports.
|
|
1762
|
+
exports.VizCategory = void 0;
|
|
1763
|
+
var VizCategory;
|
|
1207
1764
|
|
|
1208
|
-
|
|
1765
|
+
(function (VizCategory) {
|
|
1766
|
+
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1767
|
+
VizCategory["TRENDS"] = "Trends";
|
|
1768
|
+
VizCategory["COMPARISONS"] = "Comparisons";
|
|
1769
|
+
VizCategory["TABLE"] = "Table";
|
|
1770
|
+
VizCategory["GAUGE"] = "Gauge";
|
|
1771
|
+
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
1772
|
+
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
1773
|
+
VizCategory["SHAPES"] = "Shapes";
|
|
1774
|
+
VizCategory["MISC"] = "misc";
|
|
1775
|
+
VizCategory["FLOW"] = "Flow";
|
|
1776
|
+
VizCategory["CORRELATION"] = "Correlation";
|
|
1777
|
+
VizCategory["SPATIAL"] = "Spatial";
|
|
1778
|
+
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
1209
1779
|
|
|
1210
|
-
|
|
1780
|
+
/***/ }),
|
|
1781
|
+
|
|
1782
|
+
/***/ 29:
|
|
1783
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
1784
|
+
|
|
1785
|
+
"use strict";
|
|
1786
|
+
|
|
1787
|
+
|
|
1788
|
+
Object.defineProperty(exports, "__esModule", {
|
|
1789
|
+
value: true
|
|
1790
|
+
});
|
|
1791
|
+
|
|
1792
|
+
var React = __webpack_require__(1);
|
|
1211
1793
|
|
|
1212
1794
|
var lodash_1 = __webpack_require__(2);
|
|
1213
1795
|
|
|
1214
|
-
var
|
|
1796
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(30);
|
|
1215
1797
|
|
|
1216
|
-
var
|
|
1798
|
+
var Options_1 = __webpack_require__(31);
|
|
1217
1799
|
|
|
1218
|
-
var
|
|
1219
|
-
/**
|
|
1220
|
-
* @method shouldShowIconPlaceholder
|
|
1221
|
-
* @param {object} dataSources
|
|
1222
|
-
* @param {boolean} loading
|
|
1223
|
-
* @returns {boolean}
|
|
1224
|
-
*/
|
|
1800
|
+
var SanitizeProps_1 = __webpack_require__(32);
|
|
1225
1801
|
|
|
1802
|
+
var TimezoneContext_1 = __webpack_require__(19);
|
|
1226
1803
|
|
|
1227
|
-
var
|
|
1228
|
-
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
1229
|
-
var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
|
|
1230
|
-
var noData = data === undefined;
|
|
1231
|
-
var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
|
|
1232
|
-
var noFields = fields === undefined;
|
|
1233
|
-
return loading || noData || noFields;
|
|
1234
|
-
};
|
|
1804
|
+
var moment_1 = __webpack_require__(33);
|
|
1235
1805
|
|
|
1236
|
-
|
|
1237
|
-
var propTypes = {
|
|
1238
|
-
icon: T.func,
|
|
1239
|
-
width: T.oneOfType([T.string, T.number]),
|
|
1240
|
-
height: T.oneOfType([T.string, T.number]),
|
|
1241
|
-
// eslint-disable-next-line react/no-unused-prop-types
|
|
1242
|
-
backgroundColor: T.string,
|
|
1243
|
-
iconColor: T.string
|
|
1244
|
-
};
|
|
1245
|
-
/**
|
|
1246
|
-
* @method IconPlaceholder
|
|
1247
|
-
* @param {IconPlaceholderProps} props
|
|
1248
|
-
* @returns {React.ReactElement}
|
|
1249
|
-
*/
|
|
1806
|
+
var styled_components_1 = __webpack_require__(4);
|
|
1250
1807
|
|
|
1251
|
-
var
|
|
1252
|
-
var width = props.width,
|
|
1253
|
-
height = props.height,
|
|
1254
|
-
icon = props.icon,
|
|
1255
|
-
iconColor = props.iconColor;
|
|
1256
|
-
|
|
1257
|
-
if (icon) {
|
|
1258
|
-
return React.createElement(icon, {
|
|
1259
|
-
style: {
|
|
1260
|
-
left: '50%',
|
|
1261
|
-
top: '50%',
|
|
1262
|
-
color: iconColor,
|
|
1263
|
-
opacity: 0.15,
|
|
1264
|
-
position: 'absolute',
|
|
1265
|
-
transform: 'translate(-50%, -50%)'
|
|
1266
|
-
},
|
|
1267
|
-
width: '50%',
|
|
1268
|
-
height: '50%'
|
|
1269
|
-
});
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
return React.createElement(Message_1.default, {
|
|
1273
|
-
width: width,
|
|
1274
|
-
height: height,
|
|
1275
|
-
level: "warning",
|
|
1276
|
-
message: i18n_1._('No DataSource Connected')
|
|
1277
|
-
});
|
|
1278
|
-
};
|
|
1279
|
-
|
|
1280
|
-
IconPlaceholder.propTypes = propTypes;
|
|
1281
|
-
IconPlaceholder.defaultProps = {
|
|
1282
|
-
width: '100%',
|
|
1283
|
-
height: 250
|
|
1284
|
-
};
|
|
1285
|
-
exports.default = FixedSizeContainer_1.default(IconPlaceholder);
|
|
1286
|
-
|
|
1287
|
-
/***/ }),
|
|
1288
|
-
|
|
1289
|
-
/***/ 27:
|
|
1290
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1291
|
-
|
|
1292
|
-
"use strict";
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1296
|
-
value: true
|
|
1297
|
-
});
|
|
1298
|
-
exports.VizCategory = void 0;
|
|
1299
|
-
var VizCategory;
|
|
1300
|
-
|
|
1301
|
-
(function (VizCategory) {
|
|
1302
|
-
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
1303
|
-
VizCategory["TRENDS"] = "Trends";
|
|
1304
|
-
VizCategory["COMPARISONS"] = "Comparisons";
|
|
1305
|
-
VizCategory["TABLE"] = "Table";
|
|
1306
|
-
VizCategory["GAUGE"] = "Gauge";
|
|
1307
|
-
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
1308
|
-
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
1309
|
-
VizCategory["SHAPES"] = "Shapes";
|
|
1310
|
-
VizCategory["MISC"] = "misc";
|
|
1311
|
-
VizCategory["FLOW"] = "Flow";
|
|
1312
|
-
VizCategory["CORRELATION"] = "Correlation";
|
|
1313
|
-
VizCategory["SPATIAL"] = "Spatial";
|
|
1314
|
-
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
1315
|
-
|
|
1316
|
-
/***/ }),
|
|
1317
|
-
|
|
1318
|
-
/***/ 28:
|
|
1319
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1320
|
-
|
|
1321
|
-
"use strict";
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1325
|
-
value: true
|
|
1326
|
-
});
|
|
1327
|
-
|
|
1328
|
-
var React = __webpack_require__(1);
|
|
1329
|
-
|
|
1330
|
-
var lodash_1 = __webpack_require__(2);
|
|
1331
|
-
|
|
1332
|
-
var getSettingsFromThemedProps_1 = __webpack_require__(29);
|
|
1333
|
-
|
|
1334
|
-
var Options_1 = __webpack_require__(30);
|
|
1335
|
-
|
|
1336
|
-
var SanitizeProps_1 = __webpack_require__(31);
|
|
1337
|
-
|
|
1338
|
-
var styled_components_1 = __webpack_require__(4);
|
|
1339
|
-
|
|
1340
|
-
var SplunkVisualization_1 = __webpack_require__(32);
|
|
1808
|
+
var SplunkVisualization_1 = __webpack_require__(34);
|
|
1341
1809
|
|
|
1342
1810
|
var VizBehavior_1 = __webpack_require__(5);
|
|
1343
1811
|
|
|
1344
|
-
var getSorting_1 = __webpack_require__(
|
|
1812
|
+
var getSorting_1 = __webpack_require__(26);
|
|
1345
1813
|
|
|
1346
|
-
var getPagination_1 = __webpack_require__(
|
|
1814
|
+
var getPagination_1 = __webpack_require__(27);
|
|
1347
1815
|
|
|
1348
|
-
var useDeepMemo_1 = __webpack_require__(
|
|
1816
|
+
var useDeepMemo_1 = __webpack_require__(37);
|
|
1349
1817
|
|
|
1350
|
-
var JSONSchemaUtils_1 = __webpack_require__(
|
|
1818
|
+
var JSONSchemaUtils_1 = __webpack_require__(24);
|
|
1351
1819
|
|
|
1352
|
-
var MissingPropsMessage_1 = __webpack_require__(
|
|
1820
|
+
var MissingPropsMessage_1 = __webpack_require__(38);
|
|
1353
1821
|
|
|
1354
|
-
var withEditModeCover_1 = __webpack_require__(
|
|
1822
|
+
var withEditModeCover_1 = __webpack_require__(39);
|
|
1355
1823
|
|
|
1356
|
-
var withPlaceholder_1 = __webpack_require__(
|
|
1824
|
+
var withPlaceholder_1 = __webpack_require__(40);
|
|
1357
1825
|
|
|
1358
|
-
var hocUtils_1 = __webpack_require__(
|
|
1826
|
+
var hocUtils_1 = __webpack_require__(8);
|
|
1359
1827
|
/**
|
|
1360
1828
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
1361
1829
|
* @param {DashboardVizOpts} opts
|
|
@@ -1388,6 +1856,23 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1388
1856
|
theme = props.theme,
|
|
1389
1857
|
onRequestParamsChange = props.onRequestParamsChange;
|
|
1390
1858
|
|
|
1859
|
+
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
1860
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1861
|
+
|
|
1862
|
+
if (serializedTimezone) {
|
|
1863
|
+
/*
|
|
1864
|
+
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
1865
|
+
This ensures that if a timezone was provided via TimezoneContext @splunk/moment time formatting
|
|
1866
|
+
will use it.
|
|
1867
|
+
@TODO(pwied):
|
|
1868
|
+
- remove when we moved away from @splunk/moment
|
|
1869
|
+
- provide timezone context to dynamic option evaluation phase
|
|
1870
|
+
*/
|
|
1871
|
+
if (!moment_1.default.getDefaultSplunkTimezone()) {
|
|
1872
|
+
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
|
|
1391
1876
|
var themeFunc = function themeFunc(themeVar) {
|
|
1392
1877
|
var _a, _b;
|
|
1393
1878
|
|
|
@@ -1416,7 +1901,7 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1416
1901
|
console.error("unexpected error evaluating options: + ".concat(e.message));
|
|
1417
1902
|
return {};
|
|
1418
1903
|
}
|
|
1419
|
-
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources]); // useEffect hook needs to be initialized before any early returns
|
|
1904
|
+
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone]); // useEffect hook needs to be initialized before any early returns
|
|
1420
1905
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1421
1906
|
|
|
1422
1907
|
React.useEffect(function () {
|
|
@@ -1540,35 +2025,42 @@ exports.default = withDashboardViz;
|
|
|
1540
2025
|
|
|
1541
2026
|
/***/ }),
|
|
1542
2027
|
|
|
1543
|
-
/***/
|
|
2028
|
+
/***/ 3:
|
|
1544
2029
|
/***/ (function(module, exports) {
|
|
1545
2030
|
|
|
1546
|
-
module.exports = require("@splunk/
|
|
2031
|
+
module.exports = require("@splunk/ui-utils/i18n");
|
|
1547
2032
|
|
|
1548
2033
|
/***/ }),
|
|
1549
2034
|
|
|
1550
|
-
/***/
|
|
2035
|
+
/***/ 30:
|
|
1551
2036
|
/***/ (function(module, exports) {
|
|
1552
2037
|
|
|
1553
|
-
module.exports = require("@splunk/
|
|
2038
|
+
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1554
2039
|
|
|
1555
2040
|
/***/ }),
|
|
1556
2041
|
|
|
1557
|
-
/***/
|
|
2042
|
+
/***/ 31:
|
|
1558
2043
|
/***/ (function(module, exports) {
|
|
1559
2044
|
|
|
1560
2045
|
module.exports = require("@splunk/visualization-encoding/Options");
|
|
1561
2046
|
|
|
1562
2047
|
/***/ }),
|
|
1563
2048
|
|
|
1564
|
-
/***/
|
|
2049
|
+
/***/ 32:
|
|
1565
2050
|
/***/ (function(module, exports) {
|
|
1566
2051
|
|
|
1567
2052
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1568
2053
|
|
|
1569
2054
|
/***/ }),
|
|
1570
2055
|
|
|
1571
|
-
/***/
|
|
2056
|
+
/***/ 33:
|
|
2057
|
+
/***/ (function(module, exports) {
|
|
2058
|
+
|
|
2059
|
+
module.exports = require("@splunk/moment");
|
|
2060
|
+
|
|
2061
|
+
/***/ }),
|
|
2062
|
+
|
|
2063
|
+
/***/ 34:
|
|
1572
2064
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1573
2065
|
|
|
1574
2066
|
"use strict";
|
|
@@ -1586,7 +2078,7 @@ var T = __webpack_require__(0);
|
|
|
1586
2078
|
|
|
1587
2079
|
var lodash_1 = __webpack_require__(2);
|
|
1588
2080
|
|
|
1589
|
-
var VizActionHandler_1 = __webpack_require__(
|
|
2081
|
+
var VizActionHandler_1 = __webpack_require__(35); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1590
2082
|
|
|
1591
2083
|
|
|
1592
2084
|
exports.INITIAL_WIDTH = 250;
|
|
@@ -1720,7 +2212,7 @@ exports.default = SplunkVisualization;
|
|
|
1720
2212
|
|
|
1721
2213
|
/***/ }),
|
|
1722
2214
|
|
|
1723
|
-
/***/
|
|
2215
|
+
/***/ 35:
|
|
1724
2216
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1725
2217
|
|
|
1726
2218
|
"use strict";
|
|
@@ -1758,7 +2250,7 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
|
1758
2250
|
|
|
1759
2251
|
/***/ }),
|
|
1760
2252
|
|
|
1761
|
-
/***/
|
|
2253
|
+
/***/ 36:
|
|
1762
2254
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1763
2255
|
|
|
1764
2256
|
"use strict";
|
|
@@ -1772,7 +2264,7 @@ exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
|
1772
2264
|
|
|
1773
2265
|
/***/ }),
|
|
1774
2266
|
|
|
1775
|
-
/***/
|
|
2267
|
+
/***/ 37:
|
|
1776
2268
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1777
2269
|
|
|
1778
2270
|
"use strict";
|
|
@@ -1818,7 +2310,7 @@ exports.useDeepMemo = useDeepMemo;
|
|
|
1818
2310
|
|
|
1819
2311
|
/***/ }),
|
|
1820
2312
|
|
|
1821
|
-
/***/
|
|
2313
|
+
/***/ 38:
|
|
1822
2314
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1823
2315
|
|
|
1824
2316
|
"use strict";
|
|
@@ -1899,7 +2391,7 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
|
|
|
1899
2391
|
|
|
1900
2392
|
/***/ }),
|
|
1901
2393
|
|
|
1902
|
-
/***/
|
|
2394
|
+
/***/ 39:
|
|
1903
2395
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1904
2396
|
|
|
1905
2397
|
"use strict";
|
|
@@ -1913,14 +2405,14 @@ var React = __webpack_require__(1);
|
|
|
1913
2405
|
|
|
1914
2406
|
var styled_components_1 = __webpack_require__(4);
|
|
1915
2407
|
|
|
1916
|
-
var hocUtils_1 = __webpack_require__(
|
|
2408
|
+
var hocUtils_1 = __webpack_require__(8);
|
|
1917
2409
|
|
|
1918
2410
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1919
2411
|
displayName: "withEditModeCover__Cover",
|
|
1920
2412
|
componentId: "sc-1gsbnxb-0"
|
|
1921
2413
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1922
2414
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1923
|
-
'data-splunk-visualization-version': "24.
|
|
2415
|
+
'data-splunk-visualization-version': "24.5.2 - c5ebe25a8"
|
|
1924
2416
|
}).withConfig({
|
|
1925
2417
|
displayName: "withEditModeCover__Blocker",
|
|
1926
2418
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1952,7 +2444,14 @@ exports.default = withEditModeCover;
|
|
|
1952
2444
|
|
|
1953
2445
|
/***/ }),
|
|
1954
2446
|
|
|
1955
|
-
/***/
|
|
2447
|
+
/***/ 4:
|
|
2448
|
+
/***/ (function(module, exports) {
|
|
2449
|
+
|
|
2450
|
+
module.exports = require("styled-components");
|
|
2451
|
+
|
|
2452
|
+
/***/ }),
|
|
2453
|
+
|
|
2454
|
+
/***/ 40:
|
|
1956
2455
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1957
2456
|
|
|
1958
2457
|
"use strict";
|
|
@@ -1968,11 +2467,11 @@ var colorUtils_1 = __webpack_require__(12);
|
|
|
1968
2467
|
|
|
1969
2468
|
var variables_1 = __webpack_require__(11);
|
|
1970
2469
|
|
|
1971
|
-
var IconPlaceholder_1 = __webpack_require__(
|
|
2470
|
+
var IconPlaceholder_1 = __webpack_require__(25);
|
|
1972
2471
|
|
|
1973
2472
|
var VizBehavior_1 = __webpack_require__(5);
|
|
1974
2473
|
|
|
1975
|
-
var hocUtils_1 = __webpack_require__(
|
|
2474
|
+
var hocUtils_1 = __webpack_require__(8);
|
|
1976
2475
|
|
|
1977
2476
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1978
2477
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
@@ -2017,42 +2516,35 @@ exports.default = withPlaceholder;
|
|
|
2017
2516
|
|
|
2018
2517
|
/***/ }),
|
|
2019
2518
|
|
|
2020
|
-
/***/
|
|
2519
|
+
/***/ 41:
|
|
2021
2520
|
/***/ (function(module, exports) {
|
|
2022
2521
|
|
|
2023
2522
|
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
2024
2523
|
|
|
2025
2524
|
/***/ }),
|
|
2026
2525
|
|
|
2027
|
-
/***/
|
|
2028
|
-
/***/ (function(module, exports) {
|
|
2029
|
-
|
|
2030
|
-
module.exports = require("styled-components");
|
|
2031
|
-
|
|
2032
|
-
/***/ }),
|
|
2033
|
-
|
|
2034
|
-
/***/ 40:
|
|
2526
|
+
/***/ 42:
|
|
2035
2527
|
/***/ (function(module, exports) {
|
|
2036
2528
|
|
|
2037
2529
|
module.exports = require("@splunk/visualizations-shared/colorConstants");
|
|
2038
2530
|
|
|
2039
2531
|
/***/ }),
|
|
2040
2532
|
|
|
2041
|
-
/***/
|
|
2533
|
+
/***/ 44:
|
|
2042
2534
|
/***/ (function(module, exports) {
|
|
2043
2535
|
|
|
2044
2536
|
module.exports = require("@splunk/visualization-icons/placeholders");
|
|
2045
2537
|
|
|
2046
2538
|
/***/ }),
|
|
2047
2539
|
|
|
2048
|
-
/***/
|
|
2540
|
+
/***/ 46:
|
|
2049
2541
|
/***/ (function(module, exports) {
|
|
2050
2542
|
|
|
2051
2543
|
module.exports = require("@babel/runtime/helpers/extends");
|
|
2052
2544
|
|
|
2053
2545
|
/***/ }),
|
|
2054
2546
|
|
|
2055
|
-
/***/
|
|
2547
|
+
/***/ 48:
|
|
2056
2548
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2057
2549
|
|
|
2058
2550
|
"use strict";
|
|
@@ -2127,7 +2619,7 @@ var VizBehavior;
|
|
|
2127
2619
|
"use strict";
|
|
2128
2620
|
|
|
2129
2621
|
|
|
2130
|
-
var _defineProperty = __webpack_require__(
|
|
2622
|
+
var _defineProperty = __webpack_require__(7);
|
|
2131
2623
|
|
|
2132
2624
|
var __rest = this && this.__rest || function (s, e) {
|
|
2133
2625
|
var t = {};
|
|
@@ -2314,214 +2806,92 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
2314
2806
|
/***/ }),
|
|
2315
2807
|
|
|
2316
2808
|
/***/ 7:
|
|
2809
|
+
/***/ (function(module, exports) {
|
|
2810
|
+
|
|
2811
|
+
module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
2812
|
+
|
|
2813
|
+
/***/ }),
|
|
2814
|
+
|
|
2815
|
+
/***/ 76:
|
|
2317
2816
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2318
2817
|
|
|
2319
2818
|
"use strict";
|
|
2320
2819
|
|
|
2321
2820
|
|
|
2322
|
-
var
|
|
2821
|
+
var _toConsumableArray = __webpack_require__(41);
|
|
2323
2822
|
|
|
2324
2823
|
Object.defineProperty(exports, "__esModule", {
|
|
2325
2824
|
value: true
|
|
2326
2825
|
});
|
|
2327
|
-
exports.
|
|
2826
|
+
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;
|
|
2328
2827
|
|
|
2329
2828
|
var lodash_1 = __webpack_require__(2);
|
|
2330
|
-
/**
|
|
2331
|
-
* @method extendStaticWrapperProps
|
|
2332
|
-
* @param {Object} props
|
|
2333
|
-
* @param {DashboardVizType} props.Wrapper
|
|
2334
|
-
* @param {DashboardVizType} props.Visualization
|
|
2335
|
-
*/
|
|
2336
2829
|
|
|
2830
|
+
var colorConstants_1 = __webpack_require__(42);
|
|
2337
2831
|
|
|
2338
|
-
var
|
|
2339
|
-
var Wrapper = _ref.Wrapper,
|
|
2340
|
-
Visualization = _ref.Visualization;
|
|
2341
|
-
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
2342
|
-
extendProperties.forEach(function (prop) {
|
|
2343
|
-
if (Visualization[prop]) {
|
|
2344
|
-
// eslint-disable-next-line no-param-reassign
|
|
2345
|
-
Wrapper[prop] = Visualization[prop];
|
|
2346
|
-
}
|
|
2347
|
-
});
|
|
2348
|
-
};
|
|
2832
|
+
var i18n_1 = __webpack_require__(3);
|
|
2349
2833
|
|
|
2350
|
-
exports.
|
|
2834
|
+
exports.GAUGE_THICKNESS = 50;
|
|
2835
|
+
exports.FILL_THICKNESS = 38;
|
|
2836
|
+
var GRADIENT_STOP_OFFSET_MIN = 0;
|
|
2837
|
+
var GRADIENT_STOP_OFFSET_MAX = 100;
|
|
2351
2838
|
/**
|
|
2352
|
-
*
|
|
2353
|
-
*
|
|
2354
|
-
*
|
|
2355
|
-
*
|
|
2356
|
-
*
|
|
2357
|
-
*
|
|
2358
|
-
* @method deepMergeWithArrayPrimitiveOverrides
|
|
2359
|
-
* @param {Object} initial - target object to merge values into
|
|
2360
|
-
* @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
|
|
2361
|
-
*
|
|
2362
|
-
* @returns {Object}
|
|
2839
|
+
* get width for the whole gauge viz for horizontal or vertical view
|
|
2840
|
+
* @method getGaugeWidth
|
|
2841
|
+
* @param {Object} input
|
|
2842
|
+
* @param {Number} containerWidth
|
|
2843
|
+
* @param {String} orientation
|
|
2844
|
+
* @return {Number} width
|
|
2363
2845
|
*/
|
|
2364
2846
|
|
|
2365
|
-
var
|
|
2366
|
-
var
|
|
2847
|
+
var getGaugeWidth = function getGaugeWidth(_ref) {
|
|
2848
|
+
var containerWidth = _ref.containerWidth,
|
|
2849
|
+
orientation = _ref.orientation;
|
|
2850
|
+
return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
|
|
2851
|
+
};
|
|
2367
2852
|
|
|
2368
|
-
|
|
2369
|
-
|
|
2370
|
-
|
|
2853
|
+
exports.getGaugeWidth = getGaugeWidth;
|
|
2854
|
+
/**
|
|
2855
|
+
* get height for the whole gauge viz for horizontal or vertical view
|
|
2856
|
+
* @method getGaugeHeight
|
|
2857
|
+
* @param {Object} input
|
|
2858
|
+
* @param {Number} containerHeight
|
|
2859
|
+
* @param {String} orientation
|
|
2860
|
+
* @return {Number} height
|
|
2861
|
+
*/
|
|
2371
2862
|
|
|
2372
|
-
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
2376
|
-
|
|
2863
|
+
var getGaugeHeight = function getGaugeHeight(_ref2) {
|
|
2864
|
+
var containerHeight = _ref2.containerHeight,
|
|
2865
|
+
orientation = _ref2.orientation;
|
|
2866
|
+
return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
|
|
2867
|
+
};
|
|
2377
2868
|
|
|
2378
|
-
|
|
2379
|
-
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2869
|
+
exports.getGaugeHeight = getGaugeHeight;
|
|
2870
|
+
/**
|
|
2871
|
+
* get how long the gauge shoud be.
|
|
2872
|
+
* In horizontal view, gauge length equals to gauge width. In vertical view, it equals to gauge height.
|
|
2873
|
+
* @method getGaugeLength
|
|
2874
|
+
* @param {Object} input
|
|
2875
|
+
* @param {Number} input.containerWidth
|
|
2876
|
+
* @param {Number} input.containerHeight
|
|
2877
|
+
* @param {String} input.orientation
|
|
2878
|
+
* @return {Number} gaugeLength
|
|
2879
|
+
*/
|
|
2385
2880
|
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2881
|
+
var getGaugeLength = function getGaugeLength(_ref3) {
|
|
2882
|
+
var containerWidth = _ref3.containerWidth,
|
|
2883
|
+
containerHeight = _ref3.containerHeight,
|
|
2884
|
+
orientation = _ref3.orientation;
|
|
2885
|
+
return orientation === 'vertical' ? exports.getGaugeHeight({
|
|
2886
|
+
containerHeight: containerHeight,
|
|
2887
|
+
orientation: orientation
|
|
2888
|
+
}) : exports.getGaugeWidth({
|
|
2889
|
+
containerWidth: containerWidth,
|
|
2890
|
+
orientation: orientation
|
|
2393
2891
|
});
|
|
2394
|
-
return clone;
|
|
2395
2892
|
};
|
|
2396
2893
|
|
|
2397
|
-
exports.
|
|
2398
|
-
/**
|
|
2399
|
-
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
2400
|
-
* Returns the index of match if found, or -1
|
|
2401
|
-
* For eg :-
|
|
2402
|
-
const list = [{
|
|
2403
|
-
type: "marker",
|
|
2404
|
-
lat: "value1"
|
|
2405
|
-
}, {
|
|
2406
|
-
type: "bubble",
|
|
2407
|
-
size: "value2"
|
|
2408
|
-
}];
|
|
2409
|
-
|
|
2410
|
-
const obj = {
|
|
2411
|
-
type: 'bubble'
|
|
2412
|
-
};
|
|
2413
|
-
|
|
2414
|
-
findClosestMatch(list, obj) -> returns index 1.
|
|
2415
|
-
*/
|
|
2416
|
-
|
|
2417
|
-
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
2418
|
-
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
2419
|
-
return -1;
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
var keys = Object.keys(inputObj);
|
|
2423
|
-
var maxMatchCnt = 0;
|
|
2424
|
-
var maxMatchIdx = 0;
|
|
2425
|
-
searchList.forEach(function (item, idx) {
|
|
2426
|
-
var matchCnt = 0;
|
|
2427
|
-
keys.forEach(function (key) {
|
|
2428
|
-
if (item[key] === inputObj[key]) {
|
|
2429
|
-
matchCnt += 1;
|
|
2430
|
-
}
|
|
2431
|
-
});
|
|
2432
|
-
|
|
2433
|
-
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
2434
|
-
maxMatchCnt = matchCnt;
|
|
2435
|
-
maxMatchIdx = idx;
|
|
2436
|
-
}
|
|
2437
|
-
});
|
|
2438
|
-
return maxMatchIdx;
|
|
2439
|
-
};
|
|
2440
|
-
|
|
2441
|
-
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
2442
|
-
|
|
2443
|
-
/***/ }),
|
|
2444
|
-
|
|
2445
|
-
/***/ 75:
|
|
2446
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
2447
|
-
|
|
2448
|
-
"use strict";
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
var _toConsumableArray = __webpack_require__(39);
|
|
2452
|
-
|
|
2453
|
-
Object.defineProperty(exports, "__esModule", {
|
|
2454
|
-
value: true
|
|
2455
|
-
});
|
|
2456
|
-
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;
|
|
2457
|
-
|
|
2458
|
-
var lodash_1 = __webpack_require__(2);
|
|
2459
|
-
|
|
2460
|
-
var colorConstants_1 = __webpack_require__(40);
|
|
2461
|
-
|
|
2462
|
-
var i18n_1 = __webpack_require__(3);
|
|
2463
|
-
|
|
2464
|
-
exports.GAUGE_THICKNESS = 50;
|
|
2465
|
-
exports.FILL_THICKNESS = 38;
|
|
2466
|
-
var GRADIENT_STOP_OFFSET_MIN = 0;
|
|
2467
|
-
var GRADIENT_STOP_OFFSET_MAX = 100;
|
|
2468
|
-
/**
|
|
2469
|
-
* get width for the whole gauge viz for horizontal or vertical view
|
|
2470
|
-
* @method getGaugeWidth
|
|
2471
|
-
* @param {Object} input
|
|
2472
|
-
* @param {Number} containerWidth
|
|
2473
|
-
* @param {String} orientation
|
|
2474
|
-
* @return {Number} width
|
|
2475
|
-
*/
|
|
2476
|
-
|
|
2477
|
-
var getGaugeWidth = function getGaugeWidth(_ref) {
|
|
2478
|
-
var containerWidth = _ref.containerWidth,
|
|
2479
|
-
orientation = _ref.orientation;
|
|
2480
|
-
return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
|
|
2481
|
-
};
|
|
2482
|
-
|
|
2483
|
-
exports.getGaugeWidth = getGaugeWidth;
|
|
2484
|
-
/**
|
|
2485
|
-
* get height for the whole gauge viz for horizontal or vertical view
|
|
2486
|
-
* @method getGaugeHeight
|
|
2487
|
-
* @param {Object} input
|
|
2488
|
-
* @param {Number} containerHeight
|
|
2489
|
-
* @param {String} orientation
|
|
2490
|
-
* @return {Number} height
|
|
2491
|
-
*/
|
|
2492
|
-
|
|
2493
|
-
var getGaugeHeight = function getGaugeHeight(_ref2) {
|
|
2494
|
-
var containerHeight = _ref2.containerHeight,
|
|
2495
|
-
orientation = _ref2.orientation;
|
|
2496
|
-
return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
|
|
2497
|
-
};
|
|
2498
|
-
|
|
2499
|
-
exports.getGaugeHeight = getGaugeHeight;
|
|
2500
|
-
/**
|
|
2501
|
-
* get how long the gauge shoud be.
|
|
2502
|
-
* In horizontal view, gauge length equals to gauge width. In vertical view, it equals to gauge height.
|
|
2503
|
-
* @method getGaugeLength
|
|
2504
|
-
* @param {Object} input
|
|
2505
|
-
* @param {Number} input.containerWidth
|
|
2506
|
-
* @param {Number} input.containerHeight
|
|
2507
|
-
* @param {String} input.orientation
|
|
2508
|
-
* @return {Number} gaugeLength
|
|
2509
|
-
*/
|
|
2510
|
-
|
|
2511
|
-
var getGaugeLength = function getGaugeLength(_ref3) {
|
|
2512
|
-
var containerWidth = _ref3.containerWidth,
|
|
2513
|
-
containerHeight = _ref3.containerHeight,
|
|
2514
|
-
orientation = _ref3.orientation;
|
|
2515
|
-
return orientation === 'vertical' ? exports.getGaugeHeight({
|
|
2516
|
-
containerHeight: containerHeight,
|
|
2517
|
-
orientation: orientation
|
|
2518
|
-
}) : exports.getGaugeWidth({
|
|
2519
|
-
containerWidth: containerWidth,
|
|
2520
|
-
orientation: orientation
|
|
2521
|
-
});
|
|
2522
|
-
};
|
|
2523
|
-
|
|
2524
|
-
exports.getGaugeLength = getGaugeLength;
|
|
2894
|
+
exports.getGaugeLength = getGaugeLength;
|
|
2525
2895
|
/**
|
|
2526
2896
|
* get start x and y for rendering gauge
|
|
2527
2897
|
* @method getGaugeStartPosition
|
|
@@ -3212,9 +3582,131 @@ exports.convertToGaugeProperties = convertToGaugeProperties;
|
|
|
3212
3582
|
/***/ }),
|
|
3213
3583
|
|
|
3214
3584
|
/***/ 8:
|
|
3215
|
-
/***/ (function(module, exports) {
|
|
3585
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
3216
3586
|
|
|
3217
|
-
|
|
3587
|
+
"use strict";
|
|
3588
|
+
|
|
3589
|
+
|
|
3590
|
+
var _typeof = __webpack_require__(21);
|
|
3591
|
+
|
|
3592
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3593
|
+
value: true
|
|
3594
|
+
});
|
|
3595
|
+
exports.findClosestMatchFromDefaultList = exports.deepMergeWithArrayPrimitiveOverrides = exports.extendStaticWrapperProps = void 0;
|
|
3596
|
+
|
|
3597
|
+
var lodash_1 = __webpack_require__(2);
|
|
3598
|
+
/**
|
|
3599
|
+
* @method extendStaticWrapperProps
|
|
3600
|
+
* @param {Object} props
|
|
3601
|
+
* @param {DashboardVizType} props.Wrapper
|
|
3602
|
+
* @param {DashboardVizType} props.Visualization
|
|
3603
|
+
*/
|
|
3604
|
+
|
|
3605
|
+
|
|
3606
|
+
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
3607
|
+
var Wrapper = _ref.Wrapper,
|
|
3608
|
+
Visualization = _ref.Visualization;
|
|
3609
|
+
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
3610
|
+
extendProperties.forEach(function (prop) {
|
|
3611
|
+
if (Visualization[prop]) {
|
|
3612
|
+
// eslint-disable-next-line no-param-reassign
|
|
3613
|
+
Wrapper[prop] = Visualization[prop];
|
|
3614
|
+
}
|
|
3615
|
+
});
|
|
3616
|
+
};
|
|
3617
|
+
|
|
3618
|
+
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
3619
|
+
/**
|
|
3620
|
+
* helper to deeply merge objects while preserving arrays in earlier source objects
|
|
3621
|
+
* deeply nested primitive keys are merged similarly to lodash's defaultsDeep, while keys with arrays of primitives will be preserved if already present in the resultant merged object
|
|
3622
|
+
* this prevents default arrays of primitives from appending values to user-defined arrays (this occurs if the default array is longer than the user-defined one).
|
|
3623
|
+
* Array of objects gets merged with the defaults, where the defaults can be an array of objects. Closest matching default object from the defaults list based on key - value pair
|
|
3624
|
+
* will be used for merging defaults for each object in the array. If no closest match found, first object in default array list used for merging.
|
|
3625
|
+
*
|
|
3626
|
+
* @method deepMergeWithArrayPrimitiveOverrides
|
|
3627
|
+
* @param {Object} initial - target object to merge values into
|
|
3628
|
+
* @param {Object[]} sources - other default options to be merged into the resultant object if no explicit value is provided, with earlier args taking precedence over later ones
|
|
3629
|
+
*
|
|
3630
|
+
* @returns {Object}
|
|
3631
|
+
*/
|
|
3632
|
+
|
|
3633
|
+
var deepMergeWithArrayPrimitiveOverrides = function deepMergeWithArrayPrimitiveOverrides(initial) {
|
|
3634
|
+
var clone = lodash_1.cloneDeep(initial);
|
|
3635
|
+
|
|
3636
|
+
for (var _len = arguments.length, sources = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
3637
|
+
sources[_key - 1] = arguments[_key];
|
|
3638
|
+
}
|
|
3639
|
+
|
|
3640
|
+
sources.forEach(function (sourceToApply) {
|
|
3641
|
+
Object.keys(sourceToApply).forEach(function (sourceKey) {
|
|
3642
|
+
if (!Object.prototype.hasOwnProperty.call(clone, sourceKey)) {
|
|
3643
|
+
clone[sourceKey] = lodash_1.cloneDeep(sourceToApply[sourceKey]);
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
if (clone[sourceKey] && _typeof(clone[sourceKey]) === 'object' && !Array.isArray(clone[sourceKey]) && _typeof(sourceToApply[sourceKey]) === 'object') {
|
|
3647
|
+
clone[sourceKey] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey], sourceToApply[sourceKey]);
|
|
3648
|
+
} else if (Array.isArray(clone[sourceKey]) && _typeof(clone[sourceKey][0]) === 'object' && !Array.isArray(clone[sourceKey][0])) {
|
|
3649
|
+
// If option is an array of objects
|
|
3650
|
+
for (var i = 0; i < clone[sourceKey].length; i += 1) {
|
|
3651
|
+
if (_typeof(clone[sourceKey][i]) === 'object') {
|
|
3652
|
+
var closestMatchIdx = exports.findClosestMatchFromDefaultList(sourceToApply[sourceKey], clone[sourceKey][i]);
|
|
3653
|
+
|
|
3654
|
+
if (closestMatchIdx > -1) {
|
|
3655
|
+
clone[sourceKey][i] = exports.deepMergeWithArrayPrimitiveOverrides(clone[sourceKey][i], sourceToApply[sourceKey][closestMatchIdx]);
|
|
3656
|
+
}
|
|
3657
|
+
}
|
|
3658
|
+
}
|
|
3659
|
+
}
|
|
3660
|
+
});
|
|
3661
|
+
});
|
|
3662
|
+
return clone;
|
|
3663
|
+
};
|
|
3664
|
+
|
|
3665
|
+
exports.deepMergeWithArrayPrimitiveOverrides = deepMergeWithArrayPrimitiveOverrides;
|
|
3666
|
+
/**
|
|
3667
|
+
* Finds the closest matching object from the list, which has the max same key value pairs.
|
|
3668
|
+
* Returns the index of match if found, or -1
|
|
3669
|
+
* For eg :-
|
|
3670
|
+
const list = [{
|
|
3671
|
+
type: "marker",
|
|
3672
|
+
lat: "value1"
|
|
3673
|
+
}, {
|
|
3674
|
+
type: "bubble",
|
|
3675
|
+
size: "value2"
|
|
3676
|
+
}];
|
|
3677
|
+
|
|
3678
|
+
const obj = {
|
|
3679
|
+
type: 'bubble'
|
|
3680
|
+
};
|
|
3681
|
+
|
|
3682
|
+
findClosestMatch(list, obj) -> returns index 1.
|
|
3683
|
+
*/
|
|
3684
|
+
|
|
3685
|
+
var findClosestMatchFromDefaultList = function findClosestMatchFromDefaultList(searchList, inputObj) {
|
|
3686
|
+
if (!Array.isArray(searchList) || searchList.length === 0) {
|
|
3687
|
+
return -1;
|
|
3688
|
+
}
|
|
3689
|
+
|
|
3690
|
+
var keys = Object.keys(inputObj);
|
|
3691
|
+
var maxMatchCnt = 0;
|
|
3692
|
+
var maxMatchIdx = 0;
|
|
3693
|
+
searchList.forEach(function (item, idx) {
|
|
3694
|
+
var matchCnt = 0;
|
|
3695
|
+
keys.forEach(function (key) {
|
|
3696
|
+
if (item[key] === inputObj[key]) {
|
|
3697
|
+
matchCnt += 1;
|
|
3698
|
+
}
|
|
3699
|
+
});
|
|
3700
|
+
|
|
3701
|
+
if (Math.max(maxMatchCnt, matchCnt) > maxMatchCnt) {
|
|
3702
|
+
maxMatchCnt = matchCnt;
|
|
3703
|
+
maxMatchIdx = idx;
|
|
3704
|
+
}
|
|
3705
|
+
});
|
|
3706
|
+
return maxMatchIdx;
|
|
3707
|
+
};
|
|
3708
|
+
|
|
3709
|
+
exports.findClosestMatchFromDefaultList = findClosestMatchFromDefaultList;
|
|
3218
3710
|
|
|
3219
3711
|
/***/ }),
|
|
3220
3712
|
|
|
@@ -3225,7 +3717,7 @@ module.exports = require("@splunk/visualizations-shared/Message");
|
|
|
3225
3717
|
|
|
3226
3718
|
/***/ }),
|
|
3227
3719
|
|
|
3228
|
-
/***/
|
|
3720
|
+
/***/ 99:
|
|
3229
3721
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3230
3722
|
|
|
3231
3723
|
"use strict";
|
|
@@ -3288,463 +3780,6 @@ var gauge = {
|
|
|
3288
3780
|
};
|
|
3289
3781
|
exports.default = gauge;
|
|
3290
3782
|
|
|
3291
|
-
/***/ }),
|
|
3292
|
-
|
|
3293
|
-
/***/ 98:
|
|
3294
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3295
|
-
|
|
3296
|
-
"use strict";
|
|
3297
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3298
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "MajorTick", function() { return MajorTick; });
|
|
3299
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionMajorTick", function() { return positionMajorTick; });
|
|
3300
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
|
|
3301
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
3302
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
3303
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
3304
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
|
3305
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
3306
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
3307
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
3308
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22);
|
|
3309
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
var DEFAULT_NUM_OF_TICKS = 5;
|
|
3316
|
-
var TICK_LENGTH_DELTA = 5;
|
|
3317
|
-
var TICK_LABEL_PADDING_FACTOR = 3.2;
|
|
3318
|
-
var MajorTickLine = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.line.withConfig({
|
|
3319
|
-
displayName: "GaugeMajorTicks__MajorTickLine",
|
|
3320
|
-
componentId: "mchiad-0"
|
|
3321
|
-
})(["stroke:", ";stroke-width:2px;stroke-dasharray:", ";"], function (props) {
|
|
3322
|
-
return props.majorTickStrokeColor;
|
|
3323
|
-
}, function (props) {
|
|
3324
|
-
return props.index === 0 ? 0 : 3;
|
|
3325
|
-
});
|
|
3326
|
-
var MajorTickLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.text.withConfig({
|
|
3327
|
-
displayName: "GaugeMajorTicks__MajorTickLabel",
|
|
3328
|
-
componentId: "mchiad-1"
|
|
3329
|
-
})(["font-size:12px;font-family:Splunk Platform Sans,sans-serif;line-height:19px;fill:", ";text-anchor:middle;text-align:center;"], function (props) {
|
|
3330
|
-
return props.majorTickFillColor;
|
|
3331
|
-
});
|
|
3332
|
-
var MajorTick = function MajorTick(_ref) {
|
|
3333
|
-
var index = _ref.index,
|
|
3334
|
-
x1 = _ref.x1,
|
|
3335
|
-
y1 = _ref.y1,
|
|
3336
|
-
x2 = _ref.x2,
|
|
3337
|
-
y2 = _ref.y2,
|
|
3338
|
-
showLabels = _ref.showLabels,
|
|
3339
|
-
label = _ref.label,
|
|
3340
|
-
labelX = _ref.labelX,
|
|
3341
|
-
labelY = _ref.labelY,
|
|
3342
|
-
majorTickStrokeColor = _ref.majorTickStrokeColor,
|
|
3343
|
-
majorTickFillColor = _ref.majorTickFillColor;
|
|
3344
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLine, {
|
|
3345
|
-
index: index,
|
|
3346
|
-
x1: x1,
|
|
3347
|
-
y1: y1,
|
|
3348
|
-
x2: x2,
|
|
3349
|
-
y2: y2,
|
|
3350
|
-
majorTickStrokeColor: majorTickStrokeColor
|
|
3351
|
-
}), showLabels && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLabel, {
|
|
3352
|
-
x: labelX,
|
|
3353
|
-
y: labelY,
|
|
3354
|
-
majorTickFillColor: majorTickFillColor
|
|
3355
|
-
}, Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["isNumerial"])(label) ? Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["formatNumber"])(label, 0, {
|
|
3356
|
-
useThousandSeparators: true,
|
|
3357
|
-
useTrendUnits: true
|
|
3358
|
-
}) : label));
|
|
3359
|
-
};
|
|
3360
|
-
MajorTick.propTypes = {
|
|
3361
|
-
index: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3362
|
-
x1: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3363
|
-
y1: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3364
|
-
x2: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3365
|
-
y2: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3366
|
-
showLabels: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
3367
|
-
label: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
|
|
3368
|
-
labelX: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3369
|
-
labelY: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3370
|
-
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
3371
|
-
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
3372
|
-
};
|
|
3373
|
-
/**
|
|
3374
|
-
* calculate position for each major tick
|
|
3375
|
-
* @method positionMajorTick
|
|
3376
|
-
* @param {Object} input
|
|
3377
|
-
* @param {Number} input.width
|
|
3378
|
-
* @param {Number} input.height
|
|
3379
|
-
* @param {Number} input.startX start x for rendering the first major tick
|
|
3380
|
-
* @param {Number} input.startY start y for rendering the first major tick
|
|
3381
|
-
* @param {String} input.orientation
|
|
3382
|
-
* @param {Number} input.numOfTicks how many ticks need to render
|
|
3383
|
-
* @param {Number} input.i index of major tick
|
|
3384
|
-
* @return {Object} MajorTick positions
|
|
3385
|
-
*/
|
|
3386
|
-
|
|
3387
|
-
var positionMajorTick = function positionMajorTick(_ref2) {
|
|
3388
|
-
var width = _ref2.width,
|
|
3389
|
-
height = _ref2.height,
|
|
3390
|
-
startX = _ref2.startX,
|
|
3391
|
-
startY = _ref2.startY,
|
|
3392
|
-
orientation = _ref2.orientation,
|
|
3393
|
-
numOfTicks = _ref2.numOfTicks,
|
|
3394
|
-
i = _ref2.i;
|
|
3395
|
-
var x1 = startX;
|
|
3396
|
-
var y1 = startY;
|
|
3397
|
-
var x2 = startX;
|
|
3398
|
-
var y2 = startY;
|
|
3399
|
-
var labelX = startX;
|
|
3400
|
-
var labelY;
|
|
3401
|
-
|
|
3402
|
-
if (orientation === 'vertical') {
|
|
3403
|
-
var y = height / numOfTicks * (numOfTicks - i) + startY;
|
|
3404
|
-
x1 -= TICK_LENGTH_DELTA;
|
|
3405
|
-
y1 = y;
|
|
3406
|
-
x2 += width + TICK_LENGTH_DELTA;
|
|
3407
|
-
y2 = y;
|
|
3408
|
-
labelX += width + TICK_LENGTH_DELTA * TICK_LABEL_PADDING_FACTOR;
|
|
3409
|
-
labelY = y;
|
|
3410
|
-
} else {
|
|
3411
|
-
var x = width / numOfTicks * i + startX;
|
|
3412
|
-
x1 = x;
|
|
3413
|
-
y1 -= TICK_LENGTH_DELTA;
|
|
3414
|
-
x2 = x;
|
|
3415
|
-
y2 += height + TICK_LENGTH_DELTA;
|
|
3416
|
-
labelX = x;
|
|
3417
|
-
labelY = y2 + 16;
|
|
3418
|
-
}
|
|
3419
|
-
|
|
3420
|
-
return {
|
|
3421
|
-
x1: x1,
|
|
3422
|
-
y1: y1,
|
|
3423
|
-
x2: x2,
|
|
3424
|
-
y2: y2,
|
|
3425
|
-
labelX: labelX,
|
|
3426
|
-
labelY: labelY
|
|
3427
|
-
};
|
|
3428
|
-
};
|
|
3429
|
-
|
|
3430
|
-
var MajorTicks = function MajorTicks(_ref3) {
|
|
3431
|
-
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
3432
|
-
|
|
3433
|
-
var width = props.width,
|
|
3434
|
-
height = props.height,
|
|
3435
|
-
startX = props.startX,
|
|
3436
|
-
startY = props.startY,
|
|
3437
|
-
min = props.min,
|
|
3438
|
-
max = props.max,
|
|
3439
|
-
majorUnit = props.majorUnit,
|
|
3440
|
-
orientation = props.orientation,
|
|
3441
|
-
showLabels = props.showLabels,
|
|
3442
|
-
usePercentageRange = props.usePercentageRange,
|
|
3443
|
-
majorTickFillColor = props.majorTickFillColor,
|
|
3444
|
-
majorTickStrokeColor = props.majorTickStrokeColor;
|
|
3445
|
-
var range = max - min;
|
|
3446
|
-
var numOfTicks = majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0 ? DEFAULT_NUM_OF_TICKS : range / majorUnit;
|
|
3447
|
-
var majorTicks = [];
|
|
3448
|
-
|
|
3449
|
-
for (var i = 0; i <= numOfTicks; i += 1) {
|
|
3450
|
-
var _positionMajorTick = positionMajorTick({
|
|
3451
|
-
width: width,
|
|
3452
|
-
height: height,
|
|
3453
|
-
startX: startX,
|
|
3454
|
-
startY: startY,
|
|
3455
|
-
orientation: orientation,
|
|
3456
|
-
numOfTicks: numOfTicks,
|
|
3457
|
-
i: i
|
|
3458
|
-
}),
|
|
3459
|
-
x1 = _positionMajorTick.x1,
|
|
3460
|
-
y1 = _positionMajorTick.y1,
|
|
3461
|
-
x2 = _positionMajorTick.x2,
|
|
3462
|
-
y2 = _positionMajorTick.y2,
|
|
3463
|
-
labelX = _positionMajorTick.labelX,
|
|
3464
|
-
labelY = _positionMajorTick.labelY;
|
|
3465
|
-
|
|
3466
|
-
var label = usePercentageRange ? "".concat(parseInt((i / numOfTicks - min / range) * 100, 10), "%") : parseInt(min + range / numOfTicks * i, 10);
|
|
3467
|
-
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
3468
|
-
key: i,
|
|
3469
|
-
index: i,
|
|
3470
|
-
x1: x1,
|
|
3471
|
-
y1: y1,
|
|
3472
|
-
x2: x2,
|
|
3473
|
-
y2: y2,
|
|
3474
|
-
showLabels: showLabels,
|
|
3475
|
-
label: label,
|
|
3476
|
-
labelX: labelX,
|
|
3477
|
-
labelY: labelY,
|
|
3478
|
-
majorTickFillColor: majorTickFillColor,
|
|
3479
|
-
majorTickStrokeColor: majorTickStrokeColor
|
|
3480
|
-
}));
|
|
3481
|
-
} // if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
if (!Number.isInteger(numOfTicks)) {
|
|
3485
|
-
var extraNumOfTicks = Math.ceil(numOfTicks);
|
|
3486
|
-
|
|
3487
|
-
var _positionMajorTick2 = positionMajorTick({
|
|
3488
|
-
width: width,
|
|
3489
|
-
height: height,
|
|
3490
|
-
startX: startX,
|
|
3491
|
-
startY: startY,
|
|
3492
|
-
orientation: orientation,
|
|
3493
|
-
numOfTicks: extraNumOfTicks,
|
|
3494
|
-
i: extraNumOfTicks
|
|
3495
|
-
}),
|
|
3496
|
-
_x = _positionMajorTick2.x1,
|
|
3497
|
-
_y = _positionMajorTick2.y1,
|
|
3498
|
-
_x2 = _positionMajorTick2.x2,
|
|
3499
|
-
_y2 = _positionMajorTick2.y2,
|
|
3500
|
-
_labelX = _positionMajorTick2.labelX,
|
|
3501
|
-
_labelY = _positionMajorTick2.labelY;
|
|
3502
|
-
|
|
3503
|
-
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
3504
|
-
key: extraNumOfTicks,
|
|
3505
|
-
id: extraNumOfTicks,
|
|
3506
|
-
x1: _x,
|
|
3507
|
-
y1: _y,
|
|
3508
|
-
x2: _x2,
|
|
3509
|
-
y2: _y2,
|
|
3510
|
-
showLabels: showLabels,
|
|
3511
|
-
label: usePercentageRange ? '100%' : max,
|
|
3512
|
-
labelX: _labelX,
|
|
3513
|
-
labelY: _labelY,
|
|
3514
|
-
majorTickFillColor: majorTickFillColor,
|
|
3515
|
-
majorTickStrokeColor: majorTickStrokeColor
|
|
3516
|
-
}));
|
|
3517
|
-
}
|
|
3518
|
-
|
|
3519
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, majorTicks);
|
|
3520
|
-
};
|
|
3521
|
-
|
|
3522
|
-
MajorTicks.propTypes = {
|
|
3523
|
-
width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3524
|
-
height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3525
|
-
startX: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3526
|
-
startY: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3527
|
-
min: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3528
|
-
max: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3529
|
-
majorUnit: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string, prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number]),
|
|
3530
|
-
orientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
3531
|
-
showLabels: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
3532
|
-
usePercentageRange: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
3533
|
-
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
3534
|
-
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
3535
|
-
};
|
|
3536
|
-
MajorTicks.defaultProps = {
|
|
3537
|
-
min: 0,
|
|
3538
|
-
max: 100,
|
|
3539
|
-
majorUnit: 'auto',
|
|
3540
|
-
orientation: 'horizontal',
|
|
3541
|
-
showLabels: true,
|
|
3542
|
-
usePercentageRange: false
|
|
3543
|
-
};
|
|
3544
|
-
/* harmony default export */ __webpack_exports__["default"] = (MajorTicks);
|
|
3545
|
-
|
|
3546
|
-
/***/ }),
|
|
3547
|
-
|
|
3548
|
-
/***/ 99:
|
|
3549
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
3550
|
-
|
|
3551
|
-
"use strict";
|
|
3552
|
-
__webpack_require__.r(__webpack_exports__);
|
|
3553
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionValueMarkerRect", function() { return positionValueMarkerRect; });
|
|
3554
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "positionLabel", function() { return positionLabel; });
|
|
3555
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(44);
|
|
3556
|
-
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__);
|
|
3557
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(1);
|
|
3558
|
-
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
|
3559
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(0);
|
|
3560
|
-
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
|
|
3561
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4);
|
|
3562
|
-
/* harmony import */ var styled_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(styled_components__WEBPACK_IMPORTED_MODULE_3__);
|
|
3563
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(22);
|
|
3564
|
-
/* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__);
|
|
3565
|
-
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
|
|
3569
|
-
|
|
3570
|
-
var MARKER_THICKNESS = 15;
|
|
3571
|
-
var MARKER_INNER_LENGTH = 30;
|
|
3572
|
-
var MARKER_LABEL_WIDTH = 60;
|
|
3573
|
-
var MARKER_LABEL_HEIGHT = 25;
|
|
3574
|
-
var RADIUS = 2;
|
|
3575
|
-
var DELTA_LENGTH = 12;
|
|
3576
|
-
var ValueMarkerRect = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.path.withConfig({
|
|
3577
|
-
displayName: "GaugeValueMarker__ValueMarkerRect",
|
|
3578
|
-
componentId: "sc-1bxkeao-0"
|
|
3579
|
-
})(["stroke-width:2px;fill:", ";"], function (props) {
|
|
3580
|
-
return props.valueMarkerFillColor;
|
|
3581
|
-
});
|
|
3582
|
-
var ValueMarkerLabelRect = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.rect.withConfig({
|
|
3583
|
-
displayName: "GaugeValueMarker__ValueMarkerLabelRect",
|
|
3584
|
-
componentId: "sc-1bxkeao-1"
|
|
3585
|
-
})(["fill:", ";"], function (props) {
|
|
3586
|
-
return props.valueMarkerFillColor;
|
|
3587
|
-
});
|
|
3588
|
-
var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.text.withConfig({
|
|
3589
|
-
displayName: "GaugeValueMarker__ValueMarkerLabel",
|
|
3590
|
-
componentId: "sc-1bxkeao-2"
|
|
3591
|
-
})(["fill:", ";font-size:14px;font-family:Splunk Platform Sans,sans-serif;line-height:16px;text-anchor:middle;text-align:center;dominant-baseline:middle;"], function (props) {
|
|
3592
|
-
return props.valueMarkerLabelFillColor;
|
|
3593
|
-
});
|
|
3594
|
-
/**
|
|
3595
|
-
* calculate the path of Value Marker shape
|
|
3596
|
-
* @method positionValueMarkerRect
|
|
3597
|
-
* @param {Object} input
|
|
3598
|
-
* @param {Number} input.x
|
|
3599
|
-
* @param {Number} input.y
|
|
3600
|
-
* @param {String} input.orientation
|
|
3601
|
-
* @param {Number} input.valueMarkerRectLength
|
|
3602
|
-
* @return {String} d containing a series of path commands that define the path to be
|
|
3603
|
-
*/
|
|
3604
|
-
|
|
3605
|
-
var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
3606
|
-
var x = _ref.x,
|
|
3607
|
-
y = _ref.y,
|
|
3608
|
-
orientation = _ref.orientation,
|
|
3609
|
-
valueMarkerRectLength = _ref.valueMarkerRectLength;
|
|
3610
|
-
var hLength = MARKER_THICKNESS;
|
|
3611
|
-
var vLength = valueMarkerRectLength;
|
|
3612
|
-
var markerStartX = x - MARKER_THICKNESS;
|
|
3613
|
-
var markerStartY = y;
|
|
3614
|
-
var innerHLength = hLength / 3;
|
|
3615
|
-
var innerVLength = MARKER_INNER_LENGTH;
|
|
3616
|
-
var innerStartX = markerStartX + innerHLength;
|
|
3617
|
-
var innerStartY = markerStartY + 7;
|
|
3618
|
-
|
|
3619
|
-
if (orientation === 'vertical') {
|
|
3620
|
-
hLength = valueMarkerRectLength;
|
|
3621
|
-
vLength = MARKER_THICKNESS;
|
|
3622
|
-
markerStartX = x;
|
|
3623
|
-
innerHLength = MARKER_INNER_LENGTH;
|
|
3624
|
-
innerVLength = vLength / 3;
|
|
3625
|
-
innerStartX = markerStartX + 7;
|
|
3626
|
-
innerStartY = markerStartY + innerVLength;
|
|
3627
|
-
}
|
|
3628
|
-
|
|
3629
|
-
return "M".concat(markerStartX, ",").concat(markerStartY, "h").concat(hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(RADIUS, "v").concat(vLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(RADIUS, "h").concat(-hLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(-RADIUS, ",").concat(-RADIUS, "v").concat(2 * RADIUS - vLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 1 ").concat(RADIUS, ",").concat(-RADIUS, "z") + "M".concat(innerStartX, ",").concat(innerStartY, "v").concat(innerVLength - RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(RADIUS, "h").concat(innerHLength - 2 * RADIUS, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(RADIUS, ",").concat(-RADIUS, "v").concat(RADIUS - innerVLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(-RADIUS, "h").concat(2 * RADIUS - innerHLength, "a").concat(RADIUS, ",").concat(RADIUS, " 0 0 0 ").concat(-RADIUS, ",").concat(RADIUS, "z");
|
|
3630
|
-
};
|
|
3631
|
-
/**
|
|
3632
|
-
* calculate the position of value marker label
|
|
3633
|
-
* @method positionLabel
|
|
3634
|
-
* @param {Object} input
|
|
3635
|
-
* @param {Number} input.x
|
|
3636
|
-
* @param {Number} input.y
|
|
3637
|
-
* @param {Number} input.length gauge thickness
|
|
3638
|
-
* @param {String} input.orientation
|
|
3639
|
-
* @return {Object} positions
|
|
3640
|
-
* @return {Number} positions.labelRectX x of value marker label rect
|
|
3641
|
-
* @return {Number} positions.labelRectY y of value marker label rect
|
|
3642
|
-
* @return {Number} positions.labelX x of value marker label text
|
|
3643
|
-
* @return {Number} positions.labelY y of value marker label text
|
|
3644
|
-
*/
|
|
3645
|
-
|
|
3646
|
-
var positionLabel = function positionLabel(_ref2) {
|
|
3647
|
-
var x = _ref2.x,
|
|
3648
|
-
y = _ref2.y,
|
|
3649
|
-
length = _ref2.length,
|
|
3650
|
-
orientation = _ref2.orientation; // for horizontal view
|
|
3651
|
-
|
|
3652
|
-
var labelRectX = x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;
|
|
3653
|
-
var labelRectY = y + length;
|
|
3654
|
-
|
|
3655
|
-
if (orientation === 'vertical') {
|
|
3656
|
-
labelRectX = x + length;
|
|
3657
|
-
labelRectY = y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;
|
|
3658
|
-
}
|
|
3659
|
-
|
|
3660
|
-
var labelX = labelRectX + MARKER_LABEL_WIDTH / 2;
|
|
3661
|
-
var labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;
|
|
3662
|
-
return {
|
|
3663
|
-
labelRectX: labelRectX,
|
|
3664
|
-
labelRectY: labelRectY,
|
|
3665
|
-
labelX: labelX,
|
|
3666
|
-
labelY: labelY
|
|
3667
|
-
};
|
|
3668
|
-
};
|
|
3669
|
-
|
|
3670
|
-
var ValueMarker = function ValueMarker(_ref3) {
|
|
3671
|
-
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
3672
|
-
|
|
3673
|
-
var x = props.x,
|
|
3674
|
-
y = props.y,
|
|
3675
|
-
length = props.length,
|
|
3676
|
-
min = props.min,
|
|
3677
|
-
max = props.max,
|
|
3678
|
-
value = props.value,
|
|
3679
|
-
orientation = props.orientation,
|
|
3680
|
-
showValue = props.showValue,
|
|
3681
|
-
usePercentageValue = props.usePercentageValue,
|
|
3682
|
-
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
3683
|
-
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
3684
|
-
var valueMarkerRectLength = length + DELTA_LENGTH;
|
|
3685
|
-
|
|
3686
|
-
var _positionLabel = positionLabel({
|
|
3687
|
-
x: x,
|
|
3688
|
-
y: y,
|
|
3689
|
-
length: length,
|
|
3690
|
-
orientation: orientation
|
|
3691
|
-
}),
|
|
3692
|
-
labelRectX = _positionLabel.labelRectX,
|
|
3693
|
-
labelRectY = _positionLabel.labelRectY,
|
|
3694
|
-
labelX = _positionLabel.labelX,
|
|
3695
|
-
labelY = _positionLabel.labelY;
|
|
3696
|
-
|
|
3697
|
-
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerRect, {
|
|
3698
|
-
"data-test": "value-marker-rect",
|
|
3699
|
-
d: positionValueMarkerRect({
|
|
3700
|
-
x: x,
|
|
3701
|
-
y: y,
|
|
3702
|
-
orientation: orientation,
|
|
3703
|
-
valueMarkerRectLength: valueMarkerRectLength
|
|
3704
|
-
}),
|
|
3705
|
-
valueMarkerFillColor: valueMarkerFillColor
|
|
3706
|
-
}), showValue && /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerLabelRect, {
|
|
3707
|
-
"data-test": "value-marker-label-rect",
|
|
3708
|
-
x: labelRectX,
|
|
3709
|
-
y: labelRectY,
|
|
3710
|
-
width: MARKER_LABEL_WIDTH,
|
|
3711
|
-
height: MARKER_LABEL_HEIGHT,
|
|
3712
|
-
rx: RADIUS,
|
|
3713
|
-
ry: RADIUS,
|
|
3714
|
-
valueMarkerFillColor: valueMarkerFillColor
|
|
3715
|
-
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerLabel, {
|
|
3716
|
-
"data-test": "value-marker-label",
|
|
3717
|
-
x: labelX,
|
|
3718
|
-
y: labelY,
|
|
3719
|
-
valueMarkerLabelFillColor: valueMarkerLabelFillColor
|
|
3720
|
-
}, usePercentageValue ? "".concat((value / (max - min) * 100).toFixed(2), "%") : Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_4__["formatNumber"])(value, 0, {
|
|
3721
|
-
useThousandSeparators: true,
|
|
3722
|
-
useTrendUnits: true
|
|
3723
|
-
}))));
|
|
3724
|
-
};
|
|
3725
|
-
|
|
3726
|
-
ValueMarker.propTypes = {
|
|
3727
|
-
x: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3728
|
-
y: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3729
|
-
length: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3730
|
-
min: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3731
|
-
max: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3732
|
-
value: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
3733
|
-
orientation: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
3734
|
-
showValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
3735
|
-
usePercentageValue: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.bool,
|
|
3736
|
-
valueMarkerFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
3737
|
-
valueMarkerLabelFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
3738
|
-
};
|
|
3739
|
-
ValueMarker.defaultProps = {
|
|
3740
|
-
min: 0,
|
|
3741
|
-
max: 100,
|
|
3742
|
-
orientation: 'horizontal',
|
|
3743
|
-
showValue: true,
|
|
3744
|
-
usePercentageValue: false
|
|
3745
|
-
};
|
|
3746
|
-
/* harmony default export */ __webpack_exports__["default"] = (ValueMarker);
|
|
3747
|
-
|
|
3748
3783
|
/***/ })
|
|
3749
3784
|
|
|
3750
3785
|
/******/ });
|