@splunk/visualizations 26.4.1 → 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.
Files changed (152) hide show
  1. package/Area.config.js +1262 -1600
  2. package/Area.config.js.map +7 -1
  3. package/Area.js +3002 -4930
  4. package/Area.js.map +7 -1
  5. package/Bar.config.js +1247 -1574
  6. package/Bar.config.js.map +7 -1
  7. package/Bar.js +2921 -4843
  8. package/Bar.js.map +7 -1
  9. package/Bubble.config.js +896 -1213
  10. package/Bubble.config.js.map +7 -1
  11. package/Bubble.js +2517 -4483
  12. package/Bubble.js.map +7 -1
  13. package/ChoroplethSvg.config.js +282 -582
  14. package/ChoroplethSvg.config.js.map +7 -1
  15. package/ChoroplethSvg.js +2004 -3810
  16. package/ChoroplethSvg.js.map +7 -1
  17. package/Column.config.js +1208 -1541
  18. package/Column.config.js.map +7 -1
  19. package/Column.js +2930 -4886
  20. package/Column.js.map +7 -1
  21. package/Ellipse.config.js +443 -774
  22. package/Ellipse.config.js.map +7 -1
  23. package/Ellipse.js +1651 -3341
  24. package/Ellipse.js.map +7 -1
  25. package/Events.config.js +207 -492
  26. package/Events.config.js.map +7 -1
  27. package/Events.js +2615 -4649
  28. package/Events.js.map +7 -1
  29. package/FillerGauge.config.js +420 -775
  30. package/FillerGauge.config.js.map +7 -1
  31. package/FillerGauge.js +2137 -4578
  32. package/FillerGauge.js.map +7 -1
  33. package/Image.config.js +144 -411
  34. package/Image.config.js.map +7 -1
  35. package/Image.js +1395 -3048
  36. package/Image.js.map +7 -1
  37. package/Line.config.js +1278 -1625
  38. package/Line.config.js.map +7 -1
  39. package/Line.js +2954 -4926
  40. package/Line.js.map +7 -1
  41. package/LinkGraph.config.js +390 -632
  42. package/LinkGraph.config.js.map +7 -1
  43. package/LinkGraph.js +5243 -6190
  44. package/LinkGraph.js.map +7 -1
  45. package/MIGRATION.md +6 -0
  46. package/Map.config.js +501 -801
  47. package/Map.config.js.map +7 -1
  48. package/Map.js +3369 -5676
  49. package/Map.js.map +7 -1
  50. package/Markdown.config.js +232 -528
  51. package/Markdown.config.js.map +7 -1
  52. package/Markdown.js +1645 -3216
  53. package/Markdown.js.map +7 -1
  54. package/MarkerGauge.config.js +308 -613
  55. package/MarkerGauge.config.js.map +7 -1
  56. package/MarkerGauge.js +2189 -4535
  57. package/MarkerGauge.js.map +7 -1
  58. package/ParallelCoordinates.config.js +282 -581
  59. package/ParallelCoordinates.config.js.map +7 -1
  60. package/ParallelCoordinates.js +2023 -4720
  61. package/ParallelCoordinates.js.map +7 -1
  62. package/Pie.config.js +278 -547
  63. package/Pie.config.js.map +7 -1
  64. package/Pie.js +1996 -3990
  65. package/Pie.js.map +7 -1
  66. package/Punchcard.config.js +291 -578
  67. package/Punchcard.config.js.map +7 -1
  68. package/Punchcard.js +2709 -5042
  69. package/Punchcard.js.map +7 -1
  70. package/Rectangle.config.js +455 -770
  71. package/Rectangle.config.js.map +7 -1
  72. package/Rectangle.js +1638 -3262
  73. package/Rectangle.js.map +7 -1
  74. package/Sankey.config.js +291 -626
  75. package/Sankey.config.js.map +7 -1
  76. package/Sankey.js +2737 -4909
  77. package/Sankey.js.map +7 -1
  78. package/Scatter.config.js +876 -1194
  79. package/Scatter.config.js.map +7 -1
  80. package/Scatter.js +2529 -4477
  81. package/Scatter.js.map +7 -1
  82. package/SingleValue.config.js +819 -1251
  83. package/SingleValue.config.js.map +7 -1
  84. package/SingleValue.js +4203 -7413
  85. package/SingleValue.js.map +7 -1
  86. package/SingleValueBasic.js +382 -1527
  87. package/SingleValueBasic.js.map +7 -1
  88. package/SingleValueIcon.config.js +781 -1207
  89. package/SingleValueIcon.config.js.map +7 -1
  90. package/SingleValueIcon.js +3350 -6285
  91. package/SingleValueIcon.js.map +7 -1
  92. package/SingleValueRadial.config.js +708 -1119
  93. package/SingleValueRadial.config.js.map +7 -1
  94. package/SingleValueRadial.js +3808 -6965
  95. package/SingleValueRadial.js.map +7 -1
  96. package/SparkLine.js +439 -746
  97. package/SparkLine.js.map +7 -1
  98. package/Table.config.js +565 -879
  99. package/Table.config.js.map +7 -1
  100. package/Table.js +3277 -5381
  101. package/Table.js.map +7 -1
  102. package/common/Charting.js +481 -1468
  103. package/common/Charting.js.map +7 -1
  104. package/common/ChartingApi.js +46 -170
  105. package/common/ChartingApi.js.map +7 -1
  106. package/common/DocExampleWithVizSandbox.js +270 -473
  107. package/common/DocExampleWithVizSandbox.js.map +7 -1
  108. package/common/EventsDoc.js +172 -464
  109. package/common/EventsDoc.js.map +7 -1
  110. package/common/GaugeMajorTicks.js +249 -347
  111. package/common/GaugeMajorTicks.js.map +7 -1
  112. package/common/GaugeValueMarker.js +201 -311
  113. package/common/GaugeValueMarker.js.map +7 -1
  114. package/common/OptionsDoc.js +347 -912
  115. package/common/OptionsDoc.js.map +7 -1
  116. package/common/OverviewDoc.js +435 -769
  117. package/common/OverviewDoc.js.map +7 -1
  118. package/common/SplunkVisualization.js +116 -259
  119. package/common/SplunkVisualization.js.map +7 -1
  120. package/common/SplunkVisualizationApi.js +40 -156
  121. package/common/SplunkVisualizationApi.js.map +7 -1
  122. package/common/ThemesDoc.js +271 -420
  123. package/common/ThemesDoc.js.map +7 -1
  124. package/common/chartingUtils.js +140 -312
  125. package/common/chartingUtils.js.map +7 -1
  126. package/common/docUtils.js +148 -266
  127. package/common/docUtils.js.map +7 -1
  128. package/common/gaugeUtils.js +280 -808
  129. package/common/gaugeUtils.js.map +7 -1
  130. package/common/shapeUtils.js +106 -211
  131. package/common/shapeUtils.js.map +7 -1
  132. package/common/utils/configUtils.js +126 -252
  133. package/common/utils/configUtils.js.map +7 -1
  134. package/common/utils/dataUtils.js +217 -812
  135. package/common/utils/dataUtils.js.map +7 -1
  136. package/common/utils/featureFlagUtils.js +53 -133
  137. package/common/utils/featureFlagUtils.js.map +7 -1
  138. package/common/utils/hocUtils.js +32 -122
  139. package/common/utils/hocUtils.js.map +7 -1
  140. package/common/utils/mapUtils.js +502 -1337
  141. package/common/utils/mapUtils.js.map +7 -1
  142. package/common/utils/singleValueUtils.js +462 -1010
  143. package/common/utils/singleValueUtils.js.map +7 -1
  144. package/common/utils/testHelper.js +92 -146
  145. package/common/utils/testHelper.js.map +7 -1
  146. package/common/utils/trellisUtils.js +237 -489
  147. package/common/utils/trellisUtils.js.map +7 -1
  148. package/common/utils/urlUtils.js +28 -112
  149. package/common/utils/urlUtils.js.map +7 -1
  150. package/common/withDashboardViz.js +1168 -2438
  151. package/common/withDashboardViz.js.map +7 -1
  152. package/package.json +52 -43
package/Ellipse.config.js CHANGED
@@ -1,603 +1,256 @@
1
- /*!
2
- * Copyright © 2024 Splunk Inc.
3
- * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
- * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
- */
6
- module.exports =
7
- /******/ (function(modules) { // webpackBootstrap
8
- /******/ // The module cache
9
- /******/ var installedModules = {};
10
- /******/
11
- /******/ // The require function
12
- /******/ function __webpack_require__(moduleId) {
13
- /******/
14
- /******/ // Check if module is in cache
15
- /******/ if(installedModules[moduleId]) {
16
- /******/ return installedModules[moduleId].exports;
17
- /******/ }
18
- /******/ // Create a new module (and put it into the cache)
19
- /******/ var module = installedModules[moduleId] = {
20
- /******/ i: moduleId,
21
- /******/ l: false,
22
- /******/ exports: {}
23
- /******/ };
24
- /******/
25
- /******/ // Execute the module function
26
- /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
27
- /******/
28
- /******/ // Flag the module as loaded
29
- /******/ module.l = true;
30
- /******/
31
- /******/ // Return the exports of the module
32
- /******/ return module.exports;
33
- /******/ }
34
- /******/
35
- /******/
36
- /******/ // expose the modules object (__webpack_modules__)
37
- /******/ __webpack_require__.m = modules;
38
- /******/
39
- /******/ // expose the module cache
40
- /******/ __webpack_require__.c = installedModules;
41
- /******/
42
- /******/ // define getter function for harmony exports
43
- /******/ __webpack_require__.d = function(exports, name, getter) {
44
- /******/ if(!__webpack_require__.o(exports, name)) {
45
- /******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
46
- /******/ }
47
- /******/ };
48
- /******/
49
- /******/ // define __esModule on exports
50
- /******/ __webpack_require__.r = function(exports) {
51
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
52
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
53
- /******/ }
54
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
55
- /******/ };
56
- /******/
57
- /******/ // create a fake namespace object
58
- /******/ // mode & 1: value is a module id, require it
59
- /******/ // mode & 2: merge all properties of value into the ns
60
- /******/ // mode & 4: return value when already ns object
61
- /******/ // mode & 8|1: behave like require
62
- /******/ __webpack_require__.t = function(value, mode) {
63
- /******/ if(mode & 1) value = __webpack_require__(value);
64
- /******/ if(mode & 8) return value;
65
- /******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
66
- /******/ var ns = Object.create(null);
67
- /******/ __webpack_require__.r(ns);
68
- /******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
69
- /******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
70
- /******/ return ns;
71
- /******/ };
72
- /******/
73
- /******/ // getDefaultExport function for compatibility with non-harmony modules
74
- /******/ __webpack_require__.n = function(module) {
75
- /******/ var getter = module && module.__esModule ?
76
- /******/ function getDefault() { return module['default']; } :
77
- /******/ function getModuleExports() { return module; };
78
- /******/ __webpack_require__.d(getter, 'a', getter);
79
- /******/ return getter;
80
- /******/ };
81
- /******/
82
- /******/ // Object.prototype.hasOwnProperty.call
83
- /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
84
- /******/
85
- /******/ // __webpack_public_path__
86
- /******/ __webpack_require__.p = "";
87
- /******/
88
- /******/
89
- /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 44);
91
- /******/ })
92
- /************************************************************************/
93
- /******/ ([
94
- /* 0 */
95
- /***/ (function(module, exports) {
96
-
97
- module.exports = require("@splunk/ui-utils/i18n");
98
-
99
- /***/ }),
100
- /* 1 */
101
- /***/ (function(module, exports) {
102
-
103
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
104
-
105
- /***/ }),
106
- /* 2 */
107
- /***/ (function(module, exports) {
108
-
109
- module.exports = require("@splunk/visualization-schemas");
110
-
111
- /***/ }),
112
- /* 3 */
113
- /***/ (function(module, exports, __webpack_require__) {
114
-
115
- "use strict";
116
-
117
-
118
- var _toConsumableArray = __webpack_require__(1);
119
-
120
- Object.defineProperty(exports, "__esModule", {
121
- value: true
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/Ellipse/config.ts
51
+ var config_exports = {};
52
+ __export(config_exports, {
53
+ default: () => config_default
122
54
  });
123
- exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceConfig = exports.enhanceOptionsSchemaWithDynamicOptions = void 0;
124
-
125
- var lodash_1 = __webpack_require__(5); // included for backwards compatibility
126
-
127
-
128
- var visualization_schemas_1 = __webpack_require__(2);
55
+ module.exports = __toCommonJS(config_exports);
129
56
 
130
- Object.defineProperty(exports, "enhanceOptionsSchemaWithDynamicOptions", {
131
- enumerable: true,
132
- get: function get() {
133
- return visualization_schemas_1.enhanceOptionsSchemaWithDynamicOptions;
134
- }
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-color-palettes/editors/PresetPalettes
67
+ var PresetPalettes_exports = {};
68
+ __export(PresetPalettes_exports, {
69
+ default: () => PresetPalettes_default
70
+ });
71
+ var defaultImport2 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
72
+ __reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
73
+ var PresetPalettes_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
74
+
75
+ // esm-externals:@splunk/visualization-schemas
76
+ var visualization_schemas_exports = {};
77
+ __export(visualization_schemas_exports, {
78
+ default: () => visualization_schemas_default
79
+ });
80
+ var defaultImport3 = __toESM(require("@splunk/visualization-schemas"));
81
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
82
+ var visualization_schemas_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
83
+
84
+ // esm-externals:@splunk/themes/pick
85
+ var pick_exports = {};
86
+ __export(pick_exports, {
87
+ default: () => pick_default
88
+ });
89
+ var defaultImport4 = __toESM(require("@splunk/themes/pick"));
90
+ __reExport(pick_exports, require("@splunk/themes/pick"));
91
+ var pick_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
92
+
93
+ // esm-externals:@splunk/themes/variables
94
+ var variables_exports = {};
95
+ __export(variables_exports, {
96
+ default: () => variables_default
135
97
  });
136
- /**
137
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
138
- * this function also collapse all editor panels
139
- * @param vizConfig a Visualization Config
140
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
141
- * and containing `open: false` for all editor panels in editorConfig
142
- */
98
+ var defaultImport5 = __toESM(require("@splunk/themes/variables"));
99
+ __reExport(variables_exports, require("@splunk/themes/variables"));
100
+ var variables_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;
143
119
 
120
+ // src/common/utils/configUtils.ts
144
121
  function enhanceConfig(vizConfig) {
145
- var enhancedConfig = Object.assign({}, vizConfig);
146
- enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
147
- return Object.assign(Object.assign({}, config), {
148
- open: config.open || false
149
- });
150
- });
122
+ const enhancedConfig = __spreadValues({}, vizConfig);
123
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(
124
+ (config2) => {
125
+ return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
126
+ }
127
+ );
151
128
  return enhancedConfig;
152
129
  }
153
-
154
- exports.enhanceConfig = enhanceConfig;
155
- /**
156
- * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
157
- * Created for editor unit tests
158
- * @param vizConfig a Visualization Config
159
- * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
160
- */
161
-
162
- function uncollapseEditorConfig(vizConfig) {
163
- var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
164
- editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
165
- return Object.assign(Object.assign({}, config), {
166
- open: true
167
- });
168
- });
169
- return editorPanelUncollapsedConfig;
170
- }
171
-
172
- exports.uncollapseEditorConfig = uncollapseEditorConfig;
173
-
174
- function isDynamicOption(option) {
175
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
176
- }
177
-
178
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
179
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
180
-
181
- /**
182
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
183
- * if a preset has explicitly specified a key as being undefined, the vizContext must also has that key as undefined, or else this CANNOT be the initialPreset
184
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
185
- * the internal config contents are irrelevant (as the user could customize them in source), just as long as the presence of `undefined`s match up
186
- *
187
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
188
- */
189
-
190
130
  function hasCompatibleContexts(vizContext, presetContext) {
191
- var presetContextKeys = Object.keys(presetContext);
192
- return presetContextKeys.every(function (contextKey) {
193
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
194
- });
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
+ );
195
135
  }
196
- /**
197
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
198
- */
199
-
200
-
201
136
  function hasCompatibleOptions(vizOptions, presetOptions) {
202
- var presetOptionKeys = Object.keys(presetOptions);
203
- return presetOptionKeys.every(function (optionKey) {
204
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
205
- });
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
+ );
206
141
  }
207
- /**
208
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
209
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
210
- *
211
- * @param {Object} vizContext - the current vizContext definition
212
- * @param {Object} vizOptions - the current vizOptions definition
213
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
214
- */
215
-
216
-
217
- function getInitialPreset(vizContext, vizOptions, presets) {
218
- return presets.find(function (preset) {
219
- var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
220
- var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
221
- var presetContextKeys = Object.keys(presetContext);
222
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
223
- // if not, then the preset is invalid in config.ts
224
-
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);
225
148
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
226
149
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
227
150
  });
228
151
  }
229
152
 
230
- exports.getInitialPreset = getInitialPreset;
231
- /**
232
- * generates number precision values for a Select editor
233
- *
234
- * @param {Number} numPrecisionValues - number of integer precision values to generate
235
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
236
- */
237
-
238
- function generatePrecisionValues(numPrecisionValues) {
239
- return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
240
- return {
241
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
242
- value: i
243
- };
244
- });
245
- }
246
-
247
- exports.generatePrecisionValues = generatePrecisionValues;
248
- /**
249
- * insert layout in layout array, return a new layout array instead of updating the original
250
- *
251
- * @param {EditorLayoutConfig[][]} layout - editor layout
252
- * @param {Number} index - the index to insert layout item(s)
253
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
254
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
255
- */
256
-
257
- var insertLayout = function insertLayout(layout, index) {
258
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
259
- layoutItems[_key - 2] = arguments[_key];
260
- }
261
-
262
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
263
- };
264
-
265
- exports.insertLayout = insertLayout;
266
-
267
- /***/ }),
268
- /* 4 */
269
- /***/ (function(module, exports) {
270
-
271
- module.exports = require("@splunk/visualizations-shared/configUtils");
272
-
273
- /***/ }),
274
- /* 5 */
275
- /***/ (function(module, exports) {
276
-
277
- module.exports = require("lodash");
278
-
279
- /***/ }),
280
- /* 6 */
281
- /***/ (function(module, exports, __webpack_require__) {
282
-
283
- "use strict";
284
-
285
-
286
- Object.defineProperty(exports, "__esModule", {
287
- value: true
288
- });
289
- exports.VizBehavior = void 0;
290
- var VizBehavior;
291
-
292
- (function (VizBehavior) {
293
- /**
294
- * Dynamic Options Behavior.
295
- * This allows visualization options to be powered by data
296
- *
297
- * **Example**
298
- *
299
- * sparklineValues: ">primary|seriesByIndex(0)"
300
- * would configure sparklineValues with an array of data points
301
- * coming from the first series in the primary datasource
302
- *
303
- */
304
- VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
305
- VizBehavior["EVENTS"] = "events";
306
- VizBehavior["DOWNSAMPLING"] = "downsampling";
307
- /**
308
- * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
309
- * missing.
310
- * @type {string}
311
- */
312
-
313
- VizBehavior["PLACEHOLDER"] = "placeholder";
314
- VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
315
- VizBehavior["TRELLIS"] = "trellis";
316
- })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
317
-
318
- /***/ }),
319
- /* 7 */
320
- /***/ (function(module, exports, __webpack_require__) {
321
-
322
- "use strict";
323
-
324
-
325
- Object.defineProperty(exports, "__esModule", {
326
- value: true
327
- });
328
- exports.VizCategory = void 0;
329
- var VizCategory;
330
-
331
- (function (VizCategory) {
332
- VizCategory["SINGLE_VALUE"] = "Single Value";
333
- VizCategory["TRENDS"] = "Trends";
334
- VizCategory["COMPARISONS"] = "Comparisons";
335
- VizCategory["TABLE"] = "Table";
336
- VizCategory["GAUGE"] = "Gauge";
337
- VizCategory["DISTRIBUTIONS"] = "Distributions";
338
- VizCategory["CHOROPLETH"] = "Choropleth Maps";
339
- VizCategory["SHAPES"] = "Shapes";
340
- VizCategory["MISC"] = "misc";
341
- VizCategory["FLOW"] = "Flow";
342
- VizCategory["CORRELATION"] = "Correlation";
343
- VizCategory["SPATIAL"] = "Spatial";
344
- })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
345
-
346
- /***/ }),
347
- /* 8 */
348
- /***/ (function(module, exports) {
349
-
350
- module.exports = require("@splunk/themes/pick");
351
-
352
- /***/ }),
353
- /* 9 */
354
- /***/ (function(module, exports) {
355
-
356
- module.exports = require("@splunk/themes/variables");
357
-
358
- /***/ }),
359
- /* 10 */,
360
- /* 11 */,
361
- /* 12 */,
362
- /* 13 */
363
- /***/ (function(module, exports) {
364
-
365
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
366
-
367
- /***/ }),
368
- /* 14 */,
369
- /* 15 */,
370
- /* 16 */,
371
- /* 17 */,
372
- /* 18 */,
373
- /* 19 */,
374
- /* 20 */,
375
- /* 21 */,
376
- /* 22 */,
377
- /* 23 */,
378
- /* 24 */,
379
- /* 25 */,
380
- /* 26 */,
381
- /* 27 */,
382
- /* 28 */,
383
- /* 29 */,
384
- /* 30 */,
385
- /* 31 */,
386
- /* 32 */
387
- /***/ (function(module, exports, __webpack_require__) {
388
-
389
- "use strict";
390
-
391
-
392
- Object.defineProperty(exports, "__esModule", {
393
- value: true
394
- });
395
- exports.getDynamicFillColorEditor = void 0;
396
-
397
- var i18n_1 = __webpack_require__(0);
398
-
399
- var configUtils_1 = __webpack_require__(4);
400
-
401
- var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
402
- var defaultContext = _ref.defaultContext,
403
- defaultPalettesConfig = _ref.defaultPalettesConfig;
404
- return {
405
- label: (0, i18n_1._)('Fill'),
406
- option: 'fillColor',
407
- context: 'fillColorEditorConfig',
408
- editor: 'editor.dynamicColor',
409
- showEditor: function showEditor(_ref2) {
410
- var options = _ref2.options;
411
- return (0, configUtils_1.isDynamicOption)(options.fillColor);
412
- },
413
- editorProps: {
414
- labelPosition: 'top',
415
- flyoutTitle: (0, i18n_1._)('Dynamic coloring: fill'),
416
- formatters: [{
417
- label: (0, i18n_1._)('Ranges'),
418
- 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",
419
167
  defaults: {
420
- fillDataValue: defaultContext.fillColorConfig
168
+ fillDataValue: defaultContext2.fillColorConfig
421
169
  }
422
- }, {
423
- label: (0, i18n_1._)('Matches'),
424
- value: 'matchValue',
170
+ },
171
+ {
172
+ label: (0, i18n_exports._)("Matches"),
173
+ value: "matchValue",
425
174
  defaults: {
426
- fillDataValue: defaultContext.fillColorMatchConfig
175
+ fillDataValue: defaultContext2.fillColorMatchConfig
427
176
  }
428
- }],
429
- dataSelectors: [{
430
- label: (0, i18n_1._)('Fill'),
431
- value: 'fillDataValue'
432
- }],
433
- defaultPalettesConfig: defaultPalettesConfig
434
- }
435
- };
436
- };
437
-
438
- exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
439
-
440
- /***/ }),
441
- /* 33 */
442
- /***/ (function(module, exports, __webpack_require__) {
443
-
444
- "use strict";
445
-
446
-
447
- Object.defineProperty(exports, "__esModule", {
448
- value: true
177
+ }
178
+ ],
179
+ dataSelectors: [
180
+ {
181
+ label: (0, i18n_exports._)("Fill"),
182
+ value: "fillDataValue"
183
+ }
184
+ ],
185
+ defaultPalettesConfig: defaultPalettesConfig2
186
+ }
449
187
  });
450
- exports.getDynamicStrokeColorEditor = void 0;
451
-
452
- var i18n_1 = __webpack_require__(0);
453
188
 
454
- var configUtils_1 = __webpack_require__(4);
455
-
456
- var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
457
- var defaultContext = _ref.defaultContext,
458
- defaultPalettesConfig = _ref.defaultPalettesConfig;
459
- return {
460
- label: (0, i18n_1._)('Stroke'),
461
- option: 'strokeColor',
462
- context: 'strokeColorEditorConfig',
463
- editor: 'editor.dynamicColor',
464
- showEditor: function showEditor(_ref2) {
465
- var options = _ref2.options;
466
- return (0, configUtils_1.isDynamicOption)(options.strokeColor);
467
- },
468
- editorProps: {
469
- labelPosition: 'top',
470
- flyoutTitle: (0, i18n_1._)('Dynamic coloring: stroke'),
471
- formatters: [{
472
- label: (0, i18n_1._)('Ranges'),
473
- 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",
474
203
  defaults: {
475
- strokeDataValue: defaultContext.strokeColorConfig
204
+ strokeDataValue: defaultContext2.strokeColorConfig
476
205
  }
477
- }, {
478
- label: (0, i18n_1._)('Matches'),
479
- value: 'matchValue',
206
+ },
207
+ {
208
+ label: (0, i18n_exports._)("Matches"),
209
+ value: "matchValue",
480
210
  defaults: {
481
- strokeDataValue: defaultContext.strokeColorMatchConfig
211
+ strokeDataValue: defaultContext2.strokeColorMatchConfig
482
212
  }
483
- }],
484
- dataSelectors: [{
485
- label: (0, i18n_1._)('Stroke'),
486
- value: 'strokeDataValue'
487
- }],
488
- defaultPalettesConfig: defaultPalettesConfig
489
- }
490
- };
491
- };
492
-
493
- exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
494
-
495
- /***/ }),
496
- /* 34 */
497
- /***/ (function(module, exports, __webpack_require__) {
498
-
499
- "use strict";
500
-
501
-
502
- Object.defineProperty(exports, "__esModule", {
503
- value: true
213
+ }
214
+ ],
215
+ dataSelectors: [
216
+ {
217
+ label: (0, i18n_exports._)("Stroke"),
218
+ value: "strokeDataValue"
219
+ }
220
+ ],
221
+ defaultPalettesConfig: defaultPalettesConfig2
222
+ }
504
223
  });
505
224
 
506
- var i18n_1 = __webpack_require__(0);
507
-
508
- var configUtils_1 = __webpack_require__(4);
509
-
225
+ // src/common/editorConfig/StaticFillColorEditor.ts
510
226
  var StaticFillColorEditor = {
511
- label: (0, i18n_1._)('Fill'),
512
- option: 'fillColor',
513
- editor: 'editor.color',
514
- showEditor: function showEditor(_ref) {
515
- var options = _ref.options;
516
- return !(0, configUtils_1.isDynamicOption)(options.fillColor);
517
- }
227
+ label: (0, i18n_exports._)("Fill"),
228
+ option: "fillColor",
229
+ editor: "editor.color",
230
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.fillColor)
518
231
  };
519
- exports.default = StaticFillColorEditor;
520
-
521
- /***/ }),
522
- /* 35 */
523
- /***/ (function(module, exports, __webpack_require__) {
524
-
525
- "use strict";
526
-
527
-
528
- Object.defineProperty(exports, "__esModule", {
529
- value: true
530
- });
531
-
532
- var i18n_1 = __webpack_require__(0);
533
-
534
- var configUtils_1 = __webpack_require__(4);
232
+ var StaticFillColorEditor_default = StaticFillColorEditor;
535
233
 
234
+ // src/common/editorConfig/StaticStrokeColorEditor.ts
536
235
  var StaticStrokeColorEditor = {
537
- label: (0, i18n_1._)('Stroke'),
538
- option: 'strokeColor',
539
- editor: 'editor.color',
540
- showEditor: function showEditor(_ref) {
541
- var options = _ref.options;
542
- return !(0, configUtils_1.isDynamicOption)(options.strokeColor);
543
- }
236
+ label: (0, i18n_exports._)("Stroke"),
237
+ option: "strokeColor",
238
+ editor: "editor.color",
239
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.strokeColor)
544
240
  };
545
- exports.default = StaticStrokeColorEditor;
546
-
547
- /***/ }),
548
- /* 36 */,
549
- /* 37 */,
550
- /* 38 */,
551
- /* 39 */,
552
- /* 40 */,
553
- /* 41 */,
554
- /* 42 */,
555
- /* 43 */,
556
- /* 44 */
557
- /***/ (function(module, exports, __webpack_require__) {
558
-
559
- "use strict";
560
-
561
-
562
- Object.defineProperty(exports, "__esModule", {
563
- value: true
564
- });
565
-
566
- var i18n_1 = __webpack_require__(0);
567
-
568
- var PresetPalettes_1 = __webpack_require__(13);
569
-
570
- var visualization_schemas_1 = __webpack_require__(2);
571
-
572
- var pick_1 = __webpack_require__(8);
573
-
574
- var variables_1 = __webpack_require__(9);
575
-
576
- var VizBehavior_1 = __webpack_require__(6);
577
-
578
- var VizCategory_1 = __webpack_require__(7);
579
-
580
- var configUtils_1 = __webpack_require__(3);
581
-
582
- var DynamicFillColorEditor_1 = __webpack_require__(32);
583
-
584
- var DynamicStrokeColorEditor_1 = __webpack_require__(33);
585
-
586
- var StaticFillColorEditor_1 = __webpack_require__(34);
587
-
588
- var StaticStrokeColorEditor_1 = __webpack_require__(35);
241
+ var StaticStrokeColorEditor_default = StaticStrokeColorEditor;
589
242
 
243
+ // src/Ellipse/config.ts
590
244
  var dataContract = {
591
245
  requiredDataSources: [],
592
- optionalDataSources: [{
593
- name: 'primary',
594
- description: 'DataSource that powers the visualization'
595
- }],
596
- initialRequestParams: {
597
- primary: {
598
- offset: 0,
599
- count: 10000
246
+ optionalDataSources: [
247
+ {
248
+ name: "primary",
249
+ description: "DataSource that powers the visualization"
600
250
  }
251
+ ],
252
+ initialRequestParams: {
253
+ primary: { offset: 0, count: 1e4 }
601
254
  }
602
255
  };
603
256
  var size = {
@@ -605,240 +258,256 @@ var size = {
605
258
  initialHeight: 300
606
259
  };
607
260
  var defaultContext = {
608
- fillColorConfig: [{
609
- from: 100,
610
- value: '#118832'
611
- }, {
612
- from: 80,
613
- to: 100,
614
- value: '#669922'
615
- }, {
616
- from: 60,
617
- to: 80,
618
- value: '#9D9F0D'
619
- }, {
620
- from: 40,
621
- to: 60,
622
- value: '#CBA700'
623
- }, {
624
- from: 20,
625
- to: 40,
626
- value: '#D97A0D'
627
- }, {
628
- from: 0,
629
- to: 20,
630
- value: '#D94E17'
631
- }, {
632
- to: 0,
633
- value: '#D41F1F'
634
- }],
635
- strokeColorConfig: [{
636
- from: 100,
637
- value: '#118832'
638
- }, {
639
- from: 80,
640
- to: 100,
641
- value: '#669922'
642
- }, {
643
- from: 60,
644
- to: 80,
645
- value: '#9D9F0D'
646
- }, {
647
- from: 40,
648
- to: 60,
649
- value: '#CBA700'
650
- }, {
651
- from: 20,
652
- to: 40,
653
- value: '#D97A0D'
654
- }, {
655
- from: 0,
656
- to: 20,
657
- value: '#D94E17'
658
- }, {
659
- to: 0,
660
- value: '#D41F1F'
661
- }],
662
- fillColorMatchConfig: [{
663
- match: '',
664
- value: '#5C33FF'
665
- }],
666
- strokeColorMatchConfig: [{
667
- match: '',
668
- value: '#5C33FF'
669
- }]
261
+ fillColorConfig: [
262
+ {
263
+ from: 100,
264
+ value: "#118832"
265
+ },
266
+ {
267
+ from: 80,
268
+ to: 100,
269
+ value: "#669922"
270
+ },
271
+ {
272
+ from: 60,
273
+ to: 80,
274
+ value: "#9D9F0D"
275
+ },
276
+ {
277
+ from: 40,
278
+ to: 60,
279
+ value: "#CBA700"
280
+ },
281
+ {
282
+ from: 20,
283
+ to: 40,
284
+ value: "#D97A0D"
285
+ },
286
+ {
287
+ from: 0,
288
+ to: 20,
289
+ value: "#D94E17"
290
+ },
291
+ {
292
+ to: 0,
293
+ value: "#D41F1F"
294
+ }
295
+ ],
296
+ strokeColorConfig: [
297
+ {
298
+ from: 100,
299
+ value: "#118832"
300
+ },
301
+ {
302
+ from: 80,
303
+ to: 100,
304
+ value: "#669922"
305
+ },
306
+ {
307
+ from: 60,
308
+ to: 80,
309
+ value: "#9D9F0D"
310
+ },
311
+ {
312
+ from: 40,
313
+ to: 60,
314
+ value: "#CBA700"
315
+ },
316
+ {
317
+ from: 20,
318
+ to: 40,
319
+ value: "#D97A0D"
320
+ },
321
+ {
322
+ from: 0,
323
+ to: 20,
324
+ value: "#D94E17"
325
+ },
326
+ {
327
+ to: 0,
328
+ value: "#D41F1F"
329
+ }
330
+ ],
331
+ fillColorMatchConfig: [{ match: "", value: "#5C33FF" }],
332
+ strokeColorMatchConfig: [{ match: "", value: "#5C33FF" }]
670
333
  };
671
334
  var themes = {
672
- defaultFillColor: function defaultFillColor(props) {
673
- return (0, pick_1.default)({
674
- enterprise: {
675
- dark: variables_1.default.gray25(props),
676
- light: variables_1.default.gray80(props)
677
- },
678
- prisma: variables_1.default.backgroundColorSidebar(props)
679
- })(props);
680
- },
681
- defaultStrokeColor: function defaultStrokeColor(props) {
682
- return (0, pick_1.default)({
683
- enterprise: {
684
- dark: variables_1.default.gray80(props),
685
- light: variables_1.default.gray30(props)
686
- },
687
- prisma: variables_1.default.neutral500(props)
688
- })(props);
689
- }
335
+ defaultFillColor: (props) => pick_default({
336
+ enterprise: {
337
+ dark: variables_default.gray25(props),
338
+ light: variables_default.gray80(props)
339
+ },
340
+ prisma: variables_default.backgroundColorSidebar(props)
341
+ })(props),
342
+ defaultStrokeColor: (props) => pick_default({
343
+ enterprise: {
344
+ dark: variables_default.gray80(props),
345
+ light: variables_default.gray30(props)
346
+ },
347
+ prisma: variables_default.neutral500(props)
348
+ })(props)
690
349
  };
691
350
  var basePresetContext = {
692
- fillColorEditorConfig: undefined,
693
- strokeColorEditorConfig: undefined
351
+ fillColorEditorConfig: void 0,
352
+ strokeColorEditorConfig: void 0
694
353
  };
695
354
  var basePresetOptions = {
696
- fillColor: undefined,
697
- strokeColor: undefined
355
+ fillColor: void 0,
356
+ strokeColor: void 0
698
357
  };
699
- var presets = [{
700
- // dummy context variables to allow for resetting of unused context states
701
- label: (0, i18n_1._)('None'),
702
- name: 'ellipse.none',
703
- value: {
704
- context: Object.assign({}, basePresetContext),
705
- options: Object.assign({}, basePresetOptions)
706
- }
707
- }, {
708
- label: (0, i18n_1._)('Fill'),
709
- name: 'ellipse.fill',
710
- value: {
711
- context: Object.assign(Object.assign({}, basePresetContext), {
712
- fillDataValue: '> primary | seriesByType("number") | lastPoint()',
713
- fillColorEditorConfig: defaultContext.fillColorConfig
714
- }),
715
- options: Object.assign(Object.assign({}, basePresetOptions), {
716
- fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)'
717
- })
718
- }
719
- }, {
720
- label: (0, i18n_1._)('Stroke'),
721
- name: 'ellipse.stroke',
722
- value: {
723
- context: Object.assign(Object.assign({}, basePresetContext), {
724
- strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
725
- strokeColorEditorConfig: defaultContext.strokeColorConfig
726
- }),
727
- options: Object.assign(Object.assign({}, basePresetOptions), {
728
- strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
729
- })
730
- }
731
- }, {
732
- label: (0, i18n_1._)('Fill and Stroke'),
733
- name: 'ellipse.fillAndStroke',
734
- value: {
735
- context: Object.assign(Object.assign({}, basePresetContext), {
736
- fillDataValue: '> primary | seriesByType("number") | lastPoint()',
737
- strokeDataValue: '> primary | seriesByType("number") | lastPoint()',
738
- fillColorEditorConfig: defaultContext.fillColorConfig,
739
- strokeColorEditorConfig: defaultContext.strokeColorConfig
740
- }),
741
- options: Object.assign(Object.assign({}, basePresetOptions), {
742
- fillColor: '> fillDataValue | rangeValue(fillColorEditorConfig)',
743
- strokeColor: '> strokeDataValue | rangeValue(strokeColorEditorConfig)'
744
- })
745
- }
746
- }];
747
- var editorConfig = [{
748
- label: (0, i18n_1._)('Color and style'),
749
- layout: [[{
750
- label: (0, i18n_1._)('Dynamic elements'),
751
- key: 'presetSelector',
752
- editor: 'editor.presetSelector',
753
- editorProps: {
754
- presets: presets,
755
- value: function value(_ref) {
756
- var context = _ref.context,
757
- options = _ref.options;
758
- var initialPreset = (0, configUtils_1.getInitialPreset)(context, options, presets);
759
- return initialPreset && initialPreset.label || null;
760
- }
761
- }
762
- }], [Object.assign(Object.assign({}, StaticFillColorEditor_1.default), {
763
- editorProps: {
764
- themes: themes
358
+ var presets = [
359
+ {
360
+ // dummy context variables to allow for resetting of unused context states
361
+ label: (0, i18n_exports._)("None"),
362
+ name: "ellipse.none",
363
+ value: {
364
+ context: __spreadValues({}, basePresetContext),
365
+ options: __spreadValues({}, basePresetOptions)
765
366
  }
766
- })], [(0, DynamicFillColorEditor_1.getDynamicFillColorEditor)({
767
- defaultContext: defaultContext,
768
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
769
- })], [Object.assign(Object.assign({}, StaticStrokeColorEditor_1.default), {
770
- editorProps: {
771
- themes: themes
772
- }
773
- })], [(0, DynamicStrokeColorEditor_1.getDynamicStrokeColorEditor)({
774
- defaultContext: defaultContext,
775
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
776
- })], [{
777
- label: (0, i18n_1._)('Fill opacity (%)'),
778
- option: 'fillOpacity',
779
- editor: 'editor.percent',
780
- editorProps: {
781
- min: 0
782
- }
783
- }, {
784
- label: (0, i18n_1._)('Stroke opacity (%)'),
785
- option: 'strokeOpacity',
786
- editor: 'editor.percent',
787
- editorProps: {
788
- min: 0
367
+ },
368
+ {
369
+ label: (0, i18n_exports._)("Fill"),
370
+ name: "ellipse.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
+ })
789
379
  }
790
- }], [{
791
- label: (0, i18n_1._)('Stroke width'),
792
- option: 'strokeWidth',
793
- editor: 'editor.number',
794
- editorProps: {
795
- min: 0
380
+ },
381
+ {
382
+ label: (0, i18n_exports._)("Stroke"),
383
+ name: "ellipse.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
+ })
796
392
  }
797
- }, {
798
- label: (0, i18n_1._)('Stroke dash style'),
799
- option: 'strokeDashStyle',
800
- editor: 'editor.number',
801
- editorProps: {
802
- min: 0
393
+ },
394
+ {
395
+ label: (0, i18n_exports._)("Fill and Stroke"),
396
+ name: "ellipse.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
+ })
803
408
  }
804
- }]]
805
- }];
806
- /**
807
- * visualization configuration
808
- */
809
-
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
+ ];
810
484
  var config = {
811
485
  /**
812
486
  * unique viz key
813
487
  */
814
- key: 'splunk.ellipse',
815
-
488
+ key: "splunk.ellipse",
816
489
  /**
817
490
  * viz name
818
491
  */
819
- name: (0, i18n_1._)('Ellipse'),
820
- category: VizCategory_1.VizCategory.SHAPES,
821
-
492
+ name: (0, i18n_exports._)("Ellipse"),
493
+ category: "Shapes" /* SHAPES */,
822
494
  /**
823
495
  * viz icon
824
496
  */
825
497
  icon: null,
826
- dataContract: dataContract,
827
- size: size,
828
- defaultContext: defaultContext,
829
- optionsSchema: visualization_schemas_1.ellipseOptionsSchema,
830
- editorConfig: editorConfig,
498
+ dataContract,
499
+ size,
500
+ defaultContext,
501
+ optionsSchema: visualization_schemas_exports.ellipseOptionsSchema,
502
+ editorConfig,
831
503
  events: {
832
- 'ellipse.click': {
833
- description: 'triggered when user clicks ellipse',
834
- payloadKeys: ['strokeColor', 'fillColor']
504
+ "ellipse.click": {
505
+ description: "triggered when user clicks ellipse",
506
+ payloadKeys: ["strokeColor", "fillColor"]
835
507
  }
836
508
  },
837
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS],
838
- themes: themes
509
+ supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */],
510
+ themes
839
511
  };
840
- exports.default = (0, configUtils_1.enhanceConfig)(config);
841
-
842
- /***/ })
843
- /******/ ]);
844
- //# sourceMappingURL=Ellipse.config.js.map
512
+ var config_default = enhanceConfig(config);
513
+ //# sourceMappingURL=Ellipse.config.js.map