@splunk/visualizations 26.4.0 → 27.0.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 +1262 -1600
- package/Area.config.js.map +7 -1
- package/Area.js +3002 -4920
- package/Area.js.map +7 -1
- package/Bar.config.js +1247 -1574
- package/Bar.config.js.map +7 -1
- package/Bar.js +2924 -4836
- package/Bar.js.map +7 -1
- package/Bubble.config.js +896 -1213
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2520 -4476
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2004 -3810
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1208 -1541
- package/Column.config.js.map +7 -1
- package/Column.js +2933 -4879
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1651 -3341
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2615 -4649
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2137 -4578
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1395 -3048
- package/Image.js.map +7 -1
- package/Line.config.js +1278 -1625
- package/Line.config.js.map +7 -1
- package/Line.js +2957 -4919
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5243 -6190
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +12 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3369 -5676
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1645 -3216
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2189 -4535
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2023 -4720
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +1998 -3982
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2709 -5042
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1638 -3262
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2737 -4909
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +876 -1194
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2532 -4470
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +819 -1251
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4203 -7413
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +781 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3350 -6285
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +708 -1119
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3808 -6965
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/Table.config.js +565 -887
- package/Table.config.js.map +7 -1
- package/Table.js +3277 -5386
- package/Table.js.map +7 -1
- package/common/Charting.js +484 -1462
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +347 -912
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +462 -1010
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +237 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1168 -2438
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +52 -43
package/Image.config.js
CHANGED
|
@@ -1,314 +1,120 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
55
|
-
/******/ };
|
|
56
|
-
/******/
|
|
57
|
-
/******/ // create a fake namespace object
|
|
58
|
-
/******/ // mode & 1: value is a module id, require it
|
|
59
|
-
/******/ // mode & 2: merge all properties of value into the ns
|
|
60
|
-
/******/ // mode & 4: return value when already ns object
|
|
61
|
-
/******/ // mode & 8|1: behave like require
|
|
62
|
-
/******/ __webpack_require__.t = function(value, mode) {
|
|
63
|
-
/******/ if(mode & 1) value = __webpack_require__(value);
|
|
64
|
-
/******/ if(mode & 8) return value;
|
|
65
|
-
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
|
|
66
|
-
/******/ var ns = Object.create(null);
|
|
67
|
-
/******/ __webpack_require__.r(ns);
|
|
68
|
-
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
|
|
69
|
-
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
|
|
70
|
-
/******/ return ns;
|
|
71
|
-
/******/ };
|
|
72
|
-
/******/
|
|
73
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
74
|
-
/******/ __webpack_require__.n = function(module) {
|
|
75
|
-
/******/ var getter = module && module.__esModule ?
|
|
76
|
-
/******/ function getDefault() { return module['default']; } :
|
|
77
|
-
/******/ function getModuleExports() { return module; };
|
|
78
|
-
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
79
|
-
/******/ return getter;
|
|
80
|
-
/******/ };
|
|
81
|
-
/******/
|
|
82
|
-
/******/ // Object.prototype.hasOwnProperty.call
|
|
83
|
-
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
84
|
-
/******/
|
|
85
|
-
/******/ // __webpack_public_path__
|
|
86
|
-
/******/ __webpack_require__.p = "";
|
|
87
|
-
/******/
|
|
88
|
-
/******/
|
|
89
|
-
/******/ // Load entry module and return exports
|
|
90
|
-
/******/ return __webpack_require__(__webpack_require__.s = 51);
|
|
91
|
-
/******/ })
|
|
92
|
-
/************************************************************************/
|
|
93
|
-
/******/ ({
|
|
94
|
-
|
|
95
|
-
/***/ 0:
|
|
96
|
-
/***/ (function(module, exports) {
|
|
97
|
-
|
|
98
|
-
module.exports = require("@splunk/ui-utils/i18n");
|
|
99
|
-
|
|
100
|
-
/***/ }),
|
|
101
|
-
|
|
102
|
-
/***/ 1:
|
|
103
|
-
/***/ (function(module, exports) {
|
|
104
|
-
|
|
105
|
-
module.exports = require("@babel/runtime/helpers/toConsumableArray");
|
|
106
|
-
|
|
107
|
-
/***/ }),
|
|
108
|
-
|
|
109
|
-
/***/ 11:
|
|
110
|
-
/***/ (function(module, exports) {
|
|
111
|
-
|
|
112
|
-
module.exports = require("@splunk/visualization-icons");
|
|
113
|
-
|
|
114
|
-
/***/ }),
|
|
115
|
-
|
|
116
|
-
/***/ 2:
|
|
117
|
-
/***/ (function(module, exports) {
|
|
118
|
-
|
|
119
|
-
module.exports = require("@splunk/visualization-schemas");
|
|
120
|
-
|
|
121
|
-
/***/ }),
|
|
122
|
-
|
|
123
|
-
/***/ 3:
|
|
124
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
125
|
-
|
|
126
|
-
"use strict";
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
130
|
-
|
|
131
|
-
Object.defineProperty(exports, "__esModule", {
|
|
132
|
-
value: true
|
|
1
|
+
/* Copyright © 2020 Splunk Inc.
|
|
2
|
+
SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
|
|
3
|
+
in part without a valid written license from Splunk Inc. is PROHIBITED. */
|
|
4
|
+
var __create = Object.create;
|
|
5
|
+
var __defProp = Object.defineProperty;
|
|
6
|
+
var __defProps = Object.defineProperties;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
10
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
27
|
+
var __export = (target, all) => {
|
|
28
|
+
for (var name in all)
|
|
29
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
30
|
+
};
|
|
31
|
+
var __copyProps = (to, from, except, desc) => {
|
|
32
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
33
|
+
for (let key of __getOwnPropNames(from))
|
|
34
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
35
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
36
|
+
}
|
|
37
|
+
return to;
|
|
38
|
+
};
|
|
39
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
40
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
41
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
42
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
43
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
44
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
45
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
46
|
+
mod
|
|
47
|
+
));
|
|
48
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
49
|
+
|
|
50
|
+
// src/Image/config.ts
|
|
51
|
+
var config_exports = {};
|
|
52
|
+
__export(config_exports, {
|
|
53
|
+
default: () => config_default
|
|
133
54
|
});
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
var lodash_1 = __webpack_require__(5); // included for backwards compatibility
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
55
|
+
module.exports = __toCommonJS(config_exports);
|
|
140
56
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
57
|
+
// esm-externals:@splunk/ui-utils/i18n
|
|
58
|
+
var i18n_exports = {};
|
|
59
|
+
__export(i18n_exports, {
|
|
60
|
+
default: () => i18n_default
|
|
61
|
+
});
|
|
62
|
+
var defaultImport = __toESM(require("@splunk/ui-utils/i18n"));
|
|
63
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
64
|
+
var i18n_default = "default" in defaultImport ? defaultImport.default : defaultImport;
|
|
65
|
+
|
|
66
|
+
// esm-externals:@splunk/visualization-schemas
|
|
67
|
+
var visualization_schemas_exports = {};
|
|
68
|
+
__export(visualization_schemas_exports, {
|
|
69
|
+
default: () => visualization_schemas_default
|
|
70
|
+
});
|
|
71
|
+
var defaultImport2 = __toESM(require("@splunk/visualization-schemas"));
|
|
72
|
+
__reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
|
|
73
|
+
var visualization_schemas_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
|
|
74
|
+
|
|
75
|
+
// esm-externals:@splunk/visualization-icons
|
|
76
|
+
var visualization_icons_exports = {};
|
|
77
|
+
__export(visualization_icons_exports, {
|
|
78
|
+
default: () => visualization_icons_default
|
|
146
79
|
});
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/visualization-icons"));
|
|
81
|
+
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
82
|
+
var visualization_icons_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
83
|
+
|
|
84
|
+
// esm-externals:lodash
|
|
85
|
+
var lodash_exports = {};
|
|
86
|
+
__export(lodash_exports, {
|
|
87
|
+
default: () => lodash_default
|
|
88
|
+
});
|
|
89
|
+
var defaultImport4 = __toESM(require("lodash"));
|
|
90
|
+
__reExport(lodash_exports, require("lodash"));
|
|
91
|
+
var lodash_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
|
+
|
|
93
|
+
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
94
|
+
var configUtils_exports = {};
|
|
95
|
+
__export(configUtils_exports, {
|
|
96
|
+
default: () => configUtils_default
|
|
97
|
+
});
|
|
98
|
+
var defaultImport5 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
99
|
+
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
100
|
+
var configUtils_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
154
101
|
|
|
102
|
+
// src/common/utils/configUtils.ts
|
|
155
103
|
function enhanceConfig(vizConfig) {
|
|
156
|
-
|
|
157
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
158
|
-
|
|
159
|
-
open:
|
|
160
|
-
}
|
|
161
|
-
|
|
104
|
+
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
105
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
106
|
+
(config2) => {
|
|
107
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
108
|
+
}
|
|
109
|
+
);
|
|
162
110
|
return enhancedConfig;
|
|
163
111
|
}
|
|
164
112
|
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
168
|
-
* Created for editor unit tests
|
|
169
|
-
* @param vizConfig a Visualization Config
|
|
170
|
-
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
171
|
-
*/
|
|
172
|
-
|
|
173
|
-
function uncollapseEditorConfig(vizConfig) {
|
|
174
|
-
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
175
|
-
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
176
|
-
return Object.assign(Object.assign({}, config), {
|
|
177
|
-
open: true
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
return editorPanelUncollapsedConfig;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
184
|
-
|
|
185
|
-
function isDynamicOption(option) {
|
|
186
|
-
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
190
|
-
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
194
|
-
* 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
|
|
195
|
-
* the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
|
|
196
|
-
* the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
|
|
197
|
-
*
|
|
198
|
-
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
199
|
-
*/
|
|
200
|
-
|
|
201
|
-
function hasCompatibleContexts(vizContext, presetContext) {
|
|
202
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
203
|
-
return presetContextKeys.every(function (contextKey) {
|
|
204
|
-
return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
209
|
-
*/
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
213
|
-
var presetOptionKeys = Object.keys(presetOptions);
|
|
214
|
-
return presetOptionKeys.every(function (optionKey) {
|
|
215
|
-
return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
/**
|
|
219
|
-
* Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
|
|
220
|
-
* This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
|
|
221
|
-
*
|
|
222
|
-
* @param {Object} vizContext - the current vizContext definition
|
|
223
|
-
* @param {Object} vizOptions - the current vizOptions definition
|
|
224
|
-
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
225
|
-
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
229
|
-
return presets.find(function (preset) {
|
|
230
|
-
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
231
|
-
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
232
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
233
|
-
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
234
|
-
// if not, then the preset is invalid in config.ts
|
|
235
|
-
|
|
236
|
-
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
237
|
-
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
exports.getInitialPreset = getInitialPreset;
|
|
242
|
-
/**
|
|
243
|
-
* generates number precision values for a Select editor
|
|
244
|
-
*
|
|
245
|
-
* @param {Number} numPrecisionValues - number of integer precision values to generate
|
|
246
|
-
* @returns {{ label: string; value; string }[]} array of { label, value } tuples
|
|
247
|
-
*/
|
|
248
|
-
|
|
249
|
-
function generatePrecisionValues(numPrecisionValues) {
|
|
250
|
-
return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
|
|
251
|
-
return {
|
|
252
|
-
label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
|
|
253
|
-
value: i
|
|
254
|
-
};
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
exports.generatePrecisionValues = generatePrecisionValues;
|
|
259
|
-
/**
|
|
260
|
-
* insert layout in layout array, return a new layout array instead of updating the original
|
|
261
|
-
*
|
|
262
|
-
* @param {EditorLayoutConfig[][]} layout - editor layout
|
|
263
|
-
* @param {Number} index - the index to insert layout item(s)
|
|
264
|
-
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
265
|
-
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
266
|
-
*/
|
|
267
|
-
|
|
268
|
-
var insertLayout = function insertLayout(layout, index) {
|
|
269
|
-
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
270
|
-
layoutItems[_key - 2] = arguments[_key];
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
exports.insertLayout = insertLayout;
|
|
277
|
-
|
|
278
|
-
/***/ }),
|
|
279
|
-
|
|
280
|
-
/***/ 5:
|
|
281
|
-
/***/ (function(module, exports) {
|
|
282
|
-
|
|
283
|
-
module.exports = require("lodash");
|
|
284
|
-
|
|
285
|
-
/***/ }),
|
|
286
|
-
|
|
287
|
-
/***/ 51:
|
|
288
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
289
|
-
|
|
290
|
-
"use strict";
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
Object.defineProperty(exports, "__esModule", {
|
|
294
|
-
value: true
|
|
295
|
-
});
|
|
296
|
-
|
|
297
|
-
var i18n_1 = __webpack_require__(0);
|
|
298
|
-
|
|
299
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
300
|
-
|
|
301
|
-
var visualization_icons_1 = __webpack_require__(11);
|
|
302
|
-
|
|
303
|
-
var VizBehavior_1 = __webpack_require__(6);
|
|
304
|
-
|
|
305
|
-
var VizCategory_1 = __webpack_require__(7);
|
|
306
|
-
|
|
307
|
-
var configUtils_1 = __webpack_require__(3);
|
|
308
|
-
|
|
113
|
+
// src/Image/config.ts
|
|
309
114
|
var dataContract = {
|
|
310
115
|
requiredDataSources: [],
|
|
311
|
-
optionalDataSources: [
|
|
116
|
+
optionalDataSources: [
|
|
117
|
+
// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
|
|
312
118
|
// {
|
|
313
119
|
// name: 'annotation',
|
|
314
120
|
// description: 'DataSource that populate event annotations',
|
|
@@ -321,128 +127,55 @@ var size = {
|
|
|
321
127
|
initialHeight: 300
|
|
322
128
|
};
|
|
323
129
|
var defaultContext = {};
|
|
324
|
-
var editorConfig = [
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
130
|
+
var editorConfig = [
|
|
131
|
+
{
|
|
132
|
+
label: (0, i18n_exports._)("Image content"),
|
|
133
|
+
layout: [
|
|
134
|
+
[
|
|
135
|
+
{
|
|
136
|
+
label: (0, i18n_exports._)("Image file"),
|
|
137
|
+
option: "src",
|
|
138
|
+
editor: "editor.image"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
[
|
|
142
|
+
{
|
|
143
|
+
label: (0, i18n_exports._)("Preserve aspect ratio"),
|
|
144
|
+
option: "preserveAspectRatio",
|
|
145
|
+
editor: "editor.checkbox",
|
|
146
|
+
showEditor: ({ options }) => !!options.src
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
]
|
|
150
|
+
}
|
|
151
|
+
];
|
|
340
152
|
var themes = {};
|
|
341
|
-
/**
|
|
342
|
-
* visualization configuration
|
|
343
|
-
*/
|
|
344
|
-
|
|
345
153
|
var config = {
|
|
346
154
|
/**
|
|
347
155
|
* unique viz key
|
|
348
156
|
*/
|
|
349
|
-
key:
|
|
350
|
-
|
|
157
|
+
key: "splunk.image",
|
|
351
158
|
/**
|
|
352
159
|
* viz name
|
|
353
160
|
*/
|
|
354
|
-
name: (0,
|
|
355
|
-
category:
|
|
356
|
-
|
|
161
|
+
name: (0, i18n_exports._)("Image"),
|
|
162
|
+
category: "misc" /* MISC */,
|
|
357
163
|
/**
|
|
358
164
|
* viz icon
|
|
359
165
|
*/
|
|
360
|
-
icon:
|
|
361
|
-
dataContract
|
|
362
|
-
size
|
|
363
|
-
defaultContext
|
|
364
|
-
optionsSchema:
|
|
365
|
-
editorConfig
|
|
366
|
-
supports: [
|
|
367
|
-
themes
|
|
166
|
+
icon: visualization_icons_exports.Image,
|
|
167
|
+
dataContract,
|
|
168
|
+
size,
|
|
169
|
+
defaultContext,
|
|
170
|
+
optionsSchema: visualization_schemas_exports.imageOptionsSchema,
|
|
171
|
+
editorConfig,
|
|
172
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "placeholder" /* PLACEHOLDER */, "events" /* EVENTS */],
|
|
173
|
+
themes,
|
|
368
174
|
events: {
|
|
369
|
-
|
|
370
|
-
description:
|
|
175
|
+
"image.click": {
|
|
176
|
+
description: "triggered when user clicks on the image"
|
|
371
177
|
}
|
|
372
178
|
}
|
|
373
179
|
};
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
/***/ }),
|
|
377
|
-
|
|
378
|
-
/***/ 6:
|
|
379
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
380
|
-
|
|
381
|
-
"use strict";
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
Object.defineProperty(exports, "__esModule", {
|
|
385
|
-
value: true
|
|
386
|
-
});
|
|
387
|
-
exports.VizBehavior = void 0;
|
|
388
|
-
var VizBehavior;
|
|
389
|
-
|
|
390
|
-
(function (VizBehavior) {
|
|
391
|
-
/**
|
|
392
|
-
* Dynamic Options Behavior.
|
|
393
|
-
* This allows visualization options to be powered by data
|
|
394
|
-
*
|
|
395
|
-
* **Example**
|
|
396
|
-
*
|
|
397
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
398
|
-
* would configure sparklineValues with an array of data points
|
|
399
|
-
* coming from the first series in the primary datasource
|
|
400
|
-
*
|
|
401
|
-
*/
|
|
402
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
403
|
-
VizBehavior["EVENTS"] = "events";
|
|
404
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
405
|
-
/**
|
|
406
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
407
|
-
* missing.
|
|
408
|
-
* @type {string}
|
|
409
|
-
*/
|
|
410
|
-
|
|
411
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
412
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
413
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
414
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
415
|
-
|
|
416
|
-
/***/ }),
|
|
417
|
-
|
|
418
|
-
/***/ 7:
|
|
419
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
420
|
-
|
|
421
|
-
"use strict";
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
Object.defineProperty(exports, "__esModule", {
|
|
425
|
-
value: true
|
|
426
|
-
});
|
|
427
|
-
exports.VizCategory = void 0;
|
|
428
|
-
var VizCategory;
|
|
429
|
-
|
|
430
|
-
(function (VizCategory) {
|
|
431
|
-
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
432
|
-
VizCategory["TRENDS"] = "Trends";
|
|
433
|
-
VizCategory["COMPARISONS"] = "Comparisons";
|
|
434
|
-
VizCategory["TABLE"] = "Table";
|
|
435
|
-
VizCategory["GAUGE"] = "Gauge";
|
|
436
|
-
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
437
|
-
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
438
|
-
VizCategory["SHAPES"] = "Shapes";
|
|
439
|
-
VizCategory["MISC"] = "misc";
|
|
440
|
-
VizCategory["FLOW"] = "Flow";
|
|
441
|
-
VizCategory["CORRELATION"] = "Correlation";
|
|
442
|
-
VizCategory["SPATIAL"] = "Spatial";
|
|
443
|
-
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
444
|
-
|
|
445
|
-
/***/ })
|
|
446
|
-
|
|
447
|
-
/******/ });
|
|
448
|
-
//# sourceMappingURL=Image.config.js.map
|
|
180
|
+
var config_default = enhanceConfig(config);
|
|
181
|
+
//# sourceMappingURL=Image.config.js.map
|