@splunk/visualizations 25.0.0 → 25.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 (181) hide show
  1. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_basic.png +0 -0
  2. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_custom_base_layer_tile_server.png +0 -0
  3. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_dynamic_color.png +0 -0
  4. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color.png +0 -0
  5. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_marker_layer_static_color_with_no_seriesColors.png +0 -0
  6. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_off.png +0 -0
  7. package/.loki/reference/chrome_docker_PureVisualizations_PureMap_scale_unit_metric.png +0 -0
  8. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Area_Editor.png +0 -0
  9. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bar_Editor.png +0 -0
  10. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Bubble_Editor.png +0 -0
  11. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_ChoroplethSvg_Editor.png +0 -0
  12. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Column_Editor.png +0 -0
  13. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Ellipse_Editor.png +0 -0
  14. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_FillerGauge_Editor.png +0 -0
  15. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Image_Editor.png +0 -0
  16. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Line_Editor.png +0 -0
  17. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_LinkGraph_Editor.png +0 -0
  18. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Map_Editor.png +0 -0
  19. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Markdown_Editor.png +0 -0
  20. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_MarkerGauge_Editor.png +0 -0
  21. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Parallel_Coordinates_Editor.png +0 -0
  22. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Pie_Editor.png +0 -0
  23. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Punchcard_Editor.png +0 -0
  24. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Rectangle_Editor.png +0 -0
  25. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Sankey_Editor.png +0 -0
  26. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Scatter_Editor.png +0 -0
  27. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Editor.png +0 -0
  28. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Icon_Editor.png +0 -0
  29. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Single_Value_Radial_Editor.png +0 -0
  30. package/.loki/reference/chrome_docker_VisualizationEditors_Editors_Table_Editor.png +0 -0
  31. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_datasource_does_not_have_any_data.png +0 -0
  32. package/.loki/reference/chrome_docker_Visualizations_Line_Line_Placeholder_if_viz_does_not_connect_to_datasource.png +0 -0
  33. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Basic_Map.png +0 -0
  34. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer.png +0 -0
  35. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET.png +0 -0
  36. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_GET_Dynamic_Coloring.png +0 -0
  37. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Internal_Fields.png +0 -0
  38. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_By_Static_Coloring.png +0 -0
  39. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Bubble_Layer_Geostats_Dynamic_Coloring.png +0 -0
  40. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer.png +0 -0
  41. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Dynamic_coloring.png +0 -0
  42. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Marker_layer_Result_Limit_Set_To_3.png +0 -0
  43. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Restricted_Zoom.png +0 -0
  44. package/.loki/reference/chrome_docker_Visualizations_Map_Map_Set_Map_tiles.png +0 -0
  45. package/Area.config.js +166 -152
  46. package/Area.config.js.map +1 -1
  47. package/Area.js +362 -433
  48. package/Area.js.map +1 -1
  49. package/Bar.config.js +168 -148
  50. package/Bar.config.js.map +1 -1
  51. package/Bar.js +364 -429
  52. package/Bar.js.map +1 -1
  53. package/Bubble.config.js +155 -117
  54. package/Bubble.config.js.map +1 -1
  55. package/Bubble.js +353 -400
  56. package/Bubble.js.map +1 -1
  57. package/ChoroplethSvg.config.js +112 -82
  58. package/ChoroplethSvg.config.js.map +1 -1
  59. package/ChoroplethSvg.js +336 -391
  60. package/ChoroplethSvg.js.map +1 -1
  61. package/Column.config.js +164 -146
  62. package/Column.config.js.map +1 -1
  63. package/Column.js +360 -427
  64. package/Column.js.map +1 -1
  65. package/Ellipse.config.js +111 -80
  66. package/Ellipse.config.js.map +1 -1
  67. package/Ellipse.js +317 -371
  68. package/Ellipse.js.map +1 -1
  69. package/FillerGauge.config.js +117 -86
  70. package/FillerGauge.config.js.map +1 -1
  71. package/FillerGauge.js +324 -378
  72. package/FillerGauge.js.map +1 -1
  73. package/Image.config.js +100 -76
  74. package/Image.config.js.map +1 -1
  75. package/Image.js +725 -789
  76. package/Image.js.map +1 -1
  77. package/Line.config.js +164 -137
  78. package/Line.config.js.map +1 -1
  79. package/Line.js +360 -418
  80. package/Line.js.map +1 -1
  81. package/LinkGraph.config.js +137 -112
  82. package/LinkGraph.config.js.map +1 -1
  83. package/LinkGraph.js +351 -410
  84. package/LinkGraph.js.map +1 -1
  85. package/Map.config.js +140 -97
  86. package/Map.config.js.map +1 -1
  87. package/Map.js +517 -523
  88. package/Map.js.map +1 -1
  89. package/Markdown.config.js +138 -115
  90. package/Markdown.config.js.map +1 -1
  91. package/Markdown.js +502 -553
  92. package/Markdown.js.map +1 -1
  93. package/MarkerGauge.config.js +218 -195
  94. package/MarkerGauge.config.js.map +1 -1
  95. package/MarkerGauge.js +2926 -3098
  96. package/MarkerGauge.js.map +1 -1
  97. package/ParallelCoordinates.config.js +158 -133
  98. package/ParallelCoordinates.config.js.map +1 -1
  99. package/ParallelCoordinates.js +319 -377
  100. package/ParallelCoordinates.js.map +1 -1
  101. package/Pie.config.js +160 -136
  102. package/Pie.config.js.map +1 -1
  103. package/Pie.js +1316 -1492
  104. package/Pie.js.map +1 -1
  105. package/Punchcard.config.js +164 -141
  106. package/Punchcard.config.js.map +1 -1
  107. package/Punchcard.js +344 -404
  108. package/Punchcard.js.map +1 -1
  109. package/Rectangle.config.js +280 -248
  110. package/Rectangle.config.js.map +1 -1
  111. package/Rectangle.js +1247 -1303
  112. package/Rectangle.js.map +1 -1
  113. package/Sankey.config.js +175 -143
  114. package/Sankey.config.js.map +1 -1
  115. package/Sankey.js +377 -426
  116. package/Sankey.js.map +1 -1
  117. package/Scatter.config.js +156 -117
  118. package/Scatter.config.js.map +1 -1
  119. package/Scatter.js +550 -601
  120. package/Scatter.js.map +1 -1
  121. package/SingleValue.config.js +147 -115
  122. package/SingleValue.config.js.map +1 -1
  123. package/SingleValue.js +542 -598
  124. package/SingleValue.js.map +1 -1
  125. package/SingleValueBasic.js +19 -19
  126. package/SingleValueBasic.js.map +1 -1
  127. package/SingleValueIcon.config.js +154 -120
  128. package/SingleValueIcon.config.js.map +1 -1
  129. package/SingleValueIcon.js +373 -424
  130. package/SingleValueIcon.js.map +1 -1
  131. package/SingleValueRadial.config.js +143 -111
  132. package/SingleValueRadial.config.js.map +1 -1
  133. package/SingleValueRadial.js +612 -668
  134. package/SingleValueRadial.js.map +1 -1
  135. package/Table.config.js +176 -152
  136. package/Table.config.js.map +1 -1
  137. package/Table.js +740 -797
  138. package/Table.js.map +1 -1
  139. package/common/Charting.js +11 -11
  140. package/common/Charting.js.map +1 -1
  141. package/common/ChartingApi.js +2 -2
  142. package/common/ChartingApi.js.map +1 -1
  143. package/common/EventsDoc.js +12 -12
  144. package/common/EventsDoc.js.map +1 -1
  145. package/common/GaugeMajorTicks.js +8 -8
  146. package/common/GaugeMajorTicks.js.map +1 -1
  147. package/common/GaugeValueMarker.js +8 -8
  148. package/common/GaugeValueMarker.js.map +1 -1
  149. package/common/OptionsDoc.js +51 -327
  150. package/common/OptionsDoc.js.map +1 -1
  151. package/common/OverviewDoc.js +22 -22
  152. package/common/OverviewDoc.js.map +1 -1
  153. package/common/SplunkVisualization.js +4 -4
  154. package/common/SplunkVisualization.js.map +1 -1
  155. package/common/SplunkVisualizationApi.js +2 -2
  156. package/common/SplunkVisualizationApi.js.map +1 -1
  157. package/common/ThemesDoc.js +19 -19
  158. package/common/ThemesDoc.js.map +1 -1
  159. package/common/chartingUtils.js +4 -4
  160. package/common/chartingUtils.js.map +1 -1
  161. package/common/docUtils.js +4 -4
  162. package/common/docUtils.js.map +1 -1
  163. package/common/gaugeUtils.js +13 -13
  164. package/common/gaugeUtils.js.map +1 -1
  165. package/common/shapeUtils.js +8 -8
  166. package/common/shapeUtils.js.map +1 -1
  167. package/common/utils/configUtils.js +42 -18
  168. package/common/utils/configUtils.js.map +1 -1
  169. package/common/utils/hocUtils.js +6 -86
  170. package/common/utils/hocUtils.js.map +1 -1
  171. package/common/utils/{JSONSchemaUtils.js → mapUtils.js} +89 -29
  172. package/common/utils/mapUtils.js.map +1 -0
  173. package/common/utils/singleValueUtils.js +14 -12
  174. package/common/utils/singleValueUtils.js.map +1 -1
  175. package/common/utils/testHelper.js +8 -8
  176. package/common/utils/testHelper.js.map +1 -1
  177. package/common/withDashboardViz.js +120 -207
  178. package/common/withDashboardViz.js.map +1 -1
  179. package/package.json +12 -12
  180. package/.loki/reference/chrome_docker_PureVisualizations_SvgChoroplethDynamic_SVG_Of_Size_Greater_Than_2_MB_Render.png +0 -0
  181. package/common/utils/JSONSchemaUtils.js.map +0 -1
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 63);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 65);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -100,225 +100,20 @@ module.exports = require("@splunk/ui-utils/i18n");
100
100
  /***/ }),
101
101
 
102
102
  /***/ 1:
103
- /***/ (function(module, exports, __webpack_require__) {
104
-
105
- "use strict";
106
-
107
-
108
- var _toConsumableArray = __webpack_require__(2);
109
-
110
- var _defineProperty = __webpack_require__(6);
111
-
112
- var __rest = this && this.__rest || function (s, e) {
113
- var t = {};
114
-
115
- for (var p in s) {
116
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
117
- }
118
-
119
- if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
120
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
121
- }
122
- return t;
123
- };
124
-
125
- Object.defineProperty(exports, "__esModule", {
126
- value: true
127
- });
128
- exports.insertLayout = exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
129
-
130
- var lodash_1 = __webpack_require__(5);
131
-
132
- var schemaUtils_1 = __webpack_require__(4);
133
-
134
- var VizBehavior_1 = __webpack_require__(3);
135
-
136
- var dynamicOptionsDSLType = {
137
- type: 'string',
138
- pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
139
- };
140
- /**
141
- * Helper function to extend an options schema with dynamic options DSL
142
- * @param optionsSchema a visualization's options schema
143
- * @returns an updated options schema that additionally allows strings starting with > for each option
144
- */
145
-
146
- function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
147
- var enhancedOptionsSchema = {};
148
- Object.keys(optionsSchema).forEach(function (key) {
149
- var _a = optionsSchema[key],
150
- title = _a.title,
151
- description = _a.description,
152
- readOnly = _a.readOnly,
153
- writeOnly = _a.writeOnly,
154
- examples = _a.examples,
155
- defaultValue = _a.default,
156
- type = _a.type,
157
- properties = _a.properties,
158
- patternProperties = _a.patternProperties,
159
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
160
-
161
- var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
162
- title: title
163
- }), description !== undefined && {
164
- description: description
165
- }), readOnly !== undefined && {
166
- readOnly: readOnly
167
- }), writeOnly !== undefined && {
168
- writeOnly: writeOnly
169
- }), examples !== undefined && {
170
- examples: examples
171
- }), defaultValue !== undefined && {
172
- default: defaultValue
173
- });
174
-
175
- if (type === 'object') {
176
- enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
177
- type: type
178
- }), properties && {
179
- properties: enhanceOptionsSchemaWithDynamicOptions(properties)
180
- });
181
-
182
- if (patternProperties) {
183
- var enhancedPatternProperties = {};
184
- Object.keys(patternProperties).forEach(function (opt) {
185
- enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
186
- });
187
- enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
188
- }
189
- } else {
190
- enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
191
- anyOf: [Object.assign(Object.assign({}, type !== undefined && {
192
- type: type
193
- }), remainingSchemaEntry), dynamicOptionsDSLType]
194
- });
195
- }
196
- });
197
- return enhancedOptionsSchema;
198
- }
199
-
200
- exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
201
- /**
202
- * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
203
- * @param vizConfig a Visualization Config
204
- * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
205
- */
206
-
207
- function enhanceConfig(vizConfig) {
208
- var enhancedConfig = vizConfig;
209
-
210
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
211
- enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
212
- }
213
-
214
- return enhancedConfig;
215
- }
216
-
217
- exports.enhanceConfig = enhanceConfig;
218
-
219
- function isDynamicOption(option) {
220
- return option && typeof option === 'string' && option.trim().startsWith('>') || false;
221
- }
222
-
223
- exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
224
- // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
225
-
226
- /**
227
- * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
228
- * 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
229
- * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
230
- * 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
231
- *
232
- * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
233
- */
234
-
235
- function hasCompatibleContexts(vizContext, presetContext) {
236
- var presetContextKeys = Object.keys(presetContext);
237
- return presetContextKeys.every(function (contextKey) {
238
- return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
239
- });
240
- }
241
- /**
242
- * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
243
- */
244
-
245
-
246
- function hasCompatibleOptions(vizOptions, presetOptions) {
247
- var presetOptionKeys = Object.keys(presetOptions);
248
- return presetOptionKeys.every(function (optionKey) {
249
- return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
250
- });
251
- }
252
- /**
253
- * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
254
- * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
255
- *
256
- * @param {Object} vizContext - the current vizContext definition
257
- * @param {Object} vizOptions - the current vizOptions definition
258
- * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
259
- */
260
-
261
-
262
- function getInitialPreset(vizContext, vizOptions, presets) {
263
- return presets.find(function (preset) {
264
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
265
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
266
- var presetContextKeys = Object.keys(presetContext);
267
- var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
268
- // if not, then the preset is invalid in config.ts
269
-
270
- if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
271
- return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
272
- });
273
- }
274
-
275
- exports.getInitialPreset = getInitialPreset;
276
- /**
277
- * generates number precision values for a Select editor
278
- *
279
- * @param {Number} numPrecisionValues - number of integer precision values to generate
280
- * @returns {{ label: string; value; string }[]} array of { label, value } tuples
281
- */
282
-
283
- function generatePrecisionValues(numPrecisionValues) {
284
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
285
- return {
286
- label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
287
- value: i
288
- };
289
- });
290
- }
291
-
292
- exports.generatePrecisionValues = generatePrecisionValues;
293
- /**
294
- * insert layout in layout array, return a new layout array instead of updating the original
295
- *
296
- * @param {EditorLayoutConfig[][]} layout - editor layout
297
- * @param {Number} index - the index to insert layout item(s)
298
- * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
299
- * @returns {EditorLayoutConfig[][]} new editor layout with insertion
300
- */
301
-
302
- var insertLayout = function insertLayout(layout, index) {
303
- for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
304
- layoutItems[_key - 2] = arguments[_key];
305
- }
306
-
307
- return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
308
- };
103
+ /***/ (function(module, exports) {
309
104
 
310
- exports.insertLayout = insertLayout;
105
+ module.exports = require("@babel/runtime/helpers/toConsumableArray");
311
106
 
312
107
  /***/ }),
313
108
 
314
- /***/ 11:
109
+ /***/ 12:
315
110
  /***/ (function(module, exports) {
316
111
 
317
112
  module.exports = require("@splunk/visualization-icons");
318
113
 
319
114
  /***/ }),
320
115
 
321
- /***/ 14:
116
+ /***/ 15:
322
117
  /***/ (function(module, exports) {
323
118
 
324
119
  module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
@@ -326,20 +121,6 @@ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPal
326
121
  /***/ }),
327
122
 
328
123
  /***/ 2:
329
- /***/ (function(module, exports) {
330
-
331
- module.exports = require("@babel/runtime/helpers/toConsumableArray");
332
-
333
- /***/ }),
334
-
335
- /***/ 23:
336
- /***/ (function(module, exports) {
337
-
338
- module.exports = require("@splunk/themes");
339
-
340
- /***/ }),
341
-
342
- /***/ 3:
343
124
  /***/ (function(module, exports, __webpack_require__) {
344
125
 
345
126
  "use strict";
@@ -377,7 +158,21 @@ var VizBehavior;
377
158
 
378
159
  /***/ }),
379
160
 
380
- /***/ 30:
161
+ /***/ 24:
162
+ /***/ (function(module, exports) {
163
+
164
+ module.exports = require("@splunk/themes");
165
+
166
+ /***/ }),
167
+
168
+ /***/ 3:
169
+ /***/ (function(module, exports) {
170
+
171
+ module.exports = require("@splunk/visualizations-shared/schemaUtils");
172
+
173
+ /***/ }),
174
+
175
+ /***/ 31:
381
176
  /***/ (function(module, exports, __webpack_require__) {
382
177
 
383
178
  "use strict";
@@ -390,7 +185,7 @@ exports.getDynamicFillColorEditor = void 0;
390
185
 
391
186
  var i18n_1 = __webpack_require__(0);
392
187
 
393
- var configUtils_1 = __webpack_require__(1);
188
+ var configUtils_1 = __webpack_require__(5);
394
189
 
395
190
  var getDynamicFillColorEditor = function getDynamicFillColorEditor(_ref) {
396
191
  var defaultContext = _ref.defaultContext,
@@ -433,7 +228,7 @@ exports.getDynamicFillColorEditor = getDynamicFillColorEditor;
433
228
 
434
229
  /***/ }),
435
230
 
436
- /***/ 31:
231
+ /***/ 32:
437
232
  /***/ (function(module, exports, __webpack_require__) {
438
233
 
439
234
  "use strict";
@@ -446,7 +241,7 @@ exports.getDynamicStrokeColorEditor = void 0;
446
241
 
447
242
  var i18n_1 = __webpack_require__(0);
448
243
 
449
- var configUtils_1 = __webpack_require__(1);
244
+ var configUtils_1 = __webpack_require__(5);
450
245
 
451
246
  var getDynamicStrokeColorEditor = function getDynamicStrokeColorEditor(_ref) {
452
247
  var defaultContext = _ref.defaultContext,
@@ -489,7 +284,7 @@ exports.getDynamicStrokeColorEditor = getDynamicStrokeColorEditor;
489
284
 
490
285
  /***/ }),
491
286
 
492
- /***/ 32:
287
+ /***/ 33:
493
288
  /***/ (function(module, exports, __webpack_require__) {
494
289
 
495
290
  "use strict";
@@ -501,7 +296,7 @@ Object.defineProperty(exports, "__esModule", {
501
296
 
502
297
  var i18n_1 = __webpack_require__(0);
503
298
 
504
- var configUtils_1 = __webpack_require__(1);
299
+ var configUtils_1 = __webpack_require__(5);
505
300
 
506
301
  var StaticFillColorEditor = {
507
302
  label: i18n_1._('Static Fill'),
@@ -516,7 +311,7 @@ exports.default = StaticFillColorEditor;
516
311
 
517
312
  /***/ }),
518
313
 
519
- /***/ 33:
314
+ /***/ 34:
520
315
  /***/ (function(module, exports, __webpack_require__) {
521
316
 
522
317
  "use strict";
@@ -528,7 +323,7 @@ Object.defineProperty(exports, "__esModule", {
528
323
 
529
324
  var i18n_1 = __webpack_require__(0);
530
325
 
531
- var configUtils_1 = __webpack_require__(1);
326
+ var configUtils_1 = __webpack_require__(5);
532
327
 
533
328
  var StaticStrokeColorEditor = {
534
329
  label: i18n_1._('Static Stroke'),
@@ -544,27 +339,257 @@ exports.default = StaticStrokeColorEditor;
544
339
  /***/ }),
545
340
 
546
341
  /***/ 4:
547
- /***/ (function(module, exports) {
342
+ /***/ (function(module, exports, __webpack_require__) {
548
343
 
549
- module.exports = require("@splunk/visualizations-shared/schemaUtils");
344
+ "use strict";
345
+
346
+
347
+ var _toConsumableArray = __webpack_require__(1);
348
+
349
+ var _defineProperty = __webpack_require__(7);
350
+
351
+ var __rest = this && this.__rest || function (s, e) {
352
+ var t = {};
353
+
354
+ for (var p in s) {
355
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
356
+ }
357
+
358
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
359
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
360
+ }
361
+ return t;
362
+ };
363
+
364
+ Object.defineProperty(exports, "__esModule", {
365
+ value: true
366
+ });
367
+ exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
368
+
369
+ var lodash_1 = __webpack_require__(6);
370
+
371
+ var schemaUtils_1 = __webpack_require__(3);
372
+
373
+ var VizBehavior_1 = __webpack_require__(2);
374
+
375
+ var dynamicOptionsDSLType = {
376
+ type: 'string',
377
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
378
+ };
379
+ /**
380
+ * Helper function to extend an options schema with dynamic options DSL
381
+ * @param optionsSchema a visualization's options schema
382
+ * @returns an updated options schema that additionally allows strings starting with > for each option
383
+ */
384
+
385
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
386
+ var enhancedOptionsSchema = {};
387
+ Object.keys(optionsSchema).forEach(function (key) {
388
+ var _a = optionsSchema[key],
389
+ title = _a.title,
390
+ description = _a.description,
391
+ readOnly = _a.readOnly,
392
+ writeOnly = _a.writeOnly,
393
+ examples = _a.examples,
394
+ defaultValue = _a.default,
395
+ type = _a.type,
396
+ properties = _a.properties,
397
+ patternProperties = _a.patternProperties,
398
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
399
+
400
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
401
+ title: title
402
+ }), description !== undefined && {
403
+ description: description
404
+ }), readOnly !== undefined && {
405
+ readOnly: readOnly
406
+ }), writeOnly !== undefined && {
407
+ writeOnly: writeOnly
408
+ }), examples !== undefined && {
409
+ examples: examples
410
+ }), defaultValue !== undefined && {
411
+ default: defaultValue
412
+ });
413
+
414
+ if (type === 'object') {
415
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
416
+ type: type
417
+ }), properties && {
418
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
419
+ });
420
+
421
+ if (patternProperties) {
422
+ var enhancedPatternProperties = {};
423
+ Object.keys(patternProperties).forEach(function (opt) {
424
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, opt, patternProperties[opt])));
425
+ });
426
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
427
+ }
428
+ } else {
429
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
430
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
431
+ type: type
432
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
433
+ });
434
+ }
435
+ });
436
+ return enhancedOptionsSchema;
437
+ }
438
+
439
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
440
+ /**
441
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
442
+ * this function also collapse all editor panels
443
+ * @param vizConfig a Visualization Config
444
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
445
+ * and containing `open: false` for all editor panels in editorConfig
446
+ */
447
+
448
+ function enhanceConfig(vizConfig) {
449
+ var enhancedConfig = vizConfig;
450
+
451
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
452
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
453
+ }
454
+
455
+ enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
456
+ return Object.assign(Object.assign({}, config), {
457
+ open: false
458
+ });
459
+ });
460
+ return enhancedConfig;
461
+ }
462
+
463
+ exports.enhanceConfig = enhanceConfig;
464
+ /**
465
+ * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
466
+ * Created for editor unit tests
467
+ * @param vizConfig a Visualization Config
468
+ * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
469
+ */
470
+
471
+ function uncollapseEditorConfig(vizConfig) {
472
+ var editorPanelUncollapsedConfig = vizConfig;
473
+ editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
474
+ return Object.assign(Object.assign({}, config), {
475
+ open: true
476
+ });
477
+ });
478
+ return editorPanelUncollapsedConfig;
479
+ }
480
+
481
+ exports.uncollapseEditorConfig = uncollapseEditorConfig;
482
+
483
+ function isDynamicOption(option) {
484
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
485
+ }
486
+
487
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
488
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
489
+
490
+ /**
491
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
492
+ * 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
493
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
494
+ * 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
495
+ *
496
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
497
+ */
498
+
499
+ function hasCompatibleContexts(vizContext, presetContext) {
500
+ var presetContextKeys = Object.keys(presetContext);
501
+ return presetContextKeys.every(function (contextKey) {
502
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
503
+ });
504
+ }
505
+ /**
506
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
507
+ */
508
+
509
+
510
+ function hasCompatibleOptions(vizOptions, presetOptions) {
511
+ var presetOptionKeys = Object.keys(presetOptions);
512
+ return presetOptionKeys.every(function (optionKey) {
513
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
514
+ });
515
+ }
516
+ /**
517
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
518
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
519
+ *
520
+ * @param {Object} vizContext - the current vizContext definition
521
+ * @param {Object} vizOptions - the current vizOptions definition
522
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
523
+ */
524
+
525
+
526
+ function getInitialPreset(vizContext, vizOptions, presets) {
527
+ return presets.find(function (preset) {
528
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
529
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
530
+ var presetContextKeys = Object.keys(presetContext);
531
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
532
+ // if not, then the preset is invalid in config.ts
533
+
534
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
535
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
536
+ });
537
+ }
538
+
539
+ exports.getInitialPreset = getInitialPreset;
540
+ /**
541
+ * generates number precision values for a Select editor
542
+ *
543
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
544
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
545
+ */
546
+
547
+ function generatePrecisionValues(numPrecisionValues) {
548
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
549
+ return {
550
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
551
+ value: i
552
+ };
553
+ });
554
+ }
555
+
556
+ exports.generatePrecisionValues = generatePrecisionValues;
557
+ /**
558
+ * insert layout in layout array, return a new layout array instead of updating the original
559
+ *
560
+ * @param {EditorLayoutConfig[][]} layout - editor layout
561
+ * @param {Number} index - the index to insert layout item(s)
562
+ * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
563
+ * @returns {EditorLayoutConfig[][]} new editor layout with insertion
564
+ */
565
+
566
+ var insertLayout = function insertLayout(layout, index) {
567
+ for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
568
+ layoutItems[_key - 2] = arguments[_key];
569
+ }
570
+
571
+ return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
572
+ };
573
+
574
+ exports.insertLayout = insertLayout;
550
575
 
551
576
  /***/ }),
552
577
 
553
578
  /***/ 5:
554
579
  /***/ (function(module, exports) {
555
580
 
556
- module.exports = require("lodash");
581
+ module.exports = require("@splunk/visualizations-shared/configUtils");
557
582
 
558
583
  /***/ }),
559
584
 
560
585
  /***/ 6:
561
586
  /***/ (function(module, exports) {
562
587
 
563
- module.exports = require("@babel/runtime/helpers/defineProperty");
588
+ module.exports = require("lodash");
564
589
 
565
590
  /***/ }),
566
591
 
567
- /***/ 63:
592
+ /***/ 65:
568
593
  /***/ (function(module, exports, __webpack_require__) {
569
594
 
570
595
  "use strict";
@@ -575,29 +600,29 @@ Object.defineProperty(exports, "__esModule", {
575
600
  });
576
601
  exports.optionsSchema = void 0;
577
602
 
578
- var visualization_icons_1 = __webpack_require__(11);
603
+ var visualization_icons_1 = __webpack_require__(12);
579
604
 
580
- var schemaUtils_1 = __webpack_require__(4);
605
+ var schemaUtils_1 = __webpack_require__(3);
581
606
 
582
607
  var i18n_1 = __webpack_require__(0);
583
608
 
584
- var PresetPalettes_1 = __webpack_require__(14);
609
+ var PresetPalettes_1 = __webpack_require__(15);
585
610
 
586
- var themes_1 = __webpack_require__(23);
611
+ var themes_1 = __webpack_require__(24);
587
612
 
588
- var VizBehavior_1 = __webpack_require__(3);
613
+ var VizBehavior_1 = __webpack_require__(2);
589
614
 
590
- var VizCategory_1 = __webpack_require__(7);
615
+ var VizCategory_1 = __webpack_require__(8);
591
616
 
592
- var configUtils_1 = __webpack_require__(1);
617
+ var configUtils_1 = __webpack_require__(4);
593
618
 
594
- var DynamicFillColorEditor_1 = __webpack_require__(30);
619
+ var DynamicFillColorEditor_1 = __webpack_require__(31);
595
620
 
596
- var DynamicStrokeColorEditor_1 = __webpack_require__(31);
621
+ var DynamicStrokeColorEditor_1 = __webpack_require__(32);
597
622
 
598
- var StaticFillColorEditor_1 = __webpack_require__(32);
623
+ var StaticFillColorEditor_1 = __webpack_require__(33);
599
624
 
600
- var StaticStrokeColorEditor_1 = __webpack_require__(33);
625
+ var StaticStrokeColorEditor_1 = __webpack_require__(34);
601
626
 
602
627
  var dataContract = {
603
628
  requiredDataSources: [],
@@ -914,6 +939,13 @@ exports.default = configUtils_1.enhanceConfig(config);
914
939
  /***/ }),
915
940
 
916
941
  /***/ 7:
942
+ /***/ (function(module, exports) {
943
+
944
+ module.exports = require("@babel/runtime/helpers/defineProperty");
945
+
946
+ /***/ }),
947
+
948
+ /***/ 8:
917
949
  /***/ (function(module, exports, __webpack_require__) {
918
950
 
919
951
  "use strict";