@easyv/utils
Advanced tools
Comparing version 0.0.22 to 0.0.23
@@ -15,2 +15,3 @@ "use strict"; | ||
exports.getYTicks = getYTicks; | ||
exports.getYTicksByStep = getYTicksByStep; | ||
exports.degToRad = degToRad; | ||
@@ -147,2 +148,11 @@ exports.lglt2xyz = lglt2xyz; | ||
function getYTicksByStep(max, min, step) { | ||
var count = (max - min) / step; | ||
var ticks = (0, _d3Array.range)(0, count).map(function (item) { | ||
var value = item * step + +min; | ||
return +(value > -1 && value < 1 && value !== 0 || step.toString().indexOf('.') > -1 ? f2(value) : f0(value)); | ||
}); | ||
return [].concat((0, _toConsumableArray2["default"])(ticks), [max]); | ||
} | ||
function degToRad(angle) { | ||
@@ -149,0 +159,0 @@ return Math.PI / 180 * angle; |
@@ -23,2 +23,4 @@ "use strict"; | ||
yCount = yConfig.count, | ||
yStep = yConfig.step, | ||
tickModel = yConfig.tickModel, | ||
_yConfig$offset = yConfig.offset, | ||
@@ -31,4 +33,5 @@ yOffset = _yConfig$offset === void 0 ? 3 : _yConfig$offset; | ||
var yDomain = yScale.domain(); | ||
var Model = tickModel ? tickModel : 'count'; | ||
var xValues = xScale.ticks ? xScale.ticks(+xConfig.count) : xScale.domain(); | ||
var yValues = yScale.ticks ? tickAuto ? yScale.ticks(+yCount) : (0, _utils.getYTicks)(yDomain[1], yDomain[0], +yCount) : yDomain; | ||
var yValues = yScale.ticks ? tickAuto ? yScale.ticks(+yCount) : Model === 'count' ? (0, _utils.getYTicks)(yDomain[1], yDomain[0], +yCount) : (0, _utils.getYTicksByStep)(yDomain[1], yDomain[0], +yStep) : yDomain; | ||
var xBandwidth = xScale.bandwidth ? xScale.bandwidth() : 0; | ||
@@ -74,3 +77,2 @@ var yBandwidth = yScale.bandwidth ? yScale.bandwidth() : 0; | ||
; | ||
return /*#__PURE__*/_react["default"].createElement("line", { | ||
@@ -77,0 +79,0 @@ key: index, |
@@ -33,2 +33,4 @@ "use strict"; | ||
var count = label.count, | ||
tickModel = label.tickModel, | ||
step = label.step, | ||
_label$tickAuto = label.tickAuto, | ||
@@ -43,3 +45,4 @@ tickAuto = _label$tickAuto === void 0 ? true : _label$tickAuto, | ||
var domain = scale.domain(); | ||
var values = scale.ticks ? tickAuto ? scale.ticks(+count) : (0, _utils.getYTicks)(domain[1], domain[0], +count) : tickAuto ? domain : (0, _utils.getTicksOfAxis)(domain, +count); | ||
var Model = tickModel ? tickModel : 'count'; | ||
var values = scale.ticks ? tickAuto ? scale.ticks(+count) : Model === 'count' ? (0, _utils.getYTicks)(domain[1], domain[0], +count) : (0, _utils.getYTicksByStep)(domain[1], domain[0], +step) : tickAuto ? domain : (0, _utils.getTicksOfAxis)(domain, +count); | ||
var height = scale.range()[0]; | ||
@@ -110,6 +113,9 @@ var bandwidth = scale.bandwidth ? scale.bandwidth() : 0; | ||
var count = label.count, | ||
tickModel = label.tickModel, | ||
step = label.step, | ||
_label$tickAuto2 = label.tickAuto, | ||
tickAuto = _label$tickAuto2 === void 0 ? true : _label$tickAuto2; | ||
var domain = scale.domain(); | ||
var values = scale.ticks ? tickAuto ? scale.ticks(+count) : (0, _utils.getYTicks)(domain[1], domain[0], +count) : domain; | ||
var Model = tickModel ? tickModel : 'count'; | ||
var values = scale.ticks ? tickAuto ? scale.ticks(+count) : Model === 'count' ? (0, _utils.getYTicks)(domain[1], domain[0], +count) : (0, _utils.getYTicksByStep)(domain[1], domain[0], +step) : domain; | ||
var height = scale.range()[0]; | ||
@@ -116,0 +122,0 @@ var bandwidth = scale.bandwidth ? scale.bandwidth() : 0; |
{ | ||
"name": "@easyv/utils", | ||
"version": "0.0.22", | ||
"version": "0.0.23", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
160257
4100
0