@splunk/charting-bundle 24.3.5 → 24.5.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.
- package/index.js +40 -17
- package/index.js.map +1 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -46245,8 +46245,8 @@ if(false) {}
|
|
|
46245
46245
|
/***/ (function(module, exports, __webpack_require__) {
|
|
46246
46246
|
|
|
46247
46247
|
/* WEBPACK VAR INJECTION */(function(module) {
|
|
46248
|
-
var styles = {"
|
|
46249
|
-
var themeLocals = {"
|
|
46248
|
+
var styles = {"lite":".legendItemUnclickable_legend-styles__guid__47dc5e .highcharts-a11y-proxy-button{cursor:default!important}.legendItemUnclickable_legend-styles__guid__47dc5e .highcharts-a11y-proxy-button:active{pointer-events:none}","enterprise":".legendItemUnclickable_legend-styles__guid__47dc5e .highcharts-a11y-proxy-button{cursor:default!important}.legendItemUnclickable_legend-styles__guid__47dc5e .highcharts-a11y-proxy-button:active{pointer-events:none}"};
|
|
46249
|
+
var themeLocals = {"lite":{"legendItemUnclickable":"legendItemUnclickable_legend-styles__guid__47dc5e"},"enterprise":{"legendItemUnclickable":"legendItemUnclickable_legend-styles__guid__47dc5e"}};
|
|
46250
46250
|
|
|
46251
46251
|
var partialsTheme =
|
|
46252
46252
|
window.__splunkd_partials__ &&
|
|
@@ -46853,8 +46853,8 @@ module.exports = exports['default'];
|
|
|
46853
46853
|
/***/ (function(module, exports, __webpack_require__) {
|
|
46854
46854
|
|
|
46855
46855
|
/* WEBPACK VAR INJECTION */(function(module) {
|
|
46856
|
-
var styles = {"lite":".button_button-
|
|
46857
|
-
var themeLocals = {"lite":{"button":"button_button-
|
|
46856
|
+
var styles = {"lite":".button_button-styles__guid__47dc5e{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;box-sizing:content-box;caption-side:top;clear:none;clip:auto;color:#000;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1;column-span:1;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:inline;empty-cells:show;float:none;font-family:serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;line-height:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#3c444d;box-sizing:border-box;display:inline-block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;outline:medium none invert;background:rgba(60,68,77,.4);border-radius:3px;color:#fff;cursor:pointer;font-size:12px;line-height:27px;padding:0 10px;z-index:9999}.button_button-styles__guid__47dc5e::-moz-focus-inner{border:0;padding:0}.button_button-styles__guid__47dc5e:active,.button_button-styles__guid__47dc5e:hover{background:rgba(60,68,77,.35);color:#fff}.button_button-styles__guid__47dc5e:focus{border-color:rgba(0,164,253,.8);color:#00a4fd}.button_button-styles__guid__47dc5e[disabled]{background:transparent;color:#c3cbd4;cursor:default}.button_button-styles__guid__47dc5e[disabled]:hover{background:transparent;color:#c3cbd4;cursor:default}.button-dark-theme_button-styles__guid__47dc5e{background:#3c444d}.button-dark-theme_button-styles__guid__47dc5e:active,.button-dark-theme_button-styles__guid__47dc5e:hover{background:#5c6773;color:#fff}.button-dark-theme_button-styles__guid__47dc5e:focus{background:#2b3033;color:#006eaa}.panButton_button-styles__guid__47dc5e{border-radius:1px;line-height:10px;padding:4px 5px}.panButtonDark_button-styles__guid__47dc5e{border-radius:1px;line-height:10px;padding:4px 5px}.resetZoomButton_button-styles__guid__47dc5e{margin-top:5px;margin-right:10px}.resetZoomButtonDark_button-styles__guid__47dc5e{margin-top:5px;margin-right:10px}.resetZoomIcon_button-styles__guid__47dc5e{margin-right:3px}","enterprise":".button_button-styles__guid__47dc5e{-webkit-animation:none 0s ease 0s 1 normal none running;animation:none 0s ease 0s 1 normal none running;-webkit-backface-visibility:visible;backface-visibility:visible;background:transparent none repeat 0 0/auto auto padding-box border-box scroll;border:medium none currentColor;border-collapse:separate;-webkit-border-image:none;border-image:none;border-radius:0;border-spacing:0;bottom:auto;box-shadow:none;box-sizing:content-box;caption-side:top;clear:none;clip:auto;color:#000;-webkit-columns:auto;columns:auto;-webkit-column-count:auto;column-count:auto;-webkit-column-fill:balance;column-fill:balance;-webkit-column-gap:normal;column-gap:normal;-webkit-column-rule:medium none currentColor;column-rule:medium none currentColor;-webkit-column-span:1;column-span:1;-webkit-column-width:auto;column-width:auto;content:normal;counter-increment:none;counter-reset:none;cursor:auto;direction:ltr;display:inline;empty-cells:show;float:none;font-family:serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:400;font-stretch:normal;line-height:normal;height:auto;-webkit-hyphens:none;-ms-hyphens:none;hyphens:none;left:auto;letter-spacing:normal;list-style:disc outside none;margin:0;max-height:none;max-width:none;min-height:0;min-width:0;opacity:1;orphans:2;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;-webkit-perspective:none;perspective:none;-webkit-perspective-origin:50% 50%;perspective-origin:50% 50%;position:static;right:auto;-moz-tab-size:8;tab-size:8;table-layout:auto;text-align:left;text-align-last:auto;text-decoration:none;text-indent:0;text-shadow:none;text-transform:none;top:auto;-webkit-transform:none;transform:none;-webkit-transform-origin:50% 50% 0;transform-origin:50% 50% 0;-webkit-transform-style:flat;transform-style:flat;-webkit-transition:none 0s ease 0s;transition:none 0s ease 0s;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:2;width:auto;word-spacing:normal;z-index:auto;font-family:Splunk Platform Sans,Proxima Nova,Roboto,Droid,Helvetica Neue,Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#3c444d;box-sizing:border-box;display:inline-block;border-width:1px;visibility:inherit;outline:medium none #00a4fd;outline:medium none invert;background:rgba(60,68,77,.4);border-radius:3px;color:#fff;cursor:pointer;font-size:12px;line-height:27px;padding:0 10px;z-index:9999}.button_button-styles__guid__47dc5e::-moz-focus-inner{border:0;padding:0}.button_button-styles__guid__47dc5e:active,.button_button-styles__guid__47dc5e:hover{background:rgba(60,68,77,.35);color:#fff}.button_button-styles__guid__47dc5e:focus{border-color:rgba(0,164,253,.8);color:#00a4fd}.button_button-styles__guid__47dc5e[disabled]{background:transparent;color:#c3cbd4;cursor:default}.button_button-styles__guid__47dc5e[disabled]:hover{background:transparent;color:#c3cbd4;cursor:default}.button-dark-theme_button-styles__guid__47dc5e{background:#3c444d}.button-dark-theme_button-styles__guid__47dc5e:active,.button-dark-theme_button-styles__guid__47dc5e:hover{background:#5c6773;color:#fff}.button-dark-theme_button-styles__guid__47dc5e:focus{background:#2b3033;color:#006eaa}.panButton_button-styles__guid__47dc5e{border-radius:1px;line-height:10px;padding:4px 5px}.panButtonDark_button-styles__guid__47dc5e{border-radius:1px;line-height:10px;padding:4px 5px}.resetZoomButton_button-styles__guid__47dc5e{margin-top:5px;margin-right:10px}.resetZoomButtonDark_button-styles__guid__47dc5e{margin-top:5px;margin-right:10px}.resetZoomIcon_button-styles__guid__47dc5e{margin-right:3px}"};
|
|
46857
|
+
var themeLocals = {"lite":{"button":"button_button-styles__guid__47dc5e","button-dark-theme":"button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","panButton":"panButton_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","panButtonDark":"panButtonDark_button-styles__guid__47dc5e button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomButton":"resetZoomButton_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomButtonDark":"resetZoomButtonDark_button-styles__guid__47dc5e button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomIcon":"resetZoomIcon_button-styles__guid__47dc5e"},"enterprise":{"button":"button_button-styles__guid__47dc5e","button-dark-theme":"button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","panButton":"panButton_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","panButtonDark":"panButtonDark_button-styles__guid__47dc5e button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomButton":"resetZoomButton_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomButtonDark":"resetZoomButtonDark_button-styles__guid__47dc5e button-dark-theme_button-styles__guid__47dc5e button_button-styles__guid__47dc5e","resetZoomIcon":"resetZoomIcon_button-styles__guid__47dc5e"}};
|
|
46858
46858
|
|
|
46859
46859
|
var partialsTheme =
|
|
46860
46860
|
window.__splunkd_partials__ &&
|
|
@@ -47718,11 +47718,22 @@ _jquery2.default.extend(PieSeries.prototype, {
|
|
|
47718
47718
|
var that = this;
|
|
47719
47719
|
var nameSeries = [];
|
|
47720
47720
|
var sizeSeries = [];
|
|
47721
|
+
var minPositiveSize = Number.MAX_VALUE;
|
|
47721
47722
|
// negative values are omitted from the pie chart. Fix for SPL-210816
|
|
47723
|
+
var cardinality = 0;
|
|
47724
|
+
var countZero = 0;
|
|
47722
47725
|
(0, _underscore2.default)(inputData.sizes).each(function (size, i) {
|
|
47723
|
-
if (size
|
|
47726
|
+
if (size > 0) {
|
|
47724
47727
|
nameSeries.push(inputData.names[i]);
|
|
47725
47728
|
sizeSeries.push(size);
|
|
47729
|
+
cardinality += 1; // only count valid values for cardinality
|
|
47730
|
+
if (size < minPositiveSize) {
|
|
47731
|
+
// find the minimum positive value for collapsing all zero values
|
|
47732
|
+
minPositiveSize = size;
|
|
47733
|
+
}
|
|
47734
|
+
}
|
|
47735
|
+
if (size === 0) {
|
|
47736
|
+
countZero += 1;
|
|
47726
47737
|
}
|
|
47727
47738
|
});
|
|
47728
47739
|
var spanSeries = inputData.spans;
|
|
@@ -47730,12 +47741,19 @@ _jquery2.default.extend(PieSeries.prototype, {
|
|
|
47730
47741
|
var totalSize = (0, _underscore2.default)(sizeSeries).reduce(function (sum, value) {
|
|
47731
47742
|
return sum + value;
|
|
47732
47743
|
}, 0);
|
|
47733
|
-
var
|
|
47734
|
-
var
|
|
47735
|
-
var
|
|
47736
|
-
var numLessThanThresh = 0;
|
|
47744
|
+
var collapsedSizeRemovingInvalid = 0;
|
|
47745
|
+
var numCollapsed = countZero;
|
|
47746
|
+
var validNumLessThanThresh = 0;
|
|
47737
47747
|
var granularity = null;
|
|
47738
47748
|
|
|
47749
|
+
// for collapsing all zero values, calculate the value to replace zero
|
|
47750
|
+
// "valueReplaceZero" is a number < 1 and smaller than any value in the input array
|
|
47751
|
+
// small enough to show "count: 0" and "count% 0%" in the tooltip for zeros
|
|
47752
|
+
var maxDigits = Math.abs(Math.ceil(Math.log(minPositiveSize) * Math.LOG10E));
|
|
47753
|
+
var valueReplaceZero = 1 / 10 ** (maxDigits + 3);
|
|
47754
|
+
// if the value is not small enough to collapse, recalculate
|
|
47755
|
+
valueReplaceZero = valueReplaceZero / totalSize < that.collapsePercent ? valueReplaceZero : totalSize * that.collapsePercent * 0.0001;
|
|
47756
|
+
|
|
47739
47757
|
var passesThreshold = function passesThreshold(value) {
|
|
47740
47758
|
return value > 0 && value / totalSize > that.collapsePercent;
|
|
47741
47759
|
};
|
|
@@ -47746,15 +47764,20 @@ _jquery2.default.extend(PieSeries.prototype, {
|
|
|
47746
47764
|
}
|
|
47747
47765
|
|
|
47748
47766
|
this.fieldList = (0, _underscore2.default)(nameSeries).map(parsingUtils.escapeSVG, parsingUtils);
|
|
47749
|
-
(0, _underscore2.default)(sizeSeries).each(function (
|
|
47750
|
-
|
|
47751
|
-
|
|
47767
|
+
(0, _underscore2.default)(sizeSeries).each(function (size, i) {
|
|
47768
|
+
// replace zero with the calculated small value
|
|
47769
|
+
if (size === 0) {
|
|
47770
|
+
sizeSeries[i] = valueReplaceZero;
|
|
47771
|
+
countZero += 1;
|
|
47772
|
+
} else if (!passesThreshold(size)) {
|
|
47773
|
+
validNumLessThanThresh++;
|
|
47752
47774
|
}
|
|
47753
47775
|
}, this);
|
|
47754
47776
|
|
|
47755
47777
|
(0, _underscore2.default)(nameSeries).each(function (name, i) {
|
|
47756
47778
|
var sizeValue = sizeSeries[i];
|
|
47757
|
-
|
|
47779
|
+
// no collapse
|
|
47780
|
+
if (passesThreshold(sizeValue) || validNumLessThanThresh === 1 && !countZero || cardinality <= 10 && !countZero) {
|
|
47758
47781
|
if (isTimeBased) {
|
|
47759
47782
|
var bdTime = timeUtils.extractBdTime(name);
|
|
47760
47783
|
var humanizedName = timeUtils.formatBdTimeAsAxisLabel(bdTime, null, granularity).join(' ');
|
|
@@ -47765,17 +47788,17 @@ _jquery2.default.extend(PieSeries.prototype, {
|
|
|
47765
47788
|
_this.data.push([name, sizeValue]);
|
|
47766
47789
|
}
|
|
47767
47790
|
} else {
|
|
47768
|
-
|
|
47791
|
+
// collapse
|
|
47792
|
+
collapsedSizeRemovingInvalid += sizeValue === valueReplaceZero ? 0 : sizeValue;
|
|
47769
47793
|
numCollapsed++;
|
|
47770
47794
|
_this.fieldList = (0, _underscore2.default)(_this.fieldList).without(name);
|
|
47771
47795
|
}
|
|
47772
47796
|
});
|
|
47773
|
-
|
|
47774
47797
|
if (numCollapsed > 0) {
|
|
47775
47798
|
var collapsedName = this.collapseFieldName + ' (' + numCollapsed + ')';
|
|
47776
|
-
this.data.push([collapsedName,
|
|
47799
|
+
this.data.push([collapsedName, collapsedSizeRemovingInvalid]);
|
|
47777
47800
|
// Doesn't make sense to attach a span value to the collapsed section
|
|
47778
|
-
this.prettyData.push([collapsedName,
|
|
47801
|
+
this.prettyData.push([collapsedName, collapsedSizeRemovingInvalid, null]);
|
|
47779
47802
|
this.fieldList.push('__other');
|
|
47780
47803
|
}
|
|
47781
47804
|
|