@splunk/visualizations 26.4.1 → 27.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +1399 -1590
- package/Area.config.js.map +7 -1
- package/Area.js +3750 -4822
- package/Area.js.map +7 -1
- package/Bar.config.js +1423 -1566
- package/Bar.config.js.map +7 -1
- package/Bar.js +3856 -4884
- package/Bar.js.map +7 -1
- package/Bubble.config.js +1009 -1200
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2768 -4491
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2032 -3808
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1390 -1534
- package/Column.config.js.map +7 -1
- package/Column.js +3849 -4906
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1667 -3327
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2643 -4647
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2164 -4575
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1423 -3046
- package/Image.js.map +7 -1
- package/Line.config.js +1421 -1616
- package/Line.config.js.map +7 -1
- package/Line.js +3790 -4901
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5272 -6185
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +6 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3382 -5659
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1671 -3212
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2215 -4531
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2057 -4718
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +2107 -3984
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2734 -5037
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1664 -3258
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2766 -4908
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +988 -1180
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2801 -4506
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +794 -1250
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4185 -7327
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +757 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3427 -6293
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +686 -1121
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3923 -6994
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/TRELLIS.md +16 -15
- package/Table.config.js +565 -879
- package/Table.config.js.map +7 -1
- package/Table.js +3260 -5334
- package/Table.js.map +7 -1
- package/common/Charting.js +617 -1498
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +351 -911
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +466 -1013
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +277 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1191 -2431
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +53 -45
package/SingleValue.config.js
CHANGED
|
@@ -1,921 +1,495 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
/******/ // expose the modules object (__webpack_modules__)
|
|
37
|
-
/******/ __webpack_require__.m = modules;
|
|
38
|
-
/******/
|
|
39
|
-
/******/ // expose the module cache
|
|
40
|
-
/******/ __webpack_require__.c = installedModules;
|
|
41
|
-
/******/
|
|
42
|
-
/******/ // define getter function for harmony exports
|
|
43
|
-
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
44
|
-
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
45
|
-
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
|
|
46
|
-
/******/ }
|
|
47
|
-
/******/ };
|
|
48
|
-
/******/
|
|
49
|
-
/******/ // define __esModule on exports
|
|
50
|
-
/******/ __webpack_require__.r = function(exports) {
|
|
51
|
-
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
52
|
-
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
53
|
-
/******/ }
|
|
54
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
55
|
-
/******/ };
|
|
56
|
-
/******/
|
|
57
|
-
/******/ // create a fake namespace object
|
|
58
|
-
/******/ // mode & 1: value is a module id, require it
|
|
59
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
-
/******/ // mode & 4: return value when already ns object
|
|
61
|
-
/******/ // mode & 8|1: behave like require
|
|
62
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
-
/******/ if(mode & 8) return value;
|
|
65
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
-
/******/ var ns = Object.create(null);
|
|
67
|
-
/******/ __webpack_require__.r(ns);
|
|
68
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
-
/******/ return ns;
|
|
71
|
-
/******/ };
|
|
72
|
-
/******/
|
|
73
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
-
/******/ __webpack_require__.n = function(module) {
|
|
75
|
-
/******/ var getter = module && module.__esModule ?
|
|
76
|
-
/******/ function getDefault() { return module['default']; } :
|
|
77
|
-
/******/ function getModuleExports() { return module; };
|
|
78
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
-
/******/ return getter;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // __webpack_public_path__
|
|
86
|
-
/******/ __webpack_require__.p = "";
|
|
87
|
-
/******/
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s = 66);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ([
|
|
94
|
-
/* 0 */
|
|
95
|
-
/***/ (function(module, exports) {
|
|
96
|
-
|
|
97
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
98
|
-
|
|
99
|
-
/***/ }),
|
|
100
|
-
/* 1 */
|
|
101
|
-
/***/ (function(module, exports) {
|
|
102
|
-
|
|
103
|
-
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
104
|
-
|
|
105
|
-
/***/ }),
|
|
106
|
-
/* 2 */
|
|
107
|
-
/***/ (function(module, exports) {
|
|
108
|
-
|
|
109
|
-
module.exports = require("@splunk/visualization-schemas");
|
|
110
|
-
|
|
111
|
-
/***/ }),
|
|
112
|
-
/* 3 */
|
|
113
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
114
|
-
|
|
115
|
-
"use strict";
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
119
|
-
|
|
120
|
-
Object.defineProperty(exports, "__esModule", {
|
|
121
|
-
value: true
|
|
122
|
-
});
|
|
123
|
-
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceConfig = exports.enhanceOptionsSchemaWithDynamicOptions = void 0;
|
|
124
|
-
|
|
125
|
-
var lodash_1 = __webpack_require__(5); // included for backwards compatibility
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
129
|
-
|
|
130
|
-
Object.defineProperty(exports, "enhanceOptionsSchemaWithDynamicOptions", {
|
|
131
|
-
enumerable: true,
|
|
132
|
-
get: function get() {
|
|
133
|
-
return visualization_schemas_1.enhanceOptionsSchemaWithDynamicOptions;
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
/**
|
|
137
|
-
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
138
|
-
* this function also collapse all editor panels
|
|
139
|
-
* @param vizConfig a Visualization Config
|
|
140
|
-
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
141
|
-
* and containing `open: false` for all editor panels in editorConfig
|
|
142
|
-
*/
|
|
143
|
-
|
|
144
|
-
function enhanceConfig(vizConfig) {
|
|
145
|
-
var enhancedConfig = Object.assign({}, vizConfig);
|
|
146
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
147
|
-
return Object.assign(Object.assign({}, config), {
|
|
148
|
-
open: config.open || false
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
return enhancedConfig;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
exports.enhanceConfig = enhanceConfig;
|
|
155
|
-
/**
|
|
156
|
-
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
157
|
-
* Created for editor unit tests
|
|
158
|
-
* @param vizConfig a Visualization Config
|
|
159
|
-
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
160
|
-
*/
|
|
161
|
-
|
|
162
|
-
function uncollapseEditorConfig(vizConfig) {
|
|
163
|
-
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
164
|
-
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
165
|
-
return Object.assign(Object.assign({}, config), {
|
|
166
|
-
open: true
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
return editorPanelUncollapsedConfig;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
173
|
-
|
|
174
|
-
function isDynamicOption(option) {
|
|
175
|
-
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
179
|
-
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
183
|
-
* 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
|
|
184
|
-
* the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
|
|
185
|
-
* 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
|
|
186
|
-
*
|
|
187
|
-
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
188
|
-
*/
|
|
189
|
-
|
|
190
|
-
function hasCompatibleContexts(vizContext, presetContext) {
|
|
191
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
192
|
-
return presetContextKeys.every(function (contextKey) {
|
|
193
|
-
return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
|
|
194
|
-
});
|
|
195
|
-
}
|
|
196
|
-
/**
|
|
197
|
-
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
198
|
-
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
202
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
203
|
-
return presetOptionKeys.every(function (optionKey) {
|
|
204
|
-
return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
|
|
209
|
-
* This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
|
|
210
|
-
*
|
|
211
|
-
* @param {Object} vizContext - the current vizContext definition
|
|
212
|
-
* @param {Object} vizOptions - the current vizOptions definition
|
|
213
|
-
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
214
|
-
*/
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
218
|
-
return presets.find(function (preset) {
|
|
219
|
-
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
220
|
-
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
221
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
222
|
-
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
223
|
-
// if not, then the preset is invalid in config.ts
|
|
224
|
-
|
|
225
|
-
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
226
|
-
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
exports.getInitialPreset = getInitialPreset;
|
|
231
|
-
/**
|
|
232
|
-
* generates number precision values for a Select editor
|
|
233
|
-
*
|
|
234
|
-
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
235
|
-
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
function generatePrecisionValues(numPrecisionValues) {
|
|
239
|
-
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
240
|
-
return {
|
|
241
|
-
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
242
|
-
value: i
|
|
243
|
-
};
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
exports.generatePrecisionValues = generatePrecisionValues;
|
|
248
|
-
/**
|
|
249
|
-
* insert layout in layout array, return a new layout array instead of updating the original
|
|
250
|
-
*
|
|
251
|
-
* @param {EditorLayoutConfig[][]} layout - editor layout
|
|
252
|
-
* @param {Number} index - the index to insert layout item(s)
|
|
253
|
-
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
254
|
-
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
255
|
-
*/
|
|
256
|
-
|
|
257
|
-
var insertLayout = function insertLayout(layout, index) {
|
|
258
|
-
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
259
|
-
layoutItems[_key - 2] = arguments[_key];
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __export = (target, all) => {
|
|
28
|
+
for (var name in all)
|
|
29
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
30
|
+
};
|
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
+
for (let key of __getOwnPropNames(from))
|
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
260
36
|
}
|
|
261
|
-
|
|
262
|
-
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
37
|
+
return to;
|
|
263
38
|
};
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
/***/ }),
|
|
280
|
-
/* 6 */
|
|
281
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
282
|
-
|
|
283
|
-
"use strict";
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
Object.defineProperty(exports, "__esModule", {
|
|
287
|
-
value: true
|
|
39
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
40
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
41
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
42
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
43
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
44
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
45
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
+
mod
|
|
47
|
+
));
|
|
48
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
|
|
50
|
+
// src/SingleValue/config.ts
|
|
51
|
+
var config_exports = {};
|
|
52
|
+
__export(config_exports, {
|
|
53
|
+
default: () => config_default
|
|
288
54
|
});
|
|
289
|
-
exports
|
|
290
|
-
var VizBehavior;
|
|
55
|
+
module.exports = __toCommonJS(config_exports);
|
|
291
56
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
*
|
|
297
|
-
* **Example**
|
|
298
|
-
*
|
|
299
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
300
|
-
* would configure sparklineValues with an array of data points
|
|
301
|
-
* coming from the first series in the primary datasource
|
|
302
|
-
*
|
|
303
|
-
*/
|
|
304
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
305
|
-
VizBehavior["EVENTS"] = "events";
|
|
306
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
307
|
-
/**
|
|
308
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
309
|
-
* missing.
|
|
310
|
-
* @type {string}
|
|
311
|
-
*/
|
|
312
|
-
|
|
313
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
314
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
315
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
316
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
317
|
-
|
|
318
|
-
/***/ }),
|
|
319
|
-
/* 7 */
|
|
320
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
321
|
-
|
|
322
|
-
"use strict";
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
Object.defineProperty(exports, "__esModule", {
|
|
326
|
-
value: true
|
|
57
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
58
|
+
var i18n_exports = {};
|
|
59
|
+
__export(i18n_exports, {
|
|
60
|
+
default: () => i18n_default
|
|
327
61
|
});
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
showEditor: function showEditor(_ref) {
|
|
402
|
-
var options = _ref.options;
|
|
403
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
|
|
404
|
-
}
|
|
405
|
-
};
|
|
406
|
-
/* harmony default export */ __webpack_exports__["default"] = (StaticBackgroundColorEditor);
|
|
407
|
-
|
|
408
|
-
/***/ }),
|
|
409
|
-
/* 23 */,
|
|
410
|
-
/* 24 */
|
|
411
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
412
|
-
|
|
413
|
-
"use strict";
|
|
414
|
-
__webpack_require__.r(__webpack_exports__);
|
|
415
|
-
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "getDynamicTrendColorEditor", function() { return getDynamicTrendColorEditor; });
|
|
416
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
417
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
418
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
419
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
var getDynamicTrendColorEditor = function getDynamicTrendColorEditor(_ref) {
|
|
423
|
-
var defaultContext = _ref.defaultContext,
|
|
424
|
-
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
425
|
-
return {
|
|
426
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
|
|
427
|
-
option: 'trendColor',
|
|
428
|
-
context: 'trendColorEditorConfig',
|
|
429
|
-
editor: 'editor.dynamicColor',
|
|
430
|
-
showEditor: function showEditor(_ref2) {
|
|
431
|
-
var options = _ref2.options;
|
|
432
|
-
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
|
|
62
|
+
var defaultImport = __toESM(require("@splunk/ui-utils/i18n"));
|
|
63
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
64
|
+
var i18n_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
65
|
+
|
|
66
|
+
// esm-externals:@splunk/visualization-schemas
|
|
67
|
+
var visualization_schemas_exports = {};
|
|
68
|
+
__export(visualization_schemas_exports, {
|
|
69
|
+
default: () => visualization_schemas_default
|
|
70
|
+
});
|
|
71
|
+
var defaultImport2 = __toESM(require("@splunk/visualization-schemas"));
|
|
72
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
73
|
+
var visualization_schemas_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
74
|
+
|
|
75
|
+
// esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
|
|
76
|
+
var PresetPalettes_exports = {};
|
|
77
|
+
__export(PresetPalettes_exports, {
|
|
78
|
+
default: () => PresetPalettes_default
|
|
79
|
+
});
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
81
|
+
__reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
82
|
+
var PresetPalettes_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
83
|
+
|
|
84
|
+
// esm-externals:@splunk/visualization-themes/variables
|
|
85
|
+
var variables_exports = {};
|
|
86
|
+
__export(variables_exports, {
|
|
87
|
+
default: () => variables_default
|
|
88
|
+
});
|
|
89
|
+
var defaultImport4 = __toESM(require("@splunk/visualization-themes/variables"));
|
|
90
|
+
__reExport(variables_exports, require("@splunk/visualization-themes/variables"));
|
|
91
|
+
var variables_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
|
+
|
|
93
|
+
// esm-externals:@splunk/themes/pick
|
|
94
|
+
var pick_exports = {};
|
|
95
|
+
__export(pick_exports, {
|
|
96
|
+
default: () => pick_default
|
|
97
|
+
});
|
|
98
|
+
var defaultImport5 = __toESM(require("@splunk/themes/pick"));
|
|
99
|
+
__reExport(pick_exports, require("@splunk/themes/pick"));
|
|
100
|
+
var pick_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
101
|
+
|
|
102
|
+
// esm-externals:@splunk/themes/variables
|
|
103
|
+
var variables_exports2 = {};
|
|
104
|
+
__export(variables_exports2, {
|
|
105
|
+
default: () => variables_default2
|
|
106
|
+
});
|
|
107
|
+
var defaultImport6 = __toESM(require("@splunk/themes/variables"));
|
|
108
|
+
__reExport(variables_exports2, require("@splunk/themes/variables"));
|
|
109
|
+
var variables_default2 = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
110
|
+
|
|
111
|
+
// esm-externals:@splunk/visualization-icons
|
|
112
|
+
var visualization_icons_exports = {};
|
|
113
|
+
__export(visualization_icons_exports, {
|
|
114
|
+
default: () => visualization_icons_default
|
|
115
|
+
});
|
|
116
|
+
var defaultImport7 = __toESM(require("@splunk/visualization-icons"));
|
|
117
|
+
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
118
|
+
var visualization_icons_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
119
|
+
|
|
120
|
+
// esm-externals:@splunk/visualization-icons/placeholders
|
|
121
|
+
var placeholders_exports = {};
|
|
122
|
+
__export(placeholders_exports, {
|
|
123
|
+
default: () => placeholders_default
|
|
124
|
+
});
|
|
125
|
+
var defaultImport8 = __toESM(require("@splunk/visualization-icons/placeholders"));
|
|
126
|
+
__reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
|
|
127
|
+
var placeholders_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
|
|
128
|
+
|
|
129
|
+
// src/common/configContext/singleValueContext.ts
|
|
130
|
+
var defaultContext = {
|
|
131
|
+
trendColorConfig: [
|
|
132
|
+
{
|
|
133
|
+
to: 0,
|
|
134
|
+
value: "#9E2520"
|
|
433
135
|
},
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
formatters: [{
|
|
438
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
439
|
-
value: 'rangeValue',
|
|
440
|
-
defaults: {
|
|
441
|
-
trendValue: defaultContext.trendColorConfig
|
|
442
|
-
}
|
|
443
|
-
}],
|
|
444
|
-
dataSelectors: [{
|
|
445
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Trend value'),
|
|
446
|
-
value: 'trendValue'
|
|
447
|
-
}],
|
|
448
|
-
defaultPalettesConfig: defaultPalettesConfig
|
|
136
|
+
{
|
|
137
|
+
from: 0,
|
|
138
|
+
value: "#1C6B2D"
|
|
449
139
|
}
|
|
450
|
-
|
|
140
|
+
],
|
|
141
|
+
majorColorConfig: [
|
|
142
|
+
{ to: 20, value: "#D41F1F" },
|
|
143
|
+
{ from: 20, to: 40, value: "#D94E17" },
|
|
144
|
+
{ from: 40, to: 60, value: "#CBA700" },
|
|
145
|
+
{ from: 60, to: 80, value: "#669922" },
|
|
146
|
+
{ from: 80, value: "#118832" }
|
|
147
|
+
],
|
|
148
|
+
majorColorMatchConfig: [{ match: "", value: "#5C33FF" }],
|
|
149
|
+
trendValueCopy: "> trendValue",
|
|
150
|
+
divisor: "> majorValue | subtract(trendValueCopy) | divideBy(100)",
|
|
151
|
+
trendValuePercent: "> trendValue | divideBy(divisor)"
|
|
451
152
|
};
|
|
452
153
|
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
return Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
|
|
477
|
-
},
|
|
478
|
-
editorProps: {
|
|
479
|
-
labelPosition: 'top',
|
|
480
|
-
flyoutTitle: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Dynamic coloring: background'),
|
|
481
|
-
formatters: [{
|
|
482
|
-
label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Ranges'),
|
|
483
|
-
value: 'rangeValue',
|
|
154
|
+
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
155
|
+
var configUtils_exports = {};
|
|
156
|
+
__export(configUtils_exports, {
|
|
157
|
+
default: () => configUtils_default
|
|
158
|
+
});
|
|
159
|
+
var defaultImport9 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
160
|
+
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
161
|
+
var configUtils_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
|
|
162
|
+
|
|
163
|
+
// src/common/editorConfig/DynamicMajorColorEditor.js
|
|
164
|
+
var getDynamicMajorColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
165
|
+
label: (0, i18n_exports._)("Major value"),
|
|
166
|
+
option: "majorColor",
|
|
167
|
+
context: "majorColorEditorConfig",
|
|
168
|
+
editor: "editor.dynamicColor",
|
|
169
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.majorColor),
|
|
170
|
+
editorProps: {
|
|
171
|
+
labelPosition: "top",
|
|
172
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: major value"),
|
|
173
|
+
formatters: [
|
|
174
|
+
{
|
|
175
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
176
|
+
value: "rangeValue",
|
|
484
177
|
defaults: {
|
|
485
|
-
majorValue:
|
|
486
|
-
trendValue: defaultContext.trendColorConfig
|
|
178
|
+
majorValue: defaultContext2.majorColorConfig
|
|
487
179
|
}
|
|
488
|
-
},
|
|
489
|
-
|
|
490
|
-
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
label: (0, i18n_exports._)("Matches"),
|
|
183
|
+
value: "matchValue",
|
|
491
184
|
defaults: {
|
|
492
|
-
majorValue:
|
|
185
|
+
majorValue: defaultContext2.majorColorMatchConfig
|
|
493
186
|
}
|
|
494
|
-
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
/***/ }),
|
|
508
|
-
/* 26 */
|
|
509
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
510
|
-
|
|
511
|
-
"use strict";
|
|
512
|
-
__webpack_require__.r(__webpack_exports__);
|
|
513
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
514
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
187
|
+
}
|
|
188
|
+
],
|
|
189
|
+
dataSelectors: [
|
|
190
|
+
{
|
|
191
|
+
label: (0, i18n_exports._)("Major value"),
|
|
192
|
+
value: "majorValue"
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
196
|
+
}
|
|
197
|
+
});
|
|
515
198
|
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
option:
|
|
520
|
-
|
|
199
|
+
// src/common/editorConfig/DynamicTrendColorEditor.js
|
|
200
|
+
var getDynamicTrendColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
201
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
202
|
+
option: "trendColor",
|
|
203
|
+
context: "trendColorEditorConfig",
|
|
204
|
+
editor: "editor.dynamicColor",
|
|
205
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.trendColor),
|
|
521
206
|
editorProps: {
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
return options.showValue || options.showValue === undefined;
|
|
207
|
+
labelPosition: "top",
|
|
208
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: trend value"),
|
|
209
|
+
formatters: [
|
|
210
|
+
{
|
|
211
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
212
|
+
value: "rangeValue",
|
|
213
|
+
defaults: {
|
|
214
|
+
trendValue: defaultContext2.trendColorConfig
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
],
|
|
218
|
+
dataSelectors: [
|
|
219
|
+
{
|
|
220
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
221
|
+
value: "trendValue"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
541
225
|
}
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// src/common/editorConfig/DynamicBackgroundColorEditor.js
|
|
229
|
+
var getDynamicBackgroundColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
230
|
+
label: (0, i18n_exports._)("Background color"),
|
|
231
|
+
option: "backgroundColor",
|
|
232
|
+
context: "backgroundColorEditorConfig",
|
|
233
|
+
editor: "editor.dynamicColor",
|
|
234
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.backgroundColor),
|
|
546
235
|
editorProps: {
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
236
|
+
labelPosition: "top",
|
|
237
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: background"),
|
|
238
|
+
formatters: [
|
|
239
|
+
{
|
|
240
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
241
|
+
value: "rangeValue",
|
|
242
|
+
defaults: {
|
|
243
|
+
majorValue: defaultContext2.majorColorConfig,
|
|
244
|
+
trendValue: defaultContext2.trendColorConfig
|
|
245
|
+
}
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
label: (0, i18n_exports._)("Matches"),
|
|
249
|
+
value: "matchValue",
|
|
250
|
+
defaults: {
|
|
251
|
+
majorValue: defaultContext2.majorColorMatchConfig
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
],
|
|
255
|
+
dataSelectors: [
|
|
256
|
+
{
|
|
257
|
+
label: (0, i18n_exports._)("Major Value"),
|
|
258
|
+
value: "majorValue"
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
label: (0, i18n_exports._)("Trend"),
|
|
262
|
+
value: "trendValue"
|
|
263
|
+
}
|
|
264
|
+
],
|
|
265
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
553
266
|
}
|
|
554
|
-
}
|
|
555
|
-
/* harmony default export */ __webpack_exports__["default"] = (StaticMajorAndTrendLayout);
|
|
556
|
-
|
|
557
|
-
/***/ }),
|
|
558
|
-
/* 27 */
|
|
559
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
560
|
-
|
|
561
|
-
"use strict";
|
|
562
|
-
__webpack_require__.r(__webpack_exports__);
|
|
563
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
564
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
565
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
566
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
267
|
+
});
|
|
567
268
|
|
|
269
|
+
// src/common/editorConfig/StaticMajorAndTrendLayout.js
|
|
270
|
+
var StaticMajorAndTrendLayout = [
|
|
271
|
+
[
|
|
272
|
+
{
|
|
273
|
+
label: (0, i18n_exports._)("Unit position"),
|
|
274
|
+
// todo: we need a new editor combining unit and position
|
|
275
|
+
option: "unitPosition",
|
|
276
|
+
editor: "editor.select",
|
|
277
|
+
editorProps: {
|
|
278
|
+
values: [
|
|
279
|
+
{ label: (0, i18n_exports._)("Before"), value: "before" },
|
|
280
|
+
{ label: (0, i18n_exports._)("After"), value: "after" }
|
|
281
|
+
]
|
|
282
|
+
},
|
|
283
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
label: (0, i18n_exports._)("Unit label"),
|
|
287
|
+
option: "unit",
|
|
288
|
+
editor: "editor.text",
|
|
289
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
[
|
|
293
|
+
{
|
|
294
|
+
label: (0, i18n_exports._)("Precision"),
|
|
295
|
+
option: "numberPrecision",
|
|
296
|
+
editor: "editor.number",
|
|
297
|
+
editorProps: {
|
|
298
|
+
min: 0,
|
|
299
|
+
max: 20
|
|
300
|
+
},
|
|
301
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
302
|
+
}
|
|
303
|
+
]
|
|
304
|
+
];
|
|
305
|
+
var StaticMajorAndTrendLayout_default = StaticMajorAndTrendLayout;
|
|
568
306
|
|
|
307
|
+
// src/common/editorConfig/StaticMajorColorEditor.js
|
|
569
308
|
var StaticMajorColorEditor = {
|
|
570
|
-
label:
|
|
571
|
-
option:
|
|
572
|
-
editor:
|
|
573
|
-
showEditor:
|
|
574
|
-
var options = _ref.options;
|
|
575
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.majorColor);
|
|
576
|
-
}
|
|
309
|
+
label: (0, i18n_exports._)("Major value"),
|
|
310
|
+
option: "majorColor",
|
|
311
|
+
editor: "editor.color",
|
|
312
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.majorColor)
|
|
577
313
|
};
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
/***/ }),
|
|
581
|
-
/* 28 */
|
|
582
|
-
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
583
|
-
|
|
584
|
-
"use strict";
|
|
585
|
-
__webpack_require__.r(__webpack_exports__);
|
|
586
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
|
|
587
|
-
/* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
|
|
588
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
|
|
589
|
-
/* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
|
|
590
|
-
|
|
314
|
+
var StaticMajorColorEditor_default = StaticMajorColorEditor;
|
|
591
315
|
|
|
316
|
+
// src/common/editorConfig/StaticTrendColorEditor.js
|
|
592
317
|
var StaticTrendColorEditor = {
|
|
593
|
-
label:
|
|
594
|
-
option:
|
|
595
|
-
editor:
|
|
596
|
-
showEditor:
|
|
597
|
-
|
|
598
|
-
return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.trendColor);
|
|
599
|
-
},
|
|
600
|
-
isDisabled: function isDisabled(_ref2) {
|
|
601
|
-
var options = _ref2.options;
|
|
602
|
-
return options.trendDisplay === 'off';
|
|
603
|
-
}
|
|
318
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
319
|
+
option: "trendColor",
|
|
320
|
+
editor: "editor.color",
|
|
321
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.trendColor),
|
|
322
|
+
isDisabled: ({ options }) => options.trendDisplay === "off"
|
|
604
323
|
};
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
/***/ }),
|
|
608
|
-
/* 29 */
|
|
609
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
610
|
-
|
|
611
|
-
"use strict";
|
|
324
|
+
var StaticTrendColorEditor_default = StaticTrendColorEditor;
|
|
612
325
|
|
|
326
|
+
// src/common/editorConfig/StaticBackgroundColorEditor.js
|
|
327
|
+
var StaticBackgroundColorEditor = {
|
|
328
|
+
label: (0, i18n_exports._)("Background color"),
|
|
329
|
+
option: "backgroundColor",
|
|
330
|
+
editor: "editor.color",
|
|
331
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.backgroundColor)
|
|
332
|
+
};
|
|
333
|
+
var StaticBackgroundColorEditor_default = StaticBackgroundColorEditor;
|
|
613
334
|
|
|
614
|
-
|
|
615
|
-
|
|
335
|
+
// esm-externals:lodash
|
|
336
|
+
var lodash_exports = {};
|
|
337
|
+
__export(lodash_exports, {
|
|
338
|
+
default: () => lodash_default
|
|
616
339
|
});
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
var
|
|
620
|
-
|
|
621
|
-
var i18n_1 = __webpack_require__(0);
|
|
622
|
-
|
|
623
|
-
var FeatureFlagContext_1 = __webpack_require__(31);
|
|
624
|
-
|
|
625
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
626
|
-
/* eslint-disable react-hooks/rules-of-hooks */
|
|
340
|
+
var defaultImport10 = __toESM(require("lodash"));
|
|
341
|
+
__reExport(lodash_exports, require("lodash"));
|
|
342
|
+
var lodash_default = "default" in defaultImport10 ? defaultImport10.default : defaultImport10;
|
|
627
343
|
|
|
344
|
+
// src/common/utils/configUtils.ts
|
|
345
|
+
function enhanceConfig(vizConfig) {
|
|
346
|
+
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
347
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
348
|
+
(config2) => {
|
|
349
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
350
|
+
}
|
|
351
|
+
);
|
|
352
|
+
return enhancedConfig;
|
|
353
|
+
}
|
|
354
|
+
function hasCompatibleContexts(vizContext, presetContext) {
|
|
355
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
356
|
+
return presetContextKeys.every(
|
|
357
|
+
(contextKey) => presetContext[contextKey] === void 0 && vizContext[contextKey] === void 0 || presetContext[contextKey] !== void 0 && vizContext[contextKey] !== void 0
|
|
358
|
+
);
|
|
359
|
+
}
|
|
360
|
+
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
361
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
362
|
+
return presetOptionKeys.every(
|
|
363
|
+
(optionKey) => (0, configUtils_exports.isDynamicOption)(presetOptions[optionKey]) === (0, configUtils_exports.isDynamicOption)(vizOptions[optionKey])
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
function getInitialPreset(vizContext, vizOptions, presets2) {
|
|
367
|
+
return presets2.find((preset) => {
|
|
368
|
+
const presetContext = (0, lodash_exports.get)(preset, ["value", "context"], {});
|
|
369
|
+
const presetOptions = (0, lodash_exports.get)(preset, ["value", "options"], {});
|
|
370
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
371
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
372
|
+
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
373
|
+
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
374
|
+
});
|
|
375
|
+
}
|
|
628
376
|
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
editor: 'editor.toggle',
|
|
633
|
-
showEditor: function showEditor() {
|
|
634
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
635
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
636
|
-
return isTrellisFeatureFlagOn;
|
|
637
|
-
}
|
|
638
|
-
}], [{
|
|
639
|
-
label: (0, i18n_1._)('Split by'),
|
|
640
|
-
option: 'trellisSplitBy',
|
|
641
|
-
editor: 'editor.trellisSplitBy',
|
|
642
|
-
editorProps: {
|
|
643
|
-
dataSourceKey: 'primary'
|
|
644
|
-
},
|
|
645
|
-
showEditor: function showEditor(_ref) {
|
|
646
|
-
var options = _ref.options;
|
|
647
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
648
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
649
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
650
|
-
}
|
|
651
|
-
}], [{
|
|
652
|
-
label: (0, i18n_1._)('Number of columns'),
|
|
653
|
-
option: 'trellisColumns',
|
|
654
|
-
editor: 'editor.number',
|
|
655
|
-
editorProps: {
|
|
656
|
-
min: 1
|
|
657
|
-
},
|
|
658
|
-
placeholder: (0, i18n_1._)('Auto'),
|
|
659
|
-
showEditor: function showEditor(_ref2) {
|
|
660
|
-
var options = _ref2.options;
|
|
661
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
662
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
663
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
664
|
-
}
|
|
665
|
-
}], [{
|
|
666
|
-
label: (0, i18n_1._)('Min column width'),
|
|
667
|
-
option: 'trellisMinColumnWidth',
|
|
668
|
-
editor: 'editor.number',
|
|
669
|
-
editorProps: {
|
|
670
|
-
min: 1
|
|
671
|
-
},
|
|
672
|
-
showEditor: function showEditor(_ref3) {
|
|
673
|
-
var options = _ref3.options;
|
|
674
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
675
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
676
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
677
|
-
}
|
|
678
|
-
}, {
|
|
679
|
-
label: (0, i18n_1._)('Row height'),
|
|
680
|
-
option: 'trellisRowHeight',
|
|
681
|
-
editor: 'editor.number',
|
|
682
|
-
editorProps: {
|
|
683
|
-
min: 1
|
|
684
|
-
},
|
|
685
|
-
showEditor: function showEditor(_ref4) {
|
|
686
|
-
var options = _ref4.options;
|
|
687
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
688
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
689
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
690
|
-
}
|
|
691
|
-
}], [{
|
|
692
|
-
label: (0, i18n_1._)('Max number of components per page'),
|
|
693
|
-
option: 'trellisPageCount',
|
|
694
|
-
editor: 'editor.number',
|
|
695
|
-
editorProps: {
|
|
696
|
-
min: 1
|
|
697
|
-
},
|
|
698
|
-
showEditor: function showEditor(_ref5) {
|
|
699
|
-
var options = _ref5.options;
|
|
700
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
701
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
702
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
703
|
-
}
|
|
704
|
-
}]];
|
|
705
|
-
exports.TrellisBackgroundColorEditor = {
|
|
706
|
-
label: (0, i18n_1._)('Trellis background'),
|
|
707
|
-
option: 'trellisBackgroundColor',
|
|
708
|
-
editor: 'editor.color',
|
|
709
|
-
showEditor: function showEditor(_ref6) {
|
|
710
|
-
var options = _ref6.options;
|
|
711
|
-
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
712
|
-
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
713
|
-
return isTrellisFeatureFlagOn && options.splitByLayout === visualization_schemas_1.LAYOUT_TYPE.Trellis;
|
|
714
|
-
}
|
|
377
|
+
// src/common/editorConfig/TrellisEditors.ts
|
|
378
|
+
var isTrellisFeatureFlagOn = ({ featureFlags }) => {
|
|
379
|
+
return Boolean(featureFlags == null ? void 0 : featureFlags.visualizations_enableTrellis);
|
|
715
380
|
};
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
/***/ (function(module, exports) {
|
|
720
|
-
|
|
721
|
-
module.exports = require("react");
|
|
722
|
-
|
|
723
|
-
/***/ }),
|
|
724
|
-
/* 31 */
|
|
725
|
-
/***/ (function(module, exports) {
|
|
726
|
-
|
|
727
|
-
module.exports = require("@splunk/visualization-context/FeatureFlagContext");
|
|
728
|
-
|
|
729
|
-
/***/ }),
|
|
730
|
-
/* 32 */,
|
|
731
|
-
/* 33 */,
|
|
732
|
-
/* 34 */,
|
|
733
|
-
/* 35 */,
|
|
734
|
-
/* 36 */,
|
|
735
|
-
/* 37 */
|
|
736
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
737
|
-
|
|
738
|
-
"use strict";
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
Object.defineProperty(exports, "__esModule", {
|
|
742
|
-
value: true
|
|
743
|
-
});
|
|
744
|
-
exports.defaultContext = void 0;
|
|
745
|
-
exports.defaultContext = {
|
|
746
|
-
trendColorConfig: [{
|
|
747
|
-
to: 0,
|
|
748
|
-
value: '#9E2520'
|
|
749
|
-
}, {
|
|
750
|
-
from: 0,
|
|
751
|
-
value: '#1C6B2D'
|
|
752
|
-
}],
|
|
753
|
-
majorColorConfig: [{
|
|
754
|
-
to: 20,
|
|
755
|
-
value: '#D41F1F'
|
|
756
|
-
}, {
|
|
757
|
-
from: 20,
|
|
758
|
-
to: 40,
|
|
759
|
-
value: '#D94E17'
|
|
760
|
-
}, {
|
|
761
|
-
from: 40,
|
|
762
|
-
to: 60,
|
|
763
|
-
value: '#CBA700'
|
|
764
|
-
}, {
|
|
765
|
-
from: 60,
|
|
766
|
-
to: 80,
|
|
767
|
-
value: '#669922'
|
|
768
|
-
}, {
|
|
769
|
-
from: 80,
|
|
770
|
-
value: '#118832'
|
|
771
|
-
}],
|
|
772
|
-
majorColorMatchConfig: [{
|
|
773
|
-
match: '',
|
|
774
|
-
value: '#5C33FF'
|
|
775
|
-
}]
|
|
381
|
+
var isTrellisEnabled = ({ options, featureFlags }) => {
|
|
382
|
+
const { splitByLayout = visualization_schemas_exports.LAYOUT_TYPE.Off } = options;
|
|
383
|
+
return isTrellisFeatureFlagOn({ featureFlags }) && splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis;
|
|
776
384
|
};
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
385
|
+
var TrellisEditorConfig = [
|
|
386
|
+
[
|
|
387
|
+
{
|
|
388
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
389
|
+
option: "splitByLayout",
|
|
390
|
+
editor: "editor.toggle",
|
|
391
|
+
showEditor: isTrellisFeatureFlagOn
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
[
|
|
395
|
+
{
|
|
396
|
+
label: (0, i18n_exports._)("Split by"),
|
|
397
|
+
option: "trellisSplitBy",
|
|
398
|
+
editor: "editor.trellisSplitBy",
|
|
399
|
+
editorProps: {
|
|
400
|
+
dataSourceKey: "primary"
|
|
401
|
+
},
|
|
402
|
+
showEditor: isTrellisEnabled
|
|
403
|
+
}
|
|
404
|
+
],
|
|
405
|
+
[
|
|
406
|
+
{
|
|
407
|
+
label: (0, i18n_exports._)("Number of columns"),
|
|
408
|
+
option: "trellisColumns",
|
|
409
|
+
editor: "editor.number",
|
|
410
|
+
editorProps: {
|
|
411
|
+
min: 1
|
|
412
|
+
},
|
|
413
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
414
|
+
showEditor: isTrellisEnabled
|
|
415
|
+
}
|
|
416
|
+
],
|
|
417
|
+
[
|
|
418
|
+
{
|
|
419
|
+
label: (0, i18n_exports._)("Min column width"),
|
|
420
|
+
option: "trellisMinColumnWidth",
|
|
421
|
+
editor: "editor.number",
|
|
422
|
+
editorProps: {
|
|
423
|
+
min: 1
|
|
424
|
+
},
|
|
425
|
+
showEditor: isTrellisEnabled
|
|
802
426
|
},
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
427
|
+
{
|
|
428
|
+
label: (0, i18n_exports._)("Row height"),
|
|
429
|
+
option: "trellisRowHeight",
|
|
430
|
+
editor: "editor.number",
|
|
431
|
+
editorProps: {
|
|
432
|
+
min: 1
|
|
433
|
+
},
|
|
434
|
+
showEditor: isTrellisEnabled
|
|
435
|
+
}
|
|
436
|
+
],
|
|
437
|
+
[
|
|
438
|
+
{
|
|
439
|
+
label: (0, i18n_exports._)("Max number of components per page"),
|
|
440
|
+
option: "trellisPageCount",
|
|
441
|
+
editor: "editor.number",
|
|
442
|
+
editorProps: {
|
|
443
|
+
min: 1
|
|
444
|
+
},
|
|
445
|
+
showEditor: isTrellisEnabled
|
|
446
|
+
}
|
|
447
|
+
]
|
|
448
|
+
];
|
|
449
|
+
var TimechartTrellisEditorConfig = [
|
|
450
|
+
[
|
|
451
|
+
{
|
|
452
|
+
label: (0, i18n_exports._)("Trellis layout"),
|
|
453
|
+
option: "splitByLayout",
|
|
454
|
+
editor: "editor.toggle",
|
|
455
|
+
showEditor: isTrellisFeatureFlagOn,
|
|
456
|
+
// add help text for timecharts
|
|
457
|
+
editorProps: {
|
|
458
|
+
help: (0, i18n_exports._)(
|
|
459
|
+
"Y2-axis and overlay field configurations are not supported when trellis is enabled."
|
|
460
|
+
),
|
|
461
|
+
helpFormat: "under"
|
|
462
|
+
}
|
|
824
463
|
}
|
|
825
|
-
|
|
464
|
+
],
|
|
465
|
+
...TrellisEditorConfig.slice(1),
|
|
466
|
+
[
|
|
467
|
+
{
|
|
468
|
+
label: (0, i18n_exports._)("Shared y-axis scale"),
|
|
469
|
+
option: "trellisSharedScale",
|
|
470
|
+
editor: "editor.checkbox",
|
|
471
|
+
showEditor: isTrellisEnabled
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
];
|
|
475
|
+
var TrellisBackgroundColorEditor = {
|
|
476
|
+
label: (0, i18n_exports._)("Trellis background"),
|
|
477
|
+
option: "trellisBackgroundColor",
|
|
478
|
+
editor: "editor.color",
|
|
479
|
+
showEditor: isTrellisEnabled
|
|
826
480
|
};
|
|
827
481
|
|
|
828
|
-
|
|
829
|
-
/* 39 */,
|
|
830
|
-
/* 40 */,
|
|
831
|
-
/* 41 */,
|
|
832
|
-
/* 42 */,
|
|
833
|
-
/* 43 */,
|
|
834
|
-
/* 44 */,
|
|
835
|
-
/* 45 */,
|
|
836
|
-
/* 46 */,
|
|
837
|
-
/* 47 */,
|
|
838
|
-
/* 48 */,
|
|
839
|
-
/* 49 */,
|
|
840
|
-
/* 50 */,
|
|
841
|
-
/* 51 */,
|
|
842
|
-
/* 52 */,
|
|
843
|
-
/* 53 */,
|
|
844
|
-
/* 54 */,
|
|
845
|
-
/* 55 */,
|
|
846
|
-
/* 56 */,
|
|
847
|
-
/* 57 */,
|
|
848
|
-
/* 58 */,
|
|
849
|
-
/* 59 */,
|
|
850
|
-
/* 60 */,
|
|
851
|
-
/* 61 */,
|
|
852
|
-
/* 62 */,
|
|
853
|
-
/* 63 */,
|
|
854
|
-
/* 64 */,
|
|
855
|
-
/* 65 */,
|
|
856
|
-
/* 66 */
|
|
857
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
858
|
-
|
|
859
|
-
"use strict";
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
863
|
-
|
|
864
|
-
Object.defineProperty(exports, "__esModule", {
|
|
865
|
-
value: true
|
|
866
|
-
});
|
|
867
|
-
|
|
868
|
-
var i18n_1 = __webpack_require__(0);
|
|
869
|
-
|
|
870
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
871
|
-
|
|
872
|
-
var PresetPalettes_1 = __webpack_require__(13);
|
|
873
|
-
|
|
874
|
-
var variables_1 = __webpack_require__(67);
|
|
875
|
-
|
|
876
|
-
var pick_1 = __webpack_require__(8);
|
|
877
|
-
|
|
878
|
-
var variables_2 = __webpack_require__(9);
|
|
879
|
-
|
|
880
|
-
var visualization_icons_1 = __webpack_require__(11);
|
|
881
|
-
|
|
882
|
-
var placeholders_1 = __webpack_require__(10);
|
|
883
|
-
|
|
884
|
-
var singleValueContext_1 = __webpack_require__(37);
|
|
885
|
-
|
|
886
|
-
var VizBehavior_1 = __webpack_require__(6);
|
|
887
|
-
|
|
888
|
-
var DynamicMajorColorEditor_1 = __webpack_require__(38);
|
|
889
|
-
|
|
890
|
-
var DynamicTrendColorEditor_1 = __webpack_require__(24);
|
|
891
|
-
|
|
892
|
-
var DynamicBackgroundColorEditor_1 = __webpack_require__(25);
|
|
893
|
-
|
|
894
|
-
var StaticMajorAndTrendLayout_1 = __webpack_require__(26);
|
|
895
|
-
|
|
896
|
-
var StaticMajorColorEditor_1 = __webpack_require__(27);
|
|
897
|
-
|
|
898
|
-
var StaticTrendColorEditor_1 = __webpack_require__(28);
|
|
899
|
-
|
|
900
|
-
var StaticBackgroundColorEditor_1 = __webpack_require__(22);
|
|
901
|
-
|
|
902
|
-
var configUtils_1 = __webpack_require__(3);
|
|
903
|
-
|
|
904
|
-
var TrellisEditors_1 = __webpack_require__(29);
|
|
905
|
-
|
|
906
|
-
var VizCategory_1 = __webpack_require__(7);
|
|
907
|
-
|
|
482
|
+
// src/SingleValue/config.ts
|
|
908
483
|
var dataContract = {
|
|
909
|
-
requiredDataSources: [
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
484
|
+
requiredDataSources: [
|
|
485
|
+
{
|
|
486
|
+
name: "primary",
|
|
487
|
+
description: "DataSource that powers the visualization"
|
|
488
|
+
}
|
|
489
|
+
],
|
|
913
490
|
optionalDataSources: [],
|
|
914
491
|
initialRequestParams: {
|
|
915
|
-
primary: {
|
|
916
|
-
offset: 0,
|
|
917
|
-
count: 10000
|
|
918
|
-
}
|
|
492
|
+
primary: { offset: 0, count: 1e4 }
|
|
919
493
|
}
|
|
920
494
|
};
|
|
921
495
|
var size = {
|
|
@@ -923,412 +497,382 @@ var size = {
|
|
|
923
497
|
initialHeight: 250
|
|
924
498
|
};
|
|
925
499
|
var basePresetContext = {
|
|
926
|
-
majorColorEditorConfig:
|
|
927
|
-
trendColorEditorConfig:
|
|
928
|
-
backgroundColorEditorConfig:
|
|
500
|
+
majorColorEditorConfig: void 0,
|
|
501
|
+
trendColorEditorConfig: void 0,
|
|
502
|
+
backgroundColorEditorConfig: void 0
|
|
929
503
|
};
|
|
930
504
|
var basePresetOptions = {
|
|
931
|
-
majorColor:
|
|
932
|
-
trendColor:
|
|
933
|
-
backgroundColor:
|
|
505
|
+
majorColor: void 0,
|
|
506
|
+
trendColor: void 0,
|
|
507
|
+
backgroundColor: void 0
|
|
934
508
|
};
|
|
935
|
-
var presets = [
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
}
|
|
944
|
-
label: (0, i18n_1._)('Major value'),
|
|
945
|
-
name: 'singleValue.majorValue',
|
|
946
|
-
value: {
|
|
947
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
948
|
-
majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
949
|
-
}),
|
|
950
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
951
|
-
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)'
|
|
952
|
-
})
|
|
953
|
-
}
|
|
954
|
-
}, {
|
|
955
|
-
label: (0, i18n_1._)('Trend value'),
|
|
956
|
-
name: 'singleValue.trend',
|
|
957
|
-
value: {
|
|
958
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
959
|
-
trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
|
|
960
|
-
}),
|
|
961
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
962
|
-
trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
|
|
963
|
-
})
|
|
964
|
-
}
|
|
965
|
-
}, {
|
|
966
|
-
label: (0, i18n_1._)('Major value and Trend value'),
|
|
967
|
-
name: 'singleValue.majorValueAndTrend',
|
|
968
|
-
value: {
|
|
969
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
970
|
-
majorColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig,
|
|
971
|
-
trendColorEditorConfig: singleValueContext_1.defaultContext.trendColorConfig
|
|
972
|
-
}),
|
|
973
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
974
|
-
majorColor: '> majorValue | rangeValue(majorColorEditorConfig)',
|
|
975
|
-
trendColor: '> trendValue | rangeValue(trendColorEditorConfig)'
|
|
976
|
-
})
|
|
977
|
-
}
|
|
978
|
-
}, {
|
|
979
|
-
label: (0, i18n_1._)('Background'),
|
|
980
|
-
name: 'singleValue.background',
|
|
981
|
-
value: {
|
|
982
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
983
|
-
backgroundColorEditorConfig: singleValueContext_1.defaultContext.majorColorConfig
|
|
984
|
-
}),
|
|
985
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
986
|
-
backgroundColor: '> majorValue | rangeValue(backgroundColorEditorConfig)'
|
|
987
|
-
})
|
|
988
|
-
}
|
|
989
|
-
}]; // @TODO(pwied):
|
|
990
|
-
// remove once react-visualizations/SV was deprecated
|
|
991
|
-
// including unused sparklineFillColor
|
|
992
|
-
|
|
993
|
-
var LIGHTMODE_SPARKLINE_AREA_COLOR = '#171D21';
|
|
994
|
-
var DARKMODE_SPARKLINE_AREA_COLOR = '#FFFFFF';
|
|
995
|
-
var themes = {
|
|
996
|
-
defaultFontColor: function defaultFontColor(props) {
|
|
997
|
-
return (0, pick_1.default)({
|
|
998
|
-
enterprise: {
|
|
999
|
-
dark: variables_2.default.textColor(props),
|
|
1000
|
-
light: variables_2.default.gray20(props)
|
|
1001
|
-
},
|
|
1002
|
-
prisma: variables_2.default.contentColorActive(props)
|
|
1003
|
-
})(props);
|
|
509
|
+
var presets = [
|
|
510
|
+
{
|
|
511
|
+
// dummy context variables to allow for resetting of unused context states
|
|
512
|
+
label: (0, i18n_exports._)("None"),
|
|
513
|
+
name: "singleValue.none",
|
|
514
|
+
value: {
|
|
515
|
+
context: __spreadValues({}, basePresetContext),
|
|
516
|
+
options: __spreadValues({}, basePresetOptions)
|
|
517
|
+
}
|
|
1004
518
|
},
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
519
|
+
{
|
|
520
|
+
label: (0, i18n_exports._)("Major value"),
|
|
521
|
+
name: "singleValue.majorValue",
|
|
522
|
+
value: {
|
|
523
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
524
|
+
majorColorEditorConfig: defaultContext.majorColorConfig
|
|
525
|
+
}),
|
|
526
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
527
|
+
majorColor: "> majorValue | rangeValue(majorColorEditorConfig)"
|
|
528
|
+
})
|
|
529
|
+
}
|
|
1010
530
|
},
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
531
|
+
{
|
|
532
|
+
label: (0, i18n_exports._)("Trend value"),
|
|
533
|
+
name: "singleValue.trend",
|
|
534
|
+
value: {
|
|
535
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
536
|
+
trendColorEditorConfig: defaultContext.trendColorConfig
|
|
537
|
+
}),
|
|
538
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
539
|
+
trendColor: "> trendValue | rangeValue(trendColorEditorConfig)"
|
|
540
|
+
})
|
|
541
|
+
}
|
|
1019
542
|
},
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
543
|
+
{
|
|
544
|
+
label: (0, i18n_exports._)("Major value and Trend value"),
|
|
545
|
+
name: "singleValue.majorValueAndTrend",
|
|
546
|
+
value: {
|
|
547
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
548
|
+
majorColorEditorConfig: defaultContext.majorColorConfig,
|
|
549
|
+
trendColorEditorConfig: defaultContext.trendColorConfig
|
|
550
|
+
}),
|
|
551
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
552
|
+
majorColor: "> majorValue | rangeValue(majorColorEditorConfig)",
|
|
553
|
+
trendColor: "> trendValue | rangeValue(trendColorEditorConfig)"
|
|
554
|
+
})
|
|
555
|
+
}
|
|
1025
556
|
},
|
|
557
|
+
{
|
|
558
|
+
label: (0, i18n_exports._)("Background"),
|
|
559
|
+
name: "singleValue.background",
|
|
560
|
+
value: {
|
|
561
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
562
|
+
backgroundColorEditorConfig: defaultContext.majorColorConfig
|
|
563
|
+
}),
|
|
564
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
565
|
+
backgroundColor: "> majorValue | rangeValue(backgroundColorEditorConfig)"
|
|
566
|
+
})
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
];
|
|
570
|
+
var themes = {
|
|
571
|
+
defaultFontColor: (props) => pick_default({
|
|
572
|
+
enterprise: {
|
|
573
|
+
dark: variables_default2.textColor(props),
|
|
574
|
+
light: variables_default2.gray20(props)
|
|
575
|
+
},
|
|
576
|
+
prisma: variables_default2.contentColorActive(props)
|
|
577
|
+
})(props),
|
|
578
|
+
defaultBlockFontColor: (props) => pick_default({
|
|
579
|
+
enterprise: variables_default2.white(props),
|
|
580
|
+
prisma: variables_default2.contentColorActive(props)
|
|
581
|
+
})(props),
|
|
582
|
+
defaultBackgroundColor: (props) => pick_default({
|
|
583
|
+
enterprise: {
|
|
584
|
+
dark: variables_default2.black(props),
|
|
585
|
+
light: variables_default2.backgroundColor(props)
|
|
586
|
+
},
|
|
587
|
+
prisma: variables_default2.backgroundColorSidebar(props)
|
|
588
|
+
})(props),
|
|
589
|
+
defaultSparklineStrokeColor: (props) => pick_default({
|
|
590
|
+
enterprise: variables_default2.textColor(props),
|
|
591
|
+
prisma: variables_default2.contentColorActive(props)
|
|
592
|
+
})(props),
|
|
1026
593
|
// TODO(fkurniawan): update with SCP-36839
|
|
1027
|
-
sparklineSeverityColors:
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
dark: JSON.stringify({
|
|
1031
|
-
none: {
|
|
1032
|
-
background: variables_1.enterpriseDark.gray60,
|
|
1033
|
-
stroke: variables_1.enterpriseDark.white
|
|
1034
|
-
},
|
|
1035
|
-
low: {
|
|
1036
|
-
background: variables_1.enterpriseDark.successColorD50,
|
|
1037
|
-
stroke: variables_1.enterpriseDark.white
|
|
1038
|
-
},
|
|
1039
|
-
guarded: {
|
|
1040
|
-
background: variables_1.enterpriseDark.infoColorD50,
|
|
1041
|
-
stroke: variables_1.enterpriseDark.white
|
|
1042
|
-
},
|
|
1043
|
-
elevated: {
|
|
1044
|
-
background: variables_1.enterpriseDark.warningColorD50,
|
|
1045
|
-
stroke: variables_1.enterpriseDark.white
|
|
1046
|
-
},
|
|
1047
|
-
high: {
|
|
1048
|
-
background: variables_1.enterpriseDark.alertColorD50,
|
|
1049
|
-
stroke: variables_1.enterpriseDark.white
|
|
1050
|
-
},
|
|
1051
|
-
severe: {
|
|
1052
|
-
background: variables_1.enterpriseDark.errorColorD50,
|
|
1053
|
-
stroke: variables_1.enterpriseDark.white
|
|
1054
|
-
}
|
|
1055
|
-
}),
|
|
1056
|
-
light: JSON.stringify({
|
|
1057
|
-
none: {
|
|
1058
|
-
background: variables_1.enterprise.gray60,
|
|
1059
|
-
stroke: variables_1.enterprise.gray20
|
|
1060
|
-
},
|
|
1061
|
-
low: {
|
|
1062
|
-
background: variables_1.enterprise.successColorD50,
|
|
1063
|
-
stroke: variables_1.enterprise.white
|
|
1064
|
-
},
|
|
1065
|
-
guarded: {
|
|
1066
|
-
background: variables_1.enterprise.infoColorD50,
|
|
1067
|
-
stroke: variables_1.enterprise.white
|
|
1068
|
-
},
|
|
1069
|
-
elevated: {
|
|
1070
|
-
background: variables_1.enterprise.warningColorD50,
|
|
1071
|
-
stroke: variables_1.enterprise.white
|
|
1072
|
-
},
|
|
1073
|
-
high: {
|
|
1074
|
-
background: variables_1.enterprise.alertColorD50,
|
|
1075
|
-
stroke: variables_1.enterprise.white
|
|
1076
|
-
},
|
|
1077
|
-
severe: {
|
|
1078
|
-
background: variables_1.enterprise.errorColorD50,
|
|
1079
|
-
stroke: variables_1.enterprise.white
|
|
1080
|
-
}
|
|
1081
|
-
})
|
|
1082
|
-
},
|
|
1083
|
-
prisma: JSON.stringify({
|
|
594
|
+
sparklineSeverityColors: (props) => pick_default({
|
|
595
|
+
enterprise: {
|
|
596
|
+
dark: JSON.stringify({
|
|
1084
597
|
none: {
|
|
1085
|
-
background:
|
|
1086
|
-
|
|
598
|
+
background: variables_exports.enterpriseDark.gray60,
|
|
599
|
+
// note: may need update later
|
|
600
|
+
stroke: variables_exports.enterpriseDark.white
|
|
1087
601
|
},
|
|
1088
602
|
low: {
|
|
1089
|
-
background:
|
|
1090
|
-
stroke:
|
|
603
|
+
background: variables_exports.enterpriseDark.successColorD50,
|
|
604
|
+
stroke: variables_exports.enterpriseDark.white
|
|
1091
605
|
},
|
|
1092
606
|
guarded: {
|
|
1093
|
-
background:
|
|
1094
|
-
stroke:
|
|
607
|
+
background: variables_exports.enterpriseDark.infoColorD50,
|
|
608
|
+
stroke: variables_exports.enterpriseDark.white
|
|
1095
609
|
},
|
|
1096
610
|
elevated: {
|
|
1097
|
-
background:
|
|
1098
|
-
stroke:
|
|
611
|
+
background: variables_exports.enterpriseDark.warningColorD50,
|
|
612
|
+
stroke: variables_exports.enterpriseDark.white
|
|
1099
613
|
},
|
|
1100
614
|
high: {
|
|
1101
|
-
background:
|
|
1102
|
-
stroke:
|
|
615
|
+
background: variables_exports.enterpriseDark.alertColorD50,
|
|
616
|
+
stroke: variables_exports.enterpriseDark.white
|
|
1103
617
|
},
|
|
1104
618
|
severe: {
|
|
1105
|
-
background:
|
|
1106
|
-
stroke:
|
|
619
|
+
background: variables_exports.enterpriseDark.errorColorD50,
|
|
620
|
+
stroke: variables_exports.enterpriseDark.white
|
|
621
|
+
}
|
|
622
|
+
}),
|
|
623
|
+
light: JSON.stringify({
|
|
624
|
+
none: {
|
|
625
|
+
background: variables_exports.enterprise.gray60,
|
|
626
|
+
stroke: variables_exports.enterprise.gray20
|
|
627
|
+
},
|
|
628
|
+
low: {
|
|
629
|
+
background: variables_exports.enterprise.successColorD50,
|
|
630
|
+
stroke: variables_exports.enterprise.white
|
|
631
|
+
},
|
|
632
|
+
guarded: {
|
|
633
|
+
background: variables_exports.enterprise.infoColorD50,
|
|
634
|
+
stroke: variables_exports.enterprise.white
|
|
635
|
+
},
|
|
636
|
+
elevated: {
|
|
637
|
+
background: variables_exports.enterprise.warningColorD50,
|
|
638
|
+
stroke: variables_exports.enterprise.white
|
|
639
|
+
},
|
|
640
|
+
high: {
|
|
641
|
+
background: variables_exports.enterprise.alertColorD50,
|
|
642
|
+
stroke: variables_exports.enterprise.white
|
|
643
|
+
},
|
|
644
|
+
severe: {
|
|
645
|
+
background: variables_exports.enterprise.errorColorD50,
|
|
646
|
+
stroke: variables_exports.enterprise.white
|
|
1107
647
|
}
|
|
1108
648
|
})
|
|
1109
|
-
}
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
enterprise: {
|
|
1115
|
-
light: LIGHTMODE_SPARKLINE_AREA_COLOR,
|
|
1116
|
-
dark: DARKMODE_SPARKLINE_AREA_COLOR
|
|
649
|
+
},
|
|
650
|
+
prisma: JSON.stringify({
|
|
651
|
+
none: {
|
|
652
|
+
background: variables_exports.scp.gray52,
|
|
653
|
+
stroke: variables_exports.scp.white
|
|
1117
654
|
},
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
655
|
+
low: {
|
|
656
|
+
background: variables_exports.scp.successColorD50,
|
|
657
|
+
stroke: variables_exports.scp.white
|
|
658
|
+
},
|
|
659
|
+
guarded: {
|
|
660
|
+
background: variables_exports.scp.infoColorD50,
|
|
661
|
+
stroke: variables_exports.scp.white
|
|
662
|
+
},
|
|
663
|
+
elevated: {
|
|
664
|
+
background: variables_exports.scp.warningColorD50,
|
|
665
|
+
stroke: variables_exports.scp.white
|
|
666
|
+
},
|
|
667
|
+
high: {
|
|
668
|
+
background: variables_exports.scp.alertColorD50,
|
|
669
|
+
stroke: variables_exports.scp.white
|
|
670
|
+
},
|
|
671
|
+
severe: {
|
|
672
|
+
background: variables_exports.scp.errorColorD50,
|
|
673
|
+
stroke: variables_exports.scp.white
|
|
674
|
+
}
|
|
675
|
+
})
|
|
676
|
+
})(props)
|
|
1121
677
|
};
|
|
1122
|
-
var editorConfig = [
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
678
|
+
var editorConfig = [
|
|
679
|
+
{
|
|
680
|
+
label: (0, i18n_exports._)("Data configurations"),
|
|
681
|
+
layout: [
|
|
682
|
+
[
|
|
683
|
+
{
|
|
684
|
+
label: (0, i18n_exports._)("Value"),
|
|
685
|
+
editor: "editor.columnSelector",
|
|
686
|
+
option: "sparklineValues",
|
|
687
|
+
context: "sparklineValuesContext",
|
|
688
|
+
editorProps: {
|
|
689
|
+
dataSourceKey: "primary",
|
|
690
|
+
prepareValue: (definition) => {
|
|
691
|
+
const {
|
|
692
|
+
options: { sparklineValues }
|
|
693
|
+
} = definition;
|
|
694
|
+
return {
|
|
695
|
+
context: {},
|
|
696
|
+
options: {
|
|
697
|
+
majorValue: `> sparklineValues | lastPoint()`,
|
|
698
|
+
trendValue: `> sparklineValues | delta(-2)`,
|
|
699
|
+
sparklineValues
|
|
700
|
+
}
|
|
701
|
+
};
|
|
702
|
+
}
|
|
703
|
+
},
|
|
704
|
+
isDisabled: ({ options }) => options.splitByLayout === visualization_schemas_exports.LAYOUT_TYPE.Trellis
|
|
705
|
+
}
|
|
706
|
+
]
|
|
707
|
+
]
|
|
708
|
+
},
|
|
709
|
+
{
|
|
710
|
+
label: (0, i18n_exports._)("Data display"),
|
|
711
|
+
layout: [
|
|
712
|
+
...StaticMajorAndTrendLayout_default,
|
|
713
|
+
[
|
|
714
|
+
{
|
|
715
|
+
label: (0, i18n_exports._)("Trend display"),
|
|
716
|
+
option: "trendDisplay",
|
|
717
|
+
editor: "editor.select",
|
|
718
|
+
editorProps: {
|
|
719
|
+
values: [
|
|
720
|
+
{ label: (0, i18n_exports._)("Percent"), value: "percent" },
|
|
721
|
+
{ label: (0, i18n_exports._)("Absolute"), value: "absolute" },
|
|
722
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" }
|
|
723
|
+
]
|
|
724
|
+
},
|
|
725
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
726
|
+
},
|
|
727
|
+
{
|
|
728
|
+
label: (0, i18n_exports._)("Sparkline display"),
|
|
729
|
+
option: "sparklineDisplay",
|
|
730
|
+
editor: "editor.select",
|
|
731
|
+
editorProps: {
|
|
732
|
+
values: [
|
|
733
|
+
{ label: (0, i18n_exports._)("Off"), value: "off" },
|
|
734
|
+
{ label: (0, i18n_exports._)("Before"), value: "before" },
|
|
735
|
+
{ label: (0, i18n_exports._)("Below"), value: "below" },
|
|
736
|
+
{ label: (0, i18n_exports._)("After"), value: "after" }
|
|
737
|
+
]
|
|
1139
738
|
}
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
}
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
},
|
|
1249
|
-
placeholder: (0, i18n_1._)('Auto'),
|
|
1250
|
-
showEditor: function showEditor(_ref5) {
|
|
1251
|
-
var options = _ref5.options;
|
|
1252
|
-
return options.showValue || options.showValue === undefined;
|
|
1253
|
-
},
|
|
1254
|
-
isDisabled: function isDisabled(_ref6) {
|
|
1255
|
-
var options = _ref6.options;
|
|
1256
|
-
return options.trendDisplay === 'off';
|
|
1257
|
-
}
|
|
1258
|
-
}], [{
|
|
1259
|
-
label: (0, i18n_1._)('Major value abbreviation'),
|
|
1260
|
-
option: 'shouldAbbreviateMajorValue',
|
|
1261
|
-
editor: 'editor.checkbox'
|
|
1262
|
-
}], [{
|
|
1263
|
-
label: (0, i18n_1._)('Trend value abbreviation'),
|
|
1264
|
-
option: 'shouldAbbreviateTrendValue',
|
|
1265
|
-
editor: 'editor.checkbox'
|
|
1266
|
-
}], [{
|
|
1267
|
-
label: (0, i18n_1._)('Alignment'),
|
|
1268
|
-
editor: 'editor.radioBar',
|
|
1269
|
-
option: 'align',
|
|
1270
|
-
editorProps: {
|
|
1271
|
-
values: [{
|
|
1272
|
-
label: (0, i18n_1._)('Left'),
|
|
1273
|
-
value: 'left'
|
|
1274
|
-
}, {
|
|
1275
|
-
label: (0, i18n_1._)('Center'),
|
|
1276
|
-
value: 'center'
|
|
1277
|
-
}, {
|
|
1278
|
-
label: (0, i18n_1._)('Right'),
|
|
1279
|
-
value: 'right'
|
|
1280
|
-
}]
|
|
1281
|
-
},
|
|
1282
|
-
showEditor: function showEditor(_ref7) {
|
|
1283
|
-
var options = _ref7.options;
|
|
1284
|
-
return options.showValue || options.showValue === undefined;
|
|
1285
|
-
}
|
|
1286
|
-
}]]
|
|
1287
|
-
}];
|
|
1288
|
-
/**
|
|
1289
|
-
* visualization configuration
|
|
1290
|
-
*/
|
|
1291
|
-
|
|
739
|
+
}
|
|
740
|
+
],
|
|
741
|
+
...TrellisEditorConfig
|
|
742
|
+
]
|
|
743
|
+
},
|
|
744
|
+
{
|
|
745
|
+
label: (0, i18n_exports._)("Color and style"),
|
|
746
|
+
layout: [
|
|
747
|
+
[
|
|
748
|
+
{
|
|
749
|
+
label: (0, i18n_exports._)("Dynamic elements"),
|
|
750
|
+
key: "presetSelector",
|
|
751
|
+
editor: "editor.presetSelector",
|
|
752
|
+
editorProps: {
|
|
753
|
+
presets,
|
|
754
|
+
value: ({ context, options }) => {
|
|
755
|
+
const initialPreset = getInitialPreset(context, options, presets);
|
|
756
|
+
return initialPreset && initialPreset.label || null;
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
],
|
|
761
|
+
[
|
|
762
|
+
__spreadProps(__spreadValues({}, StaticMajorColorEditor_default), {
|
|
763
|
+
editorProps: {
|
|
764
|
+
themes
|
|
765
|
+
}
|
|
766
|
+
})
|
|
767
|
+
],
|
|
768
|
+
[getDynamicMajorColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
769
|
+
[
|
|
770
|
+
__spreadProps(__spreadValues({}, StaticTrendColorEditor_default), {
|
|
771
|
+
editorProps: {
|
|
772
|
+
themes
|
|
773
|
+
}
|
|
774
|
+
})
|
|
775
|
+
],
|
|
776
|
+
[getDynamicTrendColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
777
|
+
[
|
|
778
|
+
__spreadProps(__spreadValues({}, StaticBackgroundColorEditor_default), {
|
|
779
|
+
editorProps: {
|
|
780
|
+
themes
|
|
781
|
+
}
|
|
782
|
+
})
|
|
783
|
+
],
|
|
784
|
+
[
|
|
785
|
+
__spreadProps(__spreadValues({}, TrellisBackgroundColorEditor), {
|
|
786
|
+
editorProps: {
|
|
787
|
+
themes
|
|
788
|
+
}
|
|
789
|
+
})
|
|
790
|
+
],
|
|
791
|
+
[getDynamicBackgroundColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
792
|
+
[
|
|
793
|
+
{
|
|
794
|
+
label: (0, i18n_exports._)("Major value size (px)"),
|
|
795
|
+
option: "majorFontSize",
|
|
796
|
+
editor: "editor.number",
|
|
797
|
+
editorProps: {
|
|
798
|
+
min: 1
|
|
799
|
+
},
|
|
800
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
801
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
802
|
+
},
|
|
803
|
+
{
|
|
804
|
+
label: (0, i18n_exports._)("Trend value size (px)"),
|
|
805
|
+
option: "trendFontSize",
|
|
806
|
+
editor: "editor.number",
|
|
807
|
+
editorProps: {
|
|
808
|
+
min: 1
|
|
809
|
+
},
|
|
810
|
+
placeholder: (0, i18n_exports._)("Auto"),
|
|
811
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0,
|
|
812
|
+
isDisabled: ({ options }) => options.trendDisplay === "off"
|
|
813
|
+
}
|
|
814
|
+
],
|
|
815
|
+
[
|
|
816
|
+
{
|
|
817
|
+
label: (0, i18n_exports._)("Major value abbreviation"),
|
|
818
|
+
option: "shouldAbbreviateMajorValue",
|
|
819
|
+
editor: "editor.checkbox"
|
|
820
|
+
}
|
|
821
|
+
],
|
|
822
|
+
[
|
|
823
|
+
{
|
|
824
|
+
label: (0, i18n_exports._)("Trend value abbreviation"),
|
|
825
|
+
option: "shouldAbbreviateTrendValue",
|
|
826
|
+
editor: "editor.checkbox"
|
|
827
|
+
}
|
|
828
|
+
],
|
|
829
|
+
[
|
|
830
|
+
{
|
|
831
|
+
label: (0, i18n_exports._)("Alignment"),
|
|
832
|
+
editor: "editor.radioBar",
|
|
833
|
+
option: "align",
|
|
834
|
+
editorProps: {
|
|
835
|
+
values: [
|
|
836
|
+
{ label: (0, i18n_exports._)("Left"), value: "left" },
|
|
837
|
+
{ label: (0, i18n_exports._)("Center"), value: "center" },
|
|
838
|
+
{ label: (0, i18n_exports._)("Right"), value: "right" }
|
|
839
|
+
]
|
|
840
|
+
},
|
|
841
|
+
showEditor: ({ options }) => options.showValue || options.showValue === void 0
|
|
842
|
+
}
|
|
843
|
+
]
|
|
844
|
+
]
|
|
845
|
+
}
|
|
846
|
+
];
|
|
1292
847
|
var config = {
|
|
1293
848
|
/**
|
|
1294
849
|
* unique viz key
|
|
1295
850
|
*/
|
|
1296
|
-
key:
|
|
1297
|
-
|
|
851
|
+
key: "splunk.singlevalue",
|
|
1298
852
|
/**
|
|
1299
853
|
* viz name
|
|
1300
854
|
*/
|
|
1301
|
-
name: (0,
|
|
1302
|
-
category:
|
|
1303
|
-
|
|
855
|
+
name: (0, i18n_exports._)("Single value"),
|
|
856
|
+
category: "Single Value" /* SINGLE_VALUE */,
|
|
1304
857
|
/**
|
|
1305
858
|
* viz icon
|
|
1306
859
|
*/
|
|
1307
|
-
icon:
|
|
1308
|
-
placeholderIcon:
|
|
1309
|
-
dataContract
|
|
1310
|
-
size
|
|
1311
|
-
defaultContext
|
|
1312
|
-
optionsSchema:
|
|
1313
|
-
editorConfig
|
|
860
|
+
icon: visualization_icons_exports.SingleValue,
|
|
861
|
+
placeholderIcon: placeholders_exports.SingleValue,
|
|
862
|
+
dataContract,
|
|
863
|
+
size,
|
|
864
|
+
defaultContext,
|
|
865
|
+
optionsSchema: visualization_schemas_exports.singleValueOptionsSchema,
|
|
866
|
+
editorConfig,
|
|
1314
867
|
events: {
|
|
1315
|
-
|
|
1316
|
-
description:
|
|
1317
|
-
payloadKeys: [
|
|
868
|
+
"value.click": {
|
|
869
|
+
description: "trigger when user clicks major value",
|
|
870
|
+
payloadKeys: ["majorValue", "trendValue"]
|
|
1318
871
|
}
|
|
1319
872
|
},
|
|
1320
|
-
supports: [
|
|
1321
|
-
themes
|
|
1322
|
-
requiredProps: [
|
|
873
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */, "placeholder" /* PLACEHOLDER */, "trellis" /* TRELLIS */],
|
|
874
|
+
themes,
|
|
875
|
+
requiredProps: ["majorValue"]
|
|
1323
876
|
};
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
/***/ }),
|
|
1327
|
-
/* 67 */
|
|
1328
|
-
/***/ (function(module, exports) {
|
|
1329
|
-
|
|
1330
|
-
module.exports = require("@splunk/visualization-themes/variables");
|
|
1331
|
-
|
|
1332
|
-
/***/ })
|
|
1333
|
-
/******/ ]);
|
|
1334
|
-
//# sourceMappingURL=SingleValue.config.js.map
|
|
877
|
+
var config_default = enhanceConfig(config);
|
|
878
|
+
//# sourceMappingURL=SingleValue.config.js.map
|