@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.
Files changed (153) hide show
  1. package/Area.config.js +1399 -1590
  2. package/Area.config.js.map +7 -1
  3. package/Area.js +3750 -4822
  4. package/Area.js.map +7 -1
  5. package/Bar.config.js +1423 -1566
  6. package/Bar.config.js.map +7 -1
  7. package/Bar.js +3856 -4884
  8. package/Bar.js.map +7 -1
  9. package/Bubble.config.js +1009 -1200
  10. package/Bubble.config.js.map +7 -1
  11. package/Bubble.js +2768 -4491
  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 +2032 -3808
  16. package/ChoroplethSvg.js.map +7 -1
  17. package/Column.config.js +1390 -1534
  18. package/Column.config.js.map +7 -1
  19. package/Column.js +3849 -4906
  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 +1667 -3327
  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 +2643 -4647
  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 +2164 -4575
  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 +1423 -3046
  36. package/Image.js.map +7 -1
  37. package/Line.config.js +1421 -1616
  38. package/Line.config.js.map +7 -1
  39. package/Line.js +3790 -4901
  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 +5272 -6185
  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 +3382 -5659
  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 +1671 -3212
  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 +2215 -4531
  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 +2057 -4718
  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 +2107 -3984
  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 +2734 -5037
  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 +1664 -3258
  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 +2766 -4908
  77. package/Sankey.js.map +7 -1
  78. package/Scatter.config.js +988 -1180
  79. package/Scatter.config.js.map +7 -1
  80. package/Scatter.js +2801 -4506
  81. package/Scatter.js.map +7 -1
  82. package/SingleValue.config.js +794 -1250
  83. package/SingleValue.config.js.map +7 -1
  84. package/SingleValue.js +4185 -7327
  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 +757 -1207
  89. package/SingleValueIcon.config.js.map +7 -1
  90. package/SingleValueIcon.js +3427 -6293
  91. package/SingleValueIcon.js.map +7 -1
  92. package/SingleValueRadial.config.js +686 -1121
  93. package/SingleValueRadial.config.js.map +7 -1
  94. package/SingleValueRadial.js +3923 -6994
  95. package/SingleValueRadial.js.map +7 -1
  96. package/SparkLine.js +439 -746
  97. package/SparkLine.js.map +7 -1
  98. package/TRELLIS.md +16 -15
  99. package/Table.config.js +565 -879
  100. package/Table.config.js.map +7 -1
  101. package/Table.js +3260 -5334
  102. package/Table.js.map +7 -1
  103. package/common/Charting.js +617 -1498
  104. package/common/Charting.js.map +7 -1
  105. package/common/ChartingApi.js +46 -170
  106. package/common/ChartingApi.js.map +7 -1
  107. package/common/DocExampleWithVizSandbox.js +270 -473
  108. package/common/DocExampleWithVizSandbox.js.map +7 -1
  109. package/common/EventsDoc.js +172 -464
  110. package/common/EventsDoc.js.map +7 -1
  111. package/common/GaugeMajorTicks.js +249 -347
  112. package/common/GaugeMajorTicks.js.map +7 -1
  113. package/common/GaugeValueMarker.js +201 -311
  114. package/common/GaugeValueMarker.js.map +7 -1
  115. package/common/OptionsDoc.js +351 -911
  116. package/common/OptionsDoc.js.map +7 -1
  117. package/common/OverviewDoc.js +435 -769
  118. package/common/OverviewDoc.js.map +7 -1
  119. package/common/SplunkVisualization.js +116 -259
  120. package/common/SplunkVisualization.js.map +7 -1
  121. package/common/SplunkVisualizationApi.js +40 -156
  122. package/common/SplunkVisualizationApi.js.map +7 -1
  123. package/common/ThemesDoc.js +271 -420
  124. package/common/ThemesDoc.js.map +7 -1
  125. package/common/chartingUtils.js +140 -312
  126. package/common/chartingUtils.js.map +7 -1
  127. package/common/docUtils.js +148 -266
  128. package/common/docUtils.js.map +7 -1
  129. package/common/gaugeUtils.js +280 -808
  130. package/common/gaugeUtils.js.map +7 -1
  131. package/common/shapeUtils.js +106 -211
  132. package/common/shapeUtils.js.map +7 -1
  133. package/common/utils/configUtils.js +126 -252
  134. package/common/utils/configUtils.js.map +7 -1
  135. package/common/utils/dataUtils.js +217 -812
  136. package/common/utils/dataUtils.js.map +7 -1
  137. package/common/utils/featureFlagUtils.js +53 -133
  138. package/common/utils/featureFlagUtils.js.map +7 -1
  139. package/common/utils/hocUtils.js +32 -122
  140. package/common/utils/hocUtils.js.map +7 -1
  141. package/common/utils/mapUtils.js +502 -1337
  142. package/common/utils/mapUtils.js.map +7 -1
  143. package/common/utils/singleValueUtils.js +466 -1013
  144. package/common/utils/singleValueUtils.js.map +7 -1
  145. package/common/utils/testHelper.js +92 -146
  146. package/common/utils/testHelper.js.map +7 -1
  147. package/common/utils/trellisUtils.js +277 -489
  148. package/common/utils/trellisUtils.js.map +7 -1
  149. package/common/utils/urlUtils.js +28 -112
  150. package/common/utils/urlUtils.js.map +7 -1
  151. package/common/withDashboardViz.js +1191 -2431
  152. package/common/withDashboardViz.js.map +7 -1
  153. package/package.json +53 -45
@@ -1,473 +1,171 @@
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 = 42);
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/ChoroplethSvg/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
55
+ module.exports = __toCommonJS(config_exports);
126
56
 
127
-
128
- var visualization_schemas_1 = __webpack_require__(2);
129
-
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/themes/pick
67
+ var pick_exports = {};
68
+ __export(pick_exports, {
69
+ default: () => pick_default
70
+ });
71
+ var defaultImport2 = __toESM(require("@splunk/themes/pick"));
72
+ __reExport(pick_exports, require("@splunk/themes/pick"));
73
+ var pick_default = "default" in defaultImport2 ? defaultImport2.default : defaultImport2;
74
+
75
+ // esm-externals:@splunk/themes/variables
76
+ var variables_exports = {};
77
+ __export(variables_exports, {
78
+ default: () => variables_default
79
+ });
80
+ var defaultImport3 = __toESM(require("@splunk/themes/variables"));
81
+ __reExport(variables_exports, require("@splunk/themes/variables"));
82
+ var variables_default = "default" in defaultImport3 ? defaultImport3.default : defaultImport3;
83
+
84
+ // esm-externals:@splunk/visualization-schemas
85
+ var visualization_schemas_exports = {};
86
+ __export(visualization_schemas_exports, {
87
+ default: () => visualization_schemas_default
88
+ });
89
+ var defaultImport4 = __toESM(require("@splunk/visualization-schemas"));
90
+ __reExport(visualization_schemas_exports, require("@splunk/visualization-schemas"));
91
+ var visualization_schemas_default = "default" in defaultImport4 ? defaultImport4.default : defaultImport4;
92
+
93
+ // esm-externals:@splunk/visualization-color-palettes/editors/PresetPalettes
94
+ var PresetPalettes_exports = {};
95
+ __export(PresetPalettes_exports, {
96
+ default: () => PresetPalettes_default
97
+ });
98
+ var defaultImport5 = __toESM(require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
99
+ __reExport(PresetPalettes_exports, require("@splunk/visualization-color-palettes/editors/PresetPalettes"));
100
+ var PresetPalettes_default = "default" in defaultImport5 ? defaultImport5.default : defaultImport5;
101
+
102
+ // esm-externals:@splunk/visualization-icons
103
+ var visualization_icons_exports = {};
104
+ __export(visualization_icons_exports, {
105
+ default: () => visualization_icons_default
135
106
  });
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
- */
107
+ var defaultImport6 = __toESM(require("@splunk/visualization-icons"));
108
+ __reExport(visualization_icons_exports, require("@splunk/visualization-icons"));
109
+ var visualization_icons_default = "default" in defaultImport6 ? defaultImport6.default : defaultImport6;
110
+
111
+ // esm-externals:@splunk/visualization-icons/placeholders
112
+ var placeholders_exports = {};
113
+ __export(placeholders_exports, {
114
+ default: () => placeholders_default
115
+ });
116
+ var defaultImport7 = __toESM(require("@splunk/visualization-icons/placeholders"));
117
+ __reExport(placeholders_exports, require("@splunk/visualization-icons/placeholders"));
118
+ var placeholders_default = "default" in defaultImport7 ? defaultImport7.default : defaultImport7;
119
+
120
+ // esm-externals:lodash
121
+ var lodash_exports = {};
122
+ __export(lodash_exports, {
123
+ default: () => lodash_default
124
+ });
125
+ var defaultImport8 = __toESM(require("lodash"));
126
+ __reExport(lodash_exports, require("lodash"));
127
+ var lodash_default = "default" in defaultImport8 ? defaultImport8.default : defaultImport8;
128
+
129
+ // esm-externals:@splunk/visualizations-shared/configUtils
130
+ var configUtils_exports = {};
131
+ __export(configUtils_exports, {
132
+ default: () => configUtils_default
133
+ });
134
+ var defaultImport9 = __toESM(require("@splunk/visualizations-shared/configUtils"));
135
+ __reExport(configUtils_exports, require("@splunk/visualizations-shared/configUtils"));
136
+ var configUtils_default = "default" in defaultImport9 ? defaultImport9.default : defaultImport9;
143
137
 
138
+ // src/common/utils/configUtils.ts
144
139
  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
- });
140
+ const enhancedConfig = __spreadValues({}, vizConfig);
141
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(
142
+ (config2) => {
143
+ return __spreadProps(__spreadValues({}, config2), { open: config2.open || false });
144
+ }
145
+ );
151
146
  return enhancedConfig;
152
147
  }
153
148
 
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
- 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
- });
195
- }
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
- 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
- });
206
- }
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
-
225
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
226
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
227
- });
228
- }
229
-
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
- /***/ (function(module, exports) {
361
-
362
- module.exports = require("@splunk/visualization-icons/placeholders");
363
-
364
- /***/ }),
365
- /* 11 */
366
- /***/ (function(module, exports) {
367
-
368
- module.exports = require("@splunk/visualization-icons");
369
-
370
- /***/ }),
371
- /* 12 */,
372
- /* 13 */
373
- /***/ (function(module, exports) {
374
-
375
- module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
376
-
377
- /***/ }),
378
- /* 14 */,
379
- /* 15 */,
380
- /* 16 */,
381
- /* 17 */,
382
- /* 18 */,
383
- /* 19 */,
384
- /* 20 */,
385
- /* 21 */,
386
- /* 22 */
387
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
388
-
389
- "use strict";
390
- __webpack_require__.r(__webpack_exports__);
391
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(0);
392
- /* harmony import */ var _splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__);
393
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(4);
394
- /* harmony import */ var _splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__);
395
-
396
-
149
+ // src/common/editorConfig/StaticBackgroundColorEditor.js
397
150
  var StaticBackgroundColorEditor = {
398
- label: Object(_splunk_ui_utils_i18n__WEBPACK_IMPORTED_MODULE_0__["_"])('Background color'),
399
- option: 'backgroundColor',
400
- editor: 'editor.color',
401
- showEditor: function showEditor(_ref) {
402
- var options = _ref.options;
403
- return !Object(_splunk_visualizations_shared_configUtils__WEBPACK_IMPORTED_MODULE_1__["isDynamicOption"])(options.backgroundColor);
404
- }
151
+ label: (0, i18n_exports._)("Background color"),
152
+ option: "backgroundColor",
153
+ editor: "editor.color",
154
+ showEditor: ({ options }) => !(0, configUtils_exports.isDynamicOption)(options.backgroundColor)
405
155
  };
406
- /* harmony default export */ __webpack_exports__["default"] = (StaticBackgroundColorEditor);
407
-
408
- /***/ }),
409
- /* 23 */,
410
- /* 24 */,
411
- /* 25 */,
412
- /* 26 */,
413
- /* 27 */,
414
- /* 28 */,
415
- /* 29 */,
416
- /* 30 */,
417
- /* 31 */,
418
- /* 32 */,
419
- /* 33 */,
420
- /* 34 */,
421
- /* 35 */,
422
- /* 36 */,
423
- /* 37 */,
424
- /* 38 */,
425
- /* 39 */,
426
- /* 40 */,
427
- /* 41 */,
428
- /* 42 */
429
- /***/ (function(module, exports, __webpack_require__) {
430
-
431
- "use strict";
432
-
433
-
434
- Object.defineProperty(exports, "__esModule", {
435
- value: true
436
- });
437
-
438
- var i18n_1 = __webpack_require__(0);
439
-
440
- var pick_1 = __webpack_require__(8);
441
-
442
- var variables_1 = __webpack_require__(9);
443
-
444
- var visualization_schemas_1 = __webpack_require__(2);
445
-
446
- var PresetPalettes_1 = __webpack_require__(13);
447
-
448
- var visualization_icons_1 = __webpack_require__(11);
449
-
450
- var placeholders_1 = __webpack_require__(10);
451
-
452
- var VizBehavior_1 = __webpack_require__(6);
453
-
454
- var configUtils_1 = __webpack_require__(3);
455
-
456
- var VizCategory_1 = __webpack_require__(7);
457
-
458
- var StaticBackgroundColorEditor_1 = __webpack_require__(22);
156
+ var StaticBackgroundColorEditor_default = StaticBackgroundColorEditor;
459
157
 
158
+ // src/ChoroplethSvg/config.ts
460
159
  var dataContract = {
461
160
  requiredDataSources: [],
462
- optionalDataSources: [{
463
- name: 'primary',
464
- description: 'DataSource that powers the visualization'
465
- }],
466
- initialRequestParams: {
467
- primary: {
468
- offset: 0,
469
- count: 10000
161
+ optionalDataSources: [
162
+ {
163
+ name: "primary",
164
+ description: "DataSource that powers the visualization"
470
165
  }
166
+ ],
167
+ initialRequestParams: {
168
+ primary: { offset: 0, count: 1e4 }
471
169
  }
472
170
  };
473
171
  var size = {
@@ -475,148 +173,150 @@ var size = {
475
173
  initialHeight: 300
476
174
  };
477
175
  var defaultContext = {
478
- areaColorsGradientConfig: {
479
- colors: ['#7EEFDA', '#6484F6', '#C093F9', '#293873']
480
- },
481
- areaColorsRangeConfig: [{
482
- to: 20,
483
- value: '#D41F1F'
484
- }, {
485
- from: 20,
486
- to: 40,
487
- value: '#D94E17'
488
- }, {
489
- from: 40,
490
- to: 60,
491
- value: '#CBA700'
492
- }, {
493
- from: 60,
494
- to: 80,
495
- value: '#669922'
496
- }, {
497
- from: 80,
498
- value: '#118832'
499
- }],
500
- areaColorsMatchConfig: [{
501
- match: '',
502
- value: '#5C33FF'
503
- }]
176
+ areaColorsGradientConfig: { colors: ["#7EEFDA", "#6484F6", "#C093F9", "#293873"] },
177
+ areaColorsRangeConfig: [
178
+ { to: 20, value: "#D41F1F" },
179
+ { from: 20, to: 40, value: "#D94E17" },
180
+ { from: 40, to: 60, value: "#CBA700" },
181
+ { from: 60, to: 80, value: "#669922" },
182
+ { from: 80, value: "#118832" }
183
+ ],
184
+ areaColorsMatchConfig: [{ match: "", value: "#5C33FF" }]
504
185
  };
505
186
  var themes = {
506
- defaultBackgroundColor: function defaultBackgroundColor(props) {
507
- return (0, pick_1.default)({
508
- enterprise: {
509
- dark: variables_1.default.black(props),
510
- light: variables_1.default.backgroundColor(props)
511
- },
512
- prisma: variables_1.default.backgroundColorSidebar(props)
513
- })(props);
514
- }
187
+ defaultBackgroundColor: (props) => pick_default({
188
+ enterprise: {
189
+ dark: variables_default.black(props),
190
+ light: variables_default.backgroundColor(props)
191
+ },
192
+ prisma: variables_default.backgroundColorSidebar(props)
193
+ })(props)
515
194
  };
516
- var editorConfig = [{
517
- label: (0, i18n_1._)('Data configurations'),
518
- layout: [[{
519
- label: 'Area IDs',
520
- editor: 'editor.columnSelector',
521
- option: 'areaIds',
522
- context: 'areaIdContext',
523
- editorProps: {
524
- dataSourceKey: 'primary'
525
- }
526
- }], [{
527
- label: 'Area values',
528
- editor: 'editor.columnSelector',
529
- option: 'areaValues',
530
- context: 'areaValuesContext',
531
- editorProps: {
532
- dataSourceKey: 'primary'
533
- }
534
- }]]
535
- }, {
536
- label: (0, i18n_1._)('Color and style'),
537
- layout: [[{
538
- label: (0, i18n_1._)('Areas'),
539
- option: 'areaColors',
540
- context: 'defaultContext',
541
- editor: 'editor.dynamicColor',
542
- editorProps: {
543
- labelPosition: 'top',
544
- flyoutTitle: (0, i18n_1._)('Dynamic coloring: value'),
545
- formatters: [{
546
- label: (0, i18n_1._)('Ranges'),
547
- value: 'rangeValue',
548
- isDefault: true,
549
- defaults: {
550
- areaValues: defaultContext.areaColorsRangeConfig
195
+ var editorConfig = [
196
+ {
197
+ label: (0, i18n_exports._)("Data configurations"),
198
+ layout: [
199
+ [
200
+ {
201
+ label: "Area IDs",
202
+ editor: "editor.columnSelector",
203
+ option: "areaIds",
204
+ context: "areaIdContext",
205
+ // todo: need refactor this
206
+ editorProps: {
207
+ dataSourceKey: "primary"
208
+ }
551
209
  }
552
- }, {
553
- label: (0, i18n_1._)('Matches'),
554
- value: 'matchValue',
555
- defaults: {
556
- areaValues: defaultContext.areaColorsMatchConfig
210
+ ],
211
+ [
212
+ {
213
+ label: "Area values",
214
+ editor: "editor.columnSelector",
215
+ option: "areaValues",
216
+ context: "areaValuesContext",
217
+ // todo: need refactor this
218
+ editorProps: {
219
+ dataSourceKey: "primary"
220
+ }
557
221
  }
558
- }],
559
- dataSelectors: [{
560
- label: (0, i18n_1._)('Value'),
561
- value: 'areaValues'
562
- }],
563
- defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
564
- }
565
- }], [Object.assign(Object.assign({}, StaticBackgroundColorEditor_1.default), {
566
- editorProps: {
567
- themes: themes
568
- }
569
- })]]
570
- }, {
571
- label: (0, i18n_1._)('SVG content'),
572
- layout: [[{
573
- label: (0, i18n_1._)('SVG file'),
574
- option: 'svg',
575
- editor: 'editor.image',
576
- editorProps: {
577
- validMediaTypes: ['svg'],
578
- svgRenderAsDom: true
579
- }
580
- }]]
581
- }];
582
- /**
583
- * visualization configuration
584
- */
585
-
222
+ ]
223
+ ]
224
+ },
225
+ {
226
+ label: (0, i18n_exports._)("Color and style"),
227
+ layout: [
228
+ [
229
+ {
230
+ label: (0, i18n_exports._)("Areas"),
231
+ option: "areaColors",
232
+ context: "defaultContext",
233
+ editor: "editor.dynamicColor",
234
+ editorProps: {
235
+ labelPosition: "top",
236
+ flyoutTitle: (0, i18n_exports._)("Dynamic coloring: value"),
237
+ formatters: [
238
+ {
239
+ label: (0, i18n_exports._)("Ranges"),
240
+ value: "rangeValue",
241
+ isDefault: true,
242
+ // show it by default when open dynamic color flyout
243
+ defaults: {
244
+ areaValues: defaultContext.areaColorsRangeConfig
245
+ }
246
+ },
247
+ {
248
+ label: (0, i18n_exports._)("Matches"),
249
+ value: "matchValue",
250
+ defaults: {
251
+ areaValues: defaultContext.areaColorsMatchConfig
252
+ }
253
+ }
254
+ ],
255
+ dataSelectors: [
256
+ {
257
+ label: (0, i18n_exports._)("Value"),
258
+ value: "areaValues"
259
+ }
260
+ ],
261
+ defaultPalettesConfig: PresetPalettes_exports.defaultPalettesConfig
262
+ }
263
+ }
264
+ ],
265
+ [
266
+ __spreadProps(__spreadValues({}, StaticBackgroundColorEditor_default), {
267
+ editorProps: {
268
+ themes
269
+ }
270
+ })
271
+ ]
272
+ ]
273
+ },
274
+ {
275
+ label: (0, i18n_exports._)("SVG content"),
276
+ layout: [
277
+ [
278
+ {
279
+ label: (0, i18n_exports._)("SVG file"),
280
+ option: "svg",
281
+ editor: "editor.image",
282
+ editorProps: {
283
+ validMediaTypes: ["svg"],
284
+ svgRenderAsDom: true
285
+ }
286
+ }
287
+ ]
288
+ ]
289
+ }
290
+ ];
586
291
  var config = {
587
292
  /**
588
293
  * unique viz key
589
294
  */
590
- key: 'splunk.choropleth.svg',
591
-
295
+ key: "splunk.choropleth.svg",
592
296
  /**
593
297
  * viz name
594
298
  */
595
- name: (0, i18n_1._)('Choropleth SVG'),
596
- category: VizCategory_1.VizCategory.SPATIAL,
597
-
299
+ name: (0, i18n_exports._)("Choropleth SVG"),
300
+ category: "Spatial" /* SPATIAL */,
598
301
  /**
599
302
  * viz icon
600
303
  */
601
- icon: visualization_icons_1.ChoroplethSvg,
602
- placeholderIcon: placeholders_1.ChoroplethSvg,
603
- dataContract: dataContract,
604
- size: size,
605
- defaultContext: defaultContext,
606
- optionsSchema: visualization_schemas_1.choroplethSvgOptionsSchema,
607
- requiredProps: ['svg'],
608
- editorConfig: editorConfig,
304
+ icon: visualization_icons_exports.ChoroplethSvg,
305
+ placeholderIcon: placeholders_exports.ChoroplethSvg,
306
+ dataContract,
307
+ size,
308
+ defaultContext,
309
+ optionsSchema: visualization_schemas_exports.choroplethSvgOptionsSchema,
310
+ requiredProps: ["svg"],
311
+ editorConfig,
609
312
  events: {
610
- 'area.click': {
611
- description: 'trigger when user clicks one area',
612
- payloadKeys: ['value', 'name']
313
+ "area.click": {
314
+ description: "trigger when user clicks one area",
315
+ payloadKeys: ["value", "name"]
613
316
  }
614
317
  },
615
- supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.EVENTS, VizBehavior_1.VizBehavior.PLACEHOLDER],
616
- themes: themes
318
+ supports: ["dynamic-options" /* DYNAMIC_OPTIONS */, "events" /* EVENTS */, "placeholder" /* PLACEHOLDER */],
319
+ themes
617
320
  };
618
- exports.default = (0, configUtils_1.enhanceConfig)(config);
619
-
620
- /***/ })
621
- /******/ ]);
622
- //# sourceMappingURL=ChoroplethSvg.config.js.map
321
+ var config_default = enhanceConfig(config);
322
+ //# sourceMappingURL=ChoroplethSvg.config.js.map