@splunk/visualizations 25.13.1 → 26.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 (150) hide show
  1. package/Area.config.js +318 -234
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +1131 -766
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +317 -233
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +1007 -594
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +234 -160
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +912 -509
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +80 -29
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +691 -319
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +308 -223
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +1011 -587
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +127 -62
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +576 -286
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +111 -29
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +998 -527
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +142 -73
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +962 -572
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +70 -26
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +524 -253
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +326 -242
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +1022 -606
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +99 -49
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +1184 -762
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +311 -167
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1479 -873
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +93 -43
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +603 -332
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +163 -105
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +1025 -628
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +95 -41
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +993 -622
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +99 -46
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +847 -442
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +114 -62
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +1097 -633
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +131 -65
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +580 -288
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +103 -41
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +1128 -586
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +231 -157
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +904 -504
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +212 -142
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1506 -956
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +294 -233
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +208 -138
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +1375 -914
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +252 -137
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +2194 -1069
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +172 -83
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +123 -70
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +1094 -590
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +147 -75
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +18 -7
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/EventsDoc.js +91 -36
  107. package/common/EventsDoc.js.map +1 -1
  108. package/common/GaugeMajorTicks.js +70 -60
  109. package/common/GaugeMajorTicks.js.map +1 -1
  110. package/common/GaugeValueMarker.js +45 -36
  111. package/common/GaugeValueMarker.js.map +1 -1
  112. package/common/OptionsDoc.js +177 -86
  113. package/common/OptionsDoc.js.map +1 -1
  114. package/common/OverviewDoc.js +65 -32
  115. package/common/OverviewDoc.js.map +1 -1
  116. package/common/SplunkVisualization.js +34 -7
  117. package/common/SplunkVisualization.js.map +1 -1
  118. package/common/SplunkVisualizationApi.js +10 -4
  119. package/common/SplunkVisualizationApi.js.map +1 -1
  120. package/common/ThemesDoc.js +41 -28
  121. package/common/ThemesDoc.js.map +1 -1
  122. package/common/chartingUtils.js +56 -24
  123. package/common/chartingUtils.js.map +1 -1
  124. package/common/docUtils.js +15 -5
  125. package/common/docUtils.js.map +1 -1
  126. package/common/gaugeUtils.js +238 -155
  127. package/common/gaugeUtils.js.map +1 -1
  128. package/common/shapeUtils.js +34 -16
  129. package/common/shapeUtils.js.map +1 -1
  130. package/common/utils/configUtils.js +59 -23
  131. package/common/utils/configUtils.js.map +1 -1
  132. package/common/utils/dataUtils.js +9 -4
  133. package/common/utils/dataUtils.js.map +1 -1
  134. package/common/utils/hocUtils.js +5 -3
  135. package/common/utils/hocUtils.js.map +1 -1
  136. package/common/utils/layoutUtils.js +3 -2
  137. package/common/utils/layoutUtils.js.map +1 -1
  138. package/common/utils/mapUtils.js +370 -206
  139. package/common/utils/mapUtils.js.map +1 -1
  140. package/common/utils/singleValueUtils.js +243 -198
  141. package/common/utils/singleValueUtils.js.map +1 -1
  142. package/common/utils/testHelper.js +36 -9
  143. package/common/utils/testHelper.js.map +1 -1
  144. package/common/utils/trellisUtils.js +87 -26
  145. package/common/utils/trellisUtils.js.map +1 -1
  146. package/common/utils/urlUtils.js +4 -2
  147. package/common/utils/urlUtils.js.map +1 -1
  148. package/common/withDashboardViz.js +375 -193
  149. package/common/withDashboardViz.js.map +1 -1
  150. package/package.json +25 -27
@@ -87,12 +87,12 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 69);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 70);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
94
94
 
95
- /***/ 25:
95
+ /***/ 26:
96
96
  /***/ (function(module, exports) {
97
97
 
98
98
  module.exports = require("@babel/runtime/helpers/toConsumableArray");
@@ -106,20 +106,32 @@ module.exports = require("lodash");
106
106
 
107
107
  /***/ }),
108
108
 
109
- /***/ 69:
109
+ /***/ 7:
110
+ /***/ (function(module, exports) {
111
+
112
+ module.exports = require("@splunk/ui-utils/i18n");
113
+
114
+ /***/ }),
115
+
116
+ /***/ 70:
110
117
  /***/ (function(module, exports, __webpack_require__) {
111
118
 
112
119
  "use strict";
113
120
 
114
121
 
115
- var _toConsumableArray = __webpack_require__(25);
122
+ var _toConsumableArray = __webpack_require__(26);
123
+
116
124
  Object.defineProperty(exports, "__esModule", {
117
125
  value: true
118
126
  });
119
127
  exports.convertToGaugeProperties = exports.mapValueLabelDisplay = exports.mapToOldKey = exports.getGradientDimensions = exports.getGradientStops = exports.getGradientStopColors = exports.getGradientStopOffsets = exports.getGaugeRange = exports.validateRanges = exports.getSortedRanges = exports.getMarkerGaugeValueMarkerPositions = exports.getMarkerBarDimensions = exports.getFillerGaugeValueMarkerPositions = exports.getFillBarDimensions = exports.getGaugeBarHeight = exports.getGaugeBarWidth = exports.getGaugeBarStartPositions = exports.getGaugeBarLength = exports.assignGaugeColor = exports.getGaugeDimensions = exports.getGaugeStartPosition = exports.getGaugeLength = exports.getGaugeHeight = exports.getGaugeWidth = exports.FILL_THICKNESS = exports.GAUGE_THICKNESS = void 0;
128
+
120
129
  var lodash_1 = __webpack_require__(3);
121
- var colorConstants_1 = __webpack_require__(70);
130
+
131
+ var colorConstants_1 = __webpack_require__(71);
132
+
122
133
  var i18n_1 = __webpack_require__(7);
134
+
123
135
  exports.GAUGE_THICKNESS = 50;
124
136
  exports.FILL_THICKNESS = 38;
125
137
  var GRADIENT_STOP_OFFSET_MIN = 0;
@@ -132,11 +144,13 @@ var GRADIENT_STOP_OFFSET_MAX = 100;
132
144
  * @param {String} orientation
133
145
  * @return {Number} width
134
146
  */
147
+
135
148
  var getGaugeWidth = function getGaugeWidth(_ref) {
136
149
  var containerWidth = _ref.containerWidth,
137
- orientation = _ref.orientation;
150
+ orientation = _ref.orientation;
138
151
  return orientation === 'vertical' ? exports.GAUGE_THICKNESS : containerWidth * 0.8;
139
152
  };
153
+
140
154
  exports.getGaugeWidth = getGaugeWidth;
141
155
  /**
142
156
  * get height for the whole gauge viz for horizontal or vertical view
@@ -146,11 +160,13 @@ exports.getGaugeWidth = getGaugeWidth;
146
160
  * @param {String} orientation
147
161
  * @return {Number} height
148
162
  */
163
+
149
164
  var getGaugeHeight = function getGaugeHeight(_ref2) {
150
165
  var containerHeight = _ref2.containerHeight,
151
- orientation = _ref2.orientation;
166
+ orientation = _ref2.orientation;
152
167
  return orientation === 'vertical' ? containerHeight * 0.8 : exports.GAUGE_THICKNESS;
153
168
  };
169
+
154
170
  exports.getGaugeHeight = getGaugeHeight;
155
171
  /**
156
172
  * get how long the gauge shoud be.
@@ -162,18 +178,20 @@ exports.getGaugeHeight = getGaugeHeight;
162
178
  * @param {String} input.orientation
163
179
  * @return {Number} gaugeLength
164
180
  */
181
+
165
182
  var getGaugeLength = function getGaugeLength(_ref3) {
166
183
  var containerWidth = _ref3.containerWidth,
167
- containerHeight = _ref3.containerHeight,
168
- orientation = _ref3.orientation;
169
- return orientation === 'vertical' ? exports.getGaugeHeight({
184
+ containerHeight = _ref3.containerHeight,
185
+ orientation = _ref3.orientation;
186
+ return orientation === 'vertical' ? (0, exports.getGaugeHeight)({
170
187
  containerHeight: containerHeight,
171
188
  orientation: orientation
172
- }) : exports.getGaugeWidth({
189
+ }) : (0, exports.getGaugeWidth)({
173
190
  containerWidth: containerWidth,
174
191
  orientation: orientation
175
192
  });
176
193
  };
194
+
177
195
  exports.getGaugeLength = getGaugeLength;
178
196
  /**
179
197
  * get start x and y for rendering gauge
@@ -187,23 +205,27 @@ exports.getGaugeLength = getGaugeLength;
187
205
  * @return {Number} position.gaugeStartX
188
206
  * @return {Number} position.gaugeStartY
189
207
  */
208
+
190
209
  var getGaugeStartPosition = function getGaugeStartPosition(_ref4) {
191
210
  var containerWidth = _ref4.containerWidth,
192
- containerHeight = _ref4.containerHeight,
193
- gaugeLength = _ref4.gaugeLength,
194
- orientation = _ref4.orientation;
211
+ containerHeight = _ref4.containerHeight,
212
+ gaugeLength = _ref4.gaugeLength,
213
+ orientation = _ref4.orientation;
195
214
  // for horizontal view
196
215
  var gaugeStartX = (containerWidth - gaugeLength) / 2.0;
197
216
  var gaugeStartY = (containerHeight - exports.GAUGE_THICKNESS) / 2.0;
217
+
198
218
  if (orientation === 'vertical') {
199
219
  gaugeStartX = (containerWidth - exports.GAUGE_THICKNESS) / 2.0;
200
220
  gaugeStartY = (containerHeight - gaugeLength) / 2.0;
201
221
  }
222
+
202
223
  return {
203
224
  gaugeStartX: gaugeStartX,
204
225
  gaugeStartY: gaugeStartY
205
226
  };
206
227
  };
228
+
207
229
  exports.getGaugeStartPosition = getGaugeStartPosition;
208
230
  /**
209
231
  * get dimensions for the whole gauge viz,
@@ -220,28 +242,31 @@ exports.getGaugeStartPosition = getGaugeStartPosition;
220
242
  * @return {Number} gaugeDimensions.gaugeWidth natural width of gauge
221
243
  * @return {Number} gaugeDimensions.gaugeHeight natural height of gauge
222
244
  */
245
+
223
246
  var getGaugeDimensions = function getGaugeDimensions(_ref5) {
224
247
  var containerWidth = _ref5.containerWidth,
225
- containerHeight = _ref5.containerHeight,
226
- orientation = _ref5.orientation;
227
- var gaugeLength = exports.getGaugeLength({
248
+ containerHeight = _ref5.containerHeight,
249
+ orientation = _ref5.orientation;
250
+ var gaugeLength = (0, exports.getGaugeLength)({
228
251
  containerWidth: containerWidth,
229
252
  containerHeight: containerHeight,
230
253
  orientation: orientation
231
254
  });
232
- var _exports$getGaugeStar = exports.getGaugeStartPosition({
233
- containerWidth: containerWidth,
234
- containerHeight: containerHeight,
235
- gaugeLength: gaugeLength,
236
- orientation: orientation
237
- }),
238
- gaugeStartX = _exports$getGaugeStar.gaugeStartX,
239
- gaugeStartY = _exports$getGaugeStar.gaugeStartY;
240
- var gaugeWidth = exports.getGaugeWidth({
255
+
256
+ var _ref6 = (0, exports.getGaugeStartPosition)({
257
+ containerWidth: containerWidth,
258
+ containerHeight: containerHeight,
259
+ gaugeLength: gaugeLength,
260
+ orientation: orientation
261
+ }),
262
+ gaugeStartX = _ref6.gaugeStartX,
263
+ gaugeStartY = _ref6.gaugeStartY;
264
+
265
+ var gaugeWidth = (0, exports.getGaugeWidth)({
241
266
  containerWidth: containerWidth,
242
267
  orientation: orientation
243
268
  });
244
- var gaugeHeight = exports.getGaugeHeight({
269
+ var gaugeHeight = (0, exports.getGaugeHeight)({
245
270
  containerHeight: containerHeight,
246
271
  orientation: orientation
247
272
  });
@@ -253,6 +278,7 @@ var getGaugeDimensions = function getGaugeDimensions(_ref5) {
253
278
  gaugeHeight: gaugeHeight
254
279
  };
255
280
  };
281
+
256
282
  exports.getGaugeDimensions = getGaugeDimensions;
257
283
  /**
258
284
  * if gaugeColor is not specified, auto assign a gauge color to the fill bar
@@ -260,19 +286,24 @@ exports.getGaugeDimensions = getGaugeDimensions;
260
286
  * @method assignGaugeColor
261
287
  * @params
262
288
  * */
263
- var assignGaugeColor = function assignGaugeColor(_ref6) {
264
- var value = _ref6.value,
265
- min = _ref6.min,
266
- max = _ref6.max;
289
+
290
+ var assignGaugeColor = function assignGaugeColor(_ref7) {
291
+ var value = _ref7.value,
292
+ min = _ref7.min,
293
+ max = _ref7.max;
267
294
  var rate = (value - min) / (max - min);
295
+
268
296
  if (rate <= 0.3) {
269
297
  return colorConstants_1.SEMANTIC_SUCCESS;
270
298
  }
299
+
271
300
  if (rate > 0.3 && rate <= 0.6) {
272
301
  return colorConstants_1.SEMANTIC_WARNING;
273
302
  }
303
+
274
304
  return colorConstants_1.SEMANTIC_ERROR;
275
305
  };
306
+
276
307
  exports.assignGaugeColor = assignGaugeColor;
277
308
  /**
278
309
  * get inner bar length in gauge
@@ -284,22 +315,28 @@ exports.assignGaugeColor = assignGaugeColor;
284
315
  * @param {Number} input.max
285
316
  * @return {Number} gaugeBarLength
286
317
  */
287
- var getGaugeBarLength = function getGaugeBarLength(_ref7) {
288
- var gaugeLength = _ref7.gaugeLength,
289
- value = _ref7.value,
290
- min = _ref7.min,
291
- max = _ref7.max;
318
+
319
+ var getGaugeBarLength = function getGaugeBarLength(_ref8) {
320
+ var gaugeLength = _ref8.gaugeLength,
321
+ value = _ref8.value,
322
+ min = _ref8.min,
323
+ max = _ref8.max;
324
+
292
325
  if (max < min) {
293
326
  return null;
294
327
  }
328
+
295
329
  if (value >= max) {
296
330
  return gaugeLength;
297
331
  }
332
+
298
333
  if (value < min) {
299
334
  return 0;
300
335
  }
336
+
301
337
  return gaugeLength * (value - min) / (max - min);
302
338
  };
339
+
303
340
  exports.getGaugeBarLength = getGaugeBarLength;
304
341
  /**
305
342
  * get x and y position for rendering inner bar in gauge
@@ -315,26 +352,30 @@ exports.getGaugeBarLength = getGaugeBarLength;
315
352
  * @return {Number} position.gaugeBarX
316
353
  * @return {Number} position.gaugeBarY
317
354
  */
318
- var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref8) {
319
- var gaugeStartX = _ref8.gaugeStartX,
320
- gaugeStartY = _ref8.gaugeStartY,
321
- gaugeWidth = _ref8.gaugeWidth,
322
- gaugeHeight = _ref8.gaugeHeight,
323
- gaugeBarLength = _ref8.gaugeBarLength,
324
- orientation = _ref8.orientation;
355
+
356
+ var getGaugeBarStartPositions = function getGaugeBarStartPositions(_ref9) {
357
+ var gaugeStartX = _ref9.gaugeStartX,
358
+ gaugeStartY = _ref9.gaugeStartY,
359
+ gaugeWidth = _ref9.gaugeWidth,
360
+ gaugeHeight = _ref9.gaugeHeight,
361
+ gaugeBarLength = _ref9.gaugeBarLength,
362
+ orientation = _ref9.orientation;
325
363
  var gaugeBarX = gaugeStartX;
326
364
  var gaugeBarY = gaugeStartY;
365
+
327
366
  if (orientation === 'vertical') {
328
367
  gaugeBarX += (gaugeWidth - exports.FILL_THICKNESS) / 2;
329
368
  gaugeBarY += gaugeHeight - gaugeBarLength;
330
369
  } else {
331
370
  gaugeBarY += (gaugeHeight - exports.FILL_THICKNESS) / 2;
332
371
  }
372
+
333
373
  return {
334
374
  gaugeBarX: gaugeBarX,
335
375
  gaugeBarY: gaugeBarY
336
376
  };
337
377
  };
378
+
338
379
  exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
339
380
  /**
340
381
  * get width of inner bar in gauge
@@ -344,11 +385,13 @@ exports.getGaugeBarStartPositions = getGaugeBarStartPositions;
344
385
  * @param {String} orientation
345
386
  * @return {Number} gaugeBarWidth
346
387
  */
347
- var getGaugeBarWidth = function getGaugeBarWidth(_ref9) {
348
- var gaugeBarLength = _ref9.gaugeBarLength,
349
- orientation = _ref9.orientation;
388
+
389
+ var getGaugeBarWidth = function getGaugeBarWidth(_ref10) {
390
+ var gaugeBarLength = _ref10.gaugeBarLength,
391
+ orientation = _ref10.orientation;
350
392
  return orientation === 'vertical' ? exports.FILL_THICKNESS : gaugeBarLength;
351
393
  };
394
+
352
395
  exports.getGaugeBarWidth = getGaugeBarWidth;
353
396
  /**
354
397
  * get height of inner bar in gauge
@@ -358,11 +401,13 @@ exports.getGaugeBarWidth = getGaugeBarWidth;
358
401
  * @param {String} orientation
359
402
  * @return {Number} gaugeBarHeight
360
403
  */
361
- var getGaugeBarHeight = function getGaugeBarHeight(_ref10) {
362
- var gaugeBarLength = _ref10.gaugeBarLength,
363
- orientation = _ref10.orientation;
404
+
405
+ var getGaugeBarHeight = function getGaugeBarHeight(_ref11) {
406
+ var gaugeBarLength = _ref11.gaugeBarLength,
407
+ orientation = _ref11.orientation;
364
408
  return orientation === 'vertical' ? gaugeBarLength : exports.FILL_THICKNESS;
365
409
  };
410
+
366
411
  exports.getGaugeBarHeight = getGaugeBarHeight;
367
412
  /**
368
413
  * get dimensions for the fill bar in the gauge
@@ -384,37 +429,40 @@ exports.getGaugeBarHeight = getGaugeBarHeight;
384
429
  * @return {Number} fillBarDimensions.fillBarWidth
385
430
  * @return {Number} fillBarDimensions.fillBarHeight
386
431
  */
387
- var getFillBarDimensions = function getFillBarDimensions(_ref11) {
388
- var gaugeLength = _ref11.gaugeLength,
389
- gaugeStartX = _ref11.gaugeStartX,
390
- gaugeStartY = _ref11.gaugeStartY,
391
- gaugeWidth = _ref11.gaugeWidth,
392
- gaugeHeight = _ref11.gaugeHeight,
393
- value = _ref11.value,
394
- min = _ref11.min,
395
- max = _ref11.max,
396
- orientation = _ref11.orientation;
397
- var gaugeBarLength = exports.getGaugeBarLength({
432
+
433
+ var getFillBarDimensions = function getFillBarDimensions(_ref12) {
434
+ var gaugeLength = _ref12.gaugeLength,
435
+ gaugeStartX = _ref12.gaugeStartX,
436
+ gaugeStartY = _ref12.gaugeStartY,
437
+ gaugeWidth = _ref12.gaugeWidth,
438
+ gaugeHeight = _ref12.gaugeHeight,
439
+ value = _ref12.value,
440
+ min = _ref12.min,
441
+ max = _ref12.max,
442
+ orientation = _ref12.orientation;
443
+ var gaugeBarLength = (0, exports.getGaugeBarLength)({
398
444
  gaugeLength: gaugeLength,
399
445
  value: value,
400
446
  max: max,
401
447
  min: min
402
448
  });
403
- var _exports$getGaugeBarS = exports.getGaugeBarStartPositions({
404
- gaugeStartX: gaugeStartX,
405
- gaugeStartY: gaugeStartY,
406
- gaugeWidth: gaugeWidth,
407
- gaugeHeight: gaugeHeight,
408
- gaugeBarLength: gaugeBarLength,
409
- orientation: orientation
410
- }),
411
- fillBarX = _exports$getGaugeBarS.gaugeBarX,
412
- fillBarY = _exports$getGaugeBarS.gaugeBarY;
413
- var fillBarWidth = exports.getGaugeBarWidth({
449
+
450
+ var _ref13 = (0, exports.getGaugeBarStartPositions)({
451
+ gaugeStartX: gaugeStartX,
452
+ gaugeStartY: gaugeStartY,
453
+ gaugeWidth: gaugeWidth,
454
+ gaugeHeight: gaugeHeight,
455
+ gaugeBarLength: gaugeBarLength,
456
+ orientation: orientation
457
+ }),
458
+ fillBarX = _ref13.gaugeBarX,
459
+ fillBarY = _ref13.gaugeBarY;
460
+
461
+ var fillBarWidth = (0, exports.getGaugeBarWidth)({
414
462
  gaugeBarLength: gaugeBarLength,
415
463
  orientation: orientation
416
464
  });
417
- var fillBarHeight = exports.getGaugeBarHeight({
465
+ var fillBarHeight = (0, exports.getGaugeBarHeight)({
418
466
  gaugeBarLength: gaugeBarLength,
419
467
  orientation: orientation
420
468
  });
@@ -426,6 +474,7 @@ var getFillBarDimensions = function getFillBarDimensions(_ref11) {
426
474
  fillBarHeight: fillBarHeight
427
475
  };
428
476
  };
477
+
429
478
  exports.getFillBarDimensions = getFillBarDimensions;
430
479
  /**
431
480
  * get position x and y for value marker in filler gauge
@@ -439,24 +488,28 @@ exports.getFillBarDimensions = getFillBarDimensions;
439
488
  * @return {Number} position.valueMarkerX
440
489
  * @return {Number} position.valueMarkerY
441
490
  */
442
- var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref12) {
443
- var fillBarX = _ref12.fillBarX,
444
- fillBarY = _ref12.fillBarY,
445
- fillBarLength = _ref12.fillBarLength,
446
- orientation = _ref12.orientation;
491
+
492
+ var getFillerGaugeValueMarkerPositions = function getFillerGaugeValueMarkerPositions(_ref14) {
493
+ var fillBarX = _ref14.fillBarX,
494
+ fillBarY = _ref14.fillBarY,
495
+ fillBarLength = _ref14.fillBarLength,
496
+ orientation = _ref14.orientation;
447
497
  var valueMarkerX = fillBarX;
448
498
  var valueMarkerY = fillBarY;
499
+
449
500
  if (orientation === 'vertical') {
450
501
  valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
451
502
  } else {
452
503
  valueMarkerX += fillBarLength;
453
504
  valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
454
505
  }
506
+
455
507
  return {
456
508
  valueMarkerX: valueMarkerX,
457
509
  valueMarkerY: valueMarkerY
458
510
  };
459
511
  };
512
+
460
513
  exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
461
514
  /**
462
515
  * get dimensions for the marker bar in the gauge
@@ -475,29 +528,32 @@ exports.getFillerGaugeValueMarkerPositions = getFillerGaugeValueMarkerPositions;
475
528
  * @return {Number} markerBarDimensions.markerBarWidth
476
529
  * @return {Number} markerBarDimensions.markerBarHeight
477
530
  */
478
- var getMarkerBarDimensions = function getMarkerBarDimensions(_ref13) {
479
- var gaugeLength = _ref13.gaugeLength,
480
- gaugeStartX = _ref13.gaugeStartX,
481
- gaugeStartY = _ref13.gaugeStartY,
482
- gaugeWidth = _ref13.gaugeWidth,
483
- gaugeHeight = _ref13.gaugeHeight,
484
- orientation = _ref13.orientation;
531
+
532
+ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref15) {
533
+ var gaugeLength = _ref15.gaugeLength,
534
+ gaugeStartX = _ref15.gaugeStartX,
535
+ gaugeStartY = _ref15.gaugeStartY,
536
+ gaugeWidth = _ref15.gaugeWidth,
537
+ gaugeHeight = _ref15.gaugeHeight,
538
+ orientation = _ref15.orientation;
485
539
  var gaugeBarLength = gaugeLength; // For marker gauge, inner marker bar spans the entire gauge
486
- var _exports$getGaugeBarS2 = exports.getGaugeBarStartPositions({
487
- gaugeStartX: gaugeStartX,
488
- gaugeStartY: gaugeStartY,
489
- gaugeWidth: gaugeWidth,
490
- gaugeHeight: gaugeHeight,
491
- gaugeBarLength: gaugeBarLength,
492
- orientation: orientation
493
- }),
494
- markerBarX = _exports$getGaugeBarS2.gaugeBarX,
495
- markerBarY = _exports$getGaugeBarS2.gaugeBarY;
496
- var markerBarWidth = exports.getGaugeBarWidth({
540
+
541
+ var _ref16 = (0, exports.getGaugeBarStartPositions)({
542
+ gaugeStartX: gaugeStartX,
543
+ gaugeStartY: gaugeStartY,
544
+ gaugeWidth: gaugeWidth,
545
+ gaugeHeight: gaugeHeight,
546
+ gaugeBarLength: gaugeBarLength,
547
+ orientation: orientation
548
+ }),
549
+ markerBarX = _ref16.gaugeBarX,
550
+ markerBarY = _ref16.gaugeBarY;
551
+
552
+ var markerBarWidth = (0, exports.getGaugeBarWidth)({
497
553
  gaugeBarLength: gaugeBarLength,
498
554
  orientation: orientation
499
555
  });
500
- var markerBarHeight = exports.getGaugeBarHeight({
556
+ var markerBarHeight = (0, exports.getGaugeBarHeight)({
501
557
  gaugeBarLength: gaugeBarLength,
502
558
  orientation: orientation
503
559
  });
@@ -509,6 +565,7 @@ var getMarkerBarDimensions = function getMarkerBarDimensions(_ref13) {
509
565
  markerBarHeight: markerBarHeight
510
566
  };
511
567
  };
568
+
512
569
  exports.getMarkerBarDimensions = getMarkerBarDimensions;
513
570
  /**
514
571
  * get position x and y for value marker in marker gauge
@@ -526,19 +583,21 @@ exports.getMarkerBarDimensions = getMarkerBarDimensions;
526
583
  * @return {Number} position.valueMarkerX
527
584
  * @return {Number} position.valueMarkerY
528
585
  */
529
- var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref14) {
530
- var markerBarX = _ref14.markerBarX,
531
- markerBarY = _ref14.markerBarY,
532
- markerBarHeight = _ref14.markerBarHeight,
533
- gaugeLength = _ref14.markerBarLength,
534
- orientation = _ref14.orientation,
535
- value = _ref14.value,
536
- min = _ref14.min,
537
- max = _ref14.max;
586
+
587
+ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPositions(_ref17) {
588
+ var markerBarX = _ref17.markerBarX,
589
+ markerBarY = _ref17.markerBarY,
590
+ markerBarHeight = _ref17.markerBarHeight,
591
+ gaugeLength = _ref17.markerBarLength,
592
+ orientation = _ref17.orientation,
593
+ value = _ref17.value,
594
+ min = _ref17.min,
595
+ max = _ref17.max;
538
596
  var valueMarkerX = markerBarX;
539
597
  var valueMarkerY = markerBarY;
598
+
540
599
  if (orientation === 'vertical') {
541
- valueMarkerY += markerBarHeight - exports.getGaugeBarLength({
600
+ valueMarkerY += markerBarHeight - (0, exports.getGaugeBarLength)({
542
601
  gaugeLength: gaugeLength,
543
602
  value: value,
544
603
  max: max,
@@ -546,7 +605,7 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
546
605
  });
547
606
  valueMarkerX -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
548
607
  } else {
549
- valueMarkerX += exports.getGaugeBarLength({
608
+ valueMarkerX += (0, exports.getGaugeBarLength)({
550
609
  gaugeLength: gaugeLength,
551
610
  value: value,
552
611
  max: max,
@@ -554,11 +613,13 @@ var getMarkerGaugeValueMarkerPositions = function getMarkerGaugeValueMarkerPosit
554
613
  });
555
614
  valueMarkerY -= (exports.GAUGE_THICKNESS - exports.FILL_THICKNESS) / 4;
556
615
  }
616
+
557
617
  return {
558
618
  valueMarkerX: valueMarkerX,
559
619
  valueMarkerY: valueMarkerY
560
620
  };
561
621
  };
622
+
562
623
  exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
563
624
  /**
564
625
  * sort the ranges in ascending order
@@ -566,11 +627,13 @@ exports.getMarkerGaugeValueMarkerPositions = getMarkerGaugeValueMarkerPositions;
566
627
  * @param {Array} ranges
567
628
  * @return {Array} sortedRanges
568
629
  */
630
+
569
631
  var getSortedRanges = function getSortedRanges(ranges) {
570
632
  return ranges.sort(function (a, b) {
571
633
  return a.from - b.from;
572
634
  });
573
635
  };
636
+
574
637
  exports.getSortedRanges = getSortedRanges;
575
638
  /**
576
639
  * validate whether ranges prop is valid - continuous ranges, range.to < range.from, range.from != range.to
@@ -578,29 +641,35 @@ exports.getSortedRanges = getSortedRanges;
578
641
  * @param {Array} ranges
579
642
  * @return {String} error
580
643
  */
644
+
581
645
  var validateRanges = function validateRanges(ranges) {
582
646
  if (!ranges.length) {
583
- return i18n_1._('Prop "ranges" is missing entries');
584
- }
585
- // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
647
+ return (0, i18n_1._)('Prop "ranges" is missing entries');
648
+ } // check whether a range has "from" >= "to" eg: 10 - 10, 100 - 10, -20 - -10 are invalid
649
+
650
+
586
651
  if (ranges.some(function (range) {
587
652
  return range.from >= range.to;
588
653
  })) {
589
- return i18n_1._('Prop "ranges" has invalid entries: invalid range');
590
- }
591
- // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
592
- if (ranges.length !== lodash_1.uniqBy(ranges, 'to').length || ranges.length !== lodash_1.uniqBy(ranges, 'from').length) {
593
- return i18n_1._('Prop "ranges" has invalid entries: duplicate values');
654
+ return (0, i18n_1._)('Prop "ranges" has invalid entries: invalid range');
655
+ } // check whether ranges have duplicate "from/to" eg: 0 - 50, 25 - 50
656
+
657
+
658
+ if (ranges.length !== (0, lodash_1.uniqBy)(ranges, 'to').length || ranges.length !== (0, lodash_1.uniqBy)(ranges, 'from').length) {
659
+ return (0, i18n_1._)('Prop "ranges" has invalid entries: duplicate values');
594
660
  }
595
- var sortedRanges = exports.getSortedRanges(ranges);
596
- // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
661
+
662
+ var sortedRanges = (0, exports.getSortedRanges)(ranges); // check whether ranges are continuous eg: 0 - 10, 10 - 20, 20 - 30
663
+
597
664
  for (var i = 1; i < sortedRanges.length; i += 1) {
598
665
  if (sortedRanges[i].from !== sortedRanges[i - 1].to) {
599
- return i18n_1._('Prop "ranges" has invalid entries: discontinuous ranges');
666
+ return (0, i18n_1._)('Prop "ranges" has invalid entries: discontinuous ranges');
600
667
  }
601
668
  }
669
+
602
670
  return null;
603
671
  };
672
+
604
673
  exports.validateRanges = validateRanges;
605
674
  /**
606
675
  * calculate min and max value of gauge
@@ -610,6 +679,7 @@ exports.validateRanges = validateRanges;
610
679
  * @return {Number} gaugeRange.min
611
680
  * @return {Number} gaugeRange.max
612
681
  */
682
+
613
683
  var getGaugeRange = function getGaugeRange(ranges) {
614
684
  var min = Math.min.apply(Math, _toConsumableArray(ranges.map(function (range) {
615
685
  return range.from;
@@ -622,6 +692,7 @@ var getGaugeRange = function getGaugeRange(ranges) {
622
692
  max: max
623
693
  };
624
694
  };
695
+
625
696
  exports.getGaugeRange = getGaugeRange;
626
697
  /**
627
698
  * calculate stop offsets for linear gradient
@@ -630,17 +701,20 @@ exports.getGaugeRange = getGaugeRange;
630
701
  * @param {String} orientation
631
702
  * @return {Array} cumulativeOffsets
632
703
  */
633
- var getGradientStopOffsets = function getGradientStopOffsets(_ref15) {
634
- var ranges = _ref15.ranges,
635
- orientation = _ref15.orientation;
636
- var _exports$getGaugeRang = exports.getGaugeRange(ranges),
637
- min = _exports$getGaugeRang.min,
638
- max = _exports$getGaugeRang.max;
704
+
705
+ var getGradientStopOffsets = function getGradientStopOffsets(_ref18) {
706
+ var ranges = _ref18.ranges,
707
+ orientation = _ref18.orientation;
708
+
709
+ var _ref19 = (0, exports.getGaugeRange)(ranges),
710
+ min = _ref19.min,
711
+ max = _ref19.max;
712
+
639
713
  var offsetScale = (GRADIENT_STOP_OFFSET_MAX - GRADIENT_STOP_OFFSET_MIN) / (max - min);
640
714
  var offsets = ranges.map(function (range) {
641
715
  return Math.abs(range.from - range.to) * offsetScale;
642
- });
643
- // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
716
+ }); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
717
+
644
718
  offsets = orientation === 'vertical' ? offsets.reverse() : offsets;
645
719
  var cumulativeOffsets = [];
646
720
  offsets.reduce(function (accumulator, currentValue, idx) {
@@ -649,6 +723,7 @@ var getGradientStopOffsets = function getGradientStopOffsets(_ref15) {
649
723
  }, 0);
650
724
  return cumulativeOffsets;
651
725
  };
726
+
652
727
  exports.getGradientStopOffsets = getGradientStopOffsets;
653
728
  /**
654
729
  * calculate stop colors for linear gradient
@@ -657,15 +732,17 @@ exports.getGradientStopOffsets = getGradientStopOffsets;
657
732
  * @param {String} orientation
658
733
  * @return {Array} stopColors
659
734
  */
660
- var getGradientStopColors = function getGradientStopColors(_ref16) {
661
- var ranges = _ref16.ranges,
662
- orientation = _ref16.orientation;
735
+
736
+ var getGradientStopColors = function getGradientStopColors(_ref20) {
737
+ var ranges = _ref20.ranges,
738
+ orientation = _ref20.orientation;
663
739
  var stopColors = ranges.map(function (range) {
664
740
  return range.value;
665
- });
666
- // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
741
+ }); // When orientation is vertical, since the gauge starts from bottom to top, linear gradient should be reversed
742
+
667
743
  return orientation === 'vertical' ? stopColors.reverse() : stopColors;
668
744
  };
745
+
669
746
  exports.getGradientStopColors = getGradientStopColors;
670
747
  /**
671
748
  * calculate linear gradient stops from ranges
@@ -675,24 +752,25 @@ exports.getGradientStopColors = getGradientStopColors;
675
752
  * @param {String} orientation
676
753
  * @return {Array} stops
677
754
  */
678
- var getGradientStops = function getGradientStops(_ref17) {
679
- var ranges = _ref17.ranges,
680
- orientation = _ref17.orientation;
755
+
756
+ var getGradientStops = function getGradientStops(_ref21) {
757
+ var ranges = _ref21.ranges,
758
+ orientation = _ref21.orientation;
681
759
  var stops = [];
682
- var offsets = exports.getGradientStopOffsets({
760
+ var offsets = (0, exports.getGradientStopOffsets)({
683
761
  ranges: ranges,
684
762
  orientation: orientation
685
763
  });
686
- var stopColors = exports.getGradientStopColors({
764
+ var stopColors = (0, exports.getGradientStopColors)({
687
765
  ranges: ranges,
688
766
  orientation: orientation
689
- });
690
- // Initialize stops with the first color stop
767
+ }); // Initialize stops with the first color stop
768
+
691
769
  stops.push({
692
770
  offset: "".concat(offsets[0], "%"),
693
771
  stopColor: stopColors[0]
694
- });
695
- // Add the remaining color stops with gradient change at each stop
772
+ }); // Add the remaining color stops with gradient change at each stop
773
+
696
774
  for (var i = 1; i < ranges.length; i += 1) {
697
775
  stops.push({
698
776
  offset: "".concat(offsets[i - 1], "%"),
@@ -703,8 +781,10 @@ var getGradientStops = function getGradientStops(_ref17) {
703
781
  stopColor: stopColors[i]
704
782
  });
705
783
  }
784
+
706
785
  return stops;
707
786
  };
787
+
708
788
  exports.getGradientStops = getGradientStops;
709
789
  /**
710
790
  * calculate linear gradient dimensions
@@ -716,6 +796,7 @@ exports.getGradientStops = getGradientStops;
716
796
  * @return {String} dimensions.x2
717
797
  * @return {String} dimensions.y2
718
798
  */
799
+
719
800
  var getGradientDimensions = function getGradientDimensions(orientation) {
720
801
  var x1 = '0%';
721
802
  var y1 = '0%';
@@ -728,8 +809,9 @@ var getGradientDimensions = function getGradientDimensions(orientation) {
728
809
  y2: y2
729
810
  };
730
811
  };
731
- exports.getGradientDimensions = getGradientDimensions;
732
- // map for new options names to old option names
812
+
813
+ exports.getGradientDimensions = getGradientDimensions; // map for new options names to old option names
814
+
733
815
  var gaugeOptionsMapping = {
734
816
  majorTickInterval: 'majorUnit',
735
817
  gaugeRanges: 'ranges'
@@ -740,11 +822,13 @@ var gaugeOptionsMapping = {
740
822
  * @param {Object} options
741
823
  * @returns {Object}
742
824
  */
825
+
743
826
  var mapToOldKey = function mapToOldKey(options) {
744
- return lodash_1.mapKeys(options, function (val, key) {
827
+ return (0, lodash_1.mapKeys)(options, function (val, key) {
745
828
  return gaugeOptionsMapping[key] ? gaugeOptionsMapping[key] : key;
746
829
  });
747
830
  };
831
+
748
832
  exports.mapToOldKey = mapToOldKey;
749
833
  /**
750
834
  * Helper method to map labelDisplay and valueDisplay options to pure component option names
@@ -753,12 +837,14 @@ exports.mapToOldKey = mapToOldKey;
753
837
  * @param {Object} options
754
838
  * @returns {Object}
755
839
  */
840
+
756
841
  var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options) {
757
842
  var rangeOrValue = labelOrValue === 'value' ? 'Value' : 'Range';
758
843
  var showKey = labelOrValue === 'value' ? 'showValue' : 'showLabels';
759
844
  var percentKey = "usePercentage".concat(rangeOrValue);
760
845
  var optionString = "".concat(labelOrValue, "Display");
761
846
  var newOptions = Object.assign({}, options);
847
+
762
848
  if (newOptions[optionString]) {
763
849
  if (newOptions[optionString] === 'number') {
764
850
  newOptions[showKey] = true;
@@ -771,8 +857,10 @@ var mapValueLabelDisplay = function mapValueLabelDisplay(labelOrValue, options)
771
857
  newOptions[percentKey] = false;
772
858
  }
773
859
  }
774
- return lodash_1.omit(newOptions, [optionString]);
860
+
861
+ return (0, lodash_1.omit)(newOptions, [optionString]);
775
862
  };
863
+
776
864
  exports.mapValueLabelDisplay = mapValueLabelDisplay;
777
865
  /**
778
866
  * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that pure component accepts
@@ -781,25 +869,20 @@ exports.mapValueLabelDisplay = mapValueLabelDisplay;
781
869
  * @param {Object} originalOptions
782
870
  * @returns {Object}
783
871
  */
872
+
784
873
  var convertToGaugeProperties = function convertToGaugeProperties(originalOptions) {
785
- return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(function (options) {
786
- return exports.mapValueLabelDisplay('label', options);
874
+ return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru(function (options) {
875
+ return (0, exports.mapValueLabelDisplay)('label', options);
787
876
  }).thru(function (options) {
788
- return exports.mapValueLabelDisplay('value', options);
877
+ return (0, exports.mapValueLabelDisplay)('value', options);
789
878
  }).value();
790
879
  };
791
- exports.convertToGaugeProperties = convertToGaugeProperties;
792
880
 
793
- /***/ }),
794
-
795
- /***/ 7:
796
- /***/ (function(module, exports) {
797
-
798
- module.exports = require("@splunk/ui-utils/i18n");
881
+ exports.convertToGaugeProperties = convertToGaugeProperties;
799
882
 
800
883
  /***/ }),
801
884
 
802
- /***/ 70:
885
+ /***/ 71:
803
886
  /***/ (function(module, exports) {
804
887
 
805
888
  module.exports = require("@splunk/visualizations-shared/colorConstants");