@splunk/visualizations 23.2.0 → 23.5.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 (132) hide show
  1. package/Area.config.js +36 -30
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +243 -203
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +29 -23
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +233 -193
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +36 -23
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +247 -196
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +15 -12
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +201 -148
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +29 -23
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +235 -194
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +23 -20
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +176 -123
  24. package/Ellipse.js.map +1 -1
  25. package/FillerGauge.config.js +803 -0
  26. package/FillerGauge.config.js.map +1 -0
  27. package/FillerGauge.js +3634 -0
  28. package/FillerGauge.js.map +1 -0
  29. package/Image.config.js +13 -6
  30. package/Image.config.js.map +1 -1
  31. package/Image.js +260 -200
  32. package/Image.js.map +1 -1
  33. package/LICENSE.md +14 -0
  34. package/Line.config.js +40 -31
  35. package/Line.config.js.map +1 -1
  36. package/Line.js +248 -202
  37. package/Line.js.map +1 -1
  38. package/LinkGraph.config.js +107 -123
  39. package/LinkGraph.config.js.map +1 -1
  40. package/LinkGraph.js +241 -193
  41. package/LinkGraph.js.map +1 -1
  42. package/Markdown.config.js +95 -3
  43. package/Markdown.config.js.map +1 -1
  44. package/Markdown.js +272 -118
  45. package/Markdown.js.map +1 -1
  46. package/MarkerGauge.config.js +750 -0
  47. package/MarkerGauge.config.js.map +1 -0
  48. package/MarkerGauge.js +3758 -0
  49. package/MarkerGauge.js.map +1 -0
  50. package/ParallelCoordinates.config.js +52 -46
  51. package/ParallelCoordinates.config.js.map +1 -1
  52. package/ParallelCoordinates.js +257 -164
  53. package/ParallelCoordinates.js.map +1 -1
  54. package/Pie.config.js +61 -46
  55. package/Pie.config.js.map +1 -1
  56. package/Pie.js +254 -186
  57. package/Pie.js.map +1 -1
  58. package/Punchcard.config.js +279 -39
  59. package/Punchcard.config.js.map +1 -1
  60. package/Punchcard.js +825 -193
  61. package/Punchcard.js.map +1 -1
  62. package/README.external.md +45 -0
  63. package/README.md +18 -3
  64. package/Rectangle.config.js +89 -107
  65. package/Rectangle.config.js.map +1 -1
  66. package/Rectangle.js +204 -145
  67. package/Rectangle.js.map +1 -1
  68. package/Sankey.config.js +29 -22
  69. package/Sankey.config.js.map +1 -1
  70. package/Sankey.js +250 -186
  71. package/Sankey.js.map +1 -1
  72. package/Scatter.config.js +39 -28
  73. package/Scatter.config.js.map +1 -1
  74. package/Scatter.js +2375 -2434
  75. package/Scatter.js.map +1 -1
  76. package/SingleValue.config.js +37 -29
  77. package/SingleValue.config.js.map +1 -1
  78. package/SingleValue.js +3108 -3174
  79. package/SingleValue.js.map +1 -1
  80. package/SingleValueBasic.js +37 -23
  81. package/SingleValueBasic.js.map +1 -1
  82. package/SingleValueIcon.config.js +36 -28
  83. package/SingleValueIcon.config.js.map +1 -1
  84. package/SingleValueIcon.js +279 -210
  85. package/SingleValueIcon.js.map +1 -1
  86. package/SingleValueRadial.config.js +15 -13
  87. package/SingleValueRadial.config.js.map +1 -1
  88. package/SingleValueRadial.js +299 -253
  89. package/SingleValueRadial.js.map +1 -1
  90. package/Table.config.js +26 -10
  91. package/Table.config.js.map +1 -1
  92. package/Table.js +382 -265
  93. package/Table.js.map +1 -1
  94. package/common/Charting.js +33 -30
  95. package/common/Charting.js.map +1 -1
  96. package/common/ChartingApi.js +4 -4
  97. package/common/ChartingApi.js.map +1 -1
  98. package/common/EventsDoc.js +36 -34
  99. package/common/EventsDoc.js.map +1 -1
  100. package/common/GaugeMajorTicks.js +386 -0
  101. package/common/GaugeMajorTicks.js.map +1 -0
  102. package/common/GaugeValueMarker.js +333 -0
  103. package/common/GaugeValueMarker.js.map +1 -0
  104. package/common/OptionsDoc.js +47 -33
  105. package/common/OptionsDoc.js.map +1 -1
  106. package/common/OverviewDoc.js +376 -0
  107. package/common/OverviewDoc.js.map +1 -0
  108. package/common/SplunkVisualization.js +6 -6
  109. package/common/SplunkVisualization.js.map +1 -1
  110. package/common/SplunkVisualizationApi.js +10 -10
  111. package/common/SplunkVisualizationApi.js.map +1 -1
  112. package/common/ThemesDoc.js +55 -72
  113. package/common/ThemesDoc.js.map +1 -1
  114. package/common/chartingUtils.js +15 -13
  115. package/common/chartingUtils.js.map +1 -1
  116. package/common/docUtils.js +4 -4
  117. package/common/docUtils.js.map +1 -1
  118. package/common/gaugeUtils.js +893 -0
  119. package/common/gaugeUtils.js.map +1 -0
  120. package/common/shapeUtils.js +8 -8
  121. package/common/shapeUtils.js.map +1 -1
  122. package/common/utils/JSONSchemaUtils.js.map +1 -1
  123. package/common/utils/configUtils.js.map +1 -1
  124. package/common/utils/hocUtils.js +57 -3
  125. package/common/utils/hocUtils.js.map +1 -1
  126. package/common/utils/singleValueUtils.js +24 -10
  127. package/common/utils/singleValueUtils.js.map +1 -1
  128. package/common/withDashboardViz.js +158 -95
  129. package/common/withDashboardViz.js.map +1 -1
  130. package/package.json +18 -14
  131. package/common/utils/eventUtils.js +0 -115
  132. package/common/utils/eventUtils.js.map +0 -1
@@ -0,0 +1,803 @@
1
+ /*!
2
+ * Copyright © 2018 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 = 43);
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, __webpack_require__) {
102
+
103
+ "use strict";
104
+
105
+
106
+ var _defineProperty = __webpack_require__(6);
107
+
108
+ var __rest = this && this.__rest || function (s, e) {
109
+ var t = {};
110
+
111
+ for (var p in s) {
112
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
113
+ }
114
+
115
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
116
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
117
+ }
118
+ return t;
119
+ };
120
+
121
+ Object.defineProperty(exports, "__esModule", {
122
+ value: true
123
+ });
124
+ exports.generatePrecisionValues = exports.getInitialPreset = exports.isDynamicOption = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
125
+
126
+ var lodash_1 = __webpack_require__(4);
127
+
128
+ var schemaUtils_1 = __webpack_require__(3);
129
+
130
+ var VizBehavior_1 = __webpack_require__(2);
131
+
132
+ var dynamicOptionsDSLType = {
133
+ type: 'string',
134
+ pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
135
+ };
136
+ /**
137
+ * Helper function to extend an options schema with dynamic options DSL
138
+ * @param optionsSchema a visualization's options schema
139
+ * @returns an updated options schema that additionally allows strings starting with > for each option
140
+ */
141
+
142
+ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
143
+ var enhancedOptionsSchema = {};
144
+ Object.keys(optionsSchema).forEach(function (key) {
145
+ var _a = optionsSchema[key],
146
+ title = _a.title,
147
+ description = _a.description,
148
+ readOnly = _a.readOnly,
149
+ writeOnly = _a.writeOnly,
150
+ examples = _a.examples,
151
+ defaultValue = _a.default,
152
+ type = _a.type,
153
+ properties = _a.properties,
154
+ patternProperties = _a.patternProperties,
155
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
156
+
157
+ var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
158
+ title: title
159
+ }), description !== undefined && {
160
+ description: description
161
+ }), readOnly !== undefined && {
162
+ readOnly: readOnly
163
+ }), writeOnly !== undefined && {
164
+ writeOnly: writeOnly
165
+ }), examples !== undefined && {
166
+ examples: examples
167
+ }), defaultValue !== undefined && {
168
+ default: defaultValue
169
+ });
170
+
171
+ if (type === 'object') {
172
+ enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
173
+ type: type
174
+ }), properties && {
175
+ properties: enhanceOptionsSchemaWithDynamicOptions(properties)
176
+ });
177
+
178
+ if (patternProperties) {
179
+ var enhancedPatternProperties = {};
180
+ Object.keys(patternProperties).forEach(function (key) {
181
+ enhancedPatternProperties = Object.assign(Object.assign({}, enhancedPatternProperties), enhanceOptionsSchemaWithDynamicOptions(_defineProperty({}, key, patternProperties[key])));
182
+ });
183
+ enhancedOptionsSchema[key].patternProperties = enhancedPatternProperties;
184
+ }
185
+ } else {
186
+ enhancedOptionsSchema[key] = Object.assign(Object.assign({}, annotations), {
187
+ anyOf: [Object.assign(Object.assign({}, type !== undefined && {
188
+ type: type
189
+ }), remainingSchemaEntry), dynamicOptionsDSLType]
190
+ });
191
+ }
192
+ });
193
+ return enhancedOptionsSchema;
194
+ }
195
+
196
+ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
197
+ /**
198
+ * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
199
+ * @param vizConfig a Visualization Config
200
+ * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
201
+ */
202
+
203
+ function enhanceConfig(vizConfig) {
204
+ var enhancedConfig = vizConfig;
205
+
206
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
207
+ enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
208
+ }
209
+
210
+ return enhancedConfig;
211
+ }
212
+
213
+ exports.enhanceConfig = enhanceConfig;
214
+
215
+ function isDynamicOption(option) {
216
+ return option && typeof option === 'string' && option.trim().startsWith('>') || false;
217
+ }
218
+
219
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
220
+ // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
221
+
222
+ /**
223
+ * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
224
+ * 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
225
+ * the inverse is true; if a preset has key is NOT undefined, it must also be NOT undefined in the corresponding vizContext
226
+ * 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
227
+ *
228
+ * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
229
+ */
230
+
231
+ function hasCompatibleContexts(vizContext, presetContext) {
232
+ var presetContextKeys = Object.keys(presetContext);
233
+ return presetContextKeys.every(function (contextKey) {
234
+ return presetContext[contextKey] === undefined && vizContext[contextKey] === undefined || presetContext[contextKey] !== undefined && vizContext[contextKey] !== undefined;
235
+ });
236
+ }
237
+ /**
238
+ * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
239
+ */
240
+
241
+
242
+ function hasCompatibleOptions(vizOptions, presetOptions) {
243
+ var presetOptionKeys = Object.keys(presetOptions);
244
+ return presetOptionKeys.every(function (optionKey) {
245
+ return isDynamicOption(presetOptions[optionKey]) === isDynamicOption(vizOptions[optionKey]);
246
+ });
247
+ }
248
+ /**
249
+ * Evaluates whether there is an initialPreset that fits the current state of vizContext + vizOptions
250
+ * This function ignores extraneous vizOptions or vizContext keys, as they could be outside the scope of what the preset is intended to configure
251
+ *
252
+ * @param {Object} vizContext - the current vizContext definition
253
+ * @param {Object} vizOptions - the current vizOptions definition
254
+ * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
255
+ */
256
+
257
+
258
+ function getInitialPreset(vizContext, vizOptions, presets) {
259
+ return presets.find(function (preset) {
260
+ var presetContext = lodash_1.get(preset, ['value', 'context'], {});
261
+ var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
262
+ var presetContextKeys = Object.keys(presetContext);
263
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
264
+ // if not, then the preset is invalid in config.ts
265
+
266
+ if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
267
+ return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
268
+ });
269
+ }
270
+
271
+ exports.getInitialPreset = getInitialPreset;
272
+ /**
273
+ * generates number precision values for a Select editor
274
+ *
275
+ * @param {Number} numPrecisionValues - number of integer precision values to generate
276
+ * @returns {{ label: string; value; string }[]} array of { label, value } tuples
277
+ */
278
+
279
+ function generatePrecisionValues(numPrecisionValues) {
280
+ return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
281
+ return {
282
+ label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
283
+ value: i
284
+ };
285
+ });
286
+ }
287
+
288
+ exports.generatePrecisionValues = generatePrecisionValues;
289
+
290
+ /***/ }),
291
+ /* 2 */
292
+ /***/ (function(module, exports, __webpack_require__) {
293
+
294
+ "use strict";
295
+
296
+
297
+ Object.defineProperty(exports, "__esModule", {
298
+ value: true
299
+ });
300
+ exports.VizBehavior = void 0;
301
+ var VizBehavior;
302
+
303
+ (function (VizBehavior) {
304
+ /**
305
+ * Dynamic Options Behavior.
306
+ * This allows visualization options to be powered by data
307
+ *
308
+ * **Example**
309
+ *
310
+ * sparklineValues: ">primary|seriesByIndex(0)"
311
+ * would configure sparklineValues with an array of data points
312
+ * coming from the first series in the primary datasource
313
+ *
314
+ */
315
+ VizBehavior["DYNAMIC_OPTIONS"] = "dynamic-options";
316
+ VizBehavior["EVENTS"] = "events";
317
+ /**
318
+ * Placeholder behavior: visualization will display a placeholder rather than fail if any of the `requiredProps` is
319
+ * missing.
320
+ * @type {string}
321
+ */
322
+
323
+ VizBehavior["PLACEHOLDER"] = "placeholder";
324
+ VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
325
+ })(VizBehavior = exports.VizBehavior || (exports.VizBehavior = {}));
326
+
327
+ /***/ }),
328
+ /* 3 */
329
+ /***/ (function(module, exports) {
330
+
331
+ module.exports = require("@splunk/visualizations-shared/schemaUtils");
332
+
333
+ /***/ }),
334
+ /* 4 */
335
+ /***/ (function(module, exports) {
336
+
337
+ module.exports = require("lodash");
338
+
339
+ /***/ }),
340
+ /* 5 */
341
+ /***/ (function(module, exports, __webpack_require__) {
342
+
343
+ "use strict";
344
+
345
+
346
+ Object.defineProperty(exports, "__esModule", {
347
+ value: true
348
+ });
349
+ exports.VizCategory = void 0;
350
+ var VizCategory;
351
+
352
+ (function (VizCategory) {
353
+ VizCategory["SINGLE_VALUE"] = "Single Value";
354
+ VizCategory["TRENDS"] = "Trends";
355
+ VizCategory["COMPARISONS"] = "Comparisons";
356
+ VizCategory["TABLE"] = "Table";
357
+ VizCategory["GAUGE"] = "Gauge";
358
+ VizCategory["DISTRIBUTIONS"] = "Distributions";
359
+ VizCategory["CHOROPLETH"] = "Choropleth Maps";
360
+ VizCategory["SHAPES"] = "Shapes";
361
+ VizCategory["MISC"] = "misc";
362
+ VizCategory["FLOW"] = "Flow";
363
+ VizCategory["CORRELATION"] = "Correlation";
364
+ VizCategory["SPATIAL"] = "Spatial";
365
+ })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
366
+
367
+ /***/ }),
368
+ /* 6 */
369
+ /***/ (function(module, exports) {
370
+
371
+ module.exports = require("@babel/runtime/helpers/defineProperty");
372
+
373
+ /***/ }),
374
+ /* 7 */
375
+ /***/ (function(module, exports) {
376
+
377
+ module.exports = require("@splunk/themes/pick");
378
+
379
+ /***/ }),
380
+ /* 8 */
381
+ /***/ (function(module, exports) {
382
+
383
+ module.exports = require("@splunk/themes/variables");
384
+
385
+ /***/ }),
386
+ /* 9 */,
387
+ /* 10 */
388
+ /***/ (function(module, exports, __webpack_require__) {
389
+
390
+ "use strict";
391
+
392
+
393
+ Object.defineProperty(exports, "__esModule", {
394
+ value: true
395
+ });
396
+
397
+ var i18n_1 = __webpack_require__(0);
398
+
399
+ var background = function background(_ref) {
400
+ var label = _ref.label,
401
+ themes = _ref.themes,
402
+ labelPosition = _ref.labelPosition;
403
+ return [{
404
+ label: i18n_1._(label || 'Background'),
405
+ option: 'backgroundColor',
406
+ editor: 'editor.color',
407
+ editorProps: {
408
+ labelPosition: labelPosition || 'top',
409
+ themes: themes
410
+ }
411
+ }];
412
+ };
413
+
414
+ exports.default = background;
415
+
416
+ /***/ }),
417
+ /* 11 */,
418
+ /* 12 */
419
+ /***/ (function(module, exports) {
420
+
421
+ module.exports = require("@splunk/visualization-color-palettes/editors/PresetPalettes");
422
+
423
+ /***/ }),
424
+ /* 13 */,
425
+ /* 14 */,
426
+ /* 15 */,
427
+ /* 16 */,
428
+ /* 17 */,
429
+ /* 18 */,
430
+ /* 19 */,
431
+ /* 20 */,
432
+ /* 21 */,
433
+ /* 22 */,
434
+ /* 23 */,
435
+ /* 24 */,
436
+ /* 25 */,
437
+ /* 26 */,
438
+ /* 27 */,
439
+ /* 28 */,
440
+ /* 29 */
441
+ /***/ (function(module, exports, __webpack_require__) {
442
+
443
+ "use strict";
444
+
445
+
446
+ Object.defineProperty(exports, "__esModule", {
447
+ value: true
448
+ });
449
+
450
+ var i18n_1 = __webpack_require__(0);
451
+
452
+ var gauge = {
453
+ label: i18n_1._('Gauge Settings'),
454
+ layout: [[{
455
+ label: i18n_1._('Value Display'),
456
+ option: 'valueDisplay',
457
+ editor: 'editor.radioBar',
458
+ editorProps: {
459
+ values: [{
460
+ label: i18n_1._('Number'),
461
+ value: 'number'
462
+ }, {
463
+ label: i18n_1._('Percentage'),
464
+ value: 'percentage'
465
+ }, {
466
+ label: i18n_1._('Off'),
467
+ value: 'off'
468
+ }]
469
+ }
470
+ }], [{
471
+ label: i18n_1._('Label Display'),
472
+ option: 'labelDisplay',
473
+ editor: 'editor.radioBar',
474
+ editorProps: {
475
+ values: [{
476
+ label: i18n_1._('Numbers'),
477
+ value: 'number'
478
+ }, {
479
+ label: i18n_1._('Percentages'),
480
+ value: 'percentage'
481
+ }, {
482
+ label: i18n_1._('Off'),
483
+ value: 'off'
484
+ }]
485
+ }
486
+ }], [{
487
+ label: i18n_1._('Orientation'),
488
+ option: 'orientation',
489
+ editor: 'editor.radioBar',
490
+ editorProps: {
491
+ values: [{
492
+ label: i18n_1._('Vertical'),
493
+ value: 'vertical'
494
+ }, {
495
+ label: i18n_1._('Horizontal'),
496
+ value: 'horizontal'
497
+ }]
498
+ }
499
+ }]]
500
+ };
501
+ exports.default = gauge;
502
+
503
+ /***/ }),
504
+ /* 30 */,
505
+ /* 31 */,
506
+ /* 32 */,
507
+ /* 33 */,
508
+ /* 34 */,
509
+ /* 35 */,
510
+ /* 36 */,
511
+ /* 37 */,
512
+ /* 38 */,
513
+ /* 39 */,
514
+ /* 40 */,
515
+ /* 41 */,
516
+ /* 42 */,
517
+ /* 43 */
518
+ /***/ (function(module, exports, __webpack_require__) {
519
+
520
+ "use strict";
521
+
522
+
523
+ Object.defineProperty(exports, "__esModule", {
524
+ value: true
525
+ });
526
+
527
+ var i18n_1 = __webpack_require__(0);
528
+
529
+ var schemaUtils_1 = __webpack_require__(3);
530
+
531
+ var pick_1 = __webpack_require__(7);
532
+
533
+ var variables_1 = __webpack_require__(8);
534
+
535
+ var PresetPalettes_1 = __webpack_require__(12);
536
+
537
+ var GaugeFiller_1 = __webpack_require__(44);
538
+
539
+ var VizBehavior_1 = __webpack_require__(2);
540
+
541
+ var VizCategory_1 = __webpack_require__(5);
542
+
543
+ var configUtils_1 = __webpack_require__(1);
544
+
545
+ var Gauge_1 = __webpack_require__(29);
546
+
547
+ var BackgroundColor_1 = __webpack_require__(10);
548
+
549
+ var DynamicGaugeColorEditor_1 = __webpack_require__(45);
550
+
551
+ var dataContract = {
552
+ requiredDataSources: [{
553
+ name: 'primary',
554
+ description: 'DataSource that powers the visualization'
555
+ }],
556
+ optionalDataSources: [],
557
+ initialRequestParams: {
558
+ primary: {
559
+ offset: 0,
560
+ count: 10000
561
+ }
562
+ }
563
+ };
564
+ var size = {
565
+ initialWidth: 300,
566
+ initialHeight: 300
567
+ };
568
+ var defaultContext = {
569
+ gaugeColorConfig: [{
570
+ to: 9,
571
+ value: '#118832'
572
+ }, {
573
+ from: 10,
574
+ to: 29,
575
+ value: '#669922'
576
+ }, {
577
+ from: 30,
578
+ to: 49,
579
+ value: '#CBA700'
580
+ }, {
581
+ from: 50,
582
+ to: 69,
583
+ value: '#D94E17'
584
+ }, {
585
+ from: 70,
586
+ value: '#D41F1F'
587
+ }]
588
+ };
589
+ var optionsSchema = {
590
+ backgroundColor: {
591
+ default: '> themes.defaultBackgroundColor',
592
+ description: 'Specify the color used for the background. The default for enterprise light is "#ffffff". The default for enterprise dark is "#000000". The default for prisma dark is "#0b0c0e".',
593
+ pattern: schemaUtils_1.COLOR_OR_TOKEN_PATTERN_WITH_RGBA,
594
+ type: 'string'
595
+ },
596
+ gaugeColor: {
597
+ default: '> value | rangeValue(gaugeColorConfig)',
598
+ description: 'Specify the color for the gauge color of the filler gauge. You may use a dataSource to apply the color. The hex value format should be "#FFFFFF".',
599
+ type: 'string'
600
+ },
601
+ labelDisplay: {
602
+ default: 'number',
603
+ description: 'Specify whether to display the labels as numbers, percentages, or off.',
604
+ pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off']),
605
+ type: 'string'
606
+ },
607
+ majorTickInterval: {
608
+ description: 'Specify, in pixels, the spacing between major tick marks.',
609
+ default: 'auto',
610
+ type: ['string', 'number']
611
+ },
612
+ orientation: {
613
+ default: 'vertical',
614
+ description: 'Specify the axis orientation of the gauge.',
615
+ pattern: schemaUtils_1.getPattern(['vertical', 'horizontal']),
616
+ type: 'string'
617
+ },
618
+ value: {
619
+ default: '> primary | seriesByType("number") | lastPoint()',
620
+ description: 'Specify the dataSource applied to the value of the filler gauge.',
621
+ type: 'number'
622
+ },
623
+ valueDisplay: {
624
+ default: 'number',
625
+ description: 'Specify whether to display the value as a number, percentage, or off.',
626
+ pattern: schemaUtils_1.getPattern(['number', 'percentage', 'off']),
627
+ type: 'string'
628
+ }
629
+ };
630
+ var themes = {
631
+ defaultBackgroundColor: function defaultBackgroundColor(props) {
632
+ return pick_1.default({
633
+ enterprise: {
634
+ dark: variables_1.default.black(props),
635
+ light: variables_1.default.backgroundColor(props)
636
+ },
637
+ prisma: variables_1.default.backgroundColorSidebar(props)
638
+ })(props);
639
+ },
640
+ defaultBackgroundBarFillColor: function defaultBackgroundBarFillColor(props) {
641
+ return pick_1.default({
642
+ enterprise: variables_1.default.backgroundColorHover(props),
643
+ prisma: {
644
+ light: variables_1.default.contentColorActive(props),
645
+ dark: variables_1.default.neutral100(props)
646
+ }
647
+ })(props);
648
+ },
649
+ majorTickFillColor: function majorTickFillColor(props) {
650
+ return pick_1.default({
651
+ enterprise: {
652
+ light: variables_1.default.gray30(props),
653
+ dark: variables_1.default.textGray(props) // was #D7DAE0
654
+
655
+ },
656
+ prisma: {
657
+ // TODO: missed colors :(
658
+ light: variables_1.default.neutral100(props),
659
+ dark: variables_1.default.contentColorMuted(props) // was #D7DAE0; contentColor
660
+
661
+ }
662
+ })(props);
663
+ },
664
+ majorTickStrokeColor: function majorTickStrokeColor(props) {
665
+ return pick_1.default({
666
+ enterprise: {
667
+ light: variables_1.default.textGray(props),
668
+ dark: variables_1.default.contentColorMuted(props)
669
+ },
670
+ prisma: variables_1.default.contentColorMuted(props)
671
+ })(props);
672
+ },
673
+ valueMarkerFillColor: function valueMarkerFillColor(props) {
674
+ return pick_1.default({
675
+ enterprise: variables_1.default.textColor(props),
676
+ prisma: {
677
+ dark: variables_1.default.white(props),
678
+ light: variables_1.default.black(props)
679
+ }
680
+ })(props);
681
+ },
682
+ valueMarkerLabelFillColor: function valueMarkerLabelFillColor(props) {
683
+ return pick_1.default({
684
+ enterprise: {
685
+ light: variables_1.default.gray96(props),
686
+ dark: variables_1.default.black(props)
687
+ },
688
+ prisma: variables_1.default.black(props)
689
+ })(props);
690
+ }
691
+ };
692
+ var editorConfig = [{
693
+ label: i18n_1._('Select Data Field'),
694
+ layout: [[{
695
+ label: '',
696
+ editor: 'editor.columnSelector',
697
+ option: 'value',
698
+ context: 'defaultContext',
699
+ editorProps: {
700
+ dataSourceKey: 'primary',
701
+ prepareValue: function prepareValue(definition) {
702
+ var value = definition.options.value;
703
+ return {
704
+ context: {},
705
+ options: {
706
+ value: "".concat(value, " | lastPoint()")
707
+ }
708
+ };
709
+ }
710
+ }
711
+ }]]
712
+ }, Gauge_1.default, {
713
+ label: i18n_1._('Coloring'),
714
+ layout: [[DynamicGaugeColorEditor_1.getDynamicGaugeColorEditor({
715
+ defaultContext: defaultContext,
716
+ defaultPalettesConfig: PresetPalettes_1.defaultPalettesConfig
717
+ })], BackgroundColor_1.default({
718
+ themes: themes,
719
+ labelPosition: 'left'
720
+ })]
721
+ }];
722
+ /**
723
+ * visualization configuration
724
+ */
725
+
726
+ var config = {
727
+ /**
728
+ * unique viz key
729
+ */
730
+ key: 'splunk.fillergauge',
731
+
732
+ /**
733
+ * viz name
734
+ */
735
+ name: 'FillerGauge',
736
+ category: VizCategory_1.VizCategory.GAUGE,
737
+
738
+ /**
739
+ * viz icon
740
+ */
741
+ icon: GaugeFiller_1.default,
742
+ dataContract: dataContract,
743
+ size: size,
744
+ defaultContext: defaultContext,
745
+ optionsSchema: optionsSchema,
746
+ editorConfig: editorConfig,
747
+ supports: [VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS, VizBehavior_1.VizBehavior.PLACEHOLDER],
748
+ themes: themes
749
+ };
750
+ exports.default = configUtils_1.enhanceConfig(config);
751
+
752
+ /***/ }),
753
+ /* 44 */
754
+ /***/ (function(module, exports) {
755
+
756
+ module.exports = require("@splunk/react-icons/GaugeFiller");
757
+
758
+ /***/ }),
759
+ /* 45 */
760
+ /***/ (function(module, exports, __webpack_require__) {
761
+
762
+ "use strict";
763
+
764
+
765
+ Object.defineProperty(exports, "__esModule", {
766
+ value: true
767
+ });
768
+ exports.getDynamicGaugeColorEditor = void 0;
769
+
770
+ var i18n_1 = __webpack_require__(0);
771
+
772
+ var getDynamicGaugeColorEditor = function getDynamicGaugeColorEditor(_ref) {
773
+ var defaultContext = _ref.defaultContext,
774
+ defaultPalettesConfig = _ref.defaultPalettesConfig;
775
+ return {
776
+ label: i18n_1._('Gauge'),
777
+ option: 'gaugeColor',
778
+ context: 'gaugeColorConfig',
779
+ editor: 'editor.dynamicColor',
780
+ editorProps: {
781
+ labelPosition: 'left',
782
+ flyoutTitle: i18n_1._('Dynamic Coloring: Gauge'),
783
+ formatters: [{
784
+ label: i18n_1._('Ranges'),
785
+ value: 'rangeValue',
786
+ defaults: {
787
+ value: defaultContext.gaugeColorConfig
788
+ }
789
+ }],
790
+ dataSelectors: [{
791
+ label: i18n_1._('Value'),
792
+ value: 'value'
793
+ }],
794
+ defaultPalettesConfig: defaultPalettesConfig
795
+ }
796
+ };
797
+ };
798
+
799
+ exports.getDynamicGaugeColorEditor = getDynamicGaugeColorEditor;
800
+
801
+ /***/ })
802
+ /******/ ]);
803
+ //# sourceMappingURL=FillerGauge.config.js.map