react-gauge-component
Advanced tools
Comparing version 1.1.33 to 1.1.34
@@ -124,8 +124,8 @@ "use strict"; | ||
var addTickValue = function (tick, gauge) { | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k; | ||
var _l = gauge.props, labels = _l.labels, value = _l.value; | ||
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; | ||
var _m = gauge.props, labels = _m.labels, value = _m.value; | ||
var arc = gauge.props.arc; | ||
var arcWidth = arc.width; | ||
var tickValue = tick === null || tick === void 0 ? void 0 : tick.value; | ||
var _m = (0, exports.calculateAnchorAndAngleByValue)(tickValue, gauge), tickAnchor = _m.tickAnchor, angle = _m.angle; | ||
var _o = (0, exports.calculateAnchorAndAngleByValue)(tickValue, gauge), tickAnchor = _o.tickAnchor, angle = _o.angle; | ||
var centerToArcLengthSubtract = 27 - arcWidth * 10; | ||
@@ -140,3 +140,6 @@ var isInner = ((_a = labels === null || labels === void 0 ? void 0 : labels.tickLabels) === null || _a === void 0 ? void 0 : _a.type) == "inner"; | ||
var maxDecimalDigits = (_g = (_f = (_e = gauge.props.labels) === null || _e === void 0 ? void 0 : _e.tickLabels) === null || _f === void 0 ? void 0 : _f.defaultTickValueConfig) === null || _g === void 0 ? void 0 : _g.maxDecimalDigits; | ||
if ((_j = (_h = labels === null || labels === void 0 ? void 0 : labels.tickLabels) === null || _h === void 0 ? void 0 : _h.defaultTickValueConfig) === null || _j === void 0 ? void 0 : _j.formatTextValue) { | ||
if ((_h = tick.valueConfig) === null || _h === void 0 ? void 0 : _h.formatTextValue) { | ||
text = tick.valueConfig.formatTextValue(utils.floatingNumber(tickValue, maxDecimalDigits)); | ||
} | ||
else if ((_k = (_j = labels === null || labels === void 0 ? void 0 : labels.tickLabels) === null || _j === void 0 ? void 0 : _j.defaultTickValueConfig) === null || _k === void 0 ? void 0 : _k.formatTextValue) { | ||
text = labels.tickLabels.defaultTickValueConfig.formatTextValue(utils.floatingNumber(tickValue, maxDecimalDigits)); | ||
@@ -152,3 +155,3 @@ } | ||
//This is a position correction for the text being too far away from the ticks | ||
if (((_k = labels === null || labels === void 0 ? void 0 : labels.tickLabels) === null || _k === void 0 ? void 0 : _k.type) == "inner") { | ||
if (((_l = labels === null || labels === void 0 ? void 0 : labels.tickLabels) === null || _l === void 0 ? void 0 : _l.type) == "inner") { | ||
if (tickAnchor === "end") | ||
@@ -240,11 +243,12 @@ coords.x += 10; | ||
var maxDecimalDigits = (_c = (_b = gauge.props.labels) === null || _b === void 0 ? void 0 : _b.valueLabel) === null || _c === void 0 ? void 0 : _c.maxDecimalDigits; | ||
var floatValue = utils.floatingNumber(value, maxDecimalDigits); | ||
if (valueLabel.formatTextValue) { | ||
text = valueLabel.formatTextValue(utils.floatingNumber(value, maxDecimalDigits)); | ||
text = valueLabel.formatTextValue(floatValue); | ||
} | ||
else if (gauge.props.minValue === 0 && gauge.props.maxValue === 100) { | ||
text = utils.floatingNumber(value, maxDecimalDigits).toString(); | ||
text = floatValue.toString(); | ||
text += "%"; | ||
} | ||
else { | ||
text = utils.floatingNumber(value, maxDecimalDigits).toString(); | ||
text = floatValue.toString(); | ||
} | ||
@@ -251,0 +255,0 @@ var maxLengthBeforeComputation = 4; |
{ | ||
"name": "react-gauge-component", | ||
"version": "1.1.33", | ||
"version": "1.1.34", | ||
"main": "dist/lib/index.js", | ||
@@ -5,0 +5,0 @@ "module": "dist/lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108697
1924