New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@antv/scale

Package Overview
Dependencies
Maintainers
8
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@antv/scale - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

178

build/scale.js

@@ -133,3 +133,3 @@ (function webpackUniversalModuleDefinition(root, factory) {

_proto.init = function init() {};
_proto.init = function init() {}
/**

@@ -152,4 +152,4 @@ * 获取该度量的ticks,返回的是多个对象,

*/
;
_proto.getTicks = function getTicks() {

@@ -175,3 +175,3 @@ var self = this;

return rst;
};
}
/**

@@ -183,4 +183,4 @@ * 获取格式化后的文本

*/
;
_proto.getText = function getText(value, key) {

@@ -195,3 +195,3 @@ var formatter = this.formatter;

return value.toString();
};
}
/**

@@ -202,7 +202,7 @@ * 输出的值域最小值

*/
;
_proto.rangeMin = function rangeMin() {
return this.range[0];
};
}
/**

@@ -213,8 +213,8 @@ * 输出的值域最大值

*/
;
_proto.rangeMax = function rangeMax() {
var range = this.range;
return range[range.length - 1];
};
}
/**

@@ -225,7 +225,7 @@ * 度量转换后的结果,翻转回输入域

*/
;
_proto.invert = function invert(value) {
return value;
};
}
/**

@@ -236,7 +236,7 @@ * 将传入的值从非数值转换成数值格式,如分类字符串、时间字符串等

*/
;
_proto.translate = function translate(value) {
return value;
};
}
/**

@@ -247,7 +247,7 @@ * 进行度量转换

*/
;
_proto.scale = function scale(value) {
return value;
};
}
/**

@@ -257,4 +257,4 @@ * 克隆一个新的scale,拥有跟当前scale相同的输入域、输出域等

*/
;
_proto.clone = function clone() {

@@ -268,3 +268,3 @@ var self = this;

return new constr(cfg);
};
}
/**

@@ -276,4 +276,4 @@ * 更改度量的属性信息

*/
;
_proto.change = function change(info) {

@@ -458,3 +458,3 @@ this.ticks = null;

self.snapArray = null;
};
}
/**

@@ -464,4 +464,4 @@ * @protected

*/
;
_proto.init = function init() {

@@ -487,3 +487,3 @@ var self = this;

}
};
}
/**

@@ -494,4 +494,4 @@ * 计算坐标点

*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -527,5 +527,5 @@ var min = this.min,

return tmp.ticks;
}; // 初始化ticks
} // 初始化ticks
;
_proto.initTicks = function initTicks() {

@@ -555,8 +555,8 @@ var self = this;

}
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -578,8 +578,8 @@ if (isNil(value)) {

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -910,8 +910,8 @@ var percent = (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());

this.isRounding = true; // 是否进行取整操作
};
}
/**
* @override
*/
;
_proto.init = function init() {

@@ -939,8 +939,8 @@ var self = this;

}
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -952,8 +952,8 @@ if (this.values.indexOf(value) === -1 && isNumber(value)) {

return _Base.prototype.getText.call(this, value);
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {

@@ -969,8 +969,8 @@ var index = this.values.indexOf(value);

return index;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -992,8 +992,8 @@ var rangeMin = this.rangeMin();

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -1712,12 +1712,14 @@ if (isString(value)) {

if (maxTick < max) {
maxTick = maxTick + interval;
while (maxTick < max) {
// 保证计算出来的刻度最大值 maxTick 不小于数据最大值 max
maxTick = AutoUtil.fixedBase(maxTick + interval, interval);
}
if (minTick > min) {
minTick = minTick - interval;
while (minTick > min) {
// 保证计算出来的刻度最小值 minTick 不小于数据最大值 min
minTick = AutoUtil.fixedBase(minTick - interval, interval); // 防止超常浮点数计算问题
}
max = AutoUtil.fixedBase(maxTick, interval);
min = AutoUtil.fixedBase(minTick, interval);
max = maxTick;
min = minTick;
}

@@ -1782,16 +1784,16 @@

this.value = null;
};
}
/**
* @override
*/
;
_proto.getText = function getText() {
return this.value.toString();
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -1803,8 +1805,8 @@ if (this.value !== value && isNumber(value)) {

return this.range[0];
};
}
/**
* @override
*/
;
_proto.invert = function invert() {

@@ -1867,8 +1869,8 @@ return this.value;

this.mask = 'YYYY-MM-DD';
};
}
/**
* @override
*/
;
_proto.init = function init() {

@@ -1939,8 +1941,8 @@ var self = this;

return tmp.ticks;
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -1951,8 +1953,8 @@ var formatter = this.formatter;

return value;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -1964,13 +1966,13 @@ if (isString(value)) {

return _Linear.prototype.scale.call(this, value);
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {
return this._toTimeStamp(value);
}; // 将时间转换为时间戳
} // 将时间转换为时间戳
;
_proto._toTimeStamp = function _toTimeStamp(value) {

@@ -2261,3 +2263,3 @@ return TimeUtil.toTimeStamp(value);

}
};
}
/**

@@ -2267,4 +2269,4 @@ * 计算 ticks

*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -2287,8 +2289,8 @@ var self = this;

return ticks;
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {

@@ -2307,8 +2309,8 @@ value = this._toTimeStamp(value);

return index;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -2330,8 +2332,8 @@ var rangeMin = this.rangeMin();

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -2351,8 +2353,8 @@ var result = '';

return result;
};
}
/**
* @override
*/
;
_proto.getTicks = function getTicks() {

@@ -2379,5 +2381,5 @@ var self = this;

return rst;
}; // 将时间转换为时间戳
} // 将时间转换为时间戳
;
_proto._toTimeStamp = function _toTimeStamp(value) {

@@ -2453,8 +2455,8 @@ return TimeUtil.toTimeStamp(value);

this._minTick = null;
};
}
/**
* @override
*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -2510,5 +2512,5 @@ var self = this;

return ticks;
}; // 获取度量计算时,value占的定义域百分比
} // 获取度量计算时,value占的定义域百分比
;
_proto._getScalePercent = function _getScalePercent(value) {

@@ -2543,8 +2545,8 @@ var max = this.max;

return percent;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -2556,8 +2558,8 @@ var percent = this._getScalePercent(value);

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -2653,8 +2655,8 @@ var base = this.base;

this.exponent = 2;
};
}
/**
* @override
*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -2688,5 +2690,5 @@ var self = this;

return ticks;
}; // 获取度量计算时,value占的定义域百分比
} // 获取度量计算时,value占的定义域百分比
;
_proto._getScalePercent = function _getScalePercent(value) {

@@ -2703,8 +2705,8 @@ var max = this.max;

return percent;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -2716,8 +2718,8 @@ var percent = this._getScalePercent(value);

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -2724,0 +2726,0 @@ var percent = (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());

@@ -0,3 +1,13 @@

#### 0.1.1 (2019-03-08)
##### Chores
* add some comments. ([9d862592](https://github.com/antvis/scale/commit/9d8625926358517bd05219a829d7ca7d1ea29e98))
##### Bug Fixes
* Fix minimum calculation error. Closed [#7](https://github.com/antvis/scale/pull/7). ([07cd2ad2](https://github.com/antvis/scale/commit/07cd2ad294451164e0bfe074680acde5600387f3))
#### 0.0.1 (2018-06-25)
init.

@@ -1,1 +0,1 @@

!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.scale=n():t.scale=n()}("undefined"!=typeof self?self:this,function(){return function(t){function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=13)}([function(t,n,e){var i=e(16),r=e(1),a=e(7),o=e(2),u=function(){function t(t){this._initDefaultCfg(),i(this,t),this.init()}var n=t.prototype;return n._initDefaultCfg=function(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},n.init=function(){},n.getTicks=function(){var t=this,n=t.ticks,e=[];return r(n,function(n){var i;i=a(n)?n:{text:t.getText(n),tickValue:n,value:t.scale(n)},e.push(i)}),e},n.getText=function(t,n){var e=this.formatter;return t=e?e(t,n):t,!o(t)&&t.toString||(t=""),t.toString()},n.rangeMin=function(){return this.range[0]},n.rangeMax=function(){var t=this.range;return t[t.length-1]},n.invert=function(t){return t},n.translate=function(t){return t},n.scale=function(t){return t},n.clone=function(){var t=this,n=t.constructor,e={};return r(t,function(n,i){e[i]=t[i]}),new n(e)},n.change=function(t){return this.ticks=null,i(this,t),this.init(),this},t}();t.exports=u},function(t,n,e){var i=e(7),r=e(17);t.exports=function(t,n){if(t)if(r(t))for(var e=0,a=t.length;e<a&&!1!==n(t[e],e);e++);else if(i(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break}},function(t,n){t.exports=function(t){return null===t||void 0===t}},function(t,n){var e={}.toString;t.exports=function(t,n){return e.call(t)==="[object "+n+"]"}},function(t,n,e){var i=e(2),r=e(1),a=e(0),o=e(18),u=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this);this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},e.init=function(){if(this.ticks){var t=this.ticks,n=this.translate(t[0]),e=this.translate(t[t.length-1]);(i(this.min)||this.min>n)&&(this.min=n),(i(this.max)||this.max<e)&&(this.max=e)}else this.min=this.translate(this.min),this.max=this.translate(this.max),this.initTicks()},e.calculateTicks=function(){var t=this.min,n=this.max,e=this.minLimit,i=this.maxLimit,r=this.tickCount,a=this.tickInterval,u=this.minTickInterval,s=this.snapArray;if(1===r)throw new Error("linear scale'tickCount should not be 1");if(n<t)throw new Error("max: "+n+" should not be less than min: "+t);return o({min:t,max:n,minLimit:e,maxLimit:i,minCount:r,maxCount:r,interval:a,minTickInterval:u,snapArray:s}).ticks},e.initTicks=function(){var t=this,n=t.calculateTicks();if(t.nice)t.ticks=n,t.min=n[0],t.max=n[n.length-1];else{var e=[];r(n,function(n){n>=t.min&&n<=t.max&&e.push(n)}),e.length||(e.push(t.min),e.push(t.max)),t.ticks=e}},e.scale=function(t){if(i(t))return NaN;var n=this.max,e=this.min;if(n===e)return 0;var r=(t-e)/(n-e),a=this.rangeMin();return a+r*(this.rangeMax()-a)},e.invert=function(t){var n=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+n*(this.max-this.min)},n}(a);a.Linear=u,t.exports=u},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"Number")}},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"String")}},function(t,n){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){var n=void 0===t?"undefined":e(t);return null!==t&&"object"===n||"function"===n}},function(t,n){function e(t,n){var e=t.length;if(0===e)return NaN;var i=t[0];if(n<t[0])return NaN;if(n>=t[e-1])return t[e-1];for(var r=1;r<t.length&&!(n<t[r]);r++)i=t[r];return i}function i(t,n){var e=t.length;if(0===e)return NaN;var i;if(n>t[e-1])return NaN;if(n<t[0])return t[0];for(var r=1;r<t.length;r++)if(n<=t[r]){i=t[r];break}return i}var r=12,a={snapFactorTo:function(t,n,e){if(isNaN(t))return NaN;var i=1;if(0!==t){t<0&&(i=-1);var o=function(t){var n=1;if(t===1/0||t===-1/0)throw new Error("Not support Infinity!");if(t<1){for(var e=0;t<1;)n/=10,t*=10,e++;n.toString().length>r&&(n=parseFloat(n.toFixed(e)))}else for(;t>10;)n*=10,t/=10;return n}(t*=i);i*=o,t/=o}var u=(t="floor"===e?a.snapFloor(n,t):"ceil"===e?a.snapCeiling(n,t):a.snapTo(n,t))*i;if(Math.abs(i)<1&&u.toString().length>r){u=t/parseInt(1/i)*(i>0?1:-1)}return u},snapMultiple:function(t,n,e){return("ceil"===e?Math.ceil(t/n):"floor"===e?Math.floor(t/n):Math.round(t/n))*n},snapTo:function(t,n){var r=e(t,n),a=i(t,n);if(isNaN(r)||isNaN(a)){if(t[0]>=n)return t[0];var o=t[t.length-1];if(o<=n)return o}return Math.abs(n-r)<Math.abs(a-n)?r:a},snapFloor:function(t,n){return e(t,n)},snapCeiling:function(t,n){return i(t,n)},fixedBase:function(t,n){var e=n.toString(),i=e.indexOf(".");if(-1===i)return Math.round(t);var r=e.substr(i+1).length;return r>20&&(r=20),parseFloat(t.toFixed(r))}};t.exports=a},function(t,n,e){var i=e(0),r=e(10),a=e(1),o=e(5),u=e(6),s=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},e.init=function(){var t=this.values,n=this.tickCount;if(a(t,function(n,e){t[e]=n.toString()}),!this.ticks){var e=t;if(n){e=r({maxCount:n,data:t,isRounding:this.isRounding}).ticks}this.ticks=e}},e.getText=function(n){return-1===this.values.indexOf(n)&&o(n)&&(n=this.values[Math.round(n)]),t.prototype.getText.call(this,n)},e.translate=function(t){var n=this.values.indexOf(t);return-1===n&&o(t)?n=t:-1===n&&(n=NaN),n},e.scale=function(t){var n,e=this.rangeMin(),i=this.rangeMax();return(u(t)||-1!==this.values.indexOf(t))&&(t=this.translate(t)),n=this.values.length>1?t/(this.values.length-1):t,e+n*(i-e)},e.invert=function(t){if(u(t))return t;var n=this.rangeMin(),e=this.rangeMax();t<n&&(t=n),t>e&&(t=e);var i=(t-n)/(e-n),r=Math.round(i*(this.values.length-1))%this.values.length;return r=r||0,this.values[r]},n}(i);i.Cat=s,t.exports=s},function(t,n,e){var i=e(1);t.exports=function(t){var n,e={},r=[],a=t.isRounding,o=function(t){var n=[];return i(t,function(t){n=n.concat(t)}),n}(t.data),u=o.length,s=t.maxCount||8;if(a?2===(n=function(t,n){var e;for(e=n;e>0&&t%e!=0;e--);if(1===e)for(e=n;e>0&&(t-1)%e!=0;e--);return e}(u-1,s-1)+1)?n=s:n<s-4&&(n=s-4):n=s,!a&&u<=n+n/2)r=[].concat(o);else{for(var c=parseInt(u/(n-1),10),f=o.map(function(t,n){return n%c==0?o.slice(n,n+c):null}).filter(function(t){return t}),h=1,l=f.length;h<l&&(a?h*c<u-c:h<n-1);h++)r.push(f[h][0]);if(o.length){r.unshift(o[0]);var p=o[u-1];-1===r.indexOf(p)&&r.push(p)}}return e.categories=o,e.ticks=r,e}},function(t,n,e){var i;!function(r){"use strict";function a(t,n){for(var e=[],i=0,r=t.length;i<r;i++)e.push(t[i].substr(0,n));return e}function o(t){return function(n,e,i){var r=i[t].indexOf(e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());~r&&(n.month=r)}}function u(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}var s={},c=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,f=/\d\d?/,h=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,l=/\[([^]*?)\]/gm,p=function(){},m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"],g=a(v,3),d=a(m,3);s.i18n={dayNamesShort:d,dayNames:m,monthNamesShort:g,monthNames:v,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10)*t%10]}};var M={D:function(t){return t.getDate()},DD:function(t){return u(t.getDate())},Do:function(t,n){return n.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return u(t.getDay())},ddd:function(t,n){return n.dayNamesShort[t.getDay()]},dddd:function(t,n){return n.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return u(t.getMonth()+1)},MMM:function(t,n){return n.monthNamesShort[t.getMonth()]},MMMM:function(t,n){return n.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return u(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return u(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return u(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return u(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return u(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return u(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return u(t.getMilliseconds(),3)},a:function(t,n){return t.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(t,n){return t.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(t){var n=t.getTimezoneOffset();return(n>0?"-":"+")+u(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4)}},x={D:[f,function(t,n){t.day=n}],Do:[new RegExp(f.source+h.source),function(t,n){t.day=parseInt(n,10)}],M:[f,function(t,n){t.month=n-1}],YY:[f,function(t,n){var e=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(n>68?e-1:e)+n}],h:[f,function(t,n){t.hour=n}],m:[f,function(t,n){t.minute=n}],s:[f,function(t,n){t.second=n}],YYYY:[/\d{4}/,function(t,n){t.year=n}],S:[/\d/,function(t,n){t.millisecond=100*n}],SS:[/\d{2}/,function(t,n){t.millisecond=10*n}],SSS:[/\d{3}/,function(t,n){t.millisecond=n}],d:[f,p],ddd:[h,p],MMM:[h,o("monthNamesShort")],MMMM:[h,o("monthNames")],a:[h,function(t,n,e){var i=n.toLowerCase();i===e.amPm[0]?t.isPm=!1:i===e.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,n){"Z"===n&&(n="+00:00");var e,i=(n+"").match(/([\+\-]|\d\d)/gi);i&&(e=60*i[1]+parseInt(i[2],10),t.timezoneOffset="+"===i[0]?e:-e)}]};x.dd=x.d,x.dddd=x.ddd,x.DD=x.D,x.mm=x.m,x.hh=x.H=x.HH=x.h,x.MM=x.M,x.ss=x.s,x.A=x.a,s.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},s.format=function(t,n,e){var i=e||s.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");var r=[];return n=(n=s.masks[n]||n||s.masks.default).replace(l,function(t,n){return r.push(n),"??"}),(n=n.replace(c,function(n){return n in M?M[n](t,i):n.slice(1,n.length-1)})).replace(/\?\?/g,function(){return r.shift()})},s.parse=function(t,n,e){var i=e||s.i18n;if("string"!=typeof n)throw new Error("Invalid format in fecha.parse");if(n=s.masks[n]||n,t.length>1e3)return!1;var r=!0,a={};if(n.replace(c,function(n){if(x[n]){var e=x[n],o=t.search(e[0]);~o?t.replace(e[0],function(n){return e[1](a,n,i),t=t.substr(o+n.length),n}):r=!1}return x[n]?"":n.slice(1,n.length-1)}),!r)return!1;var o=new Date;!0===a.isPm&&null!=a.hour&&12!=+a.hour?a.hour=+a.hour+12:!1===a.isPm&&12==+a.hour&&(a.hour=0);var u;return null!=a.timezoneOffset?(a.minute=+(a.minute||0)-+a.timezoneOffset,u=new Date(Date.UTC(a.year||o.getFullYear(),a.month||0,a.day||1,a.hour||0,a.minute||0,a.second||0,a.millisecond||0))):u=new Date(a.year||o.getFullYear(),a.month||0,a.day||1,a.hour||0,a.minute||0,a.second||0,a.millisecond||0),u},void 0!==t&&t.exports?t.exports=s:void 0!==(i=function(){return s}.call(n,e,n,t))&&(t.exports=i)}()},function(t,n,e){var i=e(6),r=e(22);t.exports={toTimeStamp:function(t){return i(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),r(t)&&(t=t.getTime()),t}}},function(t,n,e){var i=e(14),r=e(0);r.Linear=e(4),r.Identity=e(19),r.Cat=e(9),r.Time=e(20),r.TimeCat=e(23),r.Log=e(24),r.Pow=e(25);var a=function(t){if(r.hasOwnProperty(t)){var n=i(t);r[n]=function(n){return new r[t](n)}}};for(var o in r)a(o);var u=["cat","timeCat"];r.isCategory=function(t){return u.indexOf(t)>=0},t.exports=r},function(t,n,e){var i=e(15);t.exports=function(t){var n=i(t);return n.charAt(0).toLowerCase()+n.substring(1)}},function(t,n,e){var i=e(2);t.exports=function(t){return i(t)?"":t.toString()}},function(t,n){function e(t,n){for(var e in n)n.hasOwnProperty(e)&&"constructor"!==e&&void 0!==n[e]&&(t[e]=n[e])}t.exports=function(t,n,i,r){return n&&e(t,n),i&&e(t,i),r&&e(t,r),t}},function(t,n,e){var i=e(3),r=Array.isArray?Array.isArray:function(t){return i(t,"Array")};t.exports=r},function(t,n,e){var i=e(2),r=e(5),a=e(8),o=[0,1,1.2,1.5,1.6,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],u=[0,1,2,4,5,10];t.exports=function(t){var n=t.min,e=t.max,s=t.interval,c=t.minTickInterval,f=[],h=t.minCount||5,l=t.maxCount||7,p=h===l,m=i(t.minLimit)?-1/0:t.minLimit,v=i(t.maxLimit)?1/0:t.maxLimit,g=(h+l)/2,d=g,M=t.snapArray?t.snapArray:p?o:u;if(n===m&&e===v&&p&&(s=(e-n)/(d-1)),i(n)&&(n=0),i(e)&&(e=0),e===n&&(0===n?e=1:n>0?n=0:e=0,e-n<5&&!s&&e-n>=1&&(s=1)),i(s)){var x=(e-n)/(g-1);s=a.snapFactorTo(x,M,"ceil"),l!==h&&((d=parseInt((e-n)/s,10))>l&&(d=l),d<h&&(d=h),s=a.snapFactorTo((e-n)/(d-1),M,"floor"))}if(r(c)&&s<c&&(s=c),t.interval||l!==h)e=Math.min(a.snapMultiple(e,s,"ceil"),v),n=Math.max(a.snapMultiple(n,s,"floor"),m),d=Math.round((e-n)/s),n=a.fixedBase(n,s),e=a.fixedBase(e,s);else{g=parseInt(g,10);var y,D=(e+n)/2,T=a.snapMultiple(D,s,"ceil"),k=Math.floor((g-2)/2),_=T+k*s;y=g%2==0?T-k*s:T-(k+1)*s,_<e&&(_+=s),y>n&&(y-=s),e=a.fixedBase(_,s),n=a.fixedBase(y,s)}e=Math.min(e,v),n=Math.max(n,m),f.push(n);for(var S=1;S<d;S++){var b=a.fixedBase(s*S+n,s);b<e&&f.push(b)}return f[f.length-1]<e&&f.push(e),{min:n,max:e,interval:s,count:d,ticks:f}}},function(t,n,e){var i=e(0),r=e(5),a=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.isIdentity=!0,this.type="identity",this.value=null},e.getText=function(){return this.value.toString()},e.scale=function(t){return this.value!==t&&r(t)?t:this.range[0]},e.invert=function(){return this.value},n}(i);i.Identity=a,t.exports=a},function(t,n,e){var i=e(11),r=e(1),a=e(2),o=e(6),u=e(0),s=e(4),c=e(21),f=e(12),h=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="time",this.mask="YYYY-MM-DD"},e.init=function(){var n=this,e=n.values;if(e&&e.length){var i=[],o=1/0,u=o,s=0;r(e,function(t){var e=n._toTimeStamp(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t);o>e?(u=o,o=e):u>e&&(u=e),s<e&&(s=e),i.push(e)}),e.length>1&&(n.minTickInterval=u-o),(a(n.min)||n._toTimeStamp(n.min)>o)&&(n.min=o),(a(n.max)||n._toTimeStamp(n.max)<s)&&(n.max=s)}t.prototype.init.call(this)},e.calculateTicks=function(){var t=this.min,n=this.max,e=this.tickCount,i=this.tickInterval;return c({min:t,max:n,minCount:e,maxCount:e,interval:i,minInterval:this.minTickInterval}).ticks},e.getText=function(t){var n=this.formatter;return t=this.translate(t),t=n?n(t):i.format(t,this.mask)},e.scale=function(n){return o(n)&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.translate=function(t){return this._toTimeStamp(t)},e._toTimeStamp=function(t){return f.toTimeStamp(t)},n}(s);u.Time=h,t.exports=h},function(t,n,e){function i(t){return new Date(t).getFullYear()}function r(t){return new Date(t,0,1).getTime()}function a(t){return new Date(t).getMonth()}function o(t,n){return new Date(t,n,1).getTime()}var u=e(8),s=e(2),c=[1,2,4,6,8,12],f=36e5,h=864e5;t.exports=function(t){var n,e=t.minInterval,l=[],p=t.min,m=t.max,v=t.interval;if(m===p&&(m=p+h),s(v)){var g=m-p,d=h,M=365*d;v=parseInt(g/(t.maxCount||6),10),e&&e>v&&(v=e);var x=v/M,y=i(p);if(x>.51){for(var D=Math.ceil(x),T=i(m),k=y;k<=T+D;k+=D)l.push(r(k));v=null}else if(x>.0834){for(var _=Math.ceil(x/.0834),S=a(p),b=function(t,n){var e=i(t),r=i(n),o=a(t);return 12*(r-e)+(a(n)-o)%12}(p,m),C=0;C<=b+_;C+=_)l.push(o(y,C+S));v=null}else if(v>.5*d){var Y=new Date(p),w=Y.getFullYear(),N=Y.getMonth(p),F=Y.getDate(),O=Math.ceil(v/d),I=function(t,n){return Math.ceil((n-t)/h)}(p,m);v=O*d;for(var H=0;H<I+O;H+=O)l.push(new Date(w,N,F+H).getTime())}else if(v>f){var P=new Date(p),A=P.getFullYear(),L=P.getMonth(p),j=P.getDate(),E=P.getHours(),Z=u.snapTo(c,Math.ceil(v/f)),B=function(t,n){return Math.ceil((n-t)/f)}(p,m);v=Z*f;for(var R=0;R<=B+Z;R+=Z)l.push(new Date(A,L,j,E+R).getTime())}else if(v>6e4){var z=function(t,n){return Math.ceil((n-t)/6e4)}(p,m),U=Math.ceil(v/6e4);v=6e4*U;for(var J=0;J<=z+U;J+=U)l.push(p+6e4*J)}else{v<1e3&&(v=1e3),p=1e3*Math.floor(p/1e3);var V=Math.ceil((m-p)/1e3),W=Math.ceil(v/1e3);v=1e3*W;for(var q=0;q<V+W;q+=W)l.push(p+1e3*q)}}if(!l.length){p=1e3*Math.floor(p/1e3),n=((m=1e3*Math.ceil(m/1e3))-p)/v;for(var G=0;G<=n;G++)l.push(u.fixedBase(v*G+p,v))}return{max:m,min:p,interval:v,ticks:l,count:l.length}}},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"Date")}},function(t,n,e){var i=e(0),r=e(9),a=e(11),o=e(10),u=e(12),s=e(1),c=e(5),f=e(7),h=e(6),l=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="timeCat",this.sortable=!0,this.tickCount=5,this.mask="YYYY-MM-DD"},e.init=function(){var t=this,n=this.values;s(n,function(e,i){n[i]=t._toTimeStamp(e)}),this.sortable&&n.sort(function(t,n){return t-n}),t.ticks||(t.ticks=this.calculateTicks())},e.calculateTicks=function(){var t,n=this.tickCount;if(n){t=o({maxCount:n,data:this.values,isRounding:this.isRounding}).ticks}else t=this.values;return t},e.translate=function(t){t=this._toTimeStamp(t);var n=this.values.indexOf(t);return-1===n&&(n=c(t)&&t<this.values.length?t:NaN),n},e.scale=function(t){var n,e=this.rangeMin(),i=this.rangeMax(),r=this.translate(t);return n=1===this.values.length||isNaN(r)?r:r>-1?r/(this.values.length-1):0,e+n*(i-e)},e.getText=function(t){var n="",e=this.translate(t);n=e>-1?this.values[e]:t;var i=this.formatter;return n=parseInt(n,10),n=i?i(n):a.format(n,this.mask)},e.getTicks=function(){var t=this,n=this.ticks,e=[];return s(n,function(n){var i;i=f(n)?n:{text:h(n)?n:t.getText(n),value:t.scale(n),tickValue:n},e.push(i)}),e},e._toTimeStamp=function(t){return u.toTimeStamp(t)},n}(r);i.TimeCat=l,t.exports=l},function(t,n,e){function i(t,n){return 1===t?1:Math.log(n)/Math.log(t)}var r=e(1),a=e(0),o=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="log",this.tickCount=10,this.base=2,this._minTick=null},e.calculateTicks=function(){var t,n=this.base;if(this.min<0)throw new Error("The minimum value must be greater than zero!");var e=i(n,this.max);if(this.min>0)t=Math.floor(i(n,this.min));else{var a=this.values,o=this.max;r(a,function(t){t>0&&t<o&&(o=t)}),o===this.max&&(o=this.max/n),o>1&&(o=1),t=Math.floor(i(n,o)),this._minTick=t,this.positiveMin=o}for(var u=e-t,s=this.tickCount,c=Math.ceil(u/s),f=[],h=t;h<e+c;h+=c)f.push(Math.pow(n,h));return 0===this.min&&f.unshift(0),f},e._getScalePercent=function(t){var n=this.max,e=this.min;if(n===e)return 0;if(t<=0)return 0;var r=this.base,a=this.positiveMin;a&&(e=1*a/r);return t<a?t/a/(i(r,n)-i(r,e)):(i(r,t)-i(r,e))/(i(r,n)-i(r,e))},e.scale=function(t){var n=this._getScalePercent(t),e=this.rangeMin();return e+n*(this.rangeMax()-e)},e.invert=function(t){var n,e=this.base,r=i(e,this.max),a=this.rangeMin(),o=this.rangeMax()-a,u=this.positiveMin;if(u){if(0===t)return 0;var s=1/(r-(n=i(e,u/e)))*o;if(t<s)return t/s*u}else n=i(e,this.min);var c=(t-a)/o*(r-n)+n;return Math.pow(e,c)},n}(e(4));a.Log=o,t.exports=o},function(t,n,e){function i(t,n){var e=Math.E;return Math.pow(e,Math.log(n)/t)}var r=e(0),a=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="pow",this.tickCount=10,this.exponent=2},e.calculateTicks=function(){var t,n=this.exponent,e=Math.ceil(i(n,this.max));if((t=this.min>=0?Math.floor(i(n,this.min)):0)>e){var r=e;e=t,t=r}for(var a=e-t,o=this.tickCount,u=Math.ceil(a/o),s=[],c=t;c<e+u;c+=u)s.push(Math.pow(c,n));return s},e._getScalePercent=function(t){var n=this.max,e=this.min;if(n===e)return 0;var r=this.exponent;return(i(r,t)-i(r,e))/(i(r,n)-i(r,e))},e.scale=function(t){var n=this._getScalePercent(t),e=this.rangeMin();return e+n*(this.rangeMax()-e)},e.invert=function(t){var n=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin()),e=this.exponent,r=i(e,this.max),a=i(e,this.min),o=n*(r-a)+a;return Math.pow(o,e)},n}(e(4));r.Pow=a,t.exports=a}])});
!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.scale=n():t.scale=n()}("undefined"!=typeof self?self:this,function(){return function(t){function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}var e={};return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{configurable:!1,enumerable:!0,get:i})},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},n.p="",n(n.s=13)}([function(t,n,e){var i=e(16),r=e(1),a=e(7),o=e(2),u=function(){function t(t){this._initDefaultCfg(),i(this,t),this.init()}var n=t.prototype;return n._initDefaultCfg=function(){this.type="base",this.formatter=null,this.range=[0,1],this.ticks=null,this.values=[]},n.init=function(){},n.getTicks=function(){var t=this,n=t.ticks,e=[];return r(n,function(n){var i;i=a(n)?n:{text:t.getText(n),tickValue:n,value:t.scale(n)},e.push(i)}),e},n.getText=function(t,n){var e=this.formatter;return t=e?e(t,n):t,!o(t)&&t.toString||(t=""),t.toString()},n.rangeMin=function(){return this.range[0]},n.rangeMax=function(){var t=this.range;return t[t.length-1]},n.invert=function(t){return t},n.translate=function(t){return t},n.scale=function(t){return t},n.clone=function(){var t=this,n=t.constructor,e={};return r(t,function(n,i){e[i]=t[i]}),new n(e)},n.change=function(t){return this.ticks=null,i(this,t),this.init(),this},t}();t.exports=u},function(t,n,e){var i=e(7),r=e(17);t.exports=function(t,n){if(t)if(r(t))for(var e=0,a=t.length;e<a&&!1!==n(t[e],e);e++);else if(i(t))for(var o in t)if(t.hasOwnProperty(o)&&!1===n(t[o],o))break}},function(t,n){t.exports=function(t){return null===t||void 0===t}},function(t,n){var e={}.toString;t.exports=function(t,n){return e.call(t)==="[object "+n+"]"}},function(t,n,e){var i=e(2),r=e(1),a=e(0),o=e(18),u=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this);this.type="linear",this.isLinear=!0,this.nice=!1,this.min=null,this.minLimit=null,this.max=null,this.maxLimit=null,this.tickCount=null,this.tickInterval=null,this.minTickInterval=null,this.snapArray=null},e.init=function(){if(this.ticks){var t=this.ticks,n=this.translate(t[0]),e=this.translate(t[t.length-1]);(i(this.min)||this.min>n)&&(this.min=n),(i(this.max)||this.max<e)&&(this.max=e)}else this.min=this.translate(this.min),this.max=this.translate(this.max),this.initTicks()},e.calculateTicks=function(){var t=this.min,n=this.max,e=this.minLimit,i=this.maxLimit,r=this.tickCount,a=this.tickInterval,u=this.minTickInterval,s=this.snapArray;if(1===r)throw new Error("linear scale'tickCount should not be 1");if(n<t)throw new Error("max: "+n+" should not be less than min: "+t);return o({min:t,max:n,minLimit:e,maxLimit:i,minCount:r,maxCount:r,interval:a,minTickInterval:u,snapArray:s}).ticks},e.initTicks=function(){var t=this,n=t.calculateTicks();if(t.nice)t.ticks=n,t.min=n[0],t.max=n[n.length-1];else{var e=[];r(n,function(n){n>=t.min&&n<=t.max&&e.push(n)}),e.length||(e.push(t.min),e.push(t.max)),t.ticks=e}},e.scale=function(t){if(i(t))return NaN;var n=this.max,e=this.min;if(n===e)return 0;var r=(t-e)/(n-e),a=this.rangeMin();return a+r*(this.rangeMax()-a)},e.invert=function(t){var n=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin());return this.min+n*(this.max-this.min)},n}(a);a.Linear=u,t.exports=u},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"Number")}},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"String")}},function(t,n){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};t.exports=function(t){var n=void 0===t?"undefined":e(t);return null!==t&&"object"===n||"function"===n}},function(t,n){function e(t,n){var e=t.length;if(0===e)return NaN;var i=t[0];if(n<t[0])return NaN;if(n>=t[e-1])return t[e-1];for(var r=1;r<t.length&&!(n<t[r]);r++)i=t[r];return i}function i(t,n){var e=t.length;if(0===e)return NaN;var i;if(n>t[e-1])return NaN;if(n<t[0])return t[0];for(var r=1;r<t.length;r++)if(n<=t[r]){i=t[r];break}return i}var r=12,a={snapFactorTo:function(t,n,e){if(isNaN(t))return NaN;var i=1;if(0!==t){t<0&&(i=-1);var o=function(t){var n=1;if(t===1/0||t===-1/0)throw new Error("Not support Infinity!");if(t<1){for(var e=0;t<1;)n/=10,t*=10,e++;n.toString().length>r&&(n=parseFloat(n.toFixed(e)))}else for(;t>10;)n*=10,t/=10;return n}(t*=i);i*=o,t/=o}var u=(t="floor"===e?a.snapFloor(n,t):"ceil"===e?a.snapCeiling(n,t):a.snapTo(n,t))*i;if(Math.abs(i)<1&&u.toString().length>r){u=t/parseInt(1/i)*(i>0?1:-1)}return u},snapMultiple:function(t,n,e){return("ceil"===e?Math.ceil(t/n):"floor"===e?Math.floor(t/n):Math.round(t/n))*n},snapTo:function(t,n){var r=e(t,n),a=i(t,n);if(isNaN(r)||isNaN(a)){if(t[0]>=n)return t[0];var o=t[t.length-1];if(o<=n)return o}return Math.abs(n-r)<Math.abs(a-n)?r:a},snapFloor:function(t,n){return e(t,n)},snapCeiling:function(t,n){return i(t,n)},fixedBase:function(t,n){var e=n.toString(),i=e.indexOf(".");if(-1===i)return Math.round(t);var r=e.substr(i+1).length;return r>20&&(r=20),parseFloat(t.toFixed(r))}};t.exports=a},function(t,n,e){var i=e(0),r=e(10),a=e(1),o=e(5),u=e(6),s=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="cat",this.isCategory=!0,this.isRounding=!0},e.init=function(){var t=this.values,n=this.tickCount;if(a(t,function(n,e){t[e]=n.toString()}),!this.ticks){var e=t;if(n){e=r({maxCount:n,data:t,isRounding:this.isRounding}).ticks}this.ticks=e}},e.getText=function(n){return-1===this.values.indexOf(n)&&o(n)&&(n=this.values[Math.round(n)]),t.prototype.getText.call(this,n)},e.translate=function(t){var n=this.values.indexOf(t);return-1===n&&o(t)?n=t:-1===n&&(n=NaN),n},e.scale=function(t){var n,e=this.rangeMin(),i=this.rangeMax();return(u(t)||-1!==this.values.indexOf(t))&&(t=this.translate(t)),n=this.values.length>1?t/(this.values.length-1):t,e+n*(i-e)},e.invert=function(t){if(u(t))return t;var n=this.rangeMin(),e=this.rangeMax();t<n&&(t=n),t>e&&(t=e);var i=(t-n)/(e-n),r=Math.round(i*(this.values.length-1))%this.values.length;return r=r||0,this.values[r]},n}(i);i.Cat=s,t.exports=s},function(t,n,e){var i=e(1);t.exports=function(t){var n,e={},r=[],a=t.isRounding,o=function(t){var n=[];return i(t,function(t){n=n.concat(t)}),n}(t.data),u=o.length,s=t.maxCount||8;if(a?2===(n=function(t,n){var e;for(e=n;e>0&&t%e!=0;e--);if(1===e)for(e=n;e>0&&(t-1)%e!=0;e--);return e}(u-1,s-1)+1)?n=s:n<s-4&&(n=s-4):n=s,!a&&u<=n+n/2)r=[].concat(o);else{for(var c=parseInt(u/(n-1),10),f=o.map(function(t,n){return n%c==0?o.slice(n,n+c):null}).filter(function(t){return t}),h=1,l=f.length;h<l&&(a?h*c<u-c:h<n-1);h++)r.push(f[h][0]);if(o.length){r.unshift(o[0]);var p=o[u-1];-1===r.indexOf(p)&&r.push(p)}}return e.categories=o,e.ticks=r,e}},function(t,n,e){var i;!function(r){"use strict";function a(t,n){for(var e=[],i=0,r=t.length;i<r;i++)e.push(t[i].substr(0,n));return e}function o(t){return function(n,e,i){var r=i[t].indexOf(e.charAt(0).toUpperCase()+e.substr(1).toLowerCase());~r&&(n.month=r)}}function u(t,n){for(t=String(t),n=n||2;t.length<n;)t="0"+t;return t}var s={},c=/d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,f=/\d\d?/,h=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,l=/\[([^]*?)\]/gm,p=function(){},m=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],v=["January","February","March","April","May","June","July","August","September","October","November","December"],g=a(v,3),d=a(m,3);s.i18n={dayNamesShort:d,dayNames:m,monthNamesShort:g,monthNames:v,amPm:["am","pm"],DoFn:function(t){return t+["th","st","nd","rd"][t%10>3?0:(t-t%10!=10)*t%10]}};var M={D:function(t){return t.getDate()},DD:function(t){return u(t.getDate())},Do:function(t,n){return n.DoFn(t.getDate())},d:function(t){return t.getDay()},dd:function(t){return u(t.getDay())},ddd:function(t,n){return n.dayNamesShort[t.getDay()]},dddd:function(t,n){return n.dayNames[t.getDay()]},M:function(t){return t.getMonth()+1},MM:function(t){return u(t.getMonth()+1)},MMM:function(t,n){return n.monthNamesShort[t.getMonth()]},MMMM:function(t,n){return n.monthNames[t.getMonth()]},YY:function(t){return String(t.getFullYear()).substr(2)},YYYY:function(t){return u(t.getFullYear(),4)},h:function(t){return t.getHours()%12||12},hh:function(t){return u(t.getHours()%12||12)},H:function(t){return t.getHours()},HH:function(t){return u(t.getHours())},m:function(t){return t.getMinutes()},mm:function(t){return u(t.getMinutes())},s:function(t){return t.getSeconds()},ss:function(t){return u(t.getSeconds())},S:function(t){return Math.round(t.getMilliseconds()/100)},SS:function(t){return u(Math.round(t.getMilliseconds()/10),2)},SSS:function(t){return u(t.getMilliseconds(),3)},a:function(t,n){return t.getHours()<12?n.amPm[0]:n.amPm[1]},A:function(t,n){return t.getHours()<12?n.amPm[0].toUpperCase():n.amPm[1].toUpperCase()},ZZ:function(t){var n=t.getTimezoneOffset();return(n>0?"-":"+")+u(100*Math.floor(Math.abs(n)/60)+Math.abs(n)%60,4)}},x={D:[f,function(t,n){t.day=n}],Do:[new RegExp(f.source+h.source),function(t,n){t.day=parseInt(n,10)}],M:[f,function(t,n){t.month=n-1}],YY:[f,function(t,n){var e=+(""+(new Date).getFullYear()).substr(0,2);t.year=""+(n>68?e-1:e)+n}],h:[f,function(t,n){t.hour=n}],m:[f,function(t,n){t.minute=n}],s:[f,function(t,n){t.second=n}],YYYY:[/\d{4}/,function(t,n){t.year=n}],S:[/\d/,function(t,n){t.millisecond=100*n}],SS:[/\d{2}/,function(t,n){t.millisecond=10*n}],SSS:[/\d{3}/,function(t,n){t.millisecond=n}],d:[f,p],ddd:[h,p],MMM:[h,o("monthNamesShort")],MMMM:[h,o("monthNames")],a:[h,function(t,n,e){var i=n.toLowerCase();i===e.amPm[0]?t.isPm=!1:i===e.amPm[1]&&(t.isPm=!0)}],ZZ:[/([\+\-]\d\d:?\d\d|Z)/,function(t,n){"Z"===n&&(n="+00:00");var e,i=(n+"").match(/([\+\-]|\d\d)/gi);i&&(e=60*i[1]+parseInt(i[2],10),t.timezoneOffset="+"===i[0]?e:-e)}]};x.dd=x.d,x.dddd=x.ddd,x.DD=x.D,x.mm=x.m,x.hh=x.H=x.HH=x.h,x.MM=x.M,x.ss=x.s,x.A=x.a,s.masks={default:"ddd MMM DD YYYY HH:mm:ss",shortDate:"M/D/YY",mediumDate:"MMM D, YYYY",longDate:"MMMM D, YYYY",fullDate:"dddd, MMMM D, YYYY",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},s.format=function(t,n,e){var i=e||s.i18n;if("number"==typeof t&&(t=new Date(t)),"[object Date]"!==Object.prototype.toString.call(t)||isNaN(t.getTime()))throw new Error("Invalid Date in fecha.format");var r=[];return n=(n=s.masks[n]||n||s.masks.default).replace(l,function(t,n){return r.push(n),"??"}),(n=n.replace(c,function(n){return n in M?M[n](t,i):n.slice(1,n.length-1)})).replace(/\?\?/g,function(){return r.shift()})},s.parse=function(t,n,e){var i=e||s.i18n;if("string"!=typeof n)throw new Error("Invalid format in fecha.parse");if(n=s.masks[n]||n,t.length>1e3)return!1;var r=!0,a={};if(n.replace(c,function(n){if(x[n]){var e=x[n],o=t.search(e[0]);~o?t.replace(e[0],function(n){return e[1](a,n,i),t=t.substr(o+n.length),n}):r=!1}return x[n]?"":n.slice(1,n.length-1)}),!r)return!1;var o=new Date;!0===a.isPm&&null!=a.hour&&12!=+a.hour?a.hour=+a.hour+12:!1===a.isPm&&12==+a.hour&&(a.hour=0);var u;return null!=a.timezoneOffset?(a.minute=+(a.minute||0)-+a.timezoneOffset,u=new Date(Date.UTC(a.year||o.getFullYear(),a.month||0,a.day||1,a.hour||0,a.minute||0,a.second||0,a.millisecond||0))):u=new Date(a.year||o.getFullYear(),a.month||0,a.day||1,a.hour||0,a.minute||0,a.second||0,a.millisecond||0),u},void 0!==t&&t.exports?t.exports=s:void 0!==(i=function(){return s}.call(n,e,n,t))&&(t.exports=i)}()},function(t,n,e){var i=e(6),r=e(22);t.exports={toTimeStamp:function(t){return i(t)&&(t=t.indexOf("T")>0?new Date(t).getTime():new Date(t.replace(/-/gi,"/")).getTime()),r(t)&&(t=t.getTime()),t}}},function(t,n,e){var i=e(14),r=e(0);r.Linear=e(4),r.Identity=e(19),r.Cat=e(9),r.Time=e(20),r.TimeCat=e(23),r.Log=e(24),r.Pow=e(25);var a=function(t){if(r.hasOwnProperty(t)){var n=i(t);r[n]=function(n){return new r[t](n)}}};for(var o in r)a(o);var u=["cat","timeCat"];r.isCategory=function(t){return u.indexOf(t)>=0},t.exports=r},function(t,n,e){var i=e(15);t.exports=function(t){var n=i(t);return n.charAt(0).toLowerCase()+n.substring(1)}},function(t,n,e){var i=e(2);t.exports=function(t){return i(t)?"":t.toString()}},function(t,n){function e(t,n){for(var e in n)n.hasOwnProperty(e)&&"constructor"!==e&&void 0!==n[e]&&(t[e]=n[e])}t.exports=function(t,n,i,r){return n&&e(t,n),i&&e(t,i),r&&e(t,r),t}},function(t,n,e){var i=e(3),r=Array.isArray?Array.isArray:function(t){return i(t,"Array")};t.exports=r},function(t,n,e){var i=e(2),r=e(5),a=e(8),o=[0,1,1.2,1.5,1.6,2,2.2,2.4,2.5,3,4,5,6,7.5,8,10],u=[0,1,2,4,5,10];t.exports=function(t){var n=t.min,e=t.max,s=t.interval,c=t.minTickInterval,f=[],h=t.minCount||5,l=t.maxCount||7,p=h===l,m=i(t.minLimit)?-1/0:t.minLimit,v=i(t.maxLimit)?1/0:t.maxLimit,g=(h+l)/2,d=g,M=t.snapArray?t.snapArray:p?o:u;if(n===m&&e===v&&p&&(s=(e-n)/(d-1)),i(n)&&(n=0),i(e)&&(e=0),e===n&&(0===n?e=1:n>0?n=0:e=0,e-n<5&&!s&&e-n>=1&&(s=1)),i(s)){var x=(e-n)/(g-1);s=a.snapFactorTo(x,M,"ceil"),l!==h&&((d=parseInt((e-n)/s,10))>l&&(d=l),d<h&&(d=h),s=a.snapFactorTo((e-n)/(d-1),M,"floor"))}if(r(c)&&s<c&&(s=c),t.interval||l!==h)e=Math.min(a.snapMultiple(e,s,"ceil"),v),n=Math.max(a.snapMultiple(n,s,"floor"),m),d=Math.round((e-n)/s),n=a.fixedBase(n,s),e=a.fixedBase(e,s);else{g=parseInt(g,10);var y,D=(e+n)/2,T=a.snapMultiple(D,s,"ceil"),k=Math.floor((g-2)/2),_=T+k*s;for(y=g%2==0?T-k*s:T-(k+1)*s;_<e;)_=a.fixedBase(_+s,s);for(;y>n;)y=a.fixedBase(y-s,s);e=_,n=y}e=Math.min(e,v),n=Math.max(n,m),f.push(n);for(var S=1;S<d;S++){var b=a.fixedBase(s*S+n,s);b<e&&f.push(b)}return f[f.length-1]<e&&f.push(e),{min:n,max:e,interval:s,count:d,ticks:f}}},function(t,n,e){var i=e(0),r=e(5),a=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.isIdentity=!0,this.type="identity",this.value=null},e.getText=function(){return this.value.toString()},e.scale=function(t){return this.value!==t&&r(t)?t:this.range[0]},e.invert=function(){return this.value},n}(i);i.Identity=a,t.exports=a},function(t,n,e){var i=e(11),r=e(1),a=e(2),o=e(6),u=e(0),s=e(4),c=e(21),f=e(12),h=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="time",this.mask="YYYY-MM-DD"},e.init=function(){var n=this,e=n.values;if(e&&e.length){var i=[],o=1/0,u=o,s=0;r(e,function(t){var e=n._toTimeStamp(t);if(isNaN(e))throw new TypeError("Invalid Time: "+t);o>e?(u=o,o=e):u>e&&(u=e),s<e&&(s=e),i.push(e)}),e.length>1&&(n.minTickInterval=u-o),(a(n.min)||n._toTimeStamp(n.min)>o)&&(n.min=o),(a(n.max)||n._toTimeStamp(n.max)<s)&&(n.max=s)}t.prototype.init.call(this)},e.calculateTicks=function(){var t=this.min,n=this.max,e=this.tickCount,i=this.tickInterval;return c({min:t,max:n,minCount:e,maxCount:e,interval:i,minInterval:this.minTickInterval}).ticks},e.getText=function(t){var n=this.formatter;return t=this.translate(t),t=n?n(t):i.format(t,this.mask)},e.scale=function(n){return o(n)&&(n=this.translate(n)),t.prototype.scale.call(this,n)},e.translate=function(t){return this._toTimeStamp(t)},e._toTimeStamp=function(t){return f.toTimeStamp(t)},n}(s);u.Time=h,t.exports=h},function(t,n,e){function i(t){return new Date(t).getFullYear()}function r(t){return new Date(t,0,1).getTime()}function a(t){return new Date(t).getMonth()}function o(t,n){return new Date(t,n,1).getTime()}var u=e(8),s=e(2),c=[1,2,4,6,8,12],f=36e5,h=864e5;t.exports=function(t){var n,e=t.minInterval,l=[],p=t.min,m=t.max,v=t.interval;if(m===p&&(m=p+h),s(v)){var g=m-p,d=h,M=365*d;v=parseInt(g/(t.maxCount||6),10),e&&e>v&&(v=e);var x=v/M,y=i(p);if(x>.51){for(var D=Math.ceil(x),T=i(m),k=y;k<=T+D;k+=D)l.push(r(k));v=null}else if(x>.0834){for(var _=Math.ceil(x/.0834),S=a(p),b=function(t,n){var e=i(t),r=i(n),o=a(t);return 12*(r-e)+(a(n)-o)%12}(p,m),C=0;C<=b+_;C+=_)l.push(o(y,C+S));v=null}else if(v>.5*d){var Y=new Date(p),w=Y.getFullYear(),N=Y.getMonth(p),F=Y.getDate(),O=Math.ceil(v/d),I=function(t,n){return Math.ceil((n-t)/h)}(p,m);v=O*d;for(var H=0;H<I+O;H+=O)l.push(new Date(w,N,F+H).getTime())}else if(v>f){var P=new Date(p),A=P.getFullYear(),L=P.getMonth(p),j=P.getDate(),E=P.getHours(),Z=u.snapTo(c,Math.ceil(v/f)),B=function(t,n){return Math.ceil((n-t)/f)}(p,m);v=Z*f;for(var R=0;R<=B+Z;R+=Z)l.push(new Date(A,L,j,E+R).getTime())}else if(v>6e4){var z=function(t,n){return Math.ceil((n-t)/6e4)}(p,m),U=Math.ceil(v/6e4);v=6e4*U;for(var J=0;J<=z+U;J+=U)l.push(p+6e4*J)}else{v<1e3&&(v=1e3),p=1e3*Math.floor(p/1e3);var V=Math.ceil((m-p)/1e3),W=Math.ceil(v/1e3);v=1e3*W;for(var q=0;q<V+W;q+=W)l.push(p+1e3*q)}}if(!l.length){p=1e3*Math.floor(p/1e3),n=((m=1e3*Math.ceil(m/1e3))-p)/v;for(var G=0;G<=n;G++)l.push(u.fixedBase(v*G+p,v))}return{max:m,min:p,interval:v,ticks:l,count:l.length}}},function(t,n,e){var i=e(3);t.exports=function(t){return i(t,"Date")}},function(t,n,e){var i=e(0),r=e(9),a=e(11),o=e(10),u=e(12),s=e(1),c=e(5),f=e(7),h=e(6),l=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="timeCat",this.sortable=!0,this.tickCount=5,this.mask="YYYY-MM-DD"},e.init=function(){var t=this,n=this.values;s(n,function(e,i){n[i]=t._toTimeStamp(e)}),this.sortable&&n.sort(function(t,n){return t-n}),t.ticks||(t.ticks=this.calculateTicks())},e.calculateTicks=function(){var t,n=this.tickCount;if(n){t=o({maxCount:n,data:this.values,isRounding:this.isRounding}).ticks}else t=this.values;return t},e.translate=function(t){t=this._toTimeStamp(t);var n=this.values.indexOf(t);return-1===n&&(n=c(t)&&t<this.values.length?t:NaN),n},e.scale=function(t){var n,e=this.rangeMin(),i=this.rangeMax(),r=this.translate(t);return n=1===this.values.length||isNaN(r)?r:r>-1?r/(this.values.length-1):0,e+n*(i-e)},e.getText=function(t){var n="",e=this.translate(t);n=e>-1?this.values[e]:t;var i=this.formatter;return n=parseInt(n,10),n=i?i(n):a.format(n,this.mask)},e.getTicks=function(){var t=this,n=this.ticks,e=[];return s(n,function(n){var i;i=f(n)?n:{text:h(n)?n:t.getText(n),value:t.scale(n),tickValue:n},e.push(i)}),e},e._toTimeStamp=function(t){return u.toTimeStamp(t)},n}(r);i.TimeCat=l,t.exports=l},function(t,n,e){function i(t,n){return 1===t?1:Math.log(n)/Math.log(t)}var r=e(1),a=e(0),o=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="log",this.tickCount=10,this.base=2,this._minTick=null},e.calculateTicks=function(){var t,n=this.base;if(this.min<0)throw new Error("The minimum value must be greater than zero!");var e=i(n,this.max);if(this.min>0)t=Math.floor(i(n,this.min));else{var a=this.values,o=this.max;r(a,function(t){t>0&&t<o&&(o=t)}),o===this.max&&(o=this.max/n),o>1&&(o=1),t=Math.floor(i(n,o)),this._minTick=t,this.positiveMin=o}for(var u=e-t,s=this.tickCount,c=Math.ceil(u/s),f=[],h=t;h<e+c;h+=c)f.push(Math.pow(n,h));return 0===this.min&&f.unshift(0),f},e._getScalePercent=function(t){var n=this.max,e=this.min;if(n===e)return 0;if(t<=0)return 0;var r=this.base,a=this.positiveMin;a&&(e=1*a/r);return t<a?t/a/(i(r,n)-i(r,e)):(i(r,t)-i(r,e))/(i(r,n)-i(r,e))},e.scale=function(t){var n=this._getScalePercent(t),e=this.rangeMin();return e+n*(this.rangeMax()-e)},e.invert=function(t){var n,e=this.base,r=i(e,this.max),a=this.rangeMin(),o=this.rangeMax()-a,u=this.positiveMin;if(u){if(0===t)return 0;var s=1/(r-(n=i(e,u/e)))*o;if(t<s)return t/s*u}else n=i(e,this.min);var c=(t-a)/o*(r-n)+n;return Math.pow(e,c)},n}(e(4));a.Log=o,t.exports=o},function(t,n,e){function i(t,n){var e=Math.E;return Math.pow(e,Math.log(n)/t)}var r=e(0),a=function(t){function n(){return t.apply(this,arguments)||this}!function(t,n){t.prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n}(n,t);var e=n.prototype;return e._initDefaultCfg=function(){t.prototype._initDefaultCfg.call(this),this.type="pow",this.tickCount=10,this.exponent=2},e.calculateTicks=function(){var t,n=this.exponent,e=Math.ceil(i(n,this.max));if((t=this.min>=0?Math.floor(i(n,this.min)):0)>e){var r=e;e=t,t=r}for(var a=e-t,o=this.tickCount,u=Math.ceil(a/o),s=[],c=t;c<e+u;c+=u)s.push(Math.pow(c,n));return s},e._getScalePercent=function(t){var n=this.max,e=this.min;if(n===e)return 0;var r=this.exponent;return(i(r,t)-i(r,e))/(i(r,n)-i(r,e))},e.scale=function(t){var n=this._getScalePercent(t),e=this.rangeMin();return e+n*(this.rangeMax()-e)},e.invert=function(t){var n=(t-this.rangeMin())/(this.rangeMax()-this.rangeMin()),e=this.exponent,r=i(e,this.max),a=i(e,this.min),o=n*(r-a)+a;return Math.pow(o,e)},n}(e(4));r.Pow=a,t.exports=a}])});

@@ -113,12 +113,14 @@ /**

if (maxTick < max) {
maxTick = maxTick + interval;
while (maxTick < max) {
// 保证计算出来的刻度最大值 maxTick 不小于数据最大值 max
maxTick = AutoUtil.fixedBase(maxTick + interval, interval);
}
if (minTick > min) {
minTick = minTick - interval;
while (minTick > min) {
// 保证计算出来的刻度最小值 minTick 不小于数据最大值 min
minTick = AutoUtil.fixedBase(minTick - interval, interval); // 防止超常浮点数计算问题
}
max = AutoUtil.fixedBase(maxTick, interval);
min = AutoUtil.fixedBase(minTick, interval);
max = maxTick;
min = minTick;
}

@@ -125,0 +127,0 @@

@@ -54,3 +54,3 @@ var mix = require('@antv/util/lib/mix');

_proto.init = function init() {};
_proto.init = function init() {}
/**

@@ -73,4 +73,4 @@ * 获取该度量的ticks,返回的是多个对象,

*/
;
_proto.getTicks = function getTicks() {

@@ -96,3 +96,3 @@ var self = this;

return rst;
};
}
/**

@@ -104,4 +104,4 @@ * 获取格式化后的文本

*/
;
_proto.getText = function getText(value, key) {

@@ -116,3 +116,3 @@ var formatter = this.formatter;

return value.toString();
};
}
/**

@@ -123,7 +123,7 @@ * 输出的值域最小值

*/
;
_proto.rangeMin = function rangeMin() {
return this.range[0];
};
}
/**

@@ -134,8 +134,8 @@ * 输出的值域最大值

*/
;
_proto.rangeMax = function rangeMax() {
var range = this.range;
return range[range.length - 1];
};
}
/**

@@ -146,7 +146,7 @@ * 度量转换后的结果,翻转回输入域

*/
;
_proto.invert = function invert(value) {
return value;
};
}
/**

@@ -157,7 +157,7 @@ * 将传入的值从非数值转换成数值格式,如分类字符串、时间字符串等

*/
;
_proto.translate = function translate(value) {
return value;
};
}
/**

@@ -168,7 +168,7 @@ * 进行度量转换

*/
;
_proto.scale = function scale(value) {
return value;
};
}
/**

@@ -178,4 +178,4 @@ * 克隆一个新的scale,拥有跟当前scale相同的输入域、输出域等

*/
;
_proto.clone = function clone() {

@@ -189,3 +189,3 @@ var self = this;

return new constr(cfg);
};
}
/**

@@ -197,4 +197,4 @@ * 更改度量的属性信息

*/
;
_proto.change = function change(info) {

@@ -201,0 +201,0 @@ this.ticks = null;

@@ -35,8 +35,8 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

this.isRounding = true; // 是否进行取整操作
};
}
/**
* @override
*/
;
_proto.init = function init() {

@@ -64,8 +64,8 @@ var self = this;

}
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -77,8 +77,8 @@ if (this.values.indexOf(value) === -1 && isNumber(value)) {

return _Base.prototype.getText.call(this, value);
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {

@@ -94,8 +94,8 @@ var index = this.values.indexOf(value);

return index;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -117,8 +117,8 @@ var rangeMin = this.rangeMin();

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -125,0 +125,0 @@ if (isString(value)) {

@@ -29,16 +29,16 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

this.value = null;
};
}
/**
* @override
*/
;
_proto.getText = function getText() {
return this.value.toString();
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -50,8 +50,8 @@ if (this.value !== value && isNumber(value)) {

return this.range[0];
};
}
/**
* @override
*/
;
_proto.invert = function invert() {

@@ -58,0 +58,0 @@ return this.value;

@@ -99,3 +99,3 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

self.snapArray = null;
};
}
/**

@@ -105,4 +105,4 @@ * @protected

*/
;
_proto.init = function init() {

@@ -128,3 +128,3 @@ var self = this;

}
};
}
/**

@@ -135,4 +135,4 @@ * 计算坐标点

*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -168,5 +168,5 @@ var min = this.min,

return tmp.ticks;
}; // 初始化ticks
} // 初始化ticks
;
_proto.initTicks = function initTicks() {

@@ -196,8 +196,8 @@ var self = this;

}
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -219,8 +219,8 @@ if (isNil(value)) {

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -227,0 +227,0 @@ var percent = (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());

@@ -57,8 +57,8 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

this._minTick = null;
};
}
/**
* @override
*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -114,5 +114,5 @@ var self = this;

return ticks;
}; // 获取度量计算时,value占的定义域百分比
} // 获取度量计算时,value占的定义域百分比
;
_proto._getScalePercent = function _getScalePercent(value) {

@@ -147,8 +147,8 @@ var max = this.max;

return percent;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -160,8 +160,8 @@ var percent = this._getScalePercent(value);

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -168,0 +168,0 @@ var base = this.base;

@@ -52,8 +52,8 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

this.exponent = 2;
};
}
/**
* @override
*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -87,5 +87,5 @@ var self = this;

return ticks;
}; // 获取度量计算时,value占的定义域百分比
} // 获取度量计算时,value占的定义域百分比
;
_proto._getScalePercent = function _getScalePercent(value) {

@@ -102,8 +102,8 @@ var max = this.max;

return percent;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -115,8 +115,8 @@ var percent = this._getScalePercent(value);

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.invert = function invert(value) {

@@ -123,0 +123,0 @@ var percent = (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());

@@ -78,3 +78,3 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

}
};
}
/**

@@ -84,4 +84,4 @@ * 计算 ticks

*/
;
_proto.calculateTicks = function calculateTicks() {

@@ -104,8 +104,8 @@ var self = this;

return ticks;
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {

@@ -124,8 +124,8 @@ value = this._toTimeStamp(value);

return index;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -147,8 +147,8 @@ var rangeMin = this.rangeMin();

return rangeMin + percent * (rangeMax - rangeMin);
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -168,8 +168,8 @@ var result = '';

return result;
};
}
/**
* @override
*/
;
_proto.getTicks = function getTicks() {

@@ -196,5 +196,5 @@ var self = this;

return rst;
}; // 将时间转换为时间戳
} // 将时间转换为时间戳
;
_proto._toTimeStamp = function _toTimeStamp(value) {

@@ -201,0 +201,0 @@ return TimeUtil.toTimeStamp(value);

@@ -44,8 +44,8 @@ function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }

this.mask = 'YYYY-MM-DD';
};
}
/**
* @override
*/
;
_proto.init = function init() {

@@ -116,8 +116,8 @@ var self = this;

return tmp.ticks;
};
}
/**
* @override
*/
;
_proto.getText = function getText(value) {

@@ -128,8 +128,8 @@ var formatter = this.formatter;

return value;
};
}
/**
* @override
*/
;
_proto.scale = function scale(value) {

@@ -141,13 +141,13 @@ if (isString(value)) {

return _Linear.prototype.scale.call(this, value);
};
}
/**
* @override
*/
;
_proto.translate = function translate(value) {
return this._toTimeStamp(value);
}; // 将时间转换为时间戳
} // 将时间转换为时间戳
;
_proto._toTimeStamp = function _toTimeStamp(value) {

@@ -154,0 +154,0 @@ return TimeUtil.toTimeStamp(value);

{
"name": "@antv/scale",
"version": "0.1.0",
"version": "0.1.1",
"description": "The scale module for G2, F2.",

@@ -5,0 +5,0 @@ "browser": "build/scale.js",

@@ -97,10 +97,12 @@ /**

}
if (maxTick < max) {
maxTick = maxTick + interval;
while (maxTick < max) { // 保证计算出来的刻度最大值 maxTick 不小于数据最大值 max
maxTick = AutoUtil.fixedBase(maxTick + interval, interval);
}
if (minTick > min) {
minTick = minTick - interval;
while (minTick > min) { // 保证计算出来的刻度最小值 minTick 不小于数据最大值 min
minTick = AutoUtil.fixedBase(minTick - interval, interval); // 防止超常浮点数计算问题
}
max = AutoUtil.fixedBase(maxTick, interval);
min = AutoUtil.fixedBase(minTick, interval);
max = maxTick;
min = minTick;
}

@@ -107,0 +109,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc