@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,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 428);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 431);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -136,40 +136,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
136
136
  Object.defineProperty(exports, "__esModule", {
137
137
  value: true
138
138
  });
139
+
139
140
  var React = __webpack_require__(1);
141
+
140
142
  var styled_components_1 = __webpack_require__(4);
143
+
141
144
  var SizeAwareWrapper_1 = __webpack_require__(19);
145
+
142
146
  var style_1 = __webpack_require__(14);
147
+
143
148
  var colorUtils_1 = __webpack_require__(12);
149
+
144
150
  var Item = styled_components_1.default.div.attrs(function (_ref) {
145
151
  var width = _ref.width;
146
152
  return {
147
153
  style: {
148
- width: style_1.toPx(width)
154
+ width: (0, style_1.toPx)(width)
149
155
  }
150
156
  };
151
157
  }).withConfig({
152
158
  displayName: "FixedSizeContainer__Item",
153
159
  componentId: "sc-1yhgpod-0"
154
160
  })(["position:relative;background-color:", "};"], function (props) {
155
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
156
- });
157
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
161
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
162
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
163
+
158
164
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
159
165
  var width = _ref2.width,
160
- height = _ref2.height;
166
+ height = _ref2.height;
161
167
  return {
162
168
  style: Object.assign(Object.assign({}, width && {
163
- width: style_1.toPx(width)
169
+ width: (0, style_1.toPx)(width)
164
170
  }), height && {
165
- height: style_1.toPx(height)
171
+ height: (0, style_1.toPx)(height)
166
172
  })
167
173
  };
168
174
  }).withConfig({
169
175
  displayName: "FixedSizeContainer__FixSizeItem",
170
176
  componentId: "sc-1yhgpod-1"
171
177
  })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
172
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
178
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
173
179
  });
174
180
  var ItemContent = styled_components_1.default.div.withConfig({
175
181
  displayName: "FixedSizeContainer__ItemContent",
@@ -179,11 +185,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
179
185
  displayName: "FixedSizeContainer__FixSizeItemContent",
180
186
  componentId: "sc-1yhgpod-3"
181
187
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
188
+
182
189
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
183
190
  var FixedSizeContainer = function FixedSizeContainer(props) {
184
191
  var width = props.width,
185
- height = props.height,
186
- backgroundColor = props.backgroundColor;
192
+ height = props.height,
193
+ backgroundColor = props.backgroundColor;
194
+
187
195
  if (!height) {
188
196
  return React.createElement(Item, {
189
197
  "data-test": "item",
@@ -191,24 +199,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
191
199
  backgroundColor: backgroundColor
192
200
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
193
201
  }
202
+
194
203
  return React.createElement(FixSizeItem, {
195
204
  "data-test": "fix-size-item",
196
- "data-splunk-visualization-version": "25.13.1 - ea48ec41e",
205
+ "data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
197
206
  width: width,
198
207
  height: height,
199
208
  backgroundColor: backgroundColor
200
209
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
201
210
  var newWidth = _ref3.width,
202
- newHeight = _ref3.height;
211
+ newHeight = _ref3.height;
203
212
  return React.createElement(Viz, Object.assign({}, props, {
204
213
  width: newWidth,
205
214
  height: newHeight
206
215
  }));
207
216
  })));
208
217
  };
218
+
209
219
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
210
220
  return FixedSizeContainer;
211
221
  };
222
+
212
223
  exports.default = withFixedSizeContainer;
213
224
 
214
225
  /***/ }),
@@ -236,9 +247,10 @@ exports.extendStaticWrapperProps = void 0;
236
247
  * @param {DashboardVizType} props.Wrapper
237
248
  * @param {DashboardVizType} props.Visualization
238
249
  */
250
+
239
251
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
240
252
  var Wrapper = _ref.Wrapper,
241
- Visualization = _ref.Visualization;
253
+ Visualization = _ref.Visualization;
242
254
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
243
255
  extendProperties.forEach(function (prop) {
244
256
  if (Visualization[prop]) {
@@ -247,6 +259,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
247
259
  }
248
260
  });
249
261
  };
262
+
250
263
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
251
264
 
252
265
  /***/ }),
@@ -258,7 +271,7 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
258
271
 
259
272
  /***/ }),
260
273
 
261
- /***/ 160:
274
+ /***/ 163:
262
275
  /***/ (function(module, exports) {
263
276
 
264
277
  module.exports = require("@mdhnpm/rgb-hex-converter");
@@ -300,24 +313,33 @@ module.exports = require("@splunk/ui-utils/i18n");
300
313
 
301
314
 
302
315
  var _toConsumableArray = __webpack_require__(8);
316
+
303
317
  var _defineProperty = __webpack_require__(7);
318
+
304
319
  var __rest = this && this.__rest || function (s, e) {
305
320
  var t = {};
321
+
306
322
  for (var p in s) {
307
323
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
308
324
  }
325
+
309
326
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
310
327
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
311
328
  }
312
329
  return t;
313
330
  };
331
+
314
332
  Object.defineProperty(exports, "__esModule", {
315
333
  value: true
316
334
  });
317
335
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
336
+
318
337
  var lodash_1 = __webpack_require__(3);
338
+
319
339
  var schemaUtils_1 = __webpack_require__(16);
340
+
320
341
  var VizBehavior_1 = __webpack_require__(6);
342
+
321
343
  var dynamicOptionsDSLType = {
322
344
  type: 'string',
323
345
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -327,20 +349,22 @@ var dynamicOptionsDSLType = {
327
349
  * @param optionsSchema a visualization's options schema
328
350
  * @returns an updated options schema that additionally allows strings starting with > for each option
329
351
  */
352
+
330
353
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
331
354
  var enhancedOptionsSchema = {};
332
355
  Object.keys(optionsSchema).forEach(function (key) {
333
356
  var _a = optionsSchema[key],
334
- title = _a.title,
335
- description = _a.description,
336
- readOnly = _a.readOnly,
337
- writeOnly = _a.writeOnly,
338
- examples = _a.examples,
339
- defaultValue = _a.default,
340
- type = _a.type,
341
- properties = _a.properties,
342
- patternProperties = _a.patternProperties,
343
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
357
+ title = _a.title,
358
+ description = _a.description,
359
+ readOnly = _a.readOnly,
360
+ writeOnly = _a.writeOnly,
361
+ examples = _a.examples,
362
+ defaultValue = _a.default,
363
+ type = _a.type,
364
+ properties = _a.properties,
365
+ patternProperties = _a.patternProperties,
366
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
367
+
344
368
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
345
369
  title: title
346
370
  }), description !== undefined && {
@@ -354,12 +378,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
354
378
  }), defaultValue !== undefined && {
355
379
  default: defaultValue
356
380
  });
381
+
357
382
  if (type === 'object') {
358
383
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
359
384
  type: type
360
385
  }), properties && {
361
386
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
362
387
  });
388
+
363
389
  if (patternProperties) {
364
390
  var enhancedPatternProperties = {};
365
391
  Object.keys(patternProperties).forEach(function (opt) {
@@ -377,6 +403,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
377
403
  });
378
404
  return enhancedOptionsSchema;
379
405
  }
406
+
380
407
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
381
408
  /**
382
409
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -385,11 +412,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
385
412
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
386
413
  * and containing `open: false` for all editor panels in editorConfig
387
414
  */
415
+
388
416
  function enhanceConfig(vizConfig) {
389
417
  var enhancedConfig = Object.assign({}, vizConfig);
418
+
390
419
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
391
420
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
392
421
  }
422
+
393
423
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
394
424
  return Object.assign(Object.assign({}, config), {
395
425
  open: config.open || false
@@ -397,6 +427,7 @@ function enhanceConfig(vizConfig) {
397
427
  });
398
428
  return enhancedConfig;
399
429
  }
430
+
400
431
  exports.enhanceConfig = enhanceConfig;
401
432
  /**
402
433
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -404,6 +435,7 @@ exports.enhanceConfig = enhanceConfig;
404
435
  * @param vizConfig a Visualization Config
405
436
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
406
437
  */
438
+
407
439
  function uncollapseEditorConfig(vizConfig) {
408
440
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
409
441
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -413,13 +445,16 @@ function uncollapseEditorConfig(vizConfig) {
413
445
  });
414
446
  return editorPanelUncollapsedConfig;
415
447
  }
448
+
416
449
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
450
+
417
451
  function isDynamicOption(option) {
418
452
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
419
453
  }
420
- exports.isDynamicOption = isDynamicOption;
421
- // private helpers to improve readability of getInitialPreset
454
+
455
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
422
456
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
457
+
423
458
  /**
424
459
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
425
460
  * 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
@@ -428,6 +463,7 @@ exports.isDynamicOption = isDynamicOption;
428
463
  *
429
464
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
430
465
  */
466
+
431
467
  function hasCompatibleContexts(vizContext, presetContext) {
432
468
  var presetContextKeys = Object.keys(presetContext);
433
469
  return presetContextKeys.every(function (contextKey) {
@@ -437,6 +473,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
437
473
  /**
438
474
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
439
475
  */
476
+
477
+
440
478
  function hasCompatibleOptions(vizOptions, presetOptions) {
441
479
  var presetOptionKeys = Object.keys(presetOptions);
442
480
  return presetOptionKeys.every(function (optionKey) {
@@ -451,18 +489,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
451
489
  * @param {Object} vizOptions - the current vizOptions definition
452
490
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
453
491
  */
492
+
493
+
454
494
  function getInitialPreset(vizContext, vizOptions, presets) {
455
495
  return presets.find(function (preset) {
456
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
457
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
496
+ var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
497
+ var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
458
498
  var presetContextKeys = Object.keys(presetContext);
459
- var presetOptionKeys = Object.keys(presetOptions);
460
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
499
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
461
500
  // if not, then the preset is invalid in config.ts
501
+
462
502
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
463
503
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
464
504
  });
465
505
  }
506
+
466
507
  exports.getInitialPreset = getInitialPreset;
467
508
  /**
468
509
  * generates number precision values for a Select editor
@@ -470,14 +511,16 @@ exports.getInitialPreset = getInitialPreset;
470
511
  * @param {Number} numPrecisionValues - number of integer precision values to generate
471
512
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
472
513
  */
514
+
473
515
  function generatePrecisionValues(numPrecisionValues) {
474
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
516
+ return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
475
517
  return {
476
518
  label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
477
519
  value: i
478
520
  };
479
521
  });
480
522
  }
523
+
481
524
  exports.generatePrecisionValues = generatePrecisionValues;
482
525
  /**
483
526
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -487,12 +530,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
487
530
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
488
531
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
489
532
  */
533
+
490
534
  var insertLayout = function insertLayout(layout, index) {
491
535
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
492
536
  layoutItems[_key - 2] = arguments[_key];
493
537
  }
538
+
494
539
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
495
540
  };
541
+
496
542
  exports.insertLayout = insertLayout;
497
543
 
498
544
  /***/ }),
@@ -550,34 +596,47 @@ __webpack_require__.r(__webpack_exports__);
550
596
  /* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);
551
597
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3);
552
598
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
553
- /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(30);
599
+ /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(31);
554
600
  /* harmony import */ var _splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__);
555
601
  /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(54);
556
602
  /* harmony import */ var _splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__);
557
- /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(28);
603
+ /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(29);
558
604
  /* harmony import */ var _splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__);
559
- /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(50);
605
+ /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(49);
560
606
  /* harmony import */ var _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__);
561
607
 
608
+
562
609
  function ownKeys(object, enumerableOnly) {
563
610
  var keys = Object.keys(object);
611
+
564
612
  if (Object.getOwnPropertySymbols) {
565
613
  var symbols = Object.getOwnPropertySymbols(object);
566
- enumerableOnly && (symbols = symbols.filter(function (sym) {
614
+ if (enumerableOnly) symbols = symbols.filter(function (sym) {
567
615
  return Object.getOwnPropertyDescriptor(object, sym).enumerable;
568
- })), keys.push.apply(keys, symbols);
616
+ });
617
+ keys.push.apply(keys, symbols);
569
618
  }
619
+
570
620
  return keys;
571
621
  }
622
+
572
623
  function _objectSpread(target) {
573
624
  for (var i = 1; i < arguments.length; i++) {
574
- var source = null != arguments[i] ? arguments[i] : {};
575
- i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
576
- _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]);
577
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
578
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
579
- });
625
+ var source = arguments[i] != null ? arguments[i] : {};
626
+
627
+ if (i % 2) {
628
+ ownKeys(Object(source), true).forEach(function (key) {
629
+ _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]);
630
+ });
631
+ } else if (Object.getOwnPropertyDescriptors) {
632
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
633
+ } else {
634
+ ownKeys(Object(source)).forEach(function (key) {
635
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
636
+ });
637
+ }
580
638
  }
639
+
581
640
  return target;
582
641
  }
583
642
 
@@ -585,6 +644,7 @@ function _objectSpread(target) {
585
644
 
586
645
 
587
646
 
647
+
588
648
  var DEFAULT_FONT = 12;
589
649
  var DEFAULT_FONT_FAMILY = '"Splunk Platform Sans", "Proxima Nova", "Helvetica Neue", Helvetica, Arial, sans-serif';
590
650
  var SVR_PADDING = {
@@ -593,28 +653,27 @@ var SVR_PADDING = {
593
653
  left: 16,
594
654
  right: 16
595
655
  };
596
-
597
656
  /**
598
657
  * @method shouldShowTrend
599
658
  * @param {String} trendDisplay
600
659
  * @returns {Bool}
601
660
  */
661
+
602
662
  var shouldShowTrend = function shouldShowTrend(trendDisplay) {
603
663
  return trendDisplay === 'absolute' || trendDisplay === 'percent';
604
664
  };
605
-
606
665
  /**
607
666
  * @method isLoadingOrNoColumns
608
667
  * @param {Object} dataSources
609
668
  * @param {Boolean} loading
610
669
  * @returns {Boolean} return true if loading or without columns in dataSources
611
670
  */
671
+
612
672
  var isLoadingOrNoColumns = function isLoadingOrNoColumns(dataSources, loading) {
613
673
  var data = Object(lodash__WEBPACK_IMPORTED_MODULE_1__["get"])(dataSources, 'primary.data.columns[0]', undefined);
614
674
  var noColumns = data === undefined;
615
675
  return loading || noColumns;
616
676
  };
617
-
618
677
  /**
619
678
  * Retrieve the valid formatted color
620
679
  * @method getFormattedColor
@@ -622,30 +681,30 @@ var isLoadingOrNoColumns = function isLoadingOrNoColumns(dataSources, loading) {
622
681
  * @param {String} defaultColor
623
682
  * @returns {String} the formatted color
624
683
  */
684
+
625
685
  var getFormattedColor = function getFormattedColor(color, defaultColor) {
626
686
  return Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(color) || Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(defaultColor);
627
687
  };
628
-
629
688
  /**
630
689
  * Determines if there is a background color
631
690
  * @method hasBackground
632
691
  * @param {String} backgroundColor
633
692
  * @returns true for non-transparent background color
634
693
  */
694
+
635
695
  var hasBackground = function hasBackground(backgroundColor) {
636
696
  return !!backgroundColor && backgroundColor !== 'transparent';
637
697
  };
638
-
639
698
  /**
640
699
  * @method isIdenticalColor
641
700
  * @param {String} colorA
642
701
  * @param {String} colorB
643
702
  * @returns {Boolean}
644
703
  */
704
+
645
705
  var isIdenticalColor = function isIdenticalColor(colorA, colorB) {
646
706
  return !!colorA && !!colorB && Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(colorA.toLowerCase()) === Object(_splunk_visualizations_shared_propUtils__WEBPACK_IMPORTED_MODULE_4__["formatColor"])(colorB.toLowerCase());
647
707
  };
648
-
649
708
  /*
650
709
  * @method getDefaultColorWithBg
651
710
  * @param {Object} props
@@ -654,13 +713,13 @@ var isIdenticalColor = function isIdenticalColor(colorA, colorB) {
654
713
  * @param {String} props.defaultBlockFontColor
655
714
  * @returns {String} defaultColor
656
715
  */
716
+
657
717
  var getDefaultColorWithBg = function getDefaultColorWithBg(_ref) {
658
718
  var backgroundColor = _ref.backgroundColor,
659
- defaultFontColor = _ref.defaultFontColor,
660
- defaultBlockFontColor = _ref.defaultBlockFontColor;
719
+ defaultFontColor = _ref.defaultFontColor,
720
+ defaultBlockFontColor = _ref.defaultBlockFontColor;
661
721
  return isIdenticalColor(backgroundColor, defaultBlockFontColor) ? defaultFontColor : defaultBlockFontColor;
662
722
  };
663
-
664
723
  /*
665
724
  * @method getMajorColor
666
725
  * return formatted majorColor.
@@ -671,15 +730,16 @@ var getDefaultColorWithBg = function getDefaultColorWithBg(_ref) {
671
730
  * @param {String} props.defaultBlockFontColor
672
731
  * @returns {String} majorColor
673
732
  */
733
+
674
734
  var getMajorColor = function getMajorColor(_ref2) {
675
735
  var majorColor = _ref2.majorColor,
676
- backgroundColor = _ref2.backgroundColor,
677
- defaultFontColor = _ref2.defaultFontColor,
678
- defaultBlockFontColor = _ref2.defaultBlockFontColor;
679
- // If backgroundColor is set, but no majorColor,
736
+ backgroundColor = _ref2.backgroundColor,
737
+ defaultFontColor = _ref2.defaultFontColor,
738
+ defaultBlockFontColor = _ref2.defaultBlockFontColor; // If backgroundColor is set, but no majorColor,
680
739
  // the default majorColor will turn to be defaultBlockFontColor.
681
740
  // eg: major color will turn to be white in enterprise mode.
682
741
  // however, if the bgColor is the same as defaultBlockFontColor, use defaultFontColor.
742
+
683
743
  if (hasBackground(backgroundColor) && !majorColor) {
684
744
  return getDefaultColorWithBg({
685
745
  backgroundColor: backgroundColor,
@@ -687,9 +747,9 @@ var getMajorColor = function getMajorColor(_ref2) {
687
747
  defaultBlockFontColor: defaultBlockFontColor
688
748
  });
689
749
  }
750
+
690
751
  return getFormattedColor(majorColor, defaultFontColor);
691
752
  };
692
-
693
753
  /**
694
754
  * Get the color for the trend components
695
755
  * @method getTrendColor
@@ -702,35 +762,41 @@ var getMajorColor = function getMajorColor(_ref2) {
702
762
  * @param {Object} defaultColors
703
763
  * @returns {String} trendColor
704
764
  */
765
+
705
766
  var getTrendColor = function getTrendColor(_ref3) {
706
767
  var trendColor = _ref3.trendColor,
707
- trendValue = _ref3.trendValue,
708
- majorValue = _ref3.majorValue,
709
- customizedBgColor = _ref3.customizedBgColor,
710
- trendDisplay = _ref3.trendDisplay,
711
- defaultColors = _ref3.defaultColors;
768
+ trendValue = _ref3.trendValue,
769
+ majorValue = _ref3.majorValue,
770
+ customizedBgColor = _ref3.customizedBgColor,
771
+ trendDisplay = _ref3.trendDisplay,
772
+ defaultColors = _ref3.defaultColors;
773
+
712
774
  if (trendColor) {
713
775
  return trendColor;
714
776
  }
777
+
715
778
  if (Number.isNaN(Number(trendValue))) {
716
779
  return undefined;
717
780
  }
781
+
718
782
  var defaultFontColor = defaultColors.defaultFontColor,
719
- defaultBlockFontColor = defaultColors.defaultBlockFontColor,
720
- defaultBackgroundColor = defaultColors.defaultBackgroundColor; // if user defined a backgroundColor, the default trend color will be defaultBlockFontColor
783
+ defaultBlockFontColor = defaultColors.defaultBlockFontColor,
784
+ defaultBackgroundColor = defaultColors.defaultBackgroundColor; // if user defined a backgroundColor, the default trend color will be defaultBlockFontColor
785
+
721
786
  if (hasBackground(customizedBgColor) && !isIdenticalColor(customizedBgColor, defaultBackgroundColor) && !isIdenticalColor(customizedBgColor, defaultBlockFontColor)) {
722
787
  return defaultBlockFontColor;
723
- }
724
-
725
- // if trendDisplay is percent, and trendValue === value
788
+ } // if trendDisplay is percent, and trendValue === value
726
789
  // the trend percent = trendValue / (value - trendValue) will return Infinity
790
+
791
+
727
792
  var isInvalidTrend = trendDisplay === 'percent' && trendValue === parseFloat(majorValue);
793
+
728
794
  if (trendValue === 0 || isInvalidTrend) {
729
795
  return defaultFontColor;
730
796
  }
797
+
731
798
  return trendValue > 0 ? _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__["DELTA_GREEN"] : _splunk_visualizations_shared_colorConstants__WEBPACK_IMPORTED_MODULE_5__["DELTA_RED"];
732
799
  };
733
-
734
800
  /**
735
801
  * Computes visualization properties for display component
736
802
  * @method computeColors
@@ -743,6 +809,7 @@ var getTrendColor = function getTrendColor(_ref3) {
743
809
  * @returns {String} trendColor
744
810
  * @returns {String} underLabelColor
745
811
  */
812
+
746
813
  var computeColors = function computeColors(props, defaultColors) {
747
814
  var backgroundColor = getFormattedColor(props.backgroundColor, defaultColors.defaultBackgroundColor);
748
815
  var backgroundEnabled = hasBackground(backgroundColor);
@@ -759,8 +826,8 @@ var computeColors = function computeColors(props, defaultColors) {
759
826
  customizedBgColor: props.backgroundColor,
760
827
  trendDisplay: props.trendDisplay,
761
828
  defaultColors: defaultColors
762
- });
763
- // todo: need change it to not depend on majorColor
829
+ }); // todo: need change it to not depend on majorColor
830
+
764
831
  var underLabelColor = majorColor;
765
832
  return {
766
833
  backgroundColor: backgroundColor,
@@ -770,7 +837,6 @@ var computeColors = function computeColors(props, defaultColors) {
770
837
  underLabelColor: underLabelColor
771
838
  };
772
839
  };
773
-
774
840
  /**
775
841
  * Format and return the value (major/trend)
776
842
  * @method computeText
@@ -781,21 +847,21 @@ var computeColors = function computeColors(props, defaultColors) {
781
847
  * @param {Bool} props.shouldAbbreviateTrendValue
782
848
  * @returns {Number} major or trend text
783
849
  */
850
+
784
851
  var computeText = function computeText(_ref4) {
785
852
  var value = _ref4.value,
786
- numberPrecision = _ref4.numberPrecision,
787
- shouldUseThousandSeparators = _ref4.shouldUseThousandSeparators,
788
- shouldAbbreviateTrendValue = _ref4.shouldAbbreviateTrendValue;
853
+ numberPrecision = _ref4.numberPrecision,
854
+ shouldUseThousandSeparators = _ref4.shouldUseThousandSeparators,
855
+ shouldAbbreviateTrendValue = _ref4.shouldAbbreviateTrendValue;
789
856
  var text = Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(value) ? Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["formatNumber"])(value, numberPrecision, {
790
857
  useThousandSeparators: shouldUseThousandSeparators,
791
858
  // todo: need update formatNumber
792
859
  useTrendUnits: shouldAbbreviateTrendValue
793
- }) : value;
794
- // When text is undefined, return empty string
860
+ }) : value; // When text is undefined, return empty string
861
+
795
862
  text = text || '';
796
863
  return text;
797
864
  };
798
-
799
865
  /*
800
866
  * @method getMajorText
801
867
  * @param {Object} props
@@ -804,10 +870,11 @@ var computeText = function computeText(_ref4) {
804
870
  * @param {Bool} props.shouldUseThousandSeparators
805
871
  * @returns {String} majorText
806
872
  */
873
+
807
874
  var getMajorText = function getMajorText(_ref5) {
808
875
  var majorValue = _ref5.majorValue,
809
- numberPrecision = _ref5.numberPrecision,
810
- shouldUseThousandSeparators = _ref5.shouldUseThousandSeparators;
876
+ numberPrecision = _ref5.numberPrecision,
877
+ shouldUseThousandSeparators = _ref5.shouldUseThousandSeparators;
811
878
  return computeText({
812
879
  value: majorValue === null ? 'N/A' : majorValue,
813
880
  // if majorValue is null, use `N/A`.
@@ -816,7 +883,6 @@ var getMajorText = function getMajorText(_ref5) {
816
883
  shouldAbbreviateTrendValue: false
817
884
  });
818
885
  };
819
-
820
886
  /*
821
887
  * @method getTrendText
822
888
  * @param {Object} props
@@ -828,13 +894,15 @@ var getMajorText = function getMajorText(_ref5) {
828
894
  * @param {Bool} props.shouldAbbreviateTrendValue
829
895
  * @returns {String} trendText
830
896
  */
897
+
831
898
  var getTrendText = function getTrendText(_ref6) {
832
899
  var majorValue = _ref6.majorValue,
833
- trendValue = _ref6.trendValue,
834
- trendDisplay = _ref6.trendDisplay,
835
- numberPrecision = _ref6.numberPrecision,
836
- shouldUseThousandSeparators = _ref6.shouldUseThousandSeparators,
837
- shouldAbbreviateTrendValue = _ref6.shouldAbbreviateTrendValue;
900
+ trendValue = _ref6.trendValue,
901
+ trendDisplay = _ref6.trendDisplay,
902
+ numberPrecision = _ref6.numberPrecision,
903
+ shouldUseThousandSeparators = _ref6.shouldUseThousandSeparators,
904
+ shouldAbbreviateTrendValue = _ref6.shouldAbbreviateTrendValue;
905
+
838
906
  var compute = function compute(value) {
839
907
  return computeText({
840
908
  value: value,
@@ -843,25 +911,31 @@ var getTrendText = function getTrendText(_ref6) {
843
911
  shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
844
912
  });
845
913
  };
914
+
846
915
  if (trendValue === '' || !Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(trendValue)) {
847
916
  return '';
848
917
  }
918
+
849
919
  var showPercent = trendDisplay === 'percent';
920
+
850
921
  if (!showPercent) {
851
922
  return compute(trendValue);
852
923
  }
924
+
853
925
  var diff = Math.abs(trendValue - majorValue);
854
926
  var val = Math.round(trendValue / diff * 100);
927
+
855
928
  if (trendValue === 0 && diff === 0) {
856
929
  val = 0;
857
930
  }
931
+
858
932
  if (!Number.isFinite(val)) {
859
933
  return 'N/A';
860
934
  }
935
+
861
936
  var text = compute(val);
862
937
  return "".concat(text, "%");
863
938
  };
864
-
865
939
  /**
866
940
  * Helper to determine the font size for an element
867
941
  * @method computeFontSize
@@ -873,16 +947,16 @@ var getTrendText = function getTrendText(_ref6) {
873
947
  * @param {String} [fontWeight='normal'] Boldness of font
874
948
  * @returns {Number} The size to use for fontSize styles
875
949
  */
950
+
876
951
  var computeFontSize = function computeFontSize(text, _ref7) {
877
952
  var width = _ref7.width,
878
- height = _ref7.height;
953
+ height = _ref7.height;
879
954
  var fontFamily = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DEFAULT_FONT_FAMILY;
880
955
  var fontWeight = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'normal';
881
956
  var widthInDefaultFont = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(text, "".concat(fontWeight, " ").concat(DEFAULT_FONT, "px ").concat(fontFamily));
882
957
  var fontSize = Math.min(width / widthInDefaultFont * DEFAULT_FONT, height / DEFAULT_FONT * DEFAULT_FONT);
883
958
  return parseInt(fontSize, 10);
884
959
  };
885
-
886
960
  /*
887
961
  * @method getMajorFontSize
888
962
  * @param {Object} props
@@ -893,20 +967,20 @@ var computeFontSize = function computeFontSize(text, _ref7) {
893
967
  * @param {Number} props.spaceRatio
894
968
  * @returns {Number} majorFontSize
895
969
  */
970
+
896
971
  var getMajorFontSize = function getMajorFontSize(_ref8) {
897
972
  var width = _ref8.width,
898
- height = _ref8.height,
899
- unit = _ref8.unit,
900
- majorText = _ref8.majorText,
901
- _ref8$spaceRatio = _ref8.spaceRatio,
902
- spaceRatio = _ref8$spaceRatio === void 0 ? 1 : _ref8$spaceRatio;
973
+ height = _ref8.height,
974
+ unit = _ref8.unit,
975
+ majorText = _ref8.majorText,
976
+ _ref8$spaceRatio = _ref8.spaceRatio,
977
+ spaceRatio = _ref8$spaceRatio === void 0 ? 1 : _ref8$spaceRatio;
903
978
  var majorTextCalc = unit ? "".concat(unit).concat(majorText) : majorText;
904
979
  return computeFontSize(majorTextCalc, {
905
980
  width: width * spaceRatio,
906
981
  height: height
907
982
  });
908
983
  };
909
-
910
984
  /*
911
985
  * @method getTrendFontSize
912
986
  * @param {Object} props
@@ -916,13 +990,15 @@ var getMajorFontSize = function getMajorFontSize(_ref8) {
916
990
  * @param {Number} props.spaceRatio
917
991
  * @returns {Number} trendFontSize
918
992
  */
993
+
919
994
  var getTrendFontSize = function getTrendFontSize(_ref9) {
920
995
  var width = _ref9.width,
921
- height = _ref9.height,
922
- trendText = _ref9.trendText,
923
- _ref9$spaceRatio = _ref9.spaceRatio,
924
- spaceRatio = _ref9$spaceRatio === void 0 ? 1 : _ref9$spaceRatio;
996
+ height = _ref9.height,
997
+ trendText = _ref9.trendText,
998
+ _ref9$spaceRatio = _ref9.spaceRatio,
999
+ spaceRatio = _ref9$spaceRatio === void 0 ? 1 : _ref9$spaceRatio;
925
1000
  var trendFontSize = 12;
1001
+
926
1002
  if (spaceRatio > 0) {
927
1003
  trendFontSize = computeFontSize(trendText, {
928
1004
  width: width * spaceRatio,
@@ -930,18 +1006,18 @@ var getTrendFontSize = function getTrendFontSize(_ref9) {
930
1006
  });
931
1007
  trendFontSize = parseInt(trendFontSize, 10) * spaceRatio;
932
1008
  }
1009
+
933
1010
  return trendFontSize;
934
1011
  };
935
-
936
1012
  /*
937
1013
  * The height of underLabel should no more than 12px
938
1014
  * @param {Number} height
939
1015
  * @return {Number} height || DEFAULT_FONT
940
1016
  */
1017
+
941
1018
  var getUnderLabelHeight = function getUnderLabelHeight(height) {
942
1019
  return height > DEFAULT_FONT ? DEFAULT_FONT : height;
943
1020
  };
944
-
945
1021
  /*
946
1022
  * @param {Object} config
947
1023
  * @param {String} underLabel
@@ -949,19 +1025,18 @@ var getUnderLabelHeight = function getUnderLabelHeight(height) {
949
1025
  * @param {Number} height height of underLabel
950
1026
  * @param {Number} fond size of underLabel
951
1027
  */
1028
+
952
1029
  var getUnderLabel = function getUnderLabel(_ref10) {
953
1030
  var underLabel = _ref10.underLabel,
954
- width = _ref10.width,
955
- height = _ref10.height;
956
- return (
957
- // todo: may need truncate underLabel later
1031
+ width = _ref10.width,
1032
+ height = _ref10.height;
1033
+ return (// todo: may need truncate underLabel later
958
1034
  computeFontSize(underLabel, {
959
1035
  width: width,
960
1036
  height: height
961
1037
  })
962
1038
  );
963
1039
  };
964
-
965
1040
  /**
966
1041
  * Compute value and font size for major and trend
967
1042
  * @method getMajorAndTrend
@@ -979,18 +1054,19 @@ var getUnderLabel = function getUnderLabel(_ref10) {
979
1054
  * @param {Bool} props.shouldAbbreviateTrendValue
980
1055
  * @returns {Number, Number, Number, Number} Major text, trend text, major text size, trend text size
981
1056
  */
1057
+
982
1058
  var getMajorAndTrend = function getMajorAndTrend(_ref11) {
983
1059
  var width = _ref11.width,
984
- height = _ref11.height,
985
- majorValue = _ref11.majorValue,
986
- trendValue = _ref11.trendValue,
987
- majorFontSize = _ref11.majorFontSize,
988
- trendFontSize = _ref11.trendFontSize,
989
- trendDisplay = _ref11.trendDisplay,
990
- unit = _ref11.unit,
991
- numberPrecision = _ref11.numberPrecision,
992
- shouldUseThousandSeparators = _ref11.shouldUseThousandSeparators,
993
- shouldAbbreviateTrendValue = _ref11.shouldAbbreviateTrendValue;
1060
+ height = _ref11.height,
1061
+ majorValue = _ref11.majorValue,
1062
+ trendValue = _ref11.trendValue,
1063
+ majorFontSize = _ref11.majorFontSize,
1064
+ trendFontSize = _ref11.trendFontSize,
1065
+ trendDisplay = _ref11.trendDisplay,
1066
+ unit = _ref11.unit,
1067
+ numberPrecision = _ref11.numberPrecision,
1068
+ shouldUseThousandSeparators = _ref11.shouldUseThousandSeparators,
1069
+ shouldAbbreviateTrendValue = _ref11.shouldAbbreviateTrendValue;
994
1070
  var majorTextSpaceRatio = Object(_splunk_visualizations_shared_numberUtils__WEBPACK_IMPORTED_MODULE_2__["isNumerial"])(trendValue) && shouldShowTrend(trendDisplay) ? 0.6 : 1;
995
1071
  var textContentWidth = width * 0.9;
996
1072
  var textContentHeight = height * 0.9;
@@ -1027,7 +1103,6 @@ var getMajorAndTrend = function getMajorAndTrend(_ref11) {
1027
1103
  trendTextFontSize: trendTextFontSize
1028
1104
  };
1029
1105
  };
1030
-
1031
1106
  /*
1032
1107
  * @method updateVizInSmallSpace
1033
1108
  * @param {Object} props
@@ -1047,25 +1122,26 @@ var getMajorAndTrend = function getMajorAndTrend(_ref11) {
1047
1122
  * @returns {Object} results.newMajorAndTrend
1048
1123
  * @returns {Object} results.updatedProps
1049
1124
  */
1125
+
1050
1126
  var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
1051
1127
  var width = _ref12.width,
1052
- height = _ref12.height,
1053
- toRemoveList = _ref12.toRemoveList,
1054
- majorValue = _ref12.majorValue,
1055
- trendValue = _ref12.trendValue,
1056
- majorFontSize = _ref12.majorFontSize,
1057
- trendFontSize = _ref12.trendFontSize,
1058
- majorTextFontSize = _ref12.majorTextFontSize,
1059
- unit = _ref12.unit,
1060
- numberPrecision = _ref12.numberPrecision,
1061
- shouldUseThousandSeparators = _ref12.shouldUseThousandSeparators,
1062
- shouldAbbreviateTrendValue = _ref12.shouldAbbreviateTrendValue;
1128
+ height = _ref12.height,
1129
+ toRemoveList = _ref12.toRemoveList,
1130
+ majorValue = _ref12.majorValue,
1131
+ trendValue = _ref12.trendValue,
1132
+ majorFontSize = _ref12.majorFontSize,
1133
+ trendFontSize = _ref12.trendFontSize,
1134
+ majorTextFontSize = _ref12.majorTextFontSize,
1135
+ unit = _ref12.unit,
1136
+ numberPrecision = _ref12.numberPrecision,
1137
+ shouldUseThousandSeparators = _ref12.shouldUseThousandSeparators,
1138
+ shouldAbbreviateTrendValue = _ref12.shouldAbbreviateTrendValue;
1063
1139
  var removeIndex = 0;
1064
1140
  var newProps = {}; // options need to be updated
1141
+
1065
1142
  var newMajorAndTrend = {};
1066
- var newTextSize = majorTextFontSize;
1143
+ var newTextSize = majorTextFontSize; // remove info on viz to make textFontSize >= 12px;
1067
1144
 
1068
- // remove info on viz to make textFontSize >= 12px;
1069
1145
  while (newTextSize < 12 && removeIndex < toRemoveList.length) {
1070
1146
  var toRemove = toRemoveList[removeIndex];
1071
1147
  newProps = _objectSpread(_objectSpread({}, newProps), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()({}, toRemove.key, toRemove.value));
@@ -1083,9 +1159,9 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
1083
1159
  }, newProps));
1084
1160
  newTextSize = newMajorAndTrend.majorTextFontSize;
1085
1161
  removeIndex += 1;
1086
- }
1162
+ } // truncate text if textFontSize is still less than 12
1163
+
1087
1164
 
1088
- // truncate text if textFontSize is still less than 12
1089
1165
  if (newTextSize < 12) {
1090
1166
  var truncateValue = "".concat(majorValue.toString().slice(0, 3), "...");
1091
1167
  newMajorAndTrend = getMajorAndTrend(_objectSpread({
@@ -1101,12 +1177,12 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
1101
1177
  shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1102
1178
  }, newProps));
1103
1179
  }
1180
+
1104
1181
  return {
1105
1182
  newMajorAndTrend: newMajorAndTrend,
1106
1183
  updatedProps: newProps
1107
1184
  };
1108
1185
  };
1109
-
1110
1186
  /*
1111
1187
  * @method computeSingleValueContent
1112
1188
  * @param {Object} props
@@ -1132,67 +1208,71 @@ var updateVizInSmallSpace = function updateVizInSmallSpace(_ref12) {
1132
1208
  * @returns {String} results.majorValueTitle
1133
1209
  * @returns {Object} results.smallVizProps
1134
1210
  */
1211
+
1135
1212
  var computeSingleValueContent = function computeSingleValueContent(_ref13) {
1136
1213
  var contentWidth = _ref13.contentWidth,
1137
- contentHeight = _ref13.contentHeight,
1138
- containerWidth = _ref13.containerWidth,
1139
- containerHeight = _ref13.containerHeight,
1140
- majorValue = _ref13.majorValue,
1141
- trendValue = _ref13.trendValue,
1142
- majorFontSize = _ref13.majorFontSize,
1143
- trendFontSize = _ref13.trendFontSize,
1144
- trendDisplay = _ref13.trendDisplay,
1145
- unit = _ref13.unit,
1146
- numberPrecision = _ref13.numberPrecision,
1147
- shouldUseThousandSeparators = _ref13.shouldUseThousandSeparators,
1148
- shouldAbbreviateTrendValue = _ref13.shouldAbbreviateTrendValue,
1149
- toRemoveList = _ref13.toRemoveList;
1214
+ contentHeight = _ref13.contentHeight,
1215
+ containerWidth = _ref13.containerWidth,
1216
+ containerHeight = _ref13.containerHeight,
1217
+ majorValue = _ref13.majorValue,
1218
+ trendValue = _ref13.trendValue,
1219
+ majorFontSize = _ref13.majorFontSize,
1220
+ trendFontSize = _ref13.trendFontSize,
1221
+ trendDisplay = _ref13.trendDisplay,
1222
+ unit = _ref13.unit,
1223
+ numberPrecision = _ref13.numberPrecision,
1224
+ shouldUseThousandSeparators = _ref13.shouldUseThousandSeparators,
1225
+ shouldAbbreviateTrendValue = _ref13.shouldAbbreviateTrendValue,
1226
+ toRemoveList = _ref13.toRemoveList;
1227
+
1150
1228
  var _getMajorAndTrend = getMajorAndTrend({
1229
+ majorValue: majorValue,
1230
+ trendValue: trendValue,
1231
+ majorFontSize: majorFontSize,
1232
+ trendFontSize: trendFontSize,
1233
+ trendDisplay: trendDisplay,
1234
+ width: contentWidth,
1235
+ height: contentHeight,
1236
+ unit: unit,
1237
+ numberPrecision: numberPrecision,
1238
+ shouldUseThousandSeparators: shouldUseThousandSeparators,
1239
+ shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1240
+ }),
1241
+ majorText = _getMajorAndTrend.majorText,
1242
+ trendText = _getMajorAndTrend.trendText,
1243
+ majorTextFontSize = _getMajorAndTrend.majorTextFontSize,
1244
+ trendTextFontSize = _getMajorAndTrend.trendTextFontSize;
1245
+
1246
+ var majorValueTitle = majorText;
1247
+ var smallVizProps = {}; // update viz in small space
1248
+ // if textFontSize is less than 12, remove extra info like sparkline, trendvalue, unit
1249
+ // or truncate major value to make the major font size >= 12
1250
+
1251
+ if (majorTextFontSize < 12) {
1252
+ var _updateVizInSmallSpac = updateVizInSmallSpace({
1253
+ width: containerWidth,
1254
+ height: containerHeight,
1255
+ toRemoveList: toRemoveList,
1151
1256
  majorValue: majorValue,
1152
1257
  trendValue: trendValue,
1153
1258
  majorFontSize: majorFontSize,
1154
1259
  trendFontSize: trendFontSize,
1155
- trendDisplay: trendDisplay,
1156
- width: contentWidth,
1157
- height: contentHeight,
1260
+ majorTextFontSize: majorTextFontSize,
1158
1261
  unit: unit,
1159
1262
  numberPrecision: numberPrecision,
1160
1263
  shouldUseThousandSeparators: shouldUseThousandSeparators,
1161
1264
  shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1162
1265
  }),
1163
- majorText = _getMajorAndTrend.majorText,
1164
- trendText = _getMajorAndTrend.trendText,
1165
- majorTextFontSize = _getMajorAndTrend.majorTextFontSize,
1166
- trendTextFontSize = _getMajorAndTrend.trendTextFontSize;
1167
- var majorValueTitle = majorText;
1168
- var smallVizProps = {};
1266
+ newMajorAndTrend = _updateVizInSmallSpac.newMajorAndTrend,
1267
+ updatedProps = _updateVizInSmallSpac.updatedProps;
1169
1268
 
1170
- // update viz in small space
1171
- // if textFontSize is less than 12, remove extra info like sparkline, trendvalue, unit
1172
- // or truncate major value to make the major font size >= 12
1173
- if (majorTextFontSize < 12) {
1174
- var _updateVizInSmallSpac = updateVizInSmallSpace({
1175
- width: containerWidth,
1176
- height: containerHeight,
1177
- toRemoveList: toRemoveList,
1178
- majorValue: majorValue,
1179
- trendValue: trendValue,
1180
- majorFontSize: majorFontSize,
1181
- trendFontSize: trendFontSize,
1182
- majorTextFontSize: majorTextFontSize,
1183
- unit: unit,
1184
- numberPrecision: numberPrecision,
1185
- shouldUseThousandSeparators: shouldUseThousandSeparators,
1186
- shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1187
- }),
1188
- newMajorAndTrend = _updateVizInSmallSpac.newMajorAndTrend,
1189
- updatedProps = _updateVizInSmallSpac.updatedProps;
1190
1269
  majorText = newMajorAndTrend.majorText;
1191
1270
  trendText = newMajorAndTrend.trendText;
1192
1271
  majorTextFontSize = newMajorAndTrend.majorTextFontSize;
1193
1272
  trendTextFontSize = newMajorAndTrend.trendTextFontSize;
1194
1273
  smallVizProps = updatedProps;
1195
1274
  }
1275
+
1196
1276
  return {
1197
1277
  majorText: majorText,
1198
1278
  trendText: trendText,
@@ -1204,17 +1284,17 @@ var computeSingleValueContent = function computeSingleValueContent(_ref13) {
1204
1284
  };
1205
1285
  var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_ref14) {
1206
1286
  var text = _ref14.text,
1207
- _ref14$fontSize = _ref14.fontSize,
1208
- fontSize = _ref14$fontSize === void 0 ? DEFAULT_FONT : _ref14$fontSize,
1209
- _ref14$fontFamily = _ref14.fontFamily,
1210
- fontFamily = _ref14$fontFamily === void 0 ? DEFAULT_FONT_FAMILY : _ref14$fontFamily,
1211
- _ref14$fontWeight = _ref14.fontWeight,
1212
- fontWeight = _ref14$fontWeight === void 0 ? 'normal' : _ref14$fontWeight,
1213
- containerWidth = _ref14.containerWidth;
1287
+ _ref14$fontSize = _ref14.fontSize,
1288
+ fontSize = _ref14$fontSize === void 0 ? DEFAULT_FONT : _ref14$fontSize,
1289
+ _ref14$fontFamily = _ref14.fontFamily,
1290
+ fontFamily = _ref14$fontFamily === void 0 ? DEFAULT_FONT_FAMILY : _ref14$fontFamily,
1291
+ _ref14$fontWeight = _ref14.fontWeight,
1292
+ fontWeight = _ref14$fontWeight === void 0 ? 'normal' : _ref14$fontWeight,
1293
+ containerWidth = _ref14.containerWidth;
1214
1294
  var textWidth = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(text, "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily));
1215
1295
  var modifiedText = text;
1216
- var ellipsesLength = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])('...', "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily));
1217
- // `containerWidth - ellipsesLength > 0` condition ensures space even exists for text.
1296
+ var ellipsesLength = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])('...', "".concat(fontWeight, " ").concat(fontSize, "px ").concat(fontFamily)); // `containerWidth - ellipsesLength > 0` condition ensures space even exists for text.
1297
+
1218
1298
  if (containerWidth - ellipsesLength > 0 && textWidth > containerWidth) {
1219
1299
  // Truncates the content such that the truncated value + ellipses fit within the allocated space for the ellipses.
1220
1300
  // `textWidth > containerWidth - ellipsesLength` condition checks if text + ellipses exceeds container width.
@@ -1223,11 +1303,12 @@ var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_re
1223
1303
  modifiedText = modifiedText.substring(0, modifiedText.length - 1);
1224
1304
  textWidth = Object(_splunk_visualizations_shared_domUtils__WEBPACK_IMPORTED_MODULE_3__["computeTextSize"])(modifiedText, "normal ".concat(fontSize, "px ").concat(fontFamily));
1225
1305
  }
1306
+
1226
1307
  modifiedText = "".concat(modifiedText, "...");
1227
1308
  }
1309
+
1228
1310
  return modifiedText;
1229
1311
  };
1230
-
1231
1312
  /*
1232
1313
  * @method computeSingleValueRadialContent
1233
1314
  * @param {Object} props
@@ -1254,44 +1335,46 @@ var minimallyTruncateStringToWidth = function minimallyTruncateStringToWidth(_re
1254
1335
  * @returns {String} results.majorValueTitle
1255
1336
  * @returns {Object} results.smallVizProps
1256
1337
  */
1338
+
1257
1339
  var computeSingleValueRadialContent = function computeSingleValueRadialContent(_ref15) {
1258
1340
  var contentWidth = _ref15.contentWidth,
1259
- contentHeight = _ref15.contentHeight,
1260
- containerWidth = _ref15.containerWidth,
1261
- containerHeight = _ref15.containerHeight,
1262
- majorValue = _ref15.majorValue,
1263
- trendValue = _ref15.trendValue,
1264
- majorFontSize = _ref15.majorFontSize,
1265
- trendFontSize = _ref15.trendFontSize,
1266
- trendDisplay = _ref15.trendDisplay,
1267
- unit = _ref15.unit,
1268
- numberPrecision = _ref15.numberPrecision,
1269
- shouldUseThousandSeparators = _ref15.shouldUseThousandSeparators,
1270
- shouldAbbreviateTrendValue = _ref15.shouldAbbreviateTrendValue,
1271
- smallViz = _ref15.smallViz;
1341
+ contentHeight = _ref15.contentHeight,
1342
+ containerWidth = _ref15.containerWidth,
1343
+ containerHeight = _ref15.containerHeight,
1344
+ majorValue = _ref15.majorValue,
1345
+ trendValue = _ref15.trendValue,
1346
+ majorFontSize = _ref15.majorFontSize,
1347
+ trendFontSize = _ref15.trendFontSize,
1348
+ trendDisplay = _ref15.trendDisplay,
1349
+ unit = _ref15.unit,
1350
+ numberPrecision = _ref15.numberPrecision,
1351
+ shouldUseThousandSeparators = _ref15.shouldUseThousandSeparators,
1352
+ shouldAbbreviateTrendValue = _ref15.shouldAbbreviateTrendValue,
1353
+ smallViz = _ref15.smallViz;
1354
+
1272
1355
  var _getMajorAndTrend2 = getMajorAndTrend({
1273
- majorValue: majorValue,
1274
- trendValue: trendValue,
1275
- majorFontSize: majorFontSize,
1276
- trendFontSize: trendFontSize,
1277
- trendDisplay: trendDisplay,
1278
- width: contentWidth,
1279
- height: contentHeight,
1280
- unit: unit,
1281
- numberPrecision: numberPrecision,
1282
- shouldUseThousandSeparators: shouldUseThousandSeparators,
1283
- shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1284
- }),
1285
- majorText = _getMajorAndTrend2.majorText,
1286
- trendText = _getMajorAndTrend2.trendText,
1287
- majorTextFontSize = _getMajorAndTrend2.majorTextFontSize,
1288
- trendTextFontSize = _getMajorAndTrend2.trendTextFontSize;
1289
- var majorValueTitle = majorText;
1290
- var smallVizProps = {};
1356
+ majorValue: majorValue,
1357
+ trendValue: trendValue,
1358
+ majorFontSize: majorFontSize,
1359
+ trendFontSize: trendFontSize,
1360
+ trendDisplay: trendDisplay,
1361
+ width: contentWidth,
1362
+ height: contentHeight,
1363
+ unit: unit,
1364
+ numberPrecision: numberPrecision,
1365
+ shouldUseThousandSeparators: shouldUseThousandSeparators,
1366
+ shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1367
+ }),
1368
+ majorText = _getMajorAndTrend2.majorText,
1369
+ trendText = _getMajorAndTrend2.trendText,
1370
+ majorTextFontSize = _getMajorAndTrend2.majorTextFontSize,
1371
+ trendTextFontSize = _getMajorAndTrend2.trendTextFontSize;
1291
1372
 
1292
- // custom logic for viz in small space
1373
+ var majorValueTitle = majorText;
1374
+ var smallVizProps = {}; // custom logic for viz in small space
1293
1375
  // if not showing the radial graph (if `smallViz` is true), then compute truncated major value
1294
1376
  // and font sizes
1377
+
1295
1378
  if (smallViz) {
1296
1379
  var truncateValue = minimallyTruncateStringToWidth({
1297
1380
  text: majorValue,
@@ -1299,6 +1382,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
1299
1382
  fontSize: 12,
1300
1383
  containerWidth: containerWidth
1301
1384
  });
1385
+
1302
1386
  var _getMajorAndTrend3 = getMajorAndTrend({
1303
1387
  majorValue: truncateValue,
1304
1388
  trendValue: trendValue,
@@ -1312,6 +1396,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
1312
1396
  shouldUseThousandSeparators: shouldUseThousandSeparators,
1313
1397
  shouldAbbreviateTrendValue: shouldAbbreviateTrendValue
1314
1398
  });
1399
+
1315
1400
  majorText = _getMajorAndTrend3.majorText;
1316
1401
  trendText = _getMajorAndTrend3.trendText;
1317
1402
  majorTextFontSize = _getMajorAndTrend3.majorTextFontSize;
@@ -1321,6 +1406,7 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
1321
1406
  unit: unit
1322
1407
  };
1323
1408
  }
1409
+
1324
1410
  return {
1325
1411
  majorText: majorText,
1326
1412
  trendText: trendText,
@@ -1330,7 +1416,6 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
1330
1416
  smallVizProps: smallVizProps
1331
1417
  };
1332
1418
  };
1333
-
1334
1419
  /**
1335
1420
  * Get the colors for a graph
1336
1421
  *
@@ -1343,21 +1428,22 @@ var computeSingleValueRadialContent = function computeSingleValueRadialContent(_
1343
1428
  * @returns {Object} { background, stroke } colors
1344
1429
  * @private
1345
1430
  */
1431
+
1346
1432
  var getGraphColors = function getGraphColors(_ref16) {
1347
1433
  var backgroundEnabled = _ref16.backgroundEnabled,
1348
- backgroundColor = _ref16.backgroundColor,
1349
- defaultColors = _ref16.defaultColors,
1350
- customColorFormatter = _ref16.customColorFormatter;
1351
- // Only do custom colors in block mode
1434
+ backgroundColor = _ref16.backgroundColor,
1435
+ defaultColors = _ref16.defaultColors,
1436
+ customColorFormatter = _ref16.customColorFormatter; // Only do custom colors in block mode
1437
+
1352
1438
  if (backgroundEnabled) {
1353
1439
  // Check if the user defined colors to use
1354
1440
  if (backgroundColor && typeof customColorFormatter === 'function') {
1355
1441
  return customColorFormatter(backgroundColor);
1356
1442
  }
1357
1443
  }
1444
+
1358
1445
  return defaultColors.none;
1359
1446
  };
1360
-
1361
1447
  /**
1362
1448
  * Adjust rgb value if it equals to 0 or 255
1363
1449
  * @method adjustRGB
@@ -1366,16 +1452,18 @@ var getGraphColors = function getGraphColors(_ref16) {
1366
1452
  * @returns {Number} adjusted rgb
1367
1453
  * @private
1368
1454
  */
1455
+
1369
1456
  var adjustRGB = function adjustRGB(rgb, delta) {
1370
1457
  if (rgb === 255) {
1371
1458
  return rgb - delta;
1372
1459
  }
1460
+
1373
1461
  if (rgb === 0) {
1374
1462
  return rgb + delta;
1375
1463
  }
1464
+
1376
1465
  return rgb;
1377
1466
  };
1378
-
1379
1467
  /**
1380
1468
  * Modifies colors by multiplying by a given ratio
1381
1469
  * @method changeColor
@@ -1384,18 +1472,16 @@ var adjustRGB = function adjustRGB(rgb, delta) {
1384
1472
  * @returns {String} new color
1385
1473
  * @private
1386
1474
  */
1475
+
1387
1476
  var changeColor = function changeColor(color, ratio) {
1388
1477
  var hex = color.replace(/(0x|#)/, '');
1389
1478
  var r = parseInt(hex.substr(0, 2), 16);
1390
1479
  var g = parseInt(hex.substr(2, 2), 16);
1391
- var b = parseInt(hex.substr(4, 2), 16);
1480
+ var b = parseInt(hex.substr(4, 2), 16); // Multiply by given ratio, make sure is between 0 and 255;
1392
1481
 
1393
- // Multiply by given ratio, make sure is between 0 and 255;
1394
1482
  var newR = Math.max(Math.min(Math.floor(r * ratio), 255), 0);
1395
1483
  var newG = Math.max(Math.min(Math.floor(g * ratio), 255), 0);
1396
- var newB = Math.max(Math.min(Math.floor(b * ratio), 255), 0);
1397
-
1398
- // If the color is not changed
1484
+ var newB = Math.max(Math.min(Math.floor(b * ratio), 255), 0); // If the color is not changed
1399
1485
  // case 1: the color is (0, 0 0)
1400
1486
  // lighten color (80, 80, 80)
1401
1487
  // darken color (40, 40, 40)
@@ -1404,6 +1490,7 @@ var changeColor = function changeColor(color, ratio) {
1404
1490
  // darken color (175, 175, 175)
1405
1491
  // case 3: the color is e.g. (0, 255, 0)
1406
1492
  // new color (20, 235, 20)
1493
+
1407
1494
  if (newR === r && newG === g && newB === b) {
1408
1495
  if (newR === 0 && newG === 0 && newB === 0) {
1409
1496
  if (ratio > 1) {
@@ -1431,9 +1518,9 @@ var changeColor = function changeColor(color, ratio) {
1431
1518
  newB = adjustRGB(newB, 20);
1432
1519
  }
1433
1520
  }
1521
+
1434
1522
  return "#".concat(newR.toString(16).padStart(2, 0)) + "".concat(newG.toString(16).padStart(2, 0)) + "".concat(newB.toString(16).padStart(2, 0));
1435
1523
  };
1436
-
1437
1524
  /**
1438
1525
  * Lighten a given color
1439
1526
  * @method lighten
@@ -1441,10 +1528,11 @@ var changeColor = function changeColor(color, ratio) {
1441
1528
  * @returns {String}
1442
1529
  * @private
1443
1530
  */
1531
+
1532
+
1444
1533
  var lighten = function lighten(color) {
1445
1534
  return changeColor(color, 1.3);
1446
1535
  };
1447
-
1448
1536
  /**
1449
1537
  * Darkens a given color
1450
1538
  * @method darken
@@ -1452,10 +1540,10 @@ var lighten = function lighten(color) {
1452
1540
  * @returns {String}
1453
1541
  * @private
1454
1542
  */
1543
+
1455
1544
  var darken = function darken(color) {
1456
1545
  return changeColor(color, 0.5);
1457
1546
  };
1458
-
1459
1547
  /** consistent token structure: handle callback to add value and name in event payload
1460
1548
  * @method handleValueClickCallback
1461
1549
  * @param {Object} ev
@@ -1464,6 +1552,7 @@ var darken = function darken(color) {
1464
1552
  * @param {Number} trendValue
1465
1553
  * @param {Function} onValueClick
1466
1554
  */
1555
+
1467
1556
  var handleValueClickCallback = function handleValueClickCallback(ev, majorValue, majorValueField, trendValue, onValueClick) {
1468
1557
  var trellisEnabled = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : false;
1469
1558
  var trellisSplityBy = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : '';
@@ -1473,12 +1562,14 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
1473
1562
  value: majorValue,
1474
1563
  name: majorValueField
1475
1564
  };
1565
+
1476
1566
  if (trellisEnabled) {
1477
1567
  payload = _objectSpread(_objectSpread({}, payload), {}, {
1478
1568
  'trellis.name': trellisSplityBy,
1479
1569
  'trellis.value': trellisKey
1480
1570
  });
1481
1571
  }
1572
+
1482
1573
  return onValueClick(_objectSpread(_objectSpread({}, ev), {}, {
1483
1574
  payload: payload
1484
1575
  }));
@@ -1489,35 +1580,35 @@ var handleValueClickCallback = function handleValueClickCallback(ev, majorValue,
1489
1580
  /***/ 25:
1490
1581
  /***/ (function(module, exports) {
1491
1582
 
1492
- module.exports = require("@splunk/visualization-context/TimezoneContext");
1583
+ module.exports = require("@splunk/ui-utils/id");
1493
1584
 
1494
1585
  /***/ }),
1495
1586
 
1496
1587
  /***/ 26:
1497
1588
  /***/ (function(module, exports) {
1498
1589
 
1499
- module.exports = require("@splunk/visualizations-shared/hocUtils");
1590
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
1500
1591
 
1501
1592
  /***/ }),
1502
1593
 
1503
1594
  /***/ 27:
1504
1595
  /***/ (function(module, exports) {
1505
1596
 
1506
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1597
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
1507
1598
 
1508
1599
  /***/ }),
1509
1600
 
1510
1601
  /***/ 28:
1511
1602
  /***/ (function(module, exports) {
1512
1603
 
1513
- module.exports = require("@splunk/visualizations-shared/propUtils");
1604
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
1514
1605
 
1515
1606
  /***/ }),
1516
1607
 
1517
1608
  /***/ 29:
1518
1609
  /***/ (function(module, exports) {
1519
1610
 
1520
- module.exports = require("@splunk/visualization-encoding/Options");
1611
+ module.exports = require("@splunk/visualizations-shared/propUtils");
1521
1612
 
1522
1613
  /***/ }),
1523
1614
 
@@ -1531,11 +1622,18 @@ module.exports = require("lodash");
1531
1622
  /***/ 30:
1532
1623
  /***/ (function(module, exports) {
1533
1624
 
1534
- module.exports = require("@splunk/visualizations-shared/numberUtils");
1625
+ module.exports = require("@splunk/visualization-encoding/Options");
1535
1626
 
1536
1627
  /***/ }),
1537
1628
 
1538
1629
  /***/ 31:
1630
+ /***/ (function(module, exports) {
1631
+
1632
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
1633
+
1634
+ /***/ }),
1635
+
1636
+ /***/ 32:
1539
1637
  /***/ (function(module, exports, __webpack_require__) {
1540
1638
 
1541
1639
  "use strict";
@@ -1545,11 +1643,17 @@ Object.defineProperty(exports, "__esModule", {
1545
1643
  value: true
1546
1644
  });
1547
1645
  exports.shouldShowIconPlaceholder = void 0;
1646
+
1548
1647
  var React = __webpack_require__(1);
1648
+
1549
1649
  var T = __webpack_require__(0);
1650
+
1550
1651
  var lodash_1 = __webpack_require__(3);
1652
+
1551
1653
  var i18n_1 = __webpack_require__(2);
1654
+
1552
1655
  var Message_1 = __webpack_require__(10);
1656
+
1553
1657
  var FixedSizeContainer_1 = __webpack_require__(13);
1554
1658
  /**
1555
1659
  * @method shouldShowIconPlaceholder
@@ -1557,14 +1661,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
1557
1661
  * @param {boolean} loading
1558
1662
  * @returns {boolean}
1559
1663
  */
1664
+
1665
+
1560
1666
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
1561
1667
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
1562
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
1668
+ var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
1563
1669
  var noData = data === undefined;
1564
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
1670
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
1565
1671
  var noFields = fields === undefined;
1566
1672
  return loading || noData || noFields;
1567
1673
  };
1674
+
1568
1675
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
1569
1676
  var propTypes = {
1570
1677
  icon: T.func,
@@ -1579,11 +1686,13 @@ var propTypes = {
1579
1686
  * @param {IconPlaceholderProps} props
1580
1687
  * @returns {React.ReactElement}
1581
1688
  */
1689
+
1582
1690
  var IconPlaceholder = function IconPlaceholder(props) {
1583
1691
  var width = props.width,
1584
- height = props.height,
1585
- icon = props.icon,
1586
- iconColor = props.iconColor;
1692
+ height = props.height,
1693
+ icon = props.icon,
1694
+ iconColor = props.iconColor;
1695
+
1587
1696
  if (icon) {
1588
1697
  return React.createElement(icon, {
1589
1698
  style: {
@@ -1598,26 +1707,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
1598
1707
  height: '50%'
1599
1708
  });
1600
1709
  }
1710
+
1601
1711
  return React.createElement(Message_1.default, {
1602
1712
  width: width,
1603
1713
  height: height,
1604
1714
  level: "warning",
1605
- message: i18n_1._('No DataSource Connected')
1715
+ message: (0, i18n_1._)('No DataSource Connected')
1606
1716
  });
1607
1717
  };
1718
+
1608
1719
  IconPlaceholder.propTypes = propTypes;
1609
1720
  IconPlaceholder.defaultProps = {
1610
1721
  width: '100%',
1611
1722
  height: 250
1612
1723
  };
1613
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
1614
-
1615
- /***/ }),
1616
-
1617
- /***/ 32:
1618
- /***/ (function(module, exports) {
1619
-
1620
- module.exports = require("@splunk/ui-utils/id");
1724
+ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
1621
1725
 
1622
1726
  /***/ }),
1623
1727
 
@@ -1628,21 +1732,27 @@ module.exports = require("@splunk/ui-utils/id");
1628
1732
 
1629
1733
 
1630
1734
  var _defineProperty = __webpack_require__(7);
1735
+
1631
1736
  Object.defineProperty(exports, "__esModule", {
1632
1737
  value: true
1633
1738
  });
1634
1739
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
1740
+
1635
1741
  var T = __webpack_require__(0);
1742
+
1636
1743
  var lodash_1 = __webpack_require__(3);
1637
- var DataSource_1 = __webpack_require__(43);
1744
+
1745
+ var DataSource_1 = __webpack_require__(34);
1746
+
1638
1747
  exports.SortParamsPropTypes = T.shape({
1639
1748
  currentSortKey: T.string,
1640
1749
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
1641
1750
  onSort: T.func
1642
1751
  });
1752
+
1643
1753
  var getSortingParams = function getSortingParams(_ref) {
1644
1754
  var requestParams = _ref.requestParams,
1645
- onRequestParamsChange = _ref.onRequestParamsChange;
1755
+ onRequestParamsChange = _ref.onRequestParamsChange;
1646
1756
  var currentSortKey;
1647
1757
  var currentSortDir;
1648
1758
  var nextSortDirMap = {
@@ -1651,17 +1761,20 @@ var getSortingParams = function getSortingParams(_ref) {
1651
1761
  none: 'asc'
1652
1762
  };
1653
1763
  var onSort;
1764
+
1654
1765
  if (typeof onRequestParamsChange === 'function') {
1655
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
1766
+ if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
1656
1767
  currentSortKey = Object.keys(requestParams.sort).shift();
1657
1768
  currentSortDir = requestParams.sort[currentSortKey];
1658
- }
1659
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1769
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
1770
+
1771
+
1660
1772
  onSort = function onSort(e, _ref2) {
1661
1773
  var sortKey = _ref2.sortKey,
1662
- sortDir = _ref2.sortDir;
1774
+ sortDir = _ref2.sortDir;
1775
+
1663
1776
  if (typeof sortKey === 'string') {
1664
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1777
+ var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
1665
1778
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
1666
1779
  offset: 0,
1667
1780
  sort: _defineProperty({}, sortKey, nextSortDir)
@@ -1671,12 +1784,14 @@ var getSortingParams = function getSortingParams(_ref) {
1671
1784
  }
1672
1785
  };
1673
1786
  }
1787
+
1674
1788
  return {
1675
1789
  currentSortKey: currentSortKey,
1676
1790
  currentSortDir: currentSortDir,
1677
1791
  onSort: onSort
1678
1792
  };
1679
1793
  };
1794
+
1680
1795
  exports.getSortingParams = getSortingParams;
1681
1796
 
1682
1797
  /***/ }),
@@ -1687,43 +1802,69 @@ exports.getSortingParams = getSortingParams;
1687
1802
  "use strict";
1688
1803
 
1689
1804
 
1805
+ Object.defineProperty(exports, "__esModule", {
1806
+ value: true
1807
+ });
1808
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
1809
+ exports.validSortDirs = ['asc', 'desc', 'none'];
1810
+ exports.validSegmentationModes = ['none', 'inner'];
1811
+ exports.validOutputModes = ['json_cols', 'json'];
1812
+
1813
+ /***/ }),
1814
+
1815
+ /***/ 35:
1816
+ /***/ (function(module, exports, __webpack_require__) {
1817
+
1818
+ "use strict";
1819
+
1820
+
1690
1821
  Object.defineProperty(exports, "__esModule", {
1691
1822
  value: true
1692
1823
  });
1693
1824
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
1825
+
1694
1826
  var T = __webpack_require__(0);
1827
+
1695
1828
  var lodash_1 = __webpack_require__(3);
1829
+
1696
1830
  exports.PaginatorParamsPropTypes = T.shape({
1697
1831
  isPaging: T.bool,
1698
1832
  current: T.number,
1699
1833
  totalPages: T.number,
1700
1834
  onChange: T.func
1701
1835
  });
1836
+
1702
1837
  var getPaginationParams = function getPaginationParams(_ref) {
1703
1838
  var requestParams = _ref.requestParams,
1704
- meta = _ref.meta,
1705
- onRequestParamsChange = _ref.onRequestParamsChange;
1839
+ meta = _ref.meta,
1840
+ onRequestParamsChange = _ref.onRequestParamsChange;
1706
1841
  var totalCount = meta && meta.totalCount || 0;
1707
1842
  var offset = requestParams && requestParams.offset || 0;
1708
1843
  var count = requestParams && requestParams.count;
1709
1844
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
1710
1845
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
1711
1846
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
1847
+
1712
1848
  var onChangeHandler = function onChangeHandler(e, _ref2) {
1713
1849
  var page = _ref2.page,
1714
- countArg = _ref2.count;
1715
- var newParams = lodash_1.cloneDeep(requestParams);
1850
+ countArg = _ref2.count;
1851
+ var newParams = (0, lodash_1.cloneDeep)(requestParams);
1852
+
1716
1853
  if (typeof countArg === 'number') {
1717
1854
  newParams.count = countArg;
1718
1855
  newParams.offset = 0;
1719
1856
  }
1857
+
1720
1858
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
1859
+
1721
1860
  if (typeof page === 'number' && page > 0) {
1722
1861
  newParams.count = pageCount;
1723
1862
  newParams.offset = (page - 1) * pageCount;
1724
1863
  }
1864
+
1725
1865
  onRequestParamsChange(newParams);
1726
1866
  };
1867
+
1727
1868
  return {
1728
1869
  isPaging: isPaging,
1729
1870
  current: current,
@@ -1731,11 +1872,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
1731
1872
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
1732
1873
  };
1733
1874
  };
1875
+
1734
1876
  exports.getPaginationParams = getPaginationParams;
1735
1877
 
1736
1878
  /***/ }),
1737
1879
 
1738
- /***/ 35:
1880
+ /***/ 36:
1739
1881
  /***/ (function(module, exports, __webpack_require__) {
1740
1882
 
1741
1883
  "use strict";
@@ -1746,6 +1888,7 @@ Object.defineProperty(exports, "__esModule", {
1746
1888
  });
1747
1889
  exports.VizCategory = void 0;
1748
1890
  var VizCategory;
1891
+
1749
1892
  (function (VizCategory) {
1750
1893
  VizCategory["SINGLE_VALUE"] = "Single Value";
1751
1894
  VizCategory["TRENDS"] = "Trends";
@@ -1763,67 +1906,96 @@ var VizCategory;
1763
1906
 
1764
1907
  /***/ }),
1765
1908
 
1766
- /***/ 36:
1909
+ /***/ 37:
1767
1910
  /***/ (function(module, exports, __webpack_require__) {
1768
1911
 
1769
1912
  "use strict";
1770
1913
 
1771
1914
 
1772
1915
  var _slicedToArray = __webpack_require__(17);
1916
+
1773
1917
  Object.defineProperty(exports, "__esModule", {
1774
1918
  value: true
1775
1919
  });
1920
+
1776
1921
  var React = __webpack_require__(1);
1922
+
1777
1923
  var lodash_1 = __webpack_require__(3);
1778
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
1779
- var Options_1 = __webpack_require__(29);
1780
- var SanitizeProps_1 = __webpack_require__(38);
1781
- var TimezoneContext_1 = __webpack_require__(25);
1782
- var moment_1 = __webpack_require__(39);
1924
+
1925
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
1926
+
1927
+ var Options_1 = __webpack_require__(30);
1928
+
1929
+ var SanitizeProps_1 = __webpack_require__(39);
1930
+
1931
+ var TimezoneContext_1 = __webpack_require__(26);
1932
+
1933
+ var moment_1 = __webpack_require__(40);
1934
+
1783
1935
  var FeatureFlagContext_1 = __webpack_require__(21);
1936
+
1784
1937
  var styled_components_1 = __webpack_require__(4);
1785
- var hocUtils_1 = __webpack_require__(26);
1786
- var JSONSchemaUtils_1 = __webpack_require__(27);
1787
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
1788
- var id_1 = __webpack_require__(32);
1789
- var SplunkVisualization_1 = __webpack_require__(41);
1938
+
1939
+ var hocUtils_1 = __webpack_require__(27);
1940
+
1941
+ var JSONSchemaUtils_1 = __webpack_require__(28);
1942
+
1943
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
1944
+
1945
+ var id_1 = __webpack_require__(25);
1946
+
1947
+ var SplunkVisualization_1 = __webpack_require__(42);
1948
+
1790
1949
  var VizBehavior_1 = __webpack_require__(6);
1950
+
1791
1951
  var getSorting_1 = __webpack_require__(33);
1792
- var getPagination_1 = __webpack_require__(34);
1952
+
1953
+ var getPagination_1 = __webpack_require__(35);
1954
+
1793
1955
  var useDeepMemo_1 = __webpack_require__(44);
1956
+
1794
1957
  var MissingPropsMessage_1 = __webpack_require__(45);
1958
+
1795
1959
  var withEditModeCover_1 = __webpack_require__(46);
1960
+
1796
1961
  var withPlaceholder_1 = __webpack_require__(47);
1797
1962
  /**
1798
1963
  * hoc that wraps a pure react visualization in a Dashboard visualization
1799
1964
  * @param {DashboardVizOpts} opts
1800
1965
  * @returns {HOC}
1801
1966
  */
1967
+
1968
+
1802
1969
  var withDashboardViz = function withDashboardViz(opts) {
1803
1970
  var ReactViz = opts.ReactViz,
1804
- vizConfig = opts.vizConfig,
1805
- _opts$computeVizProps = opts.computeVizProps,
1806
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1807
- disableEditModeCover = opts.disableEditModeCover,
1808
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1809
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
1810
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
1971
+ vizConfig = opts.vizConfig,
1972
+ _opts$computeVizProps = opts.computeVizProps,
1973
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
1974
+ disableEditModeCover = opts.disableEditModeCover,
1975
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
1976
+
1977
+ var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
1978
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
1979
+
1811
1980
  var DashboardViz = function DashboardViz(props) {
1812
1981
  var _a;
1982
+
1813
1983
  var mode = props.mode,
1814
- hasEventHandlers = props.hasEventHandlers,
1815
- dataSources = props.dataSources,
1816
- options = props.options,
1817
- _props$context = props.context,
1818
- context = _props$context === void 0 ? {} : _props$context,
1819
- width = props.width,
1820
- height = props.height,
1821
- onComputedProps = props.onComputedProps,
1822
- onEventTrigger = props.onEventTrigger,
1823
- theme = props.theme,
1824
- onRequestParamsChange = props.onRequestParamsChange;
1984
+ hasEventHandlers = props.hasEventHandlers,
1985
+ dataSources = props.dataSources,
1986
+ options = props.options,
1987
+ _props$context = props.context,
1988
+ context = _props$context === void 0 ? {} : _props$context,
1989
+ width = props.width,
1990
+ height = props.height,
1991
+ onComputedProps = props.onComputedProps,
1992
+ onEventTrigger = props.onEventTrigger,
1993
+ theme = props.theme,
1994
+ onRequestParamsChange = props.onRequestParamsChange;
1995
+
1825
1996
  var _React$useContext = React.useContext(TimezoneContext_1.default),
1826
- serializedTimezone = _React$useContext.serializedTimezone;
1997
+ serializedTimezone = _React$useContext.serializedTimezone;
1998
+
1827
1999
  if (serializedTimezone) {
1828
2000
  /*
1829
2001
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -1837,44 +2009,58 @@ var withDashboardViz = function withDashboardViz(opts) {
1837
2009
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
1838
2010
  }
1839
2011
  }
2012
+
1840
2013
  var themeFunc = function themeFunc(themeVar) {
1841
2014
  var _a, _b;
2015
+
1842
2016
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
1843
2017
  };
2018
+
1844
2019
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1845
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
1846
- theme: theme
1847
- }),
1848
- currentThemeFamily = _getSettingsFromTheme.family,
1849
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
1850
- currentThemeDensity = _getSettingsFromTheme.density;
2020
+
2021
+ var _ref = (0, getSettingsFromThemedProps_1.default)({
2022
+ theme: theme
2023
+ }),
2024
+ currentThemeFamily = _ref.family,
2025
+ currentThemeColorScheme = _ref.colorScheme,
2026
+ currentThemeDensity = _ref.density;
2027
+
1851
2028
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
2029
+
1852
2030
  var _React$useState = React.useState({}),
1853
- _React$useState2 = _slicedToArray(_React$useState, 2),
1854
- evaluatedOptionsAsync = _React$useState2[0],
1855
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
2031
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2032
+ evaluatedOptionsAsync = _React$useState2[0],
2033
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
2034
+
2035
+
1856
2036
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1857
- var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
1858
- _React$useState4 = _slicedToArray(_React$useState3, 1),
1859
- visualizationID = _React$useState4[0];
2037
+
2038
+ var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
2039
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
2040
+ visualizationID = _React$useState4[0];
2041
+
1860
2042
  var _React$useState5 = React.useState({}),
1861
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1862
- dataSourcesInState = _React$useState6[0],
1863
- setDataSourcesInState = _React$useState6[1];
2043
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
2044
+ dataSourcesInState = _React$useState6[0],
2045
+ setDataSourcesInState = _React$useState6[1];
2046
+
1864
2047
  var _React$useState7 = React.useState(),
1865
- _React$useState8 = _slicedToArray(_React$useState7, 2),
1866
- dataFramesInState = _React$useState8[0],
1867
- setDataFramesInState = _React$useState8[1];
1868
- var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
1869
- _React$useState10 = _slicedToArray(_React$useState9, 2),
1870
- useAsyncEvaluatedOptions = _React$useState10[0],
1871
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1872
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
2048
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
2049
+ dataFramesInState = _React$useState8[0],
2050
+ setDataFramesInState = _React$useState8[1];
2051
+
2052
+ var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
2053
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
2054
+ useAsyncEvaluatedOptions = _React$useState10[0],
2055
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
2056
+
2057
+ var isMounted = React.useRef(true);
2058
+ evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
1873
2059
  try {
1874
2060
  if (useAsyncEvaluatedOptions) {
1875
2061
  var optionsToEvaluate = {
1876
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1877
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
2062
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
2063
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1878
2064
  };
1879
2065
  var asyncDynamicOptionsEvaluatorParams = {
1880
2066
  visualizationID: visualizationID,
@@ -1885,21 +2071,23 @@ var withDashboardViz = function withDashboardViz(opts) {
1885
2071
  };
1886
2072
  async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
1887
2073
  setEvaluatedOptionsAsync(results.results);
1888
- }).catch(function (e) {
1889
- // eslint-disable-next-line no-console
1890
- console.error("unexpected error evaluating options - async: ".concat(e.message));
1891
- setUseAsyncEvaluatedOptions(false);
2074
+ }).catch(function () {
2075
+ if (isMounted.current) {
2076
+ setUseAsyncEvaluatedOptions(false);
2077
+ }
1892
2078
  });
1893
2079
  } else {
1894
2080
  var dataFrames = dataFramesInState;
2081
+
1895
2082
  if (dataSources !== dataSourcesInState) {
1896
2083
  setDataSourcesInState(dataSources);
1897
2084
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
1898
2085
  setDataFramesInState(dataFrames);
1899
2086
  }
2087
+
1900
2088
  return Options_1.Options.evaluate({
1901
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
1902
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
2089
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
2090
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
1903
2091
  }, dataSources, themeFunc, dataFrames);
1904
2092
  }
1905
2093
  } catch (e) {
@@ -1907,67 +2095,76 @@ var withDashboardViz = function withDashboardViz(opts) {
1907
2095
  console.error("unexpected error evaluating options: ".concat(e.message));
1908
2096
  return {};
1909
2097
  }
2098
+
1910
2099
  return {};
1911
2100
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
1912
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
1913
- // trellis specific backgroundColor update for onComputedProps
2101
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
1914
2102
  // if trellis is enabled following these three criteria - 1) trellis feature flag is enabled 2) vizConfig supports array has 'trellis' 3) option 'splitByLayout' is set to 'trellis
1915
2103
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
2104
+
1916
2105
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
1917
2106
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
2107
+
1918
2108
  if (isTrellisFeatureFlagOn && ((_a = vizConfig === null || vizConfig === void 0 ? void 0 : vizConfig.supports) === null || _a === void 0 ? void 0 : _a.includes(VizBehavior_1.VizBehavior.TRELLIS)) && (clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.splitByLayout) === VizBehavior_1.VizBehavior.TRELLIS) {
1919
2109
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
1920
2110
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
1921
2111
  });
1922
- }
1923
- // useEffect hook needs to be initialized before any early returns
2112
+ } // useEffect hook needs to be initialized before any early returns
1924
2113
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
2114
+
2115
+
1925
2116
  React.useEffect(function () {
1926
2117
  onComputedProps(clonedEvaluatedOptions);
1927
2118
  });
1928
2119
  React.useEffect(function () {
1929
2120
  return function () {
1930
2121
  if (useAsyncEvaluatedOptions) {
2122
+ isMounted.current = false;
1931
2123
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
1932
2124
  }
1933
- };
1934
- // eslint-disable-next-line react-hooks/exhaustive-deps
1935
- }, []);
1936
- // present warning message if any required props are missing
2125
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
2126
+ }, []); // present warning message if any required props are missing
2127
+
1937
2128
  var _vizConfig$requiredPr = vizConfig.requiredProps,
1938
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1939
- supports = vizConfig.supports;
1940
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
2129
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
2130
+ supports = vizConfig.supports;
2131
+ var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
2132
+
1941
2133
  if (missing.length > 0 && supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && vizConfig.key !== 'splunk.singlevalue' // For SV missing props msg is not displayed if required props majorValue is missing, instead this will be handled from the component, instead handled within component
1942
2134
  ) {
1943
- return React.createElement(MissingPropsMessage_1.default, {
1944
- "data-test": "missing-props-message",
1945
- width: width,
1946
- height: height,
1947
- missingProps: missing,
1948
- backgroundColor: bgColorFromTheme
1949
- });
1950
- }
1951
- // events
2135
+ return React.createElement(MissingPropsMessage_1.default, {
2136
+ "data-test": "missing-props-message",
2137
+ width: width,
2138
+ height: height,
2139
+ missingProps: missing,
2140
+ backgroundColor: bgColorFromTheme
2141
+ });
2142
+ } // events
2143
+
2144
+
1952
2145
  var eventCallbackProps = {};
2146
+
1953
2147
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1954
2148
  var supportedEvents = vizConfig.events;
1955
2149
  Object.keys(supportedEvents).forEach(function (eventName) {
1956
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
1957
- eventCallbackProps[eventCallbackPropName] = null;
1958
- // todo: refactor single value and single value icon to send payload from viz
2150
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
2151
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
1959
2152
  // then remove these lines
2153
+
1960
2154
  var payloadKeys = supportedEvents[eventName].payloadKeys;
1961
2155
  var payload = {};
2156
+
1962
2157
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1963
2158
  payloadKeys.forEach(function (p) {
1964
2159
  payload[p] = evaluatedOptionsToUse[p];
1965
2160
  });
1966
2161
  }
2162
+
1967
2163
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1968
2164
  if (ev && ev.payload) {
1969
2165
  payload = ev.payload;
1970
2166
  }
2167
+
1971
2168
  return onEventTrigger({
1972
2169
  originalEvent: ev,
1973
2170
  payload: payload,
@@ -1975,8 +2172,9 @@ var withDashboardViz = function withDashboardViz(opts) {
1975
2172
  });
1976
2173
  };
1977
2174
  });
1978
- }
1979
- // compute pure viz props which are not from options
2175
+ } // compute pure viz props which are not from options
2176
+
2177
+
1980
2178
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1981
2179
  themeFunc: themeFunc
1982
2180
  }));
@@ -1994,21 +2192,25 @@ var withDashboardViz = function withDashboardViz(opts) {
1994
2192
  * In future, we could automatically detect which all datasources are being used
1995
2193
  * and bind those magically to pagination/sorting behavior.
1996
2194
  */
2195
+
1997
2196
  var dataSourceMetadata = {};
1998
2197
  var OptionKey = 'paginateDataSourceKey';
1999
- var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
2000
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
2001
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
2002
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
2198
+ var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
2199
+
2200
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
2201
+ var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
2202
+ var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
2203
+
2003
2204
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
2004
2205
  return onRequestParamsChange(paginateDataSourceKey, payload);
2005
2206
  };
2006
- var sortParams = getSorting_1.getSortingParams({
2207
+
2208
+ var sortParams = (0, getSorting_1.getSortingParams)({
2007
2209
  requestParams: requestParams,
2008
2210
  meta: meta,
2009
2211
  onRequestParamsChange: handleRequestParamsChange
2010
2212
  });
2011
- var paginatorParams = getPagination_1.getPaginationParams({
2213
+ var paginatorParams = (0, getPagination_1.getPaginationParams)({
2012
2214
  requestParams: requestParams,
2013
2215
  meta: meta,
2014
2216
  onRequestParamsChange: handleRequestParamsChange
@@ -2017,115 +2219,132 @@ var withDashboardViz = function withDashboardViz(opts) {
2017
2219
  sortParams: sortParams,
2018
2220
  paginatorParams: paginatorParams
2019
2221
  };
2020
- }
2021
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
2222
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
2223
+
2224
+
2022
2225
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
2023
2226
  return null;
2024
2227
  }
2228
+
2025
2229
  return React.createElement(SanitizedReactViz, Object.assign({
2026
2230
  mode: mode,
2027
2231
  width: width,
2028
2232
  height: height
2029
2233
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
2030
2234
  };
2235
+
2031
2236
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
2032
2237
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
2033
2238
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
2034
2239
  theme: {}
2035
- });
2036
- // attach viz config
2037
- DashboardViz.config = vizConfig;
2038
- // @ts-ignore: TODO fix sc upgrade TS issues
2039
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
2240
+ }); // attach viz config
2241
+
2242
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
2243
+
2244
+ return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
2040
2245
  };
2246
+
2041
2247
  exports.default = withDashboardViz;
2042
2248
 
2043
2249
  /***/ }),
2044
2250
 
2045
- /***/ 37:
2251
+ /***/ 38:
2046
2252
  /***/ (function(module, exports) {
2047
2253
 
2048
2254
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
2049
2255
 
2050
2256
  /***/ }),
2051
2257
 
2052
- /***/ 38:
2258
+ /***/ 39:
2053
2259
  /***/ (function(module, exports) {
2054
2260
 
2055
2261
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
2056
2262
 
2057
2263
  /***/ }),
2058
2264
 
2059
- /***/ 39:
2265
+ /***/ 4:
2060
2266
  /***/ (function(module, exports) {
2061
2267
 
2062
- module.exports = require("@splunk/moment");
2268
+ module.exports = require("styled-components");
2063
2269
 
2064
2270
  /***/ }),
2065
2271
 
2066
- /***/ 4:
2272
+ /***/ 40:
2067
2273
  /***/ (function(module, exports) {
2068
2274
 
2069
- module.exports = require("styled-components");
2275
+ module.exports = require("@splunk/moment");
2070
2276
 
2071
2277
  /***/ }),
2072
2278
 
2073
- /***/ 40:
2279
+ /***/ 41:
2074
2280
  /***/ (function(module, exports) {
2075
2281
 
2076
2282
  module.exports = require("@splunk/async-dynamic-options-evaluator");
2077
2283
 
2078
2284
  /***/ }),
2079
2285
 
2080
- /***/ 41:
2286
+ /***/ 42:
2081
2287
  /***/ (function(module, exports, __webpack_require__) {
2082
2288
 
2083
2289
  "use strict";
2084
2290
 
2085
2291
 
2086
2292
  var _classCallCheck = __webpack_require__(9);
2293
+
2087
2294
  Object.defineProperty(exports, "__esModule", {
2088
2295
  value: true
2089
2296
  });
2090
2297
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
2091
2298
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
2299
+
2092
2300
  var T = __webpack_require__(0);
2301
+
2093
2302
  var lodash_1 = __webpack_require__(3);
2094
- var VizActionHandler_1 = __webpack_require__(42);
2095
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2303
+
2304
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
2305
+
2306
+
2096
2307
  exports.INITIAL_WIDTH = 250;
2097
2308
  exports.INITIAL_HEIGHT = 250;
2098
2309
  /**
2099
2310
  * A Splunk visualization
2100
2311
  */
2312
+
2101
2313
  var SplunkVisualization = function SplunkVisualization() {
2102
2314
  _classCallCheck(this, SplunkVisualization);
2103
2315
  };
2316
+
2104
2317
  SplunkVisualization.propTypes = {
2105
2318
  /**
2106
2319
  * display mode
2107
2320
  */
2108
2321
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
2322
+
2109
2323
  /**
2110
2324
  * width in pixel or string, defaults to 100%
2111
2325
  */
2112
2326
  width: T.oneOfType([T.string, T.number]).isRequired,
2327
+
2113
2328
  /**
2114
2329
  * height in pixel or string
2115
2330
  */
2116
2331
  height: T.oneOfType([T.string, T.number]).isRequired,
2332
+
2117
2333
  /**
2118
2334
  * visualization context used for dynamic option evaluation
2119
2335
  */
2120
2336
  context: T.object,
2337
+
2121
2338
  /**
2122
2339
  * visualization formatting options
2123
2340
  */
2124
2341
  options: T.object,
2342
+
2125
2343
  /**
2126
2344
  * A callback to update formatting options
2127
2345
  */
2128
2346
  onOptionsChange: T.func,
2347
+
2129
2348
  /**
2130
2349
  * datasource state which include data and request params, object key indicate the datasource type.
2131
2350
  */
@@ -2134,6 +2353,7 @@ SplunkVisualization.propTypes = {
2134
2353
  * current request params
2135
2354
  */
2136
2355
  requestParams: T.object,
2356
+
2137
2357
  /**
2138
2358
  * current dataset
2139
2359
  */
@@ -2141,6 +2361,7 @@ SplunkVisualization.propTypes = {
2141
2361
  fields: T.array,
2142
2362
  columns: T.array
2143
2363
  }),
2364
+
2144
2365
  /**
2145
2366
  * error
2146
2367
  */
@@ -2148,29 +2369,35 @@ SplunkVisualization.propTypes = {
2148
2369
  level: T.string,
2149
2370
  message: T.string
2150
2371
  }),
2372
+
2151
2373
  /**
2152
2374
  * meta data that came with the dataset
2153
2375
  */
2154
2376
  meta: T.object
2155
2377
  })),
2378
+
2156
2379
  /**
2157
2380
  * A callback to trigger event
2158
2381
  */
2159
2382
  onEventTrigger: T.func,
2383
+
2160
2384
  /**
2161
2385
  * Inform viz if there are handlers listening to events
2162
2386
  */
2163
2387
  hasEventHandlers: T.bool,
2388
+
2164
2389
  /**
2165
2390
  * A callback to communicate computed props to a consumer
2166
2391
  */
2167
2392
  onComputedProps: T.func,
2393
+
2168
2394
  /**
2169
2395
  * A callback to obtain visualization api
2170
2396
  */
2171
2397
  vizActionHandlerRef: T.func,
2172
2398
  loading: T.bool,
2173
2399
  theme: T.object,
2400
+
2174
2401
  /**
2175
2402
  * A callback to request new data with updated request params
2176
2403
  */
@@ -2179,6 +2406,7 @@ SplunkVisualization.propTypes = {
2179
2406
  /**
2180
2407
  *
2181
2408
  */
2409
+
2182
2410
  SplunkVisualization.defaultProps = {
2183
2411
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
2184
2412
  width: '100%',
@@ -2207,26 +2435,29 @@ exports.default = SplunkVisualization;
2207
2435
 
2208
2436
  /***/ }),
2209
2437
 
2210
- /***/ 42:
2438
+ /***/ 43:
2211
2439
  /***/ (function(module, exports, __webpack_require__) {
2212
2440
 
2213
2441
  "use strict";
2214
2442
 
2215
2443
 
2216
2444
  var _classCallCheck = __webpack_require__(9);
2445
+
2217
2446
  var _createClass = __webpack_require__(18);
2447
+
2218
2448
  Object.defineProperty(exports, "__esModule", {
2219
2449
  value: true
2220
2450
  });
2221
2451
  exports.DefaultVizActionHandler = void 0;
2452
+
2222
2453
  var DefaultVizActionHandler = /*#__PURE__*/function () {
2223
2454
  function DefaultVizActionHandler() {
2224
2455
  _classCallCheck(this, DefaultVizActionHandler);
2225
2456
  }
2457
+
2226
2458
  _createClass(DefaultVizActionHandler, [{
2227
2459
  key: "focus",
2228
- value: function focus() {
2229
- // noop
2460
+ value: function focus() {// noop
2230
2461
  }
2231
2462
  }, {
2232
2463
  key: "snapshot",
@@ -2234,13 +2465,15 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
2234
2465
  return null; // noop
2235
2466
  }
2236
2467
  }]);
2468
+
2237
2469
  return DefaultVizActionHandler;
2238
2470
  }();
2471
+
2239
2472
  exports.DefaultVizActionHandler = DefaultVizActionHandler;
2240
2473
 
2241
2474
  /***/ }),
2242
2475
 
2243
- /***/ 428:
2476
+ /***/ 431:
2244
2477
  /***/ (function(module, exports, __webpack_require__) {
2245
2478
 
2246
2479
  "use strict";
@@ -2248,36 +2481,47 @@ exports.DefaultVizActionHandler = DefaultVizActionHandler;
2248
2481
 
2249
2482
  var __rest = this && this.__rest || function (s, e) {
2250
2483
  var t = {};
2484
+
2251
2485
  for (var p in s) {
2252
2486
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2253
2487
  }
2488
+
2254
2489
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2255
2490
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2256
2491
  }
2257
2492
  return t;
2258
2493
  };
2494
+
2259
2495
  Object.defineProperty(exports, "__esModule", {
2260
2496
  value: true
2261
2497
  });
2262
2498
  exports.themes = exports.computeVizProps = exports.PureParallelCoordinates = exports.config = void 0;
2263
- var PureParallelCoordinates_1 = __webpack_require__(429);
2264
- var withDashboardViz_1 = __webpack_require__(36);
2265
- var config_1 = __webpack_require__(436);
2499
+
2500
+ var PureParallelCoordinates_1 = __webpack_require__(432);
2501
+
2502
+ var withDashboardViz_1 = __webpack_require__(37);
2503
+
2504
+ var config_1 = __webpack_require__(439);
2505
+
2266
2506
  var singleValueUtils_1 = __webpack_require__(24);
2507
+
2267
2508
  exports.config = config_1.default;
2268
2509
  exports.PureParallelCoordinates = PureParallelCoordinates_1.default;
2510
+
2269
2511
  var computeVizProps = function computeVizProps(_a) {
2270
2512
  var themeFunc = _a.themeFunc,
2271
- props = __rest(_a, ["themeFunc"]);
2513
+ props = __rest(_a, ["themeFunc"]);
2514
+
2272
2515
  var defaultThemeColorVariables = ['defaultBackgroundColor', 'axisLineColor', 'axisLineHighlightColor', 'axisLabelColor', 'axisTitleColor', 'filterButtonDisabledColor', 'filterButtonActiveColor', 'filterTextColor', 'truncatedTextColor', 'filterSelectionColor', 'textShadowColor'];
2273
2516
  var defaultThemeColors = {};
2274
2517
  defaultThemeColorVariables.forEach(function (variable) {
2275
2518
  defaultThemeColors[variable] = themeFunc(variable);
2276
2519
  });
2520
+
2277
2521
  if (props.dataSources) {
2278
2522
  var _props$dataSources$pr = props.dataSources.primary.data,
2279
- fields = _props$dataSources$pr.fields,
2280
- columns = _props$dataSources$pr.columns;
2523
+ fields = _props$dataSources$pr.fields,
2524
+ columns = _props$dataSources$pr.columns;
2281
2525
  return Object.assign({
2282
2526
  fields: fields.map(function (field) {
2283
2527
  return field.name ? field.name : field;
@@ -2285,15 +2529,17 @@ var computeVizProps = function computeVizProps(_a) {
2285
2529
  columns: columns
2286
2530
  }, defaultThemeColors);
2287
2531
  }
2532
+
2288
2533
  return defaultThemeColors;
2289
2534
  };
2535
+
2290
2536
  exports.computeVizProps = computeVizProps;
2291
- var viz = withDashboardViz_1.default({
2537
+ var viz = (0, withDashboardViz_1.default)({
2292
2538
  ReactViz: exports.PureParallelCoordinates,
2293
2539
  vizConfig: config_1.default,
2294
2540
  computeVizProps: exports.computeVizProps,
2295
2541
  useIconPlaceholder: function useIconPlaceholder(dataSources, loading) {
2296
- return singleValueUtils_1.isLoadingOrNoColumns(dataSources, loading);
2542
+ return (0, singleValueUtils_1.isLoadingOrNoColumns)(dataSources, loading);
2297
2543
  }
2298
2544
  });
2299
2545
  exports.themes = config_1.default.themes;
@@ -2301,82 +2547,100 @@ exports.default = viz;
2301
2547
 
2302
2548
  /***/ }),
2303
2549
 
2304
- /***/ 429:
2550
+ /***/ 432:
2305
2551
  /***/ (function(module, exports, __webpack_require__) {
2306
2552
 
2307
2553
  "use strict";
2308
2554
 
2309
2555
 
2310
2556
  var _toConsumableArray = __webpack_require__(8);
2557
+
2311
2558
  var __rest = this && this.__rest || function (s, e) {
2312
2559
  var t = {};
2560
+
2313
2561
  for (var p in s) {
2314
2562
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2315
2563
  }
2564
+
2316
2565
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2317
2566
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2318
2567
  }
2319
2568
  return t;
2320
2569
  };
2570
+
2321
2571
  Object.defineProperty(exports, "__esModule", {
2322
2572
  value: true
2323
2573
  });
2574
+
2324
2575
  var React = __webpack_require__(1);
2325
- var d3_array_1 = __webpack_require__(63);
2326
- var d3_scale_1 = __webpack_require__(91);
2576
+
2577
+ var d3_array_1 = __webpack_require__(64);
2578
+
2579
+ var d3_scale_1 = __webpack_require__(93);
2580
+
2327
2581
  var T = __webpack_require__(0);
2582
+
2328
2583
  var i18n_1 = __webpack_require__(2);
2584
+
2329
2585
  var Message_1 = __webpack_require__(10);
2330
- var ParallelCoordinatesChart_1 = __webpack_require__(430);
2586
+
2587
+ var ParallelCoordinatesChart_1 = __webpack_require__(433);
2588
+
2331
2589
  var PureParallelCoordinates = function PureParallelCoordinates(_a) {
2332
2590
  var props = __rest(_a, []);
2591
+
2333
2592
  var width = props.width,
2334
- height = props.height,
2335
- columns = props.columns,
2336
- fields = props.fields,
2337
- showNullAxis = props.showNullAxis,
2338
- lineColor = props.lineColor,
2339
- backgroundColor = props.backgroundColor,
2340
- axisLineHighlightColor = props.axisLineHighlightColor,
2341
- axisLineColor = props.axisLineColor,
2342
- axisTitleColor = props.axisTitleColor,
2343
- axisLabelColor = props.axisLabelColor,
2344
- lineOpacity = props.lineOpacity,
2345
- filterButtonDisabledColor = props.filterButtonDisabledColor,
2346
- filterButtonActiveColor = props.filterButtonActiveColor,
2347
- filterTextColor = props.filterTextColor,
2348
- truncatedTextColor = props.truncatedTextColor,
2349
- filterSelectionColor = props.filterSelectionColor,
2350
- textShadowColor = props.textShadowColor,
2351
- mode = props.mode;
2593
+ height = props.height,
2594
+ columns = props.columns,
2595
+ fields = props.fields,
2596
+ showNullAxis = props.showNullAxis,
2597
+ lineColor = props.lineColor,
2598
+ backgroundColor = props.backgroundColor,
2599
+ axisLineHighlightColor = props.axisLineHighlightColor,
2600
+ axisLineColor = props.axisLineColor,
2601
+ axisTitleColor = props.axisTitleColor,
2602
+ axisLabelColor = props.axisLabelColor,
2603
+ lineOpacity = props.lineOpacity,
2604
+ filterButtonDisabledColor = props.filterButtonDisabledColor,
2605
+ filterButtonActiveColor = props.filterButtonActiveColor,
2606
+ filterTextColor = props.filterTextColor,
2607
+ truncatedTextColor = props.truncatedTextColor,
2608
+ filterSelectionColor = props.filterSelectionColor,
2609
+ textShadowColor = props.textShadowColor,
2610
+ mode = props.mode;
2352
2611
  var minWidth = 200;
2353
2612
  var minHieght = 150;
2613
+
2354
2614
  if (width < minWidth || height < minHieght) {
2355
2615
  return React.createElement(Message_1.default, {
2356
2616
  width: width,
2357
2617
  height: height,
2358
- message: i18n_1._('Too small to render content'),
2618
+ message: (0, i18n_1._)('Too small to render content'),
2359
2619
  level: "info"
2360
2620
  });
2361
2621
  }
2622
+
2362
2623
  var nullOffsetHeight = 30;
2363
2624
  var axisPadding = 0.3;
2364
2625
  var minLabelHeight = 16;
2365
- var truncatedCategoriesFlag = false;
2366
- // Set up chart margins
2626
+ var truncatedCategoriesFlag = false; // Set up chart margins
2627
+
2367
2628
  var margin = {
2368
2629
  top: 27,
2369
2630
  right: 20,
2370
2631
  bottom: 40,
2371
2632
  left: 40
2372
2633
  };
2634
+
2373
2635
  if (showNullAxis) {
2374
2636
  margin.bottom += nullOffsetHeight;
2375
2637
  }
2638
+
2376
2639
  var chartWidth = +width - margin.left - margin.right;
2377
- var chartHeight = +height - margin.top - margin.bottom;
2378
- // Data processing logic:
2640
+ var chartHeight = +height - margin.top - margin.bottom; // Data processing logic:
2641
+
2379
2642
  var data = [];
2643
+
2380
2644
  var _loop = function _loop(i) {
2381
2645
  var newObj = {};
2382
2646
  fields.forEach(function (field, index) {
@@ -2388,25 +2652,29 @@ var PureParallelCoordinates = function PureParallelCoordinates(_a) {
2388
2652
  });
2389
2653
  data.push(newObj);
2390
2654
  };
2655
+
2391
2656
  for (var i = 0; i < columns[0].length; i += 1) {
2392
2657
  _loop(i);
2393
- }
2394
- // Calculate horizontal and vertical scales
2658
+ } // Calculate horizontal and vertical scales
2659
+
2660
+
2395
2661
  var keys = Object.keys(data[0]);
2396
- var yPositionScale = {};
2397
- // check whether the value is numeric
2662
+ var yPositionScale = {}; // check whether the value is numeric
2663
+
2398
2664
  var quantVal = function quantVal(v) {
2399
2665
  return !Number.isNaN(Number(v)) || v === null;
2400
- };
2401
- // const dimensions = keys.filter(key => key !== 'name');
2666
+ }; // const dimensions = keys.filter(key => key !== 'name');
2667
+
2668
+
2402
2669
  var dimensions = [].concat(keys);
2403
2670
  dimensions.forEach(function (d) {
2404
2671
  var val = data.map(function (p) {
2405
2672
  return p[d];
2406
2673
  });
2674
+
2407
2675
  if (val.every(quantVal)) {
2408
2676
  // set numeric axis scale
2409
- yPositionScale[d] = d3_scale_1.scaleLinear().domain(d3_array_1.extent(data, function (p) {
2677
+ yPositionScale[d] = (0, d3_scale_1.scaleLinear)().domain((0, d3_array_1.extent)(data, function (p) {
2410
2678
  return Number(p[d]);
2411
2679
  })).range([chartHeight, 0]);
2412
2680
  } else {
@@ -2415,6 +2683,7 @@ var PureParallelCoordinates = function PureParallelCoordinates(_a) {
2415
2683
  return val.indexOf(v) === i;
2416
2684
  });
2417
2685
  var updatedDomain;
2686
+
2418
2687
  if (chartHeight / categoryDomain.length > minLabelHeight) {
2419
2688
  updatedDomain = _toConsumableArray(categoryDomain);
2420
2689
  } else {
@@ -2424,11 +2693,12 @@ var PureParallelCoordinates = function PureParallelCoordinates(_a) {
2424
2693
  return updatedDomain.includes(row[d]);
2425
2694
  });
2426
2695
  }
2427
- yPositionScale[d] = d3_scale_1.scalePoint().domain(updatedDomain).range([chartHeight, 0]);
2696
+
2697
+ yPositionScale[d] = (0, d3_scale_1.scalePoint)().domain(updatedDomain).range([chartHeight, 0]);
2428
2698
  }
2429
2699
  });
2430
- var xPositionScale = d3_scale_1.scalePoint().padding(axisPadding).range([0, chartWidth]);
2431
- var nullAxisScale = d3_scale_1.scalePoint().padding(0);
2700
+ var xPositionScale = (0, d3_scale_1.scalePoint)().padding(axisPadding).range([0, chartWidth]);
2701
+ var nullAxisScale = (0, d3_scale_1.scalePoint)().padding(0);
2432
2702
  return React.createElement(ParallelCoordinatesChart_1.default, {
2433
2703
  backgroundColor: backgroundColor,
2434
2704
  width: chartWidth,
@@ -2458,6 +2728,7 @@ var PureParallelCoordinates = function PureParallelCoordinates(_a) {
2458
2728
  mode: mode
2459
2729
  });
2460
2730
  };
2731
+
2461
2732
  PureParallelCoordinates.propTypes = {
2462
2733
  backgroundColor: T.string,
2463
2734
  width: T.number,
@@ -2505,49 +2776,49 @@ exports.default = PureParallelCoordinates;
2505
2776
 
2506
2777
  /***/ }),
2507
2778
 
2508
- /***/ 43:
2509
- /***/ (function(module, exports, __webpack_require__) {
2510
-
2511
- "use strict";
2512
-
2513
-
2514
- Object.defineProperty(exports, "__esModule", {
2515
- value: true
2516
- });
2517
- exports.validSortDirs = void 0;
2518
- exports.validSortDirs = ['asc', 'desc', 'none'];
2519
-
2520
- /***/ }),
2521
-
2522
- /***/ 430:
2779
+ /***/ 433:
2523
2780
  /***/ (function(module, exports, __webpack_require__) {
2524
2781
 
2525
2782
  "use strict";
2526
2783
 
2527
2784
 
2528
2785
  var _toConsumableArray = __webpack_require__(8);
2786
+
2529
2787
  var _slicedToArray = __webpack_require__(17);
2788
+
2530
2789
  var __rest = this && this.__rest || function (s, e) {
2531
2790
  var t = {};
2791
+
2532
2792
  for (var p in s) {
2533
2793
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2534
2794
  }
2795
+
2535
2796
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2536
2797
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2537
2798
  }
2538
2799
  return t;
2539
2800
  };
2801
+
2540
2802
  Object.defineProperty(exports, "__esModule", {
2541
2803
  value: true
2542
2804
  });
2805
+
2543
2806
  var React = __webpack_require__(1);
2807
+
2544
2808
  var styled_components_1 = __webpack_require__(4);
2545
- var d3_selection_1 = __webpack_require__(431);
2546
- var d3_brush_1 = __webpack_require__(432);
2547
- var d3_axis_1 = __webpack_require__(433);
2548
- var d3_drag_1 = __webpack_require__(434);
2549
- var rgb_hex_converter_1 = __webpack_require__(160);
2550
- var ParallelCoordinatesCanvas_1 = __webpack_require__(435);
2809
+
2810
+ var d3_selection_1 = __webpack_require__(434);
2811
+
2812
+ var d3_brush_1 = __webpack_require__(435);
2813
+
2814
+ var d3_axis_1 = __webpack_require__(436);
2815
+
2816
+ var d3_drag_1 = __webpack_require__(437);
2817
+
2818
+ var rgb_hex_converter_1 = __webpack_require__(163);
2819
+
2820
+ var ParallelCoordinatesCanvas_1 = __webpack_require__(438);
2821
+
2551
2822
  var ChartDiv = styled_components_1.default.div.withConfig({
2552
2823
  displayName: "ParallelCoordinatesChart__ChartDiv",
2553
2824
  componentId: "sc-1oivyc-0"
@@ -2574,112 +2845,129 @@ var FilterButton = styled_components_1.default.button.attrs({
2574
2845
  })(["margin-left:16px;display:flex;border:none;background:none;color:", ";cursor:pointer;font-size:12px;padding-top:0;padding-bottom:0;padding-left:0;"], function (props) {
2575
2846
  return props.filterButtonColor;
2576
2847
  });
2848
+
2577
2849
  var ParallelCoordinatesChart = function ParallelCoordinatesChart(_a) {
2578
2850
  var props = __rest(_a, []);
2851
+
2579
2852
  var width = props.width,
2580
- height = props.height,
2581
- margin = props.margin,
2582
- axisPadding = props.axisPadding,
2583
- data = props.data,
2584
- dimensions = props.dimensions,
2585
- xPositionScale = props.xPositionScale,
2586
- yPositionScale = props.yPositionScale,
2587
- showNullAxis = props.showNullAxis,
2588
- nullOffsetHeight = props.nullOffsetHeight,
2589
- nullAxisScale = props.nullAxisScale,
2590
- lineColor = props.lineColor,
2591
- lineOpacity = props.lineOpacity,
2592
- backgroundColor = props.backgroundColor,
2593
- axisLineHighlightColor = props.axisLineHighlightColor,
2594
- axisLineColor = props.axisLineColor,
2595
- axisTitleColor = props.axisTitleColor,
2596
- axisLabelColor = props.axisLabelColor,
2597
- filterButtonDisabledColor = props.filterButtonDisabledColor,
2598
- filterButtonActiveColor = props.filterButtonActiveColor,
2599
- filterTextColor = props.filterTextColor,
2600
- truncatedCategoriesFlag = props.truncatedCategoriesFlag,
2601
- truncatedTextColor = props.truncatedTextColor,
2602
- filterSelectionColor = props.filterSelectionColor,
2603
- textShadowColor = props.textShadowColor;
2853
+ height = props.height,
2854
+ margin = props.margin,
2855
+ axisPadding = props.axisPadding,
2856
+ data = props.data,
2857
+ dimensions = props.dimensions,
2858
+ xPositionScale = props.xPositionScale,
2859
+ yPositionScale = props.yPositionScale,
2860
+ showNullAxis = props.showNullAxis,
2861
+ nullOffsetHeight = props.nullOffsetHeight,
2862
+ nullAxisScale = props.nullAxisScale,
2863
+ lineColor = props.lineColor,
2864
+ lineOpacity = props.lineOpacity,
2865
+ backgroundColor = props.backgroundColor,
2866
+ axisLineHighlightColor = props.axisLineHighlightColor,
2867
+ axisLineColor = props.axisLineColor,
2868
+ axisTitleColor = props.axisTitleColor,
2869
+ axisLabelColor = props.axisLabelColor,
2870
+ filterButtonDisabledColor = props.filterButtonDisabledColor,
2871
+ filterButtonActiveColor = props.filterButtonActiveColor,
2872
+ filterTextColor = props.filterTextColor,
2873
+ truncatedCategoriesFlag = props.truncatedCategoriesFlag,
2874
+ truncatedTextColor = props.truncatedTextColor,
2875
+ filterSelectionColor = props.filterSelectionColor,
2876
+ textShadowColor = props.textShadowColor;
2604
2877
  var brushWidth = 16;
2605
- var maxStrLength = 7;
2606
- // axis dragging storage variable
2607
- var dragging = {};
2608
- // brushing event handling variables
2609
- var brush = d3_brush_1.brushY().extent([[-brushWidth / 2, 0], [brushWidth / 2, height]]);
2610
- var updatedTextShadowColor = backgroundColor === 'transparent' ? textShadowColor : backgroundColor;
2611
- // axis dragging feature state declaration
2878
+ var maxStrLength = 7; // axis dragging storage variable
2879
+
2880
+ var dragging = {}; // brushing event handling variables
2881
+
2882
+ var brush = (0, d3_brush_1.brushY)().extent([[-brushWidth / 2, 0], [brushWidth / 2, height]]);
2883
+ var updatedTextShadowColor = backgroundColor === 'transparent' ? textShadowColor : backgroundColor; // axis dragging feature state declaration
2884
+
2612
2885
  var _React$useState = React.useState(dimensions),
2613
- _React$useState2 = _slicedToArray(_React$useState, 2),
2614
- currentDimensions = _React$useState2[0],
2615
- setCurrentDimensions = _React$useState2[1];
2886
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2887
+ currentDimensions = _React$useState2[0],
2888
+ setCurrentDimensions = _React$useState2[1];
2889
+
2616
2890
  var _React$useState3 = React.useState(false),
2617
- _React$useState4 = _slicedToArray(_React$useState3, 2),
2618
- dragStatus = _React$useState4[0],
2619
- setDragStatus = _React$useState4[1]; // brushing feature state declaration
2891
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2892
+ dragStatus = _React$useState4[0],
2893
+ setDragStatus = _React$useState4[1]; // brushing feature state declaration
2894
+
2895
+
2620
2896
  var _React$useState5 = React.useState(data),
2621
- _React$useState6 = _slicedToArray(_React$useState5, 2),
2622
- selectedData = _React$useState6[0],
2623
- setSelectedData = _React$useState6[1];
2897
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
2898
+ selectedData = _React$useState6[0],
2899
+ setSelectedData = _React$useState6[1];
2900
+
2624
2901
  var _React$useState7 = React.useState(new Map()),
2625
- _React$useState8 = _slicedToArray(_React$useState7, 2),
2626
- selections = _React$useState8[0],
2627
- setSelections = _React$useState8[1];
2902
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
2903
+ selections = _React$useState8[0],
2904
+ setSelections = _React$useState8[1];
2905
+
2628
2906
  var _React$useState9 = React.useState(false),
2629
- _React$useState10 = _slicedToArray(_React$useState9, 2),
2630
- filterPromptState = _React$useState10[0],
2631
- setFilterPromptState = _React$useState10[1];
2907
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
2908
+ filterPromptState = _React$useState10[0],
2909
+ setFilterPromptState = _React$useState10[1];
2910
+
2632
2911
  var _React$useState11 = React.useState(filterButtonDisabledColor),
2633
- _React$useState12 = _slicedToArray(_React$useState11, 2),
2634
- filterButtonColor = _React$useState12[0],
2635
- setFilterButtonColor = _React$useState12[1];
2636
- var svgRef = React.useRef(null);
2637
- // update xPositionScale
2912
+ _React$useState12 = _slicedToArray(_React$useState11, 2),
2913
+ filterButtonColor = _React$useState12[0],
2914
+ setFilterButtonColor = _React$useState12[1];
2915
+
2916
+ var svgRef = React.useRef(null); // update xPositionScale
2917
+
2638
2918
  xPositionScale.domain(currentDimensions);
2639
- nullAxisScale.domain(currentDimensions).range([0, width - 2 * axisPadding * xPositionScale.step()]);
2640
- // axis dragging helper functions
2919
+ nullAxisScale.domain(currentDimensions).range([0, width - 2 * axisPadding * xPositionScale.step()]); // axis dragging helper functions
2920
+
2641
2921
  var position = function position(d) {
2642
2922
  var v = dragging[d];
2643
2923
  return v == null ? xPositionScale(d) : v;
2644
2924
  };
2925
+
2645
2926
  var transition = function transition(g) {
2646
2927
  return g.transition().duration(500);
2647
- };
2648
- // clear filter button
2928
+ }; // clear filter button
2929
+
2930
+
2649
2931
  var clearAllFilters = function clearAllFilters() {
2650
- d3_selection_1.select(svgRef.current).selectAll('.brush').call(brush.move, null);
2932
+ (0, d3_selection_1.select)(svgRef.current).selectAll('.brush').call(brush.move, null);
2651
2933
  setSelections(new Map());
2652
2934
  setSelectedData(data);
2653
2935
  setFilterPromptState(false);
2654
2936
  setFilterButtonColor(filterButtonDisabledColor);
2655
- };
2656
- // truncated string to a length for categorical axis label
2937
+ }; // truncated string to a length for categorical axis label
2938
+
2939
+
2657
2940
  var truncate = function truncate(str, maxLength) {
2658
2941
  var updatedSuffix = '...';
2659
2942
  var updateStr = str || 'null';
2943
+
2660
2944
  if (Array.isArray(updateStr)) {
2661
2945
  updateStr = updateStr.join(', ');
2662
2946
  }
2947
+
2663
2948
  if (typeof updateStr === 'string' && updateStr.length > maxLength) {
2664
2949
  updateStr = updateStr.substring(0, maxLength - 1);
2665
2950
  updateStr += updatedSuffix;
2666
2951
  }
2952
+
2667
2953
  return updateStr;
2668
2954
  };
2955
+
2669
2956
  React.useEffect(function () {
2670
2957
  // clean svg before drawing
2671
- var svg = d3_selection_1.select(svgRef.current).html('').attr('height', height + margin.top + margin.bottom).attr('width', width + margin.left + margin.right).append('g').attr('transform', "translate(".concat(margin.left, ",").concat(margin.top, ")"));
2672
- // Add a group element for each dimension
2958
+ var svg = (0, d3_selection_1.select)(svgRef.current).html('').attr('height', height + margin.top + margin.bottom).attr('width', width + margin.left + margin.right).append('g').attr('transform', "translate(".concat(margin.left, ",").concat(margin.top, ")")); // Add a group element for each dimension
2959
+
2673
2960
  var g = svg.selectAll('.dimension').data(currentDimensions).join('g').attr('class', 'dimension').attr('data-test', 'dimension').attr('transform', function (d) {
2674
2961
  return "translate(".concat(xPositionScale(d), ")");
2675
- }).style('cursor', 'ew-resize');
2676
- // axis dragging event handling
2962
+ }).style('cursor', 'ew-resize'); // axis dragging event handling
2963
+
2677
2964
  var dragstarted = function dragstarted(event, d) {
2678
- d3_selection_1.select(event.sourceEvent.currentTarget).selectAll('.axis path').style('stroke', axisLineHighlightColor);
2679
- d3_selection_1.select(event.sourceEvent.currentTarget).selectAll('.axis line').style('stroke', axisLineHighlightColor);
2965
+ (0, d3_selection_1.select)(event.sourceEvent.currentTarget).selectAll('.axis path').style('stroke', axisLineHighlightColor);
2966
+ (0, d3_selection_1.select)(event.sourceEvent.currentTarget).selectAll('.axis line').style('stroke', axisLineHighlightColor);
2680
2967
  dragging[d] = xPositionScale(d);
2681
2968
  setDragStatus(true);
2682
2969
  };
2970
+
2683
2971
  var dragged = function dragged(event, d) {
2684
2972
  dragging[d] = Math.min(width, Math.max(0, event.x));
2685
2973
  currentDimensions.sort(function (a, b) {
@@ -2691,64 +2979,70 @@ var ParallelCoordinatesChart = function ParallelCoordinatesChart(_a) {
2691
2979
  return "translate(".concat(position(p), ")");
2692
2980
  });
2693
2981
  };
2982
+
2694
2983
  function dragended(_event, d) {
2695
2984
  delete dragging[d];
2696
- d3_selection_1.select(this).select('.axis path').style('stroke', axisLineColor);
2697
- d3_selection_1.select(this).selectAll('.axis line').style('stroke', axisLineColor);
2698
- transition(d3_selection_1.select(this).attr('transform', "translate(".concat(xPositionScale(d), ")")));
2985
+ (0, d3_selection_1.select)(this).select('.axis path').style('stroke', axisLineColor);
2986
+ (0, d3_selection_1.select)(this).selectAll('.axis line').style('stroke', axisLineColor);
2987
+ transition((0, d3_selection_1.select)(this).attr('transform', "translate(".concat(xPositionScale(d), ")")));
2699
2988
  setDragStatus(false);
2700
- }
2701
- // Add vertical axis and title.
2989
+ } // Add vertical axis and title.
2990
+
2991
+
2702
2992
  g.append('g').attr('class', 'axis vertical-axis').each(function (d, i, nodes) {
2703
2993
  if (yPositionScale[d].ticks) {
2704
2994
  // numerical axis
2705
- d3_selection_1.select(nodes[i]).call(d3_axis_1.axisLeft(yPositionScale[d])).selectAll('text').append('title').text(function (datum) {
2995
+ (0, d3_selection_1.select)(nodes[i]).call((0, d3_axis_1.axisLeft)(yPositionScale[d])).selectAll('text').append('title').text(function (datum) {
2706
2996
  return datum && datum.toString();
2707
2997
  });
2708
2998
  } else {
2709
2999
  // categorical axis and truncated long labels
2710
- d3_selection_1.select(nodes[i]).call(d3_axis_1.axisLeft(yPositionScale[d]).tickFormat(function (p) {
3000
+ (0, d3_selection_1.select)(nodes[i]).call((0, d3_axis_1.axisLeft)(yPositionScale[d]).tickFormat(function (p) {
2711
3001
  return truncate(p, maxStrLength);
2712
- }))
2713
- // add title to show full value upon hover
3002
+ })) // add title to show full value upon hover
2714
3003
  .selectAll('text').append('title').text(function (datum) {
2715
3004
  return datum && datum.toString();
2716
3005
  });
2717
3006
  }
2718
- }).selectAll('text').attr('fill', axisLabelColor).clone(true).lower().attr('fill', 'none').attr('stroke-width', 2).attr('stroke-linejoin', 'round').attr('stroke', "rgba(".concat(rgb_hex_converter_1.convertHexToRgb(updatedTextShadowColor)[0], ",").concat(rgb_hex_converter_1.convertHexToRgb(updatedTextShadowColor)[1], ",").concat(rgb_hex_converter_1.convertHexToRgb(updatedTextShadowColor)[2], ", ", 0.8, ")"));
3007
+ }).selectAll('text').attr('fill', axisLabelColor).clone(true).lower().attr('fill', 'none').attr('stroke-width', 2).attr('stroke-linejoin', 'round').attr('stroke', "rgba(".concat((0, rgb_hex_converter_1.convertHexToRgb)(updatedTextShadowColor)[0], ",").concat((0, rgb_hex_converter_1.convertHexToRgb)(updatedTextShadowColor)[1], ",").concat((0, rgb_hex_converter_1.convertHexToRgb)(updatedTextShadowColor)[2], ", ", 0.8, ")"));
2719
3008
  g.append('text').attr('class', 'axisTitle').attr('fill', axisTitleColor).attr('font-size', '12px').attr('text-anchor', 'middle').attr('y', -9).text(function (d) {
2720
3009
  return d;
2721
- });
2722
- // drawing the null axis
3010
+ }); // drawing the null axis
3011
+
2723
3012
  if (showNullAxis) {
2724
- var nullAxisOffsetHeight = yPositionScale[currentDimensions[0]].range()[0] + nullOffsetHeight;
2725
- // append null axis and title
2726
- svg.append('g').attr('class', 'axis null-axis').attr('transform', "translate(".concat(xPositionScale.step() * axisPadding, ", ").concat(nullAxisOffsetHeight, ")")).attr('fill', 'none').call(d3_axis_1.axisTop(nullAxisScale).tickFormat(function () {
3013
+ var nullAxisOffsetHeight = yPositionScale[currentDimensions[0]].range()[0] + nullOffsetHeight; // append null axis and title
3014
+
3015
+ svg.append('g').attr('class', 'axis null-axis').attr('transform', "translate(".concat(xPositionScale.step() * axisPadding, ", ").concat(nullAxisOffsetHeight, ")")).attr('fill', 'none').call((0, d3_axis_1.axisTop)(nullAxisScale).tickFormat(function () {
2727
3016
  return '';
2728
3017
  }));
2729
3018
  svg.append('text').attr('text-anchor', 'end').attr('font-size', '11px').attr('x', axisPadding * xPositionScale.step() - 9).attr('y', height + nullOffsetHeight).text('null').attr('fill', axisLabelColor);
2730
- }
2731
- // customize axis line and ticks based on themes
2732
- d3_selection_1.selectAll('.axis .domain').style('stroke', axisLineColor);
2733
- d3_selection_1.selectAll('.axis line').style('stroke', axisLineColor);
2734
- // added dragging event functions to each dimension
2735
- svg.selectAll('.dimension').call(d3_drag_1.drag().on('start', dragstarted).on('drag', dragged).on('end', dragended));
2736
- // brushing event handling
3019
+ } // customize axis line and ticks based on themes
3020
+
3021
+
3022
+ (0, d3_selection_1.selectAll)('.axis .domain').style('stroke', axisLineColor);
3023
+ (0, d3_selection_1.selectAll)('.axis line').style('stroke', axisLineColor); // added dragging event functions to each dimension
3024
+
3025
+ svg.selectAll('.dimension').call((0, d3_drag_1.drag)().on('start', dragstarted).on('drag', dragged).on('end', dragended)); // brushing event handling
3026
+
2737
3027
  var brushStart = function brushStart(event) {
2738
3028
  // prevent brushing event trigger clicking event
2739
3029
  if (event.sourceEvent) {
2740
3030
  event.sourceEvent.stopPropagation();
2741
3031
  }
3032
+
2742
3033
  setFilterPromptState(true);
2743
- setFilterButtonColor(filterButtonActiveColor);
2744
- // style filter selection box rect
2745
- d3_selection_1.selectAll('rect.selection').attr('fill', filterSelectionColor).attr('fill-opacity', '0.3').attr('stroke', 'none').attr('rx', '4px');
2746
- };
2747
- // updated selectedData after brushing
3034
+ setFilterButtonColor(filterButtonActiveColor); // style filter selection box rect
3035
+
3036
+ (0, d3_selection_1.selectAll)('rect.selection').attr('fill', filterSelectionColor).attr('fill-opacity', '0.3').attr('stroke', 'none').attr('rx', '4px');
3037
+ }; // updated selectedData after brushing
3038
+
3039
+
2748
3040
  var brushed = function brushed(_ref, key) {
2749
3041
  var selection = _ref.selection;
3042
+
2750
3043
  if (selection === null) {
2751
3044
  selections.delete(key);
3045
+
2752
3046
  if (selections.size === 0) {
2753
3047
  setFilterButtonColor(filterButtonDisabledColor);
2754
3048
  setFilterPromptState(false);
@@ -2763,29 +3057,33 @@ var ParallelCoordinatesChart = function ParallelCoordinatesChart(_a) {
2763
3057
  // categorical scale (aka scalePoint)
2764
3058
  selections.set(key, [selection[1], selection[0]]);
2765
3059
  }
3060
+
2766
3061
  var selected = [];
2767
3062
  data.forEach(function (d) {
2768
3063
  // Categorical Axis: convert ordinal dimension's values to pixels
2769
3064
  // Numerical Axis: compare numerical values with dataSources
2770
3065
  var active = Array.from(selections).every(function (_ref2) {
2771
3066
  var _ref3 = _slicedToArray(_ref2, 2),
2772
- activeKey = _ref3[0],
2773
- _ref3$ = _slicedToArray(_ref3[1], 2),
2774
- max = _ref3$[0],
2775
- min = _ref3$[1];
3067
+ activeKey = _ref3[0],
3068
+ _ref3$ = _slicedToArray(_ref3[1], 2),
3069
+ max = _ref3$[0],
3070
+ min = _ref3$[1];
3071
+
2776
3072
  var newP = yPositionScale[activeKey].ticks ? d[activeKey] : yPositionScale[activeKey](d[activeKey]);
2777
3073
  return newP >= min && newP <= max;
2778
3074
  });
3075
+
2779
3076
  if (active) {
2780
3077
  selected.push(d);
2781
3078
  }
2782
3079
  });
2783
3080
  setSelectedData(selected);
2784
3081
  };
2785
- brush.on('start', brushStart).on('brush end', brushed);
2786
- // add and store a brush for each axis.
3082
+
3083
+ brush.on('start', brushStart).on('brush end', brushed); // add and store a brush for each axis.
3084
+
2787
3085
  g.append('g').attr('class', 'brush').each(function (_d, i, nodes) {
2788
- d3_selection_1.select(nodes[i]).call(brush);
3086
+ (0, d3_selection_1.select)(nodes[i]).call(brush);
2789
3087
  });
2790
3088
  }, [data, width, height, margin, dimensions, xPositionScale, yPositionScale, selections, axisLabelColor, updatedTextShadowColor, axisTitleColor, showNullAxis, axisLineColor, axisLineHighlightColor, nullOffsetHeight, filterButtonActiveColor, filterButtonDisabledColor, truncatedCategoriesFlag, truncatedTextColor]);
2791
3089
  return React.createElement("div", null, React.createElement(ChartDiv, {
@@ -2842,39 +3140,40 @@ var ParallelCoordinatesChart = function ParallelCoordinatesChart(_a) {
2842
3140
  "data-testid": "truncated-data-warning"
2843
3141
  }, "Note: Your data is currently truncated due to a high amount of categorical values"))));
2844
3142
  };
3143
+
2845
3144
  exports.default = ParallelCoordinatesChart;
2846
3145
 
2847
3146
  /***/ }),
2848
3147
 
2849
- /***/ 431:
3148
+ /***/ 434:
2850
3149
  /***/ (function(module, exports) {
2851
3150
 
2852
3151
  module.exports = require("d3-selection");
2853
3152
 
2854
3153
  /***/ }),
2855
3154
 
2856
- /***/ 432:
3155
+ /***/ 435:
2857
3156
  /***/ (function(module, exports) {
2858
3157
 
2859
3158
  module.exports = require("d3-brush");
2860
3159
 
2861
3160
  /***/ }),
2862
3161
 
2863
- /***/ 433:
3162
+ /***/ 436:
2864
3163
  /***/ (function(module, exports) {
2865
3164
 
2866
3165
  module.exports = require("d3-axis");
2867
3166
 
2868
3167
  /***/ }),
2869
3168
 
2870
- /***/ 434:
3169
+ /***/ 437:
2871
3170
  /***/ (function(module, exports) {
2872
3171
 
2873
3172
  module.exports = require("d3-drag");
2874
3173
 
2875
3174
  /***/ }),
2876
3175
 
2877
- /***/ 435:
3176
+ /***/ 438:
2878
3177
  /***/ (function(module, exports, __webpack_require__) {
2879
3178
 
2880
3179
  "use strict";
@@ -2882,45 +3181,53 @@ module.exports = require("d3-drag");
2882
3181
 
2883
3182
  var __rest = this && this.__rest || function (s, e) {
2884
3183
  var t = {};
3184
+
2885
3185
  for (var p in s) {
2886
3186
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
2887
3187
  }
3188
+
2888
3189
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
2889
3190
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
2890
3191
  }
2891
3192
  return t;
2892
3193
  };
3194
+
2893
3195
  Object.defineProperty(exports, "__esModule", {
2894
3196
  value: true
2895
3197
  });
3198
+
2896
3199
  var React = __webpack_require__(1);
2897
- var rgb_hex_converter_1 = __webpack_require__(160);
3200
+
3201
+ var rgb_hex_converter_1 = __webpack_require__(163);
3202
+
2898
3203
  var ParallelCoordinatesCanvas = function ParallelCoordinatesCanvas(_a) {
2899
3204
  var props = __rest(_a, []);
3205
+
2900
3206
  var width = props.width,
2901
- height = props.height,
2902
- margin = props.margin,
2903
- data = props.data,
2904
- selectedData = props.selectedData,
2905
- currentDimensions = props.currentDimensions,
2906
- xPositionScale = props.xPositionScale,
2907
- yPositionScale = props.yPositionScale,
2908
- dragStatus = props.dragStatus,
2909
- showNullAxis = props.showNullAxis,
2910
- nullOffsetHeight = props.nullOffsetHeight,
2911
- lineColor = props.lineColor,
2912
- lineOpacity = props.lineOpacity,
2913
- backgroundColor = props.backgroundColor;
3207
+ height = props.height,
3208
+ margin = props.margin,
3209
+ data = props.data,
3210
+ selectedData = props.selectedData,
3211
+ currentDimensions = props.currentDimensions,
3212
+ xPositionScale = props.xPositionScale,
3213
+ yPositionScale = props.yPositionScale,
3214
+ dragStatus = props.dragStatus,
3215
+ showNullAxis = props.showNullAxis,
3216
+ nullOffsetHeight = props.nullOffsetHeight,
3217
+ lineColor = props.lineColor,
3218
+ lineOpacity = props.lineOpacity,
3219
+ backgroundColor = props.backgroundColor;
2914
3220
  var foregroundRef = React.useRef(null);
2915
- var backgroundRef = React.useRef(null);
2916
- // Get the device pixel ratio, falling back to 1.
2917
- var dpr = window.devicePixelRatio || 1;
2918
- // draw path on two layers of canvas
3221
+ var backgroundRef = React.useRef(null); // Get the device pixel ratio, falling back to 1.
3222
+
3223
+ var dpr = window.devicePixelRatio || 1; // draw path on two layers of canvas
3224
+
2919
3225
  var path = function path(d, ctx, dimensions) {
2920
3226
  if (showNullAxis) {
2921
3227
  ctx.beginPath();
2922
3228
  dimensions.forEach(function (p, i) {
2923
3229
  var updatedYPosition;
3230
+
2924
3231
  if (d[p] == null) {
2925
3232
  // add nullOffsetHeight to the bottom position of each axes and make it as the new yPosition of the null data
2926
3233
  updatedYPosition = yPositionScale[p].range()[0] + nullOffsetHeight;
@@ -2928,6 +3235,7 @@ var ParallelCoordinatesCanvas = function ParallelCoordinatesCanvas(_a) {
2928
3235
  // otherwise, yPosition stays at the same scale
2929
3236
  updatedYPosition = yPositionScale[p](d[p]);
2930
3237
  }
3238
+
2931
3239
  if (i === 0) {
2932
3240
  ctx.moveTo(xPositionScale(p), updatedYPosition);
2933
3241
  } else {
@@ -2945,6 +3253,7 @@ var ParallelCoordinatesCanvas = function ParallelCoordinatesCanvas(_a) {
2945
3253
  ctx.lineTo(xPositionScale(p), yPositionScale[p](d[p]));
2946
3254
  ctx.stroke();
2947
3255
  }
3256
+
2948
3257
  if (d[p] !== null) {
2949
3258
  prev = p;
2950
3259
  } else {
@@ -2952,46 +3261,48 @@ var ParallelCoordinatesCanvas = function ParallelCoordinatesCanvas(_a) {
2952
3261
  }
2953
3262
  });
2954
3263
  }
2955
- };
2956
- // draw all the lines on background canvas
3264
+ }; // draw all the lines on background canvas
3265
+
3266
+
2957
3267
  React.useEffect(function () {
2958
3268
  var backgroundCanvas = backgroundRef.current;
2959
3269
  var background = backgroundCanvas.getContext('2d');
2960
3270
  backgroundCanvas.width = (width + margin.left + margin.right) * dpr;
2961
- backgroundCanvas.height = (height + margin.top + margin.bottom) * dpr;
2962
- // ensure all drawing operations are scaled
3271
+ backgroundCanvas.height = (height + margin.top + margin.bottom) * dpr; // ensure all drawing operations are scaled
3272
+
2963
3273
  background.scale(dpr, dpr);
2964
3274
  background.clearRect(0, 0, width + margin.left + margin.right, height + margin.top + margin.bottom);
2965
3275
  background.translate(margin.left, margin.top);
3276
+
2966
3277
  if (backgroundColor !== 'transparent') {
2967
- background.strokeStyle = "rgba(".concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[0], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[1], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[2], ", ").concat(lineOpacity, ")");
3278
+ background.strokeStyle = "rgba(".concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[0], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[1], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[2], ", ").concat(lineOpacity, ")");
2968
3279
  data.forEach(function (d) {
2969
3280
  return path(d, background, currentDimensions);
2970
- });
2971
- // backgroundColor-ed or default page color mask btw background and foreground lines
3281
+ }); // backgroundColor-ed or default page color mask btw background and foreground lines
3282
+
2972
3283
  background.globalAlpha = 0.7;
2973
3284
  background.fillStyle = backgroundColor;
2974
3285
  background.fillRect(-10, -10, width + margin.right, height + margin.bottom);
2975
3286
  } else {
2976
3287
  // set the background lines color to be 0.1 if backgroundColor is transparent
2977
- background.strokeStyle = "rgba(".concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[0], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[1], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[2], ", 0.1)");
3288
+ background.strokeStyle = "rgba(".concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[0], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[1], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[2], ", 0.1)");
2978
3289
  data.forEach(function (d) {
2979
3290
  return path(d, background, currentDimensions);
2980
3291
  });
2981
3292
  }
2982
- }, [data, height, margin, width, currentDimensions, showNullAxis, nullOffsetHeight, lineColor, lineOpacity, backgroundColor, dpr]);
2983
- // draw lines on the foreground canvas
3293
+ }, [data, height, margin, width, currentDimensions, showNullAxis, nullOffsetHeight, lineColor, lineOpacity, backgroundColor, dpr]); // draw lines on the foreground canvas
2984
3294
  // when selectedData is updated via brushing, re-draw the foreground canvas
3295
+
2985
3296
  React.useEffect(function () {
2986
3297
  var foregroundCanvas = foregroundRef.current;
2987
3298
  var foreground = foregroundCanvas.getContext('2d');
2988
3299
  foregroundCanvas.width = (width + margin.left + margin.right) * dpr;
2989
- foregroundCanvas.height = (height + margin.top + margin.bottom) * dpr;
2990
- // ensure all drawing operations are scaled
3300
+ foregroundCanvas.height = (height + margin.top + margin.bottom) * dpr; // ensure all drawing operations are scaled
3301
+
2991
3302
  foreground.scale(dpr, dpr);
2992
3303
  foreground.clearRect(0, 0, width + margin.left + margin.right, height + margin.top + margin.bottom);
2993
3304
  foreground.translate(margin.left, margin.top);
2994
- foreground.strokeStyle = "rgba(".concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[0], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[1], ", ").concat(rgb_hex_converter_1.convertHexToRgb(lineColor)[2], ", ").concat(lineOpacity, ")");
3305
+ foreground.strokeStyle = "rgba(".concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[0], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[1], ", ").concat((0, rgb_hex_converter_1.convertHexToRgb)(lineColor)[2], ", ").concat(lineOpacity, ")");
2995
3306
  selectedData.forEach(function (d) {
2996
3307
  return path(d, foreground, currentDimensions);
2997
3308
  });
@@ -3018,11 +3329,12 @@ var ParallelCoordinatesCanvas = function ParallelCoordinatesCanvas(_a) {
3018
3329
  }
3019
3330
  }));
3020
3331
  };
3332
+
3021
3333
  exports.default = ParallelCoordinatesCanvas;
3022
3334
 
3023
3335
  /***/ }),
3024
3336
 
3025
- /***/ 436:
3337
+ /***/ 439:
3026
3338
  /***/ (function(module, exports, __webpack_require__) {
3027
3339
 
3028
3340
  "use strict";
@@ -3031,17 +3343,29 @@ exports.default = ParallelCoordinatesCanvas;
3031
3343
  Object.defineProperty(exports, "__esModule", {
3032
3344
  value: true
3033
3345
  });
3346
+
3034
3347
  var i18n_1 = __webpack_require__(2);
3348
+
3035
3349
  var schemaUtils_1 = __webpack_require__(16);
3350
+
3036
3351
  var pick_1 = __webpack_require__(23);
3352
+
3037
3353
  var variables_1 = __webpack_require__(11);
3354
+
3038
3355
  var visualization_color_palettes_1 = __webpack_require__(51);
3356
+
3039
3357
  var visualization_icons_1 = __webpack_require__(52);
3040
- var placeholders_1 = __webpack_require__(49);
3358
+
3359
+ var placeholders_1 = __webpack_require__(50);
3360
+
3041
3361
  var VizBehavior_1 = __webpack_require__(6);
3362
+
3042
3363
  var configUtils_1 = __webpack_require__(20);
3043
- var VizCategory_1 = __webpack_require__(35);
3364
+
3365
+ var VizCategory_1 = __webpack_require__(36);
3366
+
3044
3367
  var BackgroundColor_1 = __webpack_require__(53);
3368
+
3045
3369
  var dataContract = {
3046
3370
  requiredDataSources: [{
3047
3371
  name: 'primary',
@@ -3085,7 +3409,7 @@ var optionsSchema = {
3085
3409
  };
3086
3410
  var themes = {
3087
3411
  defaultBackgroundColor: function defaultBackgroundColor(props) {
3088
- return pick_1.default({
3412
+ return (0, pick_1.default)({
3089
3413
  enterprise: {
3090
3414
  dark: variables_1.default.black(props),
3091
3415
  light: variables_1.default.backgroundColor(props)
@@ -3094,7 +3418,7 @@ var themes = {
3094
3418
  })(props);
3095
3419
  },
3096
3420
  axisLineColor: function axisLineColor(props) {
3097
- return pick_1.default({
3421
+ return (0, pick_1.default)({
3098
3422
  enterprise: {
3099
3423
  dark: variables_1.default.gray45(props),
3100
3424
  light: variables_1.default.gray60(props)
@@ -3106,13 +3430,13 @@ var themes = {
3106
3430
  })(props);
3107
3431
  },
3108
3432
  axisLineHighlightColor: function axisLineHighlightColor(props) {
3109
- return pick_1.default({
3433
+ return (0, pick_1.default)({
3110
3434
  enterprise: variables_1.default.textColor(props),
3111
3435
  prisma: variables_1.default.contentColorActive(props)
3112
3436
  })(props);
3113
3437
  },
3114
3438
  axisTitleColor: function axisTitleColor(props) {
3115
- return pick_1.default({
3439
+ return (0, pick_1.default)({
3116
3440
  enterprise: {
3117
3441
  dark: variables_1.default.textGray(props),
3118
3442
  light: variables_1.default.textColor(props)
@@ -3121,7 +3445,7 @@ var themes = {
3121
3445
  })(props);
3122
3446
  },
3123
3447
  axisLabelColor: function axisLabelColor(props) {
3124
- return pick_1.default({
3448
+ return (0, pick_1.default)({
3125
3449
  enterprise: {
3126
3450
  dark: variables_1.default.textGray(props),
3127
3451
  light: variables_1.default.textColor(props)
@@ -3130,19 +3454,19 @@ var themes = {
3130
3454
  })(props);
3131
3455
  },
3132
3456
  filterButtonDisabledColor: function filterButtonDisabledColor(props) {
3133
- return pick_1.default({
3457
+ return (0, pick_1.default)({
3134
3458
  enterprise: variables_1.default.textDisabledColor(props),
3135
3459
  prisma: variables_1.default.contentColorDisabled(props)
3136
3460
  })(props);
3137
3461
  },
3138
3462
  filterButtonActiveColor: function filterButtonActiveColor(props) {
3139
- return pick_1.default({
3463
+ return (0, pick_1.default)({
3140
3464
  enterprise: variables_1.default.focusColor(props),
3141
3465
  prisma: variables_1.default.interactiveColorPrimary(props)
3142
3466
  })(props);
3143
3467
  },
3144
3468
  filterTextColor: function filterTextColor(props) {
3145
- return pick_1.default({
3469
+ return (0, pick_1.default)({
3146
3470
  enterprise: {
3147
3471
  dark: variables_1.default.textGray(props),
3148
3472
  light: variables_1.default.textColor(props)
@@ -3151,13 +3475,13 @@ var themes = {
3151
3475
  })(props);
3152
3476
  },
3153
3477
  truncatedTextColor: function truncatedTextColor(props) {
3154
- return pick_1.default({
3478
+ return (0, pick_1.default)({
3155
3479
  enterprise: variables_1.default.textGray(props),
3156
3480
  prisma: variables_1.default.contentColorMuted(props)
3157
3481
  })(props);
3158
3482
  },
3159
3483
  filterSelectionColor: function filterSelectionColor(props) {
3160
- return pick_1.default({
3484
+ return (0, pick_1.default)({
3161
3485
  enterprise: {
3162
3486
  dark: '#FFFFFF',
3163
3487
  light: '#000000'
@@ -3169,7 +3493,7 @@ var themes = {
3169
3493
  })(props);
3170
3494
  },
3171
3495
  textShadowColor: function textShadowColor(props) {
3172
- return pick_1.default({
3496
+ return (0, pick_1.default)({
3173
3497
  enterprise: {
3174
3498
  dark: variables_1.default.black(props),
3175
3499
  light: variables_1.default.backgroundColor(props)
@@ -3180,9 +3504,9 @@ var themes = {
3180
3504
  };
3181
3505
  var EDITOR_LABEL_WIDTH = 100;
3182
3506
  var editorConfig = [{
3183
- label: i18n_1._('Data display'),
3507
+ label: (0, i18n_1._)('Data display'),
3184
3508
  layout: [[{
3185
- label: i18n_1._('Show null axis'),
3509
+ label: (0, i18n_1._)('Show null axis'),
3186
3510
  option: 'showNullAxis',
3187
3511
  editor: 'editor.toggle',
3188
3512
  editorProps: {
@@ -3190,40 +3514,43 @@ var editorConfig = [{
3190
3514
  }
3191
3515
  }]]
3192
3516
  }, {
3193
- label: i18n_1._('Color and style'),
3517
+ label: (0, i18n_1._)('Color and style'),
3194
3518
  layout: [[{
3195
- label: i18n_1._('Lines'),
3519
+ label: (0, i18n_1._)('Lines'),
3196
3520
  option: 'lineColor',
3197
3521
  editor: 'editor.color',
3198
3522
  editorProps: {
3199
3523
  themes: themes
3200
3524
  }
3201
3525
  }, {
3202
- label: i18n_1._('Line opacity (%)'),
3526
+ label: (0, i18n_1._)('Line opacity (%)'),
3203
3527
  option: 'lineOpacity',
3204
3528
  editor: 'editor.percent',
3205
3529
  editorProps: {
3206
3530
  themes: themes,
3207
3531
  min: 0
3208
3532
  }
3209
- }], BackgroundColor_1.default({
3533
+ }], (0, BackgroundColor_1.default)({
3210
3534
  themes: themes
3211
3535
  })]
3212
3536
  }];
3213
3537
  /**
3214
3538
  * visualization configuration
3215
3539
  */
3540
+
3216
3541
  var config = {
3217
3542
  /**
3218
3543
  * unique viz key
3219
3544
  */
3220
3545
  key: 'splunk.parallelcoordinates',
3546
+
3221
3547
  /**
3222
3548
  * viz name
3223
3549
  */
3224
- name: i18n_1._('Parallel coordinates'),
3550
+ name: (0, i18n_1._)('Parallel coordinates'),
3225
3551
  category: VizCategory_1.VizCategory.CORRELATION,
3226
3552
  status: 'preview',
3553
+
3227
3554
  /**
3228
3555
  * viz icon
3229
3556
  */
@@ -3238,7 +3565,7 @@ var config = {
3238
3565
  themes: themes,
3239
3566
  requiredProps: []
3240
3567
  };
3241
- exports.default = configUtils_1.enhanceConfig(config);
3568
+ exports.default = (0, configUtils_1.enhanceConfig)(config);
3242
3569
 
3243
3570
  /***/ }),
3244
3571
 
@@ -3252,7 +3579,9 @@ Object.defineProperty(exports, "__esModule", {
3252
3579
  value: true
3253
3580
  });
3254
3581
  exports.useDeepMemo = void 0;
3582
+
3255
3583
  var react_1 = __webpack_require__(1);
3584
+
3256
3585
  var lodash_1 = __webpack_require__(3);
3257
3586
  /**
3258
3587
  * This hook evaluates and stores the result of a passed function and only
@@ -3267,16 +3596,21 @@ var lodash_1 = __webpack_require__(3);
3267
3596
  * @param fn the function to be executed and
3268
3597
  * @param dependencies an array of dependencies
3269
3598
  */
3599
+
3600
+
3270
3601
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
3271
- var ref = react_1.useRef();
3272
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
3602
+ var ref = (0, react_1.useRef)();
3603
+
3604
+ if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
3273
3605
  ref.current = {
3274
3606
  dependencies: dependencies,
3275
3607
  value: fn()
3276
3608
  };
3277
3609
  }
3610
+
3278
3611
  return ref.current.value;
3279
3612
  };
3613
+
3280
3614
  exports.useDeepMemo = useDeepMemo;
3281
3615
 
3282
3616
  /***/ }),
@@ -3291,19 +3625,27 @@ Object.defineProperty(exports, "__esModule", {
3291
3625
  value: true
3292
3626
  });
3293
3627
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
3628
+
3294
3629
  var React = __webpack_require__(1);
3630
+
3295
3631
  var T = __webpack_require__(0);
3632
+
3296
3633
  var i18n_1 = __webpack_require__(2);
3634
+
3297
3635
  var Message_1 = __webpack_require__(10);
3636
+
3298
3637
  var FixedSizeContainer_1 = __webpack_require__(13);
3299
3638
  /**
3300
3639
  * @method isMissing
3301
3640
  * @param {any} v
3302
3641
  * @returns {boolean} true if the input value === null or undefined
3303
3642
  */
3643
+
3644
+
3304
3645
  var isMissing = function isMissing(v) {
3305
3646
  return v === null || v === undefined;
3306
3647
  };
3648
+
3307
3649
  exports.isMissing = isMissing;
3308
3650
  /**
3309
3651
  * @method misskingKeys
@@ -3311,11 +3653,13 @@ exports.isMissing = isMissing;
3311
3653
  * @param {object} target
3312
3654
  * @returns {string[]} the keys of missing required props
3313
3655
  */
3656
+
3314
3657
  var missingKeys = function missingKeys(keys, target) {
3315
3658
  return keys.filter(function (k) {
3316
- return exports.isMissing(target[k]);
3659
+ return (0, exports.isMissing)(target[k]);
3317
3660
  });
3318
3661
  };
3662
+
3319
3663
  exports.missingKeys = missingKeys;
3320
3664
  var propTypes = {
3321
3665
  width: T.oneOfType([T.string, T.number]),
@@ -3329,24 +3673,26 @@ var propTypes = {
3329
3673
  * @param {MissingPropsProps} props
3330
3674
  * @returns {React.ReactElement}
3331
3675
  */
3676
+
3332
3677
  var MissingPropsMessage = function MissingPropsMessage(props) {
3333
3678
  var width = props.width,
3334
- height = props.height,
3335
- missingProps = props.missingProps;
3679
+ height = props.height,
3680
+ missingProps = props.missingProps;
3336
3681
  return React.createElement(Message_1.default, {
3337
3682
  "data-test": "message",
3338
3683
  width: width,
3339
3684
  height: height,
3340
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
3685
+ message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
3341
3686
  });
3342
3687
  };
3688
+
3343
3689
  exports.MissingPropsMessage = MissingPropsMessage;
3344
3690
  exports.MissingPropsMessage.propTypes = propTypes;
3345
3691
  exports.MissingPropsMessage.defaultProps = {
3346
3692
  width: '100%',
3347
3693
  height: 250
3348
3694
  };
3349
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
3695
+ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
3350
3696
 
3351
3697
  /***/ }),
3352
3698
 
@@ -3359,15 +3705,19 @@ exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
3359
3705
  Object.defineProperty(exports, "__esModule", {
3360
3706
  value: true
3361
3707
  });
3708
+
3362
3709
  var React = __webpack_require__(1);
3710
+
3363
3711
  var styled_components_1 = __webpack_require__(4);
3712
+
3364
3713
  var hocUtils_1 = __webpack_require__(15);
3714
+
3365
3715
  var Cover = styled_components_1.default.div.withConfig({
3366
3716
  displayName: "withEditModeCover__Cover",
3367
3717
  componentId: "sc-1gsbnxb-0"
3368
3718
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3369
3719
  var Blocker = styled_components_1.default.div.attrs({
3370
- 'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
3720
+ 'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
3371
3721
  }).withConfig({
3372
3722
  displayName: "withEditModeCover__Blocker",
3373
3723
  componentId: "sc-1gsbnxb-1"
@@ -3378,6 +3728,7 @@ var Blocker = styled_components_1.default.div.attrs({
3378
3728
  * @param {ExtendedDashViz} Visualization
3379
3729
  * @returns {ExtendedDashViz} Wrapper
3380
3730
  */
3731
+
3381
3732
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
3382
3733
  var Wrapper = function Wrapper(props) {
3383
3734
  var mode = props.mode;
@@ -3386,12 +3737,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
3386
3737
  "data-test": "edit-mode-cover"
3387
3738
  }));
3388
3739
  };
3389
- hocUtils_1.extendStaticWrapperProps({
3740
+
3741
+ (0, hocUtils_1.extendStaticWrapperProps)({
3390
3742
  Wrapper: Wrapper,
3391
3743
  Visualization: Visualization
3392
3744
  });
3393
3745
  return Wrapper;
3394
3746
  };
3747
+
3395
3748
  exports.default = withEditModeCover;
3396
3749
 
3397
3750
  /***/ }),
@@ -3405,27 +3758,37 @@ exports.default = withEditModeCover;
3405
3758
  Object.defineProperty(exports, "__esModule", {
3406
3759
  value: true
3407
3760
  });
3761
+
3408
3762
  var React = __webpack_require__(1);
3763
+
3409
3764
  var colorUtils_1 = __webpack_require__(12);
3765
+
3410
3766
  var variables_1 = __webpack_require__(11);
3411
- var IconPlaceholder_1 = __webpack_require__(31);
3767
+
3768
+ var IconPlaceholder_1 = __webpack_require__(32);
3769
+
3412
3770
  var VizBehavior_1 = __webpack_require__(6);
3771
+
3413
3772
  var hocUtils_1 = __webpack_require__(15);
3773
+
3414
3774
  var withPlaceholder = function withPlaceholder(Visualization) {
3415
3775
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
3416
3776
  var config = Visualization.config;
3417
3777
  var themes = config.themes;
3778
+
3418
3779
  var Wrapper = function Wrapper(props) {
3419
3780
  var _a, _b;
3781
+
3420
3782
  var dataSources = props.dataSources,
3421
- loading = props.loading,
3422
- options = props.options,
3423
- height = props.height,
3424
- width = props.width;
3783
+ loading = props.loading,
3784
+ options = props.options,
3785
+ height = props.height,
3786
+ width = props.width;
3425
3787
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
3426
- var bgColorFromTheme = colorUtils_1.isColor(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
3788
+ var bgColorFromTheme = (0, colorUtils_1.isColor)(options === null || options === void 0 ? void 0 : options.backgroundColor) ? options === null || options === void 0 ? void 0 : options.backgroundColor : (_a = themes === null || themes === void 0 ? void 0 : themes.defaultBackgroundColor) === null || _a === void 0 ? void 0 : _a.call(themes, props);
3427
3789
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
3428
3790
  var iconColor = variables_1.default.contentColorActive(props);
3791
+
3429
3792
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
3430
3793
  return React.createElement(IconPlaceholder_1.default, {
3431
3794
  "data-test": "icon-placeholder",
@@ -3436,14 +3799,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
3436
3799
  iconColor: iconColor
3437
3800
  });
3438
3801
  }
3802
+
3439
3803
  return React.createElement(Visualization, Object.assign({}, props));
3440
3804
  };
3441
- hocUtils_1.extendStaticWrapperProps({
3805
+
3806
+ (0, hocUtils_1.extendStaticWrapperProps)({
3442
3807
  Wrapper: Wrapper,
3443
3808
  Visualization: Visualization
3444
3809
  });
3445
3810
  return Wrapper;
3446
3811
  };
3812
+
3447
3813
  exports.default = withPlaceholder;
3448
3814
 
3449
3815
  /***/ }),
@@ -3451,14 +3817,14 @@ exports.default = withPlaceholder;
3451
3817
  /***/ 49:
3452
3818
  /***/ (function(module, exports) {
3453
3819
 
3454
- module.exports = require("@splunk/visualization-icons/placeholders");
3820
+ module.exports = require("@splunk/visualizations-shared/colorConstants");
3455
3821
 
3456
3822
  /***/ }),
3457
3823
 
3458
3824
  /***/ 50:
3459
3825
  /***/ (function(module, exports) {
3460
3826
 
3461
- module.exports = require("@splunk/visualizations-shared/colorConstants");
3827
+ module.exports = require("@splunk/visualization-icons/placeholders");
3462
3828
 
3463
3829
  /***/ }),
3464
3830
 
@@ -3485,13 +3851,15 @@ module.exports = require("@splunk/visualization-icons");
3485
3851
  Object.defineProperty(exports, "__esModule", {
3486
3852
  value: true
3487
3853
  });
3854
+
3488
3855
  var i18n_1 = __webpack_require__(2);
3856
+
3489
3857
  var background = function background(_ref) {
3490
3858
  var label = _ref.label,
3491
- themes = _ref.themes,
3492
- labelPosition = _ref.labelPosition;
3859
+ themes = _ref.themes,
3860
+ labelPosition = _ref.labelPosition;
3493
3861
  return [{
3494
- label: i18n_1._(label || 'Background'),
3862
+ label: (0, i18n_1._)(label || 'Background'),
3495
3863
  option: 'backgroundColor',
3496
3864
  editor: 'editor.color',
3497
3865
  editorProps: {
@@ -3500,6 +3868,7 @@ var background = function background(_ref) {
3500
3868
  }
3501
3869
  }];
3502
3870
  };
3871
+
3503
3872
  exports.default = background;
3504
3873
 
3505
3874
  /***/ }),
@@ -3522,6 +3891,7 @@ Object.defineProperty(exports, "__esModule", {
3522
3891
  });
3523
3892
  exports.VizBehavior = void 0;
3524
3893
  var VizBehavior;
3894
+
3525
3895
  (function (VizBehavior) {
3526
3896
  /**
3527
3897
  * Dynamic Options Behavior.
@@ -3541,6 +3911,7 @@ var VizBehavior;
3541
3911
  * missing.
3542
3912
  * @type {string}
3543
3913
  */
3914
+
3544
3915
  VizBehavior["PLACEHOLDER"] = "placeholder";
3545
3916
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3546
3917
  VizBehavior["TRELLIS"] = "trellis";
@@ -3548,7 +3919,7 @@ var VizBehavior;
3548
3919
 
3549
3920
  /***/ }),
3550
3921
 
3551
- /***/ 63:
3922
+ /***/ 64:
3552
3923
  /***/ (function(module, exports) {
3553
3924
 
3554
3925
  module.exports = require("d3-array");
@@ -3576,7 +3947,7 @@ module.exports = require("@babel/runtime/helpers/classCallCheck");
3576
3947
 
3577
3948
  /***/ }),
3578
3949
 
3579
- /***/ 91:
3950
+ /***/ 93:
3580
3951
  /***/ (function(module, exports) {
3581
3952
 
3582
3953
  module.exports = require("d3-scale");