@antv/scale
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -52,3 +52,3 @@ export declare type ScaleType = 'base' | 'linear' | 'cat' | 'log' | 'pow' | 'identity' | 'time' | 'timeCat'; | ||
/** tick格式化函数,会影响数据在坐标轴 axis、图例 legend、tooltip 上的显示 */ | ||
formatter: (v: any, k?: number) => string; | ||
formatter: (v: any, k?: number) => any; | ||
}>; | ||
@@ -55,0 +55,0 @@ export default abstract class Scale { |
@@ -69,5 +69,5 @@ import { __extends, __spreadArrays } from "tslib"; | ||
// 简单过滤,部分情况下小数的倍数也可以是整数 | ||
var Q = ALL_Q.filter(function (n) { return Number.isInteger(n); }); | ||
var Q_1 = ALL_Q.filter(function (n) { return Number.isInteger(n); }); | ||
// tslint:disable-next-line: no-shadowed-variable | ||
var ticks_1 = extended(this.min, this.max, this.tickCount, false, Q).ticks; | ||
var ticks_1 = extended(this.min, this.max, this.tickCount, false, Q_1).ticks; | ||
var valid = _.filter(ticks_1, function (tick) { return tick >= _this.min && tick <= _this.max; }); | ||
@@ -74,0 +74,0 @@ return valid.map(function (index) { return _this.values[index]; }); |
import { getScale, registerScale } from './factory'; | ||
import Scale, { ScaleConfig } from './base'; | ||
export { Scale, getScale, registerScale, ScaleConfig }; | ||
import Category from './category'; | ||
import Identity from './identity'; | ||
import Linear from './linear'; | ||
import Log from './linear-log'; | ||
import Pow from './linear-pow'; | ||
import Time from './time'; | ||
import TimeCat from './timeCat'; | ||
export { Category, Identity, Linear, Log, Pow, Time, TimeCat, Scale, getScale, registerScale, ScaleConfig }; |
@@ -18,3 +18,3 @@ import { getScale, registerScale } from './factory'; | ||
registerScale('timeCat', TimeCat); | ||
export { Scale, getScale, registerScale }; | ||
export { Category, Identity, Linear, Log, Pow, Time, TimeCat, Scale, getScale, registerScale }; | ||
//# sourceMappingURL=index.js.map |
@@ -52,3 +52,3 @@ export declare type ScaleType = 'base' | 'linear' | 'cat' | 'log' | 'pow' | 'identity' | 'time' | 'timeCat'; | ||
/** tick格式化函数,会影响数据在坐标轴 axis、图例 legend、tooltip 上的显示 */ | ||
formatter: (v: any, k?: number) => string; | ||
formatter: (v: any, k?: number) => any; | ||
}>; | ||
@@ -55,0 +55,0 @@ export default abstract class Scale { |
@@ -71,5 +71,5 @@ "use strict"; | ||
// 简单过滤,部分情况下小数的倍数也可以是整数 | ||
var Q = extended_1.ALL_Q.filter(function (n) { return Number.isInteger(n); }); | ||
var Q_1 = extended_1.ALL_Q.filter(function (n) { return Number.isInteger(n); }); | ||
// tslint:disable-next-line: no-shadowed-variable | ||
var ticks_1 = extended_1.default(this.min, this.max, this.tickCount, false, Q).ticks; | ||
var ticks_1 = extended_1.default(this.min, this.max, this.tickCount, false, Q_1).ticks; | ||
var valid = _.filter(ticks_1, function (tick) { return tick >= _this.min && tick <= _this.max; }); | ||
@@ -76,0 +76,0 @@ return valid.map(function (index) { return _this.values[index]; }); |
import { getScale, registerScale } from './factory'; | ||
import Scale, { ScaleConfig } from './base'; | ||
export { Scale, getScale, registerScale, ScaleConfig }; | ||
import Category from './category'; | ||
import Identity from './identity'; | ||
import Linear from './linear'; | ||
import Log from './linear-log'; | ||
import Pow from './linear-pow'; | ||
import Time from './time'; | ||
import TimeCat from './timeCat'; | ||
export { Category, Identity, Linear, Log, Pow, Time, TimeCat, Scale, getScale, registerScale, ScaleConfig }; |
@@ -9,8 +9,15 @@ "use strict"; | ||
var category_1 = require("./category"); | ||
exports.Category = category_1.default; | ||
var identity_1 = require("./identity"); | ||
exports.Identity = identity_1.default; | ||
var linear_1 = require("./linear"); | ||
exports.Linear = linear_1.default; | ||
var linear_log_1 = require("./linear-log"); | ||
exports.Log = linear_log_1.default; | ||
var linear_pow_1 = require("./linear-pow"); | ||
exports.Pow = linear_pow_1.default; | ||
var time_1 = require("./time"); | ||
exports.Time = time_1.default; | ||
var timeCat_1 = require("./timeCat"); | ||
exports.TimeCat = timeCat_1.default; | ||
factory_1.registerScale('cat', category_1.default); | ||
@@ -17,0 +24,0 @@ factory_1.registerScale('category', category_1.default); |
{ | ||
"name": "@antv/scale", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "The scale module for G2", | ||
@@ -5,0 +5,0 @@ "author": "https://github.com/orgs/antvis/people", |
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
146900
2246