@splunk/visualizations 25.13.1 → 26.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 +318 -234
- package/Area.config.js.map +1 -1
- package/Area.js +1131 -766
- package/Area.js.map +1 -1
- package/Bar.config.js +317 -233
- package/Bar.config.js.map +1 -1
- package/Bar.js +1007 -594
- package/Bar.js.map +1 -1
- package/Bubble.config.js +234 -160
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +912 -509
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +80 -29
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +691 -319
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +308 -223
- package/Column.config.js.map +1 -1
- package/Column.js +1011 -587
- package/Column.js.map +1 -1
- package/Ellipse.config.js +127 -62
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +576 -286
- package/Ellipse.js.map +1 -1
- package/Events.config.js +111 -29
- package/Events.config.js.map +1 -1
- package/Events.js +998 -527
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +142 -73
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +962 -572
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +70 -26
- package/Image.config.js.map +1 -1
- package/Image.js +524 -253
- package/Image.js.map +1 -1
- package/Line.config.js +326 -242
- package/Line.config.js.map +1 -1
- package/Line.js +1022 -606
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +99 -49
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +1184 -762
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +311 -167
- package/Map.config.js.map +1 -1
- package/Map.js +1479 -873
- package/Map.js.map +1 -1
- package/Markdown.config.js +93 -43
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +603 -332
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +163 -105
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +1025 -628
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +95 -41
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +993 -622
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +99 -46
- package/Pie.config.js.map +1 -1
- package/Pie.js +847 -442
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +114 -62
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +1097 -633
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +131 -65
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +580 -288
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +103 -41
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +1128 -586
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +231 -157
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +904 -504
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +212 -142
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1506 -956
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +294 -233
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +208 -138
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +1375 -914
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +252 -137
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +2194 -1069
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +172 -83
- package/SparkLine.js.map +1 -1
- package/Table.config.js +123 -70
- package/Table.config.js.map +1 -1
- package/Table.js +1094 -590
- package/Table.js.map +1 -1
- package/common/Charting.js +147 -75
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +91 -36
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +70 -60
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +45 -36
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +177 -86
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +65 -32
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +34 -7
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +10 -4
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +41 -28
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +56 -24
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +15 -5
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +238 -155
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +34 -16
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +59 -23
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +9 -4
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +5 -3
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +3 -2
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +370 -206
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +243 -198
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +36 -9
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +87 -26
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +4 -2
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +375 -193
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +25 -27
package/Rectangle.config.js
CHANGED
|
@@ -87,7 +87,7 @@ module.exports =
|
|
|
87
87
|
/******/
|
|
88
88
|
/******/
|
|
89
89
|
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s =
|
|
90
|
+
/******/ return __webpack_require__(__webpack_require__.s = 71);
|
|
91
91
|
/******/ })
|
|
92
92
|
/************************************************************************/
|
|
93
93
|
/******/ ({
|
|
@@ -131,6 +131,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
131
131
|
});
|
|
132
132
|
exports.VizBehavior = void 0;
|
|
133
133
|
var VizBehavior;
|
|
134
|
+
|
|
134
135
|
(function (VizBehavior) {
|
|
135
136
|
/**
|
|
136
137
|
* Dynamic Options Behavior.
|
|
@@ -150,6 +151,7 @@ var VizBehavior;
|
|
|
150
151
|
* missing.
|
|
151
152
|
* @type {string}
|
|
152
153
|
*/
|
|
154
|
+
|
|
153
155
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
154
156
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
155
157
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -171,7 +173,7 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
|
|
|
171
173
|
|
|
172
174
|
/***/ }),
|
|
173
175
|
|
|
174
|
-
/***/
|
|
176
|
+
/***/ 35:
|
|
175
177
|
/***/ (function(module, exports, __webpack_require__) {
|
|
176
178
|
|
|
177
179
|
"use strict";
|
|
@@ -181,49 +183,53 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
181
183
|
value: true
|
|
182
184
|
});
|
|
183
185
|
exports.getDynamicFillColorEditor = void 0;
|
|
186
|
+
|
|
184
187
|
var i18n_1 = __webpack_require__(0);
|
|
188
|
+
|
|
185
189
|
var configUtils_1 = __webpack_require__(5);
|
|
190
|
+
|
|
186
191
|
var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
|
|
187
192
|
var defaultContext = _ref.defaultContext,
|
|
188
|
-
|
|
193
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
189
194
|
return {
|
|
190
|
-
label: i18n_1._('Fill'),
|
|
195
|
+
label: (0, i18n_1._)('Fill'),
|
|
191
196
|
option: 'fillColor',
|
|
192
197
|
context: 'fillColorEditorConfig',
|
|
193
198
|
editor: 'editor.dynamicColor',
|
|
194
199
|
showEditor: function showEditor(_ref2) {
|
|
195
200
|
var options = _ref2.options;
|
|
196
|
-
return configUtils_1.isDynamicOption(options.fillColor);
|
|
201
|
+
return (0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
197
202
|
},
|
|
198
203
|
editorProps: {
|
|
199
204
|
labelPosition: 'top',
|
|
200
|
-
flyoutTitle: i18n_1._('Dynamic coloring: fill'),
|
|
205
|
+
flyoutTitle: (0, i18n_1._)('Dynamic coloring: fill'),
|
|
201
206
|
formatters: [{
|
|
202
|
-
label: i18n_1._('Ranges'),
|
|
207
|
+
label: (0, i18n_1._)('Ranges'),
|
|
203
208
|
value: 'rangeValue',
|
|
204
209
|
defaults: {
|
|
205
210
|
fillDataValue: defaultContext.fillColorConfig
|
|
206
211
|
}
|
|
207
212
|
}, {
|
|
208
|
-
label: i18n_1._('Matches'),
|
|
213
|
+
label: (0, i18n_1._)('Matches'),
|
|
209
214
|
value: 'matchValue',
|
|
210
215
|
defaults: {
|
|
211
216
|
fillDataValue: defaultContext.fillColorMatchConfig
|
|
212
217
|
}
|
|
213
218
|
}],
|
|
214
219
|
dataSelectors: [{
|
|
215
|
-
label: i18n_1._('Fill'),
|
|
220
|
+
label: (0, i18n_1._)('Fill'),
|
|
216
221
|
value: 'fillDataValue'
|
|
217
222
|
}],
|
|
218
223
|
defaultPalettesConfig: defaultPalettesConfig
|
|
219
224
|
}
|
|
220
225
|
};
|
|
221
226
|
};
|
|
227
|
+
|
|
222
228
|
exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
|
|
223
229
|
|
|
224
230
|
/***/ }),
|
|
225
231
|
|
|
226
|
-
/***/
|
|
232
|
+
/***/ 36:
|
|
227
233
|
/***/ (function(module, exports, __webpack_require__) {
|
|
228
234
|
|
|
229
235
|
"use strict";
|
|
@@ -233,49 +239,53 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
233
239
|
value: true
|
|
234
240
|
});
|
|
235
241
|
exports.getDynamicStrokeColorEditor = void 0;
|
|
242
|
+
|
|
236
243
|
var i18n_1 = __webpack_require__(0);
|
|
244
|
+
|
|
237
245
|
var configUtils_1 = __webpack_require__(5);
|
|
246
|
+
|
|
238
247
|
var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
|
|
239
248
|
var defaultContext = _ref.defaultContext,
|
|
240
|
-
|
|
249
|
+
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
241
250
|
return {
|
|
242
|
-
label: i18n_1._('Stroke'),
|
|
251
|
+
label: (0, i18n_1._)('Stroke'),
|
|
243
252
|
option: 'strokeColor',
|
|
244
253
|
context: 'strokeColorEditorConfig',
|
|
245
254
|
editor: 'editor.dynamicColor',
|
|
246
255
|
showEditor: function showEditor(_ref2) {
|
|
247
256
|
var options = _ref2.options;
|
|
248
|
-
return configUtils_1.isDynamicOption(options.strokeColor);
|
|
257
|
+
return (0, configUtils_1.isDynamicOption)(options.strokeColor);
|
|
249
258
|
},
|
|
250
259
|
editorProps: {
|
|
251
260
|
labelPosition: 'top',
|
|
252
|
-
flyoutTitle: i18n_1._('Dynamic coloring: stroke'),
|
|
261
|
+
flyoutTitle: (0, i18n_1._)('Dynamic coloring: stroke'),
|
|
253
262
|
formatters: [{
|
|
254
|
-
label: i18n_1._('Ranges'),
|
|
263
|
+
label: (0, i18n_1._)('Ranges'),
|
|
255
264
|
value: 'rangeValue',
|
|
256
265
|
defaults: {
|
|
257
266
|
strokeDataValue: defaultContext.strokeColorConfig
|
|
258
267
|
}
|
|
259
268
|
}, {
|
|
260
|
-
label: i18n_1._('Matches'),
|
|
269
|
+
label: (0, i18n_1._)('Matches'),
|
|
261
270
|
value: 'matchValue',
|
|
262
271
|
defaults: {
|
|
263
272
|
strokeDataValue: defaultContext.strokeColorMatchConfig
|
|
264
273
|
}
|
|
265
274
|
}],
|
|
266
275
|
dataSelectors: [{
|
|
267
|
-
label: i18n_1._('Stroke'),
|
|
276
|
+
label: (0, i18n_1._)('Stroke'),
|
|
268
277
|
value: 'strokeDataValue'
|
|
269
278
|
}],
|
|
270
279
|
defaultPalettesConfig: defaultPalettesConfig
|
|
271
280
|
}
|
|
272
281
|
};
|
|
273
282
|
};
|
|
283
|
+
|
|
274
284
|
exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
275
285
|
|
|
276
286
|
/***/ }),
|
|
277
287
|
|
|
278
|
-
/***/
|
|
288
|
+
/***/ 37:
|
|
279
289
|
/***/ (function(module, exports, __webpack_require__) {
|
|
280
290
|
|
|
281
291
|
"use strict";
|
|
@@ -284,22 +294,25 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
|
284
294
|
Object.defineProperty(exports, "__esModule", {
|
|
285
295
|
value: true
|
|
286
296
|
});
|
|
297
|
+
|
|
287
298
|
var i18n_1 = __webpack_require__(0);
|
|
299
|
+
|
|
288
300
|
var configUtils_1 = __webpack_require__(5);
|
|
301
|
+
|
|
289
302
|
var StaticFillColorEditor = {
|
|
290
|
-
label: i18n_1._('Fill'),
|
|
303
|
+
label: (0, i18n_1._)('Fill'),
|
|
291
304
|
option: 'fillColor',
|
|
292
305
|
editor: 'editor.color',
|
|
293
306
|
showEditor: function showEditor(_ref) {
|
|
294
307
|
var options = _ref.options;
|
|
295
|
-
return !configUtils_1.isDynamicOption(options.fillColor);
|
|
308
|
+
return !(0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
296
309
|
}
|
|
297
310
|
};
|
|
298
311
|
exports.default = StaticFillColorEditor;
|
|
299
312
|
|
|
300
313
|
/***/ }),
|
|
301
314
|
|
|
302
|
-
/***/
|
|
315
|
+
/***/ 38:
|
|
303
316
|
/***/ (function(module, exports, __webpack_require__) {
|
|
304
317
|
|
|
305
318
|
"use strict";
|
|
@@ -308,15 +321,18 @@ exports.default = StaticFillColorEditor;
|
|
|
308
321
|
Object.defineProperty(exports, "__esModule", {
|
|
309
322
|
value: true
|
|
310
323
|
});
|
|
324
|
+
|
|
311
325
|
var i18n_1 = __webpack_require__(0);
|
|
326
|
+
|
|
312
327
|
var configUtils_1 = __webpack_require__(5);
|
|
328
|
+
|
|
313
329
|
var StaticStrokeColorEditor = {
|
|
314
|
-
label: i18n_1._('Stroke'),
|
|
330
|
+
label: (0, i18n_1._)('Stroke'),
|
|
315
331
|
option: 'strokeColor',
|
|
316
332
|
editor: 'editor.color',
|
|
317
333
|
showEditor: function showEditor(_ref) {
|
|
318
334
|
var options = _ref.options;
|
|
319
|
-
return !configUtils_1.isDynamicOption(options.strokeColor);
|
|
335
|
+
return !(0, configUtils_1.isDynamicOption)(options.strokeColor);
|
|
320
336
|
}
|
|
321
337
|
};
|
|
322
338
|
exports.default = StaticStrokeColorEditor;
|
|
@@ -330,24 +346,33 @@ exports.default = StaticStrokeColorEditor;
|
|
|
330
346
|
|
|
331
347
|
|
|
332
348
|
var _toConsumableArray = __webpack_require__(1);
|
|
349
|
+
|
|
333
350
|
var _defineProperty = __webpack_require__(7);
|
|
351
|
+
|
|
334
352
|
var __rest = this && this.__rest || function (s, e) {
|
|
335
353
|
var t = {};
|
|
354
|
+
|
|
336
355
|
for (var p in s) {
|
|
337
356
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
338
357
|
}
|
|
358
|
+
|
|
339
359
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
340
360
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
341
361
|
}
|
|
342
362
|
return t;
|
|
343
363
|
};
|
|
364
|
+
|
|
344
365
|
Object.defineProperty(exports, "__esModule", {
|
|
345
366
|
value: true
|
|
346
367
|
});
|
|
347
368
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
369
|
+
|
|
348
370
|
var lodash_1 = __webpack_require__(6);
|
|
371
|
+
|
|
349
372
|
var schemaUtils_1 = __webpack_require__(3);
|
|
373
|
+
|
|
350
374
|
var VizBehavior_1 = __webpack_require__(2);
|
|
375
|
+
|
|
351
376
|
var dynamicOptionsDSLType = {
|
|
352
377
|
type: 'string',
|
|
353
378
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -357,20 +382,22 @@ var dynamicOptionsDSLType = {
|
|
|
357
382
|
* @param optionsSchema a visualization's options schema
|
|
358
383
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
359
384
|
*/
|
|
385
|
+
|
|
360
386
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
361
387
|
var enhancedOptionsSchema = {};
|
|
362
388
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
363
389
|
var _a = optionsSchema[key],
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
390
|
+
title = _a.title,
|
|
391
|
+
description = _a.description,
|
|
392
|
+
readOnly = _a.readOnly,
|
|
393
|
+
writeOnly = _a.writeOnly,
|
|
394
|
+
examples = _a.examples,
|
|
395
|
+
defaultValue = _a.default,
|
|
396
|
+
type = _a.type,
|
|
397
|
+
properties = _a.properties,
|
|
398
|
+
patternProperties = _a.patternProperties,
|
|
399
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
400
|
+
|
|
374
401
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
375
402
|
title: title
|
|
376
403
|
}), description !== undefined && {
|
|
@@ -384,12 +411,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
384
411
|
}), defaultValue !== undefined && {
|
|
385
412
|
default: defaultValue
|
|
386
413
|
});
|
|
414
|
+
|
|
387
415
|
if (type === 'object') {
|
|
388
416
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
389
417
|
type: type
|
|
390
418
|
}), properties && {
|
|
391
419
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
392
420
|
});
|
|
421
|
+
|
|
393
422
|
if (patternProperties) {
|
|
394
423
|
var enhancedPatternProperties = {};
|
|
395
424
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -407,6 +436,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
407
436
|
});
|
|
408
437
|
return enhancedOptionsSchema;
|
|
409
438
|
}
|
|
439
|
+
|
|
410
440
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
411
441
|
/**
|
|
412
442
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -415,11 +445,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
415
445
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
416
446
|
* and containing `open: false` for all editor panels in editorConfig
|
|
417
447
|
*/
|
|
448
|
+
|
|
418
449
|
function enhanceConfig(vizConfig) {
|
|
419
450
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
451
|
+
|
|
420
452
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
421
453
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
422
454
|
}
|
|
455
|
+
|
|
423
456
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
424
457
|
return Object.assign(Object.assign({}, config), {
|
|
425
458
|
open: config.open || false
|
|
@@ -427,6 +460,7 @@ function enhanceConfig(vizConfig) {
|
|
|
427
460
|
});
|
|
428
461
|
return enhancedConfig;
|
|
429
462
|
}
|
|
463
|
+
|
|
430
464
|
exports.enhanceConfig = enhanceConfig;
|
|
431
465
|
/**
|
|
432
466
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -434,6 +468,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
434
468
|
* @param vizConfig a Visualization Config
|
|
435
469
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
436
470
|
*/
|
|
471
|
+
|
|
437
472
|
function uncollapseEditorConfig(vizConfig) {
|
|
438
473
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
439
474
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -443,13 +478,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
443
478
|
});
|
|
444
479
|
return editorPanelUncollapsedConfig;
|
|
445
480
|
}
|
|
481
|
+
|
|
446
482
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
483
|
+
|
|
447
484
|
function isDynamicOption(option) {
|
|
448
485
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
449
486
|
}
|
|
450
|
-
|
|
451
|
-
// private helpers to improve readability of getInitialPreset
|
|
487
|
+
|
|
488
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
452
489
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
490
|
+
|
|
453
491
|
/**
|
|
454
492
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
455
493
|
* 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
|
|
@@ -458,6 +496,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
458
496
|
*
|
|
459
497
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
460
498
|
*/
|
|
499
|
+
|
|
461
500
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
462
501
|
var presetContextKeys = Object.keys(presetContext);
|
|
463
502
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -467,6 +506,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
467
506
|
/**
|
|
468
507
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
469
508
|
*/
|
|
509
|
+
|
|
510
|
+
|
|
470
511
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
471
512
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
472
513
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -481,18 +522,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
481
522
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
482
523
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
483
524
|
*/
|
|
525
|
+
|
|
526
|
+
|
|
484
527
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
485
528
|
return presets.find(function (preset) {
|
|
486
|
-
var presetContext = lodash_1.get(preset, ['value', 'context'], {});
|
|
487
|
-
var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
|
|
529
|
+
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
530
|
+
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
488
531
|
var presetContextKeys = Object.keys(presetContext);
|
|
489
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
490
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
532
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
491
533
|
// if not, then the preset is invalid in config.ts
|
|
534
|
+
|
|
492
535
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
493
536
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
494
537
|
});
|
|
495
538
|
}
|
|
539
|
+
|
|
496
540
|
exports.getInitialPreset = getInitialPreset;
|
|
497
541
|
/**
|
|
498
542
|
* generates number precision values for a Select editor
|
|
@@ -500,14 +544,16 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
500
544
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
501
545
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
502
546
|
*/
|
|
547
|
+
|
|
503
548
|
function generatePrecisionValues(numPrecisionValues) {
|
|
504
|
-
return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
|
|
549
|
+
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
505
550
|
return {
|
|
506
551
|
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
507
552
|
value: i
|
|
508
553
|
};
|
|
509
554
|
});
|
|
510
555
|
}
|
|
556
|
+
|
|
511
557
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
512
558
|
/**
|
|
513
559
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -517,12 +563,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
517
563
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
518
564
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
519
565
|
*/
|
|
566
|
+
|
|
520
567
|
var insertLayout = function insertLayout(layout, index) {
|
|
521
568
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
522
569
|
layoutItems[_key - 2] = arguments[_key];
|
|
523
570
|
}
|
|
571
|
+
|
|
524
572
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
525
573
|
};
|
|
574
|
+
|
|
526
575
|
exports.insertLayout = insertLayout;
|
|
527
576
|
|
|
528
577
|
/***/ }),
|
|
@@ -548,7 +597,7 @@ module.exports = require("@babel/runtime/helpers/defineProperty");
|
|
|
548
597
|
|
|
549
598
|
/***/ }),
|
|
550
599
|
|
|
551
|
-
/***/
|
|
600
|
+
/***/ 71:
|
|
552
601
|
/***/ (function(module, exports, __webpack_require__) {
|
|
553
602
|
|
|
554
603
|
"use strict";
|
|
@@ -558,18 +607,31 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
558
607
|
value: true
|
|
559
608
|
});
|
|
560
609
|
exports.optionsSchema = void 0;
|
|
610
|
+
|
|
561
611
|
var visualization_icons_1 = __webpack_require__(12);
|
|
612
|
+
|
|
562
613
|
var schemaUtils_1 = __webpack_require__(3);
|
|
614
|
+
|
|
563
615
|
var i18n_1 = __webpack_require__(0);
|
|
616
|
+
|
|
564
617
|
var PresetPalettes_1 = __webpack_require__(15);
|
|
618
|
+
|
|
565
619
|
var themes_1 = __webpack_require__(21);
|
|
620
|
+
|
|
566
621
|
var VizBehavior_1 = __webpack_require__(2);
|
|
622
|
+
|
|
567
623
|
var VizCategory_1 = __webpack_require__(8);
|
|
624
|
+
|
|
568
625
|
var configUtils_1 = __webpack_require__(4);
|
|
569
|
-
|
|
570
|
-
var
|
|
571
|
-
|
|
572
|
-
var
|
|
626
|
+
|
|
627
|
+
var DynamicFillColorEditor_1 = __webpack_require__(35);
|
|
628
|
+
|
|
629
|
+
var DynamicStrokeColorEditor_1 = __webpack_require__(36);
|
|
630
|
+
|
|
631
|
+
var StaticFillColorEditor_1 = __webpack_require__(37);
|
|
632
|
+
|
|
633
|
+
var StaticStrokeColorEditor_1 = __webpack_require__(38);
|
|
634
|
+
|
|
573
635
|
var dataContract = {
|
|
574
636
|
requiredDataSources: [],
|
|
575
637
|
optionalDataSources: [{
|
|
@@ -686,7 +748,7 @@ exports.optionsSchema = {
|
|
|
686
748
|
description: 'Specifies the shape to be used at the corners of paths when they are joined.',
|
|
687
749
|
type: 'string',
|
|
688
750
|
default: 'miter',
|
|
689
|
-
pattern: schemaUtils_1.getPattern(['arcs', 'bevel', 'miter', 'miter-clip', 'round'])
|
|
751
|
+
pattern: (0, schemaUtils_1.getPattern)(['arcs', 'bevel', 'miter', 'miter-clip', 'round'])
|
|
690
752
|
},
|
|
691
753
|
strokeOpacity: {
|
|
692
754
|
description: 'Specify the opacity of the stroke. Choose a number in the range of 0 - 1 (inclusive). You can also express the value as a percentage. For example, "0.80" in source or "80%" in UI.',
|
|
@@ -701,7 +763,7 @@ exports.optionsSchema = {
|
|
|
701
763
|
};
|
|
702
764
|
var themes = {
|
|
703
765
|
defaultFillColor: function defaultFillColor(props) {
|
|
704
|
-
return themes_1.pick({
|
|
766
|
+
return (0, themes_1.pick)({
|
|
705
767
|
enterprise: {
|
|
706
768
|
dark: themes_1.variables.gray25(props),
|
|
707
769
|
light: themes_1.variables.gray80(props)
|
|
@@ -710,7 +772,7 @@ var themes = {
|
|
|
710
772
|
})(props);
|
|
711
773
|
},
|
|
712
774
|
defaultStrokeColor: function defaultStrokeColor(props) {
|
|
713
|
-
return themes_1.pick({
|
|
775
|
+
return (0, themes_1.pick)({
|
|
714
776
|
enterprise: {
|
|
715
777
|
dark: themes_1.variables.gray80(props),
|
|
716
778
|
light: themes_1.variables.gray30(props)
|
|
@@ -729,14 +791,14 @@ var basePresetOptions = {
|
|
|
729
791
|
};
|
|
730
792
|
var presets = [{
|
|
731
793
|
// dummy context variables to allow for resetting of unused context states
|
|
732
|
-
label: i18n_1._('None'),
|
|
794
|
+
label: (0, i18n_1._)('None'),
|
|
733
795
|
name: 'rectangle.none',
|
|
734
796
|
value: {
|
|
735
797
|
context: Object.assign({}, basePresetContext),
|
|
736
798
|
options: Object.assign({}, basePresetOptions)
|
|
737
799
|
}
|
|
738
800
|
}, {
|
|
739
|
-
label: i18n_1._('Fill'),
|
|
801
|
+
label: (0, i18n_1._)('Fill'),
|
|
740
802
|
name: 'rectangle.fill',
|
|
741
803
|
value: {
|
|
742
804
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -748,7 +810,7 @@ var presets = [{
|
|
|
748
810
|
})
|
|
749
811
|
}
|
|
750
812
|
}, {
|
|
751
|
-
label: i18n_1._('Stroke'),
|
|
813
|
+
label: (0, i18n_1._)('Stroke'),
|
|
752
814
|
name: 'rectangle.stroke',
|
|
753
815
|
value: {
|
|
754
816
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -760,7 +822,7 @@ var presets = [{
|
|
|
760
822
|
})
|
|
761
823
|
}
|
|
762
824
|
}, {
|
|
763
|
-
label: i18n_1._('Fill and Stroke'),
|
|
825
|
+
label: (0, i18n_1._)('Fill and Stroke'),
|
|
764
826
|
name: 'rectangle.fillAndStroke',
|
|
765
827
|
value: {
|
|
766
828
|
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
@@ -776,17 +838,17 @@ var presets = [{
|
|
|
776
838
|
}
|
|
777
839
|
}];
|
|
778
840
|
var editorConfig = [{
|
|
779
|
-
label: i18n_1._('Color and style'),
|
|
841
|
+
label: (0, i18n_1._)('Color and style'),
|
|
780
842
|
layout: [[{
|
|
781
|
-
label: i18n_1._('Dynamic elements'),
|
|
843
|
+
label: (0, i18n_1._)('Dynamic elements'),
|
|
782
844
|
key: 'presetSelector',
|
|
783
845
|
editor: 'editor.presetSelector',
|
|
784
846
|
editorProps: {
|
|
785
847
|
presets: presets,
|
|
786
848
|
value: function value(_ref) {
|
|
787
849
|
var context = _ref.context,
|
|
788
|
-
|
|
789
|
-
var initialPreset = configUtils_1.getInitialPreset(context, options, presets);
|
|
850
|
+
options = _ref.options;
|
|
851
|
+
var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
|
|
790
852
|
return initialPreset && initialPreset.label || null;
|
|
791
853
|
}
|
|
792
854
|
}
|
|
@@ -794,46 +856,46 @@ var editorConfig = [{
|
|
|
794
856
|
editorProps: {
|
|
795
857
|
themes: themes
|
|
796
858
|
}
|
|
797
|
-
})], [DynamicFillColorEditor_1.getDynamicFillColorEditor({
|
|
859
|
+
})], [(0, DynamicFillColorEditor_1.getDynamicFillColorEditor)({
|
|
798
860
|
defaultContext: defaultContext,
|
|
799
861
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
800
862
|
})], [Object.assign(Object.assign({}, StaticStrokeColorEditor_1.default), {
|
|
801
863
|
editorProps: {
|
|
802
864
|
themes: themes
|
|
803
865
|
}
|
|
804
|
-
})], [DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor({
|
|
866
|
+
})], [(0, DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor)({
|
|
805
867
|
defaultContext: defaultContext,
|
|
806
868
|
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
807
869
|
})], [{
|
|
808
|
-
label: i18n_1._('Fill opacity (%)'),
|
|
870
|
+
label: (0, i18n_1._)('Fill opacity (%)'),
|
|
809
871
|
option: 'fillOpacity',
|
|
810
872
|
editor: 'editor.percent',
|
|
811
873
|
editorProps: {
|
|
812
874
|
min: 0
|
|
813
875
|
}
|
|
814
876
|
}, {
|
|
815
|
-
label: i18n_1._('Stroke opacity (%)'),
|
|
877
|
+
label: (0, i18n_1._)('Stroke opacity (%)'),
|
|
816
878
|
option: 'strokeOpacity',
|
|
817
879
|
editor: 'editor.percent',
|
|
818
880
|
editorProps: {
|
|
819
881
|
min: 0
|
|
820
882
|
}
|
|
821
883
|
}], [{
|
|
822
|
-
label: i18n_1._('Stroke width'),
|
|
884
|
+
label: (0, i18n_1._)('Stroke width'),
|
|
823
885
|
option: 'strokeWidth',
|
|
824
886
|
editor: 'editor.number',
|
|
825
887
|
editorProps: {
|
|
826
888
|
min: 0
|
|
827
889
|
}
|
|
828
890
|
}, {
|
|
829
|
-
label: i18n_1._('Stroke dash style'),
|
|
891
|
+
label: (0, i18n_1._)('Stroke dash style'),
|
|
830
892
|
option: 'strokeDashStyle',
|
|
831
893
|
editor: 'editor.number',
|
|
832
894
|
editorProps: {
|
|
833
895
|
min: 0
|
|
834
896
|
}
|
|
835
897
|
}], [{
|
|
836
|
-
label: i18n_1._('Radius (px)'),
|
|
898
|
+
label: (0, i18n_1._)('Radius (px)'),
|
|
837
899
|
option: 'rx',
|
|
838
900
|
editor: 'editor.number',
|
|
839
901
|
editorProps: {
|
|
@@ -844,16 +906,19 @@ var editorConfig = [{
|
|
|
844
906
|
/**
|
|
845
907
|
* visualization configuration
|
|
846
908
|
*/
|
|
909
|
+
|
|
847
910
|
var config = {
|
|
848
911
|
/**
|
|
849
912
|
* unique viz key
|
|
850
913
|
*/
|
|
851
914
|
key: 'splunk.rectangle',
|
|
915
|
+
|
|
852
916
|
/**
|
|
853
917
|
* viz name
|
|
854
918
|
*/
|
|
855
|
-
name: i18n_1._('Rectangle'),
|
|
919
|
+
name: (0, i18n_1._)('Rectangle'),
|
|
856
920
|
category: VizCategory_1.VizCategory.SHAPES,
|
|
921
|
+
|
|
857
922
|
/**
|
|
858
923
|
* viz icon
|
|
859
924
|
*/
|
|
@@ -872,7 +937,7 @@ var config = {
|
|
|
872
937
|
}
|
|
873
938
|
}
|
|
874
939
|
};
|
|
875
|
-
exports.default = configUtils_1.enhanceConfig(config);
|
|
940
|
+
exports.default = (0, configUtils_1.enhanceConfig)(config);
|
|
876
941
|
|
|
877
942
|
/***/ }),
|
|
878
943
|
|
|
@@ -887,6 +952,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
887
952
|
});
|
|
888
953
|
exports.VizCategory = void 0;
|
|
889
954
|
var VizCategory;
|
|
955
|
+
|
|
890
956
|
(function (VizCategory) {
|
|
891
957
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
892
958
|
VizCategory["TRENDS"] = "Trends";
|