Comparing version 3.0.0-rc5.5 to 3.0.0-rc5.6
{ | ||
"name": "@antv/g2", | ||
"version": "3.0.0-rc5.5", | ||
"version": "3.0.0-rc5.6", | ||
"description": "the Grammar of Graphics in Javascript", | ||
@@ -5,0 +5,0 @@ "main": "build/g2.js", |
@@ -10,5 +10,8 @@ /** | ||
const Default = { | ||
version: '3.0.0-rc5.5', | ||
version: '3.0.0-rc5.6', | ||
trackable: true, | ||
animate: true, | ||
snapArray: [ 0, 1, 2, 4, 5, 10 ], | ||
// 指定固定 tick 数的逼近值 | ||
snapCountArray: [ 0, 1, 1.2, 1.5, 1.6, 2, 2.2, 2.4, 3, 4, 5, 6, 7.5, 8, 10 ], | ||
widthRatio: { // 宽度所占的分类的比例 | ||
@@ -15,0 +18,0 @@ column: 1 / 2, // 一般的柱状图占比 1/2 |
@@ -10,3 +10,5 @@ /** | ||
const MAX_COUNT = 7; | ||
const INTERVAL_ARRAY = [ 0, 1, 2, 4, 5, 10 ]; | ||
const Global = require('../../global'); | ||
const INTERVAL_ARRAY = Global.snapArray; | ||
const INTERVAL_ARRAY_COUNT = Global.snapCountArray; // 指定了坐标个数的逼近数组 | ||
@@ -22,2 +24,3 @@ module.exports = function(info) { | ||
let count; | ||
const snapArray = info.minCount ? INTERVAL_ARRAY_COUNT : INTERVAL_ARRAY; | ||
@@ -48,3 +51,3 @@ if (Util.isNil(min)) { | ||
const temp = (max - min) / (avgCount - 1); | ||
interval = AutoUtil.snapFactorTo(temp, INTERVAL_ARRAY, 'ceil'); | ||
interval = AutoUtil.snapFactorTo(temp, snapArray, 'ceil'); | ||
if (maxCount !== minCount) { | ||
@@ -59,3 +62,3 @@ count = parseInt((max - min) / interval, 10); | ||
// 不确定tick的个数时,使得tick偏小 | ||
interval = AutoUtil.snapFactorTo((max - min) / (count - 1), INTERVAL_ARRAY, 'floor'); | ||
interval = AutoUtil.snapFactorTo((max - min) / (count - 1), snapArray, 'floor'); | ||
} else { | ||
@@ -62,0 +65,0 @@ count = avgCount; |
Sorry, the diff of this file is too big to display
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
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
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
18736658
297
64975
2