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