@splunk/visualizations 26.0.0 → 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 +102 -18
- package/Area.config.js.map +1 -1
- package/Area.js +618 -221
- package/Area.js.map +1 -1
- package/Bar.config.js +104 -20
- package/Bar.config.js.map +1 -1
- package/Bar.js +624 -219
- package/Bar.js.map +1 -1
- package/Bubble.config.js +94 -20
- package/Bubble.config.js.map +1 -1
- package/Bubble.js +606 -211
- package/Bubble.js.map +1 -1
- package/ChoroplethSvg.config.js +65 -14
- package/ChoroplethSvg.config.js.map +1 -1
- package/ChoroplethSvg.js +550 -183
- package/ChoroplethSvg.js.map +1 -1
- package/Column.config.js +103 -18
- package/Column.config.js.map +1 -1
- package/Column.js +637 -221
- package/Column.js.map +1 -1
- package/Ellipse.config.js +82 -17
- package/Ellipse.config.js.map +1 -1
- package/Ellipse.js +425 -148
- package/Ellipse.js.map +1 -1
- package/Events.config.js +100 -18
- package/Events.config.js.map +1 -1
- package/Events.js +752 -293
- package/Events.js.map +1 -1
- package/FillerGauge.config.js +96 -27
- package/FillerGauge.config.js.map +1 -1
- package/FillerGauge.js +759 -374
- package/FillerGauge.js.map +1 -1
- package/Image.config.js +62 -18
- package/Image.config.js.map +1 -1
- package/Image.js +419 -154
- package/Image.js.map +1 -1
- package/Line.config.js +106 -22
- package/Line.config.js.map +1 -1
- package/Line.js +631 -223
- package/Line.js.map +1 -1
- package/LinkGraph.config.js +72 -22
- package/LinkGraph.config.js.map +1 -1
- package/LinkGraph.js +632 -219
- package/LinkGraph.js.map +1 -1
- package/MIGRATION.md +1082 -0
- package/Map.config.js +241 -97
- package/Map.config.js.map +1 -1
- package/Map.js +1195 -595
- package/Map.js.map +1 -1
- package/Markdown.config.js +70 -20
- package/Markdown.config.js.map +1 -1
- package/Markdown.js +460 -195
- package/Markdown.js.map +1 -1
- package/MarkerGauge.config.js +79 -21
- package/MarkerGauge.config.js.map +1 -1
- package/MarkerGauge.js +802 -411
- package/MarkerGauge.js.map +1 -1
- package/ParallelCoordinates.config.js +72 -18
- package/ParallelCoordinates.config.js.map +1 -1
- package/ParallelCoordinates.js +853 -484
- package/ParallelCoordinates.js.map +1 -1
- package/Pie.config.js +75 -22
- package/Pie.config.js.map +1 -1
- package/Pie.js +612 -212
- package/Pie.js.map +1 -1
- package/Punchcard.config.js +81 -29
- package/Punchcard.config.js.map +1 -1
- package/Punchcard.js +844 -379
- package/Punchcard.js.map +1 -1
- package/Rectangle.config.js +85 -19
- package/Rectangle.config.js.map +1 -1
- package/Rectangle.js +432 -152
- package/Rectangle.js.map +1 -1
- package/Sankey.config.js +84 -22
- package/Sankey.config.js.map +1 -1
- package/Sankey.js +878 -342
- package/Sankey.js.map +1 -1
- package/Scatter.config.js +96 -22
- package/Scatter.config.js.map +1 -1
- package/Scatter.js +607 -212
- package/Scatter.js.map +1 -1
- package/SingleValue.config.js +94 -24
- package/SingleValue.config.js.map +1 -1
- package/SingleValue.js +1182 -650
- package/SingleValue.js.map +1 -1
- package/SingleValueBasic.js +286 -225
- package/SingleValueBasic.js.map +1 -1
- package/SingleValueIcon.config.js +92 -22
- package/SingleValueIcon.config.js.map +1 -1
- package/SingleValueIcon.js +965 -506
- package/SingleValueIcon.js.map +1 -1
- package/SingleValueRadial.config.js +99 -26
- package/SingleValueRadial.config.js.map +1 -1
- package/SingleValueRadial.js +1167 -616
- package/SingleValueRadial.js.map +1 -1
- package/SparkLine.js +126 -67
- package/SparkLine.js.map +1 -1
- package/Table.config.js +73 -20
- package/Table.config.js.map +1 -1
- package/Table.js +810 -322
- package/Table.js.map +1 -1
- package/common/Charting.js +107 -35
- package/common/Charting.js.map +1 -1
- package/common/ChartingApi.js +18 -7
- package/common/ChartingApi.js.map +1 -1
- package/common/EventsDoc.js +76 -22
- package/common/EventsDoc.js.map +1 -1
- package/common/GaugeMajorTicks.js +68 -58
- package/common/GaugeMajorTicks.js.map +1 -1
- package/common/GaugeValueMarker.js +43 -34
- package/common/GaugeValueMarker.js.map +1 -1
- package/common/OptionsDoc.js +156 -65
- package/common/OptionsDoc.js.map +1 -1
- package/common/OverviewDoc.js +33 -5
- package/common/OverviewDoc.js.map +1 -1
- package/common/SplunkVisualization.js +31 -4
- package/common/SplunkVisualization.js.map +1 -1
- package/common/SplunkVisualizationApi.js +8 -2
- package/common/SplunkVisualizationApi.js.map +1 -1
- package/common/ThemesDoc.js +27 -14
- package/common/ThemesDoc.js.map +1 -1
- package/common/chartingUtils.js +44 -12
- package/common/chartingUtils.js.map +1 -1
- package/common/docUtils.js +11 -1
- package/common/docUtils.js.map +1 -1
- package/common/gaugeUtils.js +173 -90
- package/common/gaugeUtils.js.map +1 -1
- package/common/shapeUtils.js +14 -2
- package/common/shapeUtils.js.map +1 -1
- package/common/utils/configUtils.js +49 -14
- package/common/utils/configUtils.js.map +1 -1
- package/common/utils/dataUtils.js +7 -2
- package/common/utils/dataUtils.js.map +1 -1
- package/common/utils/hocUtils.js +3 -1
- package/common/utils/hocUtils.js.map +1 -1
- package/common/utils/layoutUtils.js +1 -0
- package/common/utils/layoutUtils.js.map +1 -1
- package/common/utils/mapUtils.js +287 -127
- package/common/utils/mapUtils.js.map +1 -1
- package/common/utils/singleValueUtils.js +241 -196
- package/common/utils/singleValueUtils.js.map +1 -1
- package/common/utils/testHelper.js +9 -0
- package/common/utils/testHelper.js.map +1 -1
- package/common/utils/trellisUtils.js +61 -0
- package/common/utils/trellisUtils.js.map +1 -1
- package/common/utils/urlUtils.js +2 -0
- package/common/utils/urlUtils.js.map +1 -1
- package/common/withDashboardViz.js +274 -95
- package/common/withDashboardViz.js.map +1 -1
- package/package.json +16 -18
package/Line.js
CHANGED
|
@@ -133,6 +133,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
133
133
|
});
|
|
134
134
|
exports.VizBehavior = void 0;
|
|
135
135
|
var VizBehavior;
|
|
136
|
+
|
|
136
137
|
(function (VizBehavior) {
|
|
137
138
|
/**
|
|
138
139
|
* Dynamic Options Behavior.
|
|
@@ -152,6 +153,7 @@ var VizBehavior;
|
|
|
152
153
|
* missing.
|
|
153
154
|
* @type {string}
|
|
154
155
|
*/
|
|
156
|
+
|
|
155
157
|
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
156
158
|
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
157
159
|
VizBehavior["TRELLIS"] = "trellis";
|
|
@@ -203,11 +205,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
|
|
|
203
205
|
Object.defineProperty(exports, "__esModule", {
|
|
204
206
|
value: true
|
|
205
207
|
});
|
|
208
|
+
|
|
206
209
|
var React = __webpack_require__(1);
|
|
210
|
+
|
|
207
211
|
var styled_components_1 = __webpack_require__(4);
|
|
212
|
+
|
|
208
213
|
var SizeAwareWrapper_1 = __webpack_require__(19);
|
|
214
|
+
|
|
209
215
|
var style_1 = __webpack_require__(14);
|
|
216
|
+
|
|
210
217
|
var colorUtils_1 = __webpack_require__(12);
|
|
218
|
+
|
|
211
219
|
var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
212
220
|
var width = _ref.width;
|
|
213
221
|
return {
|
|
@@ -220,11 +228,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
|
|
|
220
228
|
componentId: "sc-1yhgpod-0"
|
|
221
229
|
})(["position:relative;background-color:", "};"], function (props) {
|
|
222
230
|
return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
|
|
223
|
-
});
|
|
224
|
-
|
|
231
|
+
}); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
|
|
232
|
+
|
|
225
233
|
var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
|
|
226
234
|
var width = _ref2.width,
|
|
227
|
-
|
|
235
|
+
height = _ref2.height;
|
|
228
236
|
return {
|
|
229
237
|
style: Object.assign(Object.assign({}, width && {
|
|
230
238
|
width: (0, style_1.toPx)(width)
|
|
@@ -246,11 +254,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
|
|
|
246
254
|
displayName: "FixedSizeContainer__FixSizeItemContent",
|
|
247
255
|
componentId: "sc-1yhgpod-3"
|
|
248
256
|
})(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
|
|
257
|
+
|
|
249
258
|
var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
250
259
|
var FixedSizeContainer = function FixedSizeContainer(props) {
|
|
251
260
|
var width = props.width,
|
|
252
|
-
|
|
253
|
-
|
|
261
|
+
height = props.height,
|
|
262
|
+
backgroundColor = props.backgroundColor;
|
|
263
|
+
|
|
254
264
|
if (!height) {
|
|
255
265
|
return React.createElement(Item, {
|
|
256
266
|
"data-test": "item",
|
|
@@ -258,24 +268,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
|
|
|
258
268
|
backgroundColor: backgroundColor
|
|
259
269
|
}, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
|
|
260
270
|
}
|
|
271
|
+
|
|
261
272
|
return React.createElement(FixSizeItem, {
|
|
262
273
|
"data-test": "fix-size-item",
|
|
263
|
-
"data-splunk-visualization-version": "26.
|
|
274
|
+
"data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
|
|
264
275
|
width: width,
|
|
265
276
|
height: height,
|
|
266
277
|
backgroundColor: backgroundColor
|
|
267
278
|
}, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
|
|
268
279
|
var newWidth = _ref3.width,
|
|
269
|
-
|
|
280
|
+
newHeight = _ref3.height;
|
|
270
281
|
return React.createElement(Viz, Object.assign({}, props, {
|
|
271
282
|
width: newWidth,
|
|
272
283
|
height: newHeight
|
|
273
284
|
}));
|
|
274
285
|
})));
|
|
275
286
|
};
|
|
287
|
+
|
|
276
288
|
FixedSizeContainer.displayName = 'withFixedSizeContainer';
|
|
277
289
|
return FixedSizeContainer;
|
|
278
290
|
};
|
|
291
|
+
|
|
279
292
|
exports.default = withFixedSizeContainer;
|
|
280
293
|
|
|
281
294
|
/***/ }),
|
|
@@ -301,9 +314,10 @@ exports.extendStaticWrapperProps = void 0;
|
|
|
301
314
|
* @param {DashboardVizType} props.Wrapper
|
|
302
315
|
* @param {DashboardVizType} props.Visualization
|
|
303
316
|
*/
|
|
317
|
+
|
|
304
318
|
var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
305
319
|
var Wrapper = _ref.Wrapper,
|
|
306
|
-
|
|
320
|
+
Visualization = _ref.Visualization;
|
|
307
321
|
var extendProperties = ['propTypes', 'defaultProps', 'config'];
|
|
308
322
|
extendProperties.forEach(function (prop) {
|
|
309
323
|
if (Visualization[prop]) {
|
|
@@ -312,6 +326,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
|
|
|
312
326
|
}
|
|
313
327
|
});
|
|
314
328
|
};
|
|
329
|
+
|
|
315
330
|
exports.extendStaticWrapperProps = extendStaticWrapperProps;
|
|
316
331
|
|
|
317
332
|
/***/ }),
|
|
@@ -346,24 +361,33 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
|
|
|
346
361
|
|
|
347
362
|
|
|
348
363
|
var _toConsumableArray = __webpack_require__(8);
|
|
364
|
+
|
|
349
365
|
var _defineProperty = __webpack_require__(7);
|
|
366
|
+
|
|
350
367
|
var __rest = this && this.__rest || function (s, e) {
|
|
351
368
|
var t = {};
|
|
369
|
+
|
|
352
370
|
for (var p in s) {
|
|
353
371
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
354
372
|
}
|
|
373
|
+
|
|
355
374
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
356
375
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
357
376
|
}
|
|
358
377
|
return t;
|
|
359
378
|
};
|
|
379
|
+
|
|
360
380
|
Object.defineProperty(exports, "__esModule", {
|
|
361
381
|
value: true
|
|
362
382
|
});
|
|
363
383
|
exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
|
|
384
|
+
|
|
364
385
|
var lodash_1 = __webpack_require__(3);
|
|
386
|
+
|
|
365
387
|
var schemaUtils_1 = __webpack_require__(16);
|
|
388
|
+
|
|
366
389
|
var VizBehavior_1 = __webpack_require__(6);
|
|
390
|
+
|
|
367
391
|
var dynamicOptionsDSLType = {
|
|
368
392
|
type: 'string',
|
|
369
393
|
pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
|
|
@@ -373,20 +397,22 @@ var dynamicOptionsDSLType = {
|
|
|
373
397
|
* @param optionsSchema a visualization's options schema
|
|
374
398
|
* @returns an updated options schema that additionally allows strings starting with > for each option
|
|
375
399
|
*/
|
|
400
|
+
|
|
376
401
|
function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
377
402
|
var enhancedOptionsSchema = {};
|
|
378
403
|
Object.keys(optionsSchema).forEach(function (key) {
|
|
379
404
|
var _a = optionsSchema[key],
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
405
|
+
title = _a.title,
|
|
406
|
+
description = _a.description,
|
|
407
|
+
readOnly = _a.readOnly,
|
|
408
|
+
writeOnly = _a.writeOnly,
|
|
409
|
+
examples = _a.examples,
|
|
410
|
+
defaultValue = _a.default,
|
|
411
|
+
type = _a.type,
|
|
412
|
+
properties = _a.properties,
|
|
413
|
+
patternProperties = _a.patternProperties,
|
|
414
|
+
remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
|
|
415
|
+
|
|
390
416
|
var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
|
|
391
417
|
title: title
|
|
392
418
|
}), description !== undefined && {
|
|
@@ -400,12 +426,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
400
426
|
}), defaultValue !== undefined && {
|
|
401
427
|
default: defaultValue
|
|
402
428
|
});
|
|
429
|
+
|
|
403
430
|
if (type === 'object') {
|
|
404
431
|
enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
|
|
405
432
|
type: type
|
|
406
433
|
}), properties && {
|
|
407
434
|
properties: enhanceOptionsSchemaWithDynamicOptions(properties)
|
|
408
435
|
});
|
|
436
|
+
|
|
409
437
|
if (patternProperties) {
|
|
410
438
|
var enhancedPatternProperties = {};
|
|
411
439
|
Object.keys(patternProperties).forEach(function (opt) {
|
|
@@ -423,6 +451,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
|
|
|
423
451
|
});
|
|
424
452
|
return enhancedOptionsSchema;
|
|
425
453
|
}
|
|
454
|
+
|
|
426
455
|
exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
|
|
427
456
|
/**
|
|
428
457
|
* Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
|
|
@@ -431,11 +460,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
|
|
|
431
460
|
* @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
|
|
432
461
|
* and containing `open: false` for all editor panels in editorConfig
|
|
433
462
|
*/
|
|
463
|
+
|
|
434
464
|
function enhanceConfig(vizConfig) {
|
|
435
465
|
var enhancedConfig = Object.assign({}, vizConfig);
|
|
466
|
+
|
|
436
467
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
|
|
437
468
|
enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
|
|
438
469
|
}
|
|
470
|
+
|
|
439
471
|
enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
440
472
|
return Object.assign(Object.assign({}, config), {
|
|
441
473
|
open: config.open || false
|
|
@@ -443,6 +475,7 @@ function enhanceConfig(vizConfig) {
|
|
|
443
475
|
});
|
|
444
476
|
return enhancedConfig;
|
|
445
477
|
}
|
|
478
|
+
|
|
446
479
|
exports.enhanceConfig = enhanceConfig;
|
|
447
480
|
/**
|
|
448
481
|
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
@@ -450,6 +483,7 @@ exports.enhanceConfig = enhanceConfig;
|
|
|
450
483
|
* @param vizConfig a Visualization Config
|
|
451
484
|
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
452
485
|
*/
|
|
486
|
+
|
|
453
487
|
function uncollapseEditorConfig(vizConfig) {
|
|
454
488
|
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
455
489
|
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
@@ -459,13 +493,16 @@ function uncollapseEditorConfig(vizConfig) {
|
|
|
459
493
|
});
|
|
460
494
|
return editorPanelUncollapsedConfig;
|
|
461
495
|
}
|
|
496
|
+
|
|
462
497
|
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
498
|
+
|
|
463
499
|
function isDynamicOption(option) {
|
|
464
500
|
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
465
501
|
}
|
|
466
|
-
|
|
467
|
-
// private helpers to improve readability of getInitialPreset
|
|
502
|
+
|
|
503
|
+
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
468
504
|
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
505
|
+
|
|
469
506
|
/**
|
|
470
507
|
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
471
508
|
* if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
|
|
@@ -474,6 +511,7 @@ exports.isDynamicOption = isDynamicOption;
|
|
|
474
511
|
*
|
|
475
512
|
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
476
513
|
*/
|
|
514
|
+
|
|
477
515
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
478
516
|
var presetContextKeys = Object.keys(presetContext);
|
|
479
517
|
return presetContextKeys.every(function (contextKey) {
|
|
@@ -483,6 +521,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
|
|
|
483
521
|
/**
|
|
484
522
|
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
485
523
|
*/
|
|
524
|
+
|
|
525
|
+
|
|
486
526
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
487
527
|
var presetOptionKeys = Object.keys(presetOptions);
|
|
488
528
|
return presetOptionKeys.every(function (optionKey) {
|
|
@@ -497,18 +537,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
|
497
537
|
* @param {Object} vizOptions - the current vizOptions definition
|
|
498
538
|
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
499
539
|
*/
|
|
540
|
+
|
|
541
|
+
|
|
500
542
|
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
501
543
|
return presets.find(function (preset) {
|
|
502
544
|
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
503
545
|
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
504
546
|
var presetContextKeys = Object.keys(presetContext);
|
|
505
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
506
|
-
// all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
547
|
+
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
507
548
|
// if not, then the preset is invalid in config.ts
|
|
549
|
+
|
|
508
550
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
509
551
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
510
552
|
});
|
|
511
553
|
}
|
|
554
|
+
|
|
512
555
|
exports.getInitialPreset = getInitialPreset;
|
|
513
556
|
/**
|
|
514
557
|
* generates number precision values for a Select editor
|
|
@@ -516,6 +559,7 @@ exports.getInitialPreset = getInitialPreset;
|
|
|
516
559
|
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
517
560
|
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
518
561
|
*/
|
|
562
|
+
|
|
519
563
|
function generatePrecisionValues(numPrecisionValues) {
|
|
520
564
|
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
521
565
|
return {
|
|
@@ -524,6 +568,7 @@ function generatePrecisionValues(numPrecisionValues) {
|
|
|
524
568
|
};
|
|
525
569
|
});
|
|
526
570
|
}
|
|
571
|
+
|
|
527
572
|
exports.generatePrecisionValues = generatePrecisionValues;
|
|
528
573
|
/**
|
|
529
574
|
* insert layout in layout array, return a new layout array instead of updating the original
|
|
@@ -533,12 +578,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
|
|
|
533
578
|
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
534
579
|
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
535
580
|
*/
|
|
581
|
+
|
|
536
582
|
var insertLayout = function insertLayout(layout, index) {
|
|
537
583
|
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
538
584
|
layoutItems[_key - 2] = arguments[_key];
|
|
539
585
|
}
|
|
586
|
+
|
|
540
587
|
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
541
588
|
};
|
|
589
|
+
|
|
542
590
|
exports.insertLayout = insertLayout;
|
|
543
591
|
|
|
544
592
|
/***/ }),
|
|
@@ -603,11 +651,17 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
603
651
|
value: true
|
|
604
652
|
});
|
|
605
653
|
exports.shouldShowIconPlaceholder = void 0;
|
|
654
|
+
|
|
606
655
|
var React = __webpack_require__(1);
|
|
656
|
+
|
|
607
657
|
var T = __webpack_require__(0);
|
|
658
|
+
|
|
608
659
|
var lodash_1 = __webpack_require__(3);
|
|
660
|
+
|
|
609
661
|
var i18n_1 = __webpack_require__(2);
|
|
662
|
+
|
|
610
663
|
var Message_1 = __webpack_require__(10);
|
|
664
|
+
|
|
611
665
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
612
666
|
/**
|
|
613
667
|
* @method shouldShowIconPlaceholder
|
|
@@ -615,6 +669,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
|
|
|
615
669
|
* @param {boolean} loading
|
|
616
670
|
* @returns {boolean}
|
|
617
671
|
*/
|
|
672
|
+
|
|
673
|
+
|
|
618
674
|
var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
|
|
619
675
|
var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
620
676
|
var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
|
|
@@ -623,6 +679,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
|
|
|
623
679
|
var noFields = fields === undefined;
|
|
624
680
|
return loading || noData || noFields;
|
|
625
681
|
};
|
|
682
|
+
|
|
626
683
|
exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
|
|
627
684
|
var propTypes = {
|
|
628
685
|
icon: T.func,
|
|
@@ -637,11 +694,13 @@ var propTypes = {
|
|
|
637
694
|
* @param {IconPlaceholderProps} props
|
|
638
695
|
* @returns {React.ReactElement}
|
|
639
696
|
*/
|
|
697
|
+
|
|
640
698
|
var IconPlaceholder = function IconPlaceholder(props) {
|
|
641
699
|
var width = props.width,
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
700
|
+
height = props.height,
|
|
701
|
+
icon = props.icon,
|
|
702
|
+
iconColor = props.iconColor;
|
|
703
|
+
|
|
645
704
|
if (icon) {
|
|
646
705
|
return React.createElement(icon, {
|
|
647
706
|
style: {
|
|
@@ -656,6 +715,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
656
715
|
height: '50%'
|
|
657
716
|
});
|
|
658
717
|
}
|
|
718
|
+
|
|
659
719
|
return React.createElement(Message_1.default, {
|
|
660
720
|
width: width,
|
|
661
721
|
height: height,
|
|
@@ -663,6 +723,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
|
|
|
663
723
|
message: (0, i18n_1._)('No DataSource Connected')
|
|
664
724
|
});
|
|
665
725
|
};
|
|
726
|
+
|
|
666
727
|
IconPlaceholder.propTypes = propTypes;
|
|
667
728
|
IconPlaceholder.defaultProps = {
|
|
668
729
|
width: '100%',
|
|
@@ -678,21 +739,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
|
|
|
678
739
|
|
|
679
740
|
|
|
680
741
|
var _defineProperty = __webpack_require__(7);
|
|
742
|
+
|
|
681
743
|
Object.defineProperty(exports, "__esModule", {
|
|
682
744
|
value: true
|
|
683
745
|
});
|
|
684
746
|
exports.getSortingParams = exports.SortParamsPropTypes = void 0;
|
|
747
|
+
|
|
685
748
|
var T = __webpack_require__(0);
|
|
749
|
+
|
|
686
750
|
var lodash_1 = __webpack_require__(3);
|
|
687
|
-
|
|
751
|
+
|
|
752
|
+
var DataSource_1 = __webpack_require__(34);
|
|
753
|
+
|
|
688
754
|
exports.SortParamsPropTypes = T.shape({
|
|
689
755
|
currentSortKey: T.string,
|
|
690
756
|
currentSortDir: T.oneOf(DataSource_1.validSortDirs),
|
|
691
757
|
onSort: T.func
|
|
692
758
|
});
|
|
759
|
+
|
|
693
760
|
var getSortingParams = function getSortingParams(_ref) {
|
|
694
761
|
var requestParams = _ref.requestParams,
|
|
695
|
-
|
|
762
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
696
763
|
var currentSortKey;
|
|
697
764
|
var currentSortDir;
|
|
698
765
|
var nextSortDirMap = {
|
|
@@ -701,15 +768,18 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
701
768
|
none: 'asc'
|
|
702
769
|
};
|
|
703
770
|
var onSort;
|
|
771
|
+
|
|
704
772
|
if (typeof onRequestParamsChange === 'function') {
|
|
705
773
|
if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
|
|
706
774
|
currentSortKey = Object.keys(requestParams.sort).shift();
|
|
707
775
|
currentSortDir = requestParams.sort[currentSortKey];
|
|
708
|
-
}
|
|
709
|
-
|
|
776
|
+
} // undid memoization since there is a dependency on requestParams, which is a deeply nested object
|
|
777
|
+
|
|
778
|
+
|
|
710
779
|
onSort = function onSort(e, _ref2) {
|
|
711
780
|
var sortKey = _ref2.sortKey,
|
|
712
|
-
|
|
781
|
+
sortDir = _ref2.sortDir;
|
|
782
|
+
|
|
713
783
|
if (typeof sortKey === 'string') {
|
|
714
784
|
var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
|
|
715
785
|
onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
|
|
@@ -721,12 +791,14 @@ var getSortingParams = function getSortingParams(_ref) {
|
|
|
721
791
|
}
|
|
722
792
|
};
|
|
723
793
|
}
|
|
794
|
+
|
|
724
795
|
return {
|
|
725
796
|
currentSortKey: currentSortKey,
|
|
726
797
|
currentSortDir: currentSortDir,
|
|
727
798
|
onSort: onSort
|
|
728
799
|
};
|
|
729
800
|
};
|
|
801
|
+
|
|
730
802
|
exports.getSortingParams = getSortingParams;
|
|
731
803
|
|
|
732
804
|
/***/ }),
|
|
@@ -736,43 +808,68 @@ exports.getSortingParams = getSortingParams;
|
|
|
736
808
|
"use strict";
|
|
737
809
|
|
|
738
810
|
|
|
811
|
+
Object.defineProperty(exports, "__esModule", {
|
|
812
|
+
value: true
|
|
813
|
+
});
|
|
814
|
+
exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
|
|
815
|
+
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
816
|
+
exports.validSegmentationModes = ['none', 'inner'];
|
|
817
|
+
exports.validOutputModes = ['json_cols', 'json'];
|
|
818
|
+
|
|
819
|
+
/***/ }),
|
|
820
|
+
/* 35 */
|
|
821
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
822
|
+
|
|
823
|
+
"use strict";
|
|
824
|
+
|
|
825
|
+
|
|
739
826
|
Object.defineProperty(exports, "__esModule", {
|
|
740
827
|
value: true
|
|
741
828
|
});
|
|
742
829
|
exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
|
|
830
|
+
|
|
743
831
|
var T = __webpack_require__(0);
|
|
832
|
+
|
|
744
833
|
var lodash_1 = __webpack_require__(3);
|
|
834
|
+
|
|
745
835
|
exports.PaginatorParamsPropTypes = T.shape({
|
|
746
836
|
isPaging: T.bool,
|
|
747
837
|
current: T.number,
|
|
748
838
|
totalPages: T.number,
|
|
749
839
|
onChange: T.func
|
|
750
840
|
});
|
|
841
|
+
|
|
751
842
|
var getPaginationParams = function getPaginationParams(_ref) {
|
|
752
843
|
var requestParams = _ref.requestParams,
|
|
753
|
-
|
|
754
|
-
|
|
844
|
+
meta = _ref.meta,
|
|
845
|
+
onRequestParamsChange = _ref.onRequestParamsChange;
|
|
755
846
|
var totalCount = meta && meta.totalCount || 0;
|
|
756
847
|
var offset = requestParams && requestParams.offset || 0;
|
|
757
848
|
var count = requestParams && requestParams.count;
|
|
758
849
|
var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
|
|
759
850
|
var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
|
|
760
851
|
var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
|
|
852
|
+
|
|
761
853
|
var onChangeHandler = function onChangeHandler(e, _ref2) {
|
|
762
854
|
var page = _ref2.page,
|
|
763
|
-
|
|
855
|
+
countArg = _ref2.count;
|
|
764
856
|
var newParams = (0, lodash_1.cloneDeep)(requestParams);
|
|
857
|
+
|
|
765
858
|
if (typeof countArg === 'number') {
|
|
766
859
|
newParams.count = countArg;
|
|
767
860
|
newParams.offset = 0;
|
|
768
861
|
}
|
|
862
|
+
|
|
769
863
|
var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
|
|
864
|
+
|
|
770
865
|
if (typeof page === 'number' && page > 0) {
|
|
771
866
|
newParams.count = pageCount;
|
|
772
867
|
newParams.offset = (page - 1) * pageCount;
|
|
773
868
|
}
|
|
869
|
+
|
|
774
870
|
onRequestParamsChange(newParams);
|
|
775
871
|
};
|
|
872
|
+
|
|
776
873
|
return {
|
|
777
874
|
isPaging: isPaging,
|
|
778
875
|
current: current,
|
|
@@ -780,10 +877,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
|
|
|
780
877
|
onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
|
|
781
878
|
};
|
|
782
879
|
};
|
|
880
|
+
|
|
783
881
|
exports.getPaginationParams = getPaginationParams;
|
|
784
882
|
|
|
785
883
|
/***/ }),
|
|
786
|
-
/*
|
|
884
|
+
/* 36 */
|
|
787
885
|
/***/ (function(module, exports, __webpack_require__) {
|
|
788
886
|
|
|
789
887
|
"use strict";
|
|
@@ -794,6 +892,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
794
892
|
});
|
|
795
893
|
exports.VizCategory = void 0;
|
|
796
894
|
var VizCategory;
|
|
895
|
+
|
|
797
896
|
(function (VizCategory) {
|
|
798
897
|
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
799
898
|
VizCategory["TRENDS"] = "Trends";
|
|
@@ -810,67 +909,96 @@ var VizCategory;
|
|
|
810
909
|
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
811
910
|
|
|
812
911
|
/***/ }),
|
|
813
|
-
/*
|
|
912
|
+
/* 37 */
|
|
814
913
|
/***/ (function(module, exports, __webpack_require__) {
|
|
815
914
|
|
|
816
915
|
"use strict";
|
|
817
916
|
|
|
818
917
|
|
|
819
918
|
var _slicedToArray = __webpack_require__(17);
|
|
919
|
+
|
|
820
920
|
Object.defineProperty(exports, "__esModule", {
|
|
821
921
|
value: true
|
|
822
922
|
});
|
|
923
|
+
|
|
823
924
|
var React = __webpack_require__(1);
|
|
925
|
+
|
|
824
926
|
var lodash_1 = __webpack_require__(3);
|
|
825
|
-
|
|
927
|
+
|
|
928
|
+
var getSettingsFromThemedProps_1 = __webpack_require__(38);
|
|
929
|
+
|
|
826
930
|
var Options_1 = __webpack_require__(30);
|
|
827
|
-
|
|
931
|
+
|
|
932
|
+
var SanitizeProps_1 = __webpack_require__(39);
|
|
933
|
+
|
|
828
934
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
829
|
-
|
|
935
|
+
|
|
936
|
+
var moment_1 = __webpack_require__(40);
|
|
937
|
+
|
|
830
938
|
var FeatureFlagContext_1 = __webpack_require__(21);
|
|
939
|
+
|
|
831
940
|
var styled_components_1 = __webpack_require__(4);
|
|
941
|
+
|
|
832
942
|
var hocUtils_1 = __webpack_require__(27);
|
|
943
|
+
|
|
833
944
|
var JSONSchemaUtils_1 = __webpack_require__(28);
|
|
834
|
-
|
|
945
|
+
|
|
946
|
+
var async_dynamic_options_evaluator_1 = __webpack_require__(41);
|
|
947
|
+
|
|
835
948
|
var id_1 = __webpack_require__(25);
|
|
836
|
-
|
|
949
|
+
|
|
950
|
+
var SplunkVisualization_1 = __webpack_require__(42);
|
|
951
|
+
|
|
837
952
|
var VizBehavior_1 = __webpack_require__(6);
|
|
953
|
+
|
|
838
954
|
var getSorting_1 = __webpack_require__(33);
|
|
839
|
-
|
|
955
|
+
|
|
956
|
+
var getPagination_1 = __webpack_require__(35);
|
|
957
|
+
|
|
840
958
|
var useDeepMemo_1 = __webpack_require__(44);
|
|
959
|
+
|
|
841
960
|
var MissingPropsMessage_1 = __webpack_require__(45);
|
|
961
|
+
|
|
842
962
|
var withEditModeCover_1 = __webpack_require__(46);
|
|
963
|
+
|
|
843
964
|
var withPlaceholder_1 = __webpack_require__(47);
|
|
844
965
|
/**
|
|
845
966
|
* hoc that wraps a pure react visualization in a Dashboard visualization
|
|
846
967
|
* @param {DashboardVizOpts} opts
|
|
847
968
|
* @returns {HOC}
|
|
848
969
|
*/
|
|
970
|
+
|
|
971
|
+
|
|
849
972
|
var withDashboardViz = function withDashboardViz(opts) {
|
|
850
973
|
var ReactViz = opts.ReactViz,
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
974
|
+
vizConfig = opts.vizConfig,
|
|
975
|
+
_opts$computeVizProps = opts.computeVizProps,
|
|
976
|
+
computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
|
|
977
|
+
disableEditModeCover = opts.disableEditModeCover,
|
|
978
|
+
useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
|
|
979
|
+
|
|
856
980
|
var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
|
|
857
981
|
var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
|
|
982
|
+
|
|
858
983
|
var DashboardViz = function DashboardViz(props) {
|
|
859
984
|
var _a;
|
|
985
|
+
|
|
860
986
|
var mode = props.mode,
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
987
|
+
hasEventHandlers = props.hasEventHandlers,
|
|
988
|
+
dataSources = props.dataSources,
|
|
989
|
+
options = props.options,
|
|
990
|
+
_props$context = props.context,
|
|
991
|
+
context = _props$context === void 0 ? {} : _props$context,
|
|
992
|
+
width = props.width,
|
|
993
|
+
height = props.height,
|
|
994
|
+
onComputedProps = props.onComputedProps,
|
|
995
|
+
onEventTrigger = props.onEventTrigger,
|
|
996
|
+
theme = props.theme,
|
|
997
|
+
onRequestParamsChange = props.onRequestParamsChange;
|
|
998
|
+
|
|
872
999
|
var _React$useContext = React.useContext(TimezoneContext_1.default),
|
|
873
|
-
|
|
1000
|
+
serializedTimezone = _React$useContext.serializedTimezone;
|
|
1001
|
+
|
|
874
1002
|
if (serializedTimezone) {
|
|
875
1003
|
/*
|
|
876
1004
|
@splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
|
|
@@ -884,38 +1012,51 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
884
1012
|
moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
|
|
885
1013
|
}
|
|
886
1014
|
}
|
|
1015
|
+
|
|
887
1016
|
var themeFunc = function themeFunc(themeVar) {
|
|
888
1017
|
var _a, _b;
|
|
1018
|
+
|
|
889
1019
|
return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
|
|
890
1020
|
};
|
|
1021
|
+
|
|
891
1022
|
var bgColorFromTheme = themeFunc('defaultBackgroundColor');
|
|
1023
|
+
|
|
892
1024
|
var _ref = (0, getSettingsFromThemedProps_1.default)({
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
1025
|
+
theme: theme
|
|
1026
|
+
}),
|
|
1027
|
+
currentThemeFamily = _ref.family,
|
|
1028
|
+
currentThemeColorScheme = _ref.colorScheme,
|
|
1029
|
+
currentThemeDensity = _ref.density;
|
|
1030
|
+
|
|
898
1031
|
var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
|
|
1032
|
+
|
|
899
1033
|
var _React$useState = React.useState({}),
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
1034
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
1035
|
+
evaluatedOptionsAsync = _React$useState2[0],
|
|
1036
|
+
setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
|
|
1037
|
+
|
|
1038
|
+
|
|
903
1039
|
var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
|
|
1040
|
+
|
|
904
1041
|
var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
|
|
905
|
-
|
|
906
|
-
|
|
1042
|
+
_React$useState4 = _slicedToArray(_React$useState3, 1),
|
|
1043
|
+
visualizationID = _React$useState4[0];
|
|
1044
|
+
|
|
907
1045
|
var _React$useState5 = React.useState({}),
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
1046
|
+
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
1047
|
+
dataSourcesInState = _React$useState6[0],
|
|
1048
|
+
setDataSourcesInState = _React$useState6[1];
|
|
1049
|
+
|
|
911
1050
|
var _React$useState7 = React.useState(),
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
1051
|
+
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
1052
|
+
dataFramesInState = _React$useState8[0],
|
|
1053
|
+
setDataFramesInState = _React$useState8[1];
|
|
1054
|
+
|
|
915
1055
|
var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
1056
|
+
_React$useState10 = _slicedToArray(_React$useState9, 2),
|
|
1057
|
+
useAsyncEvaluatedOptions = _React$useState10[0],
|
|
1058
|
+
setUseAsyncEvaluatedOptions = _React$useState10[1];
|
|
1059
|
+
|
|
919
1060
|
var isMounted = React.useRef(true);
|
|
920
1061
|
evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
|
|
921
1062
|
try {
|
|
@@ -940,11 +1081,13 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
940
1081
|
});
|
|
941
1082
|
} else {
|
|
942
1083
|
var dataFrames = dataFramesInState;
|
|
1084
|
+
|
|
943
1085
|
if (dataSources !== dataSourcesInState) {
|
|
944
1086
|
setDataSourcesInState(dataSources);
|
|
945
1087
|
dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
|
|
946
1088
|
setDataFramesInState(dataFrames);
|
|
947
1089
|
}
|
|
1090
|
+
|
|
948
1091
|
return Options_1.Options.evaluate({
|
|
949
1092
|
context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
|
|
950
1093
|
options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
|
|
@@ -955,21 +1098,24 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
955
1098
|
console.error("unexpected error evaluating options: ".concat(e.message));
|
|
956
1099
|
return {};
|
|
957
1100
|
}
|
|
1101
|
+
|
|
958
1102
|
return {};
|
|
959
1103
|
}, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
|
|
960
|
-
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
|
|
961
|
-
// trellis specific backgroundColor update for onComputedProps
|
|
1104
|
+
var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
|
|
962
1105
|
// if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
|
|
963
1106
|
// onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
|
|
1107
|
+
|
|
964
1108
|
var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
|
|
965
1109
|
var clonedEvaluatedOptions = evaluatedOptionsToUse;
|
|
1110
|
+
|
|
966
1111
|
if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
|
|
967
1112
|
clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
|
|
968
1113
|
backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
|
|
969
1114
|
});
|
|
970
|
-
}
|
|
971
|
-
// useEffect hook needs to be initialized before any early returns
|
|
1115
|
+
} // useEffect hook needs to be initialized before any early returns
|
|
972
1116
|
// this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
|
|
1117
|
+
|
|
1118
|
+
|
|
973
1119
|
React.useEffect(function () {
|
|
974
1120
|
onComputedProps(clonedEvaluatedOptions);
|
|
975
1121
|
});
|
|
@@ -979,44 +1125,49 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
979
1125
|
isMounted.current = false;
|
|
980
1126
|
async_dynamic_options_evaluator_1.default.reset(visualizationID);
|
|
981
1127
|
}
|
|
982
|
-
};
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
// present warning message if any required props are missing
|
|
1128
|
+
}; // eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1129
|
+
}, []); // present warning message if any required props are missing
|
|
1130
|
+
|
|
986
1131
|
var _vizConfig$requiredPr = vizConfig.requiredProps,
|
|
987
|
-
|
|
988
|
-
|
|
1132
|
+
requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
|
|
1133
|
+
supports = vizConfig.supports;
|
|
989
1134
|
var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
|
|
1135
|
+
|
|
990
1136
|
if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
|
|
991
1137
|
) {
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1138
|
+
return React.createElement(MissingPropsMessage_1.default, {
|
|
1139
|
+
"data-test": "missing-props-message",
|
|
1140
|
+
width: width,
|
|
1141
|
+
height: height,
|
|
1142
|
+
missingProps: missing,
|
|
1143
|
+
backgroundColor: bgColorFromTheme
|
|
1144
|
+
});
|
|
1145
|
+
} // events
|
|
1146
|
+
|
|
1147
|
+
|
|
1001
1148
|
var eventCallbackProps = {};
|
|
1149
|
+
|
|
1002
1150
|
if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
|
|
1003
1151
|
var supportedEvents = vizConfig.events;
|
|
1004
1152
|
Object.keys(supportedEvents).forEach(function (eventName) {
|
|
1005
1153
|
var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
|
|
1006
|
-
eventCallbackProps[eventCallbackPropName] = null;
|
|
1007
|
-
// todo: refactor single value and single value icon to send payload from viz
|
|
1154
|
+
eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
|
|
1008
1155
|
// then remove these lines
|
|
1156
|
+
|
|
1009
1157
|
var payloadKeys = supportedEvents[eventName].payloadKeys;
|
|
1010
1158
|
var payload = {};
|
|
1159
|
+
|
|
1011
1160
|
if (Array.isArray(payloadKeys) && payloadKeys.length) {
|
|
1012
1161
|
payloadKeys.forEach(function (p) {
|
|
1013
1162
|
payload[p] = evaluatedOptionsToUse[p];
|
|
1014
1163
|
});
|
|
1015
1164
|
}
|
|
1165
|
+
|
|
1016
1166
|
eventCallbackProps[eventCallbackPropName] = function (ev) {
|
|
1017
1167
|
if (ev && ev.payload) {
|
|
1018
1168
|
payload = ev.payload;
|
|
1019
1169
|
}
|
|
1170
|
+
|
|
1020
1171
|
return onEventTrigger({
|
|
1021
1172
|
originalEvent: ev,
|
|
1022
1173
|
payload: payload,
|
|
@@ -1024,8 +1175,9 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1024
1175
|
});
|
|
1025
1176
|
};
|
|
1026
1177
|
});
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1178
|
+
} // compute pure viz props which are not from options
|
|
1179
|
+
|
|
1180
|
+
|
|
1029
1181
|
var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
|
|
1030
1182
|
themeFunc: themeFunc
|
|
1031
1183
|
}));
|
|
@@ -1043,15 +1195,19 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1043
1195
|
* In future, we could automatically detect which all datasources are being used
|
|
1044
1196
|
* and bind those magically to pagination/sorting behavior.
|
|
1045
1197
|
*/
|
|
1198
|
+
|
|
1046
1199
|
var dataSourceMetadata = {};
|
|
1047
1200
|
var OptionKey = 'paginateDataSourceKey';
|
|
1048
1201
|
var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
|
|
1202
|
+
|
|
1049
1203
|
if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
|
|
1050
1204
|
var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
|
|
1051
1205
|
var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
|
|
1206
|
+
|
|
1052
1207
|
var handleRequestParamsChange = function handleRequestParamsChange(payload) {
|
|
1053
1208
|
return onRequestParamsChange(paginateDataSourceKey, payload);
|
|
1054
1209
|
};
|
|
1210
|
+
|
|
1055
1211
|
var sortParams = (0, getSorting_1.getSortingParams)({
|
|
1056
1212
|
requestParams: requestParams,
|
|
1057
1213
|
meta: meta,
|
|
@@ -1066,103 +1222,120 @@ var withDashboardViz = function withDashboardViz(opts) {
|
|
|
1066
1222
|
sortParams: sortParams,
|
|
1067
1223
|
paginatorParams: paginatorParams
|
|
1068
1224
|
};
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1225
|
+
} // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
|
|
1226
|
+
|
|
1227
|
+
|
|
1071
1228
|
if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
|
|
1072
1229
|
return null;
|
|
1073
1230
|
}
|
|
1231
|
+
|
|
1074
1232
|
return React.createElement(SanitizedReactViz, Object.assign({
|
|
1075
1233
|
mode: mode,
|
|
1076
1234
|
width: width,
|
|
1077
1235
|
height: height
|
|
1078
1236
|
}, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
|
|
1079
1237
|
};
|
|
1238
|
+
|
|
1080
1239
|
DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
|
|
1081
1240
|
DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
|
|
1082
1241
|
// using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
|
|
1083
1242
|
theme: {}
|
|
1084
|
-
});
|
|
1085
|
-
|
|
1086
|
-
DashboardViz.config = vizConfig;
|
|
1087
|
-
|
|
1243
|
+
}); // attach viz config
|
|
1244
|
+
|
|
1245
|
+
DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
|
|
1246
|
+
|
|
1088
1247
|
return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
|
|
1089
1248
|
};
|
|
1249
|
+
|
|
1090
1250
|
exports.default = withDashboardViz;
|
|
1091
1251
|
|
|
1092
1252
|
/***/ }),
|
|
1093
|
-
/*
|
|
1253
|
+
/* 38 */
|
|
1094
1254
|
/***/ (function(module, exports) {
|
|
1095
1255
|
|
|
1096
1256
|
module.exports = require("@splunk/themes/getSettingsFromThemedProps");
|
|
1097
1257
|
|
|
1098
1258
|
/***/ }),
|
|
1099
|
-
/*
|
|
1259
|
+
/* 39 */
|
|
1100
1260
|
/***/ (function(module, exports) {
|
|
1101
1261
|
|
|
1102
1262
|
module.exports = require("@splunk/visualizations-shared/SanitizeProps");
|
|
1103
1263
|
|
|
1104
1264
|
/***/ }),
|
|
1105
|
-
/*
|
|
1265
|
+
/* 40 */
|
|
1106
1266
|
/***/ (function(module, exports) {
|
|
1107
1267
|
|
|
1108
1268
|
module.exports = require("@splunk/moment");
|
|
1109
1269
|
|
|
1110
1270
|
/***/ }),
|
|
1111
|
-
/*
|
|
1271
|
+
/* 41 */
|
|
1112
1272
|
/***/ (function(module, exports) {
|
|
1113
1273
|
|
|
1114
1274
|
module.exports = require("@splunk/async-dynamic-options-evaluator");
|
|
1115
1275
|
|
|
1116
1276
|
/***/ }),
|
|
1117
|
-
/*
|
|
1277
|
+
/* 42 */
|
|
1118
1278
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1119
1279
|
|
|
1120
1280
|
"use strict";
|
|
1121
1281
|
|
|
1122
1282
|
|
|
1123
1283
|
var _classCallCheck = __webpack_require__(9);
|
|
1284
|
+
|
|
1124
1285
|
Object.defineProperty(exports, "__esModule", {
|
|
1125
1286
|
value: true
|
|
1126
1287
|
});
|
|
1127
1288
|
exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
|
|
1128
1289
|
/* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
|
|
1290
|
+
|
|
1129
1291
|
var T = __webpack_require__(0);
|
|
1292
|
+
|
|
1130
1293
|
var lodash_1 = __webpack_require__(3);
|
|
1131
|
-
|
|
1132
|
-
// this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1294
|
+
|
|
1295
|
+
var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
|
|
1296
|
+
|
|
1297
|
+
|
|
1133
1298
|
exports.INITIAL_WIDTH = 250;
|
|
1134
1299
|
exports.INITIAL_HEIGHT = 250;
|
|
1135
1300
|
/**
|
|
1136
1301
|
* A Splunk visualization
|
|
1137
1302
|
*/
|
|
1303
|
+
|
|
1138
1304
|
var SplunkVisualization = function SplunkVisualization() {
|
|
1139
1305
|
_classCallCheck(this, SplunkVisualization);
|
|
1140
1306
|
};
|
|
1307
|
+
|
|
1141
1308
|
SplunkVisualization.propTypes = {
|
|
1142
1309
|
/**
|
|
1143
1310
|
* display mode
|
|
1144
1311
|
*/
|
|
1145
1312
|
mode: T.oneOf(['view', 'edit', 'export']).isRequired,
|
|
1313
|
+
|
|
1146
1314
|
/**
|
|
1147
1315
|
* width in pixel or string, defaults to 100%
|
|
1148
1316
|
*/
|
|
1149
1317
|
width: T.oneOfType([T.string, T.number]).isRequired,
|
|
1318
|
+
|
|
1150
1319
|
/**
|
|
1151
1320
|
* height in pixel or string
|
|
1152
1321
|
*/
|
|
1153
1322
|
height: T.oneOfType([T.string, T.number]).isRequired,
|
|
1323
|
+
|
|
1154
1324
|
/**
|
|
1155
1325
|
* visualization context used for dynamic option evaluation
|
|
1156
1326
|
*/
|
|
1157
1327
|
context: T.object,
|
|
1328
|
+
|
|
1158
1329
|
/**
|
|
1159
1330
|
* visualization formatting options
|
|
1160
1331
|
*/
|
|
1161
1332
|
options: T.object,
|
|
1333
|
+
|
|
1162
1334
|
/**
|
|
1163
1335
|
* A callback to update formatting options
|
|
1164
1336
|
*/
|
|
1165
1337
|
onOptionsChange: T.func,
|
|
1338
|
+
|
|
1166
1339
|
/**
|
|
1167
1340
|
* datasource state which include data and request params, object key indicate the datasource type.
|
|
1168
1341
|
*/
|
|
@@ -1171,6 +1344,7 @@ SplunkVisualization.propTypes = {
|
|
|
1171
1344
|
* current request params
|
|
1172
1345
|
*/
|
|
1173
1346
|
requestParams: T.object,
|
|
1347
|
+
|
|
1174
1348
|
/**
|
|
1175
1349
|
* current dataset
|
|
1176
1350
|
*/
|
|
@@ -1178,6 +1352,7 @@ SplunkVisualization.propTypes = {
|
|
|
1178
1352
|
fields: T.array,
|
|
1179
1353
|
columns: T.array
|
|
1180
1354
|
}),
|
|
1355
|
+
|
|
1181
1356
|
/**
|
|
1182
1357
|
* error
|
|
1183
1358
|
*/
|
|
@@ -1185,29 +1360,35 @@ SplunkVisualization.propTypes = {
|
|
|
1185
1360
|
level: T.string,
|
|
1186
1361
|
message: T.string
|
|
1187
1362
|
}),
|
|
1363
|
+
|
|
1188
1364
|
/**
|
|
1189
1365
|
* meta data that came with the dataset
|
|
1190
1366
|
*/
|
|
1191
1367
|
meta: T.object
|
|
1192
1368
|
})),
|
|
1369
|
+
|
|
1193
1370
|
/**
|
|
1194
1371
|
* A callback to trigger event
|
|
1195
1372
|
*/
|
|
1196
1373
|
onEventTrigger: T.func,
|
|
1374
|
+
|
|
1197
1375
|
/**
|
|
1198
1376
|
* Inform viz if there are handlers listening to events
|
|
1199
1377
|
*/
|
|
1200
1378
|
hasEventHandlers: T.bool,
|
|
1379
|
+
|
|
1201
1380
|
/**
|
|
1202
1381
|
* A callback to communicate computed props to a consumer
|
|
1203
1382
|
*/
|
|
1204
1383
|
onComputedProps: T.func,
|
|
1384
|
+
|
|
1205
1385
|
/**
|
|
1206
1386
|
* A callback to obtain visualization api
|
|
1207
1387
|
*/
|
|
1208
1388
|
vizActionHandlerRef: T.func,
|
|
1209
1389
|
loading: T.bool,
|
|
1210
1390
|
theme: T.object,
|
|
1391
|
+
|
|
1211
1392
|
/**
|
|
1212
1393
|
* A callback to request new data with updated request params
|
|
1213
1394
|
*/
|
|
@@ -1216,6 +1397,7 @@ SplunkVisualization.propTypes = {
|
|
|
1216
1397
|
/**
|
|
1217
1398
|
*
|
|
1218
1399
|
*/
|
|
1400
|
+
|
|
1219
1401
|
SplunkVisualization.defaultProps = {
|
|
1220
1402
|
// BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
|
|
1221
1403
|
width: '100%',
|
|
@@ -1243,26 +1425,29 @@ SplunkVisualization.defaultProps = {
|
|
|
1243
1425
|
exports.default = SplunkVisualization;
|
|
1244
1426
|
|
|
1245
1427
|
/***/ }),
|
|
1246
|
-
/*
|
|
1428
|
+
/* 43 */
|
|
1247
1429
|
/***/ (function(module, exports, __webpack_require__) {
|
|
1248
1430
|
|
|
1249
1431
|
"use strict";
|
|
1250
1432
|
|
|
1251
1433
|
|
|
1252
1434
|
var _classCallCheck = __webpack_require__(9);
|
|
1435
|
+
|
|
1253
1436
|
var _createClass = __webpack_require__(18);
|
|
1437
|
+
|
|
1254
1438
|
Object.defineProperty(exports, "__esModule", {
|
|
1255
1439
|
value: true
|
|
1256
1440
|
});
|
|
1257
1441
|
exports.DefaultVizActionHandler = void 0;
|
|
1442
|
+
|
|
1258
1443
|
var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
1259
1444
|
function DefaultVizActionHandler() {
|
|
1260
1445
|
_classCallCheck(this, DefaultVizActionHandler);
|
|
1261
1446
|
}
|
|
1447
|
+
|
|
1262
1448
|
_createClass(DefaultVizActionHandler, [{
|
|
1263
1449
|
key: "focus",
|
|
1264
|
-
value: function focus() {
|
|
1265
|
-
// noop
|
|
1450
|
+
value: function focus() {// noop
|
|
1266
1451
|
}
|
|
1267
1452
|
}, {
|
|
1268
1453
|
key: "snapshot",
|
|
@@ -1270,22 +1455,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
|
|
|
1270
1455
|
return null; // noop
|
|
1271
1456
|
}
|
|
1272
1457
|
}]);
|
|
1458
|
+
|
|
1273
1459
|
return DefaultVizActionHandler;
|
|
1274
1460
|
}();
|
|
1275
|
-
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1276
|
-
|
|
1277
|
-
/***/ }),
|
|
1278
|
-
/* 43 */
|
|
1279
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
1280
|
-
|
|
1281
|
-
"use strict";
|
|
1282
|
-
|
|
1283
1461
|
|
|
1284
|
-
|
|
1285
|
-
value: true
|
|
1286
|
-
});
|
|
1287
|
-
exports.validSortDirs = void 0;
|
|
1288
|
-
exports.validSortDirs = ['asc', 'desc', 'none'];
|
|
1462
|
+
exports.DefaultVizActionHandler = DefaultVizActionHandler;
|
|
1289
1463
|
|
|
1290
1464
|
/***/ }),
|
|
1291
1465
|
/* 44 */
|
|
@@ -1298,7 +1472,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1298
1472
|
value: true
|
|
1299
1473
|
});
|
|
1300
1474
|
exports.useDeepMemo = void 0;
|
|
1475
|
+
|
|
1301
1476
|
var react_1 = __webpack_require__(1);
|
|
1477
|
+
|
|
1302
1478
|
var lodash_1 = __webpack_require__(3);
|
|
1303
1479
|
/**
|
|
1304
1480
|
* This hook evaluates and stores the result of a passed function and only
|
|
@@ -1313,16 +1489,21 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1313
1489
|
* @param fn the function to be executed and
|
|
1314
1490
|
* @param dependencies an array of dependencies
|
|
1315
1491
|
*/
|
|
1492
|
+
|
|
1493
|
+
|
|
1316
1494
|
var useDeepMemo = function useDeepMemo(fn, dependencies) {
|
|
1317
1495
|
var ref = (0, react_1.useRef)();
|
|
1496
|
+
|
|
1318
1497
|
if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
|
|
1319
1498
|
ref.current = {
|
|
1320
1499
|
dependencies: dependencies,
|
|
1321
1500
|
value: fn()
|
|
1322
1501
|
};
|
|
1323
1502
|
}
|
|
1503
|
+
|
|
1324
1504
|
return ref.current.value;
|
|
1325
1505
|
};
|
|
1506
|
+
|
|
1326
1507
|
exports.useDeepMemo = useDeepMemo;
|
|
1327
1508
|
|
|
1328
1509
|
/***/ }),
|
|
@@ -1336,19 +1517,27 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1336
1517
|
value: true
|
|
1337
1518
|
});
|
|
1338
1519
|
exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
|
|
1520
|
+
|
|
1339
1521
|
var React = __webpack_require__(1);
|
|
1522
|
+
|
|
1340
1523
|
var T = __webpack_require__(0);
|
|
1524
|
+
|
|
1341
1525
|
var i18n_1 = __webpack_require__(2);
|
|
1526
|
+
|
|
1342
1527
|
var Message_1 = __webpack_require__(10);
|
|
1528
|
+
|
|
1343
1529
|
var FixedSizeContainer_1 = __webpack_require__(13);
|
|
1344
1530
|
/**
|
|
1345
1531
|
* @method isMissing
|
|
1346
1532
|
* @param {any} v
|
|
1347
1533
|
* @returns {boolean} true if the input value === null or undefined
|
|
1348
1534
|
*/
|
|
1535
|
+
|
|
1536
|
+
|
|
1349
1537
|
var isMissing = function isMissing(v) {
|
|
1350
1538
|
return v === null || v === undefined;
|
|
1351
1539
|
};
|
|
1540
|
+
|
|
1352
1541
|
exports.isMissing = isMissing;
|
|
1353
1542
|
/**
|
|
1354
1543
|
* @method misskingKeys
|
|
@@ -1356,11 +1545,13 @@ exports.isMissing = isMissing;
|
|
|
1356
1545
|
* @param {object} target
|
|
1357
1546
|
* @returns {string[]} the keys of missing required props
|
|
1358
1547
|
*/
|
|
1548
|
+
|
|
1359
1549
|
var missingKeys = function missingKeys(keys, target) {
|
|
1360
1550
|
return keys.filter(function (k) {
|
|
1361
1551
|
return (0, exports.isMissing)(target[k]);
|
|
1362
1552
|
});
|
|
1363
1553
|
};
|
|
1554
|
+
|
|
1364
1555
|
exports.missingKeys = missingKeys;
|
|
1365
1556
|
var propTypes = {
|
|
1366
1557
|
width: T.oneOfType([T.string, T.number]),
|
|
@@ -1374,10 +1565,11 @@ var propTypes = {
|
|
|
1374
1565
|
* @param {MissingPropsProps} props
|
|
1375
1566
|
* @returns {React.ReactElement}
|
|
1376
1567
|
*/
|
|
1568
|
+
|
|
1377
1569
|
var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
1378
1570
|
var width = props.width,
|
|
1379
|
-
|
|
1380
|
-
|
|
1571
|
+
height = props.height,
|
|
1572
|
+
missingProps = props.missingProps;
|
|
1381
1573
|
return React.createElement(Message_1.default, {
|
|
1382
1574
|
"data-test": "message",
|
|
1383
1575
|
width: width,
|
|
@@ -1385,6 +1577,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
|
|
|
1385
1577
|
message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
|
|
1386
1578
|
});
|
|
1387
1579
|
};
|
|
1580
|
+
|
|
1388
1581
|
exports.MissingPropsMessage = MissingPropsMessage;
|
|
1389
1582
|
exports.MissingPropsMessage.propTypes = propTypes;
|
|
1390
1583
|
exports.MissingPropsMessage.defaultProps = {
|
|
@@ -1403,15 +1596,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
|
|
|
1403
1596
|
Object.defineProperty(exports, "__esModule", {
|
|
1404
1597
|
value: true
|
|
1405
1598
|
});
|
|
1599
|
+
|
|
1406
1600
|
var React = __webpack_require__(1);
|
|
1601
|
+
|
|
1407
1602
|
var styled_components_1 = __webpack_require__(4);
|
|
1603
|
+
|
|
1408
1604
|
var hocUtils_1 = __webpack_require__(15);
|
|
1605
|
+
|
|
1409
1606
|
var Cover = styled_components_1.default.div.withConfig({
|
|
1410
1607
|
displayName: "withEditModeCover__Cover",
|
|
1411
1608
|
componentId: "sc-1gsbnxb-0"
|
|
1412
1609
|
})(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
|
|
1413
1610
|
var Blocker = styled_components_1.default.div.attrs({
|
|
1414
|
-
'data-splunk-visualization-version': "26.
|
|
1611
|
+
'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
|
|
1415
1612
|
}).withConfig({
|
|
1416
1613
|
displayName: "withEditModeCover__Blocker",
|
|
1417
1614
|
componentId: "sc-1gsbnxb-1"
|
|
@@ -1422,6 +1619,7 @@ var Blocker = styled_components_1.default.div.attrs({
|
|
|
1422
1619
|
* @param {ExtendedDashViz} Visualization
|
|
1423
1620
|
* @returns {ExtendedDashViz} Wrapper
|
|
1424
1621
|
*/
|
|
1622
|
+
|
|
1425
1623
|
var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
|
|
1426
1624
|
var Wrapper = function Wrapper(props) {
|
|
1427
1625
|
var mode = props.mode;
|
|
@@ -1430,12 +1628,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
|
|
|
1430
1628
|
"data-test": "edit-mode-cover"
|
|
1431
1629
|
}));
|
|
1432
1630
|
};
|
|
1631
|
+
|
|
1433
1632
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1434
1633
|
Wrapper: Wrapper,
|
|
1435
1634
|
Visualization: Visualization
|
|
1436
1635
|
});
|
|
1437
1636
|
return Wrapper;
|
|
1438
1637
|
};
|
|
1638
|
+
|
|
1439
1639
|
exports.default = withEditModeCover;
|
|
1440
1640
|
|
|
1441
1641
|
/***/ }),
|
|
@@ -1448,27 +1648,37 @@ exports.default = withEditModeCover;
|
|
|
1448
1648
|
Object.defineProperty(exports, "__esModule", {
|
|
1449
1649
|
value: true
|
|
1450
1650
|
});
|
|
1651
|
+
|
|
1451
1652
|
var React = __webpack_require__(1);
|
|
1653
|
+
|
|
1452
1654
|
var colorUtils_1 = __webpack_require__(12);
|
|
1655
|
+
|
|
1453
1656
|
var variables_1 = __webpack_require__(11);
|
|
1657
|
+
|
|
1454
1658
|
var IconPlaceholder_1 = __webpack_require__(32);
|
|
1659
|
+
|
|
1455
1660
|
var VizBehavior_1 = __webpack_require__(6);
|
|
1661
|
+
|
|
1456
1662
|
var hocUtils_1 = __webpack_require__(15);
|
|
1663
|
+
|
|
1457
1664
|
var withPlaceholder = function withPlaceholder(Visualization) {
|
|
1458
1665
|
var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
|
|
1459
1666
|
var config = Visualization.config;
|
|
1460
1667
|
var themes = config.themes;
|
|
1668
|
+
|
|
1461
1669
|
var Wrapper = function Wrapper(props) {
|
|
1462
1670
|
var _a, _b;
|
|
1671
|
+
|
|
1463
1672
|
var dataSources = props.dataSources,
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1673
|
+
loading = props.loading,
|
|
1674
|
+
options = props.options,
|
|
1675
|
+
height = props.height,
|
|
1676
|
+
width = props.width;
|
|
1468
1677
|
var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
|
|
1469
1678
|
var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
|
|
1470
1679
|
var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
|
|
1471
1680
|
var iconColor = variables_1.default.contentColorActive(props);
|
|
1681
|
+
|
|
1472
1682
|
if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
|
|
1473
1683
|
return React.createElement(IconPlaceholder_1.default, {
|
|
1474
1684
|
"data-test": "icon-placeholder",
|
|
@@ -1479,14 +1689,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
|
|
|
1479
1689
|
iconColor: iconColor
|
|
1480
1690
|
});
|
|
1481
1691
|
}
|
|
1692
|
+
|
|
1482
1693
|
return React.createElement(Visualization, Object.assign({}, props));
|
|
1483
1694
|
};
|
|
1695
|
+
|
|
1484
1696
|
(0, hocUtils_1.extendStaticWrapperProps)({
|
|
1485
1697
|
Wrapper: Wrapper,
|
|
1486
1698
|
Visualization: Visualization
|
|
1487
1699
|
});
|
|
1488
1700
|
return Wrapper;
|
|
1489
1701
|
};
|
|
1702
|
+
|
|
1490
1703
|
exports.default = withPlaceholder;
|
|
1491
1704
|
|
|
1492
1705
|
/***/ }),
|
|
@@ -1519,11 +1732,13 @@ module.exports = require("@splunk/visualization-icons");
|
|
|
1519
1732
|
Object.defineProperty(exports, "__esModule", {
|
|
1520
1733
|
value: true
|
|
1521
1734
|
});
|
|
1735
|
+
|
|
1522
1736
|
var i18n_1 = __webpack_require__(2);
|
|
1737
|
+
|
|
1523
1738
|
var background = function background(_ref) {
|
|
1524
1739
|
var label = _ref.label,
|
|
1525
|
-
|
|
1526
|
-
|
|
1740
|
+
themes = _ref.themes,
|
|
1741
|
+
labelPosition = _ref.labelPosition;
|
|
1527
1742
|
return [{
|
|
1528
1743
|
label: (0, i18n_1._)(label || 'Background'),
|
|
1529
1744
|
option: 'backgroundColor',
|
|
@@ -1534,6 +1749,7 @@ var background = function background(_ref) {
|
|
|
1534
1749
|
}
|
|
1535
1750
|
}];
|
|
1536
1751
|
};
|
|
1752
|
+
|
|
1537
1753
|
exports.default = background;
|
|
1538
1754
|
|
|
1539
1755
|
/***/ }),
|
|
@@ -1551,20 +1767,25 @@ module.exports = require("@splunk/charting-bundle");
|
|
|
1551
1767
|
|
|
1552
1768
|
|
|
1553
1769
|
var _toConsumableArray = __webpack_require__(8);
|
|
1770
|
+
|
|
1554
1771
|
var __rest = this && this.__rest || function (s, e) {
|
|
1555
1772
|
var t = {};
|
|
1773
|
+
|
|
1556
1774
|
for (var p in s) {
|
|
1557
1775
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
1558
1776
|
}
|
|
1777
|
+
|
|
1559
1778
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
1560
1779
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
1561
1780
|
}
|
|
1562
1781
|
return t;
|
|
1563
1782
|
};
|
|
1783
|
+
|
|
1564
1784
|
Object.defineProperty(exports, "__esModule", {
|
|
1565
1785
|
value: true
|
|
1566
1786
|
});
|
|
1567
1787
|
exports.constructFieldsAndColumns = exports.toArrayForSeries = exports.isMultiSeriesData = exports.convertOverlayFields = exports.convertY2AxisOptions = exports.mapToValues = exports.truncateData = exports.getAnnotations = void 0;
|
|
1788
|
+
|
|
1568
1789
|
var lodash_1 = __webpack_require__(3);
|
|
1569
1790
|
/**
|
|
1570
1791
|
* Get formatted annotations
|
|
@@ -1575,10 +1796,12 @@ var lodash_1 = __webpack_require__(3);
|
|
|
1575
1796
|
* @param {Array} options.annotationLabel
|
|
1576
1797
|
* @returns {Array}
|
|
1577
1798
|
*/
|
|
1799
|
+
|
|
1800
|
+
|
|
1578
1801
|
var getAnnotations = function getAnnotations(_ref) {
|
|
1579
1802
|
var annotationX = _ref.annotationX,
|
|
1580
|
-
|
|
1581
|
-
|
|
1803
|
+
annotationColor = _ref.annotationColor,
|
|
1804
|
+
annotationLabel = _ref.annotationLabel;
|
|
1582
1805
|
return annotationX && annotationX.length ? annotationX.map(function (timestamp, i) {
|
|
1583
1806
|
return {
|
|
1584
1807
|
color: annotationColor && annotationColor[i],
|
|
@@ -1587,6 +1810,7 @@ var getAnnotations = function getAnnotations(_ref) {
|
|
|
1587
1810
|
};
|
|
1588
1811
|
}) : [];
|
|
1589
1812
|
};
|
|
1813
|
+
|
|
1590
1814
|
exports.getAnnotations = getAnnotations;
|
|
1591
1815
|
/**
|
|
1592
1816
|
* Truncate the result set to given limit
|
|
@@ -1595,20 +1819,25 @@ exports.getAnnotations = getAnnotations;
|
|
|
1595
1819
|
* @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']
|
|
1596
1820
|
* @returns {Object}
|
|
1597
1821
|
*/
|
|
1822
|
+
|
|
1598
1823
|
var truncateData = function truncateData(dataSet, truncationLimit) {
|
|
1599
1824
|
if (!dataSet) {
|
|
1600
1825
|
return null;
|
|
1601
1826
|
}
|
|
1827
|
+
|
|
1602
1828
|
var limit = parseInt(truncationLimit, 10);
|
|
1829
|
+
|
|
1603
1830
|
if (!limit || limit <= 0) {
|
|
1604
1831
|
return dataSet;
|
|
1605
1832
|
}
|
|
1833
|
+
|
|
1606
1834
|
var truncatedData = Object.assign({}, dataSet);
|
|
1607
1835
|
truncatedData.columns = truncatedData.columns.map(function (columnData) {
|
|
1608
1836
|
return columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData;
|
|
1609
1837
|
});
|
|
1610
1838
|
return truncatedData;
|
|
1611
1839
|
};
|
|
1840
|
+
|
|
1612
1841
|
exports.truncateData = truncateData;
|
|
1613
1842
|
/**
|
|
1614
1843
|
* Helper method to update the option values into the values that SC accepts
|
|
@@ -1616,12 +1845,14 @@ exports.truncateData = truncateData;
|
|
|
1616
1845
|
* @param {Object} options
|
|
1617
1846
|
* @returns {Object}
|
|
1618
1847
|
*/
|
|
1848
|
+
|
|
1619
1849
|
var mapToValues = function mapToValues(optionValuesSCMapping) {
|
|
1620
1850
|
return function (options) {
|
|
1621
1851
|
var convertedOptions = Object.assign({}, options);
|
|
1622
1852
|
Object.keys(optionValuesSCMapping).forEach(function (key) {
|
|
1623
1853
|
if ((0, lodash_1.has)(options, key)) {
|
|
1624
1854
|
var updatedValue = optionValuesSCMapping[key][options[key]];
|
|
1855
|
+
|
|
1625
1856
|
if (!(0, lodash_1.isUndefined)(updatedValue)) {
|
|
1626
1857
|
convertedOptions[key] = updatedValue;
|
|
1627
1858
|
}
|
|
@@ -1630,6 +1861,7 @@ var mapToValues = function mapToValues(optionValuesSCMapping) {
|
|
|
1630
1861
|
return convertedOptions;
|
|
1631
1862
|
};
|
|
1632
1863
|
};
|
|
1864
|
+
|
|
1633
1865
|
exports.mapToValues = mapToValues;
|
|
1634
1866
|
/**
|
|
1635
1867
|
* Helper method to process options related to y2Fields
|
|
@@ -1637,18 +1869,23 @@ exports.mapToValues = mapToValues;
|
|
|
1637
1869
|
* @param {Object} originalOptions
|
|
1638
1870
|
* @returns {Object}
|
|
1639
1871
|
*/
|
|
1872
|
+
|
|
1640
1873
|
var convertY2AxisOptions = function convertY2AxisOptions(_a) {
|
|
1641
1874
|
var y2Fields = _a.y2Fields,
|
|
1642
|
-
|
|
1875
|
+
originalOptions = __rest(_a, ["y2Fields"]);
|
|
1876
|
+
|
|
1643
1877
|
var convertedOptions = Object.assign({}, originalOptions);
|
|
1878
|
+
|
|
1644
1879
|
if (y2Fields) {
|
|
1645
1880
|
convertedOptions['axisY2.enabled'] = true;
|
|
1646
1881
|
convertedOptions['axisY2.fields'] = (0, lodash_1.isArray)(y2Fields) ? y2Fields.filter(function (name) {
|
|
1647
1882
|
return name;
|
|
1648
1883
|
}).join(',') : y2Fields;
|
|
1649
1884
|
}
|
|
1885
|
+
|
|
1650
1886
|
return convertedOptions;
|
|
1651
1887
|
};
|
|
1888
|
+
|
|
1652
1889
|
exports.convertY2AxisOptions = convertY2AxisOptions;
|
|
1653
1890
|
/**
|
|
1654
1891
|
* Helper method to format value for overlayFields
|
|
@@ -1656,9 +1893,11 @@ exports.convertY2AxisOptions = convertY2AxisOptions;
|
|
|
1656
1893
|
* @param {Object} originalOptions
|
|
1657
1894
|
* @returns {Object}
|
|
1658
1895
|
*/
|
|
1896
|
+
|
|
1659
1897
|
var convertOverlayFields = function convertOverlayFields(originalOptions) {
|
|
1660
1898
|
var convertedOptions = Object.assign({}, originalOptions);
|
|
1661
1899
|
var overlayFields = originalOptions.overlayFields;
|
|
1900
|
+
|
|
1662
1901
|
if (overlayFields) {
|
|
1663
1902
|
convertedOptions.overlayFields = Array.isArray(overlayFields) ? overlayFields.filter(function (field) {
|
|
1664
1903
|
return field;
|
|
@@ -1666,17 +1905,21 @@ var convertOverlayFields = function convertOverlayFields(originalOptions) {
|
|
|
1666
1905
|
return field.trim();
|
|
1667
1906
|
}).join(',') : overlayFields;
|
|
1668
1907
|
}
|
|
1908
|
+
|
|
1669
1909
|
return convertedOptions;
|
|
1670
1910
|
};
|
|
1911
|
+
|
|
1671
1912
|
exports.convertOverlayFields = convertOverlayFields;
|
|
1672
1913
|
/**
|
|
1673
1914
|
* checks whether data is multi series data
|
|
1674
1915
|
* @param {array} data array
|
|
1675
1916
|
* @return {Boolean}
|
|
1676
1917
|
*/
|
|
1918
|
+
|
|
1677
1919
|
var isMultiSeriesData = function isMultiSeriesData(data) {
|
|
1678
1920
|
return Array.isArray(data) && Array.isArray(data[0]);
|
|
1679
1921
|
};
|
|
1922
|
+
|
|
1680
1923
|
exports.isMultiSeriesData = isMultiSeriesData;
|
|
1681
1924
|
/**
|
|
1682
1925
|
* checks whether data is multi series data and returns value as array
|
|
@@ -1684,19 +1927,22 @@ exports.isMultiSeriesData = isMultiSeriesData;
|
|
|
1684
1927
|
* @param {*} value to return as array
|
|
1685
1928
|
* @return {array}
|
|
1686
1929
|
*/
|
|
1930
|
+
|
|
1687
1931
|
var toArrayForSeries = function toArrayForSeries(data, value) {
|
|
1688
1932
|
return (0, exports.isMultiSeriesData)(data) ? value : [value];
|
|
1689
1933
|
};
|
|
1934
|
+
|
|
1690
1935
|
exports.toArrayForSeries = toArrayForSeries;
|
|
1936
|
+
|
|
1691
1937
|
var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
1692
1938
|
var _ref2$x = _ref2.x,
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1939
|
+
x = _ref2$x === void 0 ? [] : _ref2$x,
|
|
1940
|
+
_ref2$y = _ref2.y,
|
|
1941
|
+
y = _ref2$y === void 0 ? [] : _ref2$y,
|
|
1942
|
+
xField = _ref2.xField,
|
|
1943
|
+
yFields = _ref2.yFields,
|
|
1944
|
+
y2 = _ref2.y2,
|
|
1945
|
+
y2Fields = _ref2.y2Fields;
|
|
1700
1946
|
var columns = [x.map(String)].concat(_toConsumableArray((0, exports.toArrayForSeries)(y, y).map(function (series) {
|
|
1701
1947
|
return series.map(String);
|
|
1702
1948
|
})));
|
|
@@ -1707,10 +1953,10 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
|
1707
1953
|
return {
|
|
1708
1954
|
name: field
|
|
1709
1955
|
};
|
|
1710
|
-
})));
|
|
1711
|
-
// splunk-charting requires y2 to be part of columns
|
|
1956
|
+
}))); // splunk-charting requires y2 to be part of columns
|
|
1712
1957
|
// when y & y2 options are configured with different (mutually exclusive) series
|
|
1713
1958
|
// y2 columns need to be added to columns
|
|
1959
|
+
|
|
1714
1960
|
if (y2Fields) {
|
|
1715
1961
|
var y2FieldsArray = (0, exports.toArrayForSeries)(y2, y2Fields);
|
|
1716
1962
|
var y2AsArray = (0, exports.toArrayForSeries)(y2, y2).map(function (series) {
|
|
@@ -1725,11 +1971,13 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
|
|
|
1725
1971
|
}
|
|
1726
1972
|
});
|
|
1727
1973
|
}
|
|
1974
|
+
|
|
1728
1975
|
return {
|
|
1729
1976
|
columns: columns,
|
|
1730
1977
|
fields: fields
|
|
1731
1978
|
};
|
|
1732
1979
|
};
|
|
1980
|
+
|
|
1733
1981
|
exports.constructFieldsAndColumns = constructFieldsAndColumns;
|
|
1734
1982
|
|
|
1735
1983
|
/***/ }),
|
|
@@ -1757,23 +2005,42 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
1757
2005
|
});
|
|
1758
2006
|
exports.updateRowPayload = exports.canUpdateInPlace = exports.changedOptions = exports.NO_INPLACE_PROPS = void 0;
|
|
1759
2007
|
/* eslint-disable react/no-unused-prop-types */
|
|
2008
|
+
|
|
1760
2009
|
var lodash_1 = __webpack_require__(3);
|
|
2010
|
+
|
|
1761
2011
|
var i18n_1 = __webpack_require__(2);
|
|
2012
|
+
|
|
1762
2013
|
var visualization_color_palettes_1 = __webpack_require__(51);
|
|
2014
|
+
|
|
1763
2015
|
var react_1 = __webpack_require__(1);
|
|
2016
|
+
|
|
1764
2017
|
var React = __webpack_require__(1);
|
|
2018
|
+
|
|
1765
2019
|
var T = __webpack_require__(0);
|
|
2020
|
+
|
|
1766
2021
|
var react_event_listener_1 = __webpack_require__(66);
|
|
2022
|
+
|
|
1767
2023
|
__webpack_require__(67); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
|
|
2024
|
+
|
|
2025
|
+
|
|
1768
2026
|
var charting_bundle_1 = __webpack_require__(55);
|
|
2027
|
+
|
|
1769
2028
|
var TimezoneContext_1 = __webpack_require__(26);
|
|
2029
|
+
|
|
1770
2030
|
var style_1 = __webpack_require__(14);
|
|
2031
|
+
|
|
1771
2032
|
var styled_components_1 = __webpack_require__(4);
|
|
2033
|
+
|
|
1772
2034
|
var Message_1 = __webpack_require__(10);
|
|
2035
|
+
|
|
1773
2036
|
var useSplunkTheme_1 = __webpack_require__(57);
|
|
2037
|
+
|
|
1774
2038
|
var themeUtils_1 = __webpack_require__(68);
|
|
2039
|
+
|
|
1775
2040
|
var ChartingApi_1 = __webpack_require__(69);
|
|
2041
|
+
|
|
1776
2042
|
exports.NO_INPLACE_PROPS = ['chart', 'chart.orientation', 'layout.splitSeries', 'chart.style', 'legend.placement'];
|
|
2043
|
+
|
|
1777
2044
|
var changedOptions = function changedOptions(curOptions, nextOptions) {
|
|
1778
2045
|
return Object.keys(curOptions).filter(function (key) {
|
|
1779
2046
|
return !(key in nextOptions);
|
|
@@ -1781,7 +2048,9 @@ var changedOptions = function changedOptions(curOptions, nextOptions) {
|
|
|
1781
2048
|
return !(key in curOptions) || curOptions[key] !== nextOptions[key];
|
|
1782
2049
|
}));
|
|
1783
2050
|
};
|
|
2051
|
+
|
|
1784
2052
|
exports.changedOptions = changedOptions;
|
|
2053
|
+
|
|
1785
2054
|
function usePrevious(value) {
|
|
1786
2055
|
var ref = (0, react_1.useRef)();
|
|
1787
2056
|
(0, react_1.useEffect)(function () {
|
|
@@ -1789,21 +2058,24 @@ function usePrevious(value) {
|
|
|
1789
2058
|
});
|
|
1790
2059
|
return ref.current;
|
|
1791
2060
|
}
|
|
2061
|
+
|
|
1792
2062
|
var canUpdateInPlace = function canUpdateInPlace(curOptions, nextOptions) {
|
|
1793
2063
|
// if either of the options are undefined
|
|
1794
2064
|
// it cannot update in place.
|
|
1795
2065
|
if (!curOptions || !nextOptions) {
|
|
1796
2066
|
return false;
|
|
1797
2067
|
}
|
|
2068
|
+
|
|
1798
2069
|
return !exports.NO_INPLACE_PROPS.some(function (p) {
|
|
1799
2070
|
return curOptions[p] !== nextOptions[p];
|
|
1800
2071
|
}) && !(0, exports.changedOptions)(curOptions, nextOptions).some(function (p) {
|
|
1801
2072
|
return p.toLowerCase().endsWith('color');
|
|
1802
2073
|
});
|
|
1803
2074
|
};
|
|
1804
|
-
|
|
1805
|
-
// create 'row' payloads from 'rowContext' in the flattened format:
|
|
2075
|
+
|
|
2076
|
+
exports.canUpdateInPlace = canUpdateInPlace; // create 'row' payloads from 'rowContext' in the flattened format:
|
|
1806
2077
|
// row.<fieldname>.value
|
|
2078
|
+
|
|
1807
2079
|
var updateRowPayload = function updateRowPayload(chartEventRowContext, payload) {
|
|
1808
2080
|
Object.keys(chartEventRowContext || {}).forEach(function (key) {
|
|
1809
2081
|
// eslint-disable-next-line no-param-reassign
|
|
@@ -1811,18 +2083,21 @@ var updateRowPayload = function updateRowPayload(chartEventRowContext, payload)
|
|
|
1811
2083
|
});
|
|
1812
2084
|
return payload;
|
|
1813
2085
|
};
|
|
2086
|
+
|
|
1814
2087
|
exports.updateRowPayload = updateRowPayload;
|
|
1815
2088
|
var VizChartEventType;
|
|
2089
|
+
|
|
1816
2090
|
(function (VizChartEventType) {
|
|
1817
2091
|
VizChartEventType["POINT_CLICK"] = "point.click";
|
|
1818
2092
|
VizChartEventType["POINT_MOUSE_OUT"] = "point.mouseout";
|
|
1819
2093
|
VizChartEventType["POINT_MOUSE_OVER"] = "point.mouseover";
|
|
1820
2094
|
VizChartEventType["LEGEND_CLICK"] = "legend.click";
|
|
1821
|
-
})(VizChartEventType || (VizChartEventType = {}));
|
|
1822
|
-
// @TODO(pwied): remove after HC upgrade to 8+
|
|
2095
|
+
})(VizChartEventType || (VizChartEventType = {})); // @TODO(pwied): remove after HC upgrade to 8+
|
|
1823
2096
|
// .highcharts-a11y-proxy-container rule addresses a HighCharts < 8 bug
|
|
1824
2097
|
// caused by the accessibility plugin
|
|
1825
2098
|
// https://github.com/highcharts/highcharts/issues/12883
|
|
2099
|
+
|
|
2100
|
+
|
|
1826
2101
|
var ChartingContainer = styled_components_1.default.div.attrs(function (props) {
|
|
1827
2102
|
return {
|
|
1828
2103
|
'data-test': 'charting-container',
|
|
@@ -1850,6 +2125,7 @@ var propTypes = {
|
|
|
1850
2125
|
visualizationApiRef: T.func,
|
|
1851
2126
|
themeKey: T.string
|
|
1852
2127
|
};
|
|
2128
|
+
|
|
1853
2129
|
var Charting = function Charting(props) {
|
|
1854
2130
|
var container = (0, react_1.useRef)(null);
|
|
1855
2131
|
var needsInit = (0, react_1.useRef)(true);
|
|
@@ -1857,6 +2133,7 @@ var Charting = function Charting(props) {
|
|
|
1857
2133
|
var needsRedraw = (0, react_1.useRef)(true);
|
|
1858
2134
|
var api = (0, react_1.useRef)(new ChartingApi_1.ChartingApiFunctional(chart));
|
|
1859
2135
|
var timezone = (0, react_1.useContext)(TimezoneContext_1.default);
|
|
2136
|
+
|
|
1860
2137
|
var computeChartingSize = function computeChartingSize() {
|
|
1861
2138
|
if (container.current) {
|
|
1862
2139
|
var rect = container.current.getBoundingClientRect();
|
|
@@ -1865,48 +2142,56 @@ var Charting = function Charting(props) {
|
|
|
1865
2142
|
width: rect.width
|
|
1866
2143
|
};
|
|
1867
2144
|
}
|
|
2145
|
+
|
|
1868
2146
|
return {};
|
|
1869
2147
|
};
|
|
2148
|
+
|
|
1870
2149
|
var splunkTheme = (0, useSplunkTheme_1.default)();
|
|
1871
2150
|
var themeKey = props.themeKey ? props.themeKey : (0, themeUtils_1.getChartingThemeKey)({
|
|
1872
2151
|
splunkThemeV1: splunkTheme
|
|
1873
2152
|
});
|
|
1874
2153
|
var width = props.width,
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
2154
|
+
height = props.height,
|
|
2155
|
+
style = props.style,
|
|
2156
|
+
chartData = props.chartData,
|
|
2157
|
+
options = props.options,
|
|
2158
|
+
colorPalette = props.colorPalette,
|
|
2159
|
+
onClick = props.onClick,
|
|
2160
|
+
onSelect = props.onSelect,
|
|
2161
|
+
onPointMouseOut = props.onPointMouseOut,
|
|
2162
|
+
onPointMouseOver = props.onPointMouseOver,
|
|
2163
|
+
onEventTrigger = props.onEventTrigger;
|
|
1885
2164
|
var prevOptions = usePrevious(options);
|
|
1886
2165
|
var prevTimezone = usePrevious(timezone);
|
|
2166
|
+
|
|
1887
2167
|
var handleClick = function handleClick(chartEvent, type) {
|
|
1888
2168
|
var payload = (0, lodash_1.pick)(chartEvent, 'name2', 'value2', '_span', 'modifierKey');
|
|
1889
2169
|
payload.name = payload.name2;
|
|
1890
2170
|
delete payload.name2;
|
|
2171
|
+
|
|
1891
2172
|
if (type === VizChartEventType.POINT_CLICK) {
|
|
1892
2173
|
payload.value = payload.value2;
|
|
1893
2174
|
delete payload.value2;
|
|
1894
2175
|
payload = (0, exports.updateRowPayload)(chartEvent.rowContext, payload);
|
|
1895
2176
|
}
|
|
2177
|
+
|
|
1896
2178
|
onClick({
|
|
1897
2179
|
type: type,
|
|
1898
2180
|
originalEvent: chartEvent,
|
|
1899
2181
|
payload: payload
|
|
1900
2182
|
});
|
|
1901
2183
|
};
|
|
2184
|
+
|
|
1902
2185
|
var destroyChart = function destroyChart() {
|
|
1903
2186
|
if (chart.current) {
|
|
1904
2187
|
chart.current.destroy();
|
|
1905
2188
|
chart.current = null;
|
|
1906
2189
|
}
|
|
2190
|
+
|
|
1907
2191
|
needsRedraw.current = true;
|
|
1908
2192
|
needsInit.current = true;
|
|
1909
2193
|
};
|
|
2194
|
+
|
|
1910
2195
|
var handleSelect = function handleSelect(chartEvent) {
|
|
1911
2196
|
// todo: need change this after breaking all visualizations
|
|
1912
2197
|
if (onSelect && typeof onSelect === 'function') {
|
|
@@ -1916,14 +2201,16 @@ var Charting = function Charting(props) {
|
|
|
1916
2201
|
payload: (0, lodash_1.pick)(chartEvent, 'startXIndex', 'endXIndex', 'startXValue', 'endXValue')
|
|
1917
2202
|
});
|
|
1918
2203
|
return;
|
|
1919
|
-
}
|
|
1920
|
-
|
|
2204
|
+
} // the chartEvent here is a jQuery event
|
|
2205
|
+
|
|
2206
|
+
|
|
1921
2207
|
onEventTrigger({
|
|
1922
2208
|
type: 'range.select',
|
|
1923
2209
|
originalEvent: chartEvent,
|
|
1924
2210
|
payload: (0, lodash_1.pick)(chartEvent, 'startXIndex', 'endXIndex', 'startXValue', 'endXValue')
|
|
1925
2211
|
});
|
|
1926
2212
|
};
|
|
2213
|
+
|
|
1927
2214
|
var handlePointMouseOut = function handlePointMouseOut(chartEvent, type) {
|
|
1928
2215
|
var payload = (0, lodash_1.pick)(chartEvent, 'name2', 'value2', '_span', 'modifierKey', 'tooltipContext');
|
|
1929
2216
|
payload.name = payload.name2;
|
|
@@ -1937,6 +2224,7 @@ var Charting = function Charting(props) {
|
|
|
1937
2224
|
payload: payload
|
|
1938
2225
|
});
|
|
1939
2226
|
};
|
|
2227
|
+
|
|
1940
2228
|
var handlePointMouseOver = function handlePointMouseOver(chartEvent, type) {
|
|
1941
2229
|
var payload = (0, lodash_1.pick)(chartEvent, 'name2', 'value2', '_span', 'modifierKey', 'tooltipContext');
|
|
1942
2230
|
payload.name = payload.name2;
|
|
@@ -1950,6 +2238,7 @@ var Charting = function Charting(props) {
|
|
|
1950
2238
|
payload: payload
|
|
1951
2239
|
});
|
|
1952
2240
|
};
|
|
2241
|
+
|
|
1953
2242
|
var drawChart = function drawChart() {
|
|
1954
2243
|
var updatedOptions = Object.assign(Object.assign({}, options), {
|
|
1955
2244
|
shouldColorizeTooltipData: false
|
|
@@ -1960,15 +2249,18 @@ var Charting = function Charting(props) {
|
|
|
1960
2249
|
var serializedTimezone = timezone === null || timezone === void 0 ? void 0 : timezone.serializedTimezone;
|
|
1961
2250
|
var ianaTimezone = timezone === null || timezone === void 0 ? void 0 : timezone.ianaTimezone;
|
|
1962
2251
|
var utcOffset = timezone === null || timezone === void 0 ? void 0 : timezone.utcOffset;
|
|
2252
|
+
|
|
1963
2253
|
if (!computedWidth || !computedHeight) {
|
|
1964
2254
|
return;
|
|
1965
2255
|
}
|
|
2256
|
+
|
|
1966
2257
|
if (!chartData || !Object.keys(chartData).length) {
|
|
1967
2258
|
return;
|
|
1968
|
-
}
|
|
1969
|
-
// splunk-charting layers configuration option updates.
|
|
2259
|
+
} // splunk-charting layers configuration option updates.
|
|
1970
2260
|
// when an option is removed it needs to be set to an empty string
|
|
1971
2261
|
// to override the previous configuration
|
|
2262
|
+
|
|
2263
|
+
|
|
1972
2264
|
if (prevOptions) {
|
|
1973
2265
|
Object.keys(prevOptions).forEach(function (key) {
|
|
1974
2266
|
if (updatedOptions[key] === undefined) {
|
|
@@ -1976,13 +2268,16 @@ var Charting = function Charting(props) {
|
|
|
1976
2268
|
}
|
|
1977
2269
|
});
|
|
1978
2270
|
}
|
|
2271
|
+
|
|
1979
2272
|
try {
|
|
1980
2273
|
if (needsInit.current) {
|
|
1981
2274
|
destroyChart();
|
|
1982
2275
|
charting_bundle_1.default.setTheme(themeKey);
|
|
2276
|
+
|
|
1983
2277
|
if (colorPalette.length > 0) {
|
|
1984
2278
|
charting_bundle_1.default.setColorPalette(colorPalette);
|
|
1985
2279
|
}
|
|
2280
|
+
|
|
1986
2281
|
chart.current = charting_bundle_1.default.createChart(container.current, Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, updatedOptions), {
|
|
1987
2282
|
drilldown: 'all'
|
|
1988
2283
|
}), typeof serializedTimezone === 'string' && {
|
|
@@ -1991,8 +2286,8 @@ var Charting = function Charting(props) {
|
|
|
1991
2286
|
'time.ianaTimezone': ianaTimezone
|
|
1992
2287
|
}), typeof utcOffset === 'number' && {
|
|
1993
2288
|
'time.timezoneOffset': utcOffset
|
|
1994
|
-
}));
|
|
1995
|
-
|
|
2289
|
+
})); // bind event handlers
|
|
2290
|
+
|
|
1996
2291
|
chart.current.on('pointClick', function (e) {
|
|
1997
2292
|
handleClick(e, VizChartEventType.POINT_CLICK);
|
|
1998
2293
|
});
|
|
@@ -2007,29 +2302,37 @@ var Charting = function Charting(props) {
|
|
|
2007
2302
|
});
|
|
2008
2303
|
chart.current.on('chartRangeSelect', handleSelect);
|
|
2009
2304
|
}
|
|
2305
|
+
|
|
2010
2306
|
if (needsRedraw.current) {
|
|
2011
2307
|
charting_bundle_1.default.setTheme(themeKey);
|
|
2308
|
+
|
|
2012
2309
|
if (colorPalette.length > 0) {
|
|
2013
2310
|
charting_bundle_1.default.setColorPalette(colorPalette);
|
|
2014
2311
|
}
|
|
2312
|
+
|
|
2015
2313
|
chart.current.prepareAndDraw(chartData, updatedOptions, function () {});
|
|
2016
2314
|
}
|
|
2315
|
+
|
|
2017
2316
|
if (chart.current) {
|
|
2018
2317
|
if (Math.round(chart.current.height) !== Math.round(computedHeight) || Math.round(chart.current.width) !== Math.round(computedWidth)) {
|
|
2019
2318
|
chart.current.resize(computedWidth, computedHeight);
|
|
2020
2319
|
}
|
|
2021
2320
|
}
|
|
2321
|
+
|
|
2022
2322
|
needsInit.current = false;
|
|
2023
2323
|
needsRedraw.current = false;
|
|
2024
2324
|
} catch (e) {
|
|
2025
2325
|
window.console.error('Caught error rendering chart:', e);
|
|
2026
2326
|
}
|
|
2027
2327
|
};
|
|
2328
|
+
|
|
2028
2329
|
var debouncedDrawChart = (0, lodash_1.debounce)(drawChart, 5);
|
|
2330
|
+
|
|
2029
2331
|
var onContainerMount = function onContainerMount(chartingContainer) {
|
|
2030
2332
|
container.current = chartingContainer;
|
|
2031
2333
|
debouncedDrawChart();
|
|
2032
2334
|
};
|
|
2335
|
+
|
|
2033
2336
|
var prevTheme = usePrevious(themeKey);
|
|
2034
2337
|
var prevOnClick = usePrevious(onClick);
|
|
2035
2338
|
(0, react_1.useEffect)(function () {
|
|
@@ -2043,14 +2346,14 @@ var Charting = function Charting(props) {
|
|
|
2043
2346
|
(0, react_1.useEffect)(function () {
|
|
2044
2347
|
// TODO: figure out why re-init is needed for functional components (i.e. PlatformViz) when changing theme
|
|
2045
2348
|
// seems like redraw doesn't suffice to update the background colors
|
|
2046
|
-
if (!chart.current || !(0, exports.canUpdateInPlace)(prevOptions, options) ||
|
|
2047
|
-
// timezone is a simple object so this comparison should be fast
|
|
2349
|
+
if (!chart.current || !(0, exports.canUpdateInPlace)(prevOptions, options) || // timezone is a simple object so this comparison should be fast
|
|
2048
2350
|
JSON.stringify(prevTimezone) !== JSON.stringify(timezone) || !props.themeKey && prevTheme !== themeKey || prevOnClick !== onClick) {
|
|
2049
2351
|
needsInit.current = true;
|
|
2050
2352
|
}
|
|
2051
|
-
|
|
2052
|
-
// need to immediately call drawChart upon an option or chartData change
|
|
2353
|
+
|
|
2354
|
+
needsRedraw.current = true; // need to immediately call drawChart upon an option or chartData change
|
|
2053
2355
|
// otherwise a noop would occur if the onContainerMount drawChart is re-invoked when dimensions change
|
|
2356
|
+
|
|
2054
2357
|
drawChart();
|
|
2055
2358
|
}, [JSON.stringify(options), JSON.stringify(chartData.toJSON()), JSON.stringify(chartData.annotations), timezone === null || timezone === void 0 ? void 0 : timezone.ianaTimezone, timezone === null || timezone === void 0 ? void 0 : timezone.utcOffset, timezone === null || timezone === void 0 ? void 0 : timezone.serializedTimezone, themeKey, onClick]);
|
|
2056
2359
|
return React.createElement(ChartingContainer, {
|
|
@@ -2063,6 +2366,7 @@ var Charting = function Charting(props) {
|
|
|
2063
2366
|
onResize: debouncedDrawChart
|
|
2064
2367
|
}));
|
|
2065
2368
|
};
|
|
2369
|
+
|
|
2066
2370
|
var defaultProps = {
|
|
2067
2371
|
width: '100%',
|
|
2068
2372
|
height: 250,
|
|
@@ -2080,31 +2384,36 @@ var defaultProps = {
|
|
|
2080
2384
|
themeKey: null
|
|
2081
2385
|
};
|
|
2082
2386
|
Charting.propTypes = propTypes;
|
|
2083
|
-
Charting.defaultProps = defaultProps;
|
|
2084
|
-
|
|
2387
|
+
Charting.defaultProps = defaultProps; // allow for early return in case of empty chartData while still following hook rules
|
|
2388
|
+
|
|
2085
2389
|
var withEmptyChartMessage = function withEmptyChartMessage(Chart) {
|
|
2086
2390
|
var Wrapper = function Wrapper(props) {
|
|
2087
2391
|
var chartData = props.chartData;
|
|
2392
|
+
|
|
2088
2393
|
if (!chartData) {
|
|
2089
2394
|
return React.createElement(Message_1.default, {
|
|
2090
2395
|
message: (0, i18n_1._)('No DataSource'),
|
|
2091
2396
|
level: "warning"
|
|
2092
2397
|
});
|
|
2093
2398
|
}
|
|
2399
|
+
|
|
2094
2400
|
if (chartData && !Object.keys(chartData).length) {
|
|
2095
2401
|
return React.createElement(Message_1.default, {
|
|
2096
2402
|
message: (0, i18n_1._)('No Result'),
|
|
2097
2403
|
level: "info"
|
|
2098
2404
|
});
|
|
2099
2405
|
}
|
|
2406
|
+
|
|
2100
2407
|
return React.createElement(Chart, Object.assign({}, props));
|
|
2101
2408
|
};
|
|
2409
|
+
|
|
2102
2410
|
Wrapper.displayName = 'ChartingWrapper';
|
|
2103
2411
|
Wrapper.propTypes = propTypes;
|
|
2104
2412
|
Wrapper.defaultProps = defaultProps;
|
|
2105
2413
|
return Wrapper;
|
|
2106
|
-
};
|
|
2107
|
-
|
|
2414
|
+
}; // export default Charting;
|
|
2415
|
+
|
|
2416
|
+
|
|
2108
2417
|
exports.default = withEmptyChartMessage(Charting);
|
|
2109
2418
|
|
|
2110
2419
|
/***/ }),
|
|
@@ -2133,15 +2442,19 @@ module.exports = require("@splunk/visualizations-shared/themeUtils");
|
|
|
2133
2442
|
|
|
2134
2443
|
|
|
2135
2444
|
var _classCallCheck = __webpack_require__(9);
|
|
2445
|
+
|
|
2136
2446
|
var _createClass = __webpack_require__(18);
|
|
2447
|
+
|
|
2137
2448
|
Object.defineProperty(exports, "__esModule", {
|
|
2138
2449
|
value: true
|
|
2139
2450
|
});
|
|
2140
2451
|
exports.ChartingApiFunctional = void 0;
|
|
2452
|
+
|
|
2141
2453
|
var ChartingApiFunctional = /*#__PURE__*/function () {
|
|
2142
2454
|
// eslint-disable-next-line no-useless-constructor
|
|
2143
2455
|
function ChartingApiFunctional(chartRef) {
|
|
2144
2456
|
_classCallCheck(this, ChartingApiFunctional);
|
|
2457
|
+
|
|
2145
2458
|
this.chartRef = chartRef;
|
|
2146
2459
|
}
|
|
2147
2460
|
/**
|
|
@@ -2149,15 +2462,18 @@ var ChartingApiFunctional = /*#__PURE__*/function () {
|
|
|
2149
2462
|
*
|
|
2150
2463
|
* @memberof ChartingApiFunctional
|
|
2151
2464
|
*/
|
|
2465
|
+
|
|
2466
|
+
|
|
2152
2467
|
_createClass(ChartingApiFunctional, [{
|
|
2153
2468
|
key: "highlight",
|
|
2154
2469
|
value: function highlight() {
|
|
2155
2470
|
var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2471
|
+
xValue: '',
|
|
2472
|
+
seriesName: ''
|
|
2473
|
+
},
|
|
2474
|
+
xValue = _ref.xValue,
|
|
2475
|
+
seriesName = _ref.seriesName;
|
|
2476
|
+
|
|
2161
2477
|
this.getChart().highlight(xValue, seriesName);
|
|
2162
2478
|
}
|
|
2163
2479
|
/**
|
|
@@ -2165,21 +2481,25 @@ var ChartingApiFunctional = /*#__PURE__*/function () {
|
|
|
2165
2481
|
*
|
|
2166
2482
|
* @memberof ChartingApiFunctional
|
|
2167
2483
|
*/
|
|
2484
|
+
|
|
2168
2485
|
}, {
|
|
2169
2486
|
key: "unHighlight",
|
|
2170
2487
|
value: function unHighlight() {
|
|
2171
2488
|
this.getChart().unHighlight();
|
|
2172
|
-
}
|
|
2173
|
-
|
|
2489
|
+
} // returns chart object
|
|
2490
|
+
|
|
2174
2491
|
}, {
|
|
2175
2492
|
key: "getChart",
|
|
2176
2493
|
value: function getChart() {
|
|
2177
2494
|
var _a;
|
|
2495
|
+
|
|
2178
2496
|
return (_a = this.chartRef) === null || _a === void 0 ? void 0 : _a.current;
|
|
2179
2497
|
}
|
|
2180
2498
|
}]);
|
|
2499
|
+
|
|
2181
2500
|
return ChartingApiFunctional;
|
|
2182
2501
|
}();
|
|
2502
|
+
|
|
2183
2503
|
exports.ChartingApiFunctional = ChartingApiFunctional;
|
|
2184
2504
|
|
|
2185
2505
|
/***/ }),
|
|
@@ -2199,12 +2519,16 @@ module.exports = require("@splunk/visualizations-shared/simpleXMLOptions");
|
|
|
2199
2519
|
|
|
2200
2520
|
|
|
2201
2521
|
var _toConsumableArray = __webpack_require__(8);
|
|
2522
|
+
|
|
2202
2523
|
Object.defineProperty(exports, "__esModule", {
|
|
2203
2524
|
value: true
|
|
2204
2525
|
});
|
|
2205
2526
|
exports.AxesChartDataConfigAreaColumnLine = exports.AxesChartDataConfigBubble = exports.AxesChartDataConfigScatter = exports.AxesChartDataConfigBar = void 0;
|
|
2527
|
+
|
|
2206
2528
|
var i18n_1 = __webpack_require__(2);
|
|
2529
|
+
|
|
2207
2530
|
var configUtils_1 = __webpack_require__(20);
|
|
2531
|
+
|
|
2208
2532
|
var AxesChartDataConfig = {
|
|
2209
2533
|
label: (0, i18n_1._)('Data configurations'),
|
|
2210
2534
|
layout: [[{
|
|
@@ -2337,10 +2661,15 @@ exports.default = AxesChartDataConfig;
|
|
|
2337
2661
|
Object.defineProperty(exports, "__esModule", {
|
|
2338
2662
|
value: true
|
|
2339
2663
|
});
|
|
2664
|
+
|
|
2340
2665
|
var i18n_1 = __webpack_require__(2);
|
|
2666
|
+
|
|
2341
2667
|
var pick_1 = __webpack_require__(23);
|
|
2668
|
+
|
|
2342
2669
|
var variables_1 = __webpack_require__(11);
|
|
2670
|
+
|
|
2343
2671
|
var BackgroundColor_1 = __webpack_require__(53);
|
|
2672
|
+
|
|
2344
2673
|
var themes = {
|
|
2345
2674
|
defaultBackgroundColor: function defaultBackgroundColor(props) {
|
|
2346
2675
|
return (0, pick_1.default)({
|
|
@@ -2378,7 +2707,9 @@ exports.default = AxesChartColorAndStyle;
|
|
|
2378
2707
|
Object.defineProperty(exports, "__esModule", {
|
|
2379
2708
|
value: true
|
|
2380
2709
|
});
|
|
2710
|
+
|
|
2381
2711
|
var i18n_1 = __webpack_require__(2);
|
|
2712
|
+
|
|
2382
2713
|
var AxesChartLegend = {
|
|
2383
2714
|
label: (0, i18n_1._)('Legend'),
|
|
2384
2715
|
layout: [[{
|
|
@@ -2438,12 +2769,16 @@ exports.default = AxesChartLegend;
|
|
|
2438
2769
|
|
|
2439
2770
|
|
|
2440
2771
|
var _toConsumableArray = __webpack_require__(8);
|
|
2772
|
+
|
|
2441
2773
|
Object.defineProperty(exports, "__esModule", {
|
|
2442
2774
|
value: true
|
|
2443
2775
|
});
|
|
2444
2776
|
exports.AxesChartXGridAndLabelsBubbleScatter = exports.AxesChartXGridAndLabelsCommon = void 0;
|
|
2777
|
+
|
|
2445
2778
|
var i18n_1 = __webpack_require__(2);
|
|
2779
|
+
|
|
2446
2780
|
var configUtils_1 = __webpack_require__(20);
|
|
2781
|
+
|
|
2447
2782
|
exports.AxesChartXGridAndLabelsCommon = {
|
|
2448
2783
|
label: (0, i18n_1._)('X-axis grid and labels'),
|
|
2449
2784
|
layout: [[{
|
|
@@ -2632,8 +2967,7 @@ exports.AxesChartXGridAndLabelsBubbleScatter = {
|
|
|
2632
2967
|
label: (0, i18n_1._)('Axis line visibility'),
|
|
2633
2968
|
option: 'xAxisLineVisibility',
|
|
2634
2969
|
editor: 'editor.checkbox'
|
|
2635
|
-
}],
|
|
2636
|
-
// this option is disabled for bubble and scatter
|
|
2970
|
+
}], // this option is disabled for bubble and scatter
|
|
2637
2971
|
// [
|
|
2638
2972
|
// {
|
|
2639
2973
|
// label: _('Major gridlines'),
|
|
@@ -2725,7 +3059,9 @@ exports.default = AxesChartXGridAndLabels;
|
|
|
2725
3059
|
Object.defineProperty(exports, "__esModule", {
|
|
2726
3060
|
value: true
|
|
2727
3061
|
});
|
|
3062
|
+
|
|
2728
3063
|
var i18n_1 = __webpack_require__(2);
|
|
3064
|
+
|
|
2729
3065
|
var AxesChartYGridAndLabels = {
|
|
2730
3066
|
label: (0, i18n_1._)('Y-axis grid and labels'),
|
|
2731
3067
|
layout: [[{
|
|
@@ -2885,20 +3221,26 @@ exports.default = AxesChartYGridAndLabels;
|
|
|
2885
3221
|
/* 85 */,
|
|
2886
3222
|
/* 86 */,
|
|
2887
3223
|
/* 87 */,
|
|
2888
|
-
/* 88
|
|
3224
|
+
/* 88 */,
|
|
3225
|
+
/* 89 */
|
|
2889
3226
|
/***/ (function(module, exports, __webpack_require__) {
|
|
2890
3227
|
|
|
2891
3228
|
"use strict";
|
|
2892
3229
|
|
|
2893
3230
|
|
|
2894
3231
|
var _toConsumableArray = __webpack_require__(8);
|
|
3232
|
+
|
|
2895
3233
|
Object.defineProperty(exports, "__esModule", {
|
|
2896
3234
|
value: true
|
|
2897
3235
|
});
|
|
2898
3236
|
exports.AxesChartDataDisplayColumn = exports.AxesChartDataDisplayBar = exports.AxesChartDataDisplayLine = void 0;
|
|
3237
|
+
|
|
2899
3238
|
var i18n_1 = __webpack_require__(2);
|
|
3239
|
+
|
|
2900
3240
|
var lodash_1 = __webpack_require__(3);
|
|
3241
|
+
|
|
2901
3242
|
var configUtils_1 = __webpack_require__(20);
|
|
3243
|
+
|
|
2902
3244
|
exports.AxesChartDataDisplayLine = {
|
|
2903
3245
|
label: (0, i18n_1._)('Data display'),
|
|
2904
3246
|
layout: [[{
|
|
@@ -3018,7 +3360,7 @@ exports.AxesChartDataDisplayColumn = {
|
|
|
3018
3360
|
exports.default = AxesChartDataDisplay;
|
|
3019
3361
|
|
|
3020
3362
|
/***/ }),
|
|
3021
|
-
/*
|
|
3363
|
+
/* 90 */
|
|
3022
3364
|
/***/ (function(module, exports, __webpack_require__) {
|
|
3023
3365
|
|
|
3024
3366
|
"use strict";
|
|
@@ -3027,7 +3369,9 @@ exports.default = AxesChartDataDisplay;
|
|
|
3027
3369
|
Object.defineProperty(exports, "__esModule", {
|
|
3028
3370
|
value: true
|
|
3029
3371
|
});
|
|
3372
|
+
|
|
3030
3373
|
var i18n_1 = __webpack_require__(2);
|
|
3374
|
+
|
|
3031
3375
|
var axesChartY2GridAndLabels = {
|
|
3032
3376
|
label: (0, i18n_1._)('Y2-axis grid and labels'),
|
|
3033
3377
|
layout: [[{
|
|
@@ -3190,7 +3534,6 @@ var axesChartY2GridAndLabels = {
|
|
|
3190
3534
|
exports.default = axesChartY2GridAndLabels;
|
|
3191
3535
|
|
|
3192
3536
|
/***/ }),
|
|
3193
|
-
/* 90 */,
|
|
3194
3537
|
/* 91 */,
|
|
3195
3538
|
/* 92 */,
|
|
3196
3539
|
/* 93 */,
|
|
@@ -3263,48 +3606,64 @@ exports.default = axesChartY2GridAndLabels;
|
|
|
3263
3606
|
|
|
3264
3607
|
var __rest = this && this.__rest || function (s, e) {
|
|
3265
3608
|
var t = {};
|
|
3609
|
+
|
|
3266
3610
|
for (var p in s) {
|
|
3267
3611
|
if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
3268
3612
|
}
|
|
3613
|
+
|
|
3269
3614
|
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
3270
3615
|
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
3271
3616
|
}
|
|
3272
3617
|
return t;
|
|
3273
3618
|
};
|
|
3619
|
+
|
|
3274
3620
|
Object.defineProperty(exports, "__esModule", {
|
|
3275
3621
|
value: true
|
|
3276
3622
|
});
|
|
3277
3623
|
exports.config = exports.themes = exports.computeVizProps = void 0;
|
|
3278
|
-
|
|
3279
|
-
// Charting imports i18n which needs to be run to instantiate window globals in the tests
|
|
3624
|
+
|
|
3625
|
+
var lodash_1 = __webpack_require__(3); // Charting imports i18n which needs to be run to instantiate window globals in the tests
|
|
3280
3626
|
// eslint-disable-next-line import/order
|
|
3627
|
+
|
|
3628
|
+
|
|
3281
3629
|
var Charting_1 = __webpack_require__(65);
|
|
3630
|
+
|
|
3282
3631
|
var charting_bundle_1 = __webpack_require__(55);
|
|
3632
|
+
|
|
3283
3633
|
var simpleXMLOptions_1 = __webpack_require__(70);
|
|
3634
|
+
|
|
3284
3635
|
var config_1 = __webpack_require__(224);
|
|
3636
|
+
|
|
3285
3637
|
exports.config = config_1.default;
|
|
3286
|
-
|
|
3638
|
+
|
|
3639
|
+
var withDashboardViz_1 = __webpack_require__(37);
|
|
3640
|
+
|
|
3287
3641
|
var lineUtils_1 = __webpack_require__(225);
|
|
3642
|
+
|
|
3288
3643
|
var chartingUtils_1 = __webpack_require__(56);
|
|
3644
|
+
|
|
3289
3645
|
var validOptions = Object.keys(config_1.default.optionsSchema);
|
|
3646
|
+
|
|
3290
3647
|
var computeVizProps = function computeVizProps(_a) {
|
|
3291
3648
|
var dataSources = _a.dataSources,
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3649
|
+
x = _a.x,
|
|
3650
|
+
y = _a.y,
|
|
3651
|
+
xField = _a.xField,
|
|
3652
|
+
yFields = _a.yFields,
|
|
3653
|
+
onEventTrigger = _a.onEventTrigger,
|
|
3654
|
+
annotationX = _a.annotationX,
|
|
3655
|
+
annotationColor = _a.annotationColor,
|
|
3656
|
+
annotationLabel = _a.annotationLabel,
|
|
3657
|
+
visualizationApiRef = _a.visualizationApiRef,
|
|
3658
|
+
otherOptions = __rest(_a, ["dataSources", "x", "y", "xField", "yFields", "onEventTrigger", "annotationX", "annotationColor", "annotationLabel", "visualizationApiRef"]); // options to be passed as props
|
|
3659
|
+
|
|
3660
|
+
|
|
3302
3661
|
var computedProps = {
|
|
3303
3662
|
visualizationApiRef: visualizationApiRef
|
|
3304
3663
|
};
|
|
3305
3664
|
var y2 = otherOptions.y2,
|
|
3306
|
-
|
|
3307
|
-
|
|
3665
|
+
y2Fields = otherOptions.y2Fields,
|
|
3666
|
+
hasEventHandlers = otherOptions.hasEventHandlers;
|
|
3308
3667
|
computedProps.options = (0, lodash_1.chain)(otherOptions).pick(validOptions).thru(lineUtils_1.convertToLineSCProperties).thru(function (options) {
|
|
3309
3668
|
return Object.assign(Object.assign({}, (0, simpleXMLOptions_1.getSimpleXMLOptionsForProps)(options)), {
|
|
3310
3669
|
chart: 'line'
|
|
@@ -3317,32 +3676,39 @@ var computeVizProps = function computeVizProps(_a) {
|
|
|
3317
3676
|
});
|
|
3318
3677
|
var truncationLimit = computedProps.options['chart.resultTruncationLimit'];
|
|
3319
3678
|
var primaryData = Object.assign({}, dataSources.primary.data);
|
|
3679
|
+
|
|
3320
3680
|
var _ref = (0, chartingUtils_1.constructFieldsAndColumns)({
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3681
|
+
x: x,
|
|
3682
|
+
y: y,
|
|
3683
|
+
xField: xField,
|
|
3684
|
+
yFields: yFields,
|
|
3685
|
+
y2: y2,
|
|
3686
|
+
y2Fields: y2Fields
|
|
3687
|
+
}),
|
|
3688
|
+
columns = _ref.columns,
|
|
3689
|
+
fields = _ref.fields;
|
|
3690
|
+
|
|
3330
3691
|
primaryData.columns = columns;
|
|
3331
3692
|
primaryData.fields = fields;
|
|
3693
|
+
|
|
3332
3694
|
if (truncationLimit) {
|
|
3333
3695
|
primaryData = (0, chartingUtils_1.truncateData)(primaryData, truncationLimit);
|
|
3334
3696
|
}
|
|
3697
|
+
|
|
3335
3698
|
computedProps.chartData = charting_bundle_1.default.extractChartReadyData(Object.assign(Object.assign({}, primaryData), {
|
|
3336
3699
|
annotations: chartingAnnotations
|
|
3337
3700
|
}));
|
|
3701
|
+
|
|
3338
3702
|
if (hasEventHandlers) {
|
|
3339
3703
|
computedProps.onClick = onEventTrigger;
|
|
3340
3704
|
computedProps.onSelect = onEventTrigger;
|
|
3341
3705
|
computedProps.onPointMouseOver = onEventTrigger;
|
|
3342
3706
|
computedProps.onPointMouseOut = onEventTrigger;
|
|
3343
3707
|
}
|
|
3708
|
+
|
|
3344
3709
|
return computedProps;
|
|
3345
3710
|
};
|
|
3711
|
+
|
|
3346
3712
|
exports.computeVizProps = computeVizProps;
|
|
3347
3713
|
var Line = (0, withDashboardViz_1.default)({
|
|
3348
3714
|
ReactViz: Charting_1.default,
|
|
@@ -3430,6 +3796,7 @@ exports.default = Line;
|
|
|
3430
3796
|
var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
|
|
3431
3797
|
if (k2 === undefined) k2 = k;
|
|
3432
3798
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
3799
|
+
|
|
3433
3800
|
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
3434
3801
|
desc = {
|
|
3435
3802
|
enumerable: true,
|
|
@@ -3438,22 +3805,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
|
|
|
3438
3805
|
}
|
|
3439
3806
|
};
|
|
3440
3807
|
}
|
|
3808
|
+
|
|
3441
3809
|
Object.defineProperty(o, k2, desc);
|
|
3442
3810
|
} : function (o, m, k, k2) {
|
|
3443
3811
|
if (k2 === undefined) k2 = k;
|
|
3444
3812
|
o[k2] = m[k];
|
|
3445
3813
|
});
|
|
3814
|
+
|
|
3446
3815
|
var __exportStar = this && this.__exportStar || function (m, exports) {
|
|
3447
3816
|
for (var p in m) {
|
|
3448
3817
|
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
3449
3818
|
}
|
|
3450
3819
|
};
|
|
3820
|
+
|
|
3451
3821
|
Object.defineProperty(exports, "__esModule", {
|
|
3452
3822
|
value: true
|
|
3453
3823
|
});
|
|
3454
3824
|
exports.default = void 0;
|
|
3825
|
+
|
|
3455
3826
|
__exportStar(__webpack_require__(155), exports);
|
|
3827
|
+
|
|
3456
3828
|
var Line_1 = __webpack_require__(155);
|
|
3829
|
+
|
|
3457
3830
|
Object.defineProperty(exports, "default", {
|
|
3458
3831
|
enumerable: true,
|
|
3459
3832
|
get: function get() {
|
|
@@ -3469,26 +3842,45 @@ Object.defineProperty(exports, "default", {
|
|
|
3469
3842
|
|
|
3470
3843
|
|
|
3471
3844
|
var _toConsumableArray = __webpack_require__(8);
|
|
3845
|
+
|
|
3472
3846
|
Object.defineProperty(exports, "__esModule", {
|
|
3473
3847
|
value: true
|
|
3474
3848
|
});
|
|
3849
|
+
|
|
3475
3850
|
var schemaUtils_1 = __webpack_require__(16);
|
|
3851
|
+
|
|
3476
3852
|
var visualization_color_palettes_1 = __webpack_require__(51);
|
|
3853
|
+
|
|
3477
3854
|
var visualization_icons_1 = __webpack_require__(52);
|
|
3855
|
+
|
|
3478
3856
|
var placeholders_1 = __webpack_require__(50);
|
|
3857
|
+
|
|
3479
3858
|
var i18n_1 = __webpack_require__(2);
|
|
3859
|
+
|
|
3480
3860
|
var pick_1 = __webpack_require__(23);
|
|
3861
|
+
|
|
3481
3862
|
var variables_1 = __webpack_require__(11);
|
|
3863
|
+
|
|
3482
3864
|
var AxesChartDataConfig_1 = __webpack_require__(74);
|
|
3483
|
-
|
|
3865
|
+
|
|
3866
|
+
var AxesChartDataDisplay_1 = __webpack_require__(89);
|
|
3867
|
+
|
|
3484
3868
|
var AxesChartColorAndStyle_1 = __webpack_require__(75);
|
|
3869
|
+
|
|
3485
3870
|
var AxesChartLegend_1 = __webpack_require__(76);
|
|
3871
|
+
|
|
3486
3872
|
var AxesChartXGridAndLabels_1 = __webpack_require__(77);
|
|
3873
|
+
|
|
3487
3874
|
var AxesChartYGridAndLabels_1 = __webpack_require__(78);
|
|
3488
|
-
|
|
3875
|
+
|
|
3876
|
+
var AxesChartY2GridAndLabels_1 = __webpack_require__(90);
|
|
3877
|
+
|
|
3489
3878
|
var VizBehavior_1 = __webpack_require__(6);
|
|
3490
|
-
|
|
3879
|
+
|
|
3880
|
+
var VizCategory_1 = __webpack_require__(36);
|
|
3881
|
+
|
|
3491
3882
|
var configUtils_1 = __webpack_require__(20);
|
|
3883
|
+
|
|
3492
3884
|
var dataContract = {
|
|
3493
3885
|
requiredDataSources: [{
|
|
3494
3886
|
name: 'primary',
|
|
@@ -3947,8 +4339,7 @@ var themes = {
|
|
|
3947
4339
|
};
|
|
3948
4340
|
var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigAreaColumnLine, AxesChartDataDisplay_1.AxesChartDataDisplayLine, {
|
|
3949
4341
|
label: AxesChartColorAndStyle_1.default.label,
|
|
3950
|
-
layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout), [
|
|
3951
|
-
// [
|
|
4342
|
+
layout: [].concat(_toConsumableArray(AxesChartColorAndStyle_1.default.layout), [// [
|
|
3952
4343
|
// {
|
|
3953
4344
|
// label: _('Line dash style'),
|
|
3954
4345
|
// option: 'lineDashStyle',
|
|
@@ -4071,16 +4462,19 @@ var editorConfig = [AxesChartDataConfig_1.AxesChartDataConfigAreaColumnLine, Axe
|
|
|
4071
4462
|
/**
|
|
4072
4463
|
* visualization configuration
|
|
4073
4464
|
*/
|
|
4465
|
+
|
|
4074
4466
|
var config = {
|
|
4075
4467
|
/**
|
|
4076
4468
|
* unique viz key
|
|
4077
4469
|
*/
|
|
4078
4470
|
key: 'splunk.line',
|
|
4471
|
+
|
|
4079
4472
|
/**
|
|
4080
4473
|
* viz name
|
|
4081
4474
|
*/
|
|
4082
4475
|
name: (0, i18n_1._)('Line'),
|
|
4083
4476
|
category: VizCategory_1.VizCategory.TRENDS,
|
|
4477
|
+
|
|
4084
4478
|
/**
|
|
4085
4479
|
* viz icon
|
|
4086
4480
|
*/
|
|
@@ -4124,10 +4518,14 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4124
4518
|
value: true
|
|
4125
4519
|
});
|
|
4126
4520
|
exports.convertToLineSCProperties = exports.convertToStringValues = exports.mapToOldKey = exports.convertMarkerOptions = exports.lineOptionValuesSCMapping = void 0;
|
|
4521
|
+
|
|
4127
4522
|
var lodash_1 = __webpack_require__(3);
|
|
4523
|
+
|
|
4128
4524
|
var propUtils_1 = __webpack_require__(29);
|
|
4129
|
-
|
|
4130
|
-
// map for key names which are either new or not present in SimpleXML options mapping
|
|
4525
|
+
|
|
4526
|
+
var chartingUtils_1 = __webpack_require__(56); // map for key names which are either new or not present in SimpleXML options mapping
|
|
4527
|
+
|
|
4528
|
+
|
|
4131
4529
|
var lineOptionsSCMapping = {
|
|
4132
4530
|
markerDisplay: 'lineMarkerStyle',
|
|
4133
4531
|
legendDisplay: 'legendPlacement',
|
|
@@ -4159,8 +4557,8 @@ var lineOptionsSCMapping = {
|
|
|
4159
4557
|
yAxisLineVisibility: 'yAxisVisibility',
|
|
4160
4558
|
y2AxisLineVisibility: 'y2AxisVisibility',
|
|
4161
4559
|
showLineSmoothing: 'enableLineSmoothing'
|
|
4162
|
-
};
|
|
4163
|
-
|
|
4560
|
+
}; // key value mapping of what options (and their corresponding values) which we expose in config.ts to property values SC understands
|
|
4561
|
+
|
|
4164
4562
|
exports.lineOptionValuesSCMapping = {
|
|
4165
4563
|
lineMarkerStyle: {
|
|
4166
4564
|
filled: 'normal',
|
|
@@ -4197,16 +4595,20 @@ exports.lineOptionValuesSCMapping = {
|
|
|
4197
4595
|
* @param {Object} originalOptions
|
|
4198
4596
|
* @returns {Object}
|
|
4199
4597
|
*/
|
|
4598
|
+
|
|
4200
4599
|
var convertMarkerOptions = function convertMarkerOptions(originalOptions) {
|
|
4201
4600
|
var convertedOptions = {
|
|
4202
4601
|
showMarkers: false
|
|
4203
4602
|
};
|
|
4603
|
+
|
|
4204
4604
|
if ((0, lodash_1.values)(exports.lineOptionValuesSCMapping.lineMarkerStyle).includes(originalOptions.lineMarkerStyle)) {
|
|
4205
4605
|
convertedOptions.showMarkers = true;
|
|
4206
4606
|
return Object.assign(Object.assign({}, originalOptions), convertedOptions);
|
|
4207
4607
|
}
|
|
4608
|
+
|
|
4208
4609
|
return (0, lodash_1.omit)(Object.assign(Object.assign({}, originalOptions), convertedOptions), ['lineMarkerStyle']);
|
|
4209
4610
|
};
|
|
4611
|
+
|
|
4210
4612
|
exports.convertMarkerOptions = convertMarkerOptions;
|
|
4211
4613
|
/**
|
|
4212
4614
|
* Helper method to update the option names which can be mapped to SimpleXML options or
|
|
@@ -4215,11 +4617,13 @@ exports.convertMarkerOptions = convertMarkerOptions;
|
|
|
4215
4617
|
* @param {Object} options
|
|
4216
4618
|
* @returns {Object}
|
|
4217
4619
|
*/
|
|
4620
|
+
|
|
4218
4621
|
var mapToOldKey = function mapToOldKey(options) {
|
|
4219
4622
|
return (0, lodash_1.mapKeys)(options, function (val, key) {
|
|
4220
4623
|
return lineOptionsSCMapping[key] ? lineOptionsSCMapping[key] : key;
|
|
4221
4624
|
});
|
|
4222
4625
|
};
|
|
4626
|
+
|
|
4223
4627
|
exports.mapToOldKey = mapToOldKey;
|
|
4224
4628
|
/**
|
|
4225
4629
|
* Helper method to convert option which contains object literal values (e.g. arrays, objects)
|
|
@@ -4228,6 +4632,7 @@ exports.mapToOldKey = mapToOldKey;
|
|
|
4228
4632
|
* @param {Object} options
|
|
4229
4633
|
* @returns {Object}
|
|
4230
4634
|
*/
|
|
4635
|
+
|
|
4231
4636
|
var convertToStringValues = function convertToStringValues(options) {
|
|
4232
4637
|
var updatedOptions = (0, propUtils_1.convertPropsToString)({
|
|
4233
4638
|
vizProps: options,
|
|
@@ -4235,6 +4640,7 @@ var convertToStringValues = function convertToStringValues(options) {
|
|
|
4235
4640
|
});
|
|
4236
4641
|
return Object.assign(Object.assign({}, options), updatedOptions);
|
|
4237
4642
|
};
|
|
4643
|
+
|
|
4238
4644
|
exports.convertToStringValues = convertToStringValues;
|
|
4239
4645
|
/**
|
|
4240
4646
|
* Chained helper for mapping the option properties (and values) we expose in config.ts into property values that splunk-charting accepts
|
|
@@ -4244,9 +4650,11 @@ exports.convertToStringValues = convertToStringValues;
|
|
|
4244
4650
|
* @param {Object} originalOptions
|
|
4245
4651
|
* @returns {Object}
|
|
4246
4652
|
*/
|
|
4653
|
+
|
|
4247
4654
|
var convertToLineSCProperties = function convertToLineSCProperties(originalOptions) {
|
|
4248
4655
|
return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru((0, chartingUtils_1.mapToValues)(exports.lineOptionValuesSCMapping)).thru(exports.convertToStringValues).thru(exports.convertMarkerOptions).thru(chartingUtils_1.convertOverlayFields).thru(chartingUtils_1.convertY2AxisOptions).value();
|
|
4249
4656
|
};
|
|
4657
|
+
|
|
4250
4658
|
exports.convertToLineSCProperties = convertToLineSCProperties;
|
|
4251
4659
|
|
|
4252
4660
|
/***/ })
|