@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
package/Punchcard.js CHANGED
@@ -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 = 441);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 444);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ({
@@ -120,7 +120,7 @@ module.exports = require("@splunk/themes/variables");
120
120
 
121
121
  /***/ }),
122
122
 
123
- /***/ 112:
123
+ /***/ 113:
124
124
  /***/ (function(module, exports) {
125
125
 
126
126
  module.exports = require("lodash/find");
@@ -143,40 +143,46 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
143
143
  Object.defineProperty(exports, "__esModule", {
144
144
  value: true
145
145
  });
146
+
146
147
  var React = __webpack_require__(1);
148
+
147
149
  var styled_components_1 = __webpack_require__(4);
150
+
148
151
  var SizeAwareWrapper_1 = __webpack_require__(19);
152
+
149
153
  var style_1 = __webpack_require__(14);
154
+
150
155
  var colorUtils_1 = __webpack_require__(12);
156
+
151
157
  var Item = styled_components_1.default.div.attrs(function (_ref) {
152
158
  var width = _ref.width;
153
159
  return {
154
160
  style: {
155
- width: style_1.toPx(width)
161
+ width: (0, style_1.toPx)(width)
156
162
  }
157
163
  };
158
164
  }).withConfig({
159
165
  displayName: "FixedSizeContainer__Item",
160
166
  componentId: "sc-1yhgpod-0"
161
167
  })(["position:relative;background-color:", "};"], function (props) {
162
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
163
- });
164
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
168
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
169
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
170
+
165
171
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
166
172
  var width = _ref2.width,
167
- height = _ref2.height;
173
+ height = _ref2.height;
168
174
  return {
169
175
  style: Object.assign(Object.assign({}, width && {
170
- width: style_1.toPx(width)
176
+ width: (0, style_1.toPx)(width)
171
177
  }), height && {
172
- height: style_1.toPx(height)
178
+ height: (0, style_1.toPx)(height)
173
179
  })
174
180
  };
175
181
  }).withConfig({
176
182
  displayName: "FixedSizeContainer__FixSizeItem",
177
183
  componentId: "sc-1yhgpod-1"
178
184
  })(["position:relative;flex-direction:column;flex:1;display:flex;background-color:", "};"], function (props) {
179
- return colorUtils_1.isColor(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
185
+ return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
180
186
  });
181
187
  var ItemContent = styled_components_1.default.div.withConfig({
182
188
  displayName: "FixedSizeContainer__ItemContent",
@@ -186,11 +192,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
186
192
  displayName: "FixedSizeContainer__FixSizeItemContent",
187
193
  componentId: "sc-1yhgpod-3"
188
194
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
195
+
189
196
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
190
197
  var FixedSizeContainer = function FixedSizeContainer(props) {
191
198
  var width = props.width,
192
- height = props.height,
193
- backgroundColor = props.backgroundColor;
199
+ height = props.height,
200
+ backgroundColor = props.backgroundColor;
201
+
194
202
  if (!height) {
195
203
  return React.createElement(Item, {
196
204
  "data-test": "item",
@@ -198,36 +206,39 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
198
206
  backgroundColor: backgroundColor
199
207
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
200
208
  }
209
+
201
210
  return React.createElement(FixSizeItem, {
202
211
  "data-test": "fix-size-item",
203
- "data-splunk-visualization-version": "25.13.1 - ea48ec41e",
212
+ "data-splunk-visualization-version": "26.1.0 - fc8bf8d77",
204
213
  width: width,
205
214
  height: height,
206
215
  backgroundColor: backgroundColor
207
216
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
208
217
  var newWidth = _ref3.width,
209
- newHeight = _ref3.height;
218
+ newHeight = _ref3.height;
210
219
  return React.createElement(Viz, Object.assign({}, props, {
211
220
  width: newWidth,
212
221
  height: newHeight
213
222
  }));
214
223
  })));
215
224
  };
225
+
216
226
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
217
227
  return FixedSizeContainer;
218
228
  };
229
+
219
230
  exports.default = withFixedSizeContainer;
220
231
 
221
232
  /***/ }),
222
233
 
223
- /***/ 136:
234
+ /***/ 138:
224
235
  /***/ (function(module, exports) {
225
236
 
226
237
  module.exports = require("lodash/findIndex");
227
238
 
228
239
  /***/ }),
229
240
 
230
- /***/ 137:
241
+ /***/ 139:
231
242
  /***/ (function(module, exports) {
232
243
 
233
244
  module.exports = require("lodash/flattenDeep");
@@ -257,9 +268,10 @@ exports.extendStaticWrapperProps = void 0;
257
268
  * @param {DashboardVizType} props.Wrapper
258
269
  * @param {DashboardVizType} props.Visualization
259
270
  */
271
+
260
272
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
261
273
  var Wrapper = _ref.Wrapper,
262
- Visualization = _ref.Visualization;
274
+ Visualization = _ref.Visualization;
263
275
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
264
276
  extendProperties.forEach(function (prop) {
265
277
  if (Visualization[prop]) {
@@ -268,6 +280,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
268
280
  }
269
281
  });
270
282
  };
283
+
271
284
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
272
285
 
273
286
  /***/ }),
@@ -279,17 +292,17 @@ module.exports = require("@splunk/visualizations-shared/schemaUtils");
279
292
 
280
293
  /***/ }),
281
294
 
282
- /***/ 167:
295
+ /***/ 17:
283
296
  /***/ (function(module, exports) {
284
297
 
285
- module.exports = require("lodash/sortBy");
298
+ module.exports = require("@babel/runtime/helpers/slicedToArray");
286
299
 
287
300
  /***/ }),
288
301
 
289
- /***/ 17:
302
+ /***/ 170:
290
303
  /***/ (function(module, exports) {
291
304
 
292
- module.exports = require("@babel/runtime/helpers/slicedToArray");
305
+ module.exports = require("lodash/sortBy");
293
306
 
294
307
  /***/ }),
295
308
 
@@ -321,24 +334,33 @@ module.exports = require("@splunk/ui-utils/i18n");
321
334
 
322
335
 
323
336
  var _toConsumableArray = __webpack_require__(8);
337
+
324
338
  var _defineProperty = __webpack_require__(7);
339
+
325
340
  var __rest = this && this.__rest || function (s, e) {
326
341
  var t = {};
342
+
327
343
  for (var p in s) {
328
344
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
329
345
  }
346
+
330
347
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
331
348
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
332
349
  }
333
350
  return t;
334
351
  };
352
+
335
353
  Object.defineProperty(exports, "__esModule", {
336
354
  value: true
337
355
  });
338
356
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
357
+
339
358
  var lodash_1 = __webpack_require__(3);
359
+
340
360
  var schemaUtils_1 = __webpack_require__(16);
361
+
341
362
  var VizBehavior_1 = __webpack_require__(6);
363
+
342
364
  var dynamicOptionsDSLType = {
343
365
  type: 'string',
344
366
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -348,20 +370,22 @@ var dynamicOptionsDSLType = {
348
370
  * @param optionsSchema a visualization's options schema
349
371
  * @returns an updated options schema that additionally allows strings starting with > for each option
350
372
  */
373
+
351
374
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
352
375
  var enhancedOptionsSchema = {};
353
376
  Object.keys(optionsSchema).forEach(function (key) {
354
377
  var _a = optionsSchema[key],
355
- title = _a.title,
356
- description = _a.description,
357
- readOnly = _a.readOnly,
358
- writeOnly = _a.writeOnly,
359
- examples = _a.examples,
360
- defaultValue = _a.default,
361
- type = _a.type,
362
- properties = _a.properties,
363
- patternProperties = _a.patternProperties,
364
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
378
+ title = _a.title,
379
+ description = _a.description,
380
+ readOnly = _a.readOnly,
381
+ writeOnly = _a.writeOnly,
382
+ examples = _a.examples,
383
+ defaultValue = _a.default,
384
+ type = _a.type,
385
+ properties = _a.properties,
386
+ patternProperties = _a.patternProperties,
387
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
388
+
365
389
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
366
390
  title: title
367
391
  }), description !== undefined && {
@@ -375,12 +399,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
375
399
  }), defaultValue !== undefined && {
376
400
  default: defaultValue
377
401
  });
402
+
378
403
  if (type === 'object') {
379
404
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
380
405
  type: type
381
406
  }), properties && {
382
407
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
383
408
  });
409
+
384
410
  if (patternProperties) {
385
411
  var enhancedPatternProperties = {};
386
412
  Object.keys(patternProperties).forEach(function (opt) {
@@ -398,6 +424,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
398
424
  });
399
425
  return enhancedOptionsSchema;
400
426
  }
427
+
401
428
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
402
429
  /**
403
430
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -406,11 +433,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
406
433
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
407
434
  * and containing `open: false` for all editor panels in editorConfig
408
435
  */
436
+
409
437
  function enhanceConfig(vizConfig) {
410
438
  var enhancedConfig = Object.assign({}, vizConfig);
439
+
411
440
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
412
441
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
413
442
  }
443
+
414
444
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
415
445
  return Object.assign(Object.assign({}, config), {
416
446
  open: config.open || false
@@ -418,6 +448,7 @@ function enhanceConfig(vizConfig) {
418
448
  });
419
449
  return enhancedConfig;
420
450
  }
451
+
421
452
  exports.enhanceConfig = enhanceConfig;
422
453
  /**
423
454
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -425,6 +456,7 @@ exports.enhanceConfig = enhanceConfig;
425
456
  * @param vizConfig a Visualization Config
426
457
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
427
458
  */
459
+
428
460
  function uncollapseEditorConfig(vizConfig) {
429
461
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
430
462
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -434,13 +466,16 @@ function uncollapseEditorConfig(vizConfig) {
434
466
  });
435
467
  return editorPanelUncollapsedConfig;
436
468
  }
469
+
437
470
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
471
+
438
472
  function isDynamicOption(option) {
439
473
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
440
474
  }
441
- exports.isDynamicOption = isDynamicOption;
442
- // private helpers to improve readability of getInitialPreset
475
+
476
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
443
477
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
478
+
444
479
  /**
445
480
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
446
481
  * 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
@@ -449,6 +484,7 @@ exports.isDynamicOption = isDynamicOption;
449
484
  *
450
485
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
451
486
  */
487
+
452
488
  function hasCompatibleContexts(vizContext, presetContext) {
453
489
  var presetContextKeys = Object.keys(presetContext);
454
490
  return presetContextKeys.every(function (contextKey) {
@@ -458,6 +494,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
458
494
  /**
459
495
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
460
496
  */
497
+
498
+
461
499
  function hasCompatibleOptions(vizOptions, presetOptions) {
462
500
  var presetOptionKeys = Object.keys(presetOptions);
463
501
  return presetOptionKeys.every(function (optionKey) {
@@ -472,18 +510,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
472
510
  * @param {Object} vizOptions - the current vizOptions definition
473
511
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
474
512
  */
513
+
514
+
475
515
  function getInitialPreset(vizContext, vizOptions, presets) {
476
516
  return presets.find(function (preset) {
477
- var presetContext = lodash_1.get(preset, ['value', 'context'], {});
478
- var presetOptions = lodash_1.get(preset, ['value', 'options'], {});
517
+ var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
518
+ var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
479
519
  var presetContextKeys = Object.keys(presetContext);
480
- var presetOptionKeys = Object.keys(presetOptions);
481
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
520
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
482
521
  // if not, then the preset is invalid in config.ts
522
+
483
523
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
484
524
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
485
525
  });
486
526
  }
527
+
487
528
  exports.getInitialPreset = getInitialPreset;
488
529
  /**
489
530
  * generates number precision values for a Select editor
@@ -491,14 +532,16 @@ exports.getInitialPreset = getInitialPreset;
491
532
  * @param {Number} numPrecisionValues - number of integer precision values to generate
492
533
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
493
534
  */
535
+
494
536
  function generatePrecisionValues(numPrecisionValues) {
495
- return lodash_1.range(0, numPrecisionValues + 1).map(function (i) {
537
+ return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
496
538
  return {
497
539
  label: "".concat(i, " (0").concat(i > 0 ? '.' : '').concat('0'.repeat(i), ")"),
498
540
  value: i
499
541
  };
500
542
  });
501
543
  }
544
+
502
545
  exports.generatePrecisionValues = generatePrecisionValues;
503
546
  /**
504
547
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -508,12 +551,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
508
551
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
509
552
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
510
553
  */
554
+
511
555
  var insertLayout = function insertLayout(layout, index) {
512
556
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
513
557
  layoutItems[_key - 2] = arguments[_key];
514
558
  }
559
+
515
560
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
516
561
  };
562
+
517
563
  exports.insertLayout = insertLayout;
518
564
 
519
565
  /***/ }),
@@ -535,28 +581,28 @@ module.exports = require("@splunk/themes/pick");
535
581
  /***/ 25:
536
582
  /***/ (function(module, exports) {
537
583
 
538
- module.exports = require("@splunk/visualization-context/TimezoneContext");
584
+ module.exports = require("@splunk/ui-utils/id");
539
585
 
540
586
  /***/ }),
541
587
 
542
588
  /***/ 26:
543
589
  /***/ (function(module, exports) {
544
590
 
545
- module.exports = require("@splunk/visualizations-shared/hocUtils");
591
+ module.exports = require("@splunk/visualization-context/TimezoneContext");
546
592
 
547
593
  /***/ }),
548
594
 
549
595
  /***/ 27:
550
596
  /***/ (function(module, exports) {
551
597
 
552
- module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
598
+ module.exports = require("@splunk/visualizations-shared/hocUtils");
553
599
 
554
600
  /***/ }),
555
601
 
556
- /***/ 29:
602
+ /***/ 28:
557
603
  /***/ (function(module, exports) {
558
604
 
559
- module.exports = require("@splunk/visualization-encoding/Options");
605
+ module.exports = require("@splunk/visualizations-shared/JSONSchemaUtils");
560
606
 
561
607
  /***/ }),
562
608
 
@@ -570,11 +616,18 @@ module.exports = require("lodash");
570
616
  /***/ 30:
571
617
  /***/ (function(module, exports) {
572
618
 
573
- module.exports = require("@splunk/visualizations-shared/numberUtils");
619
+ module.exports = require("@splunk/visualization-encoding/Options");
574
620
 
575
621
  /***/ }),
576
622
 
577
623
  /***/ 31:
624
+ /***/ (function(module, exports) {
625
+
626
+ module.exports = require("@splunk/visualizations-shared/numberUtils");
627
+
628
+ /***/ }),
629
+
630
+ /***/ 32:
578
631
  /***/ (function(module, exports, __webpack_require__) {
579
632
 
580
633
  "use strict";
@@ -584,11 +637,17 @@ Object.defineProperty(exports, "__esModule", {
584
637
  value: true
585
638
  });
586
639
  exports.shouldShowIconPlaceholder = void 0;
640
+
587
641
  var React = __webpack_require__(1);
642
+
588
643
  var T = __webpack_require__(0);
644
+
589
645
  var lodash_1 = __webpack_require__(3);
646
+
590
647
  var i18n_1 = __webpack_require__(2);
648
+
591
649
  var Message_1 = __webpack_require__(10);
650
+
592
651
  var FixedSizeContainer_1 = __webpack_require__(13);
593
652
  /**
594
653
  * @method shouldShowIconPlaceholder
@@ -596,14 +655,17 @@ var FixedSizeContainer_1 = __webpack_require__(13);
596
655
  * @param {boolean} loading
597
656
  * @returns {boolean}
598
657
  */
658
+
659
+
599
660
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
600
661
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
601
- var data = lodash_1.get(dataSources, 'primary.data.columns[0]', undefined);
662
+ var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
602
663
  var noData = data === undefined;
603
- var fields = lodash_1.get(dataSources, 'primary.data.fields[0]', undefined);
664
+ var fields = (0, lodash_1.get)(dataSources, 'primary.data.fields[0]', undefined);
604
665
  var noFields = fields === undefined;
605
666
  return loading || noData || noFields;
606
667
  };
668
+
607
669
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
608
670
  var propTypes = {
609
671
  icon: T.func,
@@ -618,11 +680,13 @@ var propTypes = {
618
680
  * @param {IconPlaceholderProps} props
619
681
  * @returns {React.ReactElement}
620
682
  */
683
+
621
684
  var IconPlaceholder = function IconPlaceholder(props) {
622
685
  var width = props.width,
623
- height = props.height,
624
- icon = props.icon,
625
- iconColor = props.iconColor;
686
+ height = props.height,
687
+ icon = props.icon,
688
+ iconColor = props.iconColor;
689
+
626
690
  if (icon) {
627
691
  return React.createElement(icon, {
628
692
  style: {
@@ -637,26 +701,21 @@ var IconPlaceholder = function IconPlaceholder(props) {
637
701
  height: '50%'
638
702
  });
639
703
  }
704
+
640
705
  return React.createElement(Message_1.default, {
641
706
  width: width,
642
707
  height: height,
643
708
  level: "warning",
644
- message: i18n_1._('No DataSource Connected')
709
+ message: (0, i18n_1._)('No DataSource Connected')
645
710
  });
646
711
  };
712
+
647
713
  IconPlaceholder.propTypes = propTypes;
648
714
  IconPlaceholder.defaultProps = {
649
715
  width: '100%',
650
716
  height: 250
651
717
  };
652
- exports.default = FixedSizeContainer_1.default(IconPlaceholder);
653
-
654
- /***/ }),
655
-
656
- /***/ 32:
657
- /***/ (function(module, exports) {
658
-
659
- module.exports = require("@splunk/ui-utils/id");
718
+ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
660
719
 
661
720
  /***/ }),
662
721
 
@@ -667,21 +726,27 @@ module.exports = require("@splunk/ui-utils/id");
667
726
 
668
727
 
669
728
  var _defineProperty = __webpack_require__(7);
729
+
670
730
  Object.defineProperty(exports, "__esModule", {
671
731
  value: true
672
732
  });
673
733
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
734
+
674
735
  var T = __webpack_require__(0);
736
+
675
737
  var lodash_1 = __webpack_require__(3);
676
- var DataSource_1 = __webpack_require__(43);
738
+
739
+ var DataSource_1 = __webpack_require__(34);
740
+
677
741
  exports.SortParamsPropTypes = T.shape({
678
742
  currentSortKey: T.string,
679
743
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
680
744
  onSort: T.func
681
745
  });
746
+
682
747
  var getSortingParams = function getSortingParams(_ref) {
683
748
  var requestParams = _ref.requestParams,
684
- onRequestParamsChange = _ref.onRequestParamsChange;
749
+ onRequestParamsChange = _ref.onRequestParamsChange;
685
750
  var currentSortKey;
686
751
  var currentSortDir;
687
752
  var nextSortDirMap = {
@@ -690,17 +755,20 @@ var getSortingParams = function getSortingParams(_ref) {
690
755
  none: 'asc'
691
756
  };
692
757
  var onSort;
758
+
693
759
  if (typeof onRequestParamsChange === 'function') {
694
- if (requestParams && lodash_1.has(requestParams, 'sort')) {
760
+ if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
695
761
  currentSortKey = Object.keys(requestParams.sort).shift();
696
762
  currentSortDir = requestParams.sort[currentSortKey];
697
- }
698
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
763
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
764
+
765
+
699
766
  onSort = function onSort(e, _ref2) {
700
767
  var sortKey = _ref2.sortKey,
701
- sortDir = _ref2.sortDir;
768
+ sortDir = _ref2.sortDir;
769
+
702
770
  if (typeof sortKey === 'string') {
703
- var nextSortDir = lodash_1.has(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
771
+ var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
704
772
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
705
773
  offset: 0,
706
774
  sort: _defineProperty({}, sortKey, nextSortDir)
@@ -710,12 +778,14 @@ var getSortingParams = function getSortingParams(_ref) {
710
778
  }
711
779
  };
712
780
  }
781
+
713
782
  return {
714
783
  currentSortKey: currentSortKey,
715
784
  currentSortDir: currentSortDir,
716
785
  onSort: onSort
717
786
  };
718
787
  };
788
+
719
789
  exports.getSortingParams = getSortingParams;
720
790
 
721
791
  /***/ }),
@@ -726,43 +796,69 @@ exports.getSortingParams = getSortingParams;
726
796
  "use strict";
727
797
 
728
798
 
799
+ Object.defineProperty(exports, "__esModule", {
800
+ value: true
801
+ });
802
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
803
+ exports.validSortDirs = ['asc', 'desc', 'none'];
804
+ exports.validSegmentationModes = ['none', 'inner'];
805
+ exports.validOutputModes = ['json_cols', 'json'];
806
+
807
+ /***/ }),
808
+
809
+ /***/ 35:
810
+ /***/ (function(module, exports, __webpack_require__) {
811
+
812
+ "use strict";
813
+
814
+
729
815
  Object.defineProperty(exports, "__esModule", {
730
816
  value: true
731
817
  });
732
818
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
819
+
733
820
  var T = __webpack_require__(0);
821
+
734
822
  var lodash_1 = __webpack_require__(3);
823
+
735
824
  exports.PaginatorParamsPropTypes = T.shape({
736
825
  isPaging: T.bool,
737
826
  current: T.number,
738
827
  totalPages: T.number,
739
828
  onChange: T.func
740
829
  });
830
+
741
831
  var getPaginationParams = function getPaginationParams(_ref) {
742
832
  var requestParams = _ref.requestParams,
743
- meta = _ref.meta,
744
- onRequestParamsChange = _ref.onRequestParamsChange;
833
+ meta = _ref.meta,
834
+ onRequestParamsChange = _ref.onRequestParamsChange;
745
835
  var totalCount = meta && meta.totalCount || 0;
746
836
  var offset = requestParams && requestParams.offset || 0;
747
837
  var count = requestParams && requestParams.count;
748
838
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
749
839
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
750
840
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
841
+
751
842
  var onChangeHandler = function onChangeHandler(e, _ref2) {
752
843
  var page = _ref2.page,
753
- countArg = _ref2.count;
754
- var newParams = lodash_1.cloneDeep(requestParams);
844
+ countArg = _ref2.count;
845
+ var newParams = (0, lodash_1.cloneDeep)(requestParams);
846
+
755
847
  if (typeof countArg === 'number') {
756
848
  newParams.count = countArg;
757
849
  newParams.offset = 0;
758
850
  }
851
+
759
852
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
853
+
760
854
  if (typeof page === 'number' && page > 0) {
761
855
  newParams.count = pageCount;
762
856
  newParams.offset = (page - 1) * pageCount;
763
857
  }
858
+
764
859
  onRequestParamsChange(newParams);
765
860
  };
861
+
766
862
  return {
767
863
  isPaging: isPaging,
768
864
  current: current,
@@ -770,11 +866,12 @@ var getPaginationParams = function getPaginationParams(_ref) {
770
866
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
771
867
  };
772
868
  };
869
+
773
870
  exports.getPaginationParams = getPaginationParams;
774
871
 
775
872
  /***/ }),
776
873
 
777
- /***/ 35:
874
+ /***/ 36:
778
875
  /***/ (function(module, exports, __webpack_require__) {
779
876
 
780
877
  "use strict";
@@ -785,6 +882,7 @@ Object.defineProperty(exports, "__esModule", {
785
882
  });
786
883
  exports.VizCategory = void 0;
787
884
  var VizCategory;
885
+
788
886
  (function (VizCategory) {
789
887
  VizCategory["SINGLE_VALUE"] = "Single Value";
790
888
  VizCategory["TRENDS"] = "Trends";
@@ -802,67 +900,96 @@ var VizCategory;
802
900
 
803
901
  /***/ }),
804
902
 
805
- /***/ 36:
903
+ /***/ 37:
806
904
  /***/ (function(module, exports, __webpack_require__) {
807
905
 
808
906
  "use strict";
809
907
 
810
908
 
811
909
  var _slicedToArray = __webpack_require__(17);
910
+
812
911
  Object.defineProperty(exports, "__esModule", {
813
912
  value: true
814
913
  });
914
+
815
915
  var React = __webpack_require__(1);
916
+
816
917
  var lodash_1 = __webpack_require__(3);
817
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
818
- var Options_1 = __webpack_require__(29);
819
- var SanitizeProps_1 = __webpack_require__(38);
820
- var TimezoneContext_1 = __webpack_require__(25);
821
- var moment_1 = __webpack_require__(39);
918
+
919
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
920
+
921
+ var Options_1 = __webpack_require__(30);
922
+
923
+ var SanitizeProps_1 = __webpack_require__(39);
924
+
925
+ var TimezoneContext_1 = __webpack_require__(26);
926
+
927
+ var moment_1 = __webpack_require__(40);
928
+
822
929
  var FeatureFlagContext_1 = __webpack_require__(21);
930
+
823
931
  var styled_components_1 = __webpack_require__(4);
824
- var hocUtils_1 = __webpack_require__(26);
825
- var JSONSchemaUtils_1 = __webpack_require__(27);
826
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
827
- var id_1 = __webpack_require__(32);
828
- var SplunkVisualization_1 = __webpack_require__(41);
932
+
933
+ var hocUtils_1 = __webpack_require__(27);
934
+
935
+ var JSONSchemaUtils_1 = __webpack_require__(28);
936
+
937
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
938
+
939
+ var id_1 = __webpack_require__(25);
940
+
941
+ var SplunkVisualization_1 = __webpack_require__(42);
942
+
829
943
  var VizBehavior_1 = __webpack_require__(6);
944
+
830
945
  var getSorting_1 = __webpack_require__(33);
831
- var getPagination_1 = __webpack_require__(34);
946
+
947
+ var getPagination_1 = __webpack_require__(35);
948
+
832
949
  var useDeepMemo_1 = __webpack_require__(44);
950
+
833
951
  var MissingPropsMessage_1 = __webpack_require__(45);
952
+
834
953
  var withEditModeCover_1 = __webpack_require__(46);
954
+
835
955
  var withPlaceholder_1 = __webpack_require__(47);
836
956
  /**
837
957
  * hoc that wraps a pure react visualization in a Dashboard visualization
838
958
  * @param {DashboardVizOpts} opts
839
959
  * @returns {HOC}
840
960
  */
961
+
962
+
841
963
  var withDashboardViz = function withDashboardViz(opts) {
842
964
  var ReactViz = opts.ReactViz,
843
- vizConfig = opts.vizConfig,
844
- _opts$computeVizProps = opts.computeVizProps,
845
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
846
- disableEditModeCover = opts.disableEditModeCover,
847
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
848
- var SanitizedReactViz = SanitizeProps_1.withSanitizedProps(ReactViz);
849
- var defaultOptions = JSONSchemaUtils_1.pickFieldFromJSONSchema(vizConfig.optionsSchema, 'default');
965
+ vizConfig = opts.vizConfig,
966
+ _opts$computeVizProps = opts.computeVizProps,
967
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
968
+ disableEditModeCover = opts.disableEditModeCover,
969
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
970
+
971
+ var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
972
+ var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
973
+
850
974
  var DashboardViz = function DashboardViz(props) {
851
975
  var _a;
976
+
852
977
  var mode = props.mode,
853
- hasEventHandlers = props.hasEventHandlers,
854
- dataSources = props.dataSources,
855
- options = props.options,
856
- _props$context = props.context,
857
- context = _props$context === void 0 ? {} : _props$context,
858
- width = props.width,
859
- height = props.height,
860
- onComputedProps = props.onComputedProps,
861
- onEventTrigger = props.onEventTrigger,
862
- theme = props.theme,
863
- onRequestParamsChange = props.onRequestParamsChange;
978
+ hasEventHandlers = props.hasEventHandlers,
979
+ dataSources = props.dataSources,
980
+ options = props.options,
981
+ _props$context = props.context,
982
+ context = _props$context === void 0 ? {} : _props$context,
983
+ width = props.width,
984
+ height = props.height,
985
+ onComputedProps = props.onComputedProps,
986
+ onEventTrigger = props.onEventTrigger,
987
+ theme = props.theme,
988
+ onRequestParamsChange = props.onRequestParamsChange;
989
+
864
990
  var _React$useContext = React.useContext(TimezoneContext_1.default),
865
- serializedTimezone = _React$useContext.serializedTimezone;
991
+ serializedTimezone = _React$useContext.serializedTimezone;
992
+
866
993
  if (serializedTimezone) {
867
994
  /*
868
995
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -876,44 +1003,58 @@ var withDashboardViz = function withDashboardViz(opts) {
876
1003
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
877
1004
  }
878
1005
  }
1006
+
879
1007
  var themeFunc = function themeFunc(themeVar) {
880
1008
  var _a, _b;
1009
+
881
1010
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
882
1011
  };
1012
+
883
1013
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
884
- var _getSettingsFromTheme = getSettingsFromThemedProps_1.default({
885
- theme: theme
886
- }),
887
- currentThemeFamily = _getSettingsFromTheme.family,
888
- currentThemeColorScheme = _getSettingsFromTheme.colorScheme,
889
- currentThemeDensity = _getSettingsFromTheme.density;
1014
+
1015
+ var _ref = (0, getSettingsFromThemedProps_1.default)({
1016
+ theme: theme
1017
+ }),
1018
+ currentThemeFamily = _ref.family,
1019
+ currentThemeColorScheme = _ref.colorScheme,
1020
+ currentThemeDensity = _ref.density;
1021
+
890
1022
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1023
+
891
1024
  var _React$useState = React.useState({}),
892
- _React$useState2 = _slicedToArray(_React$useState, 2),
893
- evaluatedOptionsAsync = _React$useState2[0],
894
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1025
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1026
+ evaluatedOptionsAsync = _React$useState2[0],
1027
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1028
+
1029
+
895
1030
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
896
- var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat(id_1.createGUID())),
897
- _React$useState4 = _slicedToArray(_React$useState3, 1),
898
- visualizationID = _React$useState4[0];
1031
+
1032
+ var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
1033
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1034
+ visualizationID = _React$useState4[0];
1035
+
899
1036
  var _React$useState5 = React.useState({}),
900
- _React$useState6 = _slicedToArray(_React$useState5, 2),
901
- dataSourcesInState = _React$useState6[0],
902
- setDataSourcesInState = _React$useState6[1];
1037
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1038
+ dataSourcesInState = _React$useState6[0],
1039
+ setDataSourcesInState = _React$useState6[1];
1040
+
903
1041
  var _React$useState7 = React.useState(),
904
- _React$useState8 = _slicedToArray(_React$useState7, 2),
905
- dataFramesInState = _React$useState8[0],
906
- setDataFramesInState = _React$useState8[1];
907
- var _React$useState9 = React.useState(Boolean(featureFlagContext && featureFlagContext.visualizations_useWebWorkersForDSL && typeof Worker !== 'undefined')),
908
- _React$useState10 = _slicedToArray(_React$useState9, 2),
909
- useAsyncEvaluatedOptions = _React$useState10[0],
910
- setUseAsyncEvaluatedOptions = _React$useState10[1];
911
- evaluatedOptions = useDeepMemo_1.useDeepMemo(function () {
1042
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1043
+ dataFramesInState = _React$useState8[0],
1044
+ setDataFramesInState = _React$useState8[1];
1045
+
1046
+ var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
1047
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1048
+ useAsyncEvaluatedOptions = _React$useState10[0],
1049
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1050
+
1051
+ var isMounted = React.useRef(true);
1052
+ evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
912
1053
  try {
913
1054
  if (useAsyncEvaluatedOptions) {
914
1055
  var optionsToEvaluate = {
915
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
916
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1056
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1057
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
917
1058
  };
918
1059
  var asyncDynamicOptionsEvaluatorParams = {
919
1060
  visualizationID: visualizationID,
@@ -924,21 +1065,23 @@ var withDashboardViz = function withDashboardViz(opts) {
924
1065
  };
925
1066
  async_dynamic_options_evaluator_1.default.evaluate(asyncDynamicOptionsEvaluatorParams).then(function (results) {
926
1067
  setEvaluatedOptionsAsync(results.results);
927
- }).catch(function (e) {
928
- // eslint-disable-next-line no-console
929
- console.error("unexpected error evaluating options - async: ".concat(e.message));
930
- setUseAsyncEvaluatedOptions(false);
1068
+ }).catch(function () {
1069
+ if (isMounted.current) {
1070
+ setUseAsyncEvaluatedOptions(false);
1071
+ }
931
1072
  });
932
1073
  } else {
933
1074
  var dataFrames = dataFramesInState;
1075
+
934
1076
  if (dataSources !== dataSourcesInState) {
935
1077
  setDataSourcesInState(dataSources);
936
1078
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
937
1079
  setDataFramesInState(dataFrames);
938
1080
  }
1081
+
939
1082
  return Options_1.Options.evaluate({
940
- context: lodash_1.defaultsDeep({}, context, vizConfig.defaultContext),
941
- options: hocUtils_1.deepMergeWithArrayPrimitiveOverrides({}, options, defaultOptions)
1083
+ context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
1084
+ options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
942
1085
  }, dataSources, themeFunc, dataFrames);
943
1086
  }
944
1087
  } catch (e) {
@@ -946,67 +1089,76 @@ var withDashboardViz = function withDashboardViz(opts) {
946
1089
  console.error("unexpected error evaluating options: ".concat(e.message));
947
1090
  return {};
948
1091
  }
1092
+
949
1093
  return {};
950
1094
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
951
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
952
- // trellis specific backgroundColor update for onComputedProps
1095
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
953
1096
  // 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
954
1097
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1098
+
955
1099
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
956
1100
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1101
+
957
1102
  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) {
958
1103
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
959
1104
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
960
1105
  });
961
- }
962
- // useEffect hook needs to be initialized before any early returns
1106
+ } // useEffect hook needs to be initialized before any early returns
963
1107
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1108
+
1109
+
964
1110
  React.useEffect(function () {
965
1111
  onComputedProps(clonedEvaluatedOptions);
966
1112
  });
967
1113
  React.useEffect(function () {
968
1114
  return function () {
969
1115
  if (useAsyncEvaluatedOptions) {
1116
+ isMounted.current = false;
970
1117
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
971
1118
  }
972
- };
973
- // eslint-disable-next-line react-hooks/exhaustive-deps
974
- }, []);
975
- // present warning message if any required props are missing
1119
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1120
+ }, []); // present warning message if any required props are missing
1121
+
976
1122
  var _vizConfig$requiredPr = vizConfig.requiredProps,
977
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
978
- supports = vizConfig.supports;
979
- var missing = MissingPropsMessage_1.missingKeys(requiredProps, evaluatedOptionsToUse);
1123
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1124
+ supports = vizConfig.supports;
1125
+ var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1126
+
980
1127
  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
981
1128
  ) {
982
- return React.createElement(MissingPropsMessage_1.default, {
983
- "data-test": "missing-props-message",
984
- width: width,
985
- height: height,
986
- missingProps: missing,
987
- backgroundColor: bgColorFromTheme
988
- });
989
- }
990
- // events
1129
+ return React.createElement(MissingPropsMessage_1.default, {
1130
+ "data-test": "missing-props-message",
1131
+ width: width,
1132
+ height: height,
1133
+ missingProps: missing,
1134
+ backgroundColor: bgColorFromTheme
1135
+ });
1136
+ } // events
1137
+
1138
+
991
1139
  var eventCallbackProps = {};
1140
+
992
1141
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
993
1142
  var supportedEvents = vizConfig.events;
994
1143
  Object.keys(supportedEvents).forEach(function (eventName) {
995
- var eventCallbackPropName = lodash_1.camelCase("on.".concat(eventName));
996
- eventCallbackProps[eventCallbackPropName] = null;
997
- // todo: refactor single value and single value icon to send payload from viz
1144
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1145
+ eventCallbackProps[eventCallbackPropName] = null; // todo: refactor single value and single value icon to send payload from viz
998
1146
  // then remove these lines
1147
+
999
1148
  var payloadKeys = supportedEvents[eventName].payloadKeys;
1000
1149
  var payload = {};
1150
+
1001
1151
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1002
1152
  payloadKeys.forEach(function (p) {
1003
1153
  payload[p] = evaluatedOptionsToUse[p];
1004
1154
  });
1005
1155
  }
1156
+
1006
1157
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1007
1158
  if (ev && ev.payload) {
1008
1159
  payload = ev.payload;
1009
1160
  }
1161
+
1010
1162
  return onEventTrigger({
1011
1163
  originalEvent: ev,
1012
1164
  payload: payload,
@@ -1014,8 +1166,9 @@ var withDashboardViz = function withDashboardViz(opts) {
1014
1166
  });
1015
1167
  };
1016
1168
  });
1017
- }
1018
- // compute pure viz props which are not from options
1169
+ } // compute pure viz props which are not from options
1170
+
1171
+
1019
1172
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1020
1173
  themeFunc: themeFunc
1021
1174
  }));
@@ -1033,21 +1186,25 @@ var withDashboardViz = function withDashboardViz(opts) {
1033
1186
  * In future, we could automatically detect which all datasources are being used
1034
1187
  * and bind those magically to pagination/sorting behavior.
1035
1188
  */
1189
+
1036
1190
  var dataSourceMetadata = {};
1037
1191
  var OptionKey = 'paginateDataSourceKey';
1038
- var paginateDataSourceKey = lodash_1.has(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1039
- if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && lodash_1.has(dataSources, paginateDataSourceKey)) {
1040
- var requestParams = lodash_1.get(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1041
- var meta = lodash_1.get(dataSources, [paginateDataSourceKey, 'meta'], {});
1192
+ var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1193
+
1194
+ if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1195
+ var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1196
+ var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1197
+
1042
1198
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1043
1199
  return onRequestParamsChange(paginateDataSourceKey, payload);
1044
1200
  };
1045
- var sortParams = getSorting_1.getSortingParams({
1201
+
1202
+ var sortParams = (0, getSorting_1.getSortingParams)({
1046
1203
  requestParams: requestParams,
1047
1204
  meta: meta,
1048
1205
  onRequestParamsChange: handleRequestParamsChange
1049
1206
  });
1050
- var paginatorParams = getPagination_1.getPaginationParams({
1207
+ var paginatorParams = (0, getPagination_1.getPaginationParams)({
1051
1208
  requestParams: requestParams,
1052
1209
  meta: meta,
1053
1210
  onRequestParamsChange: handleRequestParamsChange
@@ -1056,115 +1213,132 @@ var withDashboardViz = function withDashboardViz(opts) {
1056
1213
  sortParams: sortParams,
1057
1214
  paginatorParams: paginatorParams
1058
1215
  };
1059
- }
1060
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1216
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1217
+
1218
+
1061
1219
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1062
1220
  return null;
1063
1221
  }
1222
+
1064
1223
  return React.createElement(SanitizedReactViz, Object.assign({
1065
1224
  mode: mode,
1066
1225
  width: width,
1067
1226
  height: height
1068
1227
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1069
1228
  };
1229
+
1070
1230
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1071
1231
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1072
1232
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1073
1233
  theme: {}
1074
- });
1075
- // attach viz config
1076
- DashboardViz.config = vizConfig;
1077
- // @ts-ignore: TODO fix sc upgrade TS issues
1078
- return styled_components_1.withTheme(withPlaceholder_1.default(withEditModeCover_1.default(DashboardViz, disableEditModeCover), useIconPlaceholder));
1234
+ }); // attach viz config
1235
+
1236
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1237
+
1238
+ return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1079
1239
  };
1240
+
1080
1241
  exports.default = withDashboardViz;
1081
1242
 
1082
1243
  /***/ }),
1083
1244
 
1084
- /***/ 37:
1245
+ /***/ 38:
1085
1246
  /***/ (function(module, exports) {
1086
1247
 
1087
1248
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1088
1249
 
1089
1250
  /***/ }),
1090
1251
 
1091
- /***/ 38:
1252
+ /***/ 39:
1092
1253
  /***/ (function(module, exports) {
1093
1254
 
1094
1255
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1095
1256
 
1096
1257
  /***/ }),
1097
1258
 
1098
- /***/ 39:
1259
+ /***/ 4:
1099
1260
  /***/ (function(module, exports) {
1100
1261
 
1101
- module.exports = require("@splunk/moment");
1262
+ module.exports = require("styled-components");
1102
1263
 
1103
1264
  /***/ }),
1104
1265
 
1105
- /***/ 4:
1266
+ /***/ 40:
1106
1267
  /***/ (function(module, exports) {
1107
1268
 
1108
- module.exports = require("styled-components");
1269
+ module.exports = require("@splunk/moment");
1109
1270
 
1110
1271
  /***/ }),
1111
1272
 
1112
- /***/ 40:
1273
+ /***/ 41:
1113
1274
  /***/ (function(module, exports) {
1114
1275
 
1115
1276
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1116
1277
 
1117
1278
  /***/ }),
1118
1279
 
1119
- /***/ 41:
1280
+ /***/ 42:
1120
1281
  /***/ (function(module, exports, __webpack_require__) {
1121
1282
 
1122
1283
  "use strict";
1123
1284
 
1124
1285
 
1125
1286
  var _classCallCheck = __webpack_require__(9);
1287
+
1126
1288
  Object.defineProperty(exports, "__esModule", {
1127
1289
  value: true
1128
1290
  });
1129
1291
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1130
1292
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1293
+
1131
1294
  var T = __webpack_require__(0);
1295
+
1132
1296
  var lodash_1 = __webpack_require__(3);
1133
- var VizActionHandler_1 = __webpack_require__(42);
1134
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1297
+
1298
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1299
+
1300
+
1135
1301
  exports.INITIAL_WIDTH = 250;
1136
1302
  exports.INITIAL_HEIGHT = 250;
1137
1303
  /**
1138
1304
  * A Splunk visualization
1139
1305
  */
1306
+
1140
1307
  var SplunkVisualization = function SplunkVisualization() {
1141
1308
  _classCallCheck(this, SplunkVisualization);
1142
1309
  };
1310
+
1143
1311
  SplunkVisualization.propTypes = {
1144
1312
  /**
1145
1313
  * display mode
1146
1314
  */
1147
1315
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1316
+
1148
1317
  /**
1149
1318
  * width in pixel or string, defaults to 100%
1150
1319
  */
1151
1320
  width: T.oneOfType([T.string, T.number]).isRequired,
1321
+
1152
1322
  /**
1153
1323
  * height in pixel or string
1154
1324
  */
1155
1325
  height: T.oneOfType([T.string, T.number]).isRequired,
1326
+
1156
1327
  /**
1157
1328
  * visualization context used for dynamic option evaluation
1158
1329
  */
1159
1330
  context: T.object,
1331
+
1160
1332
  /**
1161
1333
  * visualization formatting options
1162
1334
  */
1163
1335
  options: T.object,
1336
+
1164
1337
  /**
1165
1338
  * A callback to update formatting options
1166
1339
  */
1167
1340
  onOptionsChange: T.func,
1341
+
1168
1342
  /**
1169
1343
  * datasource state which include data and request params, object key indicate the datasource type.
1170
1344
  */
@@ -1173,6 +1347,7 @@ SplunkVisualization.propTypes = {
1173
1347
  * current request params
1174
1348
  */
1175
1349
  requestParams: T.object,
1350
+
1176
1351
  /**
1177
1352
  * current dataset
1178
1353
  */
@@ -1180,6 +1355,7 @@ SplunkVisualization.propTypes = {
1180
1355
  fields: T.array,
1181
1356
  columns: T.array
1182
1357
  }),
1358
+
1183
1359
  /**
1184
1360
  * error
1185
1361
  */
@@ -1187,29 +1363,35 @@ SplunkVisualization.propTypes = {
1187
1363
  level: T.string,
1188
1364
  message: T.string
1189
1365
  }),
1366
+
1190
1367
  /**
1191
1368
  * meta data that came with the dataset
1192
1369
  */
1193
1370
  meta: T.object
1194
1371
  })),
1372
+
1195
1373
  /**
1196
1374
  * A callback to trigger event
1197
1375
  */
1198
1376
  onEventTrigger: T.func,
1377
+
1199
1378
  /**
1200
1379
  * Inform viz if there are handlers listening to events
1201
1380
  */
1202
1381
  hasEventHandlers: T.bool,
1382
+
1203
1383
  /**
1204
1384
  * A callback to communicate computed props to a consumer
1205
1385
  */
1206
1386
  onComputedProps: T.func,
1387
+
1207
1388
  /**
1208
1389
  * A callback to obtain visualization api
1209
1390
  */
1210
1391
  vizActionHandlerRef: T.func,
1211
1392
  loading: T.bool,
1212
1393
  theme: T.object,
1394
+
1213
1395
  /**
1214
1396
  * A callback to request new data with updated request params
1215
1397
  */
@@ -1218,6 +1400,7 @@ SplunkVisualization.propTypes = {
1218
1400
  /**
1219
1401
  *
1220
1402
  */
1403
+
1221
1404
  SplunkVisualization.defaultProps = {
1222
1405
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1223
1406
  width: '100%',
@@ -1246,26 +1429,29 @@ exports.default = SplunkVisualization;
1246
1429
 
1247
1430
  /***/ }),
1248
1431
 
1249
- /***/ 42:
1432
+ /***/ 43:
1250
1433
  /***/ (function(module, exports, __webpack_require__) {
1251
1434
 
1252
1435
  "use strict";
1253
1436
 
1254
1437
 
1255
1438
  var _classCallCheck = __webpack_require__(9);
1439
+
1256
1440
  var _createClass = __webpack_require__(18);
1441
+
1257
1442
  Object.defineProperty(exports, "__esModule", {
1258
1443
  value: true
1259
1444
  });
1260
1445
  exports.DefaultVizActionHandler = void 0;
1446
+
1261
1447
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1262
1448
  function DefaultVizActionHandler() {
1263
1449
  _classCallCheck(this, DefaultVizActionHandler);
1264
1450
  }
1451
+
1265
1452
  _createClass(DefaultVizActionHandler, [{
1266
1453
  key: "focus",
1267
- value: function focus() {
1268
- // noop
1454
+ value: function focus() {// noop
1269
1455
  }
1270
1456
  }, {
1271
1457
  key: "snapshot",
@@ -1273,23 +1459,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1273
1459
  return null; // noop
1274
1460
  }
1275
1461
  }]);
1462
+
1276
1463
  return DefaultVizActionHandler;
1277
1464
  }();
1278
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1279
-
1280
- /***/ }),
1281
-
1282
- /***/ 43:
1283
- /***/ (function(module, exports, __webpack_require__) {
1284
1465
 
1285
- "use strict";
1286
-
1287
-
1288
- Object.defineProperty(exports, "__esModule", {
1289
- value: true
1290
- });
1291
- exports.validSortDirs = void 0;
1292
- exports.validSortDirs = ['asc', 'desc', 'none'];
1466
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1293
1467
 
1294
1468
  /***/ }),
1295
1469
 
@@ -1303,7 +1477,9 @@ Object.defineProperty(exports, "__esModule", {
1303
1477
  value: true
1304
1478
  });
1305
1479
  exports.useDeepMemo = void 0;
1480
+
1306
1481
  var react_1 = __webpack_require__(1);
1482
+
1307
1483
  var lodash_1 = __webpack_require__(3);
1308
1484
  /**
1309
1485
  * This hook evaluates and stores the result of a passed function and only
@@ -1318,21 +1494,26 @@ var lodash_1 = __webpack_require__(3);
1318
1494
  * @param fn the function to be executed and
1319
1495
  * @param dependencies an array of dependencies
1320
1496
  */
1497
+
1498
+
1321
1499
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1322
- var ref = react_1.useRef();
1323
- if (!ref.current || !lodash_1.isEqual(dependencies, ref.current.dependencies)) {
1500
+ var ref = (0, react_1.useRef)();
1501
+
1502
+ if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1324
1503
  ref.current = {
1325
1504
  dependencies: dependencies,
1326
1505
  value: fn()
1327
1506
  };
1328
1507
  }
1508
+
1329
1509
  return ref.current.value;
1330
1510
  };
1511
+
1331
1512
  exports.useDeepMemo = useDeepMemo;
1332
1513
 
1333
1514
  /***/ }),
1334
1515
 
1335
- /***/ 441:
1516
+ /***/ 444:
1336
1517
  /***/ (function(module, exports, __webpack_require__) {
1337
1518
 
1338
1519
  "use strict";
@@ -1340,35 +1521,48 @@ exports.useDeepMemo = useDeepMemo;
1340
1521
 
1341
1522
  var __rest = this && this.__rest || function (s, e) {
1342
1523
  var t = {};
1524
+
1343
1525
  for (var p in s) {
1344
1526
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1345
1527
  }
1528
+
1346
1529
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1347
1530
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1348
1531
  }
1349
1532
  return t;
1350
1533
  };
1534
+
1351
1535
  Object.defineProperty(exports, "__esModule", {
1352
1536
  value: true
1353
1537
  });
1354
1538
  exports.themes = exports.computeVizProps = exports.PurePunchcard = exports.config = void 0;
1539
+
1355
1540
  var lodash_1 = __webpack_require__(3);
1541
+
1356
1542
  var visualization_color_palettes_1 = __webpack_require__(51);
1357
- var config_1 = __webpack_require__(442);
1358
- var withDashboardViz_1 = __webpack_require__(36);
1359
- var Punchcard_1 = __webpack_require__(443);
1360
- var punchcardUtils_1 = __webpack_require__(451);
1543
+
1544
+ var config_1 = __webpack_require__(445);
1545
+
1546
+ var withDashboardViz_1 = __webpack_require__(37);
1547
+
1548
+ var Punchcard_1 = __webpack_require__(446);
1549
+
1550
+ var punchcardUtils_1 = __webpack_require__(454);
1551
+
1361
1552
  exports.config = config_1.default;
1362
1553
  exports.PurePunchcard = Punchcard_1.default;
1363
1554
  var validOptions = Object.keys(exports.config.optionsSchema);
1555
+
1364
1556
  var computeVizProps = function computeVizProps(_a) {
1365
1557
  var onPointClick = _a.onPointClick,
1366
- onLegendClick = _a.onLegendClick,
1367
- x = _a.x,
1368
- y = _a.y,
1369
- category = _a.category,
1370
- otherOptions = __rest(_a, ["onPointClick", "onLegendClick", "x", "y", "category"]);
1371
- var options = lodash_1.chain(otherOptions).pick(validOptions).thru(punchcardUtils_1.convertToPunchcardProperties).value();
1558
+ onLegendClick = _a.onLegendClick,
1559
+ x = _a.x,
1560
+ y = _a.y,
1561
+ category = _a.category,
1562
+ otherOptions = __rest(_a, ["onPointClick", "onLegendClick", "x", "y", "category"]);
1563
+
1564
+ var options = (0, lodash_1.chain)(otherOptions).pick(validOptions).thru(punchcardUtils_1.convertToPunchcardProperties).value();
1565
+
1372
1566
  if (options.seriesColors && typeof options.seriesColors === 'string') {
1373
1567
  try {
1374
1568
  options.seriesColors = JSON.parse(options.seriesColors);
@@ -1376,6 +1570,7 @@ var computeVizProps = function computeVizProps(_a) {
1376
1570
  options.seriesColors = visualization_color_palettes_1.VIZ_CATEGORICAL;
1377
1571
  }
1378
1572
  }
1573
+
1379
1574
  return Object.assign({
1380
1575
  onPointClick: onPointClick,
1381
1576
  onLegendClick: onLegendClick,
@@ -1385,8 +1580,9 @@ var computeVizProps = function computeVizProps(_a) {
1385
1580
  category: category && category.map(String)
1386
1581
  }, options);
1387
1582
  };
1583
+
1388
1584
  exports.computeVizProps = computeVizProps;
1389
- var viz = withDashboardViz_1.default({
1585
+ var viz = (0, withDashboardViz_1.default)({
1390
1586
  ReactViz: Punchcard_1.default,
1391
1587
  computeVizProps: exports.computeVizProps,
1392
1588
  vizConfig: config_1.default
@@ -1396,7 +1592,7 @@ exports.default = viz;
1396
1592
 
1397
1593
  /***/ }),
1398
1594
 
1399
- /***/ 442:
1595
+ /***/ 445:
1400
1596
  /***/ (function(module, exports, __webpack_require__) {
1401
1597
 
1402
1598
  "use strict";
@@ -1405,24 +1601,35 @@ exports.default = viz;
1405
1601
  Object.defineProperty(exports, "__esModule", {
1406
1602
  value: true
1407
1603
  });
1604
+
1408
1605
  var i18n_1 = __webpack_require__(2);
1606
+
1409
1607
  var schemaUtils_1 = __webpack_require__(16);
1608
+
1410
1609
  var visualization_icons_1 = __webpack_require__(52);
1411
- var placeholders_1 = __webpack_require__(49);
1610
+
1611
+ var placeholders_1 = __webpack_require__(50);
1612
+
1412
1613
  var visualization_color_palettes_1 = __webpack_require__(51);
1614
+
1413
1615
  var pick_1 = __webpack_require__(23);
1616
+
1414
1617
  var variables_1 = __webpack_require__(11);
1618
+
1415
1619
  var VizBehavior_1 = __webpack_require__(6);
1416
- var VizCategory_1 = __webpack_require__(35);
1620
+
1621
+ var VizCategory_1 = __webpack_require__(36);
1622
+
1417
1623
  var configUtils_1 = __webpack_require__(20);
1624
+
1418
1625
  var BackgroundColor_1 = __webpack_require__(53);
1626
+
1419
1627
  var dataContract = {
1420
1628
  requiredDataSources: [{
1421
1629
  name: 'primary',
1422
1630
  description: 'DataSource that powers the visualization'
1423
1631
  }],
1424
- optionalDataSources: [
1425
- // Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1632
+ optionalDataSources: [// Note: SCP-14090 disable ui for optional datasources. We may need to add it back later
1426
1633
  // {
1427
1634
  // name: 'annotation',
1428
1635
  // description: 'DataSource that populate event annotations',
@@ -1511,7 +1718,7 @@ var optionsSchema = {
1511
1718
  bubbleLabelDisplay: {
1512
1719
  default: 'all',
1513
1720
  description: 'Specify whether all bubble labels, the max value bubble labels, or none of the bubble labels should be displayed.',
1514
- pattern: schemaUtils_1.getPattern(['all', 'max', 'off']),
1721
+ pattern: (0, schemaUtils_1.getPattern)(['all', 'max', 'off']),
1515
1722
  type: 'string'
1516
1723
  },
1517
1724
  bubbleRadiusMax: {
@@ -1527,7 +1734,7 @@ var optionsSchema = {
1527
1734
  bubbleRowScale: {
1528
1735
  default: 'global',
1529
1736
  description: 'Specify how bubbles are scaled relative to other rows.',
1530
- pattern: schemaUtils_1.getPattern(['global', 'row']),
1737
+ pattern: (0, schemaUtils_1.getPattern)(['global', 'row']),
1531
1738
  type: 'string'
1532
1739
  },
1533
1740
  bubbleSizeMax: {
@@ -1543,19 +1750,19 @@ var optionsSchema = {
1543
1750
  bubbleSizeMethod: {
1544
1751
  default: 'area',
1545
1752
  description: 'Specify whether bubble area or diameter corresponds to the size value.',
1546
- pattern: schemaUtils_1.getPattern(['radius', 'area']),
1753
+ pattern: (0, schemaUtils_1.getPattern)(['radius', 'area']),
1547
1754
  type: 'string'
1548
1755
  },
1549
1756
  colorMode: {
1550
1757
  default: 'dynamic',
1551
1758
  description: 'Specify the coloring method used for the bubbles.',
1552
- pattern: schemaUtils_1.getPattern(['categorical', 'dynamic']),
1759
+ pattern: (0, schemaUtils_1.getPattern)(['categorical', 'dynamic']),
1553
1760
  type: 'string'
1554
1761
  },
1555
1762
  legendDisplay: {
1556
1763
  default: 'right',
1557
1764
  description: 'Specify the location of the legend on the panel.',
1558
- pattern: schemaUtils_1.getPattern(['right', 'off']),
1765
+ pattern: (0, schemaUtils_1.getPattern)(['right', 'off']),
1559
1766
  type: 'string'
1560
1767
  },
1561
1768
  seriesColors: {
@@ -1584,7 +1791,7 @@ var optionsSchema = {
1584
1791
  };
1585
1792
  var themes = {
1586
1793
  defaultBackgroundColor: function defaultBackgroundColor(props) {
1587
- return pick_1.default({
1794
+ return (0, pick_1.default)({
1588
1795
  enterprise: {
1589
1796
  dark: variables_1.default.black(props),
1590
1797
  light: variables_1.default.backgroundColor(props)
@@ -1594,73 +1801,72 @@ var themes = {
1594
1801
  }
1595
1802
  };
1596
1803
  var editorConfig = [{
1597
- label: i18n_1._('Data display'),
1804
+ label: (0, i18n_1._)('Data display'),
1598
1805
  layout: [[{
1599
- label: i18n_1._('Show bubble labels'),
1806
+ label: (0, i18n_1._)('Show bubble labels'),
1600
1807
  option: 'bubbleLabelDisplay',
1601
1808
  editor: 'editor.radioBar',
1602
1809
  editorProps: {
1603
1810
  values: [{
1604
- label: i18n_1._('All'),
1811
+ label: (0, i18n_1._)('All'),
1605
1812
  value: 'all'
1606
1813
  }, {
1607
- label: i18n_1._('Max'),
1814
+ label: (0, i18n_1._)('Max'),
1608
1815
  value: 'max'
1609
1816
  }, {
1610
- label: i18n_1._('Off'),
1817
+ label: (0, i18n_1._)('Off'),
1611
1818
  value: 'off'
1612
1819
  }]
1613
1820
  }
1614
1821
  }], [{
1615
- label: i18n_1._('Pulsate max value'),
1822
+ label: (0, i18n_1._)('Pulsate max value'),
1616
1823
  option: 'showMaxValuePulsation',
1617
1824
  editor: 'editor.toggle'
1618
1825
  }], [{
1619
- label: i18n_1._('Bubble scale'),
1826
+ label: (0, i18n_1._)('Bubble scale'),
1620
1827
  option: 'bubbleSizeMethod',
1621
1828
  editor: 'editor.radioBar',
1622
1829
  editorProps: {
1623
1830
  values: [{
1624
- label: i18n_1._('Radius'),
1831
+ label: (0, i18n_1._)('Radius'),
1625
1832
  value: 'radius'
1626
1833
  }, {
1627
- label: i18n_1._('Area'),
1834
+ label: (0, i18n_1._)('Area'),
1628
1835
  value: 'area'
1629
1836
  }]
1630
1837
  }
1631
1838
  }], [{
1632
- label: i18n_1._('Bubble row scale'),
1839
+ label: (0, i18n_1._)('Bubble row scale'),
1633
1840
  option: 'bubbleRowScale',
1634
1841
  editor: 'editor.radioBar',
1635
1842
  editorProps: {
1636
1843
  values: [{
1637
- label: i18n_1._('Global'),
1844
+ label: (0, i18n_1._)('Global'),
1638
1845
  value: 'global'
1639
1846
  }, {
1640
- label: i18n_1._('By Row'),
1847
+ label: (0, i18n_1._)('By Row'),
1641
1848
  value: 'row'
1642
1849
  }]
1643
1850
  }
1644
1851
  }]]
1645
1852
  }, {
1646
- label: i18n_1._('Color and style'),
1853
+ label: (0, i18n_1._)('Color and style'),
1647
1854
  layout: [[{
1648
- label: i18n_1._('Color mode'),
1855
+ label: (0, i18n_1._)('Color mode'),
1649
1856
  option: 'colorMode',
1650
1857
  editor: 'editor.radioBar',
1651
1858
  editorProps: {
1652
1859
  values: [{
1653
- label: i18n_1._('Dynamic'),
1860
+ label: (0, i18n_1._)('Dynamic'),
1654
1861
  value: 'dynamic'
1655
1862
  }, {
1656
- label: i18n_1._('Categorical'),
1863
+ label: (0, i18n_1._)('Categorical'),
1657
1864
  value: 'categorical'
1658
1865
  }]
1659
1866
  }
1660
- }], [
1661
- // This should be hidden in categorical color mode
1867
+ }], [// This should be hidden in categorical color mode
1662
1868
  {
1663
- label: i18n_1._('Color by field'),
1869
+ label: (0, i18n_1._)('Color by field'),
1664
1870
  editor: 'editor.columnSelector',
1665
1871
  option: 'bubbleColor',
1666
1872
  context: 'bubbleColorConfig',
@@ -1680,18 +1886,18 @@ var editorConfig = [{
1680
1886
  };
1681
1887
  }
1682
1888
  }
1683
- }], BackgroundColor_1.default({
1889
+ }], (0, BackgroundColor_1.default)({
1684
1890
  themes: themes
1685
1891
  }), [{
1686
- label: i18n_1._('Legend display'),
1892
+ label: (0, i18n_1._)('Legend display'),
1687
1893
  option: 'legendDisplay',
1688
1894
  editor: 'editor.select',
1689
1895
  editorProps: {
1690
1896
  values: [{
1691
- label: i18n_1._('Right'),
1897
+ label: (0, i18n_1._)('Right'),
1692
1898
  value: 'right'
1693
1899
  }, {
1694
- label: i18n_1._('Off'),
1900
+ label: (0, i18n_1._)('Off'),
1695
1901
  value: 'off'
1696
1902
  }]
1697
1903
  },
@@ -1704,16 +1910,19 @@ var editorConfig = [{
1704
1910
  /**
1705
1911
  * visualization configuration
1706
1912
  */
1913
+
1707
1914
  var config = {
1708
1915
  /**
1709
1916
  * unique viz key
1710
1917
  */
1711
1918
  key: 'splunk.punchcard',
1919
+
1712
1920
  /**
1713
1921
  * viz name
1714
1922
  */
1715
- name: i18n_1._('Punchcard'),
1923
+ name: (0, i18n_1._)('Punchcard'),
1716
1924
  category: VizCategory_1.VizCategory.CORRELATION,
1925
+
1717
1926
  /**
1718
1927
  * viz icon
1719
1928
  */
@@ -1736,39 +1945,57 @@ var config = {
1736
1945
  themes: themes,
1737
1946
  requiredProps: ['x', 'y', 'size']
1738
1947
  };
1739
- exports.default = configUtils_1.enhanceConfig(config);
1948
+ exports.default = (0, configUtils_1.enhanceConfig)(config);
1740
1949
 
1741
1950
  /***/ }),
1742
1951
 
1743
- /***/ 443:
1952
+ /***/ 446:
1744
1953
  /***/ (function(module, exports, __webpack_require__) {
1745
1954
 
1746
1955
  "use strict";
1747
1956
 
1748
1957
 
1749
1958
  var _defineProperty = __webpack_require__(7);
1959
+
1750
1960
  var _slicedToArray = __webpack_require__(17);
1961
+
1751
1962
  Object.defineProperty(exports, "__esModule", {
1752
1963
  value: true
1753
1964
  });
1965
+
1754
1966
  var React = __webpack_require__(1);
1967
+
1755
1968
  var styled_components_1 = __webpack_require__(4);
1969
+
1756
1970
  var T = __webpack_require__(0);
1971
+
1757
1972
  var lodash_1 = __webpack_require__(3);
1973
+
1974
+ var types_1 = __webpack_require__(83);
1975
+
1758
1976
  var SizeAwareWrapper_1 = __webpack_require__(19);
1977
+
1759
1978
  var style_1 = __webpack_require__(14);
1979
+
1760
1980
  var visualization_color_palettes_1 = __webpack_require__(51);
1981
+
1761
1982
  var punchcardUtils_1 = __webpack_require__(99);
1762
- var sortUtils_1 = __webpack_require__(444);
1763
- var PunchcardAxis_1 = __webpack_require__(445);
1764
- var PunchcardChartArea_1 = __webpack_require__(446);
1765
- var PunchcardLegend_1 = __webpack_require__(449);
1766
- var PunchcardGridLines_1 = __webpack_require__(450);
1983
+
1984
+ var sortUtils_1 = __webpack_require__(447);
1985
+
1986
+ var PunchcardAxis_1 = __webpack_require__(448);
1987
+
1988
+ var PunchcardChartArea_1 = __webpack_require__(449);
1989
+
1990
+ var PunchcardLegend_1 = __webpack_require__(452);
1991
+
1992
+ var PunchcardGridLines_1 = __webpack_require__(453);
1993
+
1767
1994
  var Container = styled_components_1.default.div.withConfig({
1768
1995
  displayName: "Punchcard__Container",
1769
1996
  componentId: "orvtgq-0"
1770
1997
  })(["cursor:default;overflow:hidden;", ";background-color:", ";"], function (props) {
1771
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
1998
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
1772
1999
  }, function (props) {
1773
2000
  return props.backgroundColor;
1774
2001
  });
@@ -1782,96 +2009,110 @@ var PunchcardContainer = styled_components_1.default.div.withConfig({
1782
2009
  displayName: "Punchcard__PunchcardContainer",
1783
2010
  componentId: "orvtgq-2"
1784
2011
  })(["overflow:hidden;position:relative;", ";"], function (props) {
1785
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2012
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
1786
2013
  });
1787
2014
  var PunchcardSVG = styled_components_1.default.svg.withConfig({
1788
2015
  displayName: "Punchcard__PunchcardSVG",
1789
2016
  componentId: "orvtgq-3"
1790
2017
  })(["", ";"], function (props) {
1791
- return style_1.toDimension(lodash_1.pick(props, ['width', 'height']));
2018
+ return (0, style_1.toDimension)((0, lodash_1.pick)(props, ['width', 'height']));
1792
2019
  });
2020
+
1793
2021
  var Punchcard = function Punchcard(props) {
1794
2022
  var _React$useState = React.useState(null),
1795
- _React$useState2 = _slicedToArray(_React$useState, 2),
1796
- selectedX = _React$useState2[0],
1797
- setSelectedX = _React$useState2[1];
2023
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2024
+ selectedX = _React$useState2[0],
2025
+ setSelectedX = _React$useState2[1];
2026
+
1798
2027
  var _React$useState3 = React.useState(null),
1799
- _React$useState4 = _slicedToArray(_React$useState3, 2),
1800
- selectedY = _React$useState4[0],
1801
- setSelectedY = _React$useState4[1];
2028
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2029
+ selectedY = _React$useState4[0],
2030
+ setSelectedY = _React$useState4[1];
2031
+
1802
2032
  var _React$useState5 = React.useState(null),
1803
- _React$useState6 = _slicedToArray(_React$useState5, 2),
1804
- selectedCategory = _React$useState6[0],
1805
- setSelectedCategory = _React$useState6[1];
2033
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
2034
+ selectedCategory = _React$useState6[0],
2035
+ setSelectedCategory = _React$useState6[1];
2036
+
1806
2037
  var handleMouseLeave = function handleMouseLeave() {
1807
2038
  setSelectedX(null);
1808
2039
  setSelectedY(null);
1809
2040
  setSelectedCategory(null);
1810
2041
  };
2042
+
1811
2043
  var handleLegendHover = function handleLegendHover(category) {
1812
2044
  setSelectedX(null);
1813
2045
  setSelectedY(null);
1814
2046
  setSelectedCategory(category);
1815
2047
  };
2048
+
1816
2049
  var handleXAxisHover = function handleXAxisHover(xValue) {
1817
2050
  setSelectedX(xValue);
1818
2051
  setSelectedY(null);
1819
2052
  setSelectedCategory(null);
1820
2053
  };
2054
+
1821
2055
  var handleYAxisHover = function handleYAxisHover(yValue) {
1822
2056
  setSelectedX(null);
1823
2057
  setSelectedY(yValue);
1824
2058
  setSelectedCategory(null);
1825
2059
  };
2060
+
1826
2061
  var handleBubbleHover = function handleBubbleHover(xValue, yValue, category) {
1827
2062
  setSelectedX(xValue);
1828
2063
  setSelectedY(yValue);
1829
2064
  setSelectedCategory(category);
1830
2065
  };
2066
+
1831
2067
  var backgroundColor = props.backgroundColor,
1832
- showBubbleLabels = props.showBubbleLabels,
1833
- bubbleRowScale = props.bubbleRowScale,
1834
- bubbleScale = props.bubbleScale,
1835
- category = props.category,
1836
- categoryField = props.categoryField,
1837
- colorMode = props.colorMode,
1838
- seriesColors = props.seriesColors,
1839
- bubbleColor = props.bubbleColor,
1840
- minBubbleColorIntensity = props.minBubbleColorIntensity,
1841
- height = props.height,
1842
- showMaxValuePulsation = props.showMaxValuePulsation,
1843
- isBubbleSizeDynamic = props.isBubbleSizeDynamic,
1844
- minBubbleSize = props.minBubbleSize,
1845
- maxBubbleSize = props.maxBubbleSize,
1846
- maxBubbleRadius = props.maxBubbleRadius,
1847
- minBubbleRadius = props.minBubbleRadius,
1848
- useDefaultSort = props.useDefaultSort,
1849
- showLegend = props.showLegend,
1850
- size = props.size,
1851
- sizeField = props.sizeField,
1852
- width = props.width,
1853
- x = props.x,
1854
- y = props.y,
1855
- xField = props.xField,
1856
- yField = props.yField,
1857
- onPointClick = props.onPointClick,
1858
- onLegendClick = props.onLegendClick;
2068
+ showBubbleLabels = props.showBubbleLabels,
2069
+ bubbleRowScale = props.bubbleRowScale,
2070
+ bubbleScale = props.bubbleScale,
2071
+ category = props.category,
2072
+ categoryField = props.categoryField,
2073
+ colorMode = props.colorMode,
2074
+ seriesColors = props.seriesColors,
2075
+ bubbleColor = props.bubbleColor,
2076
+ minBubbleColorIntensity = props.minBubbleColorIntensity,
2077
+ height = props.height,
2078
+ showMaxValuePulsation = props.showMaxValuePulsation,
2079
+ isBubbleSizeDynamic = props.isBubbleSizeDynamic,
2080
+ minBubbleSize = props.minBubbleSize,
2081
+ maxBubbleSize = props.maxBubbleSize,
2082
+ maxBubbleRadius = props.maxBubbleRadius,
2083
+ minBubbleRadius = props.minBubbleRadius,
2084
+ useDefaultSort = props.useDefaultSort,
2085
+ showLegend = props.showLegend,
2086
+ size = props.size,
2087
+ sizeField = props.sizeField,
2088
+ width = props.width,
2089
+ x = props.x,
2090
+ y = props.y,
2091
+ xField = props.xField,
2092
+ yField = props.yField,
2093
+ onPointClick = props.onPointClick,
2094
+ onLegendClick = props.onLegendClick;
1859
2095
  var calculatedColorMode = category ? colorMode : punchcardUtils_1.COLOR_MODE_TYPES.SEQUENTIAL;
1860
2096
  var displayLegend = showLegend && calculatedColorMode === punchcardUtils_1.COLOR_MODE_TYPES.CATEGORICAL;
1861
- var uniqX = useDefaultSort ? sortUtils_1.sortAxis(lodash_1.uniq(x.map(function (v) {
2097
+ var uniqX = useDefaultSort ? (0, sortUtils_1.sortAxis)((0, lodash_1.uniq)(x.map(function (v) {
1862
2098
  return "".concat(v);
1863
- }))) : lodash_1.uniq(x);
1864
- var uniqY = useDefaultSort ? sortUtils_1.sortAxis(lodash_1.uniq(y.map(function (v) {
2099
+ }))) : (0, lodash_1.uniq)(x);
2100
+ var uniqY = useDefaultSort ? (0, sortUtils_1.sortAxis)((0, lodash_1.uniq)(y.map(function (v) {
1865
2101
  return "".concat(v);
1866
- }))) : lodash_1.uniq(y);
1867
- var uniqCategory = lodash_1.uniq(category);
1868
- var colorCategoryMapping = punchcardUtils_1.getColorCategoryMapping({
2102
+ }))) : (0, lodash_1.uniq)(y);
2103
+ var uniqCategory = (0, lodash_1.uniq)(category);
2104
+ var bubbleSizes = size.map(function (v) {
2105
+ return (0, types_1.isNumber)(v) ? Number(v) : 0;
2106
+ });
2107
+ var colorCategoryMapping = (0, punchcardUtils_1.getColorCategoryMapping)({
1869
2108
  category: uniqCategory,
1870
2109
  colorMode: calculatedColorMode,
1871
2110
  seriesColors: seriesColors
1872
2111
  });
2112
+
1873
2113
  var handlePointClick = function handlePointClick(sizeValue) {
1874
2114
  var _rowData;
2115
+
1875
2116
  var rowData = (_rowData = {}, _defineProperty(_rowData, "row.".concat(xField, ".value"), selectedX), _defineProperty(_rowData, "row.".concat(yField, ".value"), selectedY), _defineProperty(_rowData, "row.".concat(sizeField, ".value"), sizeValue), _rowData);
1876
2117
  if (categoryField) rowData["row.".concat(categoryField, ".value")] = selectedCategory;
1877
2118
  onPointClick({
@@ -1882,6 +2123,7 @@ var Punchcard = function Punchcard(props) {
1882
2123
  }, rowData)
1883
2124
  });
1884
2125
  };
2126
+
1885
2127
  var handleLegendClick = function handleLegendClick() {
1886
2128
  onLegendClick({
1887
2129
  type: 'legend.click',
@@ -1890,35 +2132,40 @@ var Punchcard = function Punchcard(props) {
1890
2132
  }
1891
2133
  });
1892
2134
  };
2135
+
1893
2136
  var renderVisualization = function renderVisualization(_ref) {
1894
2137
  var containerWidth = _ref.width,
1895
- containerHeight = _ref.height;
1896
- var _punchcardUtils_1$get = punchcardUtils_1.getChartAreaDimensions({
1897
- containerWidth: containerWidth,
1898
- containerHeight: containerHeight,
1899
- displayLegend: displayLegend
1900
- }),
1901
- xAxisStartY = _punchcardUtils_1$get.xAxisStartY,
1902
- yAxisStartX = _punchcardUtils_1$get.yAxisStartX,
1903
- chartAreaStartX = _punchcardUtils_1$get.chartAreaStartX,
1904
- chartAreaStartY = _punchcardUtils_1$get.chartAreaStartY,
1905
- chartAreaEndX = _punchcardUtils_1$get.chartAreaEndX,
1906
- chartAreaEndY = _punchcardUtils_1$get.chartAreaEndY,
1907
- legendStartX = _punchcardUtils_1$get.legendStartX;
1908
- var _punchcardUtils_1$get2 = punchcardUtils_1.getScales({
1909
- values: uniqX,
1910
- start: chartAreaStartX,
1911
- end: chartAreaEndX
1912
- }),
1913
- xScale = _punchcardUtils_1$get2.scale,
1914
- xPositionScale = _punchcardUtils_1$get2.positionScale;
1915
- var _punchcardUtils_1$get3 = punchcardUtils_1.getScales({
1916
- values: uniqY,
1917
- start: chartAreaStartY,
1918
- end: chartAreaEndY
1919
- }),
1920
- yScale = _punchcardUtils_1$get3.scale,
1921
- yPositionScale = _punchcardUtils_1$get3.positionScale;
2138
+ containerHeight = _ref.height;
2139
+
2140
+ var _ref2 = (0, punchcardUtils_1.getChartAreaDimensions)({
2141
+ containerWidth: containerWidth,
2142
+ containerHeight: containerHeight,
2143
+ displayLegend: displayLegend
2144
+ }),
2145
+ xAxisStartY = _ref2.xAxisStartY,
2146
+ yAxisStartX = _ref2.yAxisStartX,
2147
+ chartAreaStartX = _ref2.chartAreaStartX,
2148
+ chartAreaStartY = _ref2.chartAreaStartY,
2149
+ chartAreaEndX = _ref2.chartAreaEndX,
2150
+ chartAreaEndY = _ref2.chartAreaEndY,
2151
+ legendStartX = _ref2.legendStartX;
2152
+
2153
+ var _ref3 = (0, punchcardUtils_1.getScales)({
2154
+ values: uniqX,
2155
+ start: chartAreaStartX,
2156
+ end: chartAreaEndX
2157
+ }),
2158
+ xScale = _ref3.scale,
2159
+ xPositionScale = _ref3.positionScale;
2160
+
2161
+ var _ref4 = (0, punchcardUtils_1.getScales)({
2162
+ values: uniqY,
2163
+ start: chartAreaStartY,
2164
+ end: chartAreaEndY
2165
+ }),
2166
+ yScale = _ref4.scale,
2167
+ yPositionScale = _ref4.positionScale;
2168
+
1922
2169
  var minBand = Math.min(xScale.bandwidth(), yScale.bandwidth());
1923
2170
  return React.createElement(PunchcardWrapper, {
1924
2171
  backgroundColor: backgroundColor
@@ -1985,7 +2232,7 @@ var Punchcard = function Punchcard(props) {
1985
2232
  selectedCategory: selectedCategory,
1986
2233
  selectedX: selectedX,
1987
2234
  selectedY: selectedY,
1988
- size: size,
2235
+ size: bubbleSizes,
1989
2236
  x: x,
1990
2237
  xScale: xPositionScale,
1991
2238
  y: y,
@@ -1998,6 +2245,7 @@ var Punchcard = function Punchcard(props) {
1998
2245
  values: "0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"
1999
2246
  })))));
2000
2247
  };
2248
+
2001
2249
  return React.createElement(Container, {
2002
2250
  backgroundColor: backgroundColor,
2003
2251
  height: height,
@@ -2006,6 +2254,7 @@ var Punchcard = function Punchcard(props) {
2006
2254
  return renderVisualization(containerDimension);
2007
2255
  }));
2008
2256
  };
2257
+
2009
2258
  var propTypes = {
2010
2259
  backgroundColor: T.string,
2011
2260
  showBubbleLabels: T.oneOf(Object.values(punchcardUtils_1.BUBBLE_LABELS_TYPES)),
@@ -2033,7 +2282,7 @@ var propTypes = {
2033
2282
  // implemented in config file using requiredProps
2034
2283
  x: T.arrayOf(T.oneOfType([T.string, T.number])),
2035
2284
  y: T.arrayOf(T.oneOfType([T.string, T.number])),
2036
- size: T.arrayOf(T.number),
2285
+ size: T.arrayOf(T.oneOfType([T.string, T.number])),
2037
2286
  xField: T.string,
2038
2287
  yField: T.string,
2039
2288
  onPointClick: T.func,
@@ -2075,7 +2324,7 @@ exports.default = Punchcard;
2075
2324
 
2076
2325
  /***/ }),
2077
2326
 
2078
- /***/ 444:
2327
+ /***/ 447:
2079
2328
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
2080
2329
 
2081
2330
  "use strict";
@@ -2085,13 +2334,13 @@ __webpack_require__.r(__webpack_exports__);
2085
2334
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortedByDTime", function() { return sortedByDTime; });
2086
2335
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortByDigitOrAlpha", function() { return sortByDigitOrAlpha; });
2087
2336
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "sortAxis", function() { return sortAxis; });
2088
- /* harmony import */ var lodash_findIndex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(136);
2337
+ /* harmony import */ var lodash_findIndex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(138);
2089
2338
  /* harmony import */ var lodash_findIndex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_findIndex__WEBPACK_IMPORTED_MODULE_0__);
2090
- /* harmony import */ var lodash_find__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(112);
2339
+ /* harmony import */ var lodash_find__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(113);
2091
2340
  /* harmony import */ var lodash_find__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_find__WEBPACK_IMPORTED_MODULE_1__);
2092
- /* harmony import */ var lodash_sortBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(167);
2341
+ /* harmony import */ var lodash_sortBy__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(170);
2093
2342
  /* harmony import */ var lodash_sortBy__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash_sortBy__WEBPACK_IMPORTED_MODULE_2__);
2094
- /* harmony import */ var lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(137);
2343
+ /* harmony import */ var lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(139);
2095
2344
  /* harmony import */ var lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3__);
2096
2345
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(3);
2097
2346
  /* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_4__);
@@ -2188,78 +2437,82 @@ var TIME_RANGES = {
2188
2437
  'sun.': true
2189
2438
  }]
2190
2439
  };
2191
-
2192
2440
  /**
2193
2441
  * Sort axis labels by weekday
2194
2442
  * @param {array} axis - string array
2195
2443
  * @return {array} - string array. If those are not weekday strings, return []
2196
2444
  */
2445
+
2197
2446
  var sortedByWeekday = function sortedByWeekday(axis) {
2198
2447
  var sortedAxis = [];
2199
2448
  var notWeekDay = lodash_find__WEBPACK_IMPORTED_MODULE_1___default()(axis, function (value) {
2200
2449
  var lowerValue = value.toLowerCase();
2201
2450
  var index = lodash_findIndex__WEBPACK_IMPORTED_MODULE_0___default()(TIME_RANGES.wday, lowerValue);
2451
+
2202
2452
  if (index === -1) {
2203
2453
  // if the axis contains any value not inside weekdays, then don't treat it as weekdays
2204
2454
  return true;
2205
2455
  }
2456
+
2206
2457
  if (sortedAxis[index]) {
2207
2458
  sortedAxis[index] = [sortedAxis[index], value];
2208
2459
  } else {
2209
2460
  sortedAxis[index] = value;
2210
2461
  }
2462
+
2211
2463
  return false;
2212
2464
  });
2213
2465
  return notWeekDay ? [] : lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3___default()(sortedAxis.filter(Boolean));
2214
2466
  };
2215
-
2216
2467
  /**
2217
2468
  * Sort axis labels by month
2218
2469
  * @param {array} axis - string array
2219
2470
  * @return {array} - string array. If those are not month strings, return []
2220
2471
  */
2472
+
2221
2473
  var sortedByMonth = function sortedByMonth(axis) {
2222
2474
  var sortedAxis = [];
2223
2475
  var notMonth = lodash_find__WEBPACK_IMPORTED_MODULE_1___default()(axis, function (value) {
2224
2476
  var lowerValue = value.toLowerCase();
2225
2477
  var index = lodash_findIndex__WEBPACK_IMPORTED_MODULE_0___default()(TIME_RANGES.month, lowerValue);
2478
+
2226
2479
  if (index === -1) {
2227
2480
  // if the axis contains any value not inside month, then don't treat it as month
2228
2481
  return true;
2229
2482
  }
2483
+
2230
2484
  if (sortedAxis[index]) {
2231
2485
  sortedAxis[index] = [sortedAxis[index], value];
2232
2486
  } else {
2233
2487
  sortedAxis[index] = value;
2234
2488
  }
2489
+
2235
2490
  return false;
2236
2491
  });
2237
2492
  return notMonth ? [] : lodash_flattenDeep__WEBPACK_IMPORTED_MODULE_3___default()(sortedAxis.filter(Boolean));
2238
2493
  };
2239
-
2240
2494
  /**
2241
2495
  * Sort axis labels by date time
2242
2496
  * @param {array} axis - string array
2243
2497
  * @return {array} - string array. If those are not in acceptTimeFormat or formatted date, return []
2244
2498
  */
2499
+
2245
2500
  var sortedByDTime = function sortedByDTime(axis) {
2246
2501
  // valid time format 01:00 am, 01:00:00, 01:00
2247
- var acceptTimeFormat = [/^([0-1])?\d( )?(am|pm)$/i,
2248
- // 1am, 1 am, 12am, 12 am
2249
- /^([0-1])?\d:[0-5]\d( )?(am|pm)$/i,
2250
- // 01:00 am, 01:00am, 1:00am
2251
- /^([0-2])?\d:([0-5]\d:)?[0-5]\d$/,
2252
- // 01:00:00, 1:00:00, 23:00
2502
+ var acceptTimeFormat = [/^([0-1])?\d( )?(am|pm)$/i, // 1am, 1 am, 12am, 12 am
2503
+ /^([0-1])?\d:[0-5]\d( )?(am|pm)$/i, // 01:00 am, 01:00am, 1:00am
2504
+ /^([0-2])?\d:([0-5]\d:)?[0-5]\d$/, // 01:00:00, 1:00:00, 23:00
2253
2505
  /^([0-2])?\d:[0-5]\d:[0-5]\d( )?(am|pm)$/i // 01:00:00 am, 1:00:00am
2254
2506
  ];
2255
-
2256
2507
  var sortArr = [];
2257
2508
  var notDate = lodash_find__WEBPACK_IMPORTED_MODULE_1___default()(axis, function (value) {
2258
2509
  if (!Number.isNaN(Number(value))) {
2259
2510
  return true;
2260
- }
2261
- // should accept long date: 2019-03-02, Mar 2 2019, ..., 2019-01-01T00:00:00.000Z
2511
+ } // should accept long date: 2019-03-02, Mar 2 2019, ..., 2019-01-01T00:00:00.000Z
2512
+
2513
+
2262
2514
  var convertedDate = new Date(value);
2515
+
2263
2516
  if (!Number.isNaN(Number(convertedDate))) {
2264
2517
  sortArr.push({
2265
2518
  epoch: convertedDate,
@@ -2267,19 +2520,23 @@ var sortedByDTime = function sortedByDTime(axis) {
2267
2520
  });
2268
2521
  return false;
2269
2522
  }
2523
+
2270
2524
  var acceptedTime = acceptTimeFormat.find(function (format) {
2271
2525
  return format.test(value);
2272
2526
  });
2527
+
2273
2528
  if (acceptedTime) {
2274
2529
  var midday = /(am|pm)$/i;
2275
2530
  var reformatTime = value;
2276
2531
  var containsMidday = value.match(midday);
2532
+
2277
2533
  if (containsMidday) {
2278
2534
  // for time format like 01:00 am and 1 am
2279
2535
  reformatTime = value.split(midday).slice(0, -1);
2280
2536
  reformatTime[0] = "".concat(reformatTime[0].trim(), ":00");
2281
2537
  reformatTime = reformatTime.join(' ');
2282
2538
  }
2539
+
2283
2540
  convertedDate = new Date("1970/01/01 ".concat(reformatTime));
2284
2541
  sortArr.push({
2285
2542
  epoch: convertedDate,
@@ -2287,61 +2544,72 @@ var sortedByDTime = function sortedByDTime(axis) {
2287
2544
  });
2288
2545
  return false;
2289
2546
  }
2547
+
2290
2548
  return true;
2291
2549
  });
2550
+
2292
2551
  if (notDate) {
2293
2552
  return [];
2294
2553
  }
2554
+
2295
2555
  return lodash_sortBy__WEBPACK_IMPORTED_MODULE_2___default()(sortArr, function (val) {
2296
2556
  return val.epoch;
2297
2557
  }).map(function (val) {
2298
2558
  return val.original;
2299
2559
  });
2300
2560
  };
2301
-
2302
2561
  /**
2303
2562
  * Sort axis labels by digits or alphabetical order
2304
2563
  * @param {array} axis - string array
2305
2564
  * @return {array} - string array.
2306
2565
  * If those inputs are numbers, then return in digits order. Otherwise, return array based on alphabetical order
2307
2566
  */
2567
+
2308
2568
  var sortByDigitOrAlpha = function sortByDigitOrAlpha(axis) {
2309
2569
  // 10, 10.0, 10.1, not accept 10,000.0
2310
2570
  var coercedIsFinite = function coercedIsFinite(num) {
2311
2571
  return Number.isFinite(Number(num));
2312
2572
  };
2573
+
2313
2574
  if (Object(lodash__WEBPACK_IMPORTED_MODULE_4__["every"])(axis, coercedIsFinite)) {
2314
2575
  return axis.sort(function (a, b) {
2315
2576
  return Number(a) - Number(b);
2316
2577
  });
2317
2578
  }
2579
+
2318
2580
  return axis.sort();
2319
2581
  };
2320
-
2321
2582
  /**
2322
2583
  * Sort axis based on the priority: time measures, numbers, strings in ascending order
2323
2584
  * @param {array} axis - string array
2324
2585
  * @return {array} - string array
2325
2586
  */
2587
+
2326
2588
  var sortAxis = function sortAxis(axis) {
2327
2589
  var sortedTimeAxis = sortedByDTime(axis);
2590
+
2328
2591
  if (sortedTimeAxis.length) {
2329
2592
  return sortedTimeAxis;
2330
2593
  }
2594
+
2331
2595
  var sortedWeekdays = sortedByWeekday(axis);
2596
+
2332
2597
  if (sortedWeekdays.length) {
2333
2598
  return sortedWeekdays;
2334
2599
  }
2600
+
2335
2601
  var sortedMonths = sortedByMonth(axis);
2602
+
2336
2603
  if (sortedMonths.length) {
2337
2604
  return sortedMonths;
2338
2605
  }
2606
+
2339
2607
  return sortByDigitOrAlpha(axis);
2340
2608
  };
2341
2609
 
2342
2610
  /***/ }),
2343
2611
 
2344
- /***/ 445:
2612
+ /***/ 448:
2345
2613
  /***/ (function(module, exports, __webpack_require__) {
2346
2614
 
2347
2615
  "use strict";
@@ -2350,16 +2618,23 @@ var sortAxis = function sortAxis(axis) {
2350
2618
  Object.defineProperty(exports, "__esModule", {
2351
2619
  value: true
2352
2620
  });
2621
+
2353
2622
  var React = __webpack_require__(1);
2623
+
2354
2624
  var T = __webpack_require__(0);
2625
+
2355
2626
  var styled_components_1 = __webpack_require__(4);
2627
+
2356
2628
  var pick_1 = __webpack_require__(23);
2629
+
2357
2630
  var variables_1 = __webpack_require__(11);
2631
+
2358
2632
  var punchcardUtils_1 = __webpack_require__(99);
2633
+
2359
2634
  var AxisLabelText = styled_components_1.default.text.withConfig({
2360
2635
  displayName: "PunchcardAxis__AxisLabelText",
2361
2636
  componentId: "sc-1jv7cdw-0"
2362
- })(["cursor:pointer;dominant-baseline:middle;fill:", ";font-size:12px;text-anchor:", ";opacity:", ";transition:all 0.15s;"], pick_1.default({
2637
+ })(["cursor:pointer;dominant-baseline:middle;fill:", ";font-size:12px;text-anchor:", ";opacity:", ";transition:all 0.15s;"], (0, pick_1.default)({
2363
2638
  /* was previously named textColor in themeReg */
2364
2639
  enterprise: variables_1.default.textColor,
2365
2640
  prisma: variables_1.default.contentColorDefault
@@ -2368,25 +2643,26 @@ var AxisLabelText = styled_components_1.default.text.withConfig({
2368
2643
  }, function (props) {
2369
2644
  return props.muted ? 0.15 : 1;
2370
2645
  });
2646
+
2371
2647
  var PunchcardAxis = function PunchcardAxis(props) {
2372
2648
  var labels = props.labels,
2373
- handleMouseEnter = props.handleMouseEnter,
2374
- handleMouseLeave = props.handleMouseLeave,
2375
- orientation = props.orientation,
2376
- scale = props.scale,
2377
- selected = props.selected,
2378
- startPositionX = props.startPositionX,
2379
- startPositionY = props.startPositionY;
2649
+ handleMouseEnter = props.handleMouseEnter,
2650
+ handleMouseLeave = props.handleMouseLeave,
2651
+ orientation = props.orientation,
2652
+ scale = props.scale,
2653
+ selected = props.selected,
2654
+ startPositionX = props.startPositionX,
2655
+ startPositionY = props.startPositionY;
2380
2656
  return React.createElement("g", null, labels.map(function (label, index) {
2381
2657
  // Space between labels either in x or y direction depending on orientation
2382
2658
  var positionDelta = index * scale.bandwidth() + scale.bandwidth() / 2;
2383
2659
  var xPosition = orientation === punchcardUtils_1.AXIS_ORIENTATION_TYPES.VERTICAL ? startPositionX : startPositionX + positionDelta;
2384
- var yPosition = orientation === punchcardUtils_1.AXIS_ORIENTATION_TYPES.VERTICAL ? startPositionY + positionDelta : startPositionY;
2385
- // create padding between x-axis labels
2660
+ var yPosition = orientation === punchcardUtils_1.AXIS_ORIENTATION_TYPES.VERTICAL ? startPositionY + positionDelta : startPositionY; // create padding between x-axis labels
2661
+
2386
2662
  var xAxisWidthScale = scale.copy().paddingInner(0.1).round(true);
2387
- var truncatedLabel = orientation === punchcardUtils_1.AXIS_ORIENTATION_TYPES.VERTICAL ? punchcardUtils_1.truncateAxisLabelText({
2663
+ var truncatedLabel = orientation === punchcardUtils_1.AXIS_ORIENTATION_TYPES.VERTICAL ? (0, punchcardUtils_1.truncateAxisLabelText)({
2388
2664
  label: "".concat(label)
2389
- }) : punchcardUtils_1.truncateAxisLabelText({
2665
+ }) : (0, punchcardUtils_1.truncateAxisLabelText)({
2390
2666
  label: "".concat(label),
2391
2667
  widthInPX: xAxisWidthScale.bandwidth()
2392
2668
  });
@@ -2403,6 +2679,7 @@ var PunchcardAxis = function PunchcardAxis(props) {
2403
2679
  }, React.createElement("title", null, label), truncatedLabel);
2404
2680
  }));
2405
2681
  };
2682
+
2406
2683
  var propTypes = {
2407
2684
  labels: T.arrayOf(T.oneOfType([T.string, T.number])).isRequired,
2408
2685
  handleMouseEnter: T.func,
@@ -2433,50 +2710,58 @@ exports.default = PunchcardAxis;
2433
2710
 
2434
2711
  /***/ }),
2435
2712
 
2436
- /***/ 446:
2713
+ /***/ 449:
2437
2714
  /***/ (function(module, exports, __webpack_require__) {
2438
2715
 
2439
2716
  "use strict";
2440
2717
 
2441
2718
 
2442
2719
  var _toConsumableArray = __webpack_require__(8);
2720
+
2443
2721
  var _slicedToArray = __webpack_require__(17);
2722
+
2444
2723
  Object.defineProperty(exports, "__esModule", {
2445
2724
  value: true
2446
2725
  });
2726
+
2447
2727
  var React = __webpack_require__(1);
2728
+
2448
2729
  var T = __webpack_require__(0);
2730
+
2449
2731
  var punchcardUtils_1 = __webpack_require__(99);
2450
- var PunchcardRow_1 = __webpack_require__(447);
2732
+
2733
+ var PunchcardRow_1 = __webpack_require__(450);
2734
+
2451
2735
  var PunchcardChartArea = function PunchcardChartArea(props) {
2452
2736
  var showBubbleLabels = props.showBubbleLabels,
2453
- bubbleRowScale = props.bubbleRowScale,
2454
- bubbleScale = props.bubbleScale,
2455
- category = props.category,
2456
- colorCategoryMapping = props.colorCategoryMapping,
2457
- colorMode = props.colorMode,
2458
- bubbleColor = props.bubbleColor,
2459
- handleMouseEnter = props.handleMouseEnter,
2460
- handleMouseLeave = props.handleMouseLeave,
2461
- isBubbleSizeDynamic = props.isBubbleSizeDynamic,
2462
- minBubbleColorIntensity = props.minBubbleColorIntensity,
2463
- minBand = props.minBand,
2464
- minBubbleSize = props.minBubbleSize,
2465
- maxBubbleSize = props.maxBubbleSize,
2466
- maxBubbleRadius = props.maxBubbleRadius,
2467
- minBubbleRadius = props.minBubbleRadius,
2468
- showMaxValuePulsation = props.showMaxValuePulsation,
2469
- selectedCategory = props.selectedCategory,
2470
- selectedX = props.selectedX,
2471
- selectedY = props.selectedY,
2472
- size = props.size,
2473
- x = props.x,
2474
- xScale = props.xScale,
2475
- y = props.y,
2476
- yScale = props.yScale,
2477
- handlePointClick = props.handlePointClick;
2737
+ bubbleRowScale = props.bubbleRowScale,
2738
+ bubbleScale = props.bubbleScale,
2739
+ category = props.category,
2740
+ colorCategoryMapping = props.colorCategoryMapping,
2741
+ colorMode = props.colorMode,
2742
+ bubbleColor = props.bubbleColor,
2743
+ handleMouseEnter = props.handleMouseEnter,
2744
+ handleMouseLeave = props.handleMouseLeave,
2745
+ isBubbleSizeDynamic = props.isBubbleSizeDynamic,
2746
+ minBubbleColorIntensity = props.minBubbleColorIntensity,
2747
+ minBand = props.minBand,
2748
+ minBubbleSize = props.minBubbleSize,
2749
+ maxBubbleSize = props.maxBubbleSize,
2750
+ maxBubbleRadius = props.maxBubbleRadius,
2751
+ minBubbleRadius = props.minBubbleRadius,
2752
+ showMaxValuePulsation = props.showMaxValuePulsation,
2753
+ selectedCategory = props.selectedCategory,
2754
+ selectedX = props.selectedX,
2755
+ selectedY = props.selectedY,
2756
+ size = props.size,
2757
+ x = props.x,
2758
+ xScale = props.xScale,
2759
+ y = props.y,
2760
+ yScale = props.yScale,
2761
+ handlePointClick = props.handlePointClick;
2478
2762
  /** @type {Object<String\|Number, import('./utils/punchcardUtils').RowData>} */
2479
- var dataByRows = punchcardUtils_1.getDataByRows({
2763
+
2764
+ var dataByRows = (0, punchcardUtils_1.getDataByRows)({
2480
2765
  bubbleRowScale: bubbleRowScale,
2481
2766
  bubbleScale: bubbleScale,
2482
2767
  category: category,
@@ -2496,15 +2781,16 @@ var PunchcardChartArea = function PunchcardChartArea(props) {
2496
2781
  });
2497
2782
  return React.createElement("g", null, Object.entries(dataByRows).map(function (_ref) {
2498
2783
  var _ref2 = _slicedToArray(_ref, 2),
2499
- row = _ref2[0],
2500
- rowData = _ref2[1];
2784
+ row = _ref2[0],
2785
+ rowData = _ref2[1];
2786
+
2501
2787
  var rowXValues = rowData.rowXValues,
2502
- rowSizeValues = rowData.rowSizeValues,
2503
- rowCategoryValues = rowData.rowCategoryValues,
2504
- rowColorValues = rowData.rowColorValues,
2505
- rowFillOpacityValues = rowData.rowFillOpacityValues,
2506
- rowSizeScale = rowData.rowSizeScale,
2507
- rowRadiusValues = rowData.rowRadiusValues;
2788
+ rowSizeValues = rowData.rowSizeValues,
2789
+ rowCategoryValues = rowData.rowCategoryValues,
2790
+ rowColorValues = rowData.rowColorValues,
2791
+ rowFillOpacityValues = rowData.rowFillOpacityValues,
2792
+ rowSizeScale = rowData.rowSizeScale,
2793
+ rowRadiusValues = rowData.rowRadiusValues;
2508
2794
  var yPosition = yScale(row);
2509
2795
  return React.createElement(PunchcardRow_1.default, {
2510
2796
  key: row,
@@ -2530,6 +2816,7 @@ var PunchcardChartArea = function PunchcardChartArea(props) {
2530
2816
  });
2531
2817
  }));
2532
2818
  };
2819
+
2533
2820
  var propTypes = {
2534
2821
  showBubbleLabels: T.oneOf(Object.values(punchcardUtils_1.BUBBLE_LABELS_TYPES)),
2535
2822
  bubbleRowScale: T.oneOf(Object.values(punchcardUtils_1.BUBBLE_ROW_SCALE_TYPES)),
@@ -2595,7 +2882,88 @@ exports.default = PunchcardChartArea;
2595
2882
 
2596
2883
  /***/ }),
2597
2884
 
2598
- /***/ 447:
2885
+ /***/ 45:
2886
+ /***/ (function(module, exports, __webpack_require__) {
2887
+
2888
+ "use strict";
2889
+
2890
+
2891
+ Object.defineProperty(exports, "__esModule", {
2892
+ value: true
2893
+ });
2894
+ exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
2895
+
2896
+ var React = __webpack_require__(1);
2897
+
2898
+ var T = __webpack_require__(0);
2899
+
2900
+ var i18n_1 = __webpack_require__(2);
2901
+
2902
+ var Message_1 = __webpack_require__(10);
2903
+
2904
+ var FixedSizeContainer_1 = __webpack_require__(13);
2905
+ /**
2906
+ * @method isMissing
2907
+ * @param {any} v
2908
+ * @returns {boolean} true if the input value === null or undefined
2909
+ */
2910
+
2911
+
2912
+ var isMissing = function isMissing(v) {
2913
+ return v === null || v === undefined;
2914
+ };
2915
+
2916
+ exports.isMissing = isMissing;
2917
+ /**
2918
+ * @method misskingKeys
2919
+ * @param {string[]} keys
2920
+ * @param {object} target
2921
+ * @returns {string[]} the keys of missing required props
2922
+ */
2923
+
2924
+ var missingKeys = function missingKeys(keys, target) {
2925
+ return keys.filter(function (k) {
2926
+ return (0, exports.isMissing)(target[k]);
2927
+ });
2928
+ };
2929
+
2930
+ exports.missingKeys = missingKeys;
2931
+ var propTypes = {
2932
+ width: T.oneOfType([T.string, T.number]),
2933
+ height: T.oneOfType([T.string, T.number]),
2934
+ // eslint-disable-next-line react/no-unused-prop-types
2935
+ backgroundColor: T.string,
2936
+ missingProps: T.arrayOf(T.string)
2937
+ };
2938
+ /**
2939
+ * @method MissingPropsMessage
2940
+ * @param {MissingPropsProps} props
2941
+ * @returns {React.ReactElement}
2942
+ */
2943
+
2944
+ var MissingPropsMessage = function MissingPropsMessage(props) {
2945
+ var width = props.width,
2946
+ height = props.height,
2947
+ missingProps = props.missingProps;
2948
+ return React.createElement(Message_1.default, {
2949
+ "data-test": "message",
2950
+ width: width,
2951
+ height: height,
2952
+ message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
2953
+ });
2954
+ };
2955
+
2956
+ exports.MissingPropsMessage = MissingPropsMessage;
2957
+ exports.MissingPropsMessage.propTypes = propTypes;
2958
+ exports.MissingPropsMessage.defaultProps = {
2959
+ width: '100%',
2960
+ height: 250
2961
+ };
2962
+ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage);
2963
+
2964
+ /***/ }),
2965
+
2966
+ /***/ 450:
2599
2967
  /***/ (function(module, exports, __webpack_require__) {
2600
2968
 
2601
2969
  "use strict";
@@ -2604,30 +2972,36 @@ exports.default = PunchcardChartArea;
2604
2972
  Object.defineProperty(exports, "__esModule", {
2605
2973
  value: true
2606
2974
  });
2975
+
2607
2976
  var React = __webpack_require__(1);
2977
+
2608
2978
  var T = __webpack_require__(0);
2979
+
2609
2980
  var styled_components_1 = __webpack_require__(4);
2610
- var PunchcardBubble_1 = __webpack_require__(448);
2981
+
2982
+ var PunchcardBubble_1 = __webpack_require__(451);
2983
+
2611
2984
  var punchcardUtils_1 = __webpack_require__(99);
2985
+
2612
2986
  var PunchcardRow = function PunchcardRow(props) {
2613
2987
  var showBubbleLabels = props.showBubbleLabels,
2614
- category = props.category,
2615
- colors = props.colors,
2616
- _handleMouseEnter = props.handleMouseEnter,
2617
- handleMouseLeave = props.handleMouseLeave,
2618
- maxSizeValue = props.maxSizeValue,
2619
- opacities = props.opacities,
2620
- radiusValues = props.radiusValues,
2621
- selectedCategory = props.selectedCategory,
2622
- selectedX = props.selectedX,
2623
- selectedY = props.selectedY,
2624
- showMaxValuePulsation = props.showMaxValuePulsation,
2625
- size = props.size,
2626
- x = props.x,
2627
- xScale = props.xScale,
2628
- yPosition = props.yPosition,
2629
- yValue = props.yValue,
2630
- handlePointClick = props.handlePointClick;
2988
+ category = props.category,
2989
+ colors = props.colors,
2990
+ _handleMouseEnter = props.handleMouseEnter,
2991
+ handleMouseLeave = props.handleMouseLeave,
2992
+ maxSizeValue = props.maxSizeValue,
2993
+ opacities = props.opacities,
2994
+ radiusValues = props.radiusValues,
2995
+ selectedCategory = props.selectedCategory,
2996
+ selectedX = props.selectedX,
2997
+ selectedY = props.selectedY,
2998
+ showMaxValuePulsation = props.showMaxValuePulsation,
2999
+ size = props.size,
3000
+ x = props.x,
3001
+ xScale = props.xScale,
3002
+ yPosition = props.yPosition,
3003
+ yValue = props.yValue,
3004
+ handlePointClick = props.handlePointClick;
2631
3005
  return React.createElement("g", null, x.map(function (xValue, index) {
2632
3006
  var sizeValue = size[index];
2633
3007
  var categoryValue = category[index];
@@ -2635,11 +3009,11 @@ var PunchcardRow = function PunchcardRow(props) {
2635
3009
  var cx = xScale(xValue);
2636
3010
  var r = radiusValues[index];
2637
3011
  var fillOpacity = opacities[index];
2638
- var hover = punchcardUtils_1.isSomethingSelected({
3012
+ var hover = (0, punchcardUtils_1.isSomethingSelected)({
2639
3013
  selectedX: selectedX,
2640
3014
  selectedY: selectedY,
2641
3015
  selectedCategory: selectedCategory
2642
- }) && punchcardUtils_1.isBubbleSelected({
3016
+ }) && (0, punchcardUtils_1.isBubbleSelected)({
2643
3017
  selectedX: selectedX,
2644
3018
  selectedY: selectedY,
2645
3019
  selectedCategory: selectedCategory,
@@ -2647,7 +3021,7 @@ var PunchcardRow = function PunchcardRow(props) {
2647
3021
  yValue: yValue,
2648
3022
  categoryValue: categoryValue
2649
3023
  });
2650
- var muted = punchcardUtils_1.isSomethingSelected({
3024
+ var muted = (0, punchcardUtils_1.isSomethingSelected)({
2651
3025
  selectedX: selectedX,
2652
3026
  selectedY: selectedY,
2653
3027
  selectedCategory: selectedCategory
@@ -2673,6 +3047,7 @@ var PunchcardRow = function PunchcardRow(props) {
2673
3047
  });
2674
3048
  }));
2675
3049
  };
3050
+
2676
3051
  var propTypes = {
2677
3052
  showBubbleLabels: T.oneOf(Object.values(punchcardUtils_1.BUBBLE_LABELS_TYPES)),
2678
3053
  category: T.arrayOf(T.string),
@@ -2716,39 +3091,49 @@ var defaultProps = {
2716
3091
  };
2717
3092
  PunchcardRow.propTypes = propTypes;
2718
3093
  PunchcardRow.defaultProps = defaultProps;
2719
- exports.default = styled_components_1.withTheme(PunchcardRow);
3094
+ exports.default = (0, styled_components_1.withTheme)(PunchcardRow);
2720
3095
 
2721
3096
  /***/ }),
2722
3097
 
2723
- /***/ 448:
3098
+ /***/ 451:
2724
3099
  /***/ (function(module, exports, __webpack_require__) {
2725
3100
 
2726
3101
  "use strict";
2727
3102
 
2728
3103
 
2729
- var _taggedTemplateLiteral = __webpack_require__(98);
2730
- var _templateObject;
3104
+ var _taggedTemplateLiteral = __webpack_require__(59);
3105
+
3106
+ var _templateObject, _templateObject2;
3107
+
2731
3108
  Object.defineProperty(exports, "__esModule", {
2732
3109
  value: true
2733
3110
  });
3111
+
2734
3112
  var React = __webpack_require__(1);
3113
+
2735
3114
  var T = __webpack_require__(0);
3115
+
2736
3116
  var styled_components_1 = __webpack_require__(4);
3117
+
2737
3118
  var pick_1 = __webpack_require__(23);
3119
+
2738
3120
  var variables_1 = __webpack_require__(11);
2739
- var numberUtils_1 = __webpack_require__(30);
3121
+
3122
+ var numberUtils_1 = __webpack_require__(31);
3123
+
2740
3124
  var punchcardUtils_1 = __webpack_require__(99);
3125
+
2741
3126
  var BubbleCircle = styled_components_1.default.circle.withConfig({
2742
3127
  displayName: "PunchcardBubble__BubbleCircle",
2743
3128
  componentId: "sc-1jmms9f-0"
2744
3129
  })(["fill:", ";fill-opacity:1;opacity:", ";stroke:", ";"], function (props) {
2745
- return props.outline ? pick_1.default({
3130
+ return props.outline ? (0, pick_1.default)({
2746
3131
  // bubbleTextColor
2747
3132
  enterprise: {
2748
3133
  light: variables_1.default.white,
2749
3134
  dark: variables_1.default.contentColorInverted // enterprise.textColor
2750
- },
2751
3135
 
3136
+ },
2752
3137
  prisma: variables_1.default.contentColorActive
2753
3138
  })(props) : props.color;
2754
3139
  }, function (props) {
@@ -2756,18 +3141,17 @@ var BubbleCircle = styled_components_1.default.circle.withConfig({
2756
3141
  }, function (props) {
2757
3142
  return props.outline ? props.color : 'none';
2758
3143
  });
3144
+
2759
3145
  var pulsateAnimation = function pulsateAnimation(r) {
2760
- return styled_components_1.keyframes(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 41% {\n opacity: 0;\n r: ", ";\n }\n 100% {\n opacity: 0;\n r: ", ";\n }\n"])), r + 5, r + 5);
3146
+ return (0, styled_components_1.keyframes)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n 41% {\n opacity: 0;\n r: ", ";\n }\n 100% {\n opacity: 0;\n r: ", ";\n }\n"])), r + 5, r + 5);
2761
3147
  };
2762
- var PulsateBubble = styled_components_1.default(BubbleCircle).withConfig({
2763
- displayName: "PunchcardBubble__PulsateBubble",
2764
- componentId: "sc-1jmms9f-1"
2765
- })(["animation:", " 2.4s linear 0.4s infinite;"], function (props) {
3148
+
3149
+ var PulsateBubble = (0, styled_components_1.default)(BubbleCircle)(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n animation: ", " 2.4s linear 0.4s infinite;\n"])), function (props) {
2766
3150
  return pulsateAnimation(props.r);
2767
3151
  });
2768
3152
  var BubbleGroup = styled_components_1.default.g.withConfig({
2769
3153
  displayName: "PunchcardBubble__BubbleGroup",
2770
- componentId: "sc-1jmms9f-2"
3154
+ componentId: "sc-1jmms9f-1"
2771
3155
  })(["cursor:pointer;opacity:", ";filter:", ";transition:opacity 0.15s;"], function (props) {
2772
3156
  return props.muted ? 0.15 : 1;
2773
3157
  }, function (props) {
@@ -2775,15 +3159,15 @@ var BubbleGroup = styled_components_1.default.g.withConfig({
2775
3159
  });
2776
3160
  var BubbleLabelText = styled_components_1.default.text.withConfig({
2777
3161
  displayName: "PunchcardBubble__BubbleLabelText",
2778
- componentId: "sc-1jmms9f-3"
3162
+ componentId: "sc-1jmms9f-2"
2779
3163
  })(["dominant-baseline:middle;opacity:", ";fill:", "};font-size:", ";font-weight:", ";text-anchor:middle;"], function (props) {
2780
3164
  return props.displayLabel ? 1 : 0;
2781
3165
  }, function (props) {
2782
- return props.hover || props.outline ? pick_1.default({
3166
+ return props.hover || props.outline ? (0, pick_1.default)({
2783
3167
  // bubbleAltTextColor
2784
3168
  enterprise: variables_1.default.textColor,
2785
3169
  prisma: variables_1.default.contentColorActive
2786
- })(props) : pick_1.default({
3170
+ })(props) : (0, pick_1.default)({
2787
3171
  enterprise: {
2788
3172
  dark: variables_1.default.textColor,
2789
3173
  light: variables_1.default.white
@@ -2798,29 +3182,32 @@ var BubbleLabelText = styled_components_1.default.text.withConfig({
2798
3182
  var MIN_BUBBLE_SIZE_TO_DISPLAY_LABEL = 13;
2799
3183
  var MAX_DISPLAYABLE_VALUE = 99499999999999;
2800
3184
  var VALUE_OVERFLOW_TEXT = '99T+';
3185
+
2801
3186
  var PunchcardBubble = function PunchcardBubble(props) {
2802
3187
  var showBubbleLabel = props.showBubbleLabel,
2803
- color = props.color,
2804
- cx = props.cx,
2805
- cy = props.cy,
2806
- fillOpacity = props.fillOpacity,
2807
- handleMouseEnter = props.handleMouseEnter,
2808
- handleMouseLeave = props.handleMouseLeave,
2809
- hover = props.hover,
2810
- muted = props.muted,
2811
- pulsate = props.pulsate,
2812
- value = props.value,
2813
- r = props.r,
2814
- handlePointClick = props.handlePointClick;
3188
+ color = props.color,
3189
+ cx = props.cx,
3190
+ cy = props.cy,
3191
+ fillOpacity = props.fillOpacity,
3192
+ handleMouseEnter = props.handleMouseEnter,
3193
+ handleMouseLeave = props.handleMouseLeave,
3194
+ hover = props.hover,
3195
+ muted = props.muted,
3196
+ pulsate = props.pulsate,
3197
+ value = props.value,
3198
+ r = props.r,
3199
+ handlePointClick = props.handlePointClick;
2815
3200
  var outline = value < 0;
2816
3201
  var showPulsateBubble = pulsate && !muted && !hover;
2817
3202
  var displayLabel = hover || showBubbleLabel && r >= MIN_BUBBLE_SIZE_TO_DISPLAY_LABEL;
2818
- var bubbleLabelValueText = value <= MAX_DISPLAYABLE_VALUE ? numberUtils_1.formatNumber(value, 0, {
3203
+ var bubbleLabelValueText = value <= MAX_DISPLAYABLE_VALUE ? (0, numberUtils_1.formatNumber)(value, 0, {
2819
3204
  useTrendUnits: true
2820
3205
  }) : VALUE_OVERFLOW_TEXT;
3206
+
2821
3207
  if (hover) {
2822
- bubbleLabelValueText = numberUtils_1.formatNumber(value, 2);
3208
+ bubbleLabelValueText = (0, numberUtils_1.formatNumber)(value, 2);
2823
3209
  }
3210
+
2824
3211
  return React.createElement(BubbleGroup, {
2825
3212
  muted: muted,
2826
3213
  onMouseEnter: handleMouseEnter,
@@ -2851,6 +3238,7 @@ var PunchcardBubble = function PunchcardBubble(props) {
2851
3238
  displayLabel: displayLabel
2852
3239
  }, bubbleLabelValueText));
2853
3240
  };
3241
+
2854
3242
  var propTypes = {
2855
3243
  showBubbleLabel: T.bool,
2856
3244
  color: T.string,
@@ -2887,7 +3275,7 @@ exports.default = PunchcardBubble;
2887
3275
 
2888
3276
  /***/ }),
2889
3277
 
2890
- /***/ 449:
3278
+ /***/ 452:
2891
3279
  /***/ (function(module, exports, __webpack_require__) {
2892
3280
 
2893
3281
  "use strict";
@@ -2896,11 +3284,17 @@ exports.default = PunchcardBubble;
2896
3284
  Object.defineProperty(exports, "__esModule", {
2897
3285
  value: true
2898
3286
  });
3287
+
2899
3288
  var React = __webpack_require__(1);
3289
+
2900
3290
  var T = __webpack_require__(0);
3291
+
2901
3292
  var styled_components_1 = __webpack_require__(4);
3293
+
2902
3294
  var pick_1 = __webpack_require__(23);
3295
+
2903
3296
  var variables_1 = __webpack_require__(11);
3297
+
2904
3298
  var LEGEND_ITEM_VERTICAL_SPACER = 25;
2905
3299
  var LEGEND_ITEM_HORIZONTAL_SPACER = 10;
2906
3300
  var LEGEND_RECT_WIDTH = 5;
@@ -2921,22 +3315,23 @@ var LegendIcon = styled_components_1.default.rect.withConfig({
2921
3315
  var LegendText = styled_components_1.default.text.withConfig({
2922
3316
  displayName: "PunchcardLegend__LegendText",
2923
3317
  componentId: "c2f7we-2"
2924
- })(["dominant-baseline:middle;fill:", ";font-size:12px;"], pick_1.default({
3318
+ })(["dominant-baseline:middle;fill:", ";font-size:12px;"], (0, pick_1.default)({
2925
3319
  /* was previously named textColor in themeReg */
2926
3320
  enterprise: variables_1.default.textColor,
2927
3321
  prisma: variables_1.default.contentColorDefault
2928
3322
  }));
3323
+
2929
3324
  var PunchcardLegend = function PunchcardLegend(props) {
2930
3325
  var category = props.category,
2931
- colorCategoryMapping = props.colorCategoryMapping,
2932
- handleMouseEnter = props.handleMouseEnter,
2933
- handleMouseLeave = props.handleMouseLeave,
2934
- selected = props.selected,
2935
- startPositionX = props.startPositionX,
2936
- startPositionY = props.startPositionY,
2937
- containerWidth = props.containerWidth,
2938
- containerHeight = props.containerHeight,
2939
- handleLegendClick = props.handleLegendClick;
3326
+ colorCategoryMapping = props.colorCategoryMapping,
3327
+ handleMouseEnter = props.handleMouseEnter,
3328
+ handleMouseLeave = props.handleMouseLeave,
3329
+ selected = props.selected,
3330
+ startPositionX = props.startPositionX,
3331
+ startPositionY = props.startPositionY,
3332
+ containerWidth = props.containerWidth,
3333
+ containerHeight = props.containerHeight,
3334
+ handleLegendClick = props.handleLegendClick;
2940
3335
  var legendWidth = containerWidth - LEGEND_OFFSET_RIGHT - startPositionX;
2941
3336
  var legendHeight = containerHeight - LEGEND_OFFSET_BOTTOM;
2942
3337
  return React.createElement("svg", {
@@ -2967,6 +3362,7 @@ var PunchcardLegend = function PunchcardLegend(props) {
2967
3362
  }, React.createElement("title", null, c), c));
2968
3363
  })));
2969
3364
  };
3365
+
2970
3366
  var propTypes = {
2971
3367
  category: T.arrayOf(T.string),
2972
3368
  colorCategoryMapping: T.func.isRequired,
@@ -2998,7 +3394,7 @@ exports.default = PunchcardLegend;
2998
3394
 
2999
3395
  /***/ }),
3000
3396
 
3001
- /***/ 45:
3397
+ /***/ 453:
3002
3398
  /***/ (function(module, exports, __webpack_require__) {
3003
3399
 
3004
3400
  "use strict";
@@ -3007,101 +3403,40 @@ exports.default = PunchcardLegend;
3007
3403
  Object.defineProperty(exports, "__esModule", {
3008
3404
  value: true
3009
3405
  });
3010
- exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
3406
+
3011
3407
  var React = __webpack_require__(1);
3408
+
3012
3409
  var T = __webpack_require__(0);
3013
- var i18n_1 = __webpack_require__(2);
3014
- var Message_1 = __webpack_require__(10);
3015
- var FixedSizeContainer_1 = __webpack_require__(13);
3016
- /**
3017
- * @method isMissing
3018
- * @param {any} v
3019
- * @returns {boolean} true if the input value === null or undefined
3020
- */
3021
- var isMissing = function isMissing(v) {
3022
- return v === null || v === undefined;
3023
- };
3024
- exports.isMissing = isMissing;
3025
- /**
3026
- * @method misskingKeys
3027
- * @param {string[]} keys
3028
- * @param {object} target
3029
- * @returns {string[]} the keys of missing required props
3030
- */
3031
- var missingKeys = function missingKeys(keys, target) {
3032
- return keys.filter(function (k) {
3033
- return exports.isMissing(target[k]);
3034
- });
3035
- };
3036
- exports.missingKeys = missingKeys;
3037
- var propTypes = {
3038
- width: T.oneOfType([T.string, T.number]),
3039
- height: T.oneOfType([T.string, T.number]),
3040
- // eslint-disable-next-line react/no-unused-prop-types
3041
- backgroundColor: T.string,
3042
- missingProps: T.arrayOf(T.string)
3043
- };
3044
- /**
3045
- * @method MissingPropsMessage
3046
- * @param {MissingPropsProps} props
3047
- * @returns {React.ReactElement}
3048
- */
3049
- var MissingPropsMessage = function MissingPropsMessage(props) {
3050
- var width = props.width,
3051
- height = props.height,
3052
- missingProps = props.missingProps;
3053
- return React.createElement(Message_1.default, {
3054
- "data-test": "message",
3055
- width: width,
3056
- height: height,
3057
- message: i18n_1._("Missing property: ".concat(missingProps.join(', ')))
3058
- });
3059
- };
3060
- exports.MissingPropsMessage = MissingPropsMessage;
3061
- exports.MissingPropsMessage.propTypes = propTypes;
3062
- exports.MissingPropsMessage.defaultProps = {
3063
- width: '100%',
3064
- height: 250
3065
- };
3066
- exports.default = FixedSizeContainer_1.default(exports.MissingPropsMessage);
3067
3410
 
3068
- /***/ }),
3411
+ var styled_components_1 = __webpack_require__(4);
3069
3412
 
3070
- /***/ 450:
3071
- /***/ (function(module, exports, __webpack_require__) {
3413
+ var lodash_1 = __webpack_require__(3);
3072
3414
 
3073
- "use strict";
3415
+ var pick_1 = __webpack_require__(23);
3416
+
3417
+ var variables_1 = __webpack_require__(11); // was previously lineColor in themeRegistry
3074
3418
 
3075
3419
 
3076
- Object.defineProperty(exports, "__esModule", {
3077
- value: true
3078
- });
3079
- var React = __webpack_require__(1);
3080
- var T = __webpack_require__(0);
3081
- var styled_components_1 = __webpack_require__(4);
3082
- var lodash_1 = __webpack_require__(3);
3083
- var pick_1 = __webpack_require__(23);
3084
- var variables_1 = __webpack_require__(11);
3085
- // was previously lineColor in themeRegistry
3086
3420
  var GridLine = styled_components_1.default.line.withConfig({
3087
3421
  displayName: "PunchcardGridLines__GridLine",
3088
3422
  componentId: "sc-12y1iif-0"
3089
- })(["stroke:", ";stroke-width:1px;"], pick_1.default({
3423
+ })(["stroke:", ";stroke-width:1px;"], (0, pick_1.default)({
3090
3424
  enterprise: {
3091
3425
  light: variables_1.default.gray96,
3092
3426
  dark: variables_1.default.gray25
3093
3427
  },
3094
3428
  prisma: variables_1.default.interactiveColorBackgroundDisabled
3095
3429
  }));
3430
+
3096
3431
  var PunchcardGridLines = function PunchcardGridLines(props) {
3097
3432
  var xStartPosition = props.xStartPosition,
3098
- xEndPosition = props.xEndPosition,
3099
- yStartPosition = props.yStartPosition,
3100
- yEndPosition = props.yEndPosition,
3101
- xDelta = props.xDelta,
3102
- yDelta = props.yDelta;
3103
- var yGridLinesXPositions = lodash_1.range(xStartPosition, xEndPosition + 1, xDelta);
3104
- var xGridLinesYPositions = lodash_1.range(yStartPosition, yEndPosition + 1, yDelta);
3433
+ xEndPosition = props.xEndPosition,
3434
+ yStartPosition = props.yStartPosition,
3435
+ yEndPosition = props.yEndPosition,
3436
+ xDelta = props.xDelta,
3437
+ yDelta = props.yDelta;
3438
+ var yGridLinesXPositions = (0, lodash_1.range)(xStartPosition, xEndPosition + 1, xDelta);
3439
+ var xGridLinesYPositions = (0, lodash_1.range)(yStartPosition, yEndPosition + 1, yDelta);
3105
3440
  return React.createElement("g", {
3106
3441
  "data-test": "data-test-gridlines"
3107
3442
  }, yGridLinesXPositions.map(function (xValue) {
@@ -3122,6 +3457,7 @@ var PunchcardGridLines = function PunchcardGridLines(props) {
3122
3457
  });
3123
3458
  }));
3124
3459
  };
3460
+
3125
3461
  var propTypes = {
3126
3462
  xStartPosition: T.number,
3127
3463
  xEndPosition: T.number,
@@ -3144,7 +3480,7 @@ exports.default = PunchcardGridLines;
3144
3480
 
3145
3481
  /***/ }),
3146
3482
 
3147
- /***/ 451:
3483
+ /***/ 454:
3148
3484
  /***/ (function(module, exports, __webpack_require__) {
3149
3485
 
3150
3486
  "use strict";
@@ -3154,8 +3490,11 @@ Object.defineProperty(exports, "__esModule", {
3154
3490
  value: true
3155
3491
  });
3156
3492
  exports.convertToPunchcardProperties = exports.mapToOldKey = exports.punchcardOptionValuesMapping = void 0;
3493
+
3157
3494
  var lodash_1 = __webpack_require__(3);
3158
- var chartingUtils_1 = __webpack_require__(55);
3495
+
3496
+ var chartingUtils_1 = __webpack_require__(56);
3497
+
3159
3498
  var punchcardOptionsMapping = {
3160
3499
  legendDisplay: 'showLegend',
3161
3500
  bubbleLabelDisplay: 'showBubbleLabels',
@@ -3166,9 +3505,9 @@ var punchcardOptionsMapping = {
3166
3505
  bubbleRadiusMin: 'minBubbleRadius',
3167
3506
  bubbleSizeMax: 'maxBubbleSize',
3168
3507
  bubbleSizeMin: 'minBubbleSize'
3169
- };
3170
- // key value mapping of what options (and their corresponding values) which
3508
+ }; // key value mapping of what options (and their corresponding values) which
3171
3509
  // we expose in config.ts to property values PurePunchcard understands
3510
+
3172
3511
  exports.punchcardOptionValuesMapping = {
3173
3512
  showLegend: {
3174
3513
  right: true,
@@ -3187,11 +3526,13 @@ exports.punchcardOptionValuesMapping = {
3187
3526
  * @param {Object} options
3188
3527
  * @returns {Object}
3189
3528
  */
3529
+
3190
3530
  var mapToOldKey = function mapToOldKey(options) {
3191
- return lodash_1.mapKeys(options, function (val, key) {
3531
+ return (0, lodash_1.mapKeys)(options, function (val, key) {
3192
3532
  return punchcardOptionsMapping[key] ? punchcardOptionsMapping[key] : key;
3193
3533
  });
3194
3534
  };
3535
+
3195
3536
  exports.mapToOldKey = mapToOldKey;
3196
3537
  /**
3197
3538
  * Chained helper for mapping the option properties (and values) we expose in config.ts into property values that PurePunchcard accepts
@@ -3200,9 +3541,11 @@ exports.mapToOldKey = mapToOldKey;
3200
3541
  * @param {Object} originalOptions
3201
3542
  * @returns {Object}
3202
3543
  */
3544
+
3203
3545
  var convertToPunchcardProperties = function convertToPunchcardProperties(originalOptions) {
3204
- return lodash_1.chain(exports.mapToOldKey(originalOptions)).thru(chartingUtils_1.mapToValues(exports.punchcardOptionValuesMapping)).value();
3546
+ return (0, lodash_1.chain)((0, exports.mapToOldKey)(originalOptions)).thru((0, chartingUtils_1.mapToValues)(exports.punchcardOptionValuesMapping)).value();
3205
3547
  };
3548
+
3206
3549
  exports.convertToPunchcardProperties = convertToPunchcardProperties;
3207
3550
 
3208
3551
  /***/ }),
@@ -3216,15 +3559,19 @@ exports.convertToPunchcardProperties = convertToPunchcardProperties;
3216
3559
  Object.defineProperty(exports, "__esModule", {
3217
3560
  value: true
3218
3561
  });
3562
+
3219
3563
  var React = __webpack_require__(1);
3564
+
3220
3565
  var styled_components_1 = __webpack_require__(4);
3566
+
3221
3567
  var hocUtils_1 = __webpack_require__(15);
3568
+
3222
3569
  var Cover = styled_components_1.default.div.withConfig({
3223
3570
  displayName: "withEditModeCover__Cover",
3224
3571
  componentId: "sc-1gsbnxb-0"
3225
3572
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
3226
3573
  var Blocker = styled_components_1.default.div.attrs({
3227
- 'data-splunk-visualization-version': "25.13.1 - ea48ec41e"
3574
+ 'data-splunk-visualization-version': "26.1.0 - fc8bf8d77"
3228
3575
  }).withConfig({
3229
3576
  displayName: "withEditModeCover__Blocker",
3230
3577
  componentId: "sc-1gsbnxb-1"
@@ -3235,6 +3582,7 @@ var Blocker = styled_components_1.default.div.attrs({
3235
3582
  * @param {ExtendedDashViz} Visualization
3236
3583
  * @returns {ExtendedDashViz} Wrapper
3237
3584
  */
3585
+
3238
3586
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
3239
3587
  var Wrapper = function Wrapper(props) {
3240
3588
  var mode = props.mode;
@@ -3243,12 +3591,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
3243
3591
  "data-test": "edit-mode-cover"
3244
3592
  }));
3245
3593
  };
3246
- hocUtils_1.extendStaticWrapperProps({
3594
+
3595
+ (0, hocUtils_1.extendStaticWrapperProps)({
3247
3596
  Wrapper: Wrapper,
3248
3597
  Visualization: Visualization
3249
3598
  });
3250
3599
  return Wrapper;
3251
3600
  };
3601
+
3252
3602
  exports.default = withEditModeCover;
3253
3603
 
3254
3604
  /***/ }),
@@ -3262,27 +3612,37 @@ exports.default = withEditModeCover;
3262
3612
  Object.defineProperty(exports, "__esModule", {
3263
3613
  value: true
3264
3614
  });
3615
+
3265
3616
  var React = __webpack_require__(1);
3617
+
3266
3618
  var colorUtils_1 = __webpack_require__(12);
3619
+
3267
3620
  var variables_1 = __webpack_require__(11);
3268
- var IconPlaceholder_1 = __webpack_require__(31);
3621
+
3622
+ var IconPlaceholder_1 = __webpack_require__(32);
3623
+
3269
3624
  var VizBehavior_1 = __webpack_require__(6);
3625
+
3270
3626
  var hocUtils_1 = __webpack_require__(15);
3627
+
3271
3628
  var withPlaceholder = function withPlaceholder(Visualization) {
3272
3629
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
3273
3630
  var config = Visualization.config;
3274
3631
  var themes = config.themes;
3632
+
3275
3633
  var Wrapper = function Wrapper(props) {
3276
3634
  var _a, _b;
3635
+
3277
3636
  var dataSources = props.dataSources,
3278
- loading = props.loading,
3279
- options = props.options,
3280
- height = props.height,
3281
- width = props.width;
3637
+ loading = props.loading,
3638
+ options = props.options,
3639
+ height = props.height,
3640
+ width = props.width;
3282
3641
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
3283
- 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);
3642
+ 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);
3284
3643
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
3285
3644
  var iconColor = variables_1.default.contentColorActive(props);
3645
+
3286
3646
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
3287
3647
  return React.createElement(IconPlaceholder_1.default, {
3288
3648
  "data-test": "icon-placeholder",
@@ -3293,19 +3653,22 @@ var withPlaceholder = function withPlaceholder(Visualization) {
3293
3653
  iconColor: iconColor
3294
3654
  });
3295
3655
  }
3656
+
3296
3657
  return React.createElement(Visualization, Object.assign({}, props));
3297
3658
  };
3298
- hocUtils_1.extendStaticWrapperProps({
3659
+
3660
+ (0, hocUtils_1.extendStaticWrapperProps)({
3299
3661
  Wrapper: Wrapper,
3300
3662
  Visualization: Visualization
3301
3663
  });
3302
3664
  return Wrapper;
3303
3665
  };
3666
+
3304
3667
  exports.default = withPlaceholder;
3305
3668
 
3306
3669
  /***/ }),
3307
3670
 
3308
- /***/ 49:
3671
+ /***/ 50:
3309
3672
  /***/ (function(module, exports) {
3310
3673
 
3311
3674
  module.exports = require("@splunk/visualization-icons/placeholders");
@@ -3335,13 +3698,15 @@ module.exports = require("@splunk/visualization-icons");
3335
3698
  Object.defineProperty(exports, "__esModule", {
3336
3699
  value: true
3337
3700
  });
3701
+
3338
3702
  var i18n_1 = __webpack_require__(2);
3703
+
3339
3704
  var background = function background(_ref) {
3340
3705
  var label = _ref.label,
3341
- themes = _ref.themes,
3342
- labelPosition = _ref.labelPosition;
3706
+ themes = _ref.themes,
3707
+ labelPosition = _ref.labelPosition;
3343
3708
  return [{
3344
- label: i18n_1._(label || 'Background'),
3709
+ label: (0, i18n_1._)(label || 'Background'),
3345
3710
  option: 'backgroundColor',
3346
3711
  editor: 'editor.color',
3347
3712
  editorProps: {
@@ -3350,31 +3715,37 @@ var background = function background(_ref) {
3350
3715
  }
3351
3716
  }];
3352
3717
  };
3718
+
3353
3719
  exports.default = background;
3354
3720
 
3355
3721
  /***/ }),
3356
3722
 
3357
- /***/ 55:
3723
+ /***/ 56:
3358
3724
  /***/ (function(module, exports, __webpack_require__) {
3359
3725
 
3360
3726
  "use strict";
3361
3727
 
3362
3728
 
3363
3729
  var _toConsumableArray = __webpack_require__(8);
3730
+
3364
3731
  var __rest = this && this.__rest || function (s, e) {
3365
3732
  var t = {};
3733
+
3366
3734
  for (var p in s) {
3367
3735
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
3368
3736
  }
3737
+
3369
3738
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
3370
3739
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
3371
3740
  }
3372
3741
  return t;
3373
3742
  };
3743
+
3374
3744
  Object.defineProperty(exports, "__esModule", {
3375
3745
  value: true
3376
3746
  });
3377
3747
  exports.constructFieldsAndColumns = exports.toArrayForSeries = exports.isMultiSeriesData = exports.convertOverlayFields = exports.convertY2AxisOptions = exports.mapToValues = exports.truncateData = exports.getAnnotations = void 0;
3748
+
3378
3749
  var lodash_1 = __webpack_require__(3);
3379
3750
  /**
3380
3751
  * Get formatted annotations
@@ -3385,10 +3756,12 @@ var lodash_1 = __webpack_require__(3);
3385
3756
  * @param {Array} options.annotationLabel
3386
3757
  * @returns {Array}
3387
3758
  */
3759
+
3760
+
3388
3761
  var getAnnotations = function getAnnotations(_ref) {
3389
3762
  var annotationX = _ref.annotationX,
3390
- annotationColor = _ref.annotationColor,
3391
- annotationLabel = _ref.annotationLabel;
3763
+ annotationColor = _ref.annotationColor,
3764
+ annotationLabel = _ref.annotationLabel;
3392
3765
  return annotationX && annotationX.length ? annotationX.map(function (timestamp, i) {
3393
3766
  return {
3394
3767
  color: annotationColor && annotationColor[i],
@@ -3397,6 +3770,7 @@ var getAnnotations = function getAnnotations(_ref) {
3397
3770
  };
3398
3771
  }) : [];
3399
3772
  };
3773
+
3400
3774
  exports.getAnnotations = getAnnotations;
3401
3775
  /**
3402
3776
  * Truncate the result set to given limit
@@ -3405,20 +3779,25 @@ exports.getAnnotations = getAnnotations;
3405
3779
  * @param {Number|String} truncationLimit - options['chart.resultTruncationLimit']
3406
3780
  * @returns {Object}
3407
3781
  */
3782
+
3408
3783
  var truncateData = function truncateData(dataSet, truncationLimit) {
3409
3784
  if (!dataSet) {
3410
3785
  return null;
3411
3786
  }
3787
+
3412
3788
  var limit = parseInt(truncationLimit, 10);
3789
+
3413
3790
  if (!limit || limit <= 0) {
3414
3791
  return dataSet;
3415
3792
  }
3793
+
3416
3794
  var truncatedData = Object.assign({}, dataSet);
3417
3795
  truncatedData.columns = truncatedData.columns.map(function (columnData) {
3418
3796
  return columnData && Array.isArray(columnData) ? columnData.slice(0, limit) : columnData;
3419
3797
  });
3420
3798
  return truncatedData;
3421
3799
  };
3800
+
3422
3801
  exports.truncateData = truncateData;
3423
3802
  /**
3424
3803
  * Helper method to update the option values into the values that SC accepts
@@ -3426,13 +3805,15 @@ exports.truncateData = truncateData;
3426
3805
  * @param {Object} options
3427
3806
  * @returns {Object}
3428
3807
  */
3808
+
3429
3809
  var mapToValues = function mapToValues(optionValuesSCMapping) {
3430
3810
  return function (options) {
3431
3811
  var convertedOptions = Object.assign({}, options);
3432
3812
  Object.keys(optionValuesSCMapping).forEach(function (key) {
3433
- if (lodash_1.has(options, key)) {
3813
+ if ((0, lodash_1.has)(options, key)) {
3434
3814
  var updatedValue = optionValuesSCMapping[key][options[key]];
3435
- if (!lodash_1.isUndefined(updatedValue)) {
3815
+
3816
+ if (!(0, lodash_1.isUndefined)(updatedValue)) {
3436
3817
  convertedOptions[key] = updatedValue;
3437
3818
  }
3438
3819
  }
@@ -3440,6 +3821,7 @@ var mapToValues = function mapToValues(optionValuesSCMapping) {
3440
3821
  return convertedOptions;
3441
3822
  };
3442
3823
  };
3824
+
3443
3825
  exports.mapToValues = mapToValues;
3444
3826
  /**
3445
3827
  * Helper method to process options related to y2Fields
@@ -3447,18 +3829,23 @@ exports.mapToValues = mapToValues;
3447
3829
  * @param {Object} originalOptions
3448
3830
  * @returns {Object}
3449
3831
  */
3832
+
3450
3833
  var convertY2AxisOptions = function convertY2AxisOptions(_a) {
3451
3834
  var y2Fields = _a.y2Fields,
3452
- originalOptions = __rest(_a, ["y2Fields"]);
3835
+ originalOptions = __rest(_a, ["y2Fields"]);
3836
+
3453
3837
  var convertedOptions = Object.assign({}, originalOptions);
3838
+
3454
3839
  if (y2Fields) {
3455
3840
  convertedOptions['axisY2.enabled'] = true;
3456
- convertedOptions['axisY2.fields'] = lodash_1.isArray(y2Fields) ? y2Fields.filter(function (name) {
3841
+ convertedOptions['axisY2.fields'] = (0, lodash_1.isArray)(y2Fields) ? y2Fields.filter(function (name) {
3457
3842
  return name;
3458
3843
  }).join(',') : y2Fields;
3459
3844
  }
3845
+
3460
3846
  return convertedOptions;
3461
3847
  };
3848
+
3462
3849
  exports.convertY2AxisOptions = convertY2AxisOptions;
3463
3850
  /**
3464
3851
  * Helper method to format value for overlayFields
@@ -3466,9 +3853,11 @@ exports.convertY2AxisOptions = convertY2AxisOptions;
3466
3853
  * @param {Object} originalOptions
3467
3854
  * @returns {Object}
3468
3855
  */
3856
+
3469
3857
  var convertOverlayFields = function convertOverlayFields(originalOptions) {
3470
3858
  var convertedOptions = Object.assign({}, originalOptions);
3471
3859
  var overlayFields = originalOptions.overlayFields;
3860
+
3472
3861
  if (overlayFields) {
3473
3862
  convertedOptions.overlayFields = Array.isArray(overlayFields) ? overlayFields.filter(function (field) {
3474
3863
  return field;
@@ -3476,17 +3865,21 @@ var convertOverlayFields = function convertOverlayFields(originalOptions) {
3476
3865
  return field.trim();
3477
3866
  }).join(',') : overlayFields;
3478
3867
  }
3868
+
3479
3869
  return convertedOptions;
3480
3870
  };
3871
+
3481
3872
  exports.convertOverlayFields = convertOverlayFields;
3482
3873
  /**
3483
3874
  * checks whether data is multi series data
3484
3875
  * @param {array} data array
3485
3876
  * @return {Boolean}
3486
3877
  */
3878
+
3487
3879
  var isMultiSeriesData = function isMultiSeriesData(data) {
3488
3880
  return Array.isArray(data) && Array.isArray(data[0]);
3489
3881
  };
3882
+
3490
3883
  exports.isMultiSeriesData = isMultiSeriesData;
3491
3884
  /**
3492
3885
  * checks whether data is multi series data and returns value as array
@@ -3494,36 +3887,39 @@ exports.isMultiSeriesData = isMultiSeriesData;
3494
3887
  * @param {*} value to return as array
3495
3888
  * @return {array}
3496
3889
  */
3890
+
3497
3891
  var toArrayForSeries = function toArrayForSeries(data, value) {
3498
- return exports.isMultiSeriesData(data) ? value : [value];
3892
+ return (0, exports.isMultiSeriesData)(data) ? value : [value];
3499
3893
  };
3894
+
3500
3895
  exports.toArrayForSeries = toArrayForSeries;
3896
+
3501
3897
  var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
3502
3898
  var _ref2$x = _ref2.x,
3503
- x = _ref2$x === void 0 ? [] : _ref2$x,
3504
- _ref2$y = _ref2.y,
3505
- y = _ref2$y === void 0 ? [] : _ref2$y,
3506
- xField = _ref2.xField,
3507
- yFields = _ref2.yFields,
3508
- y2 = _ref2.y2,
3509
- y2Fields = _ref2.y2Fields;
3510
- var columns = [x.map(String)].concat(_toConsumableArray(exports.toArrayForSeries(y, y).map(function (series) {
3899
+ x = _ref2$x === void 0 ? [] : _ref2$x,
3900
+ _ref2$y = _ref2.y,
3901
+ y = _ref2$y === void 0 ? [] : _ref2$y,
3902
+ xField = _ref2.xField,
3903
+ yFields = _ref2.yFields,
3904
+ y2 = _ref2.y2,
3905
+ y2Fields = _ref2.y2Fields;
3906
+ var columns = [x.map(String)].concat(_toConsumableArray((0, exports.toArrayForSeries)(y, y).map(function (series) {
3511
3907
  return series.map(String);
3512
3908
  })));
3513
- var yFieldsArray = exports.toArrayForSeries(y, yFields);
3909
+ var yFieldsArray = (0, exports.toArrayForSeries)(y, yFields);
3514
3910
  var fields = [{
3515
3911
  name: xField
3516
3912
  }].concat(_toConsumableArray(yFieldsArray.map(function (field) {
3517
3913
  return {
3518
3914
  name: field
3519
3915
  };
3520
- })));
3521
- // splunk-charting requires y2 to be part of columns
3916
+ }))); // splunk-charting requires y2 to be part of columns
3522
3917
  // when y & y2 options are configured with different (mutually exclusive) series
3523
3918
  // y2 columns need to be added to columns
3919
+
3524
3920
  if (y2Fields) {
3525
- var y2FieldsArray = exports.toArrayForSeries(y2, y2Fields);
3526
- var y2AsArray = exports.toArrayForSeries(y2, y2).map(function (series) {
3921
+ var y2FieldsArray = (0, exports.toArrayForSeries)(y2, y2Fields);
3922
+ var y2AsArray = (0, exports.toArrayForSeries)(y2, y2).map(function (series) {
3527
3923
  return series === null || series === void 0 ? void 0 : series.map(String);
3528
3924
  });
3529
3925
  y2FieldsArray.forEach(function (y2Field, index) {
@@ -3535,15 +3931,24 @@ var constructFieldsAndColumns = function constructFieldsAndColumns(_ref2) {
3535
3931
  }
3536
3932
  });
3537
3933
  }
3934
+
3538
3935
  return {
3539
3936
  columns: columns,
3540
3937
  fields: fields
3541
3938
  };
3542
3939
  };
3940
+
3543
3941
  exports.constructFieldsAndColumns = constructFieldsAndColumns;
3544
3942
 
3545
3943
  /***/ }),
3546
3944
 
3945
+ /***/ 59:
3946
+ /***/ (function(module, exports) {
3947
+
3948
+ module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
3949
+
3950
+ /***/ }),
3951
+
3547
3952
  /***/ 6:
3548
3953
  /***/ (function(module, exports, __webpack_require__) {
3549
3954
 
@@ -3555,6 +3960,7 @@ Object.defineProperty(exports, "__esModule", {
3555
3960
  });
3556
3961
  exports.VizBehavior = void 0;
3557
3962
  var VizBehavior;
3963
+
3558
3964
  (function (VizBehavior) {
3559
3965
  /**
3560
3966
  * Dynamic Options Behavior.
@@ -3574,6 +3980,7 @@ var VizBehavior;
3574
3980
  * missing.
3575
3981
  * @type {string}
3576
3982
  */
3983
+
3577
3984
  VizBehavior["PLACEHOLDER"] = "placeholder";
3578
3985
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
3579
3986
  VizBehavior["TRELLIS"] = "trellis";
@@ -3595,24 +4002,24 @@ module.exports = require("@babel/runtime/helpers/toConsumableArray");
3595
4002
 
3596
4003
  /***/ }),
3597
4004
 
3598
- /***/ 9:
4005
+ /***/ 83:
3599
4006
  /***/ (function(module, exports) {
3600
4007
 
3601
- module.exports = require("@babel/runtime/helpers/classCallCheck");
4008
+ module.exports = require("@splunk/visualization-encoding/utils/types");
3602
4009
 
3603
4010
  /***/ }),
3604
4011
 
3605
- /***/ 91:
4012
+ /***/ 9:
3606
4013
  /***/ (function(module, exports) {
3607
4014
 
3608
- module.exports = require("d3-scale");
4015
+ module.exports = require("@babel/runtime/helpers/classCallCheck");
3609
4016
 
3610
4017
  /***/ }),
3611
4018
 
3612
- /***/ 98:
4019
+ /***/ 93:
3613
4020
  /***/ (function(module, exports) {
3614
4021
 
3615
- module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
4022
+ module.exports = require("d3-scale");
3616
4023
 
3617
4024
  /***/ }),
3618
4025
 
@@ -3623,15 +4030,20 @@ module.exports = require("@babel/runtime/helpers/taggedTemplateLiteral");
3623
4030
 
3624
4031
 
3625
4032
  var _slicedToArray = __webpack_require__(17);
4033
+
3626
4034
  Object.defineProperty(exports, "__esModule", {
3627
4035
  value: true
3628
4036
  });
3629
4037
  exports.truncateAxisLabelText = exports.isBubbleSelected = exports.isSomethingSelected = exports.getDataByRows = exports.createValueScale = exports.getScales = exports.getChartAreaDimensions = exports.getColorCategoryMapping = exports.GRAYSCALE_FILTER_ID = exports.BUBBLE_LABELS_TYPES = exports.COLOR_MODE_TYPES = exports.BUBBLE_SCALE_TYPES = exports.BUBBLE_ROW_SCALE_TYPES = exports.AXIS_ORIENTATION_TYPES = void 0;
3630
- var d3_scale_1 = __webpack_require__(91);
4038
+
4039
+ var d3_scale_1 = __webpack_require__(93);
3631
4040
  /**
3632
4041
  * @enum {AXIS_ORIENTATION_TYPES}
3633
4042
  */
4043
+
4044
+
3634
4045
  var AXIS_ORIENTATION_TYPES;
4046
+
3635
4047
  (function (AXIS_ORIENTATION_TYPES) {
3636
4048
  AXIS_ORIENTATION_TYPES["VERTICAL"] = "vertical";
3637
4049
  AXIS_ORIENTATION_TYPES["HORIZONTAL"] = "horizontal";
@@ -3639,7 +4051,10 @@ var AXIS_ORIENTATION_TYPES;
3639
4051
  /**
3640
4052
  * @enum {BUBBLE_ROW_SCALE_TYPES}
3641
4053
  */
4054
+
4055
+
3642
4056
  var BUBBLE_ROW_SCALE_TYPES;
4057
+
3643
4058
  (function (BUBBLE_ROW_SCALE_TYPES) {
3644
4059
  BUBBLE_ROW_SCALE_TYPES["GLOBAL"] = "global";
3645
4060
  BUBBLE_ROW_SCALE_TYPES["ROW"] = "row";
@@ -3647,7 +4062,10 @@ var BUBBLE_ROW_SCALE_TYPES;
3647
4062
  /**
3648
4063
  * @enum {BUBBLE_SCALE_TYPES}
3649
4064
  */
4065
+
4066
+
3650
4067
  var BUBBLE_SCALE_TYPES;
4068
+
3651
4069
  (function (BUBBLE_SCALE_TYPES) {
3652
4070
  BUBBLE_SCALE_TYPES["RADIUS"] = "radius";
3653
4071
  BUBBLE_SCALE_TYPES["AREA"] = "area";
@@ -3655,7 +4073,10 @@ var BUBBLE_SCALE_TYPES;
3655
4073
  /**
3656
4074
  * @enum {COLOR_MODE_TYPES}
3657
4075
  */
4076
+
4077
+
3658
4078
  var COLOR_MODE_TYPES;
4079
+
3659
4080
  (function (COLOR_MODE_TYPES) {
3660
4081
  COLOR_MODE_TYPES["SEQUENTIAL"] = "sequential";
3661
4082
  COLOR_MODE_TYPES["CATEGORICAL"] = "categorical";
@@ -3663,7 +4084,10 @@ var COLOR_MODE_TYPES;
3663
4084
  /**
3664
4085
  * @enum {BUBBLE_LABELS_TYPES}
3665
4086
  */
4087
+
4088
+
3666
4089
  var BUBBLE_LABELS_TYPES;
4090
+
3667
4091
  (function (BUBBLE_LABELS_TYPES) {
3668
4092
  BUBBLE_LABELS_TYPES["ALL"] = "all";
3669
4093
  BUBBLE_LABELS_TYPES["MAX"] = "max";
@@ -3672,6 +4096,8 @@ var BUBBLE_LABELS_TYPES;
3672
4096
  /**
3673
4097
  * @string GRAYSCALE_FILTER_ID
3674
4098
  */
4099
+
4100
+
3675
4101
  exports.GRAYSCALE_FILTER_ID = "punchcard-grayscale-filter-id-".concat(Math.floor(Math.random() * 1000));
3676
4102
  var X_AXIS_HEIGHT = 15;
3677
4103
  var Y_AXIS_WIDTH = 77;
@@ -3687,15 +4113,19 @@ var HORIZONTAL_SPACE_FOR_SINGLE_CHAR = 6;
3687
4113
  * @param {Array<String>} seriesColors
3688
4114
  * @return {Function} colorCategoryMapping
3689
4115
  */
4116
+
3690
4117
  var getColorCategoryMapping = function getColorCategoryMapping(_ref) {
3691
4118
  var category = _ref.category,
3692
- colorMode = _ref.colorMode,
3693
- seriesColors = _ref.seriesColors;
4119
+ colorMode = _ref.colorMode,
4120
+ seriesColors = _ref.seriesColors;
4121
+
3694
4122
  if (colorMode === COLOR_MODE_TYPES.SEQUENTIAL) {
3695
4123
  return null;
3696
4124
  }
3697
- return d3_scale_1.scaleOrdinal().domain(category).range(seriesColors).unknown(seriesColors[0]);
4125
+
4126
+ return (0, d3_scale_1.scaleOrdinal)().domain(category).range(seriesColors).unknown(seriesColors[0]);
3698
4127
  };
4128
+
3699
4129
  exports.getColorCategoryMapping = getColorCategoryMapping;
3700
4130
  /**
3701
4131
  * get punchcard dimensions given container width and height
@@ -3712,18 +4142,21 @@ exports.getColorCategoryMapping = getColorCategoryMapping;
3712
4142
  * @return {Number} dimensions.chartAreaEndX
3713
4143
  * @return {Number} dimensions.chartAreaEndY
3714
4144
  */
4145
+
3715
4146
  var getChartAreaDimensions = function getChartAreaDimensions(_ref2) {
3716
4147
  var containerWidth = _ref2.containerWidth,
3717
- containerHeight = _ref2.containerHeight,
3718
- displayLegend = _ref2.displayLegend;
4148
+ containerHeight = _ref2.containerHeight,
4149
+ displayLegend = _ref2.displayLegend;
3719
4150
  var yAxisStartX = MARGIN;
3720
4151
  var chartAreaStartX = yAxisStartX + Y_AXIS_WIDTH + MARGIN;
3721
4152
  var chartAreaEndX = containerWidth - MARGIN;
3722
4153
  var legendStartX = null;
4154
+
3723
4155
  if (displayLegend) {
3724
4156
  legendStartX = containerWidth - LEGEND_WIDTH;
3725
4157
  chartAreaEndX = legendStartX - MARGIN;
3726
4158
  }
4159
+
3727
4160
  var chartAreaStartY = MARGIN;
3728
4161
  var xAxisStartY = containerHeight - X_AXIS_HEIGHT - MARGIN;
3729
4162
  var chartAreaEndY = xAxisStartY - MARGIN;
@@ -3737,6 +4170,7 @@ var getChartAreaDimensions = function getChartAreaDimensions(_ref2) {
3737
4170
  legendStartX: legendStartX
3738
4171
  };
3739
4172
  };
4173
+
3740
4174
  exports.getChartAreaDimensions = getChartAreaDimensions;
3741
4175
  /**
3742
4176
  * gets a scale used to map values to x or y plane
@@ -3749,20 +4183,23 @@ exports.getChartAreaDimensions = getChartAreaDimensions;
3749
4183
  * @return {Function} scales.scale function to return beginning of band
3750
4184
  * @return {Function} scales.positionScale function to return middle of band
3751
4185
  */
4186
+
3752
4187
  var getScales = function getScales(_ref3) {
3753
4188
  var values = _ref3.values,
3754
- start = _ref3.start,
3755
- end = _ref3.end;
3756
- var scale = d3_scale_1.scaleBand().domain(values).range([start, end]);
3757
- // Returns the middle of the band
4189
+ start = _ref3.start,
4190
+ end = _ref3.end;
4191
+ var scale = (0, d3_scale_1.scaleBand)().domain(values).range([start, end]); // Returns the middle of the band
4192
+
3758
4193
  var positionScale = function positionScale(value) {
3759
4194
  return scale(value) + scale.bandwidth() / 2;
3760
4195
  };
4196
+
3761
4197
  return {
3762
4198
  scale: scale,
3763
4199
  positionScale: positionScale
3764
4200
  };
3765
4201
  };
4202
+
3766
4203
  exports.getScales = getScales;
3767
4204
  /**
3768
4205
  * Maps an array of values to a percentage
@@ -3771,6 +4208,7 @@ exports.getScales = getScales;
3771
4208
  * @param {Array<Number>} values
3772
4209
  * @return {Function} radiusScale
3773
4210
  */
4211
+
3774
4212
  var createValueScale = function createValueScale(values) {
3775
4213
  var absValuesWithoutZero = [];
3776
4214
  values.forEach(function (value) {
@@ -3779,8 +4217,9 @@ var createValueScale = function createValueScale(values) {
3779
4217
  absValuesWithoutZero.push(Math.abs(value));
3780
4218
  }
3781
4219
  });
3782
- return d3_scale_1.scaleLinear().domain([Math.min.apply(Math, absValuesWithoutZero), Math.max.apply(Math, absValuesWithoutZero)]).range([0, 1]).clamp(true).unknown(0);
4220
+ return (0, d3_scale_1.scaleLinear)().domain([Math.min.apply(Math, absValuesWithoutZero), Math.max.apply(Math, absValuesWithoutZero)]).range([0, 1]).clamp(true).unknown(0);
3783
4221
  };
4222
+
3784
4223
  exports.createValueScale = createValueScale;
3785
4224
  /**
3786
4225
  * Given a dataset, partition it by row and for each row:
@@ -3805,49 +4244,55 @@ exports.createValueScale = createValueScale;
3805
4244
  * @param {Number} minBubbleRadius // Used when !isBubbleSizeDynamic
3806
4245
  * @return {Object<String\|Number, RowData>} dataByRows
3807
4246
  */
4247
+
3808
4248
  var getDataByRows = function getDataByRows(_ref4) {
3809
4249
  var bubbleRowScale = _ref4.bubbleRowScale,
3810
- bubbleScale = _ref4.bubbleScale,
3811
- category = _ref4.category,
3812
- colorCategoryMapping = _ref4.colorCategoryMapping,
3813
- colorMode = _ref4.colorMode,
3814
- bubbleColor = _ref4.bubbleColor,
3815
- minBubbleColorIntensity = _ref4.minBubbleColorIntensity,
3816
- size = _ref4.size,
3817
- x = _ref4.x,
3818
- y = _ref4.y,
3819
- isBubbleSizeDynamic = _ref4.isBubbleSizeDynamic,
3820
- minBubbleSize = _ref4.minBubbleSize,
3821
- maxBubbleSize = _ref4.maxBubbleSize,
3822
- minBand = _ref4.minBand,
3823
- maxBubbleRadius = _ref4.maxBubbleRadius,
3824
- minBubbleRadius = _ref4.minBubbleRadius;
4250
+ bubbleScale = _ref4.bubbleScale,
4251
+ category = _ref4.category,
4252
+ colorCategoryMapping = _ref4.colorCategoryMapping,
4253
+ colorMode = _ref4.colorMode,
4254
+ bubbleColor = _ref4.bubbleColor,
4255
+ minBubbleColorIntensity = _ref4.minBubbleColorIntensity,
4256
+ size = _ref4.size,
4257
+ x = _ref4.x,
4258
+ y = _ref4.y,
4259
+ isBubbleSizeDynamic = _ref4.isBubbleSizeDynamic,
4260
+ minBubbleSize = _ref4.minBubbleSize,
4261
+ maxBubbleSize = _ref4.maxBubbleSize,
4262
+ minBand = _ref4.minBand,
4263
+ maxBubbleRadius = _ref4.maxBubbleRadius,
4264
+ minBubbleRadius = _ref4.minBubbleRadius;
3825
4265
  var dataByRows = {};
3826
4266
  var minRadius = isBubbleSizeDynamic ? minBand / 2 * minBubbleSize : minBubbleRadius;
3827
4267
  var maxRadius = isBubbleSizeDynamic ? minBand / 2 * maxBubbleSize : maxBubbleRadius;
3828
4268
  var minArea = Math.PI * Math.pow(minRadius, 2);
3829
4269
  var maxArea = Math.PI * Math.pow(maxRadius, 2);
3830
4270
  var isBubbleColorAnArray = Array.isArray(bubbleColor);
3831
- var globalSizeScale = exports.createValueScale(size);
4271
+ var globalSizeScale = (0, exports.createValueScale)(size);
4272
+
3832
4273
  var getRadiusValue = function getRadiusValue(value, sizeScale) {
3833
4274
  return bubbleScale === BUBBLE_SCALE_TYPES.RADIUS ? (maxRadius - minRadius) * sizeScale(Math.abs(value)) + minRadius : Math.sqrt(((maxArea - minArea) * sizeScale(Math.abs(value)) + minArea) / Math.PI);
3834
4275
  };
4276
+
3835
4277
  var getColorValue = function getColorValue(c) {
3836
4278
  return colorMode === COLOR_MODE_TYPES.CATEGORICAL ? colorCategoryMapping(c) : bubbleColor;
3837
4279
  };
4280
+
3838
4281
  var getOpacityValue = function getOpacityValue(value, sizeScale) {
3839
4282
  return colorMode === COLOR_MODE_TYPES.CATEGORICAL || isBubbleColorAnArray ? 1 : sizeScale(Math.abs(value)) * (1 - minBubbleColorIntensity) + minBubbleColorIntensity;
3840
4283
  };
4284
+
3841
4285
  y.forEach(function (yValue, index) {
3842
4286
  var xValue = x[index];
3843
4287
  var sizeValue = size[index];
3844
4288
  var categoryValue = category && category[index] ? category[index] : null;
3845
- var bubbleColorValue = colorMode === COLOR_MODE_TYPES.SEQUENTIAL && isBubbleColorAnArray ? bubbleColor[index] : getColorValue(categoryValue);
3846
- // if we find an invalid data point here (x, y or size is null or undefined), we ignore it
4289
+ var bubbleColorValue = colorMode === COLOR_MODE_TYPES.SEQUENTIAL && isBubbleColorAnArray ? bubbleColor[index] : getColorValue(categoryValue); // if we find an invalid data point here (x, y or size is null or undefined), we ignore it
4290
+
3847
4291
  if (xValue == null || yValue == null || sizeValue == null) {
3848
4292
  return;
3849
- }
3850
- // initialize rowData
4293
+ } // initialize rowData
4294
+
4295
+
3851
4296
  if (!dataByRows[yValue]) {
3852
4297
  dataByRows[yValue] = {
3853
4298
  rowXValues: [],
@@ -3859,30 +4304,34 @@ var getDataByRows = function getDataByRows(_ref4) {
3859
4304
  rowRadiusValues: []
3860
4305
  };
3861
4306
  }
4307
+
3862
4308
  dataByRows[yValue].rowXValues.push(xValue);
3863
4309
  dataByRows[yValue].rowSizeValues.push(sizeValue);
3864
4310
  dataByRows[yValue].rowCategoryValues.push(categoryValue);
3865
4311
  dataByRows[yValue].rowColorValues.push(bubbleColorValue);
3866
4312
  dataByRows[yValue].rowFillOpacityValues.push(getOpacityValue(size[index], dataByRows[yValue].rowSizeScale));
3867
4313
  dataByRows[yValue].rowRadiusValues.push(getRadiusValue(size[index], dataByRows[yValue].rowSizeScale));
3868
- });
3869
- // If we are using row scaling we need to recalculate opacity, radius and size scale
4314
+ }); // If we are using row scaling we need to recalculate opacity, radius and size scale
4315
+
3870
4316
  if (bubbleRowScale === BUBBLE_ROW_SCALE_TYPES.ROW) {
3871
4317
  Object.entries(dataByRows).forEach(function (_ref5) {
3872
4318
  var _ref6 = _slicedToArray(_ref5, 2),
3873
- row = _ref6[0],
3874
- rowData = _ref6[1];
3875
- var rowSizeScale = exports.createValueScale(rowData.rowSizeValues);
3876
- dataByRows[row].rowSizeScale = rowSizeScale;
3877
- // Fill in opacity and radius values based on row scale
4319
+ row = _ref6[0],
4320
+ rowData = _ref6[1];
4321
+
4322
+ var rowSizeScale = (0, exports.createValueScale)(rowData.rowSizeValues);
4323
+ dataByRows[row].rowSizeScale = rowSizeScale; // Fill in opacity and radius values based on row scale
4324
+
3878
4325
  rowData.rowSizeValues.forEach(function (rowSizeValue, index) {
3879
4326
  dataByRows[row].rowFillOpacityValues[index] = getOpacityValue(rowData.rowSizeValues[index], rowSizeScale);
3880
4327
  dataByRows[row].rowRadiusValues[index] = getRadiusValue(rowData.rowSizeValues[index], rowSizeScale);
3881
4328
  });
3882
4329
  });
3883
4330
  }
4331
+
3884
4332
  return dataByRows;
3885
4333
  };
4334
+
3886
4335
  exports.getDataByRows = getDataByRows;
3887
4336
  /**
3888
4337
  * Given selected dimensions
@@ -3894,12 +4343,14 @@ exports.getDataByRows = getDataByRows;
3894
4343
  * @param {String} selectedCategory
3895
4344
  * @return {Boolean}
3896
4345
  */
4346
+
3897
4347
  var isSomethingSelected = function isSomethingSelected(_ref7) {
3898
4348
  var selectedX = _ref7.selectedX,
3899
- selectedY = _ref7.selectedY,
3900
- selectedCategory = _ref7.selectedCategory;
4349
+ selectedY = _ref7.selectedY,
4350
+ selectedCategory = _ref7.selectedCategory;
3901
4351
  return selectedX !== null || selectedY !== null || selectedCategory !== null;
3902
4352
  };
4353
+
3903
4354
  exports.isSomethingSelected = isSomethingSelected;
3904
4355
  /**
3905
4356
  * Given selected dimensions and a specific bubble's values
@@ -3914,24 +4365,30 @@ exports.isSomethingSelected = isSomethingSelected;
3914
4365
  * @param {Boolean} categoryValue
3915
4366
  * @return {Boolean}
3916
4367
  */
4368
+
3917
4369
  var isBubbleSelected = function isBubbleSelected(_ref8) {
3918
4370
  var selectedX = _ref8.selectedX,
3919
- selectedY = _ref8.selectedY,
3920
- selectedCategory = _ref8.selectedCategory,
3921
- xValue = _ref8.xValue,
3922
- yValue = _ref8.yValue,
3923
- categoryValue = _ref8.categoryValue;
4371
+ selectedY = _ref8.selectedY,
4372
+ selectedCategory = _ref8.selectedCategory,
4373
+ xValue = _ref8.xValue,
4374
+ yValue = _ref8.yValue,
4375
+ categoryValue = _ref8.categoryValue;
4376
+
3924
4377
  if (selectedX !== null && xValue !== selectedX) {
3925
4378
  return false;
3926
4379
  }
4380
+
3927
4381
  if (selectedY !== null && yValue !== selectedY) {
3928
4382
  return false;
3929
4383
  }
4384
+
3930
4385
  if (selectedCategory !== null && categoryValue !== selectedCategory) {
3931
4386
  return false;
3932
4387
  }
4388
+
3933
4389
  return true;
3934
4390
  };
4391
+
3935
4392
  exports.isBubbleSelected = isBubbleSelected;
3936
4393
  /**
3937
4394
  * Given text and available width, the truncateAxisLabelText will ellipsize
@@ -3942,28 +4399,35 @@ exports.isBubbleSelected = isBubbleSelected;
3942
4399
  * @param {Number} widthInPX - Available width to render the text
3943
4400
  * @param {('ellipsisStart' | 'ellipsisEnd')} axisLabelOverflowMode - Truncate start or end of the text
3944
4401
  */
4402
+
3945
4403
  var truncateAxisLabelText = function truncateAxisLabelText(_ref9) {
3946
4404
  var label = _ref9.label,
3947
- _ref9$widthInPX = _ref9.widthInPX,
3948
- widthInPX = _ref9$widthInPX === void 0 ? Y_AXIS_WIDTH : _ref9$widthInPX,
3949
- _ref9$axisLabelOverfl = _ref9.axisLabelOverflowMode,
3950
- axisLabelOverflowMode = _ref9$axisLabelOverfl === void 0 ? 'ellipsisEnd' : _ref9$axisLabelOverfl;
4405
+ _ref9$widthInPX = _ref9.widthInPX,
4406
+ widthInPX = _ref9$widthInPX === void 0 ? Y_AXIS_WIDTH : _ref9$widthInPX,
4407
+ _ref9$axisLabelOverfl = _ref9.axisLabelOverflowMode,
4408
+ axisLabelOverflowMode = _ref9$axisLabelOverfl === void 0 ? 'ellipsisEnd' : _ref9$axisLabelOverfl;
3951
4409
  // convert available width to number of characters that can be rendered.
3952
4410
  var availableLength = Math.floor(widthInPX / HORIZONTAL_SPACE_FOR_SINGLE_CHAR);
4411
+
3953
4412
  if (label.length <= availableLength) {
3954
4413
  return label;
3955
- }
3956
- // return empty string if available space cannot accomodate
4414
+ } // return empty string if available space cannot accomodate
3957
4415
  // at least one label character
4416
+
4417
+
3958
4418
  if (availableLength < 'X...'.length) {
3959
4419
  return '';
3960
4420
  }
4421
+
3961
4422
  var endMarker = Math.max(0, availableLength - '...'.length);
4423
+
3962
4424
  if (axisLabelOverflowMode === 'ellipsisStart') {
3963
4425
  return "...".concat(label.slice(-endMarker));
3964
4426
  }
4427
+
3965
4428
  return "".concat(label.slice(0, endMarker), "...");
3966
4429
  };
4430
+
3967
4431
  exports.truncateAxisLabelText = truncateAxisLabelText;
3968
4432
 
3969
4433
  /***/ })