@splunk/visualizations 26.0.0 → 26.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +103 -19
- package/Area.config.js.map +1 -1
- package/Area.js +646 -243
- package/Area.js.map +1 -1
- package/Bar.config.js +105 -21
- package/Bar.config.js.map +1 -1
- package/Bar.js +653 -237
- package/Bar.js.map +1 -1
- package/Bubble.config.js +95 -21
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +635 -229
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +66 -15
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +589 -211
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +104 -19
- package/Column.config.js.map +1 -1
- package/Column.js +666 -239
- package/Column.js.map +1 -1
- package/Ellipse.config.js +83 -18
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +444 -156
- package/Ellipse.js.map +1 -1
- package/Events.config.js +101 -19
- package/Events.config.js.map +1 -1
- package/Events.js +792 -322
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +97 -28
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +786 -390
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +63 -19
- package/Image.config.js.map +1 -1
- package/Image.js +439 -164
- package/Image.js.map +1 -1
- package/Line.config.js +107 -23
- package/Line.config.js.map +1 -1
- package/Line.js +841 -456
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +73 -23
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +653 -230
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +244 -99
- package/Map.config.js.map +1 -1
- package/Map.js +1223 -612
- package/Map.js.map +1 -1
- package/Markdown.config.js +71 -21
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +477 -202
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +80 -22
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +819 -418
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +73 -19
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +870 -491
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +76 -23
- package/Pie.config.js.map +1 -1
- package/Pie.js +643 -233
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +82 -30
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +863 -387
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +86 -20
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +449 -159
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +85 -23
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +895 -349
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +97 -23
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +639 -234
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +95 -25
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1198 -656
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +287 -226
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +93 -23
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +991 -522
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +100 -27
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1185 -624
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +127 -68
- package/SparkLine.js.map +1 -1
- package/Table.config.js +74 -21
- package/Table.config.js.map +1 -1
- package/Table.js +827 -329
- package/Table.js.map +1 -1
- package/common/Charting.js +152 -69
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +25 -14
- package/common/ChartingApi.js.map +1 -1
- package/common/DocExampleWithVizSandbox.js +530 -0
- package/common/DocExampleWithVizSandbox.js.map +1 -0
- package/common/EventsDoc.js +139 -104
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +79 -69
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +54 -45
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +178 -87
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +530 -68
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +47 -20
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +15 -9
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +57 -44
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +52 -20
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +139 -7
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +185 -102
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +28 -16
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +50 -15
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +8 -3
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +4 -2
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +2 -1
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +288 -128
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +242 -197
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +10 -1
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +62 -1
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +3 -1
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +389 -192
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +18 -26
package/FillerGauge.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright ©
|
|
2
|
+
* Copyright © 2024 Splunk Inc.
|
|
3
3
|
* SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
4
4
|
* in part without a valid written license from Splunk Inc. is PROHIBITED.
|
|
5
5
|
*/
|
|
@@ -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 = 215);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ([
|
|
@@ -133,6 +133,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
133
133
|
});
|
|
134
134
|
exports.VizBehavior = void 0;
|
|
135
135
|
var VizBehavior;
|
|
136
|
+
|
|
136
137
|
(function (VizBehavior) {
|
|
137
138
|
/**
|
|
138
139
|
* Dynamic Options Behavior.
|
|
@@ -152,6 +153,7 @@ var VizBehavior;
|
|
|
152
153
|
* missing.
|
|
153
154
|
* @type {string}
|
|
154
155
|
*/
|
|
156
|
+
|
|
155
157
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
156
158
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
157
159
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -203,11 +205,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
203
205
|
Object.defineProperty(exports, "__esModule", {
|
|
204
206
|
value: true
|
|
205
207
|
});
|
|
208
|
+
|
|
206
209
|
var React = __webpack_require__(1);
|
|
210
|
+
|
|
207
211
|
var styled_components_1 = __webpack_require__(4);
|
|
212
|
+
|
|
208
213
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
214
|
+
|
|
209
215
|
var style_1 = __webpack_require__(14);
|
|
216
|
+
|
|
210
217
|
var colorUtils_1 = __webpack_require__(12);
|
|
218
|
+
|
|
211
219
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
212
220
|
var width = _ref.width;
|
|
213
221
|
return {
|
|
@@ -220,11 +228,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
220
228
|
componentId: "sc-1yhgpod-0"
|
|
221
229
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
222
230
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
223
|
-
});
|
|
224
|
-
|
|
231
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
232
|
+
|
|
225
233
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
226
234
|
var width = _ref2.width,
|
|
227
|
-
|
|
235
|
+
height = _ref2.height;
|
|
228
236
|
return {
|
|
229
237
|
style: Object.assign(Object.assign({}, width && {
|
|
230
238
|
width: (0, style_1.toPx)(width)
|
|
@@ -246,11 +254,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
246
254
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
247
255
|
componentId: "sc-1yhgpod-3"
|
|
248
256
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
257
|
+
|
|
249
258
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
250
259
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
251
260
|
var width = props.width,
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
height = props.height,
|
|
262
|
+
backgroundColor = props.backgroundColor;
|
|
263
|
+
|
|
254
264
|
if (!height) {
|
|
255
265
|
return React.createElement(Item, {
|
|
256
266
|
"data-test": "item",
|
|
@@ -258,24 +268,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
258
268
|
backgroundColor: backgroundColor
|
|
259
269
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
260
270
|
}
|
|
271
|
+
|
|
261
272
|
return React.createElement(FixSizeItem, {
|
|
262
273
|
"data-test": "fix-size-item",
|
|
263
|
-
"data-splunk-visualization-version": "26.
|
|
274
|
+
"data-splunk-visualization-version": "26.1.1 - b6df0a015",
|
|
264
275
|
width: width,
|
|
265
276
|
height: height,
|
|
266
277
|
backgroundColor: backgroundColor
|
|
267
278
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
268
279
|
var newWidth = _ref3.width,
|
|
269
|
-
|
|
280
|
+
newHeight = _ref3.height;
|
|
270
281
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
271
282
|
width: newWidth,
|
|
272
283
|
height: newHeight
|
|
273
284
|
}));
|
|
274
285
|
})));
|
|
275
286
|
};
|
|
287
|
+
|
|
276
288
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
277
289
|
return FixedSizeContainer;
|
|
278
290
|
};
|
|
291
|
+
|
|
279
292
|
exports.default = withFixedSizeContainer;
|
|
280
293
|
|
|
281
294
|
/***/ }),
|
|
@@ -301,9 +314,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
301
314
|
* @param {DashboardVizType} props.Wrapper
|
|
302
315
|
* @param {DashboardVizType} props.Visualization
|
|
303
316
|
*/
|
|
317
|
+
|
|
304
318
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
305
319
|
var Wrapper = _ref.Wrapper,
|
|
306
|
-
|
|
320
|
+
Visualization = _ref.Visualization;
|
|
307
321
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
308
322
|
extendProperties.forEach(function (prop) {
|
|
309
323
|
if (Visualization[prop]) {
|
|
@@ -312,6 +326,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
312
326
|
}
|
|
313
327
|
});
|
|
314
328
|
};
|
|
329
|
+
|
|
315
330
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
316
331
|
|
|
317
332
|
/***/ }),
|
|
@@ -346,24 +361,33 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
|
346
361
|
|
|
347
362
|
|
|
348
363
|
var _toConsumableArray = __webpack_require__(8);
|
|
364
|
+
|
|
349
365
|
var _defineProperty = __webpack_require__(7);
|
|
366
|
+
|
|
350
367
|
var __rest = this && this.__rest || function (s, e) {
|
|
351
368
|
var t = {};
|
|
369
|
+
|
|
352
370
|
for (var p in s) {
|
|
353
371
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
354
372
|
}
|
|
373
|
+
|
|
355
374
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
356
375
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
357
376
|
}
|
|
358
377
|
return t;
|
|
359
378
|
};
|
|
379
|
+
|
|
360
380
|
Object.defineProperty(exports, "__esModule", {
|
|
361
381
|
value: true
|
|
362
382
|
});
|
|
363
383
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
384
|
+
|
|
364
385
|
var lodash_1 = __webpack_require__(3);
|
|
386
|
+
|
|
365
387
|
var schemaUtils_1 = __webpack_require__(16);
|
|
388
|
+
|
|
366
389
|
var VizBehavior_1 = __webpack_require__(6);
|
|
390
|
+
|
|
367
391
|
var dynamicOptionsDSLType = {
|
|
368
392
|
type: 'string',
|
|
369
393
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -373,20 +397,22 @@ var dynamicOptionsDSLType = {
|
|
|
373
397
|
* @param optionsSchema a visualization's options schema
|
|
374
398
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
375
399
|
*/
|
|
400
|
+
|
|
376
401
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
377
402
|
var enhancedOptionsSchema = {};
|
|
378
403
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
379
404
|
var _a = optionsSchema[key],
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
405
|
+
title = _a.title,
|
|
406
|
+
description = _a.description,
|
|
407
|
+
readOnly = _a.readOnly,
|
|
408
|
+
writeOnly = _a.writeOnly,
|
|
409
|
+
examples = _a.examples,
|
|
410
|
+
defaultValue = _a.default,
|
|
411
|
+
type = _a.type,
|
|
412
|
+
properties = _a.properties,
|
|
413
|
+
patternProperties = _a.patternProperties,
|
|
414
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
415
|
+
|
|
390
416
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
391
417
|
title: title
|
|
392
418
|
}), description !== undefined && {
|
|
@@ -400,12 +426,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
400
426
|
}), defaultValue !== undefined && {
|
|
401
427
|
default: defaultValue
|
|
402
428
|
});
|
|
429
|
+
|
|
403
430
|
if (type === 'object') {
|
|
404
431
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
405
432
|
type: type
|
|
406
433
|
}), properties && {
|
|
407
434
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
408
435
|
});
|
|
436
|
+
|
|
409
437
|
if (patternProperties) {
|
|
410
438
|
var enhancedPatternProperties = {};
|
|
411
439
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -423,6 +451,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
423
451
|
});
|
|
424
452
|
return enhancedOptionsSchema;
|
|
425
453
|
}
|
|
454
|
+
|
|
426
455
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
427
456
|
/**
|
|
428
457
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -431,11 +460,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
431
460
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
432
461
|
* and containing `open: false` for all editor panels in editorConfig
|
|
433
462
|
*/
|
|
463
|
+
|
|
434
464
|
function enhanceConfig(vizConfig) {
|
|
435
465
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
466
|
+
|
|
436
467
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
437
468
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
438
469
|
}
|
|
470
|
+
|
|
439
471
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
440
472
|
return Object.assign(Object.assign({}, config), {
|
|
441
473
|
open: config.open || false
|
|
@@ -443,6 +475,7 @@ function enhanceConfig(vizConfig) {
|
|
|
443
475
|
});
|
|
444
476
|
return enhancedConfig;
|
|
445
477
|
}
|
|
478
|
+
|
|
446
479
|
exports.enhanceConfig = enhanceConfig;
|
|
447
480
|
/**
|
|
448
481
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -450,6 +483,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
450
483
|
* @param vizConfig a Visualization Config
|
|
451
484
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
452
485
|
*/
|
|
486
|
+
|
|
453
487
|
function uncollapseEditorConfig(vizConfig) {
|
|
454
488
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
455
489
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -459,13 +493,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
459
493
|
});
|
|
460
494
|
return editorPanelUncollapsedConfig;
|
|
461
495
|
}
|
|
496
|
+
|
|
462
497
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
498
|
+
|
|
463
499
|
function isDynamicOption(option) {
|
|
464
500
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
465
501
|
}
|
|
466
|
-
|
|
467
|
-
// private helpers to improve readability of getInitialPreset
|
|
502
|
+
|
|
503
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
468
504
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
505
|
+
|
|
469
506
|
/**
|
|
470
507
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
471
508
|
* if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
|
|
@@ -474,6 +511,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
474
511
|
*
|
|
475
512
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
476
513
|
*/
|
|
514
|
+
|
|
477
515
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
478
516
|
var presetContextKeys = Object.keys(presetContext);
|
|
479
517
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -483,6 +521,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
483
521
|
/**
|
|
484
522
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
485
523
|
*/
|
|
524
|
+
|
|
525
|
+
|
|
486
526
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
487
527
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
488
528
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -497,18 +537,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
497
537
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
498
538
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
499
539
|
*/
|
|
540
|
+
|
|
541
|
+
|
|
500
542
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
501
543
|
return presets.find(function (preset) {
|
|
502
544
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
503
545
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
504
546
|
var presetContextKeys = Object.keys(presetContext);
|
|
505
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
506
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
547
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
507
548
|
// if not, then the preset is invalid in config.ts
|
|
549
|
+
|
|
508
550
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
509
551
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
510
552
|
});
|
|
511
553
|
}
|
|
554
|
+
|
|
512
555
|
exports.getInitialPreset = getInitialPreset;
|
|
513
556
|
/**
|
|
514
557
|
* generates number precision values for a Select editor
|
|
@@ -516,6 +559,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
516
559
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
517
560
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
518
561
|
*/
|
|
562
|
+
|
|
519
563
|
function generatePrecisionValues(numPrecisionValues) {
|
|
520
564
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
521
565
|
return {
|
|
@@ -524,6 +568,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
524
568
|
};
|
|
525
569
|
});
|
|
526
570
|
}
|
|
571
|
+
|
|
527
572
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
528
573
|
/**
|
|
529
574
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -533,12 +578,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
533
578
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
534
579
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
535
580
|
*/
|
|
581
|
+
|
|
536
582
|
var insertLayout = function insertLayout(layout, index) {
|
|
537
583
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
538
584
|
layoutItems[_key - 2] = arguments[_key];
|
|
539
585
|
}
|
|
586
|
+
|
|
540
587
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
541
588
|
};
|
|
589
|
+
|
|
542
590
|
exports.insertLayout = insertLayout;
|
|
543
591
|
|
|
544
592
|
/***/ }),
|
|
@@ -608,11 +656,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
608
656
|
value: true
|
|
609
657
|
});
|
|
610
658
|
exports.shouldShowIconPlaceholder = void 0;
|
|
659
|
+
|
|
611
660
|
var React = __webpack_require__(1);
|
|
661
|
+
|
|
612
662
|
var T = __webpack_require__(0);
|
|
663
|
+
|
|
613
664
|
var lodash_1 = __webpack_require__(3);
|
|
665
|
+
|
|
614
666
|
var i18n_1 = __webpack_require__(2);
|
|
667
|
+
|
|
615
668
|
var Message_1 = __webpack_require__(10);
|
|
669
|
+
|
|
616
670
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
617
671
|
/**
|
|
618
672
|
* @method shouldShowIconPlaceholder
|
|
@@ -620,6 +674,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
620
674
|
* @param {boolean} loading
|
|
621
675
|
* @returns {boolean}
|
|
622
676
|
*/
|
|
677
|
+
|
|
678
|
+
|
|
623
679
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
624
680
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
625
681
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -628,6 +684,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
628
684
|
var noFields = fields === undefined;
|
|
629
685
|
return loading || noData || noFields;
|
|
630
686
|
};
|
|
687
|
+
|
|
631
688
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
632
689
|
var propTypes = {
|
|
633
690
|
icon: T.func,
|
|
@@ -642,11 +699,13 @@ var propTypes = {
|
|
|
642
699
|
* @param {IconPlaceholderProps} props
|
|
643
700
|
* @returns {React.ReactElement}
|
|
644
701
|
*/
|
|
702
|
+
|
|
645
703
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
646
704
|
var width = props.width,
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
705
|
+
height = props.height,
|
|
706
|
+
icon = props.icon,
|
|
707
|
+
iconColor = props.iconColor;
|
|
708
|
+
|
|
650
709
|
if (icon) {
|
|
651
710
|
return React.createElement(icon, {
|
|
652
711
|
style: {
|
|
@@ -658,9 +717,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
658
717
|
transform: 'translate(-50%, -50%)'
|
|
659
718
|
},
|
|
660
719
|
width: '50%',
|
|
661
|
-
height: '50%'
|
|
720
|
+
height: '50%',
|
|
721
|
+
'data-test': 'icon-placeholder'
|
|
662
722
|
});
|
|
663
723
|
}
|
|
724
|
+
|
|
664
725
|
return React.createElement(Message_1.default, {
|
|
665
726
|
width: width,
|
|
666
727
|
height: height,
|
|
@@ -668,6 +729,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
668
729
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
669
730
|
});
|
|
670
731
|
};
|
|
732
|
+
|
|
671
733
|
IconPlaceholder.propTypes = propTypes;
|
|
672
734
|
IconPlaceholder.defaultProps = {
|
|
673
735
|
width: '100%',
|
|
@@ -683,21 +745,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
683
745
|
|
|
684
746
|
|
|
685
747
|
var _defineProperty = __webpack_require__(7);
|
|
748
|
+
|
|
686
749
|
Object.defineProperty(exports, "__esModule", {
|
|
687
750
|
value: true
|
|
688
751
|
});
|
|
689
752
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
753
|
+
|
|
690
754
|
var T = __webpack_require__(0);
|
|
755
|
+
|
|
691
756
|
var lodash_1 = __webpack_require__(3);
|
|
692
|
-
|
|
757
|
+
|
|
758
|
+
var DataSource_1 = __webpack_require__(34);
|
|
759
|
+
|
|
693
760
|
exports.SortParamsPropTypes = T.shape({
|
|
694
761
|
currentSortKey: T.string,
|
|
695
762
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
696
763
|
onSort: T.func
|
|
697
764
|
});
|
|
765
|
+
|
|
698
766
|
var getSortingParams = function getSortingParams(_ref) {
|
|
699
767
|
var requestParams = _ref.requestParams,
|
|
700
|
-
|
|
768
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
701
769
|
var currentSortKey;
|
|
702
770
|
var currentSortDir;
|
|
703
771
|
var nextSortDirMap = {
|
|
@@ -706,15 +774,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
706
774
|
none: 'asc'
|
|
707
775
|
};
|
|
708
776
|
var onSort;
|
|
777
|
+
|
|
709
778
|
if (typeof onRequestParamsChange === 'function') {
|
|
710
779
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
711
780
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
712
781
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
713
|
-
}
|
|
714
|
-
|
|
782
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
783
|
+
|
|
784
|
+
|
|
715
785
|
onSort = function onSort(e, _ref2) {
|
|
716
786
|
var sortKey = _ref2.sortKey,
|
|
717
|
-
|
|
787
|
+
sortDir = _ref2.sortDir;
|
|
788
|
+
|
|
718
789
|
if (typeof sortKey === 'string') {
|
|
719
790
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
720
791
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -726,12 +797,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
726
797
|
}
|
|
727
798
|
};
|
|
728
799
|
}
|
|
800
|
+
|
|
729
801
|
return {
|
|
730
802
|
currentSortKey: currentSortKey,
|
|
731
803
|
currentSortDir: currentSortDir,
|
|
732
804
|
onSort: onSort
|
|
733
805
|
};
|
|
734
806
|
};
|
|
807
|
+
|
|
735
808
|
exports.getSortingParams = getSortingParams;
|
|
736
809
|
|
|
737
810
|
/***/ }),
|
|
@@ -741,43 +814,68 @@ exports.getSortingParams = getSortingParams;
|
|
|
741
814
|
"use strict";
|
|
742
815
|
|
|
743
816
|
|
|
817
|
+
Object.defineProperty(exports, "__esModule", {
|
|
818
|
+
value: true
|
|
819
|
+
});
|
|
820
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
821
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
822
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
823
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
824
|
+
|
|
825
|
+
/***/ }),
|
|
826
|
+
/* 35 */
|
|
827
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
828
|
+
|
|
829
|
+
"use strict";
|
|
830
|
+
|
|
831
|
+
|
|
744
832
|
Object.defineProperty(exports, "__esModule", {
|
|
745
833
|
value: true
|
|
746
834
|
});
|
|
747
835
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
836
|
+
|
|
748
837
|
var T = __webpack_require__(0);
|
|
838
|
+
|
|
749
839
|
var lodash_1 = __webpack_require__(3);
|
|
840
|
+
|
|
750
841
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
751
842
|
isPaging: T.bool,
|
|
752
843
|
current: T.number,
|
|
753
844
|
totalPages: T.number,
|
|
754
845
|
onChange: T.func
|
|
755
846
|
});
|
|
847
|
+
|
|
756
848
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
757
849
|
var requestParams = _ref.requestParams,
|
|
758
|
-
|
|
759
|
-
|
|
850
|
+
meta = _ref.meta,
|
|
851
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
760
852
|
var totalCount = meta && meta.totalCount || 0;
|
|
761
853
|
var offset = requestParams && requestParams.offset || 0;
|
|
762
854
|
var count = requestParams && requestParams.count;
|
|
763
855
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
764
856
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
765
857
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
858
|
+
|
|
766
859
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
767
860
|
var page = _ref2.page,
|
|
768
|
-
|
|
861
|
+
countArg = _ref2.count;
|
|
769
862
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
863
|
+
|
|
770
864
|
if (typeof countArg === 'number') {
|
|
771
865
|
newParams.count = countArg;
|
|
772
866
|
newParams.offset = 0;
|
|
773
867
|
}
|
|
868
|
+
|
|
774
869
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
870
|
+
|
|
775
871
|
if (typeof page === 'number' && page > 0) {
|
|
776
872
|
newParams.count = pageCount;
|
|
777
873
|
newParams.offset = (page - 1) * pageCount;
|
|
778
874
|
}
|
|
875
|
+
|
|
779
876
|
onRequestParamsChange(newParams);
|
|
780
877
|
};
|
|
878
|
+
|
|
781
879
|
return {
|
|
782
880
|
isPaging: isPaging,
|
|
783
881
|
current: current,
|
|
@@ -785,10 +883,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
785
883
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
786
884
|
};
|
|
787
885
|
};
|
|
886
|
+
|
|
788
887
|
exports.getPaginationParams = getPaginationParams;
|
|
789
888
|
|
|
790
889
|
/***/ }),
|
|
791
|
-
/*
|
|
890
|
+
/* 36 */
|
|
792
891
|
/***/ (function(module, exports, __webpack_require__) {
|
|
793
892
|
|
|
794
893
|
"use strict";
|
|
@@ -799,6 +898,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
799
898
|
});
|
|
800
899
|
exports.VizCategory = void 0;
|
|
801
900
|
var VizCategory;
|
|
901
|
+
|
|
802
902
|
(function (VizCategory) {
|
|
803
903
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
804
904
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -815,67 +915,96 @@ var VizCategory;
|
|
|
815
915
|
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
816
916
|
|
|
817
917
|
/***/ }),
|
|
818
|
-
/*
|
|
918
|
+
/* 37 */
|
|
819
919
|
/***/ (function(module, exports, __webpack_require__) {
|
|
820
920
|
|
|
821
921
|
"use strict";
|
|
822
922
|
|
|
823
923
|
|
|
824
924
|
var _slicedToArray = __webpack_require__(17);
|
|
925
|
+
|
|
825
926
|
Object.defineProperty(exports, "__esModule", {
|
|
826
927
|
value: true
|
|
827
928
|
});
|
|
929
|
+
|
|
828
930
|
var React = __webpack_require__(1);
|
|
931
|
+
|
|
829
932
|
var lodash_1 = __webpack_require__(3);
|
|
830
|
-
|
|
933
|
+
|
|
934
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
935
|
+
|
|
831
936
|
var Options_1 = __webpack_require__(30);
|
|
832
|
-
|
|
937
|
+
|
|
938
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
939
|
+
|
|
833
940
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
834
|
-
|
|
941
|
+
|
|
942
|
+
var moment_1 = __webpack_require__(40);
|
|
943
|
+
|
|
835
944
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
945
|
+
|
|
836
946
|
var styled_components_1 = __webpack_require__(4);
|
|
947
|
+
|
|
837
948
|
var hocUtils_1 = __webpack_require__(27);
|
|
949
|
+
|
|
838
950
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
839
|
-
|
|
951
|
+
|
|
952
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
953
|
+
|
|
840
954
|
var id_1 = __webpack_require__(25);
|
|
841
|
-
|
|
955
|
+
|
|
956
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
957
|
+
|
|
842
958
|
var VizBehavior_1 = __webpack_require__(6);
|
|
959
|
+
|
|
843
960
|
var getSorting_1 = __webpack_require__(33);
|
|
844
|
-
|
|
961
|
+
|
|
962
|
+
var getPagination_1 = __webpack_require__(35);
|
|
963
|
+
|
|
845
964
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
965
|
+
|
|
846
966
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
967
|
+
|
|
847
968
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
969
|
+
|
|
848
970
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
849
971
|
/**
|
|
850
972
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
851
973
|
* @param {DashboardVizOpts} opts
|
|
852
974
|
* @returns {HOC}
|
|
853
975
|
*/
|
|
976
|
+
|
|
977
|
+
|
|
854
978
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
855
979
|
var ReactViz = opts.ReactViz,
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
980
|
+
vizConfig = opts.vizConfig,
|
|
981
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
982
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
983
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
984
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
985
|
+
|
|
861
986
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
862
987
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
988
|
+
|
|
863
989
|
var DashboardViz = function DashboardViz(props) {
|
|
864
990
|
var _a;
|
|
991
|
+
|
|
865
992
|
var mode = props.mode,
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
993
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
994
|
+
dataSources = props.dataSources,
|
|
995
|
+
options = props.options,
|
|
996
|
+
_props$context = props.context,
|
|
997
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
998
|
+
width = props.width,
|
|
999
|
+
height = props.height,
|
|
1000
|
+
onComputedProps = props.onComputedProps,
|
|
1001
|
+
onEventTrigger = props.onEventTrigger,
|
|
1002
|
+
theme = props.theme,
|
|
1003
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
1004
|
+
|
|
877
1005
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
878
|
-
|
|
1006
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1007
|
+
|
|
879
1008
|
if (serializedTimezone) {
|
|
880
1009
|
/*
|
|
881
1010
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -889,38 +1018,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
889
1018
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
890
1019
|
}
|
|
891
1020
|
}
|
|
1021
|
+
|
|
892
1022
|
var themeFunc = function themeFunc(themeVar) {
|
|
893
1023
|
var _a, _b;
|
|
1024
|
+
|
|
894
1025
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
895
1026
|
};
|
|
1027
|
+
|
|
896
1028
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1029
|
+
|
|
897
1030
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1031
|
+
theme: theme
|
|
1032
|
+
}),
|
|
1033
|
+
currentThemeFamily = _ref.family,
|
|
1034
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1035
|
+
currentThemeDensity = _ref.density;
|
|
1036
|
+
|
|
903
1037
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1038
|
+
|
|
904
1039
|
var _React$useState = React.useState({}),
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
1040
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1041
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1042
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1043
|
+
|
|
1044
|
+
|
|
908
1045
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1046
|
+
|
|
909
1047
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
910
|
-
|
|
911
|
-
|
|
1048
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1049
|
+
visualizationID = _React$useState4[0];
|
|
1050
|
+
|
|
912
1051
|
var _React$useState5 = React.useState({}),
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
1052
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1053
|
+
dataSourcesInState = _React$useState6[0],
|
|
1054
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1055
|
+
|
|
916
1056
|
var _React$useState7 = React.useState(),
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
1057
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1058
|
+
dataFramesInState = _React$useState8[0],
|
|
1059
|
+
setDataFramesInState = _React$useState8[1];
|
|
1060
|
+
|
|
920
1061
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1062
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1063
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1064
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1065
|
+
|
|
924
1066
|
var isMounted = React.useRef(true);
|
|
925
1067
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
926
1068
|
try {
|
|
@@ -945,11 +1087,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
945
1087
|
});
|
|
946
1088
|
} else {
|
|
947
1089
|
var dataFrames = dataFramesInState;
|
|
1090
|
+
|
|
948
1091
|
if (dataSources !== dataSourcesInState) {
|
|
949
1092
|
setDataSourcesInState(dataSources);
|
|
950
1093
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
951
1094
|
setDataFramesInState(dataFrames);
|
|
952
1095
|
}
|
|
1096
|
+
|
|
953
1097
|
return Options_1.Options.evaluate({
|
|
954
1098
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
955
1099
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -960,21 +1104,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
960
1104
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
961
1105
|
return {};
|
|
962
1106
|
}
|
|
1107
|
+
|
|
963
1108
|
return {};
|
|
964
1109
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
965
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
966
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1110
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
967
1111
|
// if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
|
|
968
1112
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1113
|
+
|
|
969
1114
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
970
1115
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1116
|
+
|
|
971
1117
|
if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
|
|
972
1118
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
973
1119
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
974
1120
|
});
|
|
975
|
-
}
|
|
976
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1121
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
977
1122
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1123
|
+
|
|
1124
|
+
|
|
978
1125
|
React.useEffect(function () {
|
|
979
1126
|
onComputedProps(clonedEvaluatedOptions);
|
|
980
1127
|
});
|
|
@@ -984,53 +1131,68 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
984
1131
|
isMounted.current = false;
|
|
985
1132
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
986
1133
|
}
|
|
987
|
-
};
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
// present warning message if any required props are missing
|
|
1134
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1135
|
+
}, []); // present warning message if any required props are missing
|
|
1136
|
+
|
|
991
1137
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
992
|
-
|
|
993
|
-
|
|
1138
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1139
|
+
supports = vizConfig.supports;
|
|
994
1140
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1141
|
+
|
|
995
1142
|
if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
|
|
996
1143
|
) {
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1144
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1145
|
+
"data-test": "missing-props-message",
|
|
1146
|
+
width: width,
|
|
1147
|
+
height: height,
|
|
1148
|
+
missingProps: missing,
|
|
1149
|
+
backgroundColor: bgColorFromTheme
|
|
1150
|
+
});
|
|
1151
|
+
} // events
|
|
1152
|
+
|
|
1153
|
+
|
|
1006
1154
|
var eventCallbackProps = {};
|
|
1155
|
+
|
|
1007
1156
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1008
1157
|
var supportedEvents = vizConfig.events;
|
|
1009
1158
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1010
|
-
var
|
|
1011
|
-
|
|
1012
|
-
|
|
1159
|
+
var _supportedEvents$even = supportedEvents[eventName],
|
|
1160
|
+
parentKeys = _supportedEvents$even.parentKeys,
|
|
1161
|
+
payloadKeys = _supportedEvents$even.payloadKeys;
|
|
1162
|
+
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
|
|
1013
1163
|
// then remove these lines
|
|
1014
|
-
|
|
1164
|
+
|
|
1015
1165
|
var payload = {};
|
|
1166
|
+
|
|
1016
1167
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1017
1168
|
payloadKeys.forEach(function (p) {
|
|
1018
1169
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1019
1170
|
});
|
|
1020
1171
|
}
|
|
1172
|
+
|
|
1021
1173
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1022
1174
|
if (ev && ev.payload) {
|
|
1023
1175
|
payload = ev.payload;
|
|
1024
1176
|
}
|
|
1177
|
+
|
|
1025
1178
|
return onEventTrigger({
|
|
1026
1179
|
originalEvent: ev,
|
|
1027
1180
|
payload: payload,
|
|
1028
1181
|
type: eventName
|
|
1029
1182
|
});
|
|
1030
1183
|
};
|
|
1184
|
+
|
|
1185
|
+
if (parentKeys) {
|
|
1186
|
+
for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
|
|
1187
|
+
var newObject = {};
|
|
1188
|
+
newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
|
|
1189
|
+
eventCallbackProps[eventCallbackPropName] = newObject;
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1031
1192
|
});
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1193
|
+
} // compute pure viz props which are not from options
|
|
1194
|
+
|
|
1195
|
+
|
|
1034
1196
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1035
1197
|
themeFunc: themeFunc
|
|
1036
1198
|
}));
|
|
@@ -1048,15 +1210,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1048
1210
|
* In future, we could automatically detect which all datasources are being used
|
|
1049
1211
|
* and bind those magically to pagination/sorting behavior.
|
|
1050
1212
|
*/
|
|
1213
|
+
|
|
1051
1214
|
var dataSourceMetadata = {};
|
|
1052
1215
|
var OptionKey = 'paginateDataSourceKey';
|
|
1053
1216
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1217
|
+
|
|
1054
1218
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1055
1219
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1056
1220
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1221
|
+
|
|
1057
1222
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1058
1223
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1059
1224
|
};
|
|
1225
|
+
|
|
1060
1226
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1061
1227
|
requestParams: requestParams,
|
|
1062
1228
|
meta: meta,
|
|
@@ -1071,103 +1237,120 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1071
1237
|
sortParams: sortParams,
|
|
1072
1238
|
paginatorParams: paginatorParams
|
|
1073
1239
|
};
|
|
1074
|
-
}
|
|
1075
|
-
|
|
1240
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1241
|
+
|
|
1242
|
+
|
|
1076
1243
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1077
1244
|
return null;
|
|
1078
1245
|
}
|
|
1246
|
+
|
|
1079
1247
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1080
1248
|
mode: mode,
|
|
1081
1249
|
width: width,
|
|
1082
1250
|
height: height
|
|
1083
1251
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1084
1252
|
};
|
|
1253
|
+
|
|
1085
1254
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1086
1255
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1087
1256
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1088
1257
|
theme: {}
|
|
1089
|
-
});
|
|
1090
|
-
|
|
1091
|
-
DashboardViz.config = vizConfig;
|
|
1092
|
-
|
|
1258
|
+
}); // attach viz config
|
|
1259
|
+
|
|
1260
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1261
|
+
|
|
1093
1262
|
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1094
1263
|
};
|
|
1264
|
+
|
|
1095
1265
|
exports.default = withDashboardViz;
|
|
1096
1266
|
|
|
1097
1267
|
/***/ }),
|
|
1098
|
-
/*
|
|
1268
|
+
/* 38 */
|
|
1099
1269
|
/***/ (function(module, exports) {
|
|
1100
1270
|
|
|
1101
1271
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1102
1272
|
|
|
1103
1273
|
/***/ }),
|
|
1104
|
-
/*
|
|
1274
|
+
/* 39 */
|
|
1105
1275
|
/***/ (function(module, exports) {
|
|
1106
1276
|
|
|
1107
1277
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1108
1278
|
|
|
1109
1279
|
/***/ }),
|
|
1110
|
-
/*
|
|
1280
|
+
/* 40 */
|
|
1111
1281
|
/***/ (function(module, exports) {
|
|
1112
1282
|
|
|
1113
1283
|
module.exports = require("@splunk/moment");
|
|
1114
1284
|
|
|
1115
1285
|
/***/ }),
|
|
1116
|
-
/*
|
|
1286
|
+
/* 41 */
|
|
1117
1287
|
/***/ (function(module, exports) {
|
|
1118
1288
|
|
|
1119
1289
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1120
1290
|
|
|
1121
1291
|
/***/ }),
|
|
1122
|
-
/*
|
|
1292
|
+
/* 42 */
|
|
1123
1293
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1124
1294
|
|
|
1125
1295
|
"use strict";
|
|
1126
1296
|
|
|
1127
1297
|
|
|
1128
1298
|
var _classCallCheck = __webpack_require__(9);
|
|
1299
|
+
|
|
1129
1300
|
Object.defineProperty(exports, "__esModule", {
|
|
1130
1301
|
value: true
|
|
1131
1302
|
});
|
|
1132
1303
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1133
1304
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1305
|
+
|
|
1134
1306
|
var T = __webpack_require__(0);
|
|
1307
|
+
|
|
1135
1308
|
var lodash_1 = __webpack_require__(3);
|
|
1136
|
-
|
|
1137
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1309
|
+
|
|
1310
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1311
|
+
|
|
1312
|
+
|
|
1138
1313
|
exports.INITIAL_WIDTH = 250;
|
|
1139
1314
|
exports.INITIAL_HEIGHT = 250;
|
|
1140
1315
|
/**
|
|
1141
1316
|
* A Splunk visualization
|
|
1142
1317
|
*/
|
|
1318
|
+
|
|
1143
1319
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1144
1320
|
_classCallCheck(this, SplunkVisualization);
|
|
1145
1321
|
};
|
|
1322
|
+
|
|
1146
1323
|
SplunkVisualization.propTypes = {
|
|
1147
1324
|
/**
|
|
1148
1325
|
* display mode
|
|
1149
1326
|
*/
|
|
1150
1327
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1328
|
+
|
|
1151
1329
|
/**
|
|
1152
1330
|
* width in pixel or string, defaults to 100%
|
|
1153
1331
|
*/
|
|
1154
1332
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1333
|
+
|
|
1155
1334
|
/**
|
|
1156
1335
|
* height in pixel or string
|
|
1157
1336
|
*/
|
|
1158
1337
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1338
|
+
|
|
1159
1339
|
/**
|
|
1160
1340
|
* visualization context used for dynamic option evaluation
|
|
1161
1341
|
*/
|
|
1162
1342
|
context: T.object,
|
|
1343
|
+
|
|
1163
1344
|
/**
|
|
1164
1345
|
* visualization formatting options
|
|
1165
1346
|
*/
|
|
1166
1347
|
options: T.object,
|
|
1348
|
+
|
|
1167
1349
|
/**
|
|
1168
1350
|
* A callback to update formatting options
|
|
1169
1351
|
*/
|
|
1170
1352
|
onOptionsChange: T.func,
|
|
1353
|
+
|
|
1171
1354
|
/**
|
|
1172
1355
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1173
1356
|
*/
|
|
@@ -1176,6 +1359,7 @@ SplunkVisualization.propTypes = {
|
|
|
1176
1359
|
* current request params
|
|
1177
1360
|
*/
|
|
1178
1361
|
requestParams: T.object,
|
|
1362
|
+
|
|
1179
1363
|
/**
|
|
1180
1364
|
* current dataset
|
|
1181
1365
|
*/
|
|
@@ -1183,6 +1367,7 @@ SplunkVisualization.propTypes = {
|
|
|
1183
1367
|
fields: T.array,
|
|
1184
1368
|
columns: T.array
|
|
1185
1369
|
}),
|
|
1370
|
+
|
|
1186
1371
|
/**
|
|
1187
1372
|
* error
|
|
1188
1373
|
*/
|
|
@@ -1190,29 +1375,35 @@ SplunkVisualization.propTypes = {
|
|
|
1190
1375
|
level: T.string,
|
|
1191
1376
|
message: T.string
|
|
1192
1377
|
}),
|
|
1378
|
+
|
|
1193
1379
|
/**
|
|
1194
1380
|
* meta data that came with the dataset
|
|
1195
1381
|
*/
|
|
1196
1382
|
meta: T.object
|
|
1197
1383
|
})),
|
|
1384
|
+
|
|
1198
1385
|
/**
|
|
1199
1386
|
* A callback to trigger event
|
|
1200
1387
|
*/
|
|
1201
1388
|
onEventTrigger: T.func,
|
|
1389
|
+
|
|
1202
1390
|
/**
|
|
1203
1391
|
* Inform viz if there are handlers listening to events
|
|
1204
1392
|
*/
|
|
1205
1393
|
hasEventHandlers: T.bool,
|
|
1394
|
+
|
|
1206
1395
|
/**
|
|
1207
1396
|
* A callback to communicate computed props to a consumer
|
|
1208
1397
|
*/
|
|
1209
1398
|
onComputedProps: T.func,
|
|
1399
|
+
|
|
1210
1400
|
/**
|
|
1211
1401
|
* A callback to obtain visualization api
|
|
1212
1402
|
*/
|
|
1213
1403
|
vizActionHandlerRef: T.func,
|
|
1214
1404
|
loading: T.bool,
|
|
1215
1405
|
theme: T.object,
|
|
1406
|
+
|
|
1216
1407
|
/**
|
|
1217
1408
|
* A callback to request new data with updated request params
|
|
1218
1409
|
*/
|
|
@@ -1221,6 +1412,7 @@ SplunkVisualization.propTypes = {
|
|
|
1221
1412
|
/**
|
|
1222
1413
|
*
|
|
1223
1414
|
*/
|
|
1415
|
+
|
|
1224
1416
|
SplunkVisualization.defaultProps = {
|
|
1225
1417
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1226
1418
|
width: '100%',
|
|
@@ -1248,26 +1440,29 @@ SplunkVisualization.defaultProps = {
|
|
|
1248
1440
|
exports.default = SplunkVisualization;
|
|
1249
1441
|
|
|
1250
1442
|
/***/ }),
|
|
1251
|
-
/*
|
|
1443
|
+
/* 43 */
|
|
1252
1444
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1253
1445
|
|
|
1254
1446
|
"use strict";
|
|
1255
1447
|
|
|
1256
1448
|
|
|
1257
1449
|
var _classCallCheck = __webpack_require__(9);
|
|
1450
|
+
|
|
1258
1451
|
var _createClass = __webpack_require__(18);
|
|
1452
|
+
|
|
1259
1453
|
Object.defineProperty(exports, "__esModule", {
|
|
1260
1454
|
value: true
|
|
1261
1455
|
});
|
|
1262
1456
|
exports.DefaultVizActionHandler = void 0;
|
|
1457
|
+
|
|
1263
1458
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1264
1459
|
function DefaultVizActionHandler() {
|
|
1265
1460
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
1266
1461
|
}
|
|
1462
|
+
|
|
1267
1463
|
_createClass(DefaultVizActionHandler, [{
|
|
1268
1464
|
key: "focus",
|
|
1269
|
-
value: function focus() {
|
|
1270
|
-
// noop
|
|
1465
|
+
value: function focus() {// noop
|
|
1271
1466
|
}
|
|
1272
1467
|
}, {
|
|
1273
1468
|
key: "snapshot",
|
|
@@ -1275,22 +1470,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1275
1470
|
return null; // noop
|
|
1276
1471
|
}
|
|
1277
1472
|
}]);
|
|
1473
|
+
|
|
1278
1474
|
return DefaultVizActionHandler;
|
|
1279
1475
|
}();
|
|
1280
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1281
1476
|
|
|
1282
|
-
|
|
1283
|
-
/* 43 */
|
|
1284
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1285
|
-
|
|
1286
|
-
"use strict";
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
Object.defineProperty(exports, "__esModule", {
|
|
1290
|
-
value: true
|
|
1291
|
-
});
|
|
1292
|
-
exports.validSortDirs = void 0;
|
|
1293
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1477
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1294
1478
|
|
|
1295
1479
|
/***/ }),
|
|
1296
1480
|
/* 44 */
|
|
@@ -1303,7 +1487,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1303
1487
|
value: true
|
|
1304
1488
|
});
|
|
1305
1489
|
exports.useDeepMemo = void 0;
|
|
1490
|
+
|
|
1306
1491
|
var react_1 = __webpack_require__(1);
|
|
1492
|
+
|
|
1307
1493
|
var lodash_1 = __webpack_require__(3);
|
|
1308
1494
|
/**
|
|
1309
1495
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1318,16 +1504,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1318
1504
|
* @param fn the function to be executed and
|
|
1319
1505
|
* @param dependencies an array of dependencies
|
|
1320
1506
|
*/
|
|
1507
|
+
|
|
1508
|
+
|
|
1321
1509
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1322
1510
|
var ref = (0, react_1.useRef)();
|
|
1511
|
+
|
|
1323
1512
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1324
1513
|
ref.current = {
|
|
1325
1514
|
dependencies: dependencies,
|
|
1326
1515
|
value: fn()
|
|
1327
1516
|
};
|
|
1328
1517
|
}
|
|
1518
|
+
|
|
1329
1519
|
return ref.current.value;
|
|
1330
1520
|
};
|
|
1521
|
+
|
|
1331
1522
|
exports.useDeepMemo = useDeepMemo;
|
|
1332
1523
|
|
|
1333
1524
|
/***/ }),
|
|
@@ -1341,19 +1532,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1341
1532
|
value: true
|
|
1342
1533
|
});
|
|
1343
1534
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1535
|
+
|
|
1344
1536
|
var React = __webpack_require__(1);
|
|
1537
|
+
|
|
1345
1538
|
var T = __webpack_require__(0);
|
|
1539
|
+
|
|
1346
1540
|
var i18n_1 = __webpack_require__(2);
|
|
1541
|
+
|
|
1347
1542
|
var Message_1 = __webpack_require__(10);
|
|
1543
|
+
|
|
1348
1544
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1349
1545
|
/**
|
|
1350
1546
|
* @method isMissing
|
|
1351
1547
|
* @param {any} v
|
|
1352
1548
|
* @returns {boolean} true if the input value === null or undefined
|
|
1353
1549
|
*/
|
|
1550
|
+
|
|
1551
|
+
|
|
1354
1552
|
var isMissing = function isMissing(v) {
|
|
1355
1553
|
return v === null || v === undefined;
|
|
1356
1554
|
};
|
|
1555
|
+
|
|
1357
1556
|
exports.isMissing = isMissing;
|
|
1358
1557
|
/**
|
|
1359
1558
|
* @method misskingKeys
|
|
@@ -1361,11 +1560,13 @@ exports.isMissing = isMissing;
|
|
|
1361
1560
|
* @param {object} target
|
|
1362
1561
|
* @returns {string[]} the keys of missing required props
|
|
1363
1562
|
*/
|
|
1563
|
+
|
|
1364
1564
|
var missingKeys = function missingKeys(keys, target) {
|
|
1365
1565
|
return keys.filter(function (k) {
|
|
1366
1566
|
return (0, exports.isMissing)(target[k]);
|
|
1367
1567
|
});
|
|
1368
1568
|
};
|
|
1569
|
+
|
|
1369
1570
|
exports.missingKeys = missingKeys;
|
|
1370
1571
|
var propTypes = {
|
|
1371
1572
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1379,10 +1580,11 @@ var propTypes = {
|
|
|
1379
1580
|
* @param {MissingPropsProps} props
|
|
1380
1581
|
* @returns {React.ReactElement}
|
|
1381
1582
|
*/
|
|
1583
|
+
|
|
1382
1584
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1383
1585
|
var width = props.width,
|
|
1384
|
-
|
|
1385
|
-
|
|
1586
|
+
height = props.height,
|
|
1587
|
+
missingProps = props.missingProps;
|
|
1386
1588
|
return React.createElement(Message_1.default, {
|
|
1387
1589
|
"data-test": "message",
|
|
1388
1590
|
width: width,
|
|
@@ -1390,6 +1592,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
1390
1592
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1391
1593
|
});
|
|
1392
1594
|
};
|
|
1595
|
+
|
|
1393
1596
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1394
1597
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1395
1598
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -1408,15 +1611,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
1408
1611
|
Object.defineProperty(exports, "__esModule", {
|
|
1409
1612
|
value: true
|
|
1410
1613
|
});
|
|
1614
|
+
|
|
1411
1615
|
var React = __webpack_require__(1);
|
|
1616
|
+
|
|
1412
1617
|
var styled_components_1 = __webpack_require__(4);
|
|
1618
|
+
|
|
1413
1619
|
var hocUtils_1 = __webpack_require__(15);
|
|
1620
|
+
|
|
1414
1621
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1415
1622
|
displayName: "withEditModeCover__Cover",
|
|
1416
1623
|
componentId: "sc-1gsbnxb-0"
|
|
1417
1624
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1418
1625
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1419
|
-
'data-splunk-visualization-version': "26.
|
|
1626
|
+
'data-splunk-visualization-version': "26.1.1 - b6df0a015"
|
|
1420
1627
|
}).withConfig({
|
|
1421
1628
|
displayName: "withEditModeCover__Blocker",
|
|
1422
1629
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1427,6 +1634,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1427
1634
|
* @param {ExtendedDashViz} Visualization
|
|
1428
1635
|
* @returns {ExtendedDashViz} Wrapper
|
|
1429
1636
|
*/
|
|
1637
|
+
|
|
1430
1638
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1431
1639
|
var Wrapper = function Wrapper(props) {
|
|
1432
1640
|
var mode = props.mode;
|
|
@@ -1435,12 +1643,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1435
1643
|
"data-test": "edit-mode-cover"
|
|
1436
1644
|
}));
|
|
1437
1645
|
};
|
|
1646
|
+
|
|
1438
1647
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1439
1648
|
Wrapper: Wrapper,
|
|
1440
1649
|
Visualization: Visualization
|
|
1441
1650
|
});
|
|
1442
1651
|
return Wrapper;
|
|
1443
1652
|
};
|
|
1653
|
+
|
|
1444
1654
|
exports.default = withEditModeCover;
|
|
1445
1655
|
|
|
1446
1656
|
/***/ }),
|
|
@@ -1453,27 +1663,37 @@ exports.default = withEditModeCover;
|
|
|
1453
1663
|
Object.defineProperty(exports, "__esModule", {
|
|
1454
1664
|
value: true
|
|
1455
1665
|
});
|
|
1666
|
+
|
|
1456
1667
|
var React = __webpack_require__(1);
|
|
1668
|
+
|
|
1457
1669
|
var colorUtils_1 = __webpack_require__(12);
|
|
1670
|
+
|
|
1458
1671
|
var variables_1 = __webpack_require__(11);
|
|
1672
|
+
|
|
1459
1673
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
1674
|
+
|
|
1460
1675
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1676
|
+
|
|
1461
1677
|
var hocUtils_1 = __webpack_require__(15);
|
|
1678
|
+
|
|
1462
1679
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1463
1680
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1464
1681
|
var config = Visualization.config;
|
|
1465
1682
|
var themes = config.themes;
|
|
1683
|
+
|
|
1466
1684
|
var Wrapper = function Wrapper(props) {
|
|
1467
1685
|
var _a, _b;
|
|
1686
|
+
|
|
1468
1687
|
var dataSources = props.dataSources,
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1688
|
+
loading = props.loading,
|
|
1689
|
+
options = props.options,
|
|
1690
|
+
height = props.height,
|
|
1691
|
+
width = props.width;
|
|
1473
1692
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
1474
1693
|
var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
1475
1694
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
1476
1695
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
1696
|
+
|
|
1477
1697
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
1478
1698
|
return React.createElement(IconPlaceholder_1.default, {
|
|
1479
1699
|
"data-test": "icon-placeholder",
|
|
@@ -1484,14 +1704,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1484
1704
|
iconColor: iconColor
|
|
1485
1705
|
});
|
|
1486
1706
|
}
|
|
1707
|
+
|
|
1487
1708
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
1488
1709
|
};
|
|
1710
|
+
|
|
1489
1711
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1490
1712
|
Wrapper: Wrapper,
|
|
1491
1713
|
Visualization: Visualization
|
|
1492
1714
|
});
|
|
1493
1715
|
return Wrapper;
|
|
1494
1716
|
};
|
|
1717
|
+
|
|
1495
1718
|
exports.default = withPlaceholder;
|
|
1496
1719
|
|
|
1497
1720
|
/***/ }),
|
|
@@ -1529,11 +1752,13 @@ module.exports = require("@splunk/visualization-color-palettes");
|
|
|
1529
1752
|
Object.defineProperty(exports, "__esModule", {
|
|
1530
1753
|
value: true
|
|
1531
1754
|
});
|
|
1755
|
+
|
|
1532
1756
|
var i18n_1 = __webpack_require__(2);
|
|
1757
|
+
|
|
1533
1758
|
var background = function background(_ref) {
|
|
1534
1759
|
var label = _ref.label,
|
|
1535
|
-
|
|
1536
|
-
|
|
1760
|
+
themes = _ref.themes,
|
|
1761
|
+
labelPosition = _ref.labelPosition;
|
|
1537
1762
|
return [{
|
|
1538
1763
|
label: (0, i18n_1._)(label || 'Background'),
|
|
1539
1764
|
option: 'backgroundColor',
|
|
@@ -1544,6 +1769,7 @@ var background = function background(_ref) {
|
|
|
1544
1769
|
}
|
|
1545
1770
|
}];
|
|
1546
1771
|
};
|
|
1772
|
+
|
|
1547
1773
|
exports.default = background;
|
|
1548
1774
|
|
|
1549
1775
|
/***/ }),
|
|
@@ -1603,13 +1829,18 @@ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPal
|
|
|
1603
1829
|
|
|
1604
1830
|
|
|
1605
1831
|
var _toConsumableArray = __webpack_require__(8);
|
|
1832
|
+
|
|
1606
1833
|
Object.defineProperty(exports, "__esModule", {
|
|
1607
1834
|
value: true
|
|
1608
1835
|
});
|
|
1609
1836
|
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;
|
|
1837
|
+
|
|
1610
1838
|
var lodash_1 = __webpack_require__(3);
|
|
1839
|
+
|
|
1611
1840
|
var colorConstants_1 = __webpack_require__(49);
|
|
1841
|
+
|
|
1612
1842
|
var i18n_1 = __webpack_require__(2);
|
|
1843
|
+
|
|
1613
1844
|
exports.GAUGE_THICKNESS = 50;
|
|
1614
1845
|
exports.FILL_THICKNESS = 38;
|
|
1615
1846
|
var GRADIENT_STOP_OFFSET_MIN = 0;
|
|
@@ -1622,11 +1853,13 @@ var GRADIENT_STOP_OFFSET_MAX = 100;
|
|
|
1622
1853
|
* @param {String} orientation
|
|
1623
1854
|
* @return {Number} width
|
|
1624
1855
|
*/
|
|
1856
|
+
|
|
1625
1857
|
var getGaugeWidth = function getGaugeWidth(_ref) {
|
|
1626
1858
|
var containerWidth = _ref.containerWidth,
|
|
1627
|
-
|
|
1859
|
+
orientation = _ref.orientation;
|
|
1628
1860
|
return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
|
|
1629
1861
|
};
|
|
1862
|
+
|
|
1630
1863
|
exports.getGaugeWidth = getGaugeWidth;
|
|
1631
1864
|
/**
|
|
1632
1865
|
* get height for the whole gauge viz for horizontal or vertical view
|
|
@@ -1636,11 +1869,13 @@ exports.getGaugeWidth = getGaugeWidth;
|
|
|
1636
1869
|
* @param {String} orientation
|
|
1637
1870
|
* @return {Number} height
|
|
1638
1871
|
*/
|
|
1872
|
+
|
|
1639
1873
|
var getGaugeHeight = function getGaugeHeight(_ref2) {
|
|
1640
1874
|
var containerHeight = _ref2.containerHeight,
|
|
1641
|
-
|
|
1875
|
+
orientation = _ref2.orientation;
|
|
1642
1876
|
return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
|
|
1643
1877
|
};
|
|
1878
|
+
|
|
1644
1879
|
exports.getGaugeHeight = getGaugeHeight;
|
|
1645
1880
|
/**
|
|
1646
1881
|
* get how long the gauge shoud be.
|
|
@@ -1652,10 +1887,11 @@ exports.getGaugeHeight = getGaugeHeight;
|
|
|
1652
1887
|
* @param {String} input.orientation
|
|
1653
1888
|
* @return {Number} gaugeLength
|
|
1654
1889
|
*/
|
|
1890
|
+
|
|
1655
1891
|
var getGaugeLength = function getGaugeLength(_ref3) {
|
|
1656
1892
|
var containerWidth = _ref3.containerWidth,
|
|
1657
|
-
|
|
1658
|
-
|
|
1893
|
+
containerHeight = _ref3.containerHeight,
|
|
1894
|
+
orientation = _ref3.orientation;
|
|
1659
1895
|
return orientation === 'vertical' ? (0, exports.getGaugeHeight)({
|
|
1660
1896
|
containerHeight: containerHeight,
|
|
1661
1897
|
orientation: orientation
|
|
@@ -1664,6 +1900,7 @@ var getGaugeLength = function getGaugeLength(_ref3) {
|
|
|
1664
1900
|
orientation: orientation
|
|
1665
1901
|
});
|
|
1666
1902
|
};
|
|
1903
|
+
|
|
1667
1904
|
exports.getGaugeLength = getGaugeLength;
|
|
1668
1905
|
/**
|
|
1669
1906
|
* get start x and y for rendering gauge
|
|
@@ -1677,23 +1914,27 @@ exports.getGaugeLength = getGaugeLength;
|
|
|
1677
1914
|
* @return {Number} position.gaugeStartX
|
|
1678
1915
|
* @return {Number} position.gaugeStartY
|
|
1679
1916
|
*/
|
|
1917
|
+
|
|
1680
1918
|
var getGaugeStartPosition = function getGaugeStartPosition(_ref4) {
|
|
1681
1919
|
var containerWidth = _ref4.containerWidth,
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1920
|
+
containerHeight = _ref4.containerHeight,
|
|
1921
|
+
gaugeLength = _ref4.gaugeLength,
|
|
1922
|
+
orientation = _ref4.orientation;
|
|
1685
1923
|
// for horizontal view
|
|
1686
1924
|
var gaugeStartX = (containerWidth - gaugeLength) / 2.0;
|
|
1687
1925
|
var gaugeStartY = (containerHeight - exports.GAUGE_THICKNESS) / 2.0;
|
|
1926
|
+
|
|
1688
1927
|
if (orientation === 'vertical') {
|
|
1689
1928
|
gaugeStartX = (containerWidth - exports.GAUGE_THICKNESS) / 2.0;
|
|
1690
1929
|
gaugeStartY = (containerHeight - gaugeLength) / 2.0;
|
|
1691
1930
|
}
|
|
1931
|
+
|
|
1692
1932
|
return {
|
|
1693
1933
|
gaugeStartX: gaugeStartX,
|
|
1694
1934
|
gaugeStartY: gaugeStartY
|
|
1695
1935
|
};
|
|
1696
1936
|
};
|
|
1937
|
+
|
|
1697
1938
|
exports.getGaugeStartPosition = getGaugeStartPosition;
|
|
1698
1939
|
/**
|
|
1699
1940
|
* get dimensions for the whole gauge viz,
|
|
@@ -1710,23 +1951,26 @@ exports.getGaugeStartPosition = getGaugeStartPosition;
|
|
|
1710
1951
|
* @return {Number} gaugeDimensions.gaugeWidth natural width of gauge
|
|
1711
1952
|
* @return {Number} gaugeDimensions.gaugeHeight natural height of gauge
|
|
1712
1953
|
*/
|
|
1954
|
+
|
|
1713
1955
|
var getGaugeDimensions = function getGaugeDimensions(_ref5) {
|
|
1714
1956
|
var containerWidth = _ref5.containerWidth,
|
|
1715
|
-
|
|
1716
|
-
|
|
1957
|
+
containerHeight = _ref5.containerHeight,
|
|
1958
|
+
orientation = _ref5.orientation;
|
|
1717
1959
|
var gaugeLength = (0, exports.getGaugeLength)({
|
|
1718
1960
|
containerWidth: containerWidth,
|
|
1719
1961
|
containerHeight: containerHeight,
|
|
1720
1962
|
orientation: orientation
|
|
1721
1963
|
});
|
|
1964
|
+
|
|
1722
1965
|
var _ref6 = (0, exports.getGaugeStartPosition)({
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1966
|
+
containerWidth: containerWidth,
|
|
1967
|
+
containerHeight: containerHeight,
|
|
1968
|
+
gaugeLength: gaugeLength,
|
|
1969
|
+
orientation: orientation
|
|
1970
|
+
}),
|
|
1971
|
+
gaugeStartX = _ref6.gaugeStartX,
|
|
1972
|
+
gaugeStartY = _ref6.gaugeStartY;
|
|
1973
|
+
|
|
1730
1974
|
var gaugeWidth = (0, exports.getGaugeWidth)({
|
|
1731
1975
|
containerWidth: containerWidth,
|
|
1732
1976
|
orientation: orientation
|
|
@@ -1743,6 +1987,7 @@ var getGaugeDimensions = function getGaugeDimensions(_ref5) {
|
|
|
1743
1987
|
gaugeHeight: gaugeHeight
|
|
1744
1988
|
};
|
|
1745
1989
|
};
|
|
1990
|
+
|
|
1746
1991
|
exports.getGaugeDimensions = getGaugeDimensions;
|
|
1747
1992
|
/**
|
|
1748
1993
|
* if gaugeColor is not specified, auto assign a gauge color to the fill bar
|
|
@@ -1750,19 +1995,24 @@ exports.getGaugeDimensions = getGaugeDimensions;
|
|
|
1750
1995
|
* @method assignGaugeColor
|
|
1751
1996
|
* @params
|
|
1752
1997
|
* */
|
|
1998
|
+
|
|
1753
1999
|
var assignGaugeColor = function assignGaugeColor(_ref7) {
|
|
1754
2000
|
var value = _ref7.value,
|
|
1755
|
-
|
|
1756
|
-
|
|
2001
|
+
min = _ref7.min,
|
|
2002
|
+
max = _ref7.max;
|
|
1757
2003
|
var rate = (value - min) / (max - min);
|
|
2004
|
+
|
|
1758
2005
|
if (rate <= 0.3) {
|
|
1759
2006
|
return colorConstants_1.SEMANTIC_SUCCESS;
|
|
1760
2007
|
}
|
|
2008
|
+
|
|
1761
2009
|
if (rate > 0.3 && rate <= 0.6) {
|
|
1762
2010
|
return colorConstants_1.SEMANTIC_WARNING;
|
|
1763
2011
|
}
|
|
2012
|
+
|
|
1764
2013
|
return colorConstants_1.SEMANTIC_ERROR;
|
|
1765
2014
|
};
|
|
2015
|
+
|
|
1766
2016
|
exports.assignGaugeColor = assignGaugeColor;
|
|
1767
2017
|
/**
|
|
1768
2018
|
* get inner bar length in gauge
|
|
@@ -1774,22 +2024,28 @@ exports.assignGaugeColor = assignGaugeColor;
|
|
|
1774
2024
|
* @param {Number} input.max
|
|
1775
2025
|
* @return {Number} gaugeBarLength
|
|
1776
2026
|
*/
|
|
2027
|
+
|
|
1777
2028
|
var getGaugeBarLength = function getGaugeBarLength(_ref8) {
|
|
1778
2029
|
var gaugeLength = _ref8.gaugeLength,
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
2030
|
+
value = _ref8.value,
|
|
2031
|
+
min = _ref8.min,
|
|
2032
|
+
max = _ref8.max;
|
|
2033
|
+
|
|
1782
2034
|
if (max < min) {
|
|
1783
2035
|
return null;
|
|
1784
2036
|
}
|
|
2037
|
+
|
|
1785
2038
|
if (value >= max) {
|
|
1786
2039
|
return gaugeLength;
|
|
1787
2040
|
}
|
|
2041
|
+
|
|
1788
2042
|
if (value < min) {
|
|
1789
2043
|
return 0;
|
|
1790
2044
|
}
|
|
2045
|
+
|
|
1791
2046
|
return gaugeLength * (value - min) / (max - min);
|
|
1792
2047
|
};
|
|
2048
|
+
|
|
1793
2049
|
exports.getGaugeBarLength = getGaugeBarLength;
|
|
1794
2050
|
/**
|
|
1795
2051
|
* get x and y position for rendering inner bar in gauge
|
|
@@ -1805,26 +2061,30 @@ exports.getGaugeBarLength = getGaugeBarLength;
|
|
|
1805
2061
|
* @return {Number} position.gaugeBarX
|
|
1806
2062
|
* @return {Number} position.gaugeBarY
|
|
1807
2063
|
*/
|
|
2064
|
+
|
|
1808
2065
|
var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref9) {
|
|
1809
2066
|
var gaugeStartX = _ref9.gaugeStartX,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
2067
|
+
gaugeStartY = _ref9.gaugeStartY,
|
|
2068
|
+
gaugeWidth = _ref9.gaugeWidth,
|
|
2069
|
+
gaugeHeight = _ref9.gaugeHeight,
|
|
2070
|
+
gaugeBarLength = _ref9.gaugeBarLength,
|
|
2071
|
+
orientation = _ref9.orientation;
|
|
1815
2072
|
var gaugeBarX = gaugeStartX;
|
|
1816
2073
|
var gaugeBarY = gaugeStartY;
|
|
2074
|
+
|
|
1817
2075
|
if (orientation === 'vertical') {
|
|
1818
2076
|
gaugeBarX += (gaugeWidth - exports.FILL_THICKNESS) / 2;
|
|
1819
2077
|
gaugeBarY += gaugeHeight - gaugeBarLength;
|
|
1820
2078
|
} else {
|
|
1821
2079
|
gaugeBarY += (gaugeHeight - exports.FILL_THICKNESS) / 2;
|
|
1822
2080
|
}
|
|
2081
|
+
|
|
1823
2082
|
return {
|
|
1824
2083
|
gaugeBarX: gaugeBarX,
|
|
1825
2084
|
gaugeBarY: gaugeBarY
|
|
1826
2085
|
};
|
|
1827
2086
|
};
|
|
2087
|
+
|
|
1828
2088
|
exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
|
|
1829
2089
|
/**
|
|
1830
2090
|
* get width of inner bar in gauge
|
|
@@ -1834,11 +2094,13 @@ exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
|
|
|
1834
2094
|
* @param {String} orientation
|
|
1835
2095
|
* @return {Number} gaugeBarWidth
|
|
1836
2096
|
*/
|
|
2097
|
+
|
|
1837
2098
|
var getGaugeBarWidth = function getGaugeBarWidth(_ref10) {
|
|
1838
2099
|
var gaugeBarLength = _ref10.gaugeBarLength,
|
|
1839
|
-
|
|
2100
|
+
orientation = _ref10.orientation;
|
|
1840
2101
|
return orientation === 'vertical' ? exports.FILL_THICKNESS : gaugeBarLength;
|
|
1841
2102
|
};
|
|
2103
|
+
|
|
1842
2104
|
exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
1843
2105
|
/**
|
|
1844
2106
|
* get height of inner bar in gauge
|
|
@@ -1848,11 +2110,13 @@ exports.getGaugeBarWidth = getGaugeBarWidth;
|
|
|
1848
2110
|
* @param {String} orientation
|
|
1849
2111
|
* @return {Number} gaugeBarHeight
|
|
1850
2112
|
*/
|
|
2113
|
+
|
|
1851
2114
|
var getGaugeBarHeight = function getGaugeBarHeight(_ref11) {
|
|
1852
2115
|
var gaugeBarLength = _ref11.gaugeBarLength,
|
|
1853
|
-
|
|
2116
|
+
orientation = _ref11.orientation;
|
|
1854
2117
|
return orientation === 'vertical' ? gaugeBarLength : exports.FILL_THICKNESS;
|
|
1855
2118
|
};
|
|
2119
|
+
|
|
1856
2120
|
exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
1857
2121
|
/**
|
|
1858
2122
|
* get dimensions for the fill bar in the gauge
|
|
@@ -1874,32 +2138,35 @@ exports.getGaugeBarHeight = getGaugeBarHeight;
|
|
|
1874
2138
|
* @return {Number} fillBarDimensions.fillBarWidth
|
|
1875
2139
|
* @return {Number} fillBarDimensions.fillBarHeight
|
|
1876
2140
|
*/
|
|
2141
|
+
|
|
1877
2142
|
var getFillBarDimensions = function getFillBarDimensions(_ref12) {
|
|
1878
2143
|
var gaugeLength = _ref12.gaugeLength,
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
2144
|
+
gaugeStartX = _ref12.gaugeStartX,
|
|
2145
|
+
gaugeStartY = _ref12.gaugeStartY,
|
|
2146
|
+
gaugeWidth = _ref12.gaugeWidth,
|
|
2147
|
+
gaugeHeight = _ref12.gaugeHeight,
|
|
2148
|
+
value = _ref12.value,
|
|
2149
|
+
min = _ref12.min,
|
|
2150
|
+
max = _ref12.max,
|
|
2151
|
+
orientation = _ref12.orientation;
|
|
1887
2152
|
var gaugeBarLength = (0, exports.getGaugeBarLength)({
|
|
1888
2153
|
gaugeLength: gaugeLength,
|
|
1889
2154
|
value: value,
|
|
1890
2155
|
max: max,
|
|
1891
2156
|
min: min
|
|
1892
2157
|
});
|
|
2158
|
+
|
|
1893
2159
|
var _ref13 = (0, exports.getGaugeBarStartPositions)({
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
2160
|
+
gaugeStartX: gaugeStartX,
|
|
2161
|
+
gaugeStartY: gaugeStartY,
|
|
2162
|
+
gaugeWidth: gaugeWidth,
|
|
2163
|
+
gaugeHeight: gaugeHeight,
|
|
2164
|
+
gaugeBarLength: gaugeBarLength,
|
|
2165
|
+
orientation: orientation
|
|
2166
|
+
}),
|
|
2167
|
+
fillBarX = _ref13.gaugeBarX,
|
|
2168
|
+
fillBarY = _ref13.gaugeBarY;
|
|
2169
|
+
|
|
1903
2170
|
var fillBarWidth = (0, exports.getGaugeBarWidth)({
|
|
1904
2171
|
gaugeBarLength: gaugeBarLength,
|
|
1905
2172
|
orientation: orientation
|
|
@@ -1916,6 +2183,7 @@ var getFillBarDimensions = function getFillBarDimensions(_ref12) {
|
|
|
1916
2183
|
fillBarHeight: fillBarHeight
|
|
1917
2184
|
};
|
|
1918
2185
|
};
|
|
2186
|
+
|
|
1919
2187
|
exports.getFillBarDimensions = getFillBarDimensions;
|
|
1920
2188
|
/**
|
|
1921
2189
|
* get position x and y for value marker in filler gauge
|
|
@@ -1929,24 +2197,28 @@ exports.getFillBarDimensions = getFillBarDimensions;
|
|
|
1929
2197
|
* @return {Number} position.valueMarkerX
|
|
1930
2198
|
* @return {Number} position.valueMarkerY
|
|
1931
2199
|
*/
|
|
2200
|
+
|
|
1932
2201
|
var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref14) {
|
|
1933
2202
|
var fillBarX = _ref14.fillBarX,
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
2203
|
+
fillBarY = _ref14.fillBarY,
|
|
2204
|
+
fillBarLength = _ref14.fillBarLength,
|
|
2205
|
+
orientation = _ref14.orientation;
|
|
1937
2206
|
var valueMarkerX = fillBarX;
|
|
1938
2207
|
var valueMarkerY = fillBarY;
|
|
2208
|
+
|
|
1939
2209
|
if (orientation === 'vertical') {
|
|
1940
2210
|
valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
1941
2211
|
} else {
|
|
1942
2212
|
valueMarkerX += fillBarLength;
|
|
1943
2213
|
valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
1944
2214
|
}
|
|
2215
|
+
|
|
1945
2216
|
return {
|
|
1946
2217
|
valueMarkerX: valueMarkerX,
|
|
1947
2218
|
valueMarkerY: valueMarkerY
|
|
1948
2219
|
};
|
|
1949
2220
|
};
|
|
2221
|
+
|
|
1950
2222
|
exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
|
|
1951
2223
|
/**
|
|
1952
2224
|
* get dimensions for the marker bar in the gauge
|
|
@@ -1965,24 +2237,27 @@ exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
|
|
|
1965
2237
|
* @return {Number} markerBarDimensions.markerBarWidth
|
|
1966
2238
|
* @return {Number} markerBarDimensions.markerBarHeight
|
|
1967
2239
|
*/
|
|
2240
|
+
|
|
1968
2241
|
var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
|
|
1969
2242
|
var gaugeLength = _ref15.gaugeLength,
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
2243
|
+
gaugeStartX = _ref15.gaugeStartX,
|
|
2244
|
+
gaugeStartY = _ref15.gaugeStartY,
|
|
2245
|
+
gaugeWidth = _ref15.gaugeWidth,
|
|
2246
|
+
gaugeHeight = _ref15.gaugeHeight,
|
|
2247
|
+
orientation = _ref15.orientation;
|
|
1975
2248
|
var gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge
|
|
2249
|
+
|
|
1976
2250
|
var _ref16 = (0, exports.getGaugeBarStartPositions)({
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
1984
|
-
|
|
1985
|
-
|
|
2251
|
+
gaugeStartX: gaugeStartX,
|
|
2252
|
+
gaugeStartY: gaugeStartY,
|
|
2253
|
+
gaugeWidth: gaugeWidth,
|
|
2254
|
+
gaugeHeight: gaugeHeight,
|
|
2255
|
+
gaugeBarLength: gaugeBarLength,
|
|
2256
|
+
orientation: orientation
|
|
2257
|
+
}),
|
|
2258
|
+
markerBarX = _ref16.gaugeBarX,
|
|
2259
|
+
markerBarY = _ref16.gaugeBarY;
|
|
2260
|
+
|
|
1986
2261
|
var markerBarWidth = (0, exports.getGaugeBarWidth)({
|
|
1987
2262
|
gaugeBarLength: gaugeBarLength,
|
|
1988
2263
|
orientation: orientation
|
|
@@ -1999,6 +2274,7 @@ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
|
|
|
1999
2274
|
markerBarHeight: markerBarHeight
|
|
2000
2275
|
};
|
|
2001
2276
|
};
|
|
2277
|
+
|
|
2002
2278
|
exports.getMarkerBarDimensions = getMarkerBarDimensions;
|
|
2003
2279
|
/**
|
|
2004
2280
|
* get position x and y for value marker in marker gauge
|
|
@@ -2016,17 +2292,19 @@ exports.getMarkerBarDimensions = getMarkerBarDimensions;
|
|
|
2016
2292
|
* @return {Number} position.valueMarkerX
|
|
2017
2293
|
* @return {Number} position.valueMarkerY
|
|
2018
2294
|
*/
|
|
2295
|
+
|
|
2019
2296
|
var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref17) {
|
|
2020
2297
|
var markerBarX = _ref17.markerBarX,
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2298
|
+
markerBarY = _ref17.markerBarY,
|
|
2299
|
+
markerBarHeight = _ref17.markerBarHeight,
|
|
2300
|
+
gaugeLength = _ref17.markerBarLength,
|
|
2301
|
+
orientation = _ref17.orientation,
|
|
2302
|
+
value = _ref17.value,
|
|
2303
|
+
min = _ref17.min,
|
|
2304
|
+
max = _ref17.max;
|
|
2028
2305
|
var valueMarkerX = markerBarX;
|
|
2029
2306
|
var valueMarkerY = markerBarY;
|
|
2307
|
+
|
|
2030
2308
|
if (orientation === 'vertical') {
|
|
2031
2309
|
valueMarkerY += markerBarHeight - (0, exports.getGaugeBarLength)({
|
|
2032
2310
|
gaugeLength: gaugeLength,
|
|
@@ -2044,11 +2322,13 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
|
|
|
2044
2322
|
});
|
|
2045
2323
|
valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
|
|
2046
2324
|
}
|
|
2325
|
+
|
|
2047
2326
|
return {
|
|
2048
2327
|
valueMarkerX: valueMarkerX,
|
|
2049
2328
|
valueMarkerY: valueMarkerY
|
|
2050
2329
|
};
|
|
2051
2330
|
};
|
|
2331
|
+
|
|
2052
2332
|
exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
|
|
2053
2333
|
/**
|
|
2054
2334
|
* sort the ranges in ascending order
|
|
@@ -2056,11 +2336,13 @@ exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
|
|
|
2056
2336
|
* @param {Array} ranges
|
|
2057
2337
|
* @return {Array} sortedRanges
|
|
2058
2338
|
*/
|
|
2339
|
+
|
|
2059
2340
|
var getSortedRanges = function getSortedRanges(ranges) {
|
|
2060
2341
|
return ranges.sort(function (a, b) {
|
|
2061
2342
|
return a.from - b.from;
|
|
2062
2343
|
});
|
|
2063
2344
|
};
|
|
2345
|
+
|
|
2064
2346
|
exports.getSortedRanges = getSortedRanges;
|
|
2065
2347
|
/**
|
|
2066
2348
|
* validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to
|
|
@@ -2068,29 +2350,35 @@ exports.getSortedRanges = getSortedRanges;
|
|
|
2068
2350
|
* @param {Array} ranges
|
|
2069
2351
|
* @return {String} error
|
|
2070
2352
|
*/
|
|
2353
|
+
|
|
2071
2354
|
var validateRanges = function validateRanges(ranges) {
|
|
2072
2355
|
if (!ranges.length) {
|
|
2073
2356
|
return (0, i18n_1._)('Prop "ranges" is missing entries');
|
|
2074
|
-
}
|
|
2075
|
-
|
|
2357
|
+
} // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
|
|
2358
|
+
|
|
2359
|
+
|
|
2076
2360
|
if (ranges.some(function (range) {
|
|
2077
2361
|
return range.from >= range.to;
|
|
2078
2362
|
})) {
|
|
2079
2363
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: invalid range');
|
|
2080
|
-
}
|
|
2081
|
-
|
|
2364
|
+
} // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
|
|
2365
|
+
|
|
2366
|
+
|
|
2082
2367
|
if (ranges.length !== (0, lodash_1.uniqBy)(ranges, 'to').length || ranges.length !== (0, lodash_1.uniqBy)(ranges, 'from').length) {
|
|
2083
2368
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: duplicate values');
|
|
2084
2369
|
}
|
|
2085
|
-
|
|
2086
|
-
// check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
|
|
2370
|
+
|
|
2371
|
+
var sortedRanges = (0, exports.getSortedRanges)(ranges); // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
|
|
2372
|
+
|
|
2087
2373
|
for (var i = 1; i < sortedRanges.length; i += 1) {
|
|
2088
2374
|
if (sortedRanges[i].from !== sortedRanges[i - 1].to) {
|
|
2089
2375
|
return (0, i18n_1._)('Prop "ranges" has invalid entries: discontinuous ranges');
|
|
2090
2376
|
}
|
|
2091
2377
|
}
|
|
2378
|
+
|
|
2092
2379
|
return null;
|
|
2093
2380
|
};
|
|
2381
|
+
|
|
2094
2382
|
exports.validateRanges = validateRanges;
|
|
2095
2383
|
/**
|
|
2096
2384
|
* calculate min and max value of gauge
|
|
@@ -2100,6 +2388,7 @@ exports.validateRanges = validateRanges;
|
|
|
2100
2388
|
* @return {Number} gaugeRange.min
|
|
2101
2389
|
* @return {Number} gaugeRange.max
|
|
2102
2390
|
*/
|
|
2391
|
+
|
|
2103
2392
|
var getGaugeRange = function getGaugeRange(ranges) {
|
|
2104
2393
|
var min = Math.min.apply(Math, _toConsumableArray(ranges.map(function (range) {
|
|
2105
2394
|
return range.from;
|
|
@@ -2112,6 +2401,7 @@ var getGaugeRange = function getGaugeRange(ranges) {
|
|
|
2112
2401
|
max: max
|
|
2113
2402
|
};
|
|
2114
2403
|
};
|
|
2404
|
+
|
|
2115
2405
|
exports.getGaugeRange = getGaugeRange;
|
|
2116
2406
|
/**
|
|
2117
2407
|
* calculate stop offsets for linear gradient
|
|
@@ -2120,17 +2410,20 @@ exports.getGaugeRange = getGaugeRange;
|
|
|
2120
2410
|
* @param {String} orientation
|
|
2121
2411
|
* @return {Array} cumulativeOffsets
|
|
2122
2412
|
*/
|
|
2413
|
+
|
|
2123
2414
|
var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
|
|
2124
2415
|
var ranges = _ref18.ranges,
|
|
2125
|
-
|
|
2416
|
+
orientation = _ref18.orientation;
|
|
2417
|
+
|
|
2126
2418
|
var _ref19 = (0, exports.getGaugeRange)(ranges),
|
|
2127
|
-
|
|
2128
|
-
|
|
2419
|
+
min = _ref19.min,
|
|
2420
|
+
max = _ref19.max;
|
|
2421
|
+
|
|
2129
2422
|
var offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);
|
|
2130
2423
|
var offsets = ranges.map(function (range) {
|
|
2131
2424
|
return Math.abs(range.from - range.to) * offsetScale;
|
|
2132
|
-
});
|
|
2133
|
-
|
|
2425
|
+
}); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
|
|
2426
|
+
|
|
2134
2427
|
offsets = orientation === 'vertical' ? offsets.reverse() : offsets;
|
|
2135
2428
|
var cumulativeOffsets = [];
|
|
2136
2429
|
offsets.reduce(function (accumulator, currentValue, idx) {
|
|
@@ -2139,6 +2432,7 @@ var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
|
|
|
2139
2432
|
}, 0);
|
|
2140
2433
|
return cumulativeOffsets;
|
|
2141
2434
|
};
|
|
2435
|
+
|
|
2142
2436
|
exports.getGradientStopOffsets = getGradientStopOffsets;
|
|
2143
2437
|
/**
|
|
2144
2438
|
* calculate stop colors for linear gradient
|
|
@@ -2147,15 +2441,17 @@ exports.getGradientStopOffsets = getGradientStopOffsets;
|
|
|
2147
2441
|
* @param {String} orientation
|
|
2148
2442
|
* @return {Array} stopColors
|
|
2149
2443
|
*/
|
|
2444
|
+
|
|
2150
2445
|
var getGradientStopColors = function getGradientStopColors(_ref20) {
|
|
2151
2446
|
var ranges = _ref20.ranges,
|
|
2152
|
-
|
|
2447
|
+
orientation = _ref20.orientation;
|
|
2153
2448
|
var stopColors = ranges.map(function (range) {
|
|
2154
2449
|
return range.value;
|
|
2155
|
-
});
|
|
2156
|
-
|
|
2450
|
+
}); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
|
|
2451
|
+
|
|
2157
2452
|
return orientation === 'vertical' ? stopColors.reverse() : stopColors;
|
|
2158
2453
|
};
|
|
2454
|
+
|
|
2159
2455
|
exports.getGradientStopColors = getGradientStopColors;
|
|
2160
2456
|
/**
|
|
2161
2457
|
* calculate linear gradient stops from ranges
|
|
@@ -2165,9 +2461,10 @@ exports.getGradientStopColors = getGradientStopColors;
|
|
|
2165
2461
|
* @param {String} orientation
|
|
2166
2462
|
* @return {Array} stops
|
|
2167
2463
|
*/
|
|
2464
|
+
|
|
2168
2465
|
var getGradientStops = function getGradientStops(_ref21) {
|
|
2169
2466
|
var ranges = _ref21.ranges,
|
|
2170
|
-
|
|
2467
|
+
orientation = _ref21.orientation;
|
|
2171
2468
|
var stops = [];
|
|
2172
2469
|
var offsets = (0, exports.getGradientStopOffsets)({
|
|
2173
2470
|
ranges: ranges,
|
|
@@ -2176,13 +2473,13 @@ var getGradientStops = function getGradientStops(_ref21) {
|
|
|
2176
2473
|
var stopColors = (0, exports.getGradientStopColors)({
|
|
2177
2474
|
ranges: ranges,
|
|
2178
2475
|
orientation: orientation
|
|
2179
|
-
});
|
|
2180
|
-
|
|
2476
|
+
}); // Initialize stops with the first color stop
|
|
2477
|
+
|
|
2181
2478
|
stops.push({
|
|
2182
2479
|
offset: "".concat(offsets[0], "%"),
|
|
2183
2480
|
stopColor: stopColors[0]
|
|
2184
|
-
});
|
|
2185
|
-
|
|
2481
|
+
}); // Add the remaining color stops with gradient change at each stop
|
|
2482
|
+
|
|
2186
2483
|
for (var i = 1; i < ranges.length; i += 1) {
|
|
2187
2484
|
stops.push({
|
|
2188
2485
|
offset: "".concat(offsets[i - 1], "%"),
|
|
@@ -2193,8 +2490,10 @@ var getGradientStops = function getGradientStops(_ref21) {
|
|
|
2193
2490
|
stopColor: stopColors[i]
|
|
2194
2491
|
});
|
|
2195
2492
|
}
|
|
2493
|
+
|
|
2196
2494
|
return stops;
|
|
2197
2495
|
};
|
|
2496
|
+
|
|
2198
2497
|
exports.getGradientStops = getGradientStops;
|
|
2199
2498
|
/**
|
|
2200
2499
|
* calculate linear gradient dimensions
|
|
@@ -2206,6 +2505,7 @@ exports.getGradientStops = getGradientStops;
|
|
|
2206
2505
|
* @return {String} dimensions.x2
|
|
2207
2506
|
* @return {String} dimensions.y2
|
|
2208
2507
|
*/
|
|
2508
|
+
|
|
2209
2509
|
var getGradientDimensions = function getGradientDimensions(orientation) {
|
|
2210
2510
|
var x1 = '0%';
|
|
2211
2511
|
var y1 = '0%';
|
|
@@ -2218,8 +2518,9 @@ var getGradientDimensions = function getGradientDimensions(orientation) {
|
|
|
2218
2518
|
y2: y2
|
|
2219
2519
|
};
|
|
2220
2520
|
};
|
|
2221
|
-
|
|
2222
|
-
// map for new options names to old option names
|
|
2521
|
+
|
|
2522
|
+
exports.getGradientDimensions = getGradientDimensions; // map for new options names to old option names
|
|
2523
|
+
|
|
2223
2524
|
var gaugeOptionsMapping = {
|
|
2224
2525
|
majorTickInterval: 'majorUnit',
|
|
2225
2526
|
gaugeRanges: 'ranges'
|
|
@@ -2230,11 +2531,13 @@ var gaugeOptionsMapping = {
|
|
|
2230
2531
|
* @param {Object} options
|
|
2231
2532
|
* @returns {Object}
|
|
2232
2533
|
*/
|
|
2534
|
+
|
|
2233
2535
|
var mapToOldKey = function mapToOldKey(options) {
|
|
2234
2536
|
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
2235
2537
|
return gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key;
|
|
2236
2538
|
});
|
|
2237
2539
|
};
|
|
2540
|
+
|
|
2238
2541
|
exports.mapToOldKey = mapToOldKey;
|
|
2239
2542
|
/**
|
|
2240
2543
|
* Helper method to map labelDisplay and valueDisplay options to pure component option names
|
|
@@ -2243,12 +2546,14 @@ exports.mapToOldKey = mapToOldKey;
|
|
|
2243
2546
|
* @param {Object} options
|
|
2244
2547
|
* @returns {Object}
|
|
2245
2548
|
*/
|
|
2549
|
+
|
|
2246
2550
|
var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options) {
|
|
2247
2551
|
var rangeOrValue = labelOrValue === 'value' ? 'Value' : 'Range';
|
|
2248
2552
|
var showKey = labelOrValue === 'value' ? 'showValue' : 'showLabels';
|
|
2249
2553
|
var percentKey = "usePercentage".concat(rangeOrValue);
|
|
2250
2554
|
var optionString = "".concat(labelOrValue, "Display");
|
|
2251
2555
|
var newOptions = Object.assign({}, options);
|
|
2556
|
+
|
|
2252
2557
|
if (newOptions[optionString]) {
|
|
2253
2558
|
if (newOptions[optionString] === 'number') {
|
|
2254
2559
|
newOptions[showKey] = true;
|
|
@@ -2261,8 +2566,10 @@ var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options)
|
|
|
2261
2566
|
newOptions[percentKey] = false;
|
|
2262
2567
|
}
|
|
2263
2568
|
}
|
|
2569
|
+
|
|
2264
2570
|
return (0, lodash_1.omit)(newOptions, [optionString]);
|
|
2265
2571
|
};
|
|
2572
|
+
|
|
2266
2573
|
exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
2267
2574
|
/**
|
|
2268
2575
|
* Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts
|
|
@@ -2271,6 +2578,7 @@ exports.mapValueLabelDisplay = mapValueLabelDisplay;
|
|
|
2271
2578
|
* @param {Object} originalOptions
|
|
2272
2579
|
* @returns {Object}
|
|
2273
2580
|
*/
|
|
2581
|
+
|
|
2274
2582
|
var convertToGaugeProperties = function convertToGaugeProperties(originalOptions) {
|
|
2275
2583
|
return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru(function (options) {
|
|
2276
2584
|
return (0, exports.mapValueLabelDisplay)('label', options);
|
|
@@ -2278,6 +2586,7 @@ var convertToGaugeProperties = function convertToGaugeProperties(originalOptions
|
|
|
2278
2586
|
return (0, exports.mapValueLabelDisplay)('value', options);
|
|
2279
2587
|
}).value();
|
|
2280
2588
|
};
|
|
2589
|
+
|
|
2281
2590
|
exports.convertToGaugeProperties = convertToGaugeProperties;
|
|
2282
2591
|
|
|
2283
2592
|
/***/ }),
|
|
@@ -2317,7 +2626,9 @@ exports.convertToGaugeProperties = convertToGaugeProperties;
|
|
|
2317
2626
|
Object.defineProperty(exports, "__esModule", {
|
|
2318
2627
|
value: true
|
|
2319
2628
|
});
|
|
2629
|
+
|
|
2320
2630
|
var i18n_1 = __webpack_require__(2);
|
|
2631
|
+
|
|
2321
2632
|
var gauge = {
|
|
2322
2633
|
label: (0, i18n_1._)('Data display'),
|
|
2323
2634
|
layout: [[{
|
|
@@ -2411,16 +2722,16 @@ var MajorTickLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.te
|
|
|
2411
2722
|
});
|
|
2412
2723
|
var MajorTick = function MajorTick(_ref) {
|
|
2413
2724
|
var index = _ref.index,
|
|
2414
|
-
|
|
2415
|
-
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2725
|
+
x1 = _ref.x1,
|
|
2726
|
+
y1 = _ref.y1,
|
|
2727
|
+
x2 = _ref.x2,
|
|
2728
|
+
y2 = _ref.y2,
|
|
2729
|
+
showLabels = _ref.showLabels,
|
|
2730
|
+
label = _ref.label,
|
|
2731
|
+
labelX = _ref.labelX,
|
|
2732
|
+
labelY = _ref.labelY,
|
|
2733
|
+
majorTickStrokeColor = _ref.majorTickStrokeColor,
|
|
2734
|
+
majorTickFillColor = _ref.majorTickFillColor;
|
|
2424
2735
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTickLine, {
|
|
2425
2736
|
index: index,
|
|
2426
2737
|
x1: x1,
|
|
@@ -2450,7 +2761,6 @@ MajorTick.propTypes = {
|
|
|
2450
2761
|
majorTickStrokeColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string,
|
|
2451
2762
|
majorTickFillColor: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.string
|
|
2452
2763
|
};
|
|
2453
|
-
|
|
2454
2764
|
/**
|
|
2455
2765
|
* calculate position for each major tick
|
|
2456
2766
|
* @method positionMajorTick
|
|
@@ -2464,20 +2774,22 @@ MajorTick.propTypes = {
|
|
|
2464
2774
|
* @param {Number} input.i index of major tick
|
|
2465
2775
|
* @return {Object} MajorTick positions
|
|
2466
2776
|
*/
|
|
2777
|
+
|
|
2467
2778
|
var positionMajorTick = function positionMajorTick(_ref2) {
|
|
2468
2779
|
var width = _ref2.width,
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
2780
|
+
height = _ref2.height,
|
|
2781
|
+
startX = _ref2.startX,
|
|
2782
|
+
startY = _ref2.startY,
|
|
2783
|
+
orientation = _ref2.orientation,
|
|
2784
|
+
numOfTicks = _ref2.numOfTicks,
|
|
2785
|
+
i = _ref2.i;
|
|
2475
2786
|
var x1 = startX;
|
|
2476
2787
|
var y1 = startY;
|
|
2477
2788
|
var x2 = startX;
|
|
2478
2789
|
var y2 = startY;
|
|
2479
2790
|
var labelX = startX;
|
|
2480
2791
|
var labelY;
|
|
2792
|
+
|
|
2481
2793
|
if (orientation === 'vertical') {
|
|
2482
2794
|
var y = height / numOfTicks * (numOfTicks - i) + startY;
|
|
2483
2795
|
x1 -= TICK_LENGTH_DELTA;
|
|
@@ -2495,6 +2807,7 @@ var positionMajorTick = function positionMajorTick(_ref2) {
|
|
|
2495
2807
|
labelX = x;
|
|
2496
2808
|
labelY = y2 + 16;
|
|
2497
2809
|
}
|
|
2810
|
+
|
|
2498
2811
|
return {
|
|
2499
2812
|
x1: x1,
|
|
2500
2813
|
y1: y1,
|
|
@@ -2504,39 +2817,43 @@ var positionMajorTick = function positionMajorTick(_ref2) {
|
|
|
2504
2817
|
labelY: labelY
|
|
2505
2818
|
};
|
|
2506
2819
|
};
|
|
2820
|
+
|
|
2507
2821
|
var MajorTicks = function MajorTicks(_ref3) {
|
|
2508
2822
|
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
2823
|
+
|
|
2509
2824
|
var width = props.width,
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2825
|
+
height = props.height,
|
|
2826
|
+
startX = props.startX,
|
|
2827
|
+
startY = props.startY,
|
|
2828
|
+
min = props.min,
|
|
2829
|
+
max = props.max,
|
|
2830
|
+
majorUnit = props.majorUnit,
|
|
2831
|
+
orientation = props.orientation,
|
|
2832
|
+
showLabels = props.showLabels,
|
|
2833
|
+
usePercentageRange = props.usePercentageRange,
|
|
2834
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
2835
|
+
majorTickStrokeColor = props.majorTickStrokeColor;
|
|
2521
2836
|
var range = max - min;
|
|
2522
2837
|
var numOfTicks = majorUnit === 'auto' || Number.isNaN(Number(majorUnit)) || majorUnit <= 0 ? DEFAULT_NUM_OF_TICKS : range / majorUnit;
|
|
2523
2838
|
var majorTicks = [];
|
|
2839
|
+
|
|
2524
2840
|
for (var i = 0; i <= numOfTicks; i += 1) {
|
|
2525
2841
|
var _positionMajorTick = positionMajorTick({
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2842
|
+
width: width,
|
|
2843
|
+
height: height,
|
|
2844
|
+
startX: startX,
|
|
2845
|
+
startY: startY,
|
|
2846
|
+
orientation: orientation,
|
|
2847
|
+
numOfTicks: numOfTicks,
|
|
2848
|
+
i: i
|
|
2849
|
+
}),
|
|
2850
|
+
x1 = _positionMajorTick.x1,
|
|
2851
|
+
y1 = _positionMajorTick.y1,
|
|
2852
|
+
x2 = _positionMajorTick.x2,
|
|
2853
|
+
y2 = _positionMajorTick.y2,
|
|
2854
|
+
labelX = _positionMajorTick.labelX,
|
|
2855
|
+
labelY = _positionMajorTick.labelY;
|
|
2856
|
+
|
|
2540
2857
|
var label = usePercentageRange ? "".concat(parseInt((i / numOfTicks - min / range) * 100, 10), "%") : parseInt(min + range / numOfTicks * i, 10);
|
|
2541
2858
|
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
2542
2859
|
key: i,
|
|
@@ -2552,26 +2869,28 @@ var MajorTicks = function MajorTicks(_ref3) {
|
|
|
2552
2869
|
majorTickFillColor: majorTickFillColor,
|
|
2553
2870
|
majorTickStrokeColor: majorTickStrokeColor
|
|
2554
2871
|
}));
|
|
2555
|
-
}
|
|
2872
|
+
} // if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
2873
|
+
|
|
2556
2874
|
|
|
2557
|
-
// if the gauge is not divided evenly, put the last tick at the end of the gauge
|
|
2558
2875
|
if (!Number.isInteger(numOfTicks)) {
|
|
2559
2876
|
var extraNumOfTicks = Math.ceil(numOfTicks);
|
|
2877
|
+
|
|
2560
2878
|
var _positionMajorTick2 = positionMajorTick({
|
|
2561
|
-
|
|
2562
|
-
|
|
2563
|
-
|
|
2564
|
-
|
|
2565
|
-
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2879
|
+
width: width,
|
|
2880
|
+
height: height,
|
|
2881
|
+
startX: startX,
|
|
2882
|
+
startY: startY,
|
|
2883
|
+
orientation: orientation,
|
|
2884
|
+
numOfTicks: extraNumOfTicks,
|
|
2885
|
+
i: extraNumOfTicks
|
|
2886
|
+
}),
|
|
2887
|
+
_x = _positionMajorTick2.x1,
|
|
2888
|
+
_y = _positionMajorTick2.y1,
|
|
2889
|
+
_x2 = _positionMajorTick2.x2,
|
|
2890
|
+
_y2 = _positionMajorTick2.y2,
|
|
2891
|
+
_labelX = _positionMajorTick2.labelX,
|
|
2892
|
+
_labelY = _positionMajorTick2.labelY;
|
|
2893
|
+
|
|
2575
2894
|
majorTicks.push( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(MajorTick, {
|
|
2576
2895
|
key: extraNumOfTicks,
|
|
2577
2896
|
id: extraNumOfTicks,
|
|
@@ -2587,8 +2906,10 @@ var MajorTicks = function MajorTicks(_ref3) {
|
|
|
2587
2906
|
majorTickStrokeColor: majorTickStrokeColor
|
|
2588
2907
|
}));
|
|
2589
2908
|
}
|
|
2909
|
+
|
|
2590
2910
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, majorTicks);
|
|
2591
2911
|
};
|
|
2912
|
+
|
|
2592
2913
|
MajorTicks.propTypes = {
|
|
2593
2914
|
width: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
2594
2915
|
height: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
@@ -2660,7 +2981,6 @@ var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.
|
|
|
2660
2981
|
})(["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) {
|
|
2661
2982
|
return props.valueMarkerLabelFillColor;
|
|
2662
2983
|
});
|
|
2663
|
-
|
|
2664
2984
|
/**
|
|
2665
2985
|
* calculate the path of Value Marker shape
|
|
2666
2986
|
* @method positionValueMarkerRect
|
|
@@ -2671,13 +2991,14 @@ var ValueMarkerLabel = styled_components__WEBPACK_IMPORTED_MODULE_3___default.a.
|
|
|
2671
2991
|
* @param {Number} input.valueMarkerRectLength
|
|
2672
2992
|
* @return {String} d containing a series of path commands that define the path to be
|
|
2673
2993
|
*/
|
|
2994
|
+
|
|
2674
2995
|
var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
2675
2996
|
var x = _ref.x,
|
|
2676
|
-
|
|
2677
|
-
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2997
|
+
y = _ref.y,
|
|
2998
|
+
orientation = _ref.orientation,
|
|
2999
|
+
valueMarkerRectLength = _ref.valueMarkerRectLength,
|
|
3000
|
+
_ref$alignCenter = _ref.alignCenter,
|
|
3001
|
+
alignCenter = _ref$alignCenter === void 0 ? false : _ref$alignCenter;
|
|
2681
3002
|
var hLength = MARKER_THICKNESS;
|
|
2682
3003
|
var vLength = valueMarkerRectLength;
|
|
2683
3004
|
var markerStartX = alignCenter ? x - MARKER_THICKNESS / 2 : x - MARKER_THICKNESS;
|
|
@@ -2686,6 +3007,7 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
2686
3007
|
var innerVLength = MARKER_INNER_LENGTH;
|
|
2687
3008
|
var innerStartX = markerStartX + innerHLength;
|
|
2688
3009
|
var innerStartY = markerStartY + 7;
|
|
3010
|
+
|
|
2689
3011
|
if (orientation === 'vertical') {
|
|
2690
3012
|
hLength = valueMarkerRectLength;
|
|
2691
3013
|
vLength = MARKER_THICKNESS;
|
|
@@ -2696,9 +3018,9 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
2696
3018
|
innerStartX = markerStartX + 7;
|
|
2697
3019
|
innerStartY = markerStartY + innerVLength;
|
|
2698
3020
|
}
|
|
3021
|
+
|
|
2699
3022
|
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");
|
|
2700
3023
|
};
|
|
2701
|
-
|
|
2702
3024
|
/**
|
|
2703
3025
|
* calculate the position of value marker label
|
|
2704
3026
|
* @method positionLabel
|
|
@@ -2713,20 +3035,23 @@ var positionValueMarkerRect = function positionValueMarkerRect(_ref) {
|
|
|
2713
3035
|
* @return {Number} positions.labelX x of value marker label text
|
|
2714
3036
|
* @return {Number} positions.labelY y of value marker label text
|
|
2715
3037
|
*/
|
|
3038
|
+
|
|
2716
3039
|
var positionLabel = function positionLabel(_ref2) {
|
|
2717
3040
|
var x = _ref2.x,
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
|
|
2723
|
-
|
|
3041
|
+
y = _ref2.y,
|
|
3042
|
+
length = _ref2.length,
|
|
3043
|
+
orientation = _ref2.orientation,
|
|
3044
|
+
_ref2$alignCenter = _ref2.alignCenter,
|
|
3045
|
+
alignCenter = _ref2$alignCenter === void 0 ? false : _ref2$alignCenter; // for horizontal view
|
|
3046
|
+
|
|
2724
3047
|
var labelRectX = alignCenter ? x - MARKER_LABEL_WIDTH / 2 : x - MARKER_THICKNESS / 2 - MARKER_LABEL_WIDTH / 2;
|
|
2725
3048
|
var labelRectY = y + length;
|
|
3049
|
+
|
|
2726
3050
|
if (orientation === 'vertical') {
|
|
2727
3051
|
labelRectX = x + length;
|
|
2728
3052
|
labelRectY = alignCenter ? y - MARKER_LABEL_HEIGHT / 2 : y - (MARKER_LABEL_HEIGHT - MARKER_THICKNESS) / 2;
|
|
2729
3053
|
}
|
|
3054
|
+
|
|
2730
3055
|
var labelX = labelRectX + MARKER_LABEL_WIDTH / 2;
|
|
2731
3056
|
var labelY = labelRectY + MARKER_LABEL_HEIGHT / 2;
|
|
2732
3057
|
return {
|
|
@@ -2736,32 +3061,36 @@ var positionLabel = function positionLabel(_ref2) {
|
|
|
2736
3061
|
labelY: labelY
|
|
2737
3062
|
};
|
|
2738
3063
|
};
|
|
3064
|
+
|
|
2739
3065
|
var ValueMarker = function ValueMarker(_ref3) {
|
|
2740
3066
|
var props = _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, _ref3);
|
|
3067
|
+
|
|
2741
3068
|
var x = props.x,
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
|
|
2745
|
-
|
|
2746
|
-
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
3069
|
+
y = props.y,
|
|
3070
|
+
length = props.length,
|
|
3071
|
+
min = props.min,
|
|
3072
|
+
max = props.max,
|
|
3073
|
+
value = props.value,
|
|
3074
|
+
orientation = props.orientation,
|
|
3075
|
+
showValue = props.showValue,
|
|
3076
|
+
usePercentageValue = props.usePercentageValue,
|
|
3077
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
3078
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor,
|
|
3079
|
+
alignCenter = props.alignCenter;
|
|
2753
3080
|
var valueMarkerRectLength = length + DELTA_LENGTH;
|
|
3081
|
+
|
|
2754
3082
|
var _positionLabel = positionLabel({
|
|
2755
|
-
|
|
2756
|
-
|
|
2757
|
-
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
3083
|
+
x: x,
|
|
3084
|
+
y: y,
|
|
3085
|
+
length: length,
|
|
3086
|
+
orientation: orientation,
|
|
3087
|
+
alignCenter: alignCenter
|
|
3088
|
+
}),
|
|
3089
|
+
labelRectX = _positionLabel.labelRectX,
|
|
3090
|
+
labelRectY = _positionLabel.labelRectY,
|
|
3091
|
+
labelX = _positionLabel.labelX,
|
|
3092
|
+
labelY = _positionLabel.labelY;
|
|
3093
|
+
|
|
2765
3094
|
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement("g", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1___default.a.createElement(ValueMarkerRect, {
|
|
2766
3095
|
"data-test": "value-marker-rect",
|
|
2767
3096
|
d: positionValueMarkerRect({
|
|
@@ -2791,6 +3120,7 @@ var ValueMarker = function ValueMarker(_ref3) {
|
|
|
2791
3120
|
useTrendUnits: true
|
|
2792
3121
|
}))));
|
|
2793
3122
|
};
|
|
3123
|
+
|
|
2794
3124
|
ValueMarker.propTypes = {
|
|
2795
3125
|
x: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
2796
3126
|
y: prop_types__WEBPACK_IMPORTED_MODULE_2___default.a.number,
|
|
@@ -2901,7 +3231,8 @@ ValueMarker.defaultProps = {
|
|
|
2901
3231
|
/* 211 */,
|
|
2902
3232
|
/* 212 */,
|
|
2903
3233
|
/* 213 */,
|
|
2904
|
-
/* 214
|
|
3234
|
+
/* 214 */,
|
|
3235
|
+
/* 215 */
|
|
2905
3236
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2906
3237
|
|
|
2907
3238
|
"use strict";
|
|
@@ -2909,28 +3240,39 @@ ValueMarker.defaultProps = {
|
|
|
2909
3240
|
|
|
2910
3241
|
var __rest = this && this.__rest || function (s, e) {
|
|
2911
3242
|
var t = {};
|
|
3243
|
+
|
|
2912
3244
|
for (var p in s) {
|
|
2913
3245
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
2914
3246
|
}
|
|
3247
|
+
|
|
2915
3248
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
2916
3249
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
2917
3250
|
}
|
|
2918
3251
|
return t;
|
|
2919
3252
|
};
|
|
3253
|
+
|
|
2920
3254
|
Object.defineProperty(exports, "__esModule", {
|
|
2921
3255
|
value: true
|
|
2922
3256
|
});
|
|
2923
3257
|
exports.themes = exports.computeVizProps = exports.PureFillerGauge = exports.config = void 0;
|
|
3258
|
+
|
|
2924
3259
|
var lodash_1 = __webpack_require__(3);
|
|
2925
|
-
|
|
2926
|
-
var
|
|
2927
|
-
|
|
3260
|
+
|
|
3261
|
+
var config_1 = __webpack_require__(216);
|
|
3262
|
+
|
|
3263
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
3264
|
+
|
|
3265
|
+
var FillerGauge_1 = __webpack_require__(220);
|
|
3266
|
+
|
|
2928
3267
|
var gaugeUtils_1 = __webpack_require__(98);
|
|
3268
|
+
|
|
2929
3269
|
exports.config = config_1.default;
|
|
2930
3270
|
exports.PureFillerGauge = FillerGauge_1.default;
|
|
2931
3271
|
var validOptions = Object.keys(exports.config.optionsSchema);
|
|
3272
|
+
|
|
2932
3273
|
var computeVizProps = function computeVizProps(_a) {
|
|
2933
3274
|
var props = __rest(_a, []);
|
|
3275
|
+
|
|
2934
3276
|
var options = (0, lodash_1.chain)(props).pick(validOptions).thru(gaugeUtils_1.convertToGaugeProperties).value();
|
|
2935
3277
|
var defaultColors = {
|
|
2936
3278
|
backgroundBarFillColor: exports.config.themes.defaultBackgroundBarFillColor(props),
|
|
@@ -2941,6 +3283,7 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
2941
3283
|
};
|
|
2942
3284
|
return Object.assign(Object.assign({}, options), defaultColors);
|
|
2943
3285
|
};
|
|
3286
|
+
|
|
2944
3287
|
exports.computeVizProps = computeVizProps;
|
|
2945
3288
|
var viz = (0, withDashboardViz_1.default)({
|
|
2946
3289
|
ReactViz: FillerGauge_1.default,
|
|
@@ -2951,7 +3294,7 @@ exports.themes = config_1.default.themes;
|
|
|
2951
3294
|
exports.default = viz;
|
|
2952
3295
|
|
|
2953
3296
|
/***/ }),
|
|
2954
|
-
/*
|
|
3297
|
+
/* 216 */
|
|
2955
3298
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2956
3299
|
|
|
2957
3300
|
"use strict";
|
|
@@ -2960,21 +3303,37 @@ exports.default = viz;
|
|
|
2960
3303
|
Object.defineProperty(exports, "__esModule", {
|
|
2961
3304
|
value: true
|
|
2962
3305
|
});
|
|
3306
|
+
|
|
2963
3307
|
var i18n_1 = __webpack_require__(2);
|
|
3308
|
+
|
|
2964
3309
|
var schemaUtils_1 = __webpack_require__(16);
|
|
3310
|
+
|
|
2965
3311
|
var pick_1 = __webpack_require__(23);
|
|
3312
|
+
|
|
2966
3313
|
var variables_1 = __webpack_require__(11);
|
|
3314
|
+
|
|
2967
3315
|
var visualization_color_palettes_1 = __webpack_require__(51);
|
|
3316
|
+
|
|
2968
3317
|
var PresetPalettes_1 = __webpack_require__(61);
|
|
2969
|
-
|
|
3318
|
+
|
|
3319
|
+
var GaugeFiller_1 = __webpack_require__(217);
|
|
3320
|
+
|
|
2970
3321
|
var placeholders_1 = __webpack_require__(50);
|
|
3322
|
+
|
|
2971
3323
|
var VizBehavior_1 = __webpack_require__(6);
|
|
2972
|
-
|
|
3324
|
+
|
|
3325
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
3326
|
+
|
|
2973
3327
|
var configUtils_1 = __webpack_require__(20);
|
|
3328
|
+
|
|
2974
3329
|
var Gauge_1 = __webpack_require__(126);
|
|
3330
|
+
|
|
2975
3331
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
2976
|
-
|
|
2977
|
-
var
|
|
3332
|
+
|
|
3333
|
+
var DynamicGaugeColorEditor_1 = __webpack_require__(218);
|
|
3334
|
+
|
|
3335
|
+
var StaticGaugeColorEditor_1 = __webpack_require__(219);
|
|
3336
|
+
|
|
2978
3337
|
var dataContract = {
|
|
2979
3338
|
requiredDataSources: [{
|
|
2980
3339
|
name: 'primary',
|
|
@@ -3078,12 +3437,13 @@ var themes = {
|
|
|
3078
3437
|
enterprise: {
|
|
3079
3438
|
light: variables_1.default.gray30(props),
|
|
3080
3439
|
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
3081
|
-
},
|
|
3082
3440
|
|
|
3441
|
+
},
|
|
3083
3442
|
prisma: {
|
|
3084
3443
|
// TODO: missed colors :(
|
|
3085
3444
|
light: variables_1.default.neutral100(props),
|
|
3086
3445
|
dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
|
|
3446
|
+
|
|
3087
3447
|
}
|
|
3088
3448
|
})(props);
|
|
3089
3449
|
},
|
|
@@ -3171,7 +3531,7 @@ var editorConfig = [{
|
|
|
3171
3531
|
presets: presets,
|
|
3172
3532
|
value: function value(_ref) {
|
|
3173
3533
|
var context = _ref.context,
|
|
3174
|
-
|
|
3534
|
+
options = _ref.options;
|
|
3175
3535
|
var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
|
|
3176
3536
|
return initialPreset && initialPreset.label || null;
|
|
3177
3537
|
}
|
|
@@ -3190,16 +3550,19 @@ var editorConfig = [{
|
|
|
3190
3550
|
/**
|
|
3191
3551
|
* visualization configuration
|
|
3192
3552
|
*/
|
|
3553
|
+
|
|
3193
3554
|
var config = {
|
|
3194
3555
|
/**
|
|
3195
3556
|
* unique viz key
|
|
3196
3557
|
*/
|
|
3197
3558
|
key: 'splunk.fillergauge',
|
|
3559
|
+
|
|
3198
3560
|
/**
|
|
3199
3561
|
* viz name
|
|
3200
3562
|
*/
|
|
3201
3563
|
name: (0, i18n_1._)('Filler gauge'),
|
|
3202
3564
|
category: VizCategory_1.VizCategory.GAUGE,
|
|
3565
|
+
|
|
3203
3566
|
/**
|
|
3204
3567
|
* viz icon
|
|
3205
3568
|
*/
|
|
@@ -3216,13 +3579,13 @@ var config = {
|
|
|
3216
3579
|
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
3217
3580
|
|
|
3218
3581
|
/***/ }),
|
|
3219
|
-
/*
|
|
3582
|
+
/* 217 */
|
|
3220
3583
|
/***/ (function(module, exports) {
|
|
3221
3584
|
|
|
3222
3585
|
module.exports = require("@splunk/react-icons/enterprise/GaugeFiller");
|
|
3223
3586
|
|
|
3224
3587
|
/***/ }),
|
|
3225
|
-
/*
|
|
3588
|
+
/* 218 */
|
|
3226
3589
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3227
3590
|
|
|
3228
3591
|
"use strict";
|
|
@@ -3232,11 +3595,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3232
3595
|
value: true
|
|
3233
3596
|
});
|
|
3234
3597
|
exports.getDynamicGaugeColorEditor = void 0;
|
|
3598
|
+
|
|
3235
3599
|
var i18n_1 = __webpack_require__(2);
|
|
3600
|
+
|
|
3236
3601
|
var configUtils_1 = __webpack_require__(22);
|
|
3602
|
+
|
|
3237
3603
|
var getDynamicGaugeColorEditor = function getDynamicGaugeColorEditor(_ref) {
|
|
3238
3604
|
var defaultContext = _ref.defaultContext,
|
|
3239
|
-
|
|
3605
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
3240
3606
|
return {
|
|
3241
3607
|
label: (0, i18n_1._)('Gauge'),
|
|
3242
3608
|
option: 'gaugeColor',
|
|
@@ -3264,10 +3630,11 @@ var getDynamicGaugeColorEditor = function getDynamicGaugeColorEditor(_ref) {
|
|
|
3264
3630
|
}
|
|
3265
3631
|
};
|
|
3266
3632
|
};
|
|
3633
|
+
|
|
3267
3634
|
exports.getDynamicGaugeColorEditor = getDynamicGaugeColorEditor;
|
|
3268
3635
|
|
|
3269
3636
|
/***/ }),
|
|
3270
|
-
/*
|
|
3637
|
+
/* 219 */
|
|
3271
3638
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3272
3639
|
|
|
3273
3640
|
"use strict";
|
|
@@ -3276,8 +3643,11 @@ exports.getDynamicGaugeColorEditor = getDynamicGaugeColorEditor;
|
|
|
3276
3643
|
Object.defineProperty(exports, "__esModule", {
|
|
3277
3644
|
value: true
|
|
3278
3645
|
});
|
|
3646
|
+
|
|
3279
3647
|
var i18n_1 = __webpack_require__(2);
|
|
3648
|
+
|
|
3280
3649
|
var configUtils_1 = __webpack_require__(22);
|
|
3650
|
+
|
|
3281
3651
|
var StaticGaugeColorEditor = {
|
|
3282
3652
|
label: (0, i18n_1._)('Gauge'),
|
|
3283
3653
|
option: 'gaugeColor',
|
|
@@ -3290,7 +3660,7 @@ var StaticGaugeColorEditor = {
|
|
|
3290
3660
|
exports.default = StaticGaugeColorEditor;
|
|
3291
3661
|
|
|
3292
3662
|
/***/ }),
|
|
3293
|
-
/*
|
|
3663
|
+
/* 220 */
|
|
3294
3664
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3295
3665
|
|
|
3296
3666
|
"use strict";
|
|
@@ -3298,29 +3668,44 @@ exports.default = StaticGaugeColorEditor;
|
|
|
3298
3668
|
|
|
3299
3669
|
var __rest = this && this.__rest || function (s, e) {
|
|
3300
3670
|
var t = {};
|
|
3671
|
+
|
|
3301
3672
|
for (var p in s) {
|
|
3302
3673
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
3303
3674
|
}
|
|
3675
|
+
|
|
3304
3676
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3305
3677
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
3306
3678
|
}
|
|
3307
3679
|
return t;
|
|
3308
3680
|
};
|
|
3681
|
+
|
|
3309
3682
|
Object.defineProperty(exports, "__esModule", {
|
|
3310
3683
|
value: true
|
|
3311
3684
|
});
|
|
3312
3685
|
exports.AXIS_ORIENTATION_TYPES = void 0;
|
|
3686
|
+
|
|
3313
3687
|
var React = __webpack_require__(1);
|
|
3688
|
+
|
|
3314
3689
|
var T = __webpack_require__(0);
|
|
3690
|
+
|
|
3315
3691
|
var styled_components_1 = __webpack_require__(4);
|
|
3692
|
+
|
|
3316
3693
|
var lodash_1 = __webpack_require__(3);
|
|
3694
|
+
|
|
3317
3695
|
var i18n_1 = __webpack_require__(2);
|
|
3696
|
+
|
|
3318
3697
|
var style_1 = __webpack_require__(14);
|
|
3698
|
+
|
|
3319
3699
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
3700
|
+
|
|
3320
3701
|
var Message_1 = __webpack_require__(10);
|
|
3702
|
+
|
|
3321
3703
|
var gaugeUtils_1 = __webpack_require__(98);
|
|
3704
|
+
|
|
3322
3705
|
var GaugeMajorTicks_1 = __webpack_require__(127);
|
|
3706
|
+
|
|
3323
3707
|
var GaugeValueMarker_1 = __webpack_require__(128);
|
|
3708
|
+
|
|
3324
3709
|
var Container = styled_components_1.default.div.withConfig({
|
|
3325
3710
|
displayName: "FillerGauge__Container",
|
|
3326
3711
|
componentId: "u356pd-0"
|
|
@@ -3368,33 +3753,38 @@ var MIN_VERTICAL_CONTAINER_HEIGHT = 200;
|
|
|
3368
3753
|
var MIN_HORIZONTAL_CONTAINER_WIDTH = 200;
|
|
3369
3754
|
var MIN_HORIZONTAL_CONTAINER_HEIGHT = 100;
|
|
3370
3755
|
var AXIS_ORIENTATION_TYPES;
|
|
3756
|
+
|
|
3371
3757
|
(function (AXIS_ORIENTATION_TYPES) {
|
|
3372
3758
|
AXIS_ORIENTATION_TYPES["VERTICAL"] = "vertical";
|
|
3373
3759
|
AXIS_ORIENTATION_TYPES["HORIZONTAL"] = "horizontal";
|
|
3374
3760
|
})(AXIS_ORIENTATION_TYPES = exports.AXIS_ORIENTATION_TYPES || (exports.AXIS_ORIENTATION_TYPES = {}));
|
|
3761
|
+
|
|
3375
3762
|
var FillerGauge = function FillerGauge(_a) {
|
|
3376
3763
|
var props = __rest(_a, []);
|
|
3764
|
+
|
|
3377
3765
|
var width = props.width,
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3766
|
+
height = props.height,
|
|
3767
|
+
value = props.value,
|
|
3768
|
+
gaugeColor = props.gaugeColor,
|
|
3769
|
+
min = props.min,
|
|
3770
|
+
max = props.max,
|
|
3771
|
+
orientation = props.orientation,
|
|
3772
|
+
majorUnit = props.majorUnit,
|
|
3773
|
+
showLabels = props.showLabels,
|
|
3774
|
+
showValue = props.showValue,
|
|
3775
|
+
usePercentageRange = props.usePercentageRange,
|
|
3776
|
+
usePercentageValue = props.usePercentageValue,
|
|
3777
|
+
backgroundColor = props.backgroundColor,
|
|
3778
|
+
backgroundBarFillColor = props.backgroundBarFillColor,
|
|
3779
|
+
majorTickFillColor = props.majorTickFillColor,
|
|
3780
|
+
majorTickStrokeColor = props.majorTickStrokeColor,
|
|
3781
|
+
valueMarkerFillColor = props.valueMarkerFillColor,
|
|
3782
|
+
valueMarkerLabelFillColor = props.valueMarkerLabelFillColor;
|
|
3783
|
+
|
|
3395
3784
|
var renderVisualization = function renderVisualization(_ref) {
|
|
3396
3785
|
var containerWidth = _ref.width,
|
|
3397
|
-
|
|
3786
|
+
containerHeight = _ref.height;
|
|
3787
|
+
|
|
3398
3788
|
// todo: need change the size when get design for smaller space
|
|
3399
3789
|
// 58 is the title & description header height in dashboard visualization
|
|
3400
3790
|
if ((containerWidth < MAX_VERTICAL_CONTAINER_WIDTH || containerHeight + 58 < MIN_VERTICAL_CONTAINER_HEIGHT) && orientation === 'vertical' || (containerWidth < MIN_HORIZONTAL_CONTAINER_WIDTH || containerHeight < MIN_HORIZONTAL_CONTAINER_HEIGHT) && orientation === 'horizontal') {
|
|
@@ -3405,40 +3795,44 @@ var FillerGauge = function FillerGauge(_a) {
|
|
|
3405
3795
|
level: "info"
|
|
3406
3796
|
});
|
|
3407
3797
|
}
|
|
3798
|
+
|
|
3408
3799
|
var _ref2 = (0, gaugeUtils_1.getGaugeDimensions)({
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3800
|
+
containerWidth: containerWidth,
|
|
3801
|
+
containerHeight: containerHeight,
|
|
3802
|
+
orientation: orientation
|
|
3803
|
+
}),
|
|
3804
|
+
gaugeLength = _ref2.gaugeLength,
|
|
3805
|
+
gaugeStartX = _ref2.gaugeStartX,
|
|
3806
|
+
gaugeStartY = _ref2.gaugeStartY,
|
|
3807
|
+
gaugeWidth = _ref2.gaugeWidth,
|
|
3808
|
+
gaugeHeight = _ref2.gaugeHeight;
|
|
3809
|
+
|
|
3418
3810
|
var _ref3 = (0, gaugeUtils_1.getFillBarDimensions)({
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
|
|
3423
|
-
|
|
3424
|
-
|
|
3425
|
-
|
|
3426
|
-
|
|
3427
|
-
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
|
|
3432
|
-
|
|
3433
|
-
|
|
3811
|
+
gaugeLength: gaugeLength,
|
|
3812
|
+
gaugeStartX: gaugeStartX,
|
|
3813
|
+
gaugeStartY: gaugeStartY,
|
|
3814
|
+
gaugeWidth: gaugeWidth,
|
|
3815
|
+
gaugeHeight: gaugeHeight,
|
|
3816
|
+
value: value,
|
|
3817
|
+
min: min,
|
|
3818
|
+
max: max,
|
|
3819
|
+
orientation: orientation
|
|
3820
|
+
}),
|
|
3821
|
+
fillBarLength = _ref3.fillBarLength,
|
|
3822
|
+
fillBarX = _ref3.fillBarX,
|
|
3823
|
+
fillBarY = _ref3.fillBarY,
|
|
3824
|
+
fillBarWidth = _ref3.fillBarWidth,
|
|
3825
|
+
fillBarHeight = _ref3.fillBarHeight;
|
|
3826
|
+
|
|
3434
3827
|
var _ref4 = (0, gaugeUtils_1.getFillerGaugeValueMarkerPositions)({
|
|
3435
|
-
|
|
3436
|
-
|
|
3437
|
-
|
|
3438
|
-
|
|
3439
|
-
|
|
3440
|
-
|
|
3441
|
-
|
|
3828
|
+
fillBarX: fillBarX,
|
|
3829
|
+
fillBarY: fillBarY,
|
|
3830
|
+
fillBarLength: fillBarLength,
|
|
3831
|
+
orientation: orientation
|
|
3832
|
+
}),
|
|
3833
|
+
valueMarkerX = _ref4.valueMarkerX,
|
|
3834
|
+
valueMarkerY = _ref4.valueMarkerY;
|
|
3835
|
+
|
|
3442
3836
|
return React.createElement(FillerGaugeWrapper, {
|
|
3443
3837
|
backgroundColor: backgroundColor,
|
|
3444
3838
|
"data-test": "FillerGaugeWrapper"
|
|
@@ -3495,6 +3889,7 @@ var FillerGauge = function FillerGauge(_a) {
|
|
|
3495
3889
|
valueMarkerLabelFillColor: valueMarkerLabelFillColor
|
|
3496
3890
|
}))));
|
|
3497
3891
|
};
|
|
3892
|
+
|
|
3498
3893
|
return React.createElement(Container, {
|
|
3499
3894
|
width: width,
|
|
3500
3895
|
height: height,
|
|
@@ -3503,6 +3898,7 @@ var FillerGauge = function FillerGauge(_a) {
|
|
|
3503
3898
|
return renderVisualization(containerDimension);
|
|
3504
3899
|
}));
|
|
3505
3900
|
};
|
|
3901
|
+
|
|
3506
3902
|
var propTypes = {
|
|
3507
3903
|
width: T.oneOfType([T.string, T.number]),
|
|
3508
3904
|
height: T.oneOfType([T.string, T.number]),
|