@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/MarkerGauge.config.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 = 65);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -129,11 +129,13 @@ module.exports = require("@splunk/visualization-icons/placeholders");
|
|
|
129
129
|
Object.defineProperty(exports, "__esModule", {
|
|
130
130
|
value: true
|
|
131
131
|
});
|
|
132
|
+
|
|
132
133
|
var i18n_1 = __webpack_require__(0);
|
|
134
|
+
|
|
133
135
|
var background = function background(_ref) {
|
|
134
136
|
var label = _ref.label,
|
|
135
|
-
|
|
136
|
-
|
|
137
|
+
themes = _ref.themes,
|
|
138
|
+
labelPosition = _ref.labelPosition;
|
|
137
139
|
return [{
|
|
138
140
|
label: (0, i18n_1._)(label || 'Background'),
|
|
139
141
|
option: 'backgroundColor',
|
|
@@ -144,6 +146,7 @@ var background = function background(_ref) {
|
|
|
144
146
|
}
|
|
145
147
|
}];
|
|
146
148
|
};
|
|
149
|
+
|
|
147
150
|
exports.default = background;
|
|
148
151
|
|
|
149
152
|
/***/ }),
|
|
@@ -159,6 +162,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
159
162
|
});
|
|
160
163
|
exports.VizBehavior = void 0;
|
|
161
164
|
var VizBehavior;
|
|
165
|
+
|
|
162
166
|
(function (VizBehavior) {
|
|
163
167
|
/**
|
|
164
168
|
* Dynamic Options Behavior.
|
|
@@ -178,6 +182,7 @@ var VizBehavior;
|
|
|
178
182
|
* missing.
|
|
179
183
|
* @type {string}
|
|
180
184
|
*/
|
|
185
|
+
|
|
181
186
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
182
187
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
183
188
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -201,7 +206,9 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
201
206
|
Object.defineProperty(exports, "__esModule", {
|
|
202
207
|
value: true
|
|
203
208
|
});
|
|
209
|
+
|
|
204
210
|
var i18n_1 = __webpack_require__(0);
|
|
211
|
+
|
|
205
212
|
var gauge = {
|
|
206
213
|
label: (0, i18n_1._)('Data display'),
|
|
207
214
|
layout: [[{
|
|
@@ -262,24 +269,33 @@ exports.default = gauge;
|
|
|
262
269
|
|
|
263
270
|
|
|
264
271
|
var _toConsumableArray = __webpack_require__(1);
|
|
272
|
+
|
|
265
273
|
var _defineProperty = __webpack_require__(7);
|
|
274
|
+
|
|
266
275
|
var __rest = this && this.__rest || function (s, e) {
|
|
267
276
|
var t = {};
|
|
277
|
+
|
|
268
278
|
for (var p in s) {
|
|
269
279
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
270
280
|
}
|
|
281
|
+
|
|
271
282
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
272
283
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
273
284
|
}
|
|
274
285
|
return t;
|
|
275
286
|
};
|
|
287
|
+
|
|
276
288
|
Object.defineProperty(exports, "__esModule", {
|
|
277
289
|
value: true
|
|
278
290
|
});
|
|
279
291
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
292
|
+
|
|
280
293
|
var lodash_1 = __webpack_require__(6);
|
|
294
|
+
|
|
281
295
|
var schemaUtils_1 = __webpack_require__(3);
|
|
296
|
+
|
|
282
297
|
var VizBehavior_1 = __webpack_require__(2);
|
|
298
|
+
|
|
283
299
|
var dynamicOptionsDSLType = {
|
|
284
300
|
type: 'string',
|
|
285
301
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -289,20 +305,22 @@ var dynamicOptionsDSLType = {
|
|
|
289
305
|
* @param optionsSchema a visualization's options schema
|
|
290
306
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
291
307
|
*/
|
|
308
|
+
|
|
292
309
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
293
310
|
var enhancedOptionsSchema = {};
|
|
294
311
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
295
312
|
var _a = optionsSchema[key],
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
313
|
+
title = _a.title,
|
|
314
|
+
description = _a.description,
|
|
315
|
+
readOnly = _a.readOnly,
|
|
316
|
+
writeOnly = _a.writeOnly,
|
|
317
|
+
examples = _a.examples,
|
|
318
|
+
defaultValue = _a.default,
|
|
319
|
+
type = _a.type,
|
|
320
|
+
properties = _a.properties,
|
|
321
|
+
patternProperties = _a.patternProperties,
|
|
322
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
323
|
+
|
|
306
324
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
307
325
|
title: title
|
|
308
326
|
}), description !== undefined && {
|
|
@@ -316,12 +334,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
316
334
|
}), defaultValue !== undefined && {
|
|
317
335
|
default: defaultValue
|
|
318
336
|
});
|
|
337
|
+
|
|
319
338
|
if (type === 'object') {
|
|
320
339
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
321
340
|
type: type
|
|
322
341
|
}), properties && {
|
|
323
342
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
324
343
|
});
|
|
344
|
+
|
|
325
345
|
if (patternProperties) {
|
|
326
346
|
var enhancedPatternProperties = {};
|
|
327
347
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -339,6 +359,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
339
359
|
});
|
|
340
360
|
return enhancedOptionsSchema;
|
|
341
361
|
}
|
|
362
|
+
|
|
342
363
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
343
364
|
/**
|
|
344
365
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -347,11 +368,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
347
368
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
348
369
|
* and containing `open: false` for all editor panels in editorConfig
|
|
349
370
|
*/
|
|
371
|
+
|
|
350
372
|
function enhanceConfig(vizConfig) {
|
|
351
373
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
374
|
+
|
|
352
375
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
353
376
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
354
377
|
}
|
|
378
|
+
|
|
355
379
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
356
380
|
return Object.assign(Object.assign({}, config), {
|
|
357
381
|
open: config.open || false
|
|
@@ -359,6 +383,7 @@ function enhanceConfig(vizConfig) {
|
|
|
359
383
|
});
|
|
360
384
|
return enhancedConfig;
|
|
361
385
|
}
|
|
386
|
+
|
|
362
387
|
exports.enhanceConfig = enhanceConfig;
|
|
363
388
|
/**
|
|
364
389
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -366,6 +391,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
366
391
|
* @param vizConfig a Visualization Config
|
|
367
392
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
368
393
|
*/
|
|
394
|
+
|
|
369
395
|
function uncollapseEditorConfig(vizConfig) {
|
|
370
396
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
371
397
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -375,13 +401,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
375
401
|
});
|
|
376
402
|
return editorPanelUncollapsedConfig;
|
|
377
403
|
}
|
|
404
|
+
|
|
378
405
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
406
|
+
|
|
379
407
|
function isDynamicOption(option) {
|
|
380
408
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
381
409
|
}
|
|
382
|
-
|
|
383
|
-
// private helpers to improve readability of getInitialPreset
|
|
410
|
+
|
|
411
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
384
412
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
413
|
+
|
|
385
414
|
/**
|
|
386
415
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
387
416
|
* 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
|
|
@@ -390,6 +419,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
390
419
|
*
|
|
391
420
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
392
421
|
*/
|
|
422
|
+
|
|
393
423
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
394
424
|
var presetContextKeys = Object.keys(presetContext);
|
|
395
425
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -399,6 +429,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
399
429
|
/**
|
|
400
430
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
401
431
|
*/
|
|
432
|
+
|
|
433
|
+
|
|
402
434
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
403
435
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
404
436
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -413,18 +445,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
413
445
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
414
446
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
415
447
|
*/
|
|
448
|
+
|
|
449
|
+
|
|
416
450
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
417
451
|
return presets.find(function (preset) {
|
|
418
452
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
419
453
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
420
454
|
var presetContextKeys = Object.keys(presetContext);
|
|
421
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
422
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
455
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
423
456
|
// if not, then the preset is invalid in config.ts
|
|
457
|
+
|
|
424
458
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
425
459
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
426
460
|
});
|
|
427
461
|
}
|
|
462
|
+
|
|
428
463
|
exports.getInitialPreset = getInitialPreset;
|
|
429
464
|
/**
|
|
430
465
|
* generates number precision values for a Select editor
|
|
@@ -432,6 +467,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
432
467
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
433
468
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
434
469
|
*/
|
|
470
|
+
|
|
435
471
|
function generatePrecisionValues(numPrecisionValues) {
|
|
436
472
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
437
473
|
return {
|
|
@@ -440,6 +476,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
440
476
|
};
|
|
441
477
|
});
|
|
442
478
|
}
|
|
479
|
+
|
|
443
480
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
444
481
|
/**
|
|
445
482
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -449,12 +486,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
449
486
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
450
487
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
451
488
|
*/
|
|
489
|
+
|
|
452
490
|
var insertLayout = function insertLayout(layout, index) {
|
|
453
491
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
454
492
|
layoutItems[_key - 2] = arguments[_key];
|
|
455
493
|
}
|
|
494
|
+
|
|
456
495
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
457
496
|
};
|
|
497
|
+
|
|
458
498
|
exports.insertLayout = insertLayout;
|
|
459
499
|
|
|
460
500
|
/***/ }),
|
|
@@ -466,7 +506,7 @@ module.exports = require("lodash");
|
|
|
466
506
|
|
|
467
507
|
/***/ }),
|
|
468
508
|
|
|
469
|
-
/***/
|
|
509
|
+
/***/ 65:
|
|
470
510
|
/***/ (function(module, exports, __webpack_require__) {
|
|
471
511
|
|
|
472
512
|
"use strict";
|
|
@@ -475,17 +515,29 @@ module.exports = require("lodash");
|
|
|
475
515
|
Object.defineProperty(exports, "__esModule", {
|
|
476
516
|
value: true
|
|
477
517
|
});
|
|
518
|
+
|
|
478
519
|
var i18n_1 = __webpack_require__(0);
|
|
479
|
-
|
|
520
|
+
|
|
521
|
+
var GaugeMarker_1 = __webpack_require__(66);
|
|
522
|
+
|
|
480
523
|
var placeholders_1 = __webpack_require__(11);
|
|
524
|
+
|
|
481
525
|
var schemaUtils_1 = __webpack_require__(3);
|
|
526
|
+
|
|
482
527
|
var variables_1 = __webpack_require__(10);
|
|
528
|
+
|
|
483
529
|
var pick_1 = __webpack_require__(9);
|
|
530
|
+
|
|
484
531
|
var Gauge_1 = __webpack_require__(39);
|
|
532
|
+
|
|
485
533
|
var VizBehavior_1 = __webpack_require__(2);
|
|
534
|
+
|
|
486
535
|
var VizCategory_1 = __webpack_require__(8);
|
|
536
|
+
|
|
487
537
|
var configUtils_1 = __webpack_require__(4);
|
|
538
|
+
|
|
488
539
|
var BackgroundColor_1 = __webpack_require__(13);
|
|
540
|
+
|
|
489
541
|
var dataContract = {
|
|
490
542
|
requiredDataSources: [{
|
|
491
543
|
name: 'primary',
|
|
@@ -598,12 +650,13 @@ var themes = {
|
|
|
598
650
|
enterprise: {
|
|
599
651
|
light: variables_1.default.gray30(props),
|
|
600
652
|
dark: variables_1.default.textGray(props) // was #D7DAE0
|
|
601
|
-
},
|
|
602
653
|
|
|
654
|
+
},
|
|
603
655
|
prisma: {
|
|
604
656
|
// TODO: missed colors :(
|
|
605
657
|
light: variables_1.default.neutral100(props),
|
|
606
658
|
dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
|
|
659
|
+
|
|
607
660
|
}
|
|
608
661
|
})(props);
|
|
609
662
|
},
|
|
@@ -664,6 +717,7 @@ var editorConfig = [{
|
|
|
664
717
|
editorProps: {
|
|
665
718
|
openRanges: false,
|
|
666
719
|
isTogglable: false // Can not disable thresholds
|
|
720
|
+
|
|
667
721
|
}
|
|
668
722
|
}], (0, BackgroundColor_1.default)({
|
|
669
723
|
themes: themes,
|
|
@@ -673,16 +727,19 @@ var editorConfig = [{
|
|
|
673
727
|
/**
|
|
674
728
|
* visualization configuration
|
|
675
729
|
*/
|
|
730
|
+
|
|
676
731
|
var config = {
|
|
677
732
|
/**
|
|
678
733
|
* unique viz key
|
|
679
734
|
*/
|
|
680
735
|
key: 'splunk.markergauge',
|
|
736
|
+
|
|
681
737
|
/**
|
|
682
738
|
* viz name
|
|
683
739
|
*/
|
|
684
740
|
name: (0, i18n_1._)('Marker gauge'),
|
|
685
741
|
category: VizCategory_1.VizCategory.GAUGE,
|
|
742
|
+
|
|
686
743
|
/**
|
|
687
744
|
* viz icon
|
|
688
745
|
*/
|
|
@@ -700,7 +757,7 @@ exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
|
700
757
|
|
|
701
758
|
/***/ }),
|
|
702
759
|
|
|
703
|
-
/***/
|
|
760
|
+
/***/ 66:
|
|
704
761
|
/***/ (function(module, exports) {
|
|
705
762
|
|
|
706
763
|
module.exports = require("@splunk/react-icons/enterprise/GaugeMarker");
|
|
@@ -725,6 +782,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
725
782
|
});
|
|
726
783
|
exports.VizCategory = void 0;
|
|
727
784
|
var VizCategory;
|
|
785
|
+
|
|
728
786
|
(function (VizCategory) {
|
|
729
787
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
730
788
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"@splunk/visualization-icons/placeholders\"","webpack:///./src/common/editorConfig/BackgroundColor.ts","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/editorConfig/Gauge.ts","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"lodash\"","webpack:///./src/MarkerGauge/config.ts","webpack:///external \"@splunk/react-icons/enterprise/GaugeMarker\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/interfaces/VizCategory.ts","webpack:///external \"@splunk/themes/pick\""],"names":["i18n_1","require","background","_ref","label","themes","labelPosition","_","option","editor","editorProps","exports","default","VizBehavior","gauge","layout","values","value","lodash_1","schemaUtils_1","VizBehavior_1","dynamicOptionsDSLType","type","pattern","DYNAMIC_OPTIONS_DSL_PATTERN","enhanceOptionsSchemaWithDynamicOptions","optionsSchema","enhancedOptionsSchema","Object","keys","forEach","key","_a","title","description","readOnly","writeOnly","examples","defaultValue","properties","patternProperties","remainingSchemaEntry","__rest","annotations","assign","undefined","enhancedPatternProperties","opt","_defineProperty","anyOf","enhanceConfig","vizConfig","enhancedConfig","supports","indexOf","DYNAMIC_OPTIONS","editorConfig","map","config","open","uncollapseEditorConfig","editorPanelUncollapsedConfig","isDynamicOption","trim","startsWith","hasCompatibleContexts","vizContext","presetContext","presetContextKeys","every","contextKey","hasCompatibleOptions","vizOptions","presetOptions","presetOptionKeys","optionKey","getInitialPreset","presets","find","preset","get","length","generatePrecisionValues","numPrecisionValues","range","i","concat","repeat","insertLayout","index","_len","arguments","layoutItems","Array","_key","_toConsumableArray","slice","GaugeMarker_1","placeholders_1","variables_1","pick_1","Gauge_1","VizCategory_1","configUtils_1","BackgroundColor_1","dataContract","requiredDataSources","name","optionalDataSources","initialRequestParams","primary","offset","count","size","initialWidth","initialHeight","defaultContext","backgroundColor","COLOR_OR_TOKEN_PATTERN_WITH_RGBA","gaugeRanges","from","to","items","required","additionalProperties","labelDisplay","getPattern","majorTickInterval","orientation","valueDisplay","defaultFillColor","props","enterprise","backgroundColorHover","prisma","neutral100","defaultBackgroundColor","dark","black","light","backgroundColorSidebar","majorTickFillColor","gray30","textGray","contentColorMuted","majorTickStrokeColor","valueMarkerFillColor","textColor","white","valueMarkerLabelFillColor","gray96","context","dataSourceKey","prepareValue","definition","options","openRanges","isTogglable","category","VizCategory","GAUGE","icon","placeholderIcon","MarkerGauge","PLACEHOLDER"],"mappings":";;;;;;;QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;;QAEA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;;;QAGA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA,0CAA0C,gCAAgC;QAC1E;QACA;;QAEA;QACA;QACA;QACA,wDAAwD,kBAAkB;QAC1E;QACA,iDAAiD,cAAc;QAC/D;;QAEA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA;QACA,yCAAyC,iCAAiC;QAC1E,gHAAgH,mBAAmB,EAAE;QACrI;QACA;;QAEA;QACA;QACA;QACA,2BAA2B,0BAA0B,EAAE;QACvD,iCAAiC,eAAe;QAChD;QACA;QACA;;QAEA;QACA,sDAAsD,+DAA+D;;QAErH;QACA;;;QAGA;QACA;;;;;;;;AClFA,kD;;;;;;;ACAA,qE;;;;;;;ACAA,qD;;;;;;;ACAA,qE;;;;;;;;;;;;;ACAA,IAAAA,MAAA,GAAAC,mBAAA;AAUA,IAAMC,UAAU,GAAsF,SAAhGA,UAAUA,CAAAC,IAAA;EAAA,IACZC,KAAK,GAAAD,IAAA,CAALC,KAAK;IACLC,MAAM,GAAAF,IAAA,CAANE,MAAM;IACNC,aAAa,GAAAH,IAAA,CAAbG,aAAa;EAAA,OACX,CACF;IACIF,KAAK,EAAE,IAAAJ,MAAA,CAAAO,CAAC,EAACH,KAAK,IAAI,YAAY,CAAC;IAC/BI,MAAM,EAAE,iBAAiB;IACzBC,MAAM,EAAE,cAAc;IACtBC,WAAW,EAAE;MACTJ,aAAa,EAAEA,aAAa,IAAI,KAAK;MACrCD,MAAM,EAANA;;GAEP,CACJ;AAAA;AAEDM,OAAA,CAAAC,OAAA,GAAeV,UAAU,C;;;;;;;;;;;;;;AC1BzB,IAAYW,WAsBX;AAtBD,WAAYA,WAAW;E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A,kCAA8B;EAC9BA,WAAA,qBAAiB;EACjBA,WAAA,iBAAa;EACbA,WAAA,iBAAa;EACbA,WAAA,+BAA2B;EAC3BA,WAAA,uBAAmB;AACvB,CAAC,EAbWA,WAAW,GAAXpJ,OAAA,CAAAoJ,WAAW,KAAXpJ,OAAA,CAAAoJ,WAAW,Q;;;;;;;ACAvB,gD","file":"MarkerGauge.config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 64);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/visualization-icons/placeholders\");","import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n TRELLIS = 'trellis',\n}\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorConfig } from '../interfaces/Editor';\n\nconst gauge: EditorConfig = {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Value display'),\n option: 'valueDisplay',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Number'), value: 'number' },\n { label: _('Percentage'), value: 'percentage' },\n { label: _('Off'), value: 'off' },\n ],\n },\n },\n ],\n [\n {\n label: _('Label display'),\n option: 'labelDisplay',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Numbers'), value: 'number' },\n { label: _('Percentages'), value: 'percentage' },\n { label: _('Off'), value: 'off' },\n ],\n },\n },\n ],\n [\n {\n label: _('Orientation'),\n option: 'orientation',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Vertical'), value: 'vertical' },\n { label: _('Horizontal'), value: 'horizontal' },\n ],\n },\n },\n ],\n ],\n};\n\nexport default gauge;\n","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * 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\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n isDynamicOption,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"lodash\");","import { _ } from '@splunk/ui-utils/i18n';\nimport MarkerGaugeIcon from '@splunk/react-icons/enterprise/GaugeMarker';\nimport { MarkerGauge as MarkerGaugePlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { COLOR_OR_TOKEN_PATTERN_WITH_RGBA, getPattern } from '@splunk/visualizations-shared/schemaUtils';\nimport variables from '@splunk/themes/variables';\nimport pick from '@splunk/themes/pick';\nimport GaugeConfig from '../common/editorConfig/Gauge';\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { OptionsSchema } from '../common/interfaces/OptionsSchema';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\n\nconst dataContract: DataContract = {\n requiredDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n optionalDataSources: [],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 300,\n initialHeight: 300,\n};\n\nconst defaultContext: DefaultContext = {};\n\nconst optionsSchema: OptionsSchema = {\n backgroundColor: {\n description:\n 'Specify the color used for the background. The default for enterprise light is \"#ffffff\". The default for enterprise dark is \"#000000\". The default for prisma dark is \"#0b0c0e\".',\n type: 'string',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n default: '> themes.defaultBackgroundColor',\n },\n gaugeRanges: {\n description:\n 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{\"from\": 0, \"to\": 20, \"value\": \"#4BEBA8\"}, {\"from\": 20, \"to\": 50, \"value\": \"#F4DF7A\"}].',\n default: [\n { from: 0, to: 50, value: '#118832' },\n { from: 50, to: 90, value: '#CBA700' },\n { from: 90, to: 100, value: '#D41F1F' },\n ],\n type: 'array',\n items: {\n type: 'object',\n properties: {\n from: {\n type: 'number',\n description: 'Starting value for range.',\n },\n to: {\n type: 'number',\n description: 'Ending value for range.',\n },\n value: {\n description: 'Color for sub range.',\n type: 'string',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n },\n },\n required: ['from', 'to', 'value'],\n additionalProperties: false,\n },\n },\n labelDisplay: {\n description:\n 'Specify whether to display the labels as numbers, percentages, or off. The label center aligns to the value.',\n default: 'number',\n type: 'string',\n pattern: getPattern(['number', 'percentage', 'off']),\n },\n majorTickInterval: {\n description: 'Specify, in pixels, the spacing between major tick marks.',\n default: 'auto',\n type: ['string', 'number'],\n },\n orientation: {\n description: 'Specify the axis orientation of the gauge.',\n default: 'vertical',\n type: 'string',\n pattern: getPattern(['horizontal', 'vertical']),\n },\n value: {\n description: 'Specify the dataSource applied to the value of the marker gauge.',\n type: 'string',\n default: '> primary | seriesByType(\"number\") | lastPoint()',\n },\n valueDisplay: {\n description: 'Specify whether to display the value as a number, percentage, or off.',\n default: 'number',\n type: 'string',\n pattern: getPattern(['number', 'percentage', 'off']),\n },\n};\n\nconst themes: ThemedDefaults = {\n defaultFillColor: props =>\n pick({\n enterprise: variables.backgroundColorHover(props),\n prisma: variables.neutral100(props),\n })(props),\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n majorTickFillColor: props =>\n pick({\n enterprise: {\n light: variables.gray30(props), // was '#33343B'\n dark: variables.textGray(props), // was #D7DAE0\n },\n prisma: {\n // TODO: missed colors :(\n light: variables.neutral100(props), // TBD\n dark: variables.contentColorMuted(props), // was #D7DAE0; contentColor\n },\n })(props),\n majorTickStrokeColor: props =>\n pick({\n enterprise: {\n light: variables.textGray(props),\n dark: variables.contentColorMuted(props),\n },\n prisma: variables.contentColorMuted(props),\n })(props),\n valueMarkerFillColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: {\n dark: variables.white(props),\n light: variables.black(props),\n },\n })(props),\n valueMarkerLabelFillColor: props =>\n pick({\n enterprise: {\n light: variables.gray96(props),\n dark: variables.black(props),\n },\n prisma: variables.black(props),\n })(props),\n};\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Value'),\n editor: 'editor.columnSelector',\n option: 'value',\n context: 'defaultContext',\n editorProps: {\n dataSourceKey: 'primary',\n prepareValue: (\n definition\n ): { context: Record<string, any>; options: Record<string, any> } => {\n const {\n options: { value },\n } = definition;\n return {\n context: {},\n options: {\n value: `${value} | lastPoint()`,\n },\n };\n },\n },\n },\n ],\n ],\n },\n GaugeConfig,\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Gauge ranges'),\n option: 'gaugeRanges',\n editor: 'editor.threshold',\n editorProps: {\n openRanges: false, // Use closed ranges\n isTogglable: false, // Can not disable thresholds\n },\n },\n ],\n getBackgroundColorEditor({ themes, labelPosition: 'top' }),\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.markergauge',\n /**\n * viz name\n */\n name: _('Marker gauge'),\n category: VizCategory.GAUGE,\n /**\n * viz icon\n */\n icon: MarkerGaugeIcon,\n placeholderIcon: MarkerGaugePlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.PLACEHOLDER],\n themes,\n};\n\nexport default enhanceConfig(config);\n","module.exports = require(\"@splunk/react-icons/enterprise/GaugeMarker\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","export enum VizCategory {\n SINGLE_VALUE = 'Single Value',\n TRENDS = 'Trends',\n COMPARISONS = 'Comparisons',\n TABLE = 'Table',\n GAUGE = 'Gauge',\n DISTRIBUTIONS = 'Distributions',\n CHOROPLETH = 'Choropleth Maps',\n SHAPES = 'Shapes',\n MISC = 'misc',\n FLOW = 'Flow',\n CORRELATION = 'Correlation',\n SPATIAL = 'Spatial',\n}\n","module.exports = require(\"@splunk/themes/pick\");"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///external \"@splunk/ui-utils/i18n\"","webpack:///external \"@babel/runtime/helpers/toConsumableArray\"","webpack:///external \"@splunk/themes/variables\"","webpack:///external \"@splunk/visualization-icons/placeholders\"","webpack:///./src/common/editorConfig/BackgroundColor.ts","webpack:///./src/common/interfaces/VizBehavior.ts","webpack:///external \"@splunk/visualizations-shared/schemaUtils\"","webpack:///./src/common/editorConfig/Gauge.ts","webpack:///./src/common/utils/configUtils.ts","webpack:///external \"lodash\"","webpack:///./src/MarkerGauge/config.ts","webpack:///external \"@splunk/react-icons/enterprise/GaugeMarker\"","webpack:///external \"@babel/runtime/helpers/defineProperty\"","webpack:///./src/common/interfaces/VizCategory.ts","webpack:///external \"@splunk/themes/pick\""],"names":[],"mapp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,eAAa,EAAb,aAlBsB;AAmBtB,cAAY,EAAZ,YAnBsB;AAoBtB,UAAQ,EAAE,CAAC,0BAAY,eAAb,EAA8B,0BAAY,WAA1C,CApBY;AAqBtB,QAAM,EAAN;AArBsB,CAA1B;AAwBA,kBAAe,iCAAc,MAAd,CAAf,C;;;;;;;AC7OA,uE;;;;;;;ACAA,kE;;;;;;;;;;;;;;ACAA,IAAY,WAAZ;;AAAA,WAAY,WAAZ,EAAuB;AACnB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACH,CAbD,EAAY,WAAW,GAAX,8CAAW,EAAX,CAAZ,E;;;;;;;ACAA,gD","file":"MarkerGauge.config.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 65);\n","module.exports = require(\"@splunk/ui-utils/i18n\");","module.exports = require(\"@babel/runtime/helpers/toConsumableArray\");","module.exports = require(\"@splunk/themes/variables\");","module.exports = require(\"@splunk/visualization-icons/placeholders\");","import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorLayoutConfig } from '../interfaces/Editor';\nimport { ThemedDefaults } from '../interfaces/ThemedDefaults';\n\ninterface backgroundEditorProps {\n label?: string;\n themes: ThemedDefaults;\n labelPosition?: string;\n}\n\nconst background: ({ label, themes, labelPosition }: backgroundEditorProps) => EditorLayoutConfig[] = ({\n label,\n themes,\n labelPosition,\n}) => [\n {\n label: _(label || 'Background'),\n option: 'backgroundColor',\n editor: 'editor.color',\n editorProps: {\n labelPosition: labelPosition || 'top',\n themes,\n },\n },\n];\n\nexport default background;\n","export enum VizBehavior {\n /**\n * Dynamic Options Behavior.\n * This allows visualization options to be powered by data\n *\n * **Example**\n *\n * sparklineValues: \">primary|seriesByIndex(0)\"\n * would configure sparklineValues with an array of data points\n * coming from the first series in the primary datasource\n *\n */\n DYNAMIC_OPTIONS = 'dynamic-options',\n EVENTS = 'events',\n /**\n * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is\n * missing.\n * @type {string}\n */\n PLACEHOLDER = 'placeholder',\n PAGE_AND_SORT = 'page-and-sort',\n TRELLIS = 'trellis',\n}\n","module.exports = require(\"@splunk/visualizations-shared/schemaUtils\");","import { _ } from '@splunk/ui-utils/i18n';\nimport { EditorConfig } from '../interfaces/Editor';\n\nconst gauge: EditorConfig = {\n label: _('Data display'),\n layout: [\n [\n {\n label: _('Value display'),\n option: 'valueDisplay',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Number'), value: 'number' },\n { label: _('Percentage'), value: 'percentage' },\n { label: _('Off'), value: 'off' },\n ],\n },\n },\n ],\n [\n {\n label: _('Label display'),\n option: 'labelDisplay',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Numbers'), value: 'number' },\n { label: _('Percentages'), value: 'percentage' },\n { label: _('Off'), value: 'off' },\n ],\n },\n },\n ],\n [\n {\n label: _('Orientation'),\n option: 'orientation',\n editor: 'editor.radioBar',\n editorProps: {\n values: [\n { label: _('Vertical'), value: 'vertical' },\n { label: _('Horizontal'), value: 'horizontal' },\n ],\n },\n },\n ],\n ],\n};\n\nexport default gauge;\n","import { get, range } from 'lodash';\nimport { DYNAMIC_OPTIONS_DSL_PATTERN } from '@splunk/visualizations-shared/schemaUtils';\nimport type { JSONSchema7Definition } from 'json-schema';\nimport { isDynamicOption } from '@splunk/visualizations-shared/configUtils';\nimport { VizBehavior } from '../interfaces/VizBehavior';\nimport { VizConfig } from '../interfaces/VizConfig';\nimport { OptionsSchema } from '../interfaces/OptionsSchema';\nimport { EditorLayoutConfig, EditorConfig } from '../interfaces/Editor';\n\nexport interface PresetEntry {\n name: string;\n value: any;\n label: string;\n}\n\nconst dynamicOptionsDSLType = {\n type: 'string',\n pattern: DYNAMIC_OPTIONS_DSL_PATTERN,\n} as const;\n\n/**\n * Helper function to extend an options schema with dynamic options DSL\n * @param optionsSchema a visualization's options schema\n * @returns an updated options schema that additionally allows strings starting with > for each option\n */\nfunction enhanceOptionsSchemaWithDynamicOptions(\n optionsSchema: OptionsSchema | JSONSchema7Definition\n): OptionsSchema {\n const enhancedOptionsSchema: OptionsSchema = {};\n Object.keys(optionsSchema).forEach((key): void => {\n const {\n // The next a few are schema annotations, we should leave them as is.\n // Note: in reality we don't use `readOnly`, `writeOnly` or `examples`, but they are listed here for completeness.\n // Ref: https://datatracker.ietf.org/doc/html/draft-handrews-json-schema-validation-01\n title,\n description,\n readOnly,\n writeOnly,\n examples,\n default: defaultValue,\n // The next a few need special care\n type,\n properties,\n patternProperties,\n // The rest should be handled together\n ...remainingSchemaEntry\n } = optionsSchema[key];\n\n const annotations = {\n ...(title !== undefined && { title }),\n ...(description !== undefined && { description }),\n ...(readOnly !== undefined && { readOnly }),\n ...(writeOnly !== undefined && { writeOnly }),\n ...(examples !== undefined && { examples }),\n ...(defaultValue !== undefined && { default: defaultValue }),\n };\n\n if (type === 'object') {\n enhancedOptionsSchema[key] = {\n ...remainingSchemaEntry,\n ...annotations,\n type,\n ...(properties && { properties: enhanceOptionsSchemaWithDynamicOptions(properties) }),\n };\n if (patternProperties) {\n let enhancedPatternProperties = {};\n Object.keys(patternProperties).forEach((opt): void => {\n enhancedPatternProperties = {\n ...enhancedPatternProperties,\n ...enhanceOptionsSchemaWithDynamicOptions({ [opt]: patternProperties[opt] }),\n };\n });\n enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;\n }\n } else {\n enhancedOptionsSchema[key] = {\n ...annotations,\n anyOf: [\n // we can't assume `type` is always there because there are `enum` and `const`.\n { ...(type !== undefined && { type }), ...remainingSchemaEntry },\n dynamicOptionsDSLType,\n ],\n };\n }\n });\n return enhancedOptionsSchema;\n}\n\n/**\n * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block\n * this function also collapse all editor panels\n * @param vizConfig a Visualization Config\n * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports\n * and containing `open: false` for all editor panels in editorConfig\n */\nfunction enhanceConfig(vizConfig: VizConfig): VizConfig {\n const enhancedConfig: VizConfig = { ...vizConfig };\n if (vizConfig.supports.indexOf(VizBehavior.DYNAMIC_OPTIONS) !== -1) {\n enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);\n }\n enhancedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: config.open || false };\n }\n );\n return enhancedConfig;\n}\n\n/**\n * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig\n * Created for editor unit tests\n * @param vizConfig a Visualization Config\n * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig\n */\nfunction uncollapseEditorConfig(vizConfig: VizConfig): VizConfig {\n const editorPanelUncollapsedConfig: VizConfig = { ...vizConfig };\n editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(\n (config: EditorConfig): EditorConfig => {\n return { ...config, open: true };\n }\n );\n return editorPanelUncollapsedConfig;\n}\n\nfunction isDynamicOption(option?: string): boolean {\n return (option && typeof option === 'string' && option.trim().startsWith('>')) || false;\n}\n\n// private helpers to improve readability of getInitialPreset\n// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset\n\n/**\n * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset\n * 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\n * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext\n * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up\n *\n * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values\n */\nfunction hasCompatibleContexts(\n vizContext: { [configKey: string]: any },\n presetContext: { [configKey: string]: any }\n): boolean {\n const presetContextKeys = Object.keys(presetContext);\n return presetContextKeys.every(\n (contextKey): boolean =>\n (presetContext[contextKey] === undefined && vizContext[contextKey] === undefined) ||\n (presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined)\n );\n}\n\n/**\n * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions\n */\nfunction hasCompatibleOptions(\n vizOptions: { [configKey: string]: any },\n presetOptions: { [configKey: string]: any }\n): boolean {\n const presetOptionKeys = Object.keys(presetOptions);\n return presetOptionKeys.every(\n (optionKey): boolean =>\n isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey])\n );\n}\n\n/**\n * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions\n * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure\n *\n * @param {Object} vizContext - the current vizContext definition\n * @param {Object} vizOptions - the current vizOptions definition\n * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset\n */\nfunction getInitialPreset(\n vizContext: { [configKey: string]: any },\n vizOptions: { [configKey: string]: any },\n presets: PresetEntry[]\n): PresetEntry | null {\n return presets.find((preset): boolean => {\n const presetContext = get(preset, ['value', 'context'], {});\n const presetOptions = get(preset, ['value', 'options'], {});\n const presetContextKeys = Object.keys(presetContext);\n const presetOptionKeys = Object.keys(presetOptions);\n\n // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)\n // if not, then the preset is invalid in config.ts\n if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;\n\n return (\n hasCompatibleContexts(vizContext, presetContext) &&\n hasCompatibleOptions(vizOptions, presetOptions)\n );\n });\n}\n\ninterface PrecisionOption {\n label: string;\n value: number;\n}\n\n/**\n * generates number precision values for a Select editor\n *\n * @param {Number} numPrecisionValues - number of integer precision values to generate\n * @returns {{ label: string; value; string }[]} array of { label, value } tuples\n */\nfunction generatePrecisionValues(numPrecisionValues: number): PrecisionOption[] {\n return range(0, numPrecisionValues + 1).map(\n (i): PrecisionOption => ({\n label: `${i} (0${i > 0 ? '.' : ''}${'0'.repeat(i)})`, // e.g. 0.000 for numPrecisionValues = 3\n value: i,\n })\n );\n}\n\nexport {\n enhanceConfig,\n enhanceOptionsSchemaWithDynamicOptions,\n getInitialPreset,\n generatePrecisionValues,\n uncollapseEditorConfig,\n isDynamicOption,\n};\n\n/**\n * insert layout in layout array, return a new layout array instead of updating the original\n *\n * @param {EditorLayoutConfig[][]} layout - editor layout\n * @param {Number} index - the index to insert layout item(s)\n * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert\n * @returns {EditorLayoutConfig[][]} new editor layout with insertion\n */\nexport const insertLayout = (\n layout: EditorLayoutConfig[][],\n index: number,\n ...layoutItems: EditorLayoutConfig[][]\n): EditorLayoutConfig[][] => [\n // copy part of the array before the specified index\n ...layout.slice(0, index),\n // inserted layout item\n ...layoutItems,\n // copy part of the array after the specified index\n ...layout.slice(index),\n];\n","module.exports = require(\"lodash\");","import { _ } from '@splunk/ui-utils/i18n';\nimport MarkerGaugeIcon from '@splunk/react-icons/enterprise/GaugeMarker';\nimport { MarkerGauge as MarkerGaugePlaceholderIcon } from '@splunk/visualization-icons/placeholders';\nimport { COLOR_OR_TOKEN_PATTERN_WITH_RGBA, getPattern } from '@splunk/visualizations-shared/schemaUtils';\nimport variables from '@splunk/themes/variables';\nimport pick from '@splunk/themes/pick';\nimport GaugeConfig from '../common/editorConfig/Gauge';\nimport { DataContract } from '../common/interfaces/DataContract';\nimport { DefaultContext } from '../common/interfaces/DefaultContext';\nimport { EditorConfig } from '../common/interfaces/Editor';\nimport { OptionsSchema } from '../common/interfaces/OptionsSchema';\nimport { ThemedDefaults } from '../common/interfaces/ThemedDefaults';\nimport { VizBehavior } from '../common/interfaces/VizBehavior';\nimport { VizCategory } from '../common/interfaces/VizCategory';\nimport { VizConfig } from '../common/interfaces/VizConfig';\nimport { VizSize } from '../common/interfaces/VizSize';\nimport { enhanceConfig } from '../common/utils/configUtils';\nimport getBackgroundColorEditor from '../common/editorConfig/BackgroundColor';\n\nconst dataContract: DataContract = {\n requiredDataSources: [\n {\n name: 'primary',\n description: 'DataSource that powers the visualization',\n },\n ],\n optionalDataSources: [],\n initialRequestParams: {\n primary: { offset: 0, count: 10000 },\n },\n};\n\nconst size: VizSize = {\n initialWidth: 300,\n initialHeight: 300,\n};\n\nconst defaultContext: DefaultContext = {};\n\nconst optionsSchema: OptionsSchema = {\n backgroundColor: {\n description:\n 'Specify the color used for the background. The default for enterprise light is \"#ffffff\". The default for enterprise dark is \"#000000\". The default for prisma dark is \"#0b0c0e\".',\n type: 'string',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n default: '> themes.defaultBackgroundColor',\n },\n gaugeRanges: {\n description:\n 'Specify the overall range of the gauge as a series of continuous, color-coded subranges. For example, [{\"from\": 0, \"to\": 20, \"value\": \"#4BEBA8\"}, {\"from\": 20, \"to\": 50, \"value\": \"#F4DF7A\"}].',\n default: [\n { from: 0, to: 50, value: '#118832' },\n { from: 50, to: 90, value: '#CBA700' },\n { from: 90, to: 100, value: '#D41F1F' },\n ],\n type: 'array',\n items: {\n type: 'object',\n properties: {\n from: {\n type: 'number',\n description: 'Starting value for range.',\n },\n to: {\n type: 'number',\n description: 'Ending value for range.',\n },\n value: {\n description: 'Color for sub range.',\n type: 'string',\n pattern: COLOR_OR_TOKEN_PATTERN_WITH_RGBA,\n },\n },\n required: ['from', 'to', 'value'],\n additionalProperties: false,\n },\n },\n labelDisplay: {\n description:\n 'Specify whether to display the labels as numbers, percentages, or off. The label center aligns to the value.',\n default: 'number',\n type: 'string',\n pattern: getPattern(['number', 'percentage', 'off']),\n },\n majorTickInterval: {\n description: 'Specify, in pixels, the spacing between major tick marks.',\n default: 'auto',\n type: ['string', 'number'],\n },\n orientation: {\n description: 'Specify the axis orientation of the gauge.',\n default: 'vertical',\n type: 'string',\n pattern: getPattern(['horizontal', 'vertical']),\n },\n value: {\n description: 'Specify the dataSource applied to the value of the marker gauge.',\n type: 'string',\n default: '> primary | seriesByType(\"number\") | lastPoint()',\n },\n valueDisplay: {\n description: 'Specify whether to display the value as a number, percentage, or off.',\n default: 'number',\n type: 'string',\n pattern: getPattern(['number', 'percentage', 'off']),\n },\n};\n\nconst themes: ThemedDefaults = {\n defaultFillColor: props =>\n pick({\n enterprise: variables.backgroundColorHover(props),\n prisma: variables.neutral100(props),\n })(props),\n defaultBackgroundColor: props =>\n pick({\n enterprise: {\n dark: variables.black(props),\n light: variables.backgroundColor(props),\n },\n prisma: variables.backgroundColorSidebar(props),\n })(props),\n majorTickFillColor: props =>\n pick({\n enterprise: {\n light: variables.gray30(props), // was '#33343B'\n dark: variables.textGray(props), // was #D7DAE0\n },\n prisma: {\n // TODO: missed colors :(\n light: variables.neutral100(props), // TBD\n dark: variables.contentColorMuted(props), // was #D7DAE0; contentColor\n },\n })(props),\n majorTickStrokeColor: props =>\n pick({\n enterprise: {\n light: variables.textGray(props),\n dark: variables.contentColorMuted(props),\n },\n prisma: variables.contentColorMuted(props),\n })(props),\n valueMarkerFillColor: props =>\n pick({\n enterprise: variables.textColor(props),\n prisma: {\n dark: variables.white(props),\n light: variables.black(props),\n },\n })(props),\n valueMarkerLabelFillColor: props =>\n pick({\n enterprise: {\n light: variables.gray96(props),\n dark: variables.black(props),\n },\n prisma: variables.black(props),\n })(props),\n};\n\nconst editorConfig: EditorConfig[] = [\n {\n label: _('Data configurations'),\n layout: [\n [\n {\n label: _('Value'),\n editor: 'editor.columnSelector',\n option: 'value',\n context: 'defaultContext',\n editorProps: {\n dataSourceKey: 'primary',\n prepareValue: (\n definition\n ): { context: Record<string, any>; options: Record<string, any> } => {\n const {\n options: { value },\n } = definition;\n return {\n context: {},\n options: {\n value: `${value} | lastPoint()`,\n },\n };\n },\n },\n },\n ],\n ],\n },\n GaugeConfig,\n {\n label: _('Color and style'),\n layout: [\n [\n {\n label: _('Gauge ranges'),\n option: 'gaugeRanges',\n editor: 'editor.threshold',\n editorProps: {\n openRanges: false, // Use closed ranges\n isTogglable: false, // Can not disable thresholds\n },\n },\n ],\n getBackgroundColorEditor({ themes, labelPosition: 'top' }),\n ],\n },\n];\n\n/**\n * visualization configuration\n */\nconst config: VizConfig = {\n /**\n * unique viz key\n */\n key: 'splunk.markergauge',\n /**\n * viz name\n */\n name: _('Marker gauge'),\n category: VizCategory.GAUGE,\n /**\n * viz icon\n */\n icon: MarkerGaugeIcon,\n placeholderIcon: MarkerGaugePlaceholderIcon,\n dataContract,\n size,\n defaultContext,\n optionsSchema,\n editorConfig,\n supports: [VizBehavior.DYNAMIC_OPTIONS, VizBehavior.PLACEHOLDER],\n themes,\n};\n\nexport default enhanceConfig(config);\n","module.exports = require(\"@splunk/react-icons/enterprise/GaugeMarker\");","module.exports = require(\"@babel/runtime/helpers/defineProperty\");","export enum VizCategory {\n SINGLE_VALUE = 'Single Value',\n TRENDS = 'Trends',\n COMPARISONS = 'Comparisons',\n TABLE = 'Table',\n GAUGE = 'Gauge',\n DISTRIBUTIONS = 'Distributions',\n CHOROPLETH = 'Choropleth Maps',\n SHAPES = 'Shapes',\n MISC = 'misc',\n FLOW = 'Flow',\n CORRELATION = 'Correlation',\n SPATIAL = 'Spatial',\n}\n","module.exports = require(\"@splunk/themes/pick\");"],"sourceRoot":""}
|