@visactor/vutils-extension
Advanced tools
Comparing version 1.7.0-alpha.1 to 1.7.0-alpha.2
@@ -30,3 +30,4 @@ "use strict"; | ||
} else if (op.sampling) { | ||
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2, rangeStart = Math.min(...range), rangeEnd = Math.max(...range); | ||
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2, rangeStart = (0, | ||
vutils_1.minInArray)(range), rangeEnd = (0, vutils_1.maxInArray)(range); | ||
if (domain.length <= rangeSize / fontSize) { | ||
@@ -33,0 +34,0 @@ const incrementUnit = (rangeEnd - rangeStart) / domain.length, labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal), minBoundsLength = Math.min(...labelBoundsList.map((bounds => bounds[2]))), stepResult = getStep(domain, labelBoundsList, labelGap, op.labelLastVisible, Math.floor(minBoundsLength / incrementUnit), !1); |
@@ -21,3 +21,4 @@ "use strict"; | ||
} else if (op.sampling) { | ||
const domain = scale.domain(), range = scale.range(), labelBoundsList = (0, util_1.getPolarAngleLabelBounds)(scale, domain, op), rangeStart = Math.min(...range), rangeEnd = Math.max(...range), incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length, {step: step, delCount: delCount} = getStep(domain, labelBoundsList, labelGap, Math.floor(labelBoundsList.reduce(((min, curBounds) => Math.min(min, curBounds.width(), curBounds.height())), Number.MAX_VALUE) / incrementUnit)); | ||
const domain = scale.domain(), range = scale.range(), labelBoundsList = (0, util_1.getPolarAngleLabelBounds)(scale, domain, op), rangeStart = (0, | ||
vutils_1.minInArray)(range), rangeEnd = (0, vutils_1.maxInArray)(range), incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length, {step: step, delCount: delCount} = getStep(domain, labelBoundsList, labelGap, Math.floor(labelBoundsList.reduce(((min, curBounds) => Math.min(min, curBounds.width(), curBounds.height())), Number.MAX_VALUE) / incrementUnit)); | ||
scaleTicks = scale.stepTicks(step), scaleTicks = scaleTicks.slice(0, scaleTicks.length - delCount); | ||
@@ -24,0 +25,0 @@ } else scaleTicks = scale.domain(); |
@@ -1,2 +0,2 @@ | ||
import { isFunction, isValid } from "@visactor/vutils"; | ||
import { isFunction, isValid, maxInArray, minInArray } from "@visactor/vutils"; | ||
@@ -25,3 +25,3 @@ import { convertDomainToTickData, getCartesianLabelBounds, isAxisHorizontal } from "../util"; | ||
} else if (op.sampling) { | ||
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2, rangeStart = Math.min(...range), rangeEnd = Math.max(...range); | ||
const fontSize = (null !== (_a = op.labelStyle.fontSize) && void 0 !== _a ? _a : 12) + 2, rangeStart = minInArray(range), rangeEnd = maxInArray(range); | ||
if (domain.length <= rangeSize / fontSize) { | ||
@@ -28,0 +28,0 @@ const incrementUnit = (rangeEnd - rangeStart) / domain.length, labelBoundsList = getOneDimensionalLabelBounds(scale, domain, op, isHorizontal), minBoundsLength = Math.min(...labelBoundsList.map((bounds => bounds[2]))), stepResult = getStep(domain, labelBoundsList, labelGap, op.labelLastVisible, Math.floor(minBoundsLength / incrementUnit), !1); |
@@ -1,2 +0,2 @@ | ||
import { isFunction, isValid } from "@visactor/vutils"; | ||
import { isFunction, isValid, maxInArray, minInArray } from "@visactor/vutils"; | ||
@@ -16,3 +16,3 @@ import { convertDomainToTickData, getPolarAngleLabelBounds, labelOverlap } from "../util"; | ||
} else if (op.sampling) { | ||
const domain = scale.domain(), range = scale.range(), labelBoundsList = getPolarAngleLabelBounds(scale, domain, op), rangeStart = Math.min(...range), rangeEnd = Math.max(...range), incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length, {step: step, delCount: delCount} = getStep(domain, labelBoundsList, labelGap, Math.floor(labelBoundsList.reduce(((min, curBounds) => Math.min(min, curBounds.width(), curBounds.height())), Number.MAX_VALUE) / incrementUnit)); | ||
const domain = scale.domain(), range = scale.range(), labelBoundsList = getPolarAngleLabelBounds(scale, domain, op), rangeStart = minInArray(range), rangeEnd = maxInArray(range), incrementUnit = Math.abs(rangeEnd - rangeStart) * (radius + labelOffset) / domain.length, {step: step, delCount: delCount} = getStep(domain, labelBoundsList, labelGap, Math.floor(labelBoundsList.reduce(((min, curBounds) => Math.min(min, curBounds.width(), curBounds.height())), Number.MAX_VALUE) / incrementUnit)); | ||
scaleTicks = scale.stepTicks(step), scaleTicks = scaleTicks.slice(0, scaleTicks.length - delCount); | ||
@@ -19,0 +19,0 @@ } else scaleTicks = scale.domain(); |
{ | ||
"name": "@visactor/vutils-extension", | ||
"version": "1.7.0-alpha.1", | ||
"version": "1.7.0-alpha.2", | ||
"description": "The extension module for VUtil from VisActor", | ||
@@ -15,6 +15,6 @@ "sideEffects": false, | ||
"dependencies": { | ||
"@visactor/vutils": "~0.16.14", | ||
"@visactor/vscale": "~0.16.14", | ||
"@visactor/vrender-core": "~0.16.16", | ||
"@visactor/vrender-kits": "~0.16.16" | ||
"@visactor/vutils": "~0.16.18", | ||
"@visactor/vscale": "~0.16.18", | ||
"@visactor/vrender-core": "~0.16.17", | ||
"@visactor/vrender-kits": "~0.16.17" | ||
}, | ||
@@ -21,0 +21,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
158331
872
Updated@visactor/vscale@~0.16.18
Updated@visactor/vutils@~0.16.18