@splunk/visualizations 26.0.0 → 26.1.1

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 (152) hide show
  1. package/Area.config.js +103 -19
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +646 -243
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +105 -21
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +653 -237
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +95 -21
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +635 -229
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +66 -15
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +589 -211
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +104 -19
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +666 -239
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +83 -18
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +444 -156
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +101 -19
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +792 -322
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +97 -28
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +786 -390
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +63 -19
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +439 -164
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +107 -23
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +841 -456
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +73 -23
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +653 -230
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +1082 -0
  46. package/Map.config.js +244 -99
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +1223 -612
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +71 -21
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +477 -202
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +80 -22
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +819 -418
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +73 -19
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +870 -491
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +76 -23
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +643 -233
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +82 -30
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +863 -387
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +86 -20
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +449 -159
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +85 -23
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +895 -349
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +97 -23
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +639 -234
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +95 -25
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +1198 -656
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +287 -226
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +93 -23
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +991 -522
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +100 -27
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1185 -624
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +127 -68
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +74 -21
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +827 -329
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +152 -69
  103. package/common/Charting.js.map +1 -1
  104. package/common/ChartingApi.js +25 -14
  105. package/common/ChartingApi.js.map +1 -1
  106. package/common/DocExampleWithVizSandbox.js +530 -0
  107. package/common/DocExampleWithVizSandbox.js.map +1 -0
  108. package/common/EventsDoc.js +139 -104
  109. package/common/EventsDoc.js.map +1 -1
  110. package/common/GaugeMajorTicks.js +79 -69
  111. package/common/GaugeMajorTicks.js.map +1 -1
  112. package/common/GaugeValueMarker.js +54 -45
  113. package/common/GaugeValueMarker.js.map +1 -1
  114. package/common/OptionsDoc.js +178 -87
  115. package/common/OptionsDoc.js.map +1 -1
  116. package/common/OverviewDoc.js +530 -68
  117. package/common/OverviewDoc.js.map +1 -1
  118. package/common/SplunkVisualization.js +47 -20
  119. package/common/SplunkVisualization.js.map +1 -1
  120. package/common/SplunkVisualizationApi.js +15 -9
  121. package/common/SplunkVisualizationApi.js.map +1 -1
  122. package/common/ThemesDoc.js +57 -44
  123. package/common/ThemesDoc.js.map +1 -1
  124. package/common/chartingUtils.js +52 -20
  125. package/common/chartingUtils.js.map +1 -1
  126. package/common/docUtils.js +139 -7
  127. package/common/docUtils.js.map +1 -1
  128. package/common/gaugeUtils.js +185 -102
  129. package/common/gaugeUtils.js.map +1 -1
  130. package/common/shapeUtils.js +28 -16
  131. package/common/shapeUtils.js.map +1 -1
  132. package/common/utils/configUtils.js +50 -15
  133. package/common/utils/configUtils.js.map +1 -1
  134. package/common/utils/dataUtils.js +8 -3
  135. package/common/utils/dataUtils.js.map +1 -1
  136. package/common/utils/hocUtils.js +4 -2
  137. package/common/utils/hocUtils.js.map +1 -1
  138. package/common/utils/layoutUtils.js +2 -1
  139. package/common/utils/layoutUtils.js.map +1 -1
  140. package/common/utils/mapUtils.js +288 -128
  141. package/common/utils/mapUtils.js.map +1 -1
  142. package/common/utils/singleValueUtils.js +242 -197
  143. package/common/utils/singleValueUtils.js.map +1 -1
  144. package/common/utils/testHelper.js +10 -1
  145. package/common/utils/testHelper.js.map +1 -1
  146. package/common/utils/trellisUtils.js +62 -1
  147. package/common/utils/trellisUtils.js.map +1 -1
  148. package/common/utils/urlUtils.js +3 -1
  149. package/common/utils/urlUtils.js.map +1 -1
  150. package/common/withDashboardViz.js +389 -192
  151. package/common/withDashboardViz.js.map +1 -1
  152. package/package.json +18 -26
package/LinkGraph.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Copyright © 2018 Splunk Inc.
2
+ * Copyright © 2024 Splunk Inc.
3
3
  * SPLUNK CONFIDENTIAL – Use or disclosure of this material in whole or
4
4
  * in part without a valid written license from Splunk Inc. is PROHIBITED.
5
5
  */
@@ -138,6 +138,7 @@ Object.defineProperty(exports, "__esModule", {
138
138
  });
139
139
  exports.VizBehavior = void 0;
140
140
  var VizBehavior;
141
+
141
142
  (function (VizBehavior) {
142
143
  /**
143
144
  * Dynamic Options Behavior.
@@ -157,6 +158,7 @@ var VizBehavior;
157
158
  * missing.
158
159
  * @type {string}
159
160
  */
161
+
160
162
  VizBehavior["PLACEHOLDER"] = "placeholder";
161
163
  VizBehavior["PAGE_AND_SORT"] = "page-and-sort";
162
164
  VizBehavior["TRELLIS"] = "trellis";
@@ -208,11 +210,17 @@ module.exports = require("@splunk/visualizations-shared/colorUtils");
208
210
  Object.defineProperty(exports, "__esModule", {
209
211
  value: true
210
212
  });
213
+
211
214
  var React = __webpack_require__(1);
215
+
212
216
  var styled_components_1 = __webpack_require__(4);
217
+
213
218
  var SizeAwareWrapper_1 = __webpack_require__(19);
219
+
214
220
  var style_1 = __webpack_require__(14);
221
+
215
222
  var colorUtils_1 = __webpack_require__(12);
223
+
216
224
  var Item = styled_components_1.default.div.attrs(function (_ref) {
217
225
  var width = _ref.width;
218
226
  return {
@@ -225,11 +233,11 @@ var Item = styled_components_1.default.div.attrs(function (_ref) {
225
233
  componentId: "sc-1yhgpod-0"
226
234
  })(["position:relative;background-color:", "};"], function (props) {
227
235
  return (0, colorUtils_1.isColor)(props.backgroundColor) && props.backgroundColor || props.theme.defaultBackgroundColor;
228
- });
229
- // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
236
+ }); // Use `.attrs()` for highly dynamic styles. Ref: https://github.com/styled-components/styled-components/issues/134#issuecomment-312415291
237
+
230
238
  var FixSizeItem = styled_components_1.default.div.attrs(function (_ref2) {
231
239
  var width = _ref2.width,
232
- height = _ref2.height;
240
+ height = _ref2.height;
233
241
  return {
234
242
  style: Object.assign(Object.assign({}, width && {
235
243
  width: (0, style_1.toPx)(width)
@@ -251,11 +259,13 @@ var FixSizeItemContent = styled_components_1.default.div.withConfig({
251
259
  displayName: "FixedSizeContainer__FixSizeItemContent",
252
260
  componentId: "sc-1yhgpod-3"
253
261
  })(["min-height:0px;flex:1;position:relative;box-sizing:border-box;"]);
262
+
254
263
  var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
255
264
  var FixedSizeContainer = function FixedSizeContainer(props) {
256
265
  var width = props.width,
257
- height = props.height,
258
- backgroundColor = props.backgroundColor;
266
+ height = props.height,
267
+ backgroundColor = props.backgroundColor;
268
+
259
269
  if (!height) {
260
270
  return React.createElement(Item, {
261
271
  "data-test": "item",
@@ -263,24 +273,27 @@ var withFixedSizeContainer = function withFixedSizeContainer(Viz) {
263
273
  backgroundColor: backgroundColor
264
274
  }, React.createElement(ItemContent, null, React.createElement(Viz, Object.assign({}, props))));
265
275
  }
276
+
266
277
  return React.createElement(FixSizeItem, {
267
278
  "data-test": "fix-size-item",
268
- "data-splunk-visualization-version": "26.0.0 - 2f7458907",
279
+ "data-splunk-visualization-version": "26.1.1 - b6df0a015",
269
280
  width: width,
270
281
  height: height,
271
282
  backgroundColor: backgroundColor
272
283
  }, React.createElement(FixSizeItemContent, null, React.createElement(SizeAwareWrapper_1.default, null, function (_ref3) {
273
284
  var newWidth = _ref3.width,
274
- newHeight = _ref3.height;
285
+ newHeight = _ref3.height;
275
286
  return React.createElement(Viz, Object.assign({}, props, {
276
287
  width: newWidth,
277
288
  height: newHeight
278
289
  }));
279
290
  })));
280
291
  };
292
+
281
293
  FixedSizeContainer.displayName = 'withFixedSizeContainer';
282
294
  return FixedSizeContainer;
283
295
  };
296
+
284
297
  exports.default = withFixedSizeContainer;
285
298
 
286
299
  /***/ }),
@@ -306,9 +319,10 @@ exports.extendStaticWrapperProps = void 0;
306
319
  * @param {DashboardVizType} props.Wrapper
307
320
  * @param {DashboardVizType} props.Visualization
308
321
  */
322
+
309
323
  var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
310
324
  var Wrapper = _ref.Wrapper,
311
- Visualization = _ref.Visualization;
325
+ Visualization = _ref.Visualization;
312
326
  var extendProperties = ['propTypes', 'defaultProps', 'config'];
313
327
  extendProperties.forEach(function (prop) {
314
328
  if (Visualization[prop]) {
@@ -317,6 +331,7 @@ var extendStaticWrapperProps = function extendStaticWrapperProps(_ref) {
317
331
  }
318
332
  });
319
333
  };
334
+
320
335
  exports.extendStaticWrapperProps = extendStaticWrapperProps;
321
336
 
322
337
  /***/ }),
@@ -351,24 +366,33 @@ module.exports = require("@splunk/visualizations-shared/SizeAwareWrapper");
351
366
 
352
367
 
353
368
  var _toConsumableArray = __webpack_require__(8);
369
+
354
370
  var _defineProperty = __webpack_require__(7);
371
+
355
372
  var __rest = this && this.__rest || function (s, e) {
356
373
  var t = {};
374
+
357
375
  for (var p in s) {
358
376
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
359
377
  }
378
+
360
379
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
361
380
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
362
381
  }
363
382
  return t;
364
383
  };
384
+
365
385
  Object.defineProperty(exports, "__esModule", {
366
386
  value: true
367
387
  });
368
388
  exports.insertLayout = exports.isDynamicOption = exports.uncollapseEditorConfig = exports.generatePrecisionValues = exports.getInitialPreset = exports.enhanceOptionsSchemaWithDynamicOptions = exports.enhanceConfig = void 0;
389
+
369
390
  var lodash_1 = __webpack_require__(3);
391
+
370
392
  var schemaUtils_1 = __webpack_require__(16);
393
+
371
394
  var VizBehavior_1 = __webpack_require__(6);
395
+
372
396
  var dynamicOptionsDSLType = {
373
397
  type: 'string',
374
398
  pattern: schemaUtils_1.DYNAMIC_OPTIONS_DSL_PATTERN
@@ -378,20 +402,22 @@ var dynamicOptionsDSLType = {
378
402
  * @param optionsSchema a visualization's options schema
379
403
  * @returns an updated options schema that additionally allows strings starting with > for each option
380
404
  */
405
+
381
406
  function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
382
407
  var enhancedOptionsSchema = {};
383
408
  Object.keys(optionsSchema).forEach(function (key) {
384
409
  var _a = optionsSchema[key],
385
- title = _a.title,
386
- description = _a.description,
387
- readOnly = _a.readOnly,
388
- writeOnly = _a.writeOnly,
389
- examples = _a.examples,
390
- defaultValue = _a.default,
391
- type = _a.type,
392
- properties = _a.properties,
393
- patternProperties = _a.patternProperties,
394
- remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
410
+ title = _a.title,
411
+ description = _a.description,
412
+ readOnly = _a.readOnly,
413
+ writeOnly = _a.writeOnly,
414
+ examples = _a.examples,
415
+ defaultValue = _a.default,
416
+ type = _a.type,
417
+ properties = _a.properties,
418
+ patternProperties = _a.patternProperties,
419
+ remainingSchemaEntry = __rest(_a, ["title", "description", "readOnly", "writeOnly", "examples", "default", "type", "properties", "patternProperties"]);
420
+
395
421
  var annotations = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, title !== undefined && {
396
422
  title: title
397
423
  }), description !== undefined && {
@@ -405,12 +431,14 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
405
431
  }), defaultValue !== undefined && {
406
432
  default: defaultValue
407
433
  });
434
+
408
435
  if (type === 'object') {
409
436
  enhancedOptionsSchema[key] = Object.assign(Object.assign(Object.assign(Object.assign({}, remainingSchemaEntry), annotations), {
410
437
  type: type
411
438
  }), properties && {
412
439
  properties: enhanceOptionsSchemaWithDynamicOptions(properties)
413
440
  });
441
+
414
442
  if (patternProperties) {
415
443
  var enhancedPatternProperties = {};
416
444
  Object.keys(patternProperties).forEach(function (opt) {
@@ -428,6 +456,7 @@ function enhanceOptionsSchemaWithDynamicOptions(optionsSchema) {
428
456
  });
429
457
  return enhancedOptionsSchema;
430
458
  }
459
+
431
460
  exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamicOptions;
432
461
  /**
433
462
  * Helper function to enhance a Visualization Config as needed based on behaviors specified in supports block
@@ -436,11 +465,14 @@ exports.enhanceOptionsSchemaWithDynamicOptions = enhanceOptionsSchemaWithDynamic
436
465
  * @returns an enhanced Visualization Config containing updated config entries based on behaviors it supports
437
466
  * and containing `open: false` for all editor panels in editorConfig
438
467
  */
468
+
439
469
  function enhanceConfig(vizConfig) {
440
470
  var enhancedConfig = Object.assign({}, vizConfig);
471
+
441
472
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.DYNAMIC_OPTIONS) !== -1) {
442
473
  enhancedConfig.optionsSchema = enhanceOptionsSchemaWithDynamicOptions(vizConfig.optionsSchema);
443
474
  }
475
+
444
476
  enhancedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
445
477
  return Object.assign(Object.assign({}, config), {
446
478
  open: config.open || false
@@ -448,6 +480,7 @@ function enhanceConfig(vizConfig) {
448
480
  });
449
481
  return enhancedConfig;
450
482
  }
483
+
451
484
  exports.enhanceConfig = enhanceConfig;
452
485
  /**
453
486
  * Helper function to uncollapse all editor panels by adding `open: true` to the editorConfig
@@ -455,6 +488,7 @@ exports.enhanceConfig = enhanceConfig;
455
488
  * @param vizConfig a Visualization Config
456
489
  * @returns a Visualization Config containing `open: true` for all editor panels in editorConfig
457
490
  */
491
+
458
492
  function uncollapseEditorConfig(vizConfig) {
459
493
  var editorPanelUncollapsedConfig = Object.assign({}, vizConfig);
460
494
  editorPanelUncollapsedConfig.editorConfig = vizConfig.editorConfig.map(function (config) {
@@ -464,13 +498,16 @@ function uncollapseEditorConfig(vizConfig) {
464
498
  });
465
499
  return editorPanelUncollapsedConfig;
466
500
  }
501
+
467
502
  exports.uncollapseEditorConfig = uncollapseEditorConfig;
503
+
468
504
  function isDynamicOption(option) {
469
505
  return option && typeof option === 'string' && option.trim().startsWith('>') || false;
470
506
  }
471
- exports.isDynamicOption = isDynamicOption;
472
- // private helpers to improve readability of getInitialPreset
507
+
508
+ exports.isDynamicOption = isDynamicOption; // private helpers to improve readability of getInitialPreset
473
509
  // this shouldn't be tested since this util isn't something that we expect to use outside of getInitialPreset
510
+
474
511
  /**
475
512
  * this checks to make sure that all values within vizContext are compatible with the given preset's context to determine the initialPreset
476
513
  * 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
@@ -479,6 +516,7 @@ exports.isDynamicOption = isDynamicOption;
479
516
  *
480
517
  * Since the presetConfigs have explicit undefined keys to override the existing config, we need to explicitly check the undefined values
481
518
  */
519
+
482
520
  function hasCompatibleContexts(vizContext, presetContext) {
483
521
  var presetContextKeys = Object.keys(presetContext);
484
522
  return presetContextKeys.every(function (contextKey) {
@@ -488,6 +526,8 @@ function hasCompatibleContexts(vizContext, presetContext) {
488
526
  /**
489
527
  * Checks to make sure that dynamic (non-dynamic) options in a given preset are also dynamic (non-dynamic) in the vizOptions
490
528
  */
529
+
530
+
491
531
  function hasCompatibleOptions(vizOptions, presetOptions) {
492
532
  var presetOptionKeys = Object.keys(presetOptions);
493
533
  return presetOptionKeys.every(function (optionKey) {
@@ -502,18 +542,21 @@ function hasCompatibleOptions(vizOptions, presetOptions) {
502
542
  * @param {Object} vizOptions - the current vizOptions definition
503
543
  * @param {PresetEntry[]} presets - the list of presets, one of which can be considered an initialPreset
504
544
  */
545
+
546
+
505
547
  function getInitialPreset(vizContext, vizOptions, presets) {
506
548
  return presets.find(function (preset) {
507
549
  var presetContext = (0, lodash_1.get)(preset, ['value', 'context'], {});
508
550
  var presetOptions = (0, lodash_1.get)(preset, ['value', 'options'], {});
509
551
  var presetContextKeys = Object.keys(presetContext);
510
- var presetOptionKeys = Object.keys(presetOptions);
511
- // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
552
+ var presetOptionKeys = Object.keys(presetOptions); // all presets have to explicitly specify which options to reset (i.e. need explicitly undefined keys)
512
553
  // if not, then the preset is invalid in config.ts
554
+
513
555
  if (presetContextKeys.length === 0 || presetOptionKeys.length === 0) return false;
514
556
  return hasCompatibleContexts(vizContext, presetContext) && hasCompatibleOptions(vizOptions, presetOptions);
515
557
  });
516
558
  }
559
+
517
560
  exports.getInitialPreset = getInitialPreset;
518
561
  /**
519
562
  * generates number precision values for a Select editor
@@ -521,6 +564,7 @@ exports.getInitialPreset = getInitialPreset;
521
564
  * @param {Number} numPrecisionValues - number of integer precision values to generate
522
565
  * @returns {{ label: string; value; string }[]} array of { label, value } tuples
523
566
  */
567
+
524
568
  function generatePrecisionValues(numPrecisionValues) {
525
569
  return (0, lodash_1.range)(0, numPrecisionValues + 1).map(function (i) {
526
570
  return {
@@ -529,6 +573,7 @@ function generatePrecisionValues(numPrecisionValues) {
529
573
  };
530
574
  });
531
575
  }
576
+
532
577
  exports.generatePrecisionValues = generatePrecisionValues;
533
578
  /**
534
579
  * insert layout in layout array, return a new layout array instead of updating the original
@@ -538,12 +583,15 @@ exports.generatePrecisionValues = generatePrecisionValues;
538
583
  * @param {EditorLayoutConfig[][]} layoutItems - the item(s) to insert
539
584
  * @returns {EditorLayoutConfig[][]} new editor layout with insertion
540
585
  */
586
+
541
587
  var insertLayout = function insertLayout(layout, index) {
542
588
  for (var _len = arguments.length, layoutItems = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
543
589
  layoutItems[_key - 2] = arguments[_key];
544
590
  }
591
+
545
592
  return [].concat(_toConsumableArray(layout.slice(0, index)), layoutItems, _toConsumableArray(layout.slice(index)));
546
593
  };
594
+
547
595
  exports.insertLayout = insertLayout;
548
596
 
549
597
  /***/ }),
@@ -603,11 +651,17 @@ Object.defineProperty(exports, "__esModule", {
603
651
  value: true
604
652
  });
605
653
  exports.shouldShowIconPlaceholder = void 0;
654
+
606
655
  var React = __webpack_require__(1);
656
+
607
657
  var T = __webpack_require__(0);
658
+
608
659
  var lodash_1 = __webpack_require__(3);
660
+
609
661
  var i18n_1 = __webpack_require__(2);
662
+
610
663
  var Message_1 = __webpack_require__(10);
664
+
611
665
  var FixedSizeContainer_1 = __webpack_require__(13);
612
666
  /**
613
667
  * @method shouldShowIconPlaceholder
@@ -615,6 +669,8 @@ var FixedSizeContainer_1 = __webpack_require__(13);
615
669
  * @param {boolean} loading
616
670
  * @returns {boolean}
617
671
  */
672
+
673
+
618
674
  var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources) {
619
675
  var loading = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
620
676
  var data = (0, lodash_1.get)(dataSources, 'primary.data.columns[0]', undefined);
@@ -623,6 +679,7 @@ var shouldShowIconPlaceholder = function shouldShowIconPlaceholder(dataSources)
623
679
  var noFields = fields === undefined;
624
680
  return loading || noData || noFields;
625
681
  };
682
+
626
683
  exports.shouldShowIconPlaceholder = shouldShowIconPlaceholder;
627
684
  var propTypes = {
628
685
  icon: T.func,
@@ -637,11 +694,13 @@ var propTypes = {
637
694
  * @param {IconPlaceholderProps} props
638
695
  * @returns {React.ReactElement}
639
696
  */
697
+
640
698
  var IconPlaceholder = function IconPlaceholder(props) {
641
699
  var width = props.width,
642
- height = props.height,
643
- icon = props.icon,
644
- iconColor = props.iconColor;
700
+ height = props.height,
701
+ icon = props.icon,
702
+ iconColor = props.iconColor;
703
+
645
704
  if (icon) {
646
705
  return React.createElement(icon, {
647
706
  style: {
@@ -653,9 +712,11 @@ var IconPlaceholder = function IconPlaceholder(props) {
653
712
  transform: 'translate(-50%, -50%)'
654
713
  },
655
714
  width: '50%',
656
- height: '50%'
715
+ height: '50%',
716
+ 'data-test': 'icon-placeholder'
657
717
  });
658
718
  }
719
+
659
720
  return React.createElement(Message_1.default, {
660
721
  width: width,
661
722
  height: height,
@@ -663,6 +724,7 @@ var IconPlaceholder = function IconPlaceholder(props) {
663
724
  message: (0, i18n_1._)('No DataSource Connected')
664
725
  });
665
726
  };
727
+
666
728
  IconPlaceholder.propTypes = propTypes;
667
729
  IconPlaceholder.defaultProps = {
668
730
  width: '100%',
@@ -678,21 +740,27 @@ exports.default = (0, FixedSizeContainer_1.default)(IconPlaceholder);
678
740
 
679
741
 
680
742
  var _defineProperty = __webpack_require__(7);
743
+
681
744
  Object.defineProperty(exports, "__esModule", {
682
745
  value: true
683
746
  });
684
747
  exports.getSortingParams = exports.SortParamsPropTypes = void 0;
748
+
685
749
  var T = __webpack_require__(0);
750
+
686
751
  var lodash_1 = __webpack_require__(3);
687
- var DataSource_1 = __webpack_require__(43);
752
+
753
+ var DataSource_1 = __webpack_require__(34);
754
+
688
755
  exports.SortParamsPropTypes = T.shape({
689
756
  currentSortKey: T.string,
690
757
  currentSortDir: T.oneOf(DataSource_1.validSortDirs),
691
758
  onSort: T.func
692
759
  });
760
+
693
761
  var getSortingParams = function getSortingParams(_ref) {
694
762
  var requestParams = _ref.requestParams,
695
- onRequestParamsChange = _ref.onRequestParamsChange;
763
+ onRequestParamsChange = _ref.onRequestParamsChange;
696
764
  var currentSortKey;
697
765
  var currentSortDir;
698
766
  var nextSortDirMap = {
@@ -701,15 +769,18 @@ var getSortingParams = function getSortingParams(_ref) {
701
769
  none: 'asc'
702
770
  };
703
771
  var onSort;
772
+
704
773
  if (typeof onRequestParamsChange === 'function') {
705
774
  if (requestParams && (0, lodash_1.has)(requestParams, 'sort')) {
706
775
  currentSortKey = Object.keys(requestParams.sort).shift();
707
776
  currentSortDir = requestParams.sort[currentSortKey];
708
- }
709
- // undid memoization since there is a dependency on requestParams, which is a deeply nested object
777
+ } // undid memoization since there is a dependency on requestParams, which is a deeply nested object
778
+
779
+
710
780
  onSort = function onSort(e, _ref2) {
711
781
  var sortKey = _ref2.sortKey,
712
- sortDir = _ref2.sortDir;
782
+ sortDir = _ref2.sortDir;
783
+
713
784
  if (typeof sortKey === 'string') {
714
785
  var nextSortDir = (0, lodash_1.has)(nextSortDirMap, sortDir) ? nextSortDirMap[sortDir] : 'none';
715
786
  onRequestParamsChange(Object.assign(Object.assign({}, requestParams), {
@@ -721,12 +792,14 @@ var getSortingParams = function getSortingParams(_ref) {
721
792
  }
722
793
  };
723
794
  }
795
+
724
796
  return {
725
797
  currentSortKey: currentSortKey,
726
798
  currentSortDir: currentSortDir,
727
799
  onSort: onSort
728
800
  };
729
801
  };
802
+
730
803
  exports.getSortingParams = getSortingParams;
731
804
 
732
805
  /***/ }),
@@ -736,43 +809,68 @@ exports.getSortingParams = getSortingParams;
736
809
  "use strict";
737
810
 
738
811
 
812
+ Object.defineProperty(exports, "__esModule", {
813
+ value: true
814
+ });
815
+ exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
816
+ exports.validSortDirs = ['asc', 'desc', 'none'];
817
+ exports.validSegmentationModes = ['none', 'inner'];
818
+ exports.validOutputModes = ['json_cols', 'json'];
819
+
820
+ /***/ }),
821
+ /* 35 */
822
+ /***/ (function(module, exports, __webpack_require__) {
823
+
824
+ "use strict";
825
+
826
+
739
827
  Object.defineProperty(exports, "__esModule", {
740
828
  value: true
741
829
  });
742
830
  exports.getPaginationParams = exports.PaginatorParamsPropTypes = void 0;
831
+
743
832
  var T = __webpack_require__(0);
833
+
744
834
  var lodash_1 = __webpack_require__(3);
835
+
745
836
  exports.PaginatorParamsPropTypes = T.shape({
746
837
  isPaging: T.bool,
747
838
  current: T.number,
748
839
  totalPages: T.number,
749
840
  onChange: T.func
750
841
  });
842
+
751
843
  var getPaginationParams = function getPaginationParams(_ref) {
752
844
  var requestParams = _ref.requestParams,
753
- meta = _ref.meta,
754
- onRequestParamsChange = _ref.onRequestParamsChange;
845
+ meta = _ref.meta,
846
+ onRequestParamsChange = _ref.onRequestParamsChange;
755
847
  var totalCount = meta && meta.totalCount || 0;
756
848
  var offset = requestParams && requestParams.offset || 0;
757
849
  var count = requestParams && requestParams.count;
758
850
  var totalPages = typeof count === 'number' && count > 0 ? Math.ceil(totalCount / count) : 0;
759
851
  var current = typeof count === 'number' && count > 0 ? Math.floor(offset / count) + 1 : 0;
760
852
  var isPaging = totalPages > 1 && typeof onRequestParamsChange === 'function';
853
+
761
854
  var onChangeHandler = function onChangeHandler(e, _ref2) {
762
855
  var page = _ref2.page,
763
- countArg = _ref2.count;
856
+ countArg = _ref2.count;
764
857
  var newParams = (0, lodash_1.cloneDeep)(requestParams);
858
+
765
859
  if (typeof countArg === 'number') {
766
860
  newParams.count = countArg;
767
861
  newParams.offset = 0;
768
862
  }
863
+
769
864
  var pageCount = typeof newParams.count === 'number' ? newParams.count : 10;
865
+
770
866
  if (typeof page === 'number' && page > 0) {
771
867
  newParams.count = pageCount;
772
868
  newParams.offset = (page - 1) * pageCount;
773
869
  }
870
+
774
871
  onRequestParamsChange(newParams);
775
872
  };
873
+
776
874
  return {
777
875
  isPaging: isPaging,
778
876
  current: current,
@@ -780,10 +878,11 @@ var getPaginationParams = function getPaginationParams(_ref) {
780
878
  onChange: typeof onRequestParamsChange === 'function' ? onChangeHandler : lodash_1.noop
781
879
  };
782
880
  };
881
+
783
882
  exports.getPaginationParams = getPaginationParams;
784
883
 
785
884
  /***/ }),
786
- /* 35 */
885
+ /* 36 */
787
886
  /***/ (function(module, exports, __webpack_require__) {
788
887
 
789
888
  "use strict";
@@ -794,6 +893,7 @@ Object.defineProperty(exports, "__esModule", {
794
893
  });
795
894
  exports.VizCategory = void 0;
796
895
  var VizCategory;
896
+
797
897
  (function (VizCategory) {
798
898
  VizCategory["SINGLE_VALUE"] = "Single Value";
799
899
  VizCategory["TRENDS"] = "Trends";
@@ -810,67 +910,96 @@ var VizCategory;
810
910
  })(VizCategory = exports.VizCategory || (exports.VizCategory = {}));
811
911
 
812
912
  /***/ }),
813
- /* 36 */
913
+ /* 37 */
814
914
  /***/ (function(module, exports, __webpack_require__) {
815
915
 
816
916
  "use strict";
817
917
 
818
918
 
819
919
  var _slicedToArray = __webpack_require__(17);
920
+
820
921
  Object.defineProperty(exports, "__esModule", {
821
922
  value: true
822
923
  });
924
+
823
925
  var React = __webpack_require__(1);
926
+
824
927
  var lodash_1 = __webpack_require__(3);
825
- var getSettingsFromThemedProps_1 = __webpack_require__(37);
928
+
929
+ var getSettingsFromThemedProps_1 = __webpack_require__(38);
930
+
826
931
  var Options_1 = __webpack_require__(30);
827
- var SanitizeProps_1 = __webpack_require__(38);
932
+
933
+ var SanitizeProps_1 = __webpack_require__(39);
934
+
828
935
  var TimezoneContext_1 = __webpack_require__(26);
829
- var moment_1 = __webpack_require__(39);
936
+
937
+ var moment_1 = __webpack_require__(40);
938
+
830
939
  var FeatureFlagContext_1 = __webpack_require__(21);
940
+
831
941
  var styled_components_1 = __webpack_require__(4);
942
+
832
943
  var hocUtils_1 = __webpack_require__(27);
944
+
833
945
  var JSONSchemaUtils_1 = __webpack_require__(28);
834
- var async_dynamic_options_evaluator_1 = __webpack_require__(40);
946
+
947
+ var async_dynamic_options_evaluator_1 = __webpack_require__(41);
948
+
835
949
  var id_1 = __webpack_require__(25);
836
- var SplunkVisualization_1 = __webpack_require__(41);
950
+
951
+ var SplunkVisualization_1 = __webpack_require__(42);
952
+
837
953
  var VizBehavior_1 = __webpack_require__(6);
954
+
838
955
  var getSorting_1 = __webpack_require__(33);
839
- var getPagination_1 = __webpack_require__(34);
956
+
957
+ var getPagination_1 = __webpack_require__(35);
958
+
840
959
  var useDeepMemo_1 = __webpack_require__(44);
960
+
841
961
  var MissingPropsMessage_1 = __webpack_require__(45);
962
+
842
963
  var withEditModeCover_1 = __webpack_require__(46);
964
+
843
965
  var withPlaceholder_1 = __webpack_require__(47);
844
966
  /**
845
967
  * hoc that wraps a pure react visualization in a Dashboard visualization
846
968
  * @param {DashboardVizOpts} opts
847
969
  * @returns {HOC}
848
970
  */
971
+
972
+
849
973
  var withDashboardViz = function withDashboardViz(opts) {
850
974
  var ReactViz = opts.ReactViz,
851
- vizConfig = opts.vizConfig,
852
- _opts$computeVizProps = opts.computeVizProps,
853
- computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
854
- disableEditModeCover = opts.disableEditModeCover,
855
- useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
975
+ vizConfig = opts.vizConfig,
976
+ _opts$computeVizProps = opts.computeVizProps,
977
+ computeVizProps = _opts$computeVizProps === void 0 ? function () {} : _opts$computeVizProps,
978
+ disableEditModeCover = opts.disableEditModeCover,
979
+ useIconPlaceholder = opts.useIconPlaceholder; // sanitizing props before sending them to reactviz.
980
+
856
981
  var SanitizedReactViz = (0, SanitizeProps_1.withSanitizedProps)(ReactViz);
857
982
  var defaultOptions = (0, JSONSchemaUtils_1.pickFieldFromJSONSchema)(vizConfig.optionsSchema, 'default');
983
+
858
984
  var DashboardViz = function DashboardViz(props) {
859
985
  var _a;
986
+
860
987
  var mode = props.mode,
861
- hasEventHandlers = props.hasEventHandlers,
862
- dataSources = props.dataSources,
863
- options = props.options,
864
- _props$context = props.context,
865
- context = _props$context === void 0 ? {} : _props$context,
866
- width = props.width,
867
- height = props.height,
868
- onComputedProps = props.onComputedProps,
869
- onEventTrigger = props.onEventTrigger,
870
- theme = props.theme,
871
- onRequestParamsChange = props.onRequestParamsChange;
988
+ hasEventHandlers = props.hasEventHandlers,
989
+ dataSources = props.dataSources,
990
+ options = props.options,
991
+ _props$context = props.context,
992
+ context = _props$context === void 0 ? {} : _props$context,
993
+ width = props.width,
994
+ height = props.height,
995
+ onComputedProps = props.onComputedProps,
996
+ onEventTrigger = props.onEventTrigger,
997
+ theme = props.theme,
998
+ onRequestParamsChange = props.onRequestParamsChange;
999
+
872
1000
  var _React$useContext = React.useContext(TimezoneContext_1.default),
873
- serializedTimezone = _React$useContext.serializedTimezone;
1001
+ serializedTimezone = _React$useContext.serializedTimezone;
1002
+
874
1003
  if (serializedTimezone) {
875
1004
  /*
876
1005
  @splunk/moment currently does not allow us to customize the timezone on a per visualization basis.
@@ -884,38 +1013,51 @@ var withDashboardViz = function withDashboardViz(opts) {
884
1013
  moment_1.default.setDefaultSplunkTimezone(serializedTimezone);
885
1014
  }
886
1015
  }
1016
+
887
1017
  var themeFunc = function themeFunc(themeVar) {
888
1018
  var _a, _b;
1019
+
889
1020
  return (_b = (_a = vizConfig.themes)[themeVar]) === null || _b === void 0 ? void 0 : _b.call(_a, props);
890
1021
  };
1022
+
891
1023
  var bgColorFromTheme = themeFunc('defaultBackgroundColor');
1024
+
892
1025
  var _ref = (0, getSettingsFromThemedProps_1.default)({
893
- theme: theme
894
- }),
895
- currentThemeFamily = _ref.family,
896
- currentThemeColorScheme = _ref.colorScheme,
897
- currentThemeDensity = _ref.density;
1026
+ theme: theme
1027
+ }),
1028
+ currentThemeFamily = _ref.family,
1029
+ currentThemeColorScheme = _ref.colorScheme,
1030
+ currentThemeDensity = _ref.density;
1031
+
898
1032
  var evaluatedOptions = {}; // evaluatedOptions need to be initialized as an empty object
1033
+
899
1034
  var _React$useState = React.useState({}),
900
- _React$useState2 = _slicedToArray(_React$useState, 2),
901
- evaluatedOptionsAsync = _React$useState2[0],
902
- setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1035
+ _React$useState2 = _slicedToArray(_React$useState, 2),
1036
+ evaluatedOptionsAsync = _React$useState2[0],
1037
+ setEvaluatedOptionsAsync = _React$useState2[1]; // evaluatedOptions need to be initialized as an empty object
1038
+
1039
+
903
1040
  var featureFlagContext = React.useContext(FeatureFlagContext_1.default);
1041
+
904
1042
  var _React$useState3 = React.useState("".concat(vizConfig.name, " - ").concat((0, id_1.createGUID)())),
905
- _React$useState4 = _slicedToArray(_React$useState3, 1),
906
- visualizationID = _React$useState4[0];
1043
+ _React$useState4 = _slicedToArray(_React$useState3, 1),
1044
+ visualizationID = _React$useState4[0];
1045
+
907
1046
  var _React$useState5 = React.useState({}),
908
- _React$useState6 = _slicedToArray(_React$useState5, 2),
909
- dataSourcesInState = _React$useState6[0],
910
- setDataSourcesInState = _React$useState6[1];
1047
+ _React$useState6 = _slicedToArray(_React$useState5, 2),
1048
+ dataSourcesInState = _React$useState6[0],
1049
+ setDataSourcesInState = _React$useState6[1];
1050
+
911
1051
  var _React$useState7 = React.useState(),
912
- _React$useState8 = _slicedToArray(_React$useState7, 2),
913
- dataFramesInState = _React$useState8[0],
914
- setDataFramesInState = _React$useState8[1];
1052
+ _React$useState8 = _slicedToArray(_React$useState7, 2),
1053
+ dataFramesInState = _React$useState8[0],
1054
+ setDataFramesInState = _React$useState8[1];
1055
+
915
1056
  var _React$useState9 = React.useState(Boolean(featureFlagContext === null || featureFlagContext === void 0 ? void 0 : featureFlagContext.visualizations_useWebWorkersForDSL)),
916
- _React$useState10 = _slicedToArray(_React$useState9, 2),
917
- useAsyncEvaluatedOptions = _React$useState10[0],
918
- setUseAsyncEvaluatedOptions = _React$useState10[1];
1057
+ _React$useState10 = _slicedToArray(_React$useState9, 2),
1058
+ useAsyncEvaluatedOptions = _React$useState10[0],
1059
+ setUseAsyncEvaluatedOptions = _React$useState10[1];
1060
+
919
1061
  var isMounted = React.useRef(true);
920
1062
  evaluatedOptions = (0, useDeepMemo_1.useDeepMemo)(function () {
921
1063
  try {
@@ -940,11 +1082,13 @@ var withDashboardViz = function withDashboardViz(opts) {
940
1082
  });
941
1083
  } else {
942
1084
  var dataFrames = dataFramesInState;
1085
+
943
1086
  if (dataSources !== dataSourcesInState) {
944
1087
  setDataSourcesInState(dataSources);
945
1088
  dataFrames = Options_1.Options.dataFrameFromDataSource(dataSources);
946
1089
  setDataFramesInState(dataFrames);
947
1090
  }
1091
+
948
1092
  return Options_1.Options.evaluate({
949
1093
  context: (0, lodash_1.defaultsDeep)({}, context, vizConfig.defaultContext),
950
1094
  options: (0, hocUtils_1.deepMergeWithArrayPrimitiveOverrides)({}, options, defaultOptions)
@@ -955,21 +1099,24 @@ var withDashboardViz = function withDashboardViz(opts) {
955
1099
  console.error("unexpected error evaluating options: ".concat(e.message));
956
1100
  return {};
957
1101
  }
1102
+
958
1103
  return {};
959
1104
  }, [currentThemeFamily, currentThemeColorScheme, currentThemeDensity, options, context, dataSources, serializedTimezone, useAsyncEvaluatedOptions]);
960
- var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync;
961
- // trellis specific backgroundColor update for onComputedProps
1105
+ var evaluatedOptionsToUse = !useAsyncEvaluatedOptions ? evaluatedOptions : evaluatedOptionsAsync; // trellis specific backgroundColor update for onComputedProps
962
1106
  // 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
963
1107
  // onComputedProps api should return back trellisBackgroundColor value for backgroundColor option to support coloring of sibling panels (for eg:- title/ description on UDF side)
1108
+
964
1109
  var isTrellisFeatureFlagOn = Boolean(featureFlagContext && featureFlagContext.visualizations_enableTrellis);
965
1110
  var clonedEvaluatedOptions = evaluatedOptionsToUse;
1111
+
966
1112
  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) {
967
1113
  clonedEvaluatedOptions = Object.assign(Object.assign({}, evaluatedOptionsToUse), {
968
1114
  backgroundColor: clonedEvaluatedOptions === null || clonedEvaluatedOptions === void 0 ? void 0 : clonedEvaluatedOptions.trellisBackgroundColor
969
1115
  });
970
- }
971
- // useEffect hook needs to be initialized before any early returns
1116
+ } // useEffect hook needs to be initialized before any early returns
972
1117
  // this is in accordance with the order of hook calls being the same on each render https://reactjs.org/docs/hooks-rules.html#explanation
1118
+
1119
+
973
1120
  React.useEffect(function () {
974
1121
  onComputedProps(clonedEvaluatedOptions);
975
1122
  });
@@ -979,53 +1126,68 @@ var withDashboardViz = function withDashboardViz(opts) {
979
1126
  isMounted.current = false;
980
1127
  async_dynamic_options_evaluator_1.default.reset(visualizationID);
981
1128
  }
982
- };
983
- // eslint-disable-next-line react-hooks/exhaustive-deps
984
- }, []);
985
- // present warning message if any required props are missing
1129
+ }; // eslint-disable-next-line react-hooks/exhaustive-deps
1130
+ }, []); // present warning message if any required props are missing
1131
+
986
1132
  var _vizConfig$requiredPr = vizConfig.requiredProps,
987
- requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
988
- supports = vizConfig.supports;
1133
+ requiredProps = _vizConfig$requiredPr === void 0 ? [] : _vizConfig$requiredPr,
1134
+ supports = vizConfig.supports;
989
1135
  var missing = (0, MissingPropsMessage_1.missingKeys)(requiredProps, evaluatedOptionsToUse);
1136
+
990
1137
  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
991
1138
  ) {
992
- return React.createElement(MissingPropsMessage_1.default, {
993
- "data-test": "missing-props-message",
994
- width: width,
995
- height: height,
996
- missingProps: missing,
997
- backgroundColor: bgColorFromTheme
998
- });
999
- }
1000
- // events
1139
+ return React.createElement(MissingPropsMessage_1.default, {
1140
+ "data-test": "missing-props-message",
1141
+ width: width,
1142
+ height: height,
1143
+ missingProps: missing,
1144
+ backgroundColor: bgColorFromTheme
1145
+ });
1146
+ } // events
1147
+
1148
+
1001
1149
  var eventCallbackProps = {};
1150
+
1002
1151
  if (hasEventHandlers && mode === 'view' && vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.EVENTS) > -1) {
1003
1152
  var supportedEvents = vizConfig.events;
1004
1153
  Object.keys(supportedEvents).forEach(function (eventName) {
1005
- var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName));
1006
- eventCallbackProps[eventCallbackPropName] = null;
1007
- // todo: refactor single value and single value icon to send payload from viz
1154
+ var _supportedEvents$even = supportedEvents[eventName],
1155
+ parentKeys = _supportedEvents$even.parentKeys,
1156
+ payloadKeys = _supportedEvents$even.payloadKeys;
1157
+ var eventCallbackPropName = (0, lodash_1.camelCase)("on.".concat(eventName)); // todo: refactor single value and single value icon to send payload from viz
1008
1158
  // then remove these lines
1009
- var payloadKeys = supportedEvents[eventName].payloadKeys;
1159
+
1010
1160
  var payload = {};
1161
+
1011
1162
  if (Array.isArray(payloadKeys) && payloadKeys.length) {
1012
1163
  payloadKeys.forEach(function (p) {
1013
1164
  payload[p] = evaluatedOptionsToUse[p];
1014
1165
  });
1015
1166
  }
1167
+
1016
1168
  eventCallbackProps[eventCallbackPropName] = function (ev) {
1017
1169
  if (ev && ev.payload) {
1018
1170
  payload = ev.payload;
1019
1171
  }
1172
+
1020
1173
  return onEventTrigger({
1021
1174
  originalEvent: ev,
1022
1175
  payload: payload,
1023
1176
  type: eventName
1024
1177
  });
1025
1178
  };
1179
+
1180
+ if (parentKeys) {
1181
+ for (var i = parentKeys.length - 1; i >= 0; i -= 1) {
1182
+ var newObject = {};
1183
+ newObject[parentKeys[i]] = eventCallbackProps[eventCallbackPropName];
1184
+ eventCallbackProps[eventCallbackPropName] = newObject;
1185
+ }
1186
+ }
1026
1187
  });
1027
- }
1028
- // compute pure viz props which are not from options
1188
+ } // compute pure viz props which are not from options
1189
+
1190
+
1029
1191
  var computedVizProps = computeVizProps(Object.assign(Object.assign(Object.assign(Object.assign({}, props), evaluatedOptionsToUse), eventCallbackProps), {
1030
1192
  themeFunc: themeFunc
1031
1193
  }));
@@ -1043,15 +1205,19 @@ var withDashboardViz = function withDashboardViz(opts) {
1043
1205
  * In future, we could automatically detect which all datasources are being used
1044
1206
  * and bind those magically to pagination/sorting behavior.
1045
1207
  */
1208
+
1046
1209
  var dataSourceMetadata = {};
1047
1210
  var OptionKey = 'paginateDataSourceKey';
1048
1211
  var paginateDataSourceKey = (0, lodash_1.has)(evaluatedOptionsToUse, OptionKey) && evaluatedOptionsToUse[OptionKey] || 'primary';
1212
+
1049
1213
  if (vizConfig.supports.indexOf(VizBehavior_1.VizBehavior.PAGE_AND_SORT) > -1 && (0, lodash_1.has)(dataSources, paginateDataSourceKey)) {
1050
1214
  var requestParams = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'requestParams'], {});
1051
1215
  var meta = (0, lodash_1.get)(dataSources, [paginateDataSourceKey, 'meta'], {});
1216
+
1052
1217
  var handleRequestParamsChange = function handleRequestParamsChange(payload) {
1053
1218
  return onRequestParamsChange(paginateDataSourceKey, payload);
1054
1219
  };
1220
+
1055
1221
  var sortParams = (0, getSorting_1.getSortingParams)({
1056
1222
  requestParams: requestParams,
1057
1223
  meta: meta,
@@ -1066,103 +1232,120 @@ var withDashboardViz = function withDashboardViz(opts) {
1066
1232
  sortParams: sortParams,
1067
1233
  paginatorParams: paginatorParams
1068
1234
  };
1069
- }
1070
- // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1235
+ } // if were using webworkers and this is the first render we dont want to show a viz with missing data so we return null
1236
+
1237
+
1071
1238
  if (useAsyncEvaluatedOptions && Object.keys(evaluatedOptionsToUse).length === 0) {
1072
1239
  return null;
1073
1240
  }
1241
+
1074
1242
  return React.createElement(SanitizedReactViz, Object.assign({
1075
1243
  mode: mode,
1076
1244
  width: width,
1077
1245
  height: height
1078
1246
  }, evaluatedOptionsToUse, computedVizProps, eventCallbackProps, dataSourceMetadata));
1079
1247
  };
1248
+
1080
1249
  DashboardViz.propTypes = Object.assign(Object.assign({}, SplunkVisualization_1.default.propTypes), ReactViz.propTypes);
1081
1250
  DashboardViz.defaultProps = Object.assign(Object.assign(Object.assign({}, SplunkVisualization_1.default.defaultProps), ReactViz.defaultProps), {
1082
1251
  // using withTheme requires component to receive theme prop. In case the consumer did not provide ThemeProvider, a default empty object will prevent warnings.
1083
1252
  theme: {}
1084
- });
1085
- // attach viz config
1086
- DashboardViz.config = vizConfig;
1087
- // @ts-ignore: TODO fix sc upgrade TS issues
1253
+ }); // attach viz config
1254
+
1255
+ DashboardViz.config = vizConfig; // @ts-ignore: TODO fix sc upgrade TS issues
1256
+
1088
1257
  return (0, styled_components_1.withTheme)((0, withPlaceholder_1.default)((0, withEditModeCover_1.default)(DashboardViz, disableEditModeCover), useIconPlaceholder));
1089
1258
  };
1259
+
1090
1260
  exports.default = withDashboardViz;
1091
1261
 
1092
1262
  /***/ }),
1093
- /* 37 */
1263
+ /* 38 */
1094
1264
  /***/ (function(module, exports) {
1095
1265
 
1096
1266
  module.exports = require("@splunk/themes/getSettingsFromThemedProps");
1097
1267
 
1098
1268
  /***/ }),
1099
- /* 38 */
1269
+ /* 39 */
1100
1270
  /***/ (function(module, exports) {
1101
1271
 
1102
1272
  module.exports = require("@splunk/visualizations-shared/SanitizeProps");
1103
1273
 
1104
1274
  /***/ }),
1105
- /* 39 */
1275
+ /* 40 */
1106
1276
  /***/ (function(module, exports) {
1107
1277
 
1108
1278
  module.exports = require("@splunk/moment");
1109
1279
 
1110
1280
  /***/ }),
1111
- /* 40 */
1281
+ /* 41 */
1112
1282
  /***/ (function(module, exports) {
1113
1283
 
1114
1284
  module.exports = require("@splunk/async-dynamic-options-evaluator");
1115
1285
 
1116
1286
  /***/ }),
1117
- /* 41 */
1287
+ /* 42 */
1118
1288
  /***/ (function(module, exports, __webpack_require__) {
1119
1289
 
1120
1290
  "use strict";
1121
1291
 
1122
1292
 
1123
1293
  var _classCallCheck = __webpack_require__(9);
1294
+
1124
1295
  Object.defineProperty(exports, "__esModule", {
1125
1296
  value: true
1126
1297
  });
1127
1298
  exports.INITIAL_HEIGHT = exports.INITIAL_WIDTH = void 0;
1128
1299
  /* eslint-disable react/no-unused-prop-types,react/prefer-stateless-function */
1300
+
1129
1301
  var T = __webpack_require__(0);
1302
+
1130
1303
  var lodash_1 = __webpack_require__(3);
1131
- var VizActionHandler_1 = __webpack_require__(42);
1132
- // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1304
+
1305
+ var VizActionHandler_1 = __webpack_require__(43); // this is identical to the initial height and width we use in BaseVisualization in dashboard-visualizations
1306
+
1307
+
1133
1308
  exports.INITIAL_WIDTH = 250;
1134
1309
  exports.INITIAL_HEIGHT = 250;
1135
1310
  /**
1136
1311
  * A Splunk visualization
1137
1312
  */
1313
+
1138
1314
  var SplunkVisualization = function SplunkVisualization() {
1139
1315
  _classCallCheck(this, SplunkVisualization);
1140
1316
  };
1317
+
1141
1318
  SplunkVisualization.propTypes = {
1142
1319
  /**
1143
1320
  * display mode
1144
1321
  */
1145
1322
  mode: T.oneOf(['view', 'edit', 'export']).isRequired,
1323
+
1146
1324
  /**
1147
1325
  * width in pixel or string, defaults to 100%
1148
1326
  */
1149
1327
  width: T.oneOfType([T.string, T.number]).isRequired,
1328
+
1150
1329
  /**
1151
1330
  * height in pixel or string
1152
1331
  */
1153
1332
  height: T.oneOfType([T.string, T.number]).isRequired,
1333
+
1154
1334
  /**
1155
1335
  * visualization context used for dynamic option evaluation
1156
1336
  */
1157
1337
  context: T.object,
1338
+
1158
1339
  /**
1159
1340
  * visualization formatting options
1160
1341
  */
1161
1342
  options: T.object,
1343
+
1162
1344
  /**
1163
1345
  * A callback to update formatting options
1164
1346
  */
1165
1347
  onOptionsChange: T.func,
1348
+
1166
1349
  /**
1167
1350
  * datasource state which include data and request params, object key indicate the datasource type.
1168
1351
  */
@@ -1171,6 +1354,7 @@ SplunkVisualization.propTypes = {
1171
1354
  * current request params
1172
1355
  */
1173
1356
  requestParams: T.object,
1357
+
1174
1358
  /**
1175
1359
  * current dataset
1176
1360
  */
@@ -1178,6 +1362,7 @@ SplunkVisualization.propTypes = {
1178
1362
  fields: T.array,
1179
1363
  columns: T.array
1180
1364
  }),
1365
+
1181
1366
  /**
1182
1367
  * error
1183
1368
  */
@@ -1185,29 +1370,35 @@ SplunkVisualization.propTypes = {
1185
1370
  level: T.string,
1186
1371
  message: T.string
1187
1372
  }),
1373
+
1188
1374
  /**
1189
1375
  * meta data that came with the dataset
1190
1376
  */
1191
1377
  meta: T.object
1192
1378
  })),
1379
+
1193
1380
  /**
1194
1381
  * A callback to trigger event
1195
1382
  */
1196
1383
  onEventTrigger: T.func,
1384
+
1197
1385
  /**
1198
1386
  * Inform viz if there are handlers listening to events
1199
1387
  */
1200
1388
  hasEventHandlers: T.bool,
1389
+
1201
1390
  /**
1202
1391
  * A callback to communicate computed props to a consumer
1203
1392
  */
1204
1393
  onComputedProps: T.func,
1394
+
1205
1395
  /**
1206
1396
  * A callback to obtain visualization api
1207
1397
  */
1208
1398
  vizActionHandlerRef: T.func,
1209
1399
  loading: T.bool,
1210
1400
  theme: T.object,
1401
+
1211
1402
  /**
1212
1403
  * A callback to request new data with updated request params
1213
1404
  */
@@ -1216,6 +1407,7 @@ SplunkVisualization.propTypes = {
1216
1407
  /**
1217
1408
  *
1218
1409
  */
1410
+
1219
1411
  SplunkVisualization.defaultProps = {
1220
1412
  // BaseVisualization in dashboard-visualizations uses 100% for width but 250 for height
1221
1413
  width: '100%',
@@ -1243,26 +1435,29 @@ SplunkVisualization.defaultProps = {
1243
1435
  exports.default = SplunkVisualization;
1244
1436
 
1245
1437
  /***/ }),
1246
- /* 42 */
1438
+ /* 43 */
1247
1439
  /***/ (function(module, exports, __webpack_require__) {
1248
1440
 
1249
1441
  "use strict";
1250
1442
 
1251
1443
 
1252
1444
  var _classCallCheck = __webpack_require__(9);
1445
+
1253
1446
  var _createClass = __webpack_require__(18);
1447
+
1254
1448
  Object.defineProperty(exports, "__esModule", {
1255
1449
  value: true
1256
1450
  });
1257
1451
  exports.DefaultVizActionHandler = void 0;
1452
+
1258
1453
  var DefaultVizActionHandler = /*#__PURE__*/function () {
1259
1454
  function DefaultVizActionHandler() {
1260
1455
  _classCallCheck(this, DefaultVizActionHandler);
1261
1456
  }
1457
+
1262
1458
  _createClass(DefaultVizActionHandler, [{
1263
1459
  key: "focus",
1264
- value: function focus() {
1265
- // noop
1460
+ value: function focus() {// noop
1266
1461
  }
1267
1462
  }, {
1268
1463
  key: "snapshot",
@@ -1270,22 +1465,11 @@ var DefaultVizActionHandler = /*#__PURE__*/function () {
1270
1465
  return null; // noop
1271
1466
  }
1272
1467
  }]);
1468
+
1273
1469
  return DefaultVizActionHandler;
1274
1470
  }();
1275
- exports.DefaultVizActionHandler = DefaultVizActionHandler;
1276
-
1277
- /***/ }),
1278
- /* 43 */
1279
- /***/ (function(module, exports, __webpack_require__) {
1280
-
1281
- "use strict";
1282
-
1283
1471
 
1284
- Object.defineProperty(exports, "__esModule", {
1285
- value: true
1286
- });
1287
- exports.validSortDirs = void 0;
1288
- exports.validSortDirs = ['asc', 'desc', 'none'];
1472
+ exports.DefaultVizActionHandler = DefaultVizActionHandler;
1289
1473
 
1290
1474
  /***/ }),
1291
1475
  /* 44 */
@@ -1298,7 +1482,9 @@ Object.defineProperty(exports, "__esModule", {
1298
1482
  value: true
1299
1483
  });
1300
1484
  exports.useDeepMemo = void 0;
1485
+
1301
1486
  var react_1 = __webpack_require__(1);
1487
+
1302
1488
  var lodash_1 = __webpack_require__(3);
1303
1489
  /**
1304
1490
  * This hook evaluates and stores the result of a passed function and only
@@ -1313,16 +1499,21 @@ var lodash_1 = __webpack_require__(3);
1313
1499
  * @param fn the function to be executed and
1314
1500
  * @param dependencies an array of dependencies
1315
1501
  */
1502
+
1503
+
1316
1504
  var useDeepMemo = function useDeepMemo(fn, dependencies) {
1317
1505
  var ref = (0, react_1.useRef)();
1506
+
1318
1507
  if (!ref.current || !(0, lodash_1.isEqual)(dependencies, ref.current.dependencies)) {
1319
1508
  ref.current = {
1320
1509
  dependencies: dependencies,
1321
1510
  value: fn()
1322
1511
  };
1323
1512
  }
1513
+
1324
1514
  return ref.current.value;
1325
1515
  };
1516
+
1326
1517
  exports.useDeepMemo = useDeepMemo;
1327
1518
 
1328
1519
  /***/ }),
@@ -1336,19 +1527,27 @@ Object.defineProperty(exports, "__esModule", {
1336
1527
  value: true
1337
1528
  });
1338
1529
  exports.MissingPropsMessage = exports.missingKeys = exports.isMissing = void 0;
1530
+
1339
1531
  var React = __webpack_require__(1);
1532
+
1340
1533
  var T = __webpack_require__(0);
1534
+
1341
1535
  var i18n_1 = __webpack_require__(2);
1536
+
1342
1537
  var Message_1 = __webpack_require__(10);
1538
+
1343
1539
  var FixedSizeContainer_1 = __webpack_require__(13);
1344
1540
  /**
1345
1541
  * @method isMissing
1346
1542
  * @param {any} v
1347
1543
  * @returns {boolean} true if the input value === null or undefined
1348
1544
  */
1545
+
1546
+
1349
1547
  var isMissing = function isMissing(v) {
1350
1548
  return v === null || v === undefined;
1351
1549
  };
1550
+
1352
1551
  exports.isMissing = isMissing;
1353
1552
  /**
1354
1553
  * @method misskingKeys
@@ -1356,11 +1555,13 @@ exports.isMissing = isMissing;
1356
1555
  * @param {object} target
1357
1556
  * @returns {string[]} the keys of missing required props
1358
1557
  */
1558
+
1359
1559
  var missingKeys = function missingKeys(keys, target) {
1360
1560
  return keys.filter(function (k) {
1361
1561
  return (0, exports.isMissing)(target[k]);
1362
1562
  });
1363
1563
  };
1564
+
1364
1565
  exports.missingKeys = missingKeys;
1365
1566
  var propTypes = {
1366
1567
  width: T.oneOfType([T.string, T.number]),
@@ -1374,10 +1575,11 @@ var propTypes = {
1374
1575
  * @param {MissingPropsProps} props
1375
1576
  * @returns {React.ReactElement}
1376
1577
  */
1578
+
1377
1579
  var MissingPropsMessage = function MissingPropsMessage(props) {
1378
1580
  var width = props.width,
1379
- height = props.height,
1380
- missingProps = props.missingProps;
1581
+ height = props.height,
1582
+ missingProps = props.missingProps;
1381
1583
  return React.createElement(Message_1.default, {
1382
1584
  "data-test": "message",
1383
1585
  width: width,
@@ -1385,6 +1587,7 @@ var MissingPropsMessage = function MissingPropsMessage(props) {
1385
1587
  message: (0, i18n_1._)("Missing property: ".concat(missingProps.join(', ')))
1386
1588
  });
1387
1589
  };
1590
+
1388
1591
  exports.MissingPropsMessage = MissingPropsMessage;
1389
1592
  exports.MissingPropsMessage.propTypes = propTypes;
1390
1593
  exports.MissingPropsMessage.defaultProps = {
@@ -1403,15 +1606,19 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.MissingPropsMessage)
1403
1606
  Object.defineProperty(exports, "__esModule", {
1404
1607
  value: true
1405
1608
  });
1609
+
1406
1610
  var React = __webpack_require__(1);
1611
+
1407
1612
  var styled_components_1 = __webpack_require__(4);
1613
+
1408
1614
  var hocUtils_1 = __webpack_require__(15);
1615
+
1409
1616
  var Cover = styled_components_1.default.div.withConfig({
1410
1617
  displayName: "withEditModeCover__Cover",
1411
1618
  componentId: "sc-1gsbnxb-0"
1412
1619
  })(["position:absolute;left:0;right:0;top:0;bottom:0;"]);
1413
1620
  var Blocker = styled_components_1.default.div.attrs({
1414
- 'data-splunk-visualization-version': "26.0.0 - 2f7458907"
1621
+ 'data-splunk-visualization-version': "26.1.1 - b6df0a015"
1415
1622
  }).withConfig({
1416
1623
  displayName: "withEditModeCover__Blocker",
1417
1624
  componentId: "sc-1gsbnxb-1"
@@ -1422,6 +1629,7 @@ var Blocker = styled_components_1.default.div.attrs({
1422
1629
  * @param {ExtendedDashViz} Visualization
1423
1630
  * @returns {ExtendedDashViz} Wrapper
1424
1631
  */
1632
+
1425
1633
  var withEditModeCover = function withEditModeCover(Visualization, disableEditModeCover) {
1426
1634
  var Wrapper = function Wrapper(props) {
1427
1635
  var mode = props.mode;
@@ -1430,12 +1638,14 @@ var withEditModeCover = function withEditModeCover(Visualization, disableEditMod
1430
1638
  "data-test": "edit-mode-cover"
1431
1639
  }));
1432
1640
  };
1641
+
1433
1642
  (0, hocUtils_1.extendStaticWrapperProps)({
1434
1643
  Wrapper: Wrapper,
1435
1644
  Visualization: Visualization
1436
1645
  });
1437
1646
  return Wrapper;
1438
1647
  };
1648
+
1439
1649
  exports.default = withEditModeCover;
1440
1650
 
1441
1651
  /***/ }),
@@ -1448,27 +1658,37 @@ exports.default = withEditModeCover;
1448
1658
  Object.defineProperty(exports, "__esModule", {
1449
1659
  value: true
1450
1660
  });
1661
+
1451
1662
  var React = __webpack_require__(1);
1663
+
1452
1664
  var colorUtils_1 = __webpack_require__(12);
1665
+
1453
1666
  var variables_1 = __webpack_require__(11);
1667
+
1454
1668
  var IconPlaceholder_1 = __webpack_require__(32);
1669
+
1455
1670
  var VizBehavior_1 = __webpack_require__(6);
1671
+
1456
1672
  var hocUtils_1 = __webpack_require__(15);
1673
+
1457
1674
  var withPlaceholder = function withPlaceholder(Visualization) {
1458
1675
  var useIconPlaceholder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : IconPlaceholder_1.shouldShowIconPlaceholder;
1459
1676
  var config = Visualization.config;
1460
1677
  var themes = config.themes;
1678
+
1461
1679
  var Wrapper = function Wrapper(props) {
1462
1680
  var _a, _b;
1681
+
1463
1682
  var dataSources = props.dataSources,
1464
- loading = props.loading,
1465
- options = props.options,
1466
- height = props.height,
1467
- width = props.width;
1683
+ loading = props.loading,
1684
+ options = props.options,
1685
+ height = props.height,
1686
+ width = props.width;
1468
1687
  var showPlaceholder = useIconPlaceholder(dataSources, loading, options);
1469
1688
  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);
1470
1689
  var icon = (_b = config.placeholderIcon) !== null && _b !== void 0 ? _b : config.icon;
1471
1690
  var iconColor = variables_1.default.contentColorActive(props);
1691
+
1472
1692
  if (config.supports.includes(VizBehavior_1.VizBehavior.PLACEHOLDER) && showPlaceholder) {
1473
1693
  return React.createElement(IconPlaceholder_1.default, {
1474
1694
  "data-test": "icon-placeholder",
@@ -1479,14 +1699,17 @@ var withPlaceholder = function withPlaceholder(Visualization) {
1479
1699
  iconColor: iconColor
1480
1700
  });
1481
1701
  }
1702
+
1482
1703
  return React.createElement(Visualization, Object.assign({}, props));
1483
1704
  };
1705
+
1484
1706
  (0, hocUtils_1.extendStaticWrapperProps)({
1485
1707
  Wrapper: Wrapper,
1486
1708
  Visualization: Visualization
1487
1709
  });
1488
1710
  return Wrapper;
1489
1711
  };
1712
+
1490
1713
  exports.default = withPlaceholder;
1491
1714
 
1492
1715
  /***/ }),
@@ -1633,33 +1856,40 @@ module.exports = require("@splunk/react-ui/Button");
1633
1856
 
1634
1857
 
1635
1858
  var _toConsumableArray = __webpack_require__(8);
1859
+
1636
1860
  Object.defineProperty(exports, "__esModule", {
1637
1861
  value: true
1638
1862
  });
1639
1863
  exports.getSecondaryColumnByField = exports.sortGraphColumn = exports.getNodesToHighlight = exports.createLinkGraphFromTable = exports.OFFSET_Y = exports.hashString = void 0;
1864
+
1640
1865
  var lodash_1 = __webpack_require__(3);
1866
+
1641
1867
  var hashString = function hashString() {
1642
1868
  var stringIn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
1643
1869
  var returnStringArray = stringIn.toString().split('').map(function (v) {
1644
1870
  return v.charCodeAt(0);
1645
1871
  });
1872
+
1646
1873
  if (returnStringArray.length === 0) {
1647
1874
  return '-1';
1648
1875
  }
1649
- var returnValue =
1650
- // eslint-disable-next-line no-bitwise
1876
+
1877
+ var returnValue = // eslint-disable-next-line no-bitwise
1651
1878
  returnStringArray.reduce(function (a, v) {
1652
1879
  return a + ((a << 7) + (a << 3)) ^ v;
1653
1880
  }).toString(16);
1654
1881
  return returnValue;
1655
1882
  };
1883
+
1656
1884
  exports.hashString = hashString;
1885
+
1657
1886
  var createNode = function createNode(graphDataModelIn, nodesIn, column, field, fieldIndex, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, shouldAddToGraphDataModel) {
1658
1887
  var nodes = nodesIn;
1659
1888
  var graphDataModel = graphDataModelIn;
1660
1889
  var fieldHash = (0, exports.hashString)(field);
1661
1890
  var columnHash = (0, exports.hashString)(column);
1662
1891
  var node = nodes[columnHash];
1892
+
1663
1893
  if (!nodes[columnHash]) {
1664
1894
  node = {
1665
1895
  x: 0,
@@ -1678,10 +1908,13 @@ var createNode = function createNode(graphDataModelIn, nodesIn, column, field, f
1678
1908
  } else {
1679
1909
  node.data.count += 1;
1680
1910
  }
1911
+
1681
1912
  if (column.toString().length === 0) {
1682
1913
  node.data.isHidden = true;
1683
1914
  }
1915
+
1684
1916
  var key = "".concat(fieldIndex, "-").concat(fieldHash, "-").concat(columnHash);
1917
+
1685
1918
  if (shouldAddToGraphDataModel && !graphDataModel.nodes[key]) {
1686
1919
  nodes[columnHash] = node;
1687
1920
  graphDataModel.nodes[key] = node;
@@ -1691,17 +1924,21 @@ var createNode = function createNode(graphDataModelIn, nodesIn, column, field, f
1691
1924
  node.h = nodeHeight;
1692
1925
  node.yIndex = Object.keys(nodes).length - 1;
1693
1926
  }
1927
+
1694
1928
  return node;
1695
1929
  };
1930
+
1696
1931
  var createEdge = function createEdge(graphDataModelIn, nodesIn, edgesIn, nodeIn, columns, column, columnIndex, fields, field, fieldIndex, shouldAddToGraphDataModel) {
1697
1932
  if (!shouldAddToGraphDataModel) {
1698
1933
  return;
1699
1934
  }
1935
+
1700
1936
  var node = nodeIn;
1701
1937
  var edges = edgesIn;
1702
1938
  var fieldHash = (0, exports.hashString)(field);
1703
1939
  var columnHash = (0, exports.hashString)(column);
1704
1940
  var graphDataModel = graphDataModelIn;
1941
+
1705
1942
  if (columns[fieldIndex + 1]) {
1706
1943
  var sourceNode = "".concat(fieldIndex, "-").concat(fieldHash, "-").concat(columnHash);
1707
1944
  var nextColumnOverContent = columns[fieldIndex + 1][columnIndex];
@@ -1713,13 +1950,16 @@ var createEdge = function createEdge(graphDataModelIn, nodesIn, edgesIn, nodeIn,
1713
1950
  node.data.outs["".concat(columnHash, "-").concat((0, exports.hashString)(columns[fieldIndex + 1][columnIndex]))] = edge;
1714
1951
  edges["".concat(edge.sourceNode, "-").concat(edge.targetNode)] = edge;
1715
1952
  }
1953
+
1716
1954
  var fieldToUpdate = graphDataModel.fields.find(function (fieldInQuestion) {
1717
1955
  return (0, exports.hashString)(fieldInQuestion.value) === fieldHash;
1718
1956
  });
1957
+
1719
1958
  if (fieldToUpdate) {
1720
1959
  fieldToUpdate.count = Object.keys(nodesIn).length;
1721
1960
  }
1722
1961
  };
1962
+
1723
1963
  exports.OFFSET_Y = 35;
1724
1964
  /**
1725
1965
  *
@@ -1740,6 +1980,7 @@ exports.OFFSET_Y = 35;
1740
1980
  * look to the right one column, create an edge
1741
1981
  * look to the left one column, create an edge
1742
1982
  */
1983
+
1743
1984
  var createLinkGraphFromTable = function createLinkGraphFromTable(fieldsIn, columnsIn, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, resultLimit, fieldOrder) {
1744
1985
  var nodes = {};
1745
1986
  var edges = {};
@@ -1748,19 +1989,23 @@ var createLinkGraphFromTable = function createLinkGraphFromTable(fieldsIn, colum
1748
1989
  edges: [],
1749
1990
  fields: []
1750
1991
  };
1992
+
1751
1993
  if (!fieldsIn || !Array.isArray(fieldsIn) || !columnsIn || !Array.isArray(columnsIn)) {
1752
1994
  return graphDataModel;
1753
1995
  }
1996
+
1754
1997
  var fields = fieldsIn;
1755
1998
  var columns = columnsIn;
1999
+
1756
2000
  if (fieldOrder.length) {
1757
2001
  fields = fieldOrder;
1758
2002
  columns = [];
1759
2003
  fields.forEach(function (fieldIn, fieldIndex) {
1760
2004
  columns[fieldIndex] = columnsIn[fieldsIn.indexOf(fieldIn)];
1761
2005
  });
1762
- }
1763
- // eslint-disable-next-line consistent-return
2006
+ } // eslint-disable-next-line consistent-return
2007
+
2008
+
1764
2009
  fields.forEach(function (fieldIn, fieldIndex) {
1765
2010
  var field = (0, exports.hashString)(fieldIn);
1766
2011
  nodes[field] = {
@@ -1770,9 +2015,11 @@ var createLinkGraphFromTable = function createLinkGraphFromTable(fieldsIn, colum
1770
2015
  count: 0,
1771
2016
  value: fieldIn
1772
2017
  });
2018
+
1773
2019
  if (!columns[fieldIndex]) {
1774
2020
  return graphDataModel;
1775
2021
  }
2022
+
1776
2023
  columns[fieldIndex].forEach(function (columnIn, columnIndex) {
1777
2024
  var shouldAddToGraphDataModel = Object.keys(nodes[field].nodes).length < resultLimit;
1778
2025
  var node = createNode(graphDataModel, nodes[field].nodes, columnIn, fieldIn, fieldIndex, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, shouldAddToGraphDataModel);
@@ -1780,15 +2027,16 @@ var createLinkGraphFromTable = function createLinkGraphFromTable(fieldsIn, colum
1780
2027
  });
1781
2028
  });
1782
2029
  graphDataModel.edges = Object.values(edges);
1783
- graphDataModel.columns = columns;
1784
- // hide all edges that go to or from a hidden node
2030
+ graphDataModel.columns = columns; // hide all edges that go to or from a hidden node
2031
+
1785
2032
  var edgeTemp;
1786
2033
  graphDataModel.edges.forEach(function (edge) {
1787
2034
  var _a, _b, _c, _d;
2035
+
1788
2036
  if (((_b = (_a = graphDataModel.nodes[edge.sourceNode]) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.isHidden) || ((_d = (_c = graphDataModel.nodes[edge.targetNode]) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.isHidden)) {
1789
2037
  edgeTemp = edge;
1790
- edgeTemp.isHidden = true;
1791
- // show all paths from hidden nodes across the real data
2038
+ edgeTemp.isHidden = true; // show all paths from hidden nodes across the real data
2039
+
1792
2040
  getAllPathsFromNodeID(graphDataModel, graphDataModel.nodes[edge.sourceNode]).edges.forEach(function (edgeToShowTemp) {
1793
2041
  var edgeToShow = edgeToShowTemp;
1794
2042
  edgeToShow.isHidden = false;
@@ -1797,6 +2045,7 @@ var createLinkGraphFromTable = function createLinkGraphFromTable(fieldsIn, colum
1797
2045
  });
1798
2046
  return graphDataModel;
1799
2047
  };
2048
+
1800
2049
  exports.createLinkGraphFromTable = createLinkGraphFromTable;
1801
2050
  /* getAllPathsFromNodeID gets paths from a node via the data and not the graph
1802
2051
 
@@ -1811,33 +2060,40 @@ a, , c
1811
2060
 
1812
2061
  getAllPathsFromNodeID(graph, a) would return nodes a,b,'',c and edges a-b, b-c, a-'', ''-c
1813
2062
  */
2063
+
1814
2064
  var getAllPathsFromNodeID = function getAllPathsFromNodeID(graphDataModel, node) {
1815
2065
  var newEdges = [];
1816
2066
  var nodes = [];
2067
+
1817
2068
  if (!node) {
1818
2069
  return {
1819
2070
  nodes: [],
1820
2071
  edges: []
1821
2072
  };
1822
2073
  }
2074
+
1823
2075
  graphDataModel.columns[node.data.fieldIndex].forEach(function (value, index) {
1824
2076
  if (value === node.data.value) {
1825
2077
  var row = graphDataModel.columns.map(function (column) {
1826
2078
  return column[index];
1827
- });
1828
- // remove blank spaces from the start of the array
2079
+ }); // remove blank spaces from the start of the array
2080
+
1829
2081
  var offset = 0;
2082
+
1830
2083
  while (row[0] === '') {
1831
2084
  row.shift();
1832
2085
  offset += 1;
1833
- }
1834
- // remove blank spaces from the end of the array
2086
+ } // remove blank spaces from the end of the array
2087
+
2088
+
1835
2089
  while (row[row.length - 1] === '') {
1836
2090
  row.pop();
1837
2091
  }
2092
+
1838
2093
  for (var i = 0; i < row.length - 1; i += 1) {
1839
2094
  if (graphDataModel.fields[i + 1]) {
1840
2095
  var fieldIndexStart = offset + i; // this is field.index not i
2096
+
1841
2097
  var fieldHashStart = (0, exports.hashString)(graphDataModel.fields[offset + i].value);
1842
2098
  var columnHashStart = (0, exports.hashString)(row[i]);
1843
2099
  var fieldIndexEnd = offset + i + 1;
@@ -1866,6 +2122,7 @@ var getAllPathsFromNodeID = function getAllPathsFromNodeID(graphDataModel, node)
1866
2122
  edges: edges
1867
2123
  };
1868
2124
  };
2125
+
1869
2126
  var getNodesToHighlight = function getNodesToHighlight(graph, sourceNodeID) {
1870
2127
  var paths = getAllPathsFromNodeID(graph, graph.nodes[sourceNodeID]);
1871
2128
  var newEdges = paths.edges.map(function (edge) {
@@ -1876,8 +2133,9 @@ var getNodesToHighlight = function getNodesToHighlight(graph, sourceNodeID) {
1876
2133
  edges: newEdges
1877
2134
  };
1878
2135
  };
1879
- exports.getNodesToHighlight = getNodesToHighlight;
1880
- // TODO: write tests once all sorting options are supported
2136
+
2137
+ exports.getNodesToHighlight = getNodesToHighlight; // TODO: write tests once all sorting options are supported
2138
+
1881
2139
  var sortGraphColumn = function sortGraphColumn(graph, field, sortKey, nodeHeight, nodeSpacingY) {
1882
2140
  var nodesToSort = Object.values(graph.nodes).filter(function (node) {
1883
2141
  return node.data.field === field;
@@ -1885,19 +2143,24 @@ var sortGraphColumn = function sortGraphColumn(graph, field, sortKey, nodeHeight
1885
2143
  var nodes = (0, lodash_1.sortBy)(nodesToSort, function (node) {
1886
2144
  return node.data.value;
1887
2145
  });
2146
+
1888
2147
  if (sortKey === 'Z-A') {
1889
2148
  nodes.reverse();
1890
2149
  }
2150
+
1891
2151
  nodes.forEach(function (node, index) {
1892
2152
  var currentNode = node;
1893
2153
  currentNode.y = index * nodeHeight + index * nodeSpacingY + exports.OFFSET_Y;
1894
2154
  });
1895
2155
  };
2156
+
1896
2157
  exports.sortGraphColumn = sortGraphColumn;
2158
+
1897
2159
  var getSecondaryColumnByField = function getSecondaryColumnByField(field, metadataFields, metadataColumns) {
1898
2160
  if (!metadataFields || !metadataColumns) {
1899
2161
  return {};
1900
2162
  }
2163
+
1901
2164
  var fieldIndex = metadataFields.findIndex(function (fieldIn) {
1902
2165
  return fieldIn.name === 'node_value';
1903
2166
  });
@@ -1908,6 +2171,7 @@ var getSecondaryColumnByField = function getSecondaryColumnByField(field, metada
1908
2171
  });
1909
2172
  return returnObject;
1910
2173
  };
2174
+
1911
2175
  exports.getSecondaryColumnByField = getSecondaryColumnByField;
1912
2176
 
1913
2177
  /***/ }),
@@ -1942,7 +2206,8 @@ module.exports = require("@splunk/react-icons/enterprise/Clear");
1942
2206
  /* 153 */,
1943
2207
  /* 154 */,
1944
2208
  /* 155 */,
1945
- /* 156 */
2209
+ /* 156 */,
2210
+ /* 157 */
1946
2211
  /***/ (function(module, exports, __webpack_require__) {
1947
2212
 
1948
2213
  "use strict";
@@ -1950,50 +2215,66 @@ module.exports = require("@splunk/react-icons/enterprise/Clear");
1950
2215
 
1951
2216
  var __rest = this && this.__rest || function (s, e) {
1952
2217
  var t = {};
2218
+
1953
2219
  for (var p in s) {
1954
2220
  if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
1955
2221
  }
2222
+
1956
2223
  if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
1957
2224
  if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
1958
2225
  }
1959
2226
  return t;
1960
2227
  };
2228
+
1961
2229
  Object.defineProperty(exports, "__esModule", {
1962
2230
  value: true
1963
2231
  });
1964
2232
  exports.PureLinkGraph = exports.LinkGraph = exports.config = exports.themes = exports.computeVizProps = exports.showPlaceHolderIcon = void 0;
2233
+
1965
2234
  var lodash_1 = __webpack_require__(3);
2235
+
1966
2236
  var dataSourceUtils_1 = __webpack_require__(97);
1967
- var withDashboardViz_1 = __webpack_require__(36);
2237
+
2238
+ var withDashboardViz_1 = __webpack_require__(37);
2239
+
1968
2240
  var PureLinkGraph_1 = __webpack_require__(227);
2241
+
1969
2242
  exports.PureLinkGraph = PureLinkGraph_1.default;
2243
+
1970
2244
  var config_1 = __webpack_require__(409);
2245
+
1971
2246
  exports.config = config_1.default;
1972
2247
  /**
1973
2248
  * @method showPlaceHolderIcon
1974
2249
  * @param {Object} dataSources
1975
2250
  * @returns {Boolean} return true if loading, error, non existent state or without columns in dataSources
1976
2251
  */
2252
+
1977
2253
  var showPlaceHolderIcon = function showPlaceHolderIcon(dataSources) {
1978
2254
  var columns = (0, lodash_1.get)(dataSources, 'primary.data.columns', undefined);
1979
2255
  var noColumns = columns === undefined;
1980
2256
  var dataSourceState = (0, dataSourceUtils_1.getDataSourceStateInfo)(dataSources);
1981
2257
  return dataSourceState === dataSourceUtils_1.DataSourceState.ERROR || dataSourceState === dataSourceUtils_1.DataSourceState.LOADING || dataSourceState === dataSourceUtils_1.DataSourceState.NONEXISTENT || noColumns;
1982
2258
  };
2259
+
1983
2260
  exports.showPlaceHolderIcon = showPlaceHolderIcon;
2261
+
1984
2262
  var computeVizProps = function computeVizProps(_a) {
1985
2263
  var _b, _c, _d, _e, _f, _g;
2264
+
1986
2265
  var themeFunc = _a.themeFunc,
1987
- props = __rest(_a, ["themeFunc"]);
2266
+ props = __rest(_a, ["themeFunc"]);
2267
+
1988
2268
  var themeColorVariables = ['defaultBackgroundColor', 'defaultLinkColor', 'defaultNodeColor'];
1989
2269
  var themeColors = {};
1990
2270
  themeColorVariables.forEach(function (variable) {
1991
2271
  themeColors[variable] = themeFunc(variable);
1992
2272
  });
2273
+
1993
2274
  if (props.dataSources) {
1994
2275
  var _props$dataSources$pr = props.dataSources.primary.data,
1995
- fields = _props$dataSources$pr.fields,
1996
- columns = _props$dataSources$pr.columns;
2276
+ fields = _props$dataSources$pr.fields,
2277
+ columns = _props$dataSources$pr.columns;
1997
2278
  var metadataFields = (_d = (_c = (_b = props === null || props === void 0 ? void 0 : props.dataSources) === null || _b === void 0 ? void 0 : _b.metadata) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.fields;
1998
2279
  var metadataColumns = (_g = (_f = (_e = props === null || props === void 0 ? void 0 : props.dataSources) === null || _e === void 0 ? void 0 : _e.metadata) === null || _f === void 0 ? void 0 : _f.data) === null || _g === void 0 ? void 0 : _g.columns;
1999
2280
  return Object.assign({
@@ -2005,8 +2286,10 @@ var computeVizProps = function computeVizProps(_a) {
2005
2286
  columns: columns
2006
2287
  }, themeColors);
2007
2288
  }
2289
+
2008
2290
  return themeColors;
2009
2291
  };
2292
+
2010
2293
  exports.computeVizProps = computeVizProps;
2011
2294
  var LinkGraph = (0, withDashboardViz_1.default)({
2012
2295
  ReactViz: PureLinkGraph_1.default,
@@ -2022,7 +2305,7 @@ exports.themes = themes;
2022
2305
  exports.default = LinkGraph;
2023
2306
 
2024
2307
  /***/ }),
2025
- /* 157 */
2308
+ /* 158 */
2026
2309
  /***/ (function(module, exports, __webpack_require__) {
2027
2310
 
2028
2311
  "use strict";
@@ -2032,9 +2315,13 @@ Object.defineProperty(exports, "__esModule", {
2032
2315
  value: true
2033
2316
  });
2034
2317
  exports.StyledEdgesPath = exports.StyledViewport = void 0;
2318
+
2035
2319
  var styled_components_1 = __webpack_require__(4);
2320
+
2036
2321
  var pick_1 = __webpack_require__(23);
2322
+
2037
2323
  var variables_1 = __webpack_require__(11);
2324
+
2038
2325
  exports.StyledViewport = styled_components_1.default.div.withConfig({
2039
2326
  displayName: "GraphStyles__StyledViewport",
2040
2327
  componentId: "sc-5hdhcf-0"
@@ -2091,7 +2378,6 @@ exports.StyledEdgesPath = styled_components_1.default.path.withConfig({
2091
2378
  });
2092
2379
 
2093
2380
  /***/ }),
2094
- /* 158 */,
2095
2381
  /* 159 */,
2096
2382
  /* 160 */,
2097
2383
  /* 161 */,
@@ -2168,6 +2454,7 @@ exports.StyledEdgesPath = styled_components_1.default.path.withConfig({
2168
2454
  var __createBinding = this && this.__createBinding || (Object.create ? function (o, m, k, k2) {
2169
2455
  if (k2 === undefined) k2 = k;
2170
2456
  var desc = Object.getOwnPropertyDescriptor(m, k);
2457
+
2171
2458
  if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
2172
2459
  desc = {
2173
2460
  enumerable: true,
@@ -2176,22 +2463,28 @@ var __createBinding = this && this.__createBinding || (Object.create ? function
2176
2463
  }
2177
2464
  };
2178
2465
  }
2466
+
2179
2467
  Object.defineProperty(o, k2, desc);
2180
2468
  } : function (o, m, k, k2) {
2181
2469
  if (k2 === undefined) k2 = k;
2182
2470
  o[k2] = m[k];
2183
2471
  });
2472
+
2184
2473
  var __exportStar = this && this.__exportStar || function (m, exports) {
2185
2474
  for (var p in m) {
2186
2475
  if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
2187
2476
  }
2188
2477
  };
2478
+
2189
2479
  Object.defineProperty(exports, "__esModule", {
2190
2480
  value: true
2191
2481
  });
2192
2482
  exports.default = void 0;
2193
- __exportStar(__webpack_require__(156), exports);
2194
- var LinkGraph_1 = __webpack_require__(156);
2483
+
2484
+ __exportStar(__webpack_require__(157), exports);
2485
+
2486
+ var LinkGraph_1 = __webpack_require__(157);
2487
+
2195
2488
  Object.defineProperty(exports, "default", {
2196
2489
  enumerable: true,
2197
2490
  get: function get() {
@@ -2207,19 +2500,30 @@ Object.defineProperty(exports, "default", {
2207
2500
 
2208
2501
 
2209
2502
  var _slicedToArray = __webpack_require__(17);
2503
+
2210
2504
  Object.defineProperty(exports, "__esModule", {
2211
2505
  value: true
2212
2506
  });
2213
2507
  exports.PureLinkGraph = void 0;
2508
+
2214
2509
  var React = __webpack_require__(1);
2510
+
2215
2511
  var T = __webpack_require__(0);
2512
+
2216
2513
  var styled_components_1 = __webpack_require__(4);
2514
+
2217
2515
  var lodash_1 = __webpack_require__(3);
2516
+
2218
2517
  var FixedSizeContainer_1 = __webpack_require__(13);
2518
+
2219
2519
  var PureLinkGraphUtils_1 = __webpack_require__(129);
2520
+
2220
2521
  var Graph_1 = __webpack_require__(228);
2522
+
2221
2523
  var Field_1 = __webpack_require__(405);
2524
+
2222
2525
  var FieldStyles_1 = __webpack_require__(408);
2526
+
2223
2527
  var LinkGraphContainer = styled_components_1.default.div.withConfig({
2224
2528
  displayName: "PureLinkGraph__LinkGraphContainer",
2225
2529
  componentId: "sc-2wfxi-0"
@@ -2240,31 +2544,32 @@ var LinkGraphWrapper = styled_components_1.default.div.withConfig({
2240
2544
  return (0, lodash_1.get)(props, 'height');
2241
2545
  });
2242
2546
  LinkGraphContainer.displayName = 'LinkGraphContainer';
2547
+
2243
2548
  var PureLinkGraph = function PureLinkGraph(props) {
2244
2549
  var mode = props.mode,
2245
- backgroundColor = props.backgroundColor,
2246
- width = props.width,
2247
- height = props.height,
2248
- fields = props.fields,
2249
- columns = props.columns,
2250
- nodeWidth = props.nodeWidth,
2251
- nodeHeight = props.nodeHeight,
2252
- nodeSpacingX = props.nodeSpacingX,
2253
- nodeSpacingY = props.nodeSpacingY,
2254
- onNodeClick = props.onNodeClick,
2255
- onNodeMouseover = props.onNodeMouseover,
2256
- linkColor = props.linkColor,
2257
- nodeColor = props.nodeColor,
2258
- nodeTextColor = props.nodeTextColor,
2259
- nodeHighlightColor = props.nodeHighlightColor,
2260
- nodeTextHighlightColor = props.nodeTextHighlightColor,
2261
- resultLimit = props.resultLimit,
2262
- linkWidth = props.linkWidth,
2263
- showValueCounts = props.showValueCounts,
2264
- showNodeCounts = props.showNodeCounts,
2265
- fieldOrder = props.fieldOrder,
2266
- metadataFields = props.metadataFields,
2267
- metadataColumns = props.metadataColumns;
2550
+ backgroundColor = props.backgroundColor,
2551
+ width = props.width,
2552
+ height = props.height,
2553
+ fields = props.fields,
2554
+ columns = props.columns,
2555
+ nodeWidth = props.nodeWidth,
2556
+ nodeHeight = props.nodeHeight,
2557
+ nodeSpacingX = props.nodeSpacingX,
2558
+ nodeSpacingY = props.nodeSpacingY,
2559
+ onNodeClick = props.onNodeClick,
2560
+ onNodeMouseover = props.onNodeMouseover,
2561
+ linkColor = props.linkColor,
2562
+ nodeColor = props.nodeColor,
2563
+ nodeTextColor = props.nodeTextColor,
2564
+ nodeHighlightColor = props.nodeHighlightColor,
2565
+ nodeTextHighlightColor = props.nodeTextHighlightColor,
2566
+ resultLimit = props.resultLimit,
2567
+ linkWidth = props.linkWidth,
2568
+ showValueCounts = props.showValueCounts,
2569
+ showNodeCounts = props.showNodeCounts,
2570
+ fieldOrder = props.fieldOrder,
2571
+ metadataFields = props.metadataFields,
2572
+ metadataColumns = props.metadataColumns;
2268
2573
  /*
2269
2574
  value / setValue is here so we can modify graphDataModelState directly and
2270
2575
  force a rerender, as opposed to making a copy of graphDataModelState and
@@ -2272,22 +2577,27 @@ var PureLinkGraph = function PureLinkGraph(props) {
2272
2577
  I will make sure to test this in a UDF context to make sure there is no data loss
2273
2578
  or incorrect rendering ( and will then remove this last comment or address later on )
2274
2579
  */
2580
+
2275
2581
  var _React$useState = React.useState(0),
2276
- _React$useState2 = _slicedToArray(_React$useState, 2),
2277
- value = _React$useState2[0],
2278
- setValue = _React$useState2[1];
2582
+ _React$useState2 = _slicedToArray(_React$useState, 2),
2583
+ value = _React$useState2[0],
2584
+ setValue = _React$useState2[1];
2585
+
2279
2586
  var _React$useState3 = React.useState((0, PureLinkGraphUtils_1.createLinkGraphFromTable)(fields, columns, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, resultLimit, fieldOrder)),
2280
- _React$useState4 = _slicedToArray(_React$useState3, 2),
2281
- graphDataModelState = _React$useState4[0],
2282
- setGraphDataModelState = _React$useState4[1];
2587
+ _React$useState4 = _slicedToArray(_React$useState3, 2),
2588
+ graphDataModelState = _React$useState4[0],
2589
+ setGraphDataModelState = _React$useState4[1];
2590
+
2283
2591
  React.useEffect(function () {
2284
2592
  setGraphDataModelState((0, PureLinkGraphUtils_1.createLinkGraphFromTable)(fields, columns, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, resultLimit, fieldOrder));
2285
2593
  }, [fields, columns, nodeWidth, nodeHeight, nodeSpacingX, nodeSpacingY, resultLimit, fieldOrder]);
2594
+
2286
2595
  var handleFieldSort = function handleFieldSort(field, sortKey) {
2287
2596
  (0, PureLinkGraphUtils_1.sortGraphColumn)(graphDataModelState, field, sortKey, nodeHeight, nodeSpacingY);
2288
2597
  setGraphDataModelState(graphDataModelState);
2289
2598
  setValue(value + 1);
2290
2599
  };
2600
+
2291
2601
  return React.createElement(LinkGraphWrapper, {
2292
2602
  backgroundColor: backgroundColor,
2293
2603
  height: height,
@@ -2326,6 +2636,7 @@ var PureLinkGraph = function PureLinkGraph(props) {
2326
2636
  });
2327
2637
  }))));
2328
2638
  };
2639
+
2329
2640
  exports.PureLinkGraph = PureLinkGraph;
2330
2641
  exports.PureLinkGraph.propTypes = {
2331
2642
  mode: T.string,
@@ -2386,28 +2697,47 @@ exports.default = (0, FixedSizeContainer_1.default)(exports.PureLinkGraph);
2386
2697
 
2387
2698
 
2388
2699
  var _toConsumableArray = __webpack_require__(8);
2700
+
2389
2701
  var _classCallCheck = __webpack_require__(9);
2702
+
2390
2703
  var _createClass = __webpack_require__(18);
2704
+
2391
2705
  var _inherits = __webpack_require__(71);
2706
+
2392
2707
  var _possibleConstructorReturn = __webpack_require__(72);
2708
+
2393
2709
  var _getPrototypeOf = __webpack_require__(63);
2710
+
2394
2711
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
2712
+
2395
2713
  function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2714
+
2396
2715
  Object.defineProperty(exports, "__esModule", {
2397
2716
  value: true
2398
2717
  });
2718
+
2399
2719
  var React = __webpack_require__(1);
2720
+
2400
2721
  var lodash_1 = __webpack_require__(3);
2722
+
2401
2723
  var Edges_1 = __webpack_require__(229);
2724
+
2402
2725
  var Nodes_1 = __webpack_require__(230);
2403
- var GraphStyles_1 = __webpack_require__(157);
2726
+
2727
+ var GraphStyles_1 = __webpack_require__(158);
2728
+
2404
2729
  var PureLinkGraphUtils_1 = __webpack_require__(129);
2730
+
2405
2731
  var Graph = /*#__PURE__*/function (_React$Component) {
2406
2732
  _inherits(Graph, _React$Component);
2733
+
2407
2734
  var _super = _createSuper(Graph);
2735
+
2408
2736
  function Graph(props) {
2409
2737
  var _this;
2738
+
2410
2739
  _classCallCheck(this, Graph);
2740
+
2411
2741
  _this = _super.call(this, props);
2412
2742
  _this.requestAnimationFrameId = null;
2413
2743
  _this.viewport = null;
@@ -2417,11 +2747,14 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2417
2747
  highlightedNodes: [],
2418
2748
  hasMounted: false
2419
2749
  };
2750
+
2420
2751
  _this.handleNodeMouseover = function (k) {
2421
2752
  return _this.props.onNodeMouseover(k);
2422
2753
  };
2754
+
2423
2755
  return _this;
2424
2756
  }
2757
+
2425
2758
  _createClass(Graph, [{
2426
2759
  key: "componentDidMount",
2427
2760
  value: function componentDidMount() {
@@ -2433,6 +2766,7 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2433
2766
  key: "componentDidUpdate",
2434
2767
  value: function componentDidUpdate() {
2435
2768
  var _this2 = this;
2769
+
2436
2770
  var highlightedNodes = this.state.highlightedNodes;
2437
2771
  cancelAnimationFrame(this.requestAnimationFrameId);
2438
2772
  this.highlightAllEdges();
@@ -2451,16 +2785,21 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2451
2785
  key: "handleMouseEnterNode",
2452
2786
  value: function handleMouseEnterNode(nodeID) {
2453
2787
  var _this3 = this;
2788
+
2454
2789
  this.unhighlightAllEdges();
2790
+
2455
2791
  var _ref = (0, PureLinkGraphUtils_1.getNodesToHighlight)(this.props.graphDataModel, nodeID),
2456
- nodes = _ref.nodes,
2457
- edges = _ref.edges;
2792
+ nodes = _ref.nodes,
2793
+ edges = _ref.edges;
2794
+
2458
2795
  edges.forEach(function (e) {
2459
2796
  var element = _this3.viewport.querySelector("[data-test=\"edge-".concat(e, "\"]"));
2797
+
2460
2798
  element.classList.add('hovering');
2461
2799
  });
2462
2800
  nodes.forEach(function (uuid) {
2463
2801
  var element = _this3.viewport.querySelector("[data-test=\"node-".concat(uuid, "\"]"));
2802
+
2464
2803
  element.classList.add('hovering');
2465
2804
  });
2466
2805
  }
@@ -2468,10 +2807,13 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2468
2807
  key: "handleMouseLeave",
2469
2808
  value: function handleMouseLeave() {
2470
2809
  var _this4 = this;
2810
+
2471
2811
  var highlightedNodes = this.state.highlightedNodes;
2812
+
2472
2813
  _toConsumableArray(this.viewport.getElementsByClassName('hovering')[Symbol.iterator]()).forEach(function (ele) {
2473
2814
  ele.classList.remove('hovering');
2474
2815
  });
2816
+
2475
2817
  highlightedNodes.forEach(function (value) {
2476
2818
  _this4.handleMouseEnterNode(value);
2477
2819
  });
@@ -2481,14 +2823,18 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2481
2823
  key: "handleMouseClick",
2482
2824
  value: function handleMouseClick(key) {
2483
2825
  var _this5 = this;
2826
+
2484
2827
  var onNodeClick = this.props.onNodeClick;
2485
2828
  var _this$state = this.state,
2486
- nodes = _this$state.nodes,
2487
- highlightedNodes = _this$state.highlightedNodes;
2829
+ nodes = _this$state.nodes,
2830
+ highlightedNodes = _this$state.highlightedNodes;
2831
+
2488
2832
  var newHighlightedNodes = _toConsumableArray(highlightedNodes);
2833
+
2489
2834
  var index = newHighlightedNodes.indexOf(key);
2490
2835
  var element = this.viewport.querySelector("[data-test=\"node-".concat(key, "\"]"));
2491
2836
  var state = false;
2837
+
2492
2838
  if (index !== -1) {
2493
2839
  newHighlightedNodes.splice(index, 1);
2494
2840
  element.classList.remove('selected');
@@ -2499,6 +2845,7 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2499
2845
  element.classList.add('selected');
2500
2846
  element.setAttribute('aria-pressed', 'true');
2501
2847
  }
2848
+
2502
2849
  this.setState({
2503
2850
  highlightedNodes: newHighlightedNodes
2504
2851
  }, function () {
@@ -2506,8 +2853,8 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2506
2853
  });
2507
2854
  var selectedOption = state ? 'selected' : 'unselected';
2508
2855
  var _nodes$key$data = nodes[key].data,
2509
- field = _nodes$key$data.field,
2510
- value = _nodes$key$data.value;
2856
+ field = _nodes$key$data.field,
2857
+ value = _nodes$key$data.value;
2511
2858
  var payload = {
2512
2859
  name: field,
2513
2860
  value: value,
@@ -2518,9 +2865,11 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2518
2865
  }).forEach(function (node) {
2519
2866
  if (node.data.isHidden !== true) {
2520
2867
  var row = "row.".concat(node.data.field, ".value");
2868
+
2521
2869
  if (!payload[row]) {
2522
2870
  payload[row] = [];
2523
2871
  }
2872
+
2524
2873
  payload[row].push(node.data.value);
2525
2874
  }
2526
2875
  });
@@ -2532,6 +2881,7 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2532
2881
  key: "highlightAllEdges",
2533
2882
  value: function highlightAllEdges() {
2534
2883
  var highlightedNodes = this.state.highlightedNodes;
2884
+
2535
2885
  if (!highlightedNodes.length) {
2536
2886
  this.viewport.querySelectorAll("[data-test^=\"edge-\"]").forEach(function (element) {
2537
2887
  return element.classList.add('hovering');
@@ -2542,6 +2892,7 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2542
2892
  key: "unhighlightAllEdges",
2543
2893
  value: function unhighlightAllEdges() {
2544
2894
  var highlightedNodes = this.state.highlightedNodes;
2895
+
2545
2896
  if (!highlightedNodes.length) {
2546
2897
  this.viewport.querySelectorAll("[data-test^=\"edge-\"]").forEach(function (element) {
2547
2898
  return element.classList.remove('hovering');
@@ -2552,6 +2903,7 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2552
2903
  key: "unhighlightAllNodes",
2553
2904
  value: function unhighlightAllNodes() {
2554
2905
  var highlightedNodes = this.state.highlightedNodes;
2906
+
2555
2907
  if (!highlightedNodes.length) {
2556
2908
  this.viewport.querySelectorAll("[data-test^=\"node-\"]").forEach(function (element) {
2557
2909
  return element.classList.remove('hovering');
@@ -2562,11 +2914,14 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2562
2914
  key: "tween",
2563
2915
  value: function tween() {
2564
2916
  var _this6 = this;
2917
+
2565
2918
  var nodes = this.state.nodes;
2566
2919
  var isAnimating = false;
2567
2920
  Object.keys(nodes).forEach(function (nodeId) {
2568
2921
  var node = nodes[nodeId];
2922
+
2569
2923
  var nodeElement = _this6.viewport.querySelector("[data-test=\"node-".concat(nodeId, "\"]"));
2924
+
2570
2925
  if (nodeElement) {
2571
2926
  if (nodeElement.style.left === '') {
2572
2927
  _this6.moveNodeBy(nodeId, Math.floor(node.x), Math.floor(node.y), Math.floor(node.w), Math.floor(node.h));
@@ -2580,17 +2935,21 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2580
2935
  var newY = Math.floor(y * (1 - node.time) + node.y * node.time);
2581
2936
  var newWidth = Math.floor(w * (1 - node.time) + node.w * node.time);
2582
2937
  var newHeight = Math.floor(h * (1 - node.time) + node.h * node.time);
2938
+
2583
2939
  if (node.time < 1) {
2584
2940
  _this6.moveNodeBy(nodeId, Math.floor(newX), Math.floor(newY), Math.floor(newWidth), Math.floor(newHeight));
2941
+
2585
2942
  isAnimating = true;
2586
2943
  } else {
2587
2944
  _this6.moveNodeBy(nodeId, Math.floor(node.x), Math.floor(node.y), Math.floor(node.w), Math.floor(node.h));
2945
+
2588
2946
  node.time = 1;
2589
2947
  }
2590
2948
  }
2591
2949
  }
2592
2950
  });
2593
2951
  cancelAnimationFrame(this.requestAnimationFrameId);
2952
+
2594
2953
  if (isAnimating) {
2595
2954
  this.requestAnimationFrameId = requestAnimationFrame(this.tween.bind(this));
2596
2955
  }
@@ -2599,23 +2958,28 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2599
2958
  key: "moveNodeBy",
2600
2959
  value: function moveNodeBy(nodeId, xIn, yIn, wIn, hIn) {
2601
2960
  var _this7 = this;
2961
+
2602
2962
  var nodes = this.state.nodes;
2603
2963
  nodes[nodeId].currentX = xIn;
2604
2964
  nodes[nodeId].currentY = yIn;
2605
2965
  nodes[nodeId].currentW = wIn;
2606
2966
  nodes[nodeId].currentH = hIn;
2607
2967
  var nodeElement = this.viewport.querySelector("[data-test=\"node-".concat(nodeId, "\"]"));
2968
+
2608
2969
  if (nodeElement) {
2609
2970
  nodeElement.style.left = "".concat(xIn, "px");
2610
2971
  nodeElement.style.top = "".concat(yIn, "px");
2611
2972
  nodeElement.style.width = "".concat(wIn, "px");
2612
2973
  nodeElement.style.height = "".concat(hIn, "px");
2613
2974
  }
2975
+
2614
2976
  Object.values(nodes[nodeId].data.outs).forEach(function (edge) {
2615
2977
  if (edge.sourceNode === nodeId || edge.targetNode === nodeId) {
2616
2978
  var start = nodes[edge.sourceNode];
2617
2979
  var end = nodes[edge.targetNode];
2980
+
2618
2981
  var edgeElement = _this7.viewport.querySelector("[data-test=\"edge-".concat(edge.sourceNode, "-").concat(edge.targetNode, "\"]"));
2982
+
2619
2983
  if (edgeElement && start && end) {
2620
2984
  var middle = {
2621
2985
  currentX: 0,
@@ -2635,19 +2999,20 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2635
2999
  key: "render",
2636
3000
  value: function render() {
2637
3001
  var _this8 = this;
3002
+
2638
3003
  var _this$state2 = this.state,
2639
- nodes = _this$state2.nodes,
2640
- edges = _this$state2.edges;
3004
+ nodes = _this$state2.nodes,
3005
+ edges = _this$state2.edges;
2641
3006
  var _this$props = this.props,
2642
- nodeColor = _this$props.nodeColor,
2643
- nodeHighlightColor = _this$props.nodeHighlightColor,
2644
- linkColor = _this$props.linkColor,
2645
- linkWidth = _this$props.linkWidth,
2646
- showValueCounts = _this$props.showValueCounts,
2647
- nodeTextColor = _this$props.nodeTextColor,
2648
- nodeTextHighlightColor = _this$props.nodeTextHighlightColor,
2649
- metadataFields = _this$props.metadataFields,
2650
- metadataColumns = _this$props.metadataColumns;
3007
+ nodeColor = _this$props.nodeColor,
3008
+ nodeHighlightColor = _this$props.nodeHighlightColor,
3009
+ linkColor = _this$props.linkColor,
3010
+ linkWidth = _this$props.linkWidth,
3011
+ showValueCounts = _this$props.showValueCounts,
3012
+ nodeTextColor = _this$props.nodeTextColor,
3013
+ nodeTextHighlightColor = _this$props.nodeTextHighlightColor,
3014
+ metadataFields = _this$props.metadataFields,
3015
+ metadataColumns = _this$props.metadataColumns;
2651
3016
  var newEdges = edges.filter(function (edge) {
2652
3017
  return nodes[edge.sourceNode] && nodes[edge.targetNode];
2653
3018
  });
@@ -2686,21 +3051,26 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2686
3051
  if (!state.hasMounted) {
2687
3052
  return state;
2688
3053
  }
3054
+
2689
3055
  var nodes = (0, lodash_1.cloneDeep)(props.graphDataModel.nodes);
2690
3056
  Object.keys(nodes).forEach(function (key) {
2691
3057
  var nodeFromProps = nodes[key];
2692
3058
  var nodeFromState = state.nodes[key];
3059
+
2693
3060
  if (!nodeFromState) {
2694
3061
  nodeFromProps.time = 1;
2695
3062
  } else if (nodeFromProps.x !== nodeFromState.x || nodeFromProps.y !== nodeFromState.y || nodeFromProps.w !== nodeFromState.w || nodeFromProps.h !== nodeFromState.h) {
2696
3063
  nodeFromProps.time = 0;
2697
3064
  }
3065
+
2698
3066
  nodeFromProps.currentX = nodeFromProps.x;
2699
3067
  nodeFromProps.currentY = nodeFromProps.y;
2700
3068
  nodeFromProps.currentW = nodeFromProps.w;
2701
3069
  nodeFromProps.currentH = nodeFromProps.h;
2702
3070
  });
3071
+
2703
3072
  var highlightedNodes = _toConsumableArray(state.highlightedNodes);
3073
+
2704
3074
  state.highlightedNodes.forEach(function (nodeID) {
2705
3075
  if (!props.graphDataModel.nodes[nodeID]) {
2706
3076
  highlightedNodes = [];
@@ -2713,8 +3083,10 @@ var Graph = /*#__PURE__*/function (_React$Component) {
2713
3083
  };
2714
3084
  }
2715
3085
  }]);
3086
+
2716
3087
  return Graph;
2717
3088
  }(React.Component);
3089
+
2718
3090
  exports.default = Graph;
2719
3091
 
2720
3092
  /***/ }),
@@ -2727,11 +3099,14 @@ exports.default = Graph;
2727
3099
  Object.defineProperty(exports, "__esModule", {
2728
3100
  value: true
2729
3101
  });
3102
+
2730
3103
  var React = __webpack_require__(1);
2731
- var GraphStyles_1 = __webpack_require__(157);
3104
+
3105
+ var GraphStyles_1 = __webpack_require__(158);
3106
+
2732
3107
  var Edges = function Edges(props) {
2733
3108
  var edges = props.edges,
2734
- linkWidth = props.linkWidth;
3109
+ linkWidth = props.linkWidth;
2735
3110
  var key = '';
2736
3111
  return React.createElement("svg", {
2737
3112
  style: {
@@ -2755,6 +3130,7 @@ var Edges = function Edges(props) {
2755
3130
  })];
2756
3131
  }));
2757
3132
  };
3133
+
2758
3134
  exports.default = Edges;
2759
3135
 
2760
3136
  /***/ }),
@@ -2767,10 +3143,15 @@ exports.default = Edges;
2767
3143
  Object.defineProperty(exports, "__esModule", {
2768
3144
  value: true
2769
3145
  });
3146
+
2770
3147
  var React = __webpack_require__(1);
3148
+
2771
3149
  var FeatureFlagContext_1 = __webpack_require__(21);
3150
+
2772
3151
  var lodash_1 = __webpack_require__(3);
3152
+
2773
3153
  var Node_1 = __webpack_require__(231);
3154
+
2774
3155
  var Nodes = function Nodes(props) {
2775
3156
  var context = React.useContext(FeatureFlagContext_1.default);
2776
3157
  var NodeToUse = (0, lodash_1.get)(context, 'LinkGraph.showNodeMetaData') ? Node_1.NodeES : Node_1.Node;
@@ -2802,6 +3183,7 @@ var Nodes = function Nodes(props) {
2802
3183
  }));
2803
3184
  });
2804
3185
  };
3186
+
2805
3187
  exports.default = Nodes;
2806
3188
 
2807
3189
  /***/ }),
@@ -2812,22 +3194,28 @@ exports.default = Nodes;
2812
3194
 
2813
3195
 
2814
3196
  var _slicedToArray = __webpack_require__(17);
3197
+
2815
3198
  Object.defineProperty(exports, "__esModule", {
2816
3199
  value: true
2817
3200
  });
2818
3201
  exports.NodeES = exports.Node = void 0;
3202
+
2819
3203
  var React = __webpack_require__(1);
3204
+
2820
3205
  var Paragraph_1 = __webpack_require__(110);
3206
+
2821
3207
  var PureLinkGraphUtils_1 = __webpack_require__(129);
3208
+
2822
3209
  var Node = function Node(props) {
2823
3210
  var data = props.data,
2824
- showValueCounts = props.showValueCounts;
3211
+ showValueCounts = props.showValueCounts;
2825
3212
  return React.createElement(React.Fragment, null, React.createElement("div", {
2826
3213
  className: "center-content"
2827
3214
  }, React.createElement(Paragraph_1.default, null, data.value)), React.createElement("div", {
2828
3215
  className: "right-content"
2829
3216
  }, React.createElement(Paragraph_1.default, null, showValueCounts ? data.count : null)));
2830
3217
  };
3218
+
2831
3219
  exports.Node = Node;
2832
3220
  var esStyle = {
2833
3221
  width: 'auto',
@@ -2839,20 +3227,24 @@ var esStyle = {
2839
3227
  * 2. a @splunk/react-icon by passing in the icon name
2840
3228
  * 3. an SVG path - example: d="M 0, 0 m -5, 0 a 5,5 0 1,0 5,0 a 5,5 0 1,0 -5,0"
2841
3229
  */
3230
+
2842
3231
  var NodeES = function NodeES(props) {
2843
3232
  var data = props.data,
2844
- showValueCounts = props.showValueCounts,
2845
- metadataFields = props.metadataFields,
2846
- metadataColumns = props.metadataColumns;
3233
+ showValueCounts = props.showValueCounts,
3234
+ metadataFields = props.metadataFields,
3235
+ metadataColumns = props.metadataColumns;
2847
3236
  var metaData = (0, PureLinkGraphUtils_1.getSecondaryColumnByField)(data.value, metadataFields, metadataColumns);
2848
3237
  var isSVG = String(metaData.icon).indexOf('d=') === 0;
2849
3238
  var isIMG = String(metaData.icon).indexOf('data:image/') === 0;
3239
+
2850
3240
  var _React$useState = React.useState(false),
2851
- _React$useState2 = _slicedToArray(_React$useState, 2),
2852
- showRollOverText = _React$useState2[0],
2853
- setShowRollOverText = _React$useState2[1];
3241
+ _React$useState2 = _slicedToArray(_React$useState, 2),
3242
+ showRollOverText = _React$useState2[0],
3243
+ setShowRollOverText = _React$useState2[1];
3244
+
2854
3245
  var anchorRef = React.useRef(null);
2855
3246
  var Icon = null;
3247
+
2856
3248
  if (metaData.icon && !isIMG && !isSVG) {
2857
3249
  try {
2858
3250
  /* eslint-disable import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires */
@@ -2863,6 +3255,8 @@ var NodeES = function NodeES(props) {
2863
3255
  Icon = __webpack_require__(233)("./".concat(metaData.icon, ".js"));
2864
3256
  }
2865
3257
  /* eslint-enable import/no-dynamic-require, global-require, @typescript-eslint/no-var-requires */
3258
+
3259
+
2866
3260
  if (Icon && Icon.default) {
2867
3261
  Icon = Icon.default;
2868
3262
  }
@@ -2870,6 +3264,7 @@ var NodeES = function NodeES(props) {
2870
3264
  Icon = null;
2871
3265
  }
2872
3266
  }
3267
+
2873
3268
  return React.createElement("div", {
2874
3269
  className: "center-content-se",
2875
3270
  ref: anchorRef,
@@ -2928,6 +3323,7 @@ var NodeES = function NodeES(props) {
2928
3323
  }
2929
3324
  }, metaData.badge_label ? metaData.badge_label : null)));
2930
3325
  };
3326
+
2931
3327
  exports.NodeES = NodeES;
2932
3328
 
2933
3329
  /***/ }),
@@ -27182,20 +27578,29 @@ module.exports = __webpack_require__(5);
27182
27578
  Object.defineProperty(exports, "__esModule", {
27183
27579
  value: true
27184
27580
  });
27581
+
27185
27582
  var React = __webpack_require__(1);
27583
+
27186
27584
  var Dropdown_1 = __webpack_require__(406);
27585
+
27187
27586
  var Paragraph_1 = __webpack_require__(110);
27587
+
27188
27588
  var Button_1 = __webpack_require__(123);
27589
+
27189
27590
  var Menu_1 = __webpack_require__(119);
27591
+
27190
27592
  var Chip_1 = __webpack_require__(407);
27593
+
27191
27594
  var FeatureFlagContext_1 = __webpack_require__(21);
27595
+
27192
27596
  var lodash_1 = __webpack_require__(3);
27597
+
27193
27598
  var Field = function Field(_ref) {
27194
27599
  var field = _ref.field,
27195
- count = _ref.count,
27196
- onSort = _ref.onSort,
27197
- showNodeCounts = _ref.showNodeCounts,
27198
- width = _ref.width;
27600
+ count = _ref.count,
27601
+ onSort = _ref.onSort,
27602
+ showNodeCounts = _ref.showNodeCounts,
27603
+ width = _ref.width;
27199
27604
  var toggle = React.createElement(Button_1.default, {
27200
27605
  label: field,
27201
27606
  isMenu: true,
@@ -27243,6 +27648,7 @@ var Field = function Field(_ref) {
27243
27648
  var FieldToUse = (0, lodash_1.get)(context, 'LinkGraph.showNodeMetaData') ? FieldES : FieldNonES;
27244
27649
  return FieldToUse;
27245
27650
  };
27651
+
27246
27652
  Field.displayName = 'Field';
27247
27653
  exports.default = Field;
27248
27654
 
@@ -27269,8 +27675,11 @@ Object.defineProperty(exports, "__esModule", {
27269
27675
  value: true
27270
27676
  });
27271
27677
  exports.StyledFields = void 0;
27678
+
27272
27679
  var styled_components_1 = __webpack_require__(4);
27680
+
27273
27681
  var pick_1 = __webpack_require__(23);
27682
+
27274
27683
  exports.StyledFields = styled_components_1.default.div.withConfig({
27275
27684
  displayName: "FieldStyles__StyledFields",
27276
27685
  componentId: "gvs6f8-0"
@@ -27290,28 +27699,41 @@ exports.StyledFields = styled_components_1.default.div.withConfig({
27290
27699
 
27291
27700
 
27292
27701
  var _toConsumableArray = __webpack_require__(8);
27702
+
27293
27703
  Object.defineProperty(exports, "__esModule", {
27294
27704
  value: true
27295
27705
  });
27706
+
27296
27707
  var lodash_1 = __webpack_require__(3);
27708
+
27297
27709
  var visualization_icons_1 = __webpack_require__(52);
27710
+
27298
27711
  var placeholders_1 = __webpack_require__(50);
27712
+
27299
27713
  var schemaUtils_1 = __webpack_require__(16);
27714
+
27300
27715
  var i18n_1 = __webpack_require__(2);
27716
+
27301
27717
  var pick_1 = __webpack_require__(23);
27718
+
27302
27719
  var variables_1 = __webpack_require__(11);
27720
+
27303
27721
  var colorConstants_1 = __webpack_require__(49);
27722
+
27304
27723
  var visualization_color_palettes_1 = __webpack_require__(51);
27724
+
27305
27725
  var configUtils_1 = __webpack_require__(20);
27306
- var VizCategory_1 = __webpack_require__(35);
27726
+
27727
+ var VizCategory_1 = __webpack_require__(36);
27728
+
27307
27729
  var VizBehavior_1 = __webpack_require__(6);
27730
+
27308
27731
  var dataContract = {
27309
27732
  requiredDataSources: [{
27310
27733
  name: 'primary',
27311
27734
  description: 'DataSource that powers the visualization'
27312
27735
  }],
27313
- optionalDataSources: [
27314
- // {
27736
+ optionalDataSources: [// {
27315
27737
  // name: 'metadata',
27316
27738
  // description: 'Used buy the ES team along side the feature flag `LinkGraph.showNodeMetaData`',
27317
27739
  // },
@@ -27447,8 +27869,8 @@ var themes = {
27447
27869
  enterprise: {
27448
27870
  dark: variables_1.default.contentColorInverted(props),
27449
27871
  light: variables_1.default.white(props) // equal to textColor in enterpriseDark
27450
- },
27451
27872
 
27873
+ },
27452
27874
  prisma: variables_1.default.contentColorInverted(props)
27453
27875
  })(props);
27454
27876
  },
@@ -27463,8 +27885,8 @@ var themes = {
27463
27885
  enterprise: {
27464
27886
  dark: variables_1.default.contentColorInverted(props),
27465
27887
  light: variables_1.default.white(props) // equal to textColor in enterpriseDark
27466
- },
27467
27888
 
27889
+ },
27468
27890
  prisma: variables_1.default.contentColorInverted(props)
27469
27891
  })(props);
27470
27892
  }
@@ -27473,8 +27895,7 @@ var EDITOR_LABEL_WIDTH = 140;
27473
27895
  var backgroundColorPaletteSet = new Set([].concat(_toConsumableArray(colorConstants_1.COLOR_EDITOR_PALETTE), _toConsumableArray((0, lodash_1.map)(themes, function (t) {
27474
27896
  return (0, lodash_1.get)(t, 'defaultBackgroundColor');
27475
27897
  }))));
27476
- var editorConfig = [
27477
- // {
27898
+ var editorConfig = [// {
27478
27899
  // label: _('Data'),
27479
27900
  // layout: [
27480
27901
  // [
@@ -27618,12 +28039,14 @@ var config = {
27618
28039
  * unique viz key
27619
28040
  */
27620
28041
  key: 'splunk.linkgraph',
28042
+
27621
28043
  /**
27622
28044
  * viz name
27623
28045
  */
27624
28046
  name: (0, i18n_1._)('Link graph'),
27625
28047
  category: VizCategory_1.VizCategory.FLOW,
27626
28048
  status: 'preview',
28049
+
27627
28050
  /**
27628
28051
  * viz icon
27629
28052
  */