123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- import * as clazzUtil from '../util/clazz.js';
- var Scale = function () {
- function Scale(setting) {
- this._setting = setting || {};
- this._extent = [Infinity, -Infinity];
- }
- Scale.prototype.getSetting = function (name) {
- return this._setting[name];
- };
-
- Scale.prototype.unionExtent = function (other) {
- var extent = this._extent;
- other[0] < extent[0] && (extent[0] = other[0]);
- other[1] > extent[1] && (extent[1] = other[1]);
-
-
- };
-
- Scale.prototype.unionExtentFromData = function (data, dim) {
- this.unionExtent(data.getApproximateExtent(dim));
- };
-
- Scale.prototype.getExtent = function () {
- return this._extent.slice();
- };
-
- Scale.prototype.setExtent = function (start, end) {
- var thisExtent = this._extent;
- if (!isNaN(start)) {
- thisExtent[0] = start;
- }
- if (!isNaN(end)) {
- thisExtent[1] = end;
- }
- };
-
- Scale.prototype.isInExtentRange = function (value) {
- return this._extent[0] <= value && this._extent[1] >= value;
- };
-
- Scale.prototype.isBlank = function () {
- return this._isBlank;
- };
-
- Scale.prototype.setBlank = function (isBlank) {
- this._isBlank = isBlank;
- };
- return Scale;
- }();
- clazzUtil.enableClassManagement(Scale);
- export default Scale;
|