@antv/scale
Advanced tools
Comparing version
@@ -67,3 +67,3 @@ import { head, indexOf, last, map, size } from '@antv/util'; | ||
// 异常数据情况下,直接返回,防止 oom | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number') { | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number' || !m) { | ||
return { | ||
@@ -75,3 +75,4 @@ min: 0, | ||
} | ||
if (dmin === dmax || m === 1) { | ||
// js 极大值极小值问题,差值小于 1e-15 会导致计算出错 | ||
if (dmax - dmin < 1e-15 || m === 1) { | ||
return { | ||
@@ -78,0 +79,0 @@ min: dmin, |
@@ -70,3 +70,3 @@ "use strict"; | ||
// 异常数据情况下,直接返回,防止 oom | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number') { | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number' || !m) { | ||
return { | ||
@@ -78,3 +78,4 @@ min: 0, | ||
} | ||
if (dmin === dmax || m === 1) { | ||
// js 极大值极小值问题,差值小于 1e-15 会导致计算出错 | ||
if (dmax - dmin < 1e-15 || m === 1) { | ||
return { | ||
@@ -81,0 +82,0 @@ min: dmin, |
{ | ||
"name": "@antv/scale", | ||
"version": "0.3.7", | ||
"version": "0.3.8", | ||
"description": "The scale module for G2", | ||
@@ -5,0 +5,0 @@ "author": "https://github.com/orgs/antvis/people", |
@@ -82,3 +82,3 @@ import { head, indexOf, last, map, size } from '@antv/util'; | ||
// 异常数据情况下,直接返回,防止 oom | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number') { | ||
if (typeof dmin !== 'number' || typeof dmax !== 'number' || !m) { | ||
return { | ||
@@ -90,4 +90,5 @@ min: 0, | ||
} | ||
if (dmin === dmax || m === 1) { | ||
// js 极大值极小值问题,差值小于 1e-15 会导致计算出错 | ||
if (dmax - dmin < 1e-15 || m === 1) { | ||
return { | ||
@@ -94,0 +95,0 @@ min: dmin, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
320060
0.11%5957
0.05%