@splunk/visualizations 26.2.1 → 26.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (150) hide show
  1. package/Area.config.js +92 -595
  2. package/Area.config.js.map +1 -1
  3. package/Area.js +296 -801
  4. package/Area.js.map +1 -1
  5. package/Bar.config.js +93 -562
  6. package/Bar.config.js.map +1 -1
  7. package/Bar.js +299 -770
  8. package/Bar.js.map +1 -1
  9. package/Bubble.config.js +84 -483
  10. package/Bubble.config.js.map +1 -1
  11. package/Bubble.js +286 -687
  12. package/Bubble.js.map +1 -1
  13. package/ChoroplethSvg.config.js +77 -202
  14. package/ChoroplethSvg.config.js.map +1 -1
  15. package/ChoroplethSvg.js +272 -400
  16. package/ChoroplethSvg.js.map +1 -1
  17. package/Column.config.js +93 -600
  18. package/Column.config.js.map +1 -1
  19. package/Column.js +299 -808
  20. package/Column.js.map +1 -1
  21. package/Ellipse.config.js +82 -200
  22. package/Ellipse.config.js.map +1 -1
  23. package/Ellipse.js +233 -356
  24. package/Ellipse.js.map +1 -1
  25. package/Events.config.js +62 -283
  26. package/Events.config.js.map +1 -1
  27. package/Events.js +326 -530
  28. package/Events.js.map +1 -1
  29. package/FillerGauge.config.js +91 -220
  30. package/FillerGauge.config.js.map +1 -1
  31. package/FillerGauge.js +267 -401
  32. package/FillerGauge.js.map +1 -1
  33. package/Image.config.js +61 -157
  34. package/Image.config.js.map +1 -1
  35. package/Image.js +217 -327
  36. package/Image.js.map +1 -1
  37. package/Line.config.js +92 -607
  38. package/Line.config.js.map +1 -1
  39. package/Line.js +297 -814
  40. package/Line.js.map +1 -1
  41. package/LinkGraph.config.js +75 -257
  42. package/LinkGraph.config.js.map +1 -1
  43. package/LinkGraph.js +1755 -17415
  44. package/LinkGraph.js.map +1 -1
  45. package/MIGRATION.md +6 -0
  46. package/Map.config.js +128 -1123
  47. package/Map.config.js.map +1 -1
  48. package/Map.js +470 -782
  49. package/Map.js.map +1 -1
  50. package/Markdown.config.js +62 -189
  51. package/Markdown.config.js.map +1 -1
  52. package/Markdown.js +272 -401
  53. package/Markdown.js.map +1 -1
  54. package/MarkerGauge.config.js +138 -298
  55. package/MarkerGauge.config.js.map +1 -1
  56. package/MarkerGauge.js +309 -470
  57. package/MarkerGauge.js.map +1 -1
  58. package/ParallelCoordinates.config.js +72 -192
  59. package/ParallelCoordinates.config.js.map +1 -1
  60. package/ParallelCoordinates.js +333 -442
  61. package/ParallelCoordinates.js.map +1 -1
  62. package/Pie.config.js +77 -241
  63. package/Pie.config.js.map +1 -1
  64. package/Pie.js +336 -471
  65. package/Pie.js.map +1 -1
  66. package/Punchcard.config.js +72 -306
  67. package/Punchcard.config.js.map +1 -1
  68. package/Punchcard.js +356 -583
  69. package/Punchcard.js.map +1 -1
  70. package/Rectangle.config.js +211 -347
  71. package/Rectangle.config.js.map +1 -1
  72. package/Rectangle.js +371 -509
  73. package/Rectangle.js.map +1 -1
  74. package/Sankey.config.js +72 -214
  75. package/Sankey.config.js.map +1 -1
  76. package/Sankey.js +343 -475
  77. package/Sankey.js.map +1 -1
  78. package/Scatter.config.js +86 -464
  79. package/Scatter.config.js.map +1 -1
  80. package/Scatter.js +1118 -1493
  81. package/Scatter.js.map +1 -1
  82. package/SingleValue.config.js +124 -411
  83. package/SingleValue.config.js.map +1 -1
  84. package/SingleValue.js +522 -789
  85. package/SingleValue.js.map +1 -1
  86. package/SingleValueBasic.js +73 -61
  87. package/SingleValueBasic.js.map +1 -1
  88. package/SingleValueIcon.config.js +123 -380
  89. package/SingleValueIcon.config.js.map +1 -1
  90. package/SingleValueIcon.js +508 -745
  91. package/SingleValueIcon.js.map +1 -1
  92. package/SingleValueRadial.config.js +121 -385
  93. package/SingleValueRadial.config.js.map +1 -1
  94. package/SingleValueRadial.js +1642 -1885
  95. package/SingleValueRadial.js.map +1 -1
  96. package/SparkLine.js +39 -39
  97. package/SparkLine.js.map +1 -1
  98. package/Table.config.js +82 -496
  99. package/Table.config.js.map +1 -1
  100. package/Table.js +416 -825
  101. package/Table.js.map +1 -1
  102. package/common/Charting.js +37 -57
  103. package/common/Charting.js.map +1 -1
  104. package/common/DocExampleWithVizSandbox.js +21 -21
  105. package/common/DocExampleWithVizSandbox.js.map +1 -1
  106. package/common/EventsDoc.js +18 -18
  107. package/common/EventsDoc.js.map +1 -1
  108. package/common/GaugeMajorTicks.js +4 -4
  109. package/common/GaugeMajorTicks.js.map +1 -1
  110. package/common/GaugeValueMarker.js +2 -2
  111. package/common/GaugeValueMarker.js.map +1 -1
  112. package/common/OptionsDoc.js +4 -4
  113. package/common/OptionsDoc.js.map +1 -1
  114. package/common/OverviewDoc.js +39 -40
  115. package/common/OverviewDoc.js.map +1 -1
  116. package/common/SplunkVisualization.js +2 -2
  117. package/common/SplunkVisualization.js.map +1 -1
  118. package/common/SplunkVisualizationApi.js +2 -2
  119. package/common/SplunkVisualizationApi.js.map +1 -1
  120. package/common/ThemesDoc.js +19 -19
  121. package/common/ThemesDoc.js.map +1 -1
  122. package/common/chartingUtils.js +2 -2
  123. package/common/chartingUtils.js.map +1 -1
  124. package/common/gaugeUtils.js +10 -10
  125. package/common/gaugeUtils.js.map +1 -1
  126. package/common/shapeUtils.js +10 -10
  127. package/common/shapeUtils.js.map +1 -1
  128. package/common/utils/configUtils.js +25 -155
  129. package/common/utils/configUtils.js.map +1 -1
  130. package/common/utils/dataUtils.js +87 -105
  131. package/common/utils/dataUtils.js.map +1 -1
  132. package/common/utils/featureFlagUtils.js +4 -4
  133. package/common/utils/featureFlagUtils.js.map +1 -1
  134. package/common/utils/hocUtils.js +2 -2
  135. package/common/utils/hocUtils.js.map +1 -1
  136. package/common/utils/mapUtils.js +51 -54
  137. package/common/utils/mapUtils.js.map +1 -1
  138. package/common/utils/singleValueUtils.js +30 -18
  139. package/common/utils/singleValueUtils.js.map +1 -1
  140. package/common/utils/testHelper.js +7 -36
  141. package/common/utils/testHelper.js.map +1 -1
  142. package/common/utils/trellisUtils.js +7 -6
  143. package/common/utils/trellisUtils.js.map +1 -1
  144. package/common/utils/urlUtils.js +2 -2
  145. package/common/utils/urlUtils.js.map +1 -1
  146. package/common/withDashboardViz.js +93 -101
  147. package/common/withDashboardViz.js.map +1 -1
  148. package/package.json +48 -50
  149. package/common/utils/layoutUtils.js +0 -115
  150. package/common/utils/layoutUtils.js.map +0 -1
@@ -87,7 +87,7 @@ module.exports =
87
87
  /******/
88
88
  /******/
89
89
  /******/ // Load entry module and return exports
90
- /******/ return __webpack_require__(__webpack_require__.s = 74);
90
+ /******/ return __webpack_require__(__webpack_require__.s = 73);
91
91
  /******/ })
92
92
  /************************************************************************/
93
93
  /******/ ([
@@ -410,19 +410,21 @@ var largestTriangleThreeBuckets = function largestTriangleThreeBuckets(data, thr
410
410
  */
411
411
 
412
412
 
413
- var strictlyCoerceYColumn = function strictlyCoerceYColumn(column) {
414
- // Splunk charting allows for numbers in formats such as negative hex that
413
+ var strictlyCoerceYColumn = function strictlyCoerceYColumn(column, options) {
414
+ var isNullCoercionEnabled = options.nullValueDisplay === 'zero'; // Splunk charting allows for numbers in formats such as negative hex that
415
415
  // Number() does not support and also allows loose coercion of hex numbers (but not other formats)
416
416
  // We want to identify columns which contain at least one value that can be loosely coerced
417
+
417
418
  var canLooselyCoerceSomeValues = column.findIndex(function (value) {
418
- return (0, numberUtils_1.startsWithNumber)("".concat(value));
419
+ return (0, numberUtils_1.startsWithNumber)("".concat(value)) || isNullCoercionEnabled && value === null;
419
420
  }) >= 0; // If not all values in column can be strictly coerced to a number, we do not downsample
420
421
 
421
422
  var coercedColumn = [];
422
423
  var canDownsampleColumn = !column.some(function (value) {
423
- var coercedValue = Number(value); // if it can't be parsed or isn't safe, fail
424
+ var coercedValue = Number(value);
425
+ var coerceValueToZero = isNullCoercionEnabled && value === null; // if it can't be parsed or isn't safe, fail
424
426
 
425
- if (Number.isNaN(coercedValue) || coercedValue <= Number.MIN_SAFE_INTEGER || coercedValue >= Number.MAX_SAFE_INTEGER || typeof value !== 'string' && typeof value !== 'number') {
427
+ if (Number.isNaN(coercedValue) || coercedValue <= Number.MIN_SAFE_INTEGER || coercedValue >= Number.MAX_SAFE_INTEGER || typeof value !== 'string' && typeof value !== 'number' && !coerceValueToZero) {
426
428
  return true;
427
429
  } // save value and continue to next
428
430
 
@@ -503,8 +505,7 @@ var calculateDownsamplingThreshold = function calculateDownsamplingThreshold(_re
503
505
  dataSources = _ref3.dataSources,
504
506
  selectChartEvent = _ref3.selectChartEvent,
505
507
  width = _ref3.width,
506
- xField = _ref3.xField,
507
- y2Fields = _ref3.y2Fields;
508
+ xField = _ref3.xField;
508
509
 
509
510
  var _a, _b, _c;
510
511
 
@@ -541,14 +542,7 @@ var calculateDownsamplingThreshold = function calculateDownsamplingThreshold(_re
541
542
  });
542
543
  var lastIndex = fullSeries.findIndex(function (x) {
543
544
  return downsampledSeries[endXIndex] === x;
544
- }); // For charts with categorical x-axis (charts with an xField that isn't _time), do not support
545
- // re-calculating downsampling threshold if the chart is zoomed in until SPL-259458 is fixed
546
- // Also do not support re-calculating downsampling threshold for zoomed-in charts with y2
547
- // until SPL-259611 is fixed
548
-
549
- if (xField !== '_time' || (y2Fields === null || y2Fields === void 0 ? void 0 : y2Fields.length)) {
550
- return firstIndex === 0 && lastIndex === fullSeries.length - 1 ? width : null;
551
- }
545
+ });
552
546
 
553
547
  if (firstIndex >= 0 && lastIndex >= 0 && firstIndex <= lastIndex) {
554
548
  return (0, exports.calculateThresholdOnRangeSelect)({
@@ -559,6 +553,7 @@ var calculateDownsamplingThreshold = function calculateDownsamplingThreshold(_re
559
553
  });
560
554
  }
561
555
  } catch (e) {
556
+ // eslint-disable-next-line no-console
562
557
  console.error('Error occurred while setting downsample threshold on range select event', e);
563
558
  }
564
559
 
@@ -597,7 +592,7 @@ var isColumnStrictlyIncreasing = function isColumnStrictlyIncreasing(column, fie
597
592
  */
598
593
 
599
594
 
600
- var tryToCoerceAllDisplayedFields = function tryToCoerceAllDisplayedFields(ds, xField, yFields, fieldTypes) {
595
+ var tryToCoerceAllDisplayedFields = function tryToCoerceAllDisplayedFields(ds, xField, yFields, fieldTypes, options) {
601
596
  var xColumn = [];
602
597
  var yColumns = [];
603
598
  var canDownsample = !ds.data.fields.some(function (field, index) {
@@ -611,7 +606,7 @@ var tryToCoerceAllDisplayedFields = function tryToCoerceAllDisplayedFields(ds, x
611
606
  if (fieldName === xField) {
612
607
  xColumn = strictlyCoerceXColumn(column, fieldType);
613
608
  } else if (yFields.has(fieldName)) {
614
- var _strictlyCoerceYColum = strictlyCoerceYColumn(ds.data.columns[index]),
609
+ var _strictlyCoerceYColum = strictlyCoerceYColumn(ds.data.columns[index], options),
615
610
  coercedColumn = _strictlyCoerceYColum.coercedColumn,
616
611
  canLooselyCoerceSomeValues = _strictlyCoerceYColum.canLooselyCoerceSomeValues,
617
612
  canDownsampleColumn = _strictlyCoerceYColum.canDownsampleColumn; // do not perform downsampling if a column can possibly be displayed but cannot
@@ -701,7 +696,7 @@ var downsampleDataSources = function downsampleDataSources(_ref4) {
701
696
  return dataSources;
702
697
  }
703
698
 
704
- var _tryToCoerceAllDispla = tryToCoerceAllDisplayedFields(primaryDS, xField, nonInternalYFields, fieldTypes),
699
+ var _tryToCoerceAllDispla = tryToCoerceAllDisplayedFields(primaryDS, xField, nonInternalYFields, fieldTypes, options),
705
700
  xColumn = _tryToCoerceAllDispla.xColumn,
706
701
  yColumns = _tryToCoerceAllDispla.yColumns;
707
702
 
@@ -725,6 +720,7 @@ var downsampleDataSources = function downsampleDataSources(_ref4) {
725
720
  return downsampledIndices.add(downsampleIndex);
726
721
  });
727
722
  } catch (e) {
723
+ // eslint-disable-next-line no-console
728
724
  console.error("Error occurred while downsampling column ".concat(columnIndex), e);
729
725
  }
730
726
  }); // update data columns with downsampled columns
@@ -745,9 +741,8 @@ exports.downsampleDataSources = downsampleDataSources;
745
741
  Object.defineProperty(exports, "__esModule", {
746
742
  value: true
747
743
  });
748
- exports.validOutputModes = exports.validSegmentationModes = exports.validSortDirs = void 0;
744
+ exports.validOutputModes = exports.validSortDirs = void 0;
749
745
  exports.validSortDirs = ['asc', 'desc', 'none'];
750
- exports.validSegmentationModes = ['none', 'inner'];
751
746
  exports.validOutputModes = ['json_cols', 'json'];
752
747
 
753
748
  /***/ }),
@@ -908,14 +903,14 @@ __exportStar(__webpack_require__(39), exports);
908
903
 
909
904
  __exportStar(__webpack_require__(40), exports);
910
905
 
911
- __exportStar(__webpack_require__(41), exports);
912
-
913
906
  __exportStar(__webpack_require__(14), exports);
914
907
 
915
908
  __exportStar(__webpack_require__(18), exports);
916
909
 
917
910
  __exportStar(__webpack_require__(19), exports);
918
911
 
912
+ __exportStar(__webpack_require__(41), exports);
913
+
919
914
  __exportStar(__webpack_require__(42), exports);
920
915
 
921
916
  __exportStar(__webpack_require__(43), exports);
@@ -926,8 +921,6 @@ __exportStar(__webpack_require__(45), exports);
926
921
 
927
922
  __exportStar(__webpack_require__(46), exports);
928
923
 
929
- __exportStar(__webpack_require__(47), exports);
930
-
931
924
  /***/ }),
932
925
  /* 33 */
933
926
  /***/ (function(module, exports, __webpack_require__) {
@@ -1086,17 +1079,7 @@ Object.defineProperty(exports, "__esModule", {
1086
1079
  });
1087
1080
 
1088
1081
  /***/ }),
1089
- /* 47 */
1090
- /***/ (function(module, exports, __webpack_require__) {
1091
-
1092
- "use strict";
1093
-
1094
-
1095
- Object.defineProperty(exports, "__esModule", {
1096
- value: true
1097
- });
1098
-
1099
- /***/ }),
1082
+ /* 47 */,
1100
1083
  /* 48 */,
1101
1084
  /* 49 */,
1102
1085
  /* 50 */,
@@ -1122,8 +1105,7 @@ Object.defineProperty(exports, "__esModule", {
1122
1105
  /* 70 */,
1123
1106
  /* 71 */,
1124
1107
  /* 72 */,
1125
- /* 73 */,
1126
- /* 74 */
1108
+ /* 73 */
1127
1109
  /***/ (function(module, exports, __webpack_require__) {
1128
1110
 
1129
1111
  "use strict";
@@ -1139,7 +1121,7 @@ var lodash_1 = __webpack_require__(3);
1139
1121
 
1140
1122
  var i18n_1 = __webpack_require__(5);
1141
1123
 
1142
- var visualization_color_palettes_1 = __webpack_require__(75);
1124
+ var visualization_color_palettes_1 = __webpack_require__(74);
1143
1125
 
1144
1126
  var react_1 = __webpack_require__(0);
1145
1127
 
@@ -1147,12 +1129,12 @@ var React = __webpack_require__(0);
1147
1129
 
1148
1130
  var T = __webpack_require__(1);
1149
1131
 
1150
- var react_event_listener_1 = __webpack_require__(76);
1132
+ var react_event_listener_1 = __webpack_require__(75);
1151
1133
 
1152
- __webpack_require__(77); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
1134
+ __webpack_require__(76); // fixme, @splunk/charting should be refactor to use locale & timezone instead of i18n functions
1153
1135
 
1154
1136
 
1155
- var charting_bundle_1 = __webpack_require__(78);
1137
+ var charting_bundle_1 = __webpack_require__(77);
1156
1138
 
1157
1139
  var TimezoneContext_1 = __webpack_require__(28);
1158
1140
 
@@ -1162,15 +1144,15 @@ var styled_components_1 = __webpack_require__(2);
1162
1144
 
1163
1145
  var Message_1 = __webpack_require__(24);
1164
1146
 
1165
- var useSplunkTheme_1 = __webpack_require__(79);
1147
+ var useSplunkTheme_1 = __webpack_require__(78);
1166
1148
 
1167
- var themeUtils_1 = __webpack_require__(80);
1149
+ var themeUtils_1 = __webpack_require__(79);
1168
1150
 
1169
1151
  var ChartingApi_1 = __webpack_require__(30);
1170
1152
 
1171
1153
  var usePrevious_1 = __webpack_require__(31);
1172
1154
 
1173
- var useEventCallback_1 = __webpack_require__(81);
1155
+ var useEventCallback_1 = __webpack_require__(80);
1174
1156
 
1175
1157
  var dataUtils_1 = __webpack_require__(25);
1176
1158
 
@@ -1297,8 +1279,7 @@ var Charting = function Charting(props) {
1297
1279
  onEventTrigger = props.onEventTrigger,
1298
1280
  originalDataSources = props.originalDataSources,
1299
1281
  onDownsamplingThresholdChange = props.onDownsamplingThresholdChange,
1300
- xField = props.xField,
1301
- y2Fields = props.y2Fields;
1282
+ xField = props.xField;
1302
1283
  var prevOptions = (0, usePrevious_1.default)(options);
1303
1284
  var prevTimezone = (0, usePrevious_1.default)(timezone);
1304
1285
 
@@ -1341,14 +1322,13 @@ var Charting = function Charting(props) {
1341
1322
  dataSources: originalDataSources,
1342
1323
  width: Number(width),
1343
1324
  selectChartEvent: selectChartEvent.current,
1344
- xField: xField,
1345
- y2Fields: y2Fields
1325
+ xField: xField
1346
1326
  });
1347
1327
 
1348
1328
  if (Number.isFinite(newThreshold)) {
1349
1329
  onDownsamplingThresholdChange(newThreshold);
1350
1330
  }
1351
- }, [enableSearchZoom, originalDataSources, onDownsamplingThresholdChange, width, xField, y2Fields]);
1331
+ }, [enableSearchZoom, originalDataSources, onDownsamplingThresholdChange, width, xField]);
1352
1332
  React.useEffect(function () {
1353
1333
  recalculateDownsamplingThreshold();
1354
1334
  }, [recalculateDownsamplingThreshold]); // useEventCallback is used for these handlers to make sure that they are a stable reference and
@@ -1586,43 +1566,43 @@ var withEmptyChartMessage = function withEmptyChartMessage(Chart) {
1586
1566
  exports.default = withEmptyChartMessage(Charting);
1587
1567
 
1588
1568
  /***/ }),
1589
- /* 75 */
1569
+ /* 74 */
1590
1570
  /***/ (function(module, exports) {
1591
1571
 
1592
1572
  module.exports = require("@splunk/visualization-color-palettes");
1593
1573
 
1594
1574
  /***/ }),
1595
- /* 76 */
1575
+ /* 75 */
1596
1576
  /***/ (function(module, exports) {
1597
1577
 
1598
1578
  module.exports = require("react-event-listener");
1599
1579
 
1600
1580
  /***/ }),
1601
- /* 77 */
1581
+ /* 76 */
1602
1582
  /***/ (function(module, exports) {
1603
1583
 
1604
1584
  module.exports = require("@splunk/visualizations-shared/i18n");
1605
1585
 
1606
1586
  /***/ }),
1607
- /* 78 */
1587
+ /* 77 */
1608
1588
  /***/ (function(module, exports) {
1609
1589
 
1610
1590
  module.exports = require("@splunk/charting-bundle");
1611
1591
 
1612
1592
  /***/ }),
1613
- /* 79 */
1593
+ /* 78 */
1614
1594
  /***/ (function(module, exports) {
1615
1595
 
1616
1596
  module.exports = require("@splunk/themes/useSplunkTheme");
1617
1597
 
1618
1598
  /***/ }),
1619
- /* 80 */
1599
+ /* 79 */
1620
1600
  /***/ (function(module, exports) {
1621
1601
 
1622
1602
  module.exports = require("@splunk/visualizations-shared/themeUtils");
1623
1603
 
1624
1604
  /***/ }),
1625
- /* 81 */
1605
+ /* 80 */
1626
1606
  /***/ (function(module, exports, __webpack_require__) {
1627
1607
 
1628
1608
  "use strict";