@splunk/visualizations 26.4.1 → 27.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Area.config.js +1399 -1590
- package/Area.config.js.map +7 -1
- package/Area.js +3750 -4822
- package/Area.js.map +7 -1
- package/Bar.config.js +1423 -1566
- package/Bar.config.js.map +7 -1
- package/Bar.js +3856 -4884
- package/Bar.js.map +7 -1
- package/Bubble.config.js +1009 -1200
- package/Bubble.config.js.map +7 -1
- package/Bubble.js +2768 -4491
- package/Bubble.js.map +7 -1
- package/ChoroplethSvg.config.js +282 -582
- package/ChoroplethSvg.config.js.map +7 -1
- package/ChoroplethSvg.js +2032 -3808
- package/ChoroplethSvg.js.map +7 -1
- package/Column.config.js +1390 -1534
- package/Column.config.js.map +7 -1
- package/Column.js +3849 -4906
- package/Column.js.map +7 -1
- package/Ellipse.config.js +443 -774
- package/Ellipse.config.js.map +7 -1
- package/Ellipse.js +1667 -3327
- package/Ellipse.js.map +7 -1
- package/Events.config.js +207 -492
- package/Events.config.js.map +7 -1
- package/Events.js +2643 -4647
- package/Events.js.map +7 -1
- package/FillerGauge.config.js +420 -775
- package/FillerGauge.config.js.map +7 -1
- package/FillerGauge.js +2164 -4575
- package/FillerGauge.js.map +7 -1
- package/Image.config.js +144 -411
- package/Image.config.js.map +7 -1
- package/Image.js +1423 -3046
- package/Image.js.map +7 -1
- package/Line.config.js +1421 -1616
- package/Line.config.js.map +7 -1
- package/Line.js +3790 -4901
- package/Line.js.map +7 -1
- package/LinkGraph.config.js +390 -632
- package/LinkGraph.config.js.map +7 -1
- package/LinkGraph.js +5272 -6185
- package/LinkGraph.js.map +7 -1
- package/MIGRATION.md +6 -0
- package/Map.config.js +501 -801
- package/Map.config.js.map +7 -1
- package/Map.js +3382 -5659
- package/Map.js.map +7 -1
- package/Markdown.config.js +232 -528
- package/Markdown.config.js.map +7 -1
- package/Markdown.js +1671 -3212
- package/Markdown.js.map +7 -1
- package/MarkerGauge.config.js +308 -613
- package/MarkerGauge.config.js.map +7 -1
- package/MarkerGauge.js +2215 -4531
- package/MarkerGauge.js.map +7 -1
- package/ParallelCoordinates.config.js +282 -581
- package/ParallelCoordinates.config.js.map +7 -1
- package/ParallelCoordinates.js +2057 -4718
- package/ParallelCoordinates.js.map +7 -1
- package/Pie.config.js +278 -547
- package/Pie.config.js.map +7 -1
- package/Pie.js +2107 -3984
- package/Pie.js.map +7 -1
- package/Punchcard.config.js +291 -578
- package/Punchcard.config.js.map +7 -1
- package/Punchcard.js +2734 -5037
- package/Punchcard.js.map +7 -1
- package/Rectangle.config.js +455 -770
- package/Rectangle.config.js.map +7 -1
- package/Rectangle.js +1664 -3258
- package/Rectangle.js.map +7 -1
- package/Sankey.config.js +291 -626
- package/Sankey.config.js.map +7 -1
- package/Sankey.js +2766 -4908
- package/Sankey.js.map +7 -1
- package/Scatter.config.js +988 -1180
- package/Scatter.config.js.map +7 -1
- package/Scatter.js +2801 -4506
- package/Scatter.js.map +7 -1
- package/SingleValue.config.js +794 -1250
- package/SingleValue.config.js.map +7 -1
- package/SingleValue.js +4185 -7327
- package/SingleValue.js.map +7 -1
- package/SingleValueBasic.js +382 -1527
- package/SingleValueBasic.js.map +7 -1
- package/SingleValueIcon.config.js +757 -1207
- package/SingleValueIcon.config.js.map +7 -1
- package/SingleValueIcon.js +3427 -6293
- package/SingleValueIcon.js.map +7 -1
- package/SingleValueRadial.config.js +686 -1121
- package/SingleValueRadial.config.js.map +7 -1
- package/SingleValueRadial.js +3923 -6994
- package/SingleValueRadial.js.map +7 -1
- package/SparkLine.js +439 -746
- package/SparkLine.js.map +7 -1
- package/TRELLIS.md +16 -15
- package/Table.config.js +565 -879
- package/Table.config.js.map +7 -1
- package/Table.js +3260 -5334
- package/Table.js.map +7 -1
- package/common/Charting.js +617 -1498
- package/common/Charting.js.map +7 -1
- package/common/ChartingApi.js +46 -170
- package/common/ChartingApi.js.map +7 -1
- package/common/DocExampleWithVizSandbox.js +270 -473
- package/common/DocExampleWithVizSandbox.js.map +7 -1
- package/common/EventsDoc.js +172 -464
- package/common/EventsDoc.js.map +7 -1
- package/common/GaugeMajorTicks.js +249 -347
- package/common/GaugeMajorTicks.js.map +7 -1
- package/common/GaugeValueMarker.js +201 -311
- package/common/GaugeValueMarker.js.map +7 -1
- package/common/OptionsDoc.js +351 -911
- package/common/OptionsDoc.js.map +7 -1
- package/common/OverviewDoc.js +435 -769
- package/common/OverviewDoc.js.map +7 -1
- package/common/SplunkVisualization.js +116 -259
- package/common/SplunkVisualization.js.map +7 -1
- package/common/SplunkVisualizationApi.js +40 -156
- package/common/SplunkVisualizationApi.js.map +7 -1
- package/common/ThemesDoc.js +271 -420
- package/common/ThemesDoc.js.map +7 -1
- package/common/chartingUtils.js +140 -312
- package/common/chartingUtils.js.map +7 -1
- package/common/docUtils.js +148 -266
- package/common/docUtils.js.map +7 -1
- package/common/gaugeUtils.js +280 -808
- package/common/gaugeUtils.js.map +7 -1
- package/common/shapeUtils.js +106 -211
- package/common/shapeUtils.js.map +7 -1
- package/common/utils/configUtils.js +126 -252
- package/common/utils/configUtils.js.map +7 -1
- package/common/utils/dataUtils.js +217 -812
- package/common/utils/dataUtils.js.map +7 -1
- package/common/utils/featureFlagUtils.js +53 -133
- package/common/utils/featureFlagUtils.js.map +7 -1
- package/common/utils/hocUtils.js +32 -122
- package/common/utils/hocUtils.js.map +7 -1
- package/common/utils/mapUtils.js +502 -1337
- package/common/utils/mapUtils.js.map +7 -1
- package/common/utils/singleValueUtils.js +466 -1013
- package/common/utils/singleValueUtils.js.map +7 -1
- package/common/utils/testHelper.js +92 -146
- package/common/utils/testHelper.js.map +7 -1
- package/common/utils/trellisUtils.js +277 -489
- package/common/utils/trellisUtils.js.map +7 -1
- package/common/utils/urlUtils.js +28 -112
- package/common/utils/urlUtils.js.map +7 -1
- package/common/withDashboardViz.js +1191 -2431
- package/common/withDashboardViz.js.map +7 -1
- package/package.json +53 -45
package/Rectangle.config.js
CHANGED
|
@@ -1,561 +1,256 @@
|
|
|
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 = 62);
|
|
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
|
-
/***/ 13:
|
|
117
|
-
/***/ (function(module, exports) {
|
|
118
|
-
|
|
119
|
-
module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
|
|
120
|
-
|
|
121
|
-
/***/ }),
|
|
122
|
-
|
|
123
|
-
/***/ 19:
|
|
124
|
-
/***/ (function(module, exports) {
|
|
125
|
-
|
|
126
|
-
module.exports = require("@splunk/themes");
|
|
127
|
-
|
|
128
|
-
/***/ }),
|
|
129
|
-
|
|
130
|
-
/***/ 2:
|
|
131
|
-
/***/ (function(module, exports) {
|
|
132
|
-
|
|
133
|
-
module.exports = require("@splunk/visualization-schemas");
|
|
134
|
-
|
|
135
|
-
/***/ }),
|
|
136
|
-
|
|
137
|
-
/***/ 3:
|
|
138
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
139
|
-
|
|
140
|
-
"use strict";
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
var _toConsumableArray = __webpack_require__(1);
|
|
144
|
-
|
|
145
|
-
Object.defineProperty(exports, "__esModule", {
|
|
146
|
-
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/Rectangle/config.ts
|
|
51
|
+
var config_exports = {};
|
|
52
|
+
__export(config_exports, {
|
|
53
|
+
default: () => config_default
|
|
147
54
|
});
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var lodash_1 = __webpack_require__(5); // included for backwards compatibility
|
|
151
|
-
|
|
55
|
+
module.exports = __toCommonJS(config_exports);
|
|
152
56
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
57
|
+
// esm-externals:@splunk/visualization-icons
|
|
58
|
+
var visualization_icons_exports = {};
|
|
59
|
+
__export(visualization_icons_exports, {
|
|
60
|
+
default: () => visualization_icons_default
|
|
61
|
+
});
|
|
62
|
+
var defaultImport = __toESM(require("@splunk/visualization-icons"));
|
|
63
|
+
__reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
|
|
64
|
+
var visualization_icons_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
|
|
160
70
|
});
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
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/ui-utils/i18n
|
|
76
|
+
var i18n_exports = {};
|
|
77
|
+
__export(i18n_exports, {
|
|
78
|
+
default: () => i18n_default
|
|
79
|
+
});
|
|
80
|
+
var defaultImport3 = __toESM(require("@splunk/ui-utils/i18n"));
|
|
81
|
+
__reExport(i18n_exports, require("@splunk/ui-utils/i18n"));
|
|
82
|
+
var i18n_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
|
|
83
|
+
|
|
84
|
+
// esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
|
|
85
|
+
var PresetPalettes_exports = {};
|
|
86
|
+
__export(PresetPalettes_exports, {
|
|
87
|
+
default: () => PresetPalettes_default
|
|
88
|
+
});
|
|
89
|
+
var defaultImport4 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
90
|
+
__reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
|
|
91
|
+
var PresetPalettes_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
|
|
92
|
+
|
|
93
|
+
// esm-externals:@splunk/themes
|
|
94
|
+
var themes_exports = {};
|
|
95
|
+
__export(themes_exports, {
|
|
96
|
+
default: () => themes_default
|
|
97
|
+
});
|
|
98
|
+
var defaultImport5 = __toESM(require("@splunk/themes"));
|
|
99
|
+
__reExport(themes_exports, require("@splunk/themes"));
|
|
100
|
+
var themes_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
|
|
101
|
+
|
|
102
|
+
// esm-externals:lodash
|
|
103
|
+
var lodash_exports = {};
|
|
104
|
+
__export(lodash_exports, {
|
|
105
|
+
default: () => lodash_default
|
|
106
|
+
});
|
|
107
|
+
var defaultImport6 = __toESM(require("lodash"));
|
|
108
|
+
__reExport(lodash_exports, require("lodash"));
|
|
109
|
+
var lodash_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
|
|
110
|
+
|
|
111
|
+
// esm-externals:@splunk/visualizations-shared/configUtils
|
|
112
|
+
var configUtils_exports = {};
|
|
113
|
+
__export(configUtils_exports, {
|
|
114
|
+
default: () => configUtils_default
|
|
115
|
+
});
|
|
116
|
+
var defaultImport7 = __toESM(require("@splunk/visualizations-shared/configUtils"));
|
|
117
|
+
__reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
|
|
118
|
+
var configUtils_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
|
|
168
119
|
|
|
120
|
+
// src/common/utils/configUtils.ts
|
|
169
121
|
function enhanceConfig(vizConfig) {
|
|
170
|
-
|
|
171
|
-
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
172
|
-
|
|
173
|
-
open:
|
|
174
|
-
}
|
|
175
|
-
|
|
122
|
+
const enhancedConfig = __spreadValues({}, vizConfig);
|
|
123
|
+
enhancedConfig.editorConfig = vizConfig.editorConfig.map(
|
|
124
|
+
(config2) => {
|
|
125
|
+
return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
|
|
126
|
+
}
|
|
127
|
+
);
|
|
176
128
|
return enhancedConfig;
|
|
177
129
|
}
|
|
178
|
-
|
|
179
|
-
exports.enhanceConfig = enhanceConfig;
|
|
180
|
-
/**
|
|
181
|
-
* Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
|
|
182
|
-
* Created for editor unit tests
|
|
183
|
-
* @param vizConfig a Visualization Config
|
|
184
|
-
* @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
|
|
185
|
-
*/
|
|
186
|
-
|
|
187
|
-
function uncollapseEditorConfig(vizConfig) {
|
|
188
|
-
var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
|
|
189
|
-
editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
|
|
190
|
-
return Object.assign(Object.assign({}, config), {
|
|
191
|
-
open: true
|
|
192
|
-
});
|
|
193
|
-
});
|
|
194
|
-
return editorPanelUncollapsedConfig;
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
exports.uncollapseEditorConfig = uncollapseEditorConfig;
|
|
198
|
-
|
|
199
|
-
function isDynamicOption(option) {
|
|
200
|
-
return option && typeof option === 'string' && option.trim().startsWith('>') || false;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
|
|
204
|
-
// this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
|
|
208
|
-
* 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
|
|
209
|
-
* the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
|
|
210
|
-
* 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
|
|
211
|
-
*
|
|
212
|
-
* Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
|
|
213
|
-
*/
|
|
214
|
-
|
|
215
130
|
function hasCompatibleContexts(vizContext, presetContext) {
|
|
216
|
-
|
|
217
|
-
return presetContextKeys.every(
|
|
218
|
-
|
|
219
|
-
|
|
131
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
132
|
+
return presetContextKeys.every(
|
|
133
|
+
(contextKey) => presetContext[contextKey] === void 0 && vizContext[contextKey] === void 0 || presetContext[contextKey] !== void 0 && vizContext[contextKey] !== void 0
|
|
134
|
+
);
|
|
220
135
|
}
|
|
221
|
-
/**
|
|
222
|
-
* Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
|
|
223
|
-
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
136
|
function hasCompatibleOptions(vizOptions, presetOptions) {
|
|
227
|
-
|
|
228
|
-
return presetOptionKeys.every(
|
|
229
|
-
|
|
230
|
-
|
|
137
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
138
|
+
return presetOptionKeys.every(
|
|
139
|
+
(optionKey) => (0, configUtils_exports.isDynamicOption)(presetOptions[optionKey]) === (0, configUtils_exports.isDynamicOption)(vizOptions[optionKey])
|
|
140
|
+
);
|
|
231
141
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
* @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
|
|
239
|
-
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
function getInitialPreset(vizContext, vizOptions, presets) {
|
|
243
|
-
return presets.find(function (preset) {
|
|
244
|
-
var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
|
|
245
|
-
var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
|
|
246
|
-
var presetContextKeys = Object.keys(presetContext);
|
|
247
|
-
var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
|
|
248
|
-
// if not, then the preset is invalid in config.ts
|
|
249
|
-
|
|
142
|
+
function getInitialPreset(vizContext, vizOptions, presets2) {
|
|
143
|
+
return presets2.find((preset) => {
|
|
144
|
+
const presetContext = (0, lodash_exports.get)(preset, ["value", "context"], {});
|
|
145
|
+
const presetOptions = (0, lodash_exports.get)(preset, ["value", "options"], {});
|
|
146
|
+
const presetContextKeys = Object.keys(presetContext);
|
|
147
|
+
const presetOptionKeys = Object.keys(presetOptions);
|
|
250
148
|
if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
|
|
251
149
|
return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
|
|
252
150
|
});
|
|
253
151
|
}
|
|
254
152
|
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
exports.generatePrecisionValues = generatePrecisionValues;
|
|
273
|
-
/**
|
|
274
|
-
* insert layout in layout array, return a new layout array instead of updating the original
|
|
275
|
-
*
|
|
276
|
-
* @param {EditorLayoutConfig[][]} layout - editor layout
|
|
277
|
-
* @param {Number} index - the index to insert layout item(s)
|
|
278
|
-
* @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
|
|
279
|
-
* @returns {EditorLayoutConfig[][]} new editor layout with insertion
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
var insertLayout = function insertLayout(layout, index) {
|
|
283
|
-
for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
|
|
284
|
-
layoutItems[_key - 2] = arguments[_key];
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
exports.insertLayout = insertLayout;
|
|
291
|
-
|
|
292
|
-
/***/ }),
|
|
293
|
-
|
|
294
|
-
/***/ 32:
|
|
295
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
296
|
-
|
|
297
|
-
"use strict";
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
Object.defineProperty(exports, "__esModule", {
|
|
301
|
-
value: true
|
|
302
|
-
});
|
|
303
|
-
exports.getDynamicFillColorEditor = void 0;
|
|
304
|
-
|
|
305
|
-
var i18n_1 = __webpack_require__(0);
|
|
306
|
-
|
|
307
|
-
var configUtils_1 = __webpack_require__(4);
|
|
308
|
-
|
|
309
|
-
var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
|
|
310
|
-
var defaultContext = _ref.defaultContext,
|
|
311
|
-
defaultPalettesConfig = _ref.defaultPalettesConfig;
|
|
312
|
-
return {
|
|
313
|
-
label: (0, i18n_1._)('Fill'),
|
|
314
|
-
option: 'fillColor',
|
|
315
|
-
context: 'fillColorEditorConfig',
|
|
316
|
-
editor: 'editor.dynamicColor',
|
|
317
|
-
showEditor: function showEditor(_ref2) {
|
|
318
|
-
var options = _ref2.options;
|
|
319
|
-
return (0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
320
|
-
},
|
|
321
|
-
editorProps: {
|
|
322
|
-
labelPosition: 'top',
|
|
323
|
-
flyoutTitle: (0, i18n_1._)('Dynamic coloring: fill'),
|
|
324
|
-
formatters: [{
|
|
325
|
-
label: (0, i18n_1._)('Ranges'),
|
|
326
|
-
value: 'rangeValue',
|
|
153
|
+
// src/common/editorConfig/DynamicFillColorEditor.ts
|
|
154
|
+
var getDynamicFillColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
155
|
+
label: (0, i18n_exports._)("Fill"),
|
|
156
|
+
option: "fillColor",
|
|
157
|
+
context: "fillColorEditorConfig",
|
|
158
|
+
editor: "editor.dynamicColor",
|
|
159
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.fillColor),
|
|
160
|
+
editorProps: {
|
|
161
|
+
labelPosition: "top",
|
|
162
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: fill"),
|
|
163
|
+
formatters: [
|
|
164
|
+
{
|
|
165
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
166
|
+
value: "rangeValue",
|
|
327
167
|
defaults: {
|
|
328
|
-
fillDataValue:
|
|
168
|
+
fillDataValue: defaultContext2.fillColorConfig
|
|
329
169
|
}
|
|
330
|
-
},
|
|
331
|
-
|
|
332
|
-
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
label: (0, i18n_exports._)("Matches"),
|
|
173
|
+
value: "matchValue",
|
|
333
174
|
defaults: {
|
|
334
|
-
fillDataValue:
|
|
175
|
+
fillDataValue: defaultContext2.fillColorMatchConfig
|
|
335
176
|
}
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
|
|
347
|
-
|
|
348
|
-
/***/ }),
|
|
349
|
-
|
|
350
|
-
/***/ 33:
|
|
351
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
352
|
-
|
|
353
|
-
"use strict";
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
Object.defineProperty(exports, "__esModule", {
|
|
357
|
-
value: true
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
dataSelectors: [
|
|
180
|
+
{
|
|
181
|
+
label: (0, i18n_exports._)("Fill"),
|
|
182
|
+
value: "fillDataValue"
|
|
183
|
+
}
|
|
184
|
+
],
|
|
185
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
186
|
+
}
|
|
358
187
|
});
|
|
359
|
-
exports.getDynamicStrokeColorEditor = void 0;
|
|
360
|
-
|
|
361
|
-
var i18n_1 = __webpack_require__(0);
|
|
362
188
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
editorProps: {
|
|
378
|
-
labelPosition: 'top',
|
|
379
|
-
flyoutTitle: (0, i18n_1._)('Dynamic coloring: stroke'),
|
|
380
|
-
formatters: [{
|
|
381
|
-
label: (0, i18n_1._)('Ranges'),
|
|
382
|
-
value: 'rangeValue',
|
|
189
|
+
// src/common/editorConfig/DynamicStrokeColorEditor.ts
|
|
190
|
+
var getDynamicStrokeColorEditor = ({ defaultContext: defaultContext2, defaultPalettesConfig: defaultPalettesConfig2 }) => ({
|
|
191
|
+
label: (0, i18n_exports._)("Stroke"),
|
|
192
|
+
option: "strokeColor",
|
|
193
|
+
context: "strokeColorEditorConfig",
|
|
194
|
+
editor: "editor.dynamicColor",
|
|
195
|
+
showEditor: ({ options }) => (0, configUtils_exports.isDynamicOption)(options.strokeColor),
|
|
196
|
+
editorProps: {
|
|
197
|
+
labelPosition: "top",
|
|
198
|
+
flyoutTitle: (0, i18n_exports._)("Dynamic coloring: stroke"),
|
|
199
|
+
formatters: [
|
|
200
|
+
{
|
|
201
|
+
label: (0, i18n_exports._)("Ranges"),
|
|
202
|
+
value: "rangeValue",
|
|
383
203
|
defaults: {
|
|
384
|
-
strokeDataValue:
|
|
204
|
+
strokeDataValue: defaultContext2.strokeColorConfig
|
|
385
205
|
}
|
|
386
|
-
},
|
|
387
|
-
|
|
388
|
-
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
label: (0, i18n_exports._)("Matches"),
|
|
209
|
+
value: "matchValue",
|
|
389
210
|
defaults: {
|
|
390
|
-
strokeDataValue:
|
|
211
|
+
strokeDataValue: defaultContext2.strokeColorMatchConfig
|
|
391
212
|
}
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
|
|
403
|
-
|
|
404
|
-
/***/ }),
|
|
405
|
-
|
|
406
|
-
/***/ 34:
|
|
407
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
408
|
-
|
|
409
|
-
"use strict";
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
Object.defineProperty(exports, "__esModule", {
|
|
413
|
-
value: true
|
|
213
|
+
}
|
|
214
|
+
],
|
|
215
|
+
dataSelectors: [
|
|
216
|
+
{
|
|
217
|
+
label: (0, i18n_exports._)("Stroke"),
|
|
218
|
+
value: "strokeDataValue"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
defaultPalettesConfig: defaultPalettesConfig2
|
|
222
|
+
}
|
|
414
223
|
});
|
|
415
224
|
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
var configUtils_1 = __webpack_require__(4);
|
|
419
|
-
|
|
225
|
+
// src/common/editorConfig/StaticFillColorEditor.ts
|
|
420
226
|
var StaticFillColorEditor = {
|
|
421
|
-
label: (0,
|
|
422
|
-
option:
|
|
423
|
-
editor:
|
|
424
|
-
showEditor:
|
|
425
|
-
var options = _ref.options;
|
|
426
|
-
return !(0, configUtils_1.isDynamicOption)(options.fillColor);
|
|
427
|
-
}
|
|
227
|
+
label: (0, i18n_exports._)("Fill"),
|
|
228
|
+
option: "fillColor",
|
|
229
|
+
editor: "editor.color",
|
|
230
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.fillColor)
|
|
428
231
|
};
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
/***/ }),
|
|
432
|
-
|
|
433
|
-
/***/ 35:
|
|
434
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
435
|
-
|
|
436
|
-
"use strict";
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
Object.defineProperty(exports, "__esModule", {
|
|
440
|
-
value: true
|
|
441
|
-
});
|
|
442
|
-
|
|
443
|
-
var i18n_1 = __webpack_require__(0);
|
|
444
|
-
|
|
445
|
-
var configUtils_1 = __webpack_require__(4);
|
|
232
|
+
var StaticFillColorEditor_default = StaticFillColorEditor;
|
|
446
233
|
|
|
234
|
+
// src/common/editorConfig/StaticStrokeColorEditor.ts
|
|
447
235
|
var StaticStrokeColorEditor = {
|
|
448
|
-
label: (0,
|
|
449
|
-
option:
|
|
450
|
-
editor:
|
|
451
|
-
showEditor:
|
|
452
|
-
var options = _ref.options;
|
|
453
|
-
return !(0, configUtils_1.isDynamicOption)(options.strokeColor);
|
|
454
|
-
}
|
|
236
|
+
label: (0, i18n_exports._)("Stroke"),
|
|
237
|
+
option: "strokeColor",
|
|
238
|
+
editor: "editor.color",
|
|
239
|
+
showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.strokeColor)
|
|
455
240
|
};
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
/***/ }),
|
|
459
|
-
|
|
460
|
-
/***/ 4:
|
|
461
|
-
/***/ (function(module, exports) {
|
|
462
|
-
|
|
463
|
-
module.exports = require("@splunk/visualizations-shared/configUtils");
|
|
464
|
-
|
|
465
|
-
/***/ }),
|
|
466
|
-
|
|
467
|
-
/***/ 5:
|
|
468
|
-
/***/ (function(module, exports) {
|
|
469
|
-
|
|
470
|
-
module.exports = require("lodash");
|
|
471
|
-
|
|
472
|
-
/***/ }),
|
|
473
|
-
|
|
474
|
-
/***/ 6:
|
|
475
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
476
|
-
|
|
477
|
-
"use strict";
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
Object.defineProperty(exports, "__esModule", {
|
|
481
|
-
value: true
|
|
482
|
-
});
|
|
483
|
-
exports.VizBehavior = void 0;
|
|
484
|
-
var VizBehavior;
|
|
485
|
-
|
|
486
|
-
(function (VizBehavior) {
|
|
487
|
-
/**
|
|
488
|
-
* Dynamic Options Behavior.
|
|
489
|
-
* This allows visualization options to be powered by data
|
|
490
|
-
*
|
|
491
|
-
* **Example**
|
|
492
|
-
*
|
|
493
|
-
* sparklineValues: ">primary|seriesByIndex(0)"
|
|
494
|
-
* would configure sparklineValues with an array of data points
|
|
495
|
-
* coming from the first series in the primary datasource
|
|
496
|
-
*
|
|
497
|
-
*/
|
|
498
|
-
VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
|
|
499
|
-
VizBehavior["EVENTS"] = "events";
|
|
500
|
-
VizBehavior["DOWNSAMPLING"] = "downsampling";
|
|
501
|
-
/**
|
|
502
|
-
* Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
|
|
503
|
-
* missing.
|
|
504
|
-
* @type {string}
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
|
-
VizBehavior["PLACEHOLDER"] = "placeholder";
|
|
508
|
-
VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
|
|
509
|
-
VizBehavior["TRELLIS"] = "trellis";
|
|
510
|
-
})(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
|
|
511
|
-
|
|
512
|
-
/***/ }),
|
|
513
|
-
|
|
514
|
-
/***/ 62:
|
|
515
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
516
|
-
|
|
517
|
-
"use strict";
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
Object.defineProperty(exports, "__esModule", {
|
|
521
|
-
value: true
|
|
522
|
-
});
|
|
523
|
-
|
|
524
|
-
var visualization_icons_1 = __webpack_require__(11);
|
|
525
|
-
|
|
526
|
-
var visualization_schemas_1 = __webpack_require__(2);
|
|
527
|
-
|
|
528
|
-
var i18n_1 = __webpack_require__(0);
|
|
529
|
-
|
|
530
|
-
var PresetPalettes_1 = __webpack_require__(13);
|
|
531
|
-
|
|
532
|
-
var themes_1 = __webpack_require__(19);
|
|
533
|
-
|
|
534
|
-
var VizBehavior_1 = __webpack_require__(6);
|
|
535
|
-
|
|
536
|
-
var VizCategory_1 = __webpack_require__(7);
|
|
537
|
-
|
|
538
|
-
var configUtils_1 = __webpack_require__(3);
|
|
539
|
-
|
|
540
|
-
var DynamicFillColorEditor_1 = __webpack_require__(32);
|
|
541
|
-
|
|
542
|
-
var DynamicStrokeColorEditor_1 = __webpack_require__(33);
|
|
543
|
-
|
|
544
|
-
var StaticFillColorEditor_1 = __webpack_require__(34);
|
|
545
|
-
|
|
546
|
-
var StaticStrokeColorEditor_1 = __webpack_require__(35);
|
|
241
|
+
var StaticStrokeColorEditor_default = StaticStrokeColorEditor;
|
|
547
242
|
|
|
243
|
+
// src/Rectangle/config.ts
|
|
548
244
|
var dataContract = {
|
|
549
245
|
requiredDataSources: [],
|
|
550
|
-
optionalDataSources: [
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
initialRequestParams: {
|
|
555
|
-
primary: {
|
|
556
|
-
offset: 0,
|
|
557
|
-
count: 10000
|
|
246
|
+
optionalDataSources: [
|
|
247
|
+
{
|
|
248
|
+
name: "primary",
|
|
249
|
+
description: "DataSource that powers the visualization"
|
|
558
250
|
}
|
|
251
|
+
],
|
|
252
|
+
initialRequestParams: {
|
|
253
|
+
primary: { offset: 0, count: 1e4 }
|
|
559
254
|
}
|
|
560
255
|
};
|
|
561
256
|
var size = {
|
|
@@ -563,277 +258,267 @@ var size = {
|
|
|
563
258
|
initialHeight: 300
|
|
564
259
|
};
|
|
565
260
|
var defaultContext = {
|
|
566
|
-
fillColorConfig: [
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
261
|
+
fillColorConfig: [
|
|
262
|
+
{
|
|
263
|
+
from: 100,
|
|
264
|
+
value: "#088F44"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
from: 80,
|
|
268
|
+
to: 100,
|
|
269
|
+
value: "#2EB82E"
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
from: 60,
|
|
273
|
+
to: 80,
|
|
274
|
+
value: "#C3CC33"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
from: 40,
|
|
278
|
+
to: 60,
|
|
279
|
+
value: "#FFD442"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
from: 20,
|
|
283
|
+
to: 40,
|
|
284
|
+
value: "#FFA857"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
from: 0,
|
|
288
|
+
to: 20,
|
|
289
|
+
value: "#FF7149"
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
to: 0,
|
|
293
|
+
value: "#FE3A3A"
|
|
294
|
+
}
|
|
295
|
+
],
|
|
296
|
+
strokeColorConfig: [
|
|
297
|
+
{
|
|
298
|
+
from: 100,
|
|
299
|
+
value: "#088F44"
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
from: 80,
|
|
303
|
+
to: 100,
|
|
304
|
+
value: "#2EB82E"
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
from: 60,
|
|
308
|
+
to: 80,
|
|
309
|
+
value: "#C3CC33"
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
from: 40,
|
|
313
|
+
to: 60,
|
|
314
|
+
value: "#FFD442"
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
from: 20,
|
|
318
|
+
to: 40,
|
|
319
|
+
value: "#FFA857"
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
from: 0,
|
|
323
|
+
to: 20,
|
|
324
|
+
value: "#FF7149"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
to: 0,
|
|
328
|
+
value: "#FE3A3A"
|
|
329
|
+
}
|
|
330
|
+
],
|
|
331
|
+
fillColorMatchConfig: [{ match: "", value: "#5C33FF" }],
|
|
332
|
+
strokeColorMatchConfig: [{ match: "", value: "#5C33FF" }]
|
|
628
333
|
};
|
|
629
334
|
var themes = {
|
|
630
|
-
defaultFillColor:
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
},
|
|
645
|
-
prisma: themes_1.variables.neutral500(props)
|
|
646
|
-
})(props);
|
|
647
|
-
}
|
|
335
|
+
defaultFillColor: (props) => (0, themes_exports.pick)({
|
|
336
|
+
enterprise: {
|
|
337
|
+
dark: themes_exports.variables.gray25(props),
|
|
338
|
+
light: themes_exports.variables.gray80(props)
|
|
339
|
+
},
|
|
340
|
+
prisma: themes_exports.variables.backgroundColorSidebar(props)
|
|
341
|
+
})(props),
|
|
342
|
+
defaultStrokeColor: (props) => (0, themes_exports.pick)({
|
|
343
|
+
enterprise: {
|
|
344
|
+
dark: themes_exports.variables.gray80(props),
|
|
345
|
+
light: themes_exports.variables.gray30(props)
|
|
346
|
+
},
|
|
347
|
+
prisma: themes_exports.variables.neutral500(props)
|
|
348
|
+
})(props)
|
|
648
349
|
};
|
|
649
350
|
var basePresetContext = {
|
|
650
|
-
fillColorEditorConfig:
|
|
651
|
-
strokeColorEditorConfig:
|
|
351
|
+
fillColorEditorConfig: void 0,
|
|
352
|
+
strokeColorEditorConfig: void 0
|
|
652
353
|
};
|
|
653
354
|
var basePresetOptions = {
|
|
654
|
-
fillColor:
|
|
655
|
-
strokeColor:
|
|
355
|
+
fillColor: void 0,
|
|
356
|
+
strokeColor: void 0
|
|
656
357
|
};
|
|
657
|
-
var presets = [
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
}, {
|
|
666
|
-
label: (0, i18n_1._)('Fill'),
|
|
667
|
-
name: 'rectangle.fill',
|
|
668
|
-
value: {
|
|
669
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
670
|
-
fillDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
671
|
-
fillColorEditorConfig: defaultContext.fillColorConfig
|
|
672
|
-
}),
|
|
673
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
674
|
-
fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)'
|
|
675
|
-
})
|
|
676
|
-
}
|
|
677
|
-
}, {
|
|
678
|
-
label: (0, i18n_1._)('Stroke'),
|
|
679
|
-
name: 'rectangle.stroke',
|
|
680
|
-
value: {
|
|
681
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
682
|
-
strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
683
|
-
strokeColorEditorConfig: defaultContext.strokeColorConfig
|
|
684
|
-
}),
|
|
685
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
686
|
-
strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
|
|
687
|
-
})
|
|
688
|
-
}
|
|
689
|
-
}, {
|
|
690
|
-
label: (0, i18n_1._)('Fill and Stroke'),
|
|
691
|
-
name: 'rectangle.fillAndStroke',
|
|
692
|
-
value: {
|
|
693
|
-
context: Object.assign(Object.assign({}, basePresetContext), {
|
|
694
|
-
fillDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
695
|
-
strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
696
|
-
fillColorEditorConfig: defaultContext.fillColorConfig,
|
|
697
|
-
strokeColorEditorConfig: defaultContext.strokeColorConfig
|
|
698
|
-
}),
|
|
699
|
-
options: Object.assign(Object.assign({}, basePresetOptions), {
|
|
700
|
-
fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)',
|
|
701
|
-
strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
|
|
702
|
-
})
|
|
703
|
-
}
|
|
704
|
-
}];
|
|
705
|
-
var editorConfig = [{
|
|
706
|
-
label: (0, i18n_1._)('Color and style'),
|
|
707
|
-
layout: [[{
|
|
708
|
-
label: (0, i18n_1._)('Dynamic elements'),
|
|
709
|
-
key: 'presetSelector',
|
|
710
|
-
editor: 'editor.presetSelector',
|
|
711
|
-
editorProps: {
|
|
712
|
-
presets: presets,
|
|
713
|
-
value: function value(_ref) {
|
|
714
|
-
var context = _ref.context,
|
|
715
|
-
options = _ref.options;
|
|
716
|
-
var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
|
|
717
|
-
return initialPreset && initialPreset.label || null;
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
}], [Object.assign(Object.assign({}, StaticFillColorEditor_1.default), {
|
|
721
|
-
editorProps: {
|
|
722
|
-
themes: themes
|
|
723
|
-
}
|
|
724
|
-
})], [(0, DynamicFillColorEditor_1.getDynamicFillColorEditor)({
|
|
725
|
-
defaultContext: defaultContext,
|
|
726
|
-
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
727
|
-
})], [Object.assign(Object.assign({}, StaticStrokeColorEditor_1.default), {
|
|
728
|
-
editorProps: {
|
|
729
|
-
themes: themes
|
|
730
|
-
}
|
|
731
|
-
})], [(0, DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor)({
|
|
732
|
-
defaultContext: defaultContext,
|
|
733
|
-
defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
|
|
734
|
-
})], [{
|
|
735
|
-
label: (0, i18n_1._)('Fill opacity (%)'),
|
|
736
|
-
option: 'fillOpacity',
|
|
737
|
-
editor: 'editor.percent',
|
|
738
|
-
editorProps: {
|
|
739
|
-
min: 0
|
|
358
|
+
var presets = [
|
|
359
|
+
{
|
|
360
|
+
// dummy context variables to allow for resetting of unused context states
|
|
361
|
+
label: (0, i18n_exports._)("None"),
|
|
362
|
+
name: "rectangle.none",
|
|
363
|
+
value: {
|
|
364
|
+
context: __spreadValues({}, basePresetContext),
|
|
365
|
+
options: __spreadValues({}, basePresetOptions)
|
|
740
366
|
}
|
|
741
|
-
},
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
min: 0
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
label: (0, i18n_exports._)("Fill"),
|
|
370
|
+
name: "rectangle.fill",
|
|
371
|
+
value: {
|
|
372
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
373
|
+
fillDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
374
|
+
fillColorEditorConfig: defaultContext.fillColorConfig
|
|
375
|
+
}),
|
|
376
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
377
|
+
fillColor: "> fillDataValue | rangeValue(fillColorEditorConfig)"
|
|
378
|
+
})
|
|
754
379
|
}
|
|
755
|
-
},
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
label: (0, i18n_exports._)("Stroke"),
|
|
383
|
+
name: "rectangle.stroke",
|
|
384
|
+
value: {
|
|
385
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
386
|
+
strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
387
|
+
strokeColorEditorConfig: defaultContext.strokeColorConfig
|
|
388
|
+
}),
|
|
389
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
390
|
+
strokeColor: "> strokeDataValue | rangeValue(strokeColorEditorConfig)"
|
|
391
|
+
})
|
|
761
392
|
}
|
|
762
|
-
}
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
label: (0, i18n_exports._)("Fill and Stroke"),
|
|
396
|
+
name: "rectangle.fillAndStroke",
|
|
397
|
+
value: {
|
|
398
|
+
context: __spreadProps(__spreadValues({}, basePresetContext), {
|
|
399
|
+
fillDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
400
|
+
strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
|
|
401
|
+
fillColorEditorConfig: defaultContext.fillColorConfig,
|
|
402
|
+
strokeColorEditorConfig: defaultContext.strokeColorConfig
|
|
403
|
+
}),
|
|
404
|
+
options: __spreadProps(__spreadValues({}, basePresetOptions), {
|
|
405
|
+
fillColor: "> fillDataValue | rangeValue(fillColorEditorConfig)",
|
|
406
|
+
strokeColor: "> strokeDataValue | rangeValue(strokeColorEditorConfig)"
|
|
407
|
+
})
|
|
768
408
|
}
|
|
769
|
-
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
409
|
+
}
|
|
410
|
+
];
|
|
411
|
+
var editorConfig = [
|
|
412
|
+
{
|
|
413
|
+
label: (0, i18n_exports._)("Color and style"),
|
|
414
|
+
layout: [
|
|
415
|
+
[
|
|
416
|
+
{
|
|
417
|
+
label: (0, i18n_exports._)("Dynamic elements"),
|
|
418
|
+
key: "presetSelector",
|
|
419
|
+
editor: "editor.presetSelector",
|
|
420
|
+
editorProps: {
|
|
421
|
+
presets,
|
|
422
|
+
value: ({ context, options }) => {
|
|
423
|
+
const initialPreset = getInitialPreset(context, options, presets);
|
|
424
|
+
return initialPreset && initialPreset.label || null;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
],
|
|
429
|
+
[
|
|
430
|
+
__spreadProps(__spreadValues({}, StaticFillColorEditor_default), {
|
|
431
|
+
editorProps: {
|
|
432
|
+
themes
|
|
433
|
+
}
|
|
434
|
+
})
|
|
435
|
+
],
|
|
436
|
+
[getDynamicFillColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
437
|
+
[
|
|
438
|
+
__spreadProps(__spreadValues({}, StaticStrokeColorEditor_default), {
|
|
439
|
+
editorProps: {
|
|
440
|
+
themes
|
|
441
|
+
}
|
|
442
|
+
})
|
|
443
|
+
],
|
|
444
|
+
[getDynamicStrokeColorEditor({ defaultContext, defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig })],
|
|
445
|
+
[
|
|
446
|
+
{
|
|
447
|
+
label: (0, i18n_exports._)("Fill opacity (%)"),
|
|
448
|
+
option: "fillOpacity",
|
|
449
|
+
editor: "editor.percent",
|
|
450
|
+
editorProps: {
|
|
451
|
+
min: 0
|
|
452
|
+
}
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
label: (0, i18n_exports._)("Stroke opacity (%)"),
|
|
456
|
+
option: "strokeOpacity",
|
|
457
|
+
editor: "editor.percent",
|
|
458
|
+
editorProps: {
|
|
459
|
+
min: 0
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
],
|
|
463
|
+
[
|
|
464
|
+
{
|
|
465
|
+
label: (0, i18n_exports._)("Stroke width"),
|
|
466
|
+
option: "strokeWidth",
|
|
467
|
+
editor: "editor.number",
|
|
468
|
+
editorProps: {
|
|
469
|
+
min: 0
|
|
470
|
+
}
|
|
471
|
+
},
|
|
472
|
+
{
|
|
473
|
+
label: (0, i18n_exports._)("Stroke dash style"),
|
|
474
|
+
option: "strokeDashStyle",
|
|
475
|
+
editor: "editor.number",
|
|
476
|
+
editorProps: {
|
|
477
|
+
min: 0
|
|
478
|
+
}
|
|
479
|
+
}
|
|
480
|
+
],
|
|
481
|
+
[
|
|
482
|
+
{
|
|
483
|
+
label: (0, i18n_exports._)("Radius (px)"),
|
|
484
|
+
option: "rx",
|
|
485
|
+
editor: "editor.number",
|
|
486
|
+
editorProps: {
|
|
487
|
+
min: 0
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
{}
|
|
491
|
+
]
|
|
492
|
+
]
|
|
493
|
+
}
|
|
494
|
+
];
|
|
775
495
|
var config = {
|
|
776
496
|
/**
|
|
777
497
|
* unique viz key
|
|
778
498
|
*/
|
|
779
|
-
key:
|
|
780
|
-
|
|
499
|
+
key: "splunk.rectangle",
|
|
781
500
|
/**
|
|
782
501
|
* viz name
|
|
783
502
|
*/
|
|
784
|
-
name: (0,
|
|
785
|
-
category:
|
|
786
|
-
|
|
503
|
+
name: (0, i18n_exports._)("Rectangle"),
|
|
504
|
+
category: "Shapes" /* SHAPES */,
|
|
787
505
|
/**
|
|
788
506
|
* viz icon
|
|
789
507
|
*/
|
|
790
|
-
icon:
|
|
791
|
-
dataContract
|
|
792
|
-
size
|
|
793
|
-
defaultContext
|
|
794
|
-
optionsSchema:
|
|
795
|
-
editorConfig
|
|
796
|
-
supports: [
|
|
797
|
-
themes
|
|
508
|
+
icon: visualization_icons_exports.Rectangle,
|
|
509
|
+
dataContract,
|
|
510
|
+
size,
|
|
511
|
+
defaultContext,
|
|
512
|
+
optionsSchema: visualization_schemas_exports.rectangleOptionsSchema,
|
|
513
|
+
editorConfig,
|
|
514
|
+
supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */],
|
|
515
|
+
themes,
|
|
798
516
|
events: {
|
|
799
|
-
|
|
800
|
-
description:
|
|
801
|
-
payloadKeys: [
|
|
517
|
+
"rectangle.click": {
|
|
518
|
+
description: "trigger when user clicks rectangle",
|
|
519
|
+
payloadKeys: ["strokeColor", "fillColor"]
|
|
802
520
|
}
|
|
803
521
|
}
|
|
804
522
|
};
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
/***/ }),
|
|
808
|
-
|
|
809
|
-
/***/ 7:
|
|
810
|
-
/***/ (function(module, exports, __webpack_require__) {
|
|
811
|
-
|
|
812
|
-
"use strict";
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
Object.defineProperty(exports, "__esModule", {
|
|
816
|
-
value: true
|
|
817
|
-
});
|
|
818
|
-
exports.VizCategory = void 0;
|
|
819
|
-
var VizCategory;
|
|
820
|
-
|
|
821
|
-
(function (VizCategory) {
|
|
822
|
-
VizCategory["SINGLE_VALUE"] = "Single Value";
|
|
823
|
-
VizCategory["TRENDS"] = "Trends";
|
|
824
|
-
VizCategory["COMPARISONS"] = "Comparisons";
|
|
825
|
-
VizCategory["TABLE"] = "Table";
|
|
826
|
-
VizCategory["GAUGE"] = "Gauge";
|
|
827
|
-
VizCategory["DISTRIBUTIONS"] = "Distributions";
|
|
828
|
-
VizCategory["CHOROPLETH"] = "Choropleth Maps";
|
|
829
|
-
VizCategory["SHAPES"] = "Shapes";
|
|
830
|
-
VizCategory["MISC"] = "misc";
|
|
831
|
-
VizCategory["FLOW"] = "Flow";
|
|
832
|
-
VizCategory["CORRELATION"] = "Correlation";
|
|
833
|
-
VizCategory["SPATIAL"] = "Spatial";
|
|
834
|
-
})(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
|
|
835
|
-
|
|
836
|
-
/***/ })
|
|
837
|
-
|
|
838
|
-
/******/ });
|
|
839
|
-
//# sourceMappingURL=Rectangle.config.js.map
|
|
523
|
+
var config_default = enhanceConfig(config);
|
|
524
|
+
//# sourceMappingURL=Rectangle.config.js.map
|