UNPKG

cione-comp-lib

Version:

`$ yarn add cione-comp-lib` 或者 `$ npm i cione-comp-lib -S`

44 lines (43 loc) 1.27 kB
import { enableClassManagement } from "../util/clazz.mjs"; var Scale = function() { function Scale2(setting) { this._setting = setting || {}; this._extent = [Infinity, -Infinity]; } Scale2.prototype.getSetting = function(name) { return this._setting[name]; }; Scale2.prototype.unionExtent = function(other) { var extent = this._extent; other[0] < extent[0] && (extent[0] = other[0]); other[1] > extent[1] && (extent[1] = other[1]); }; Scale2.prototype.unionExtentFromData = function(data, dim) { this.unionExtent(data.getApproximateExtent(dim)); }; Scale2.prototype.getExtent = function() { return this._extent.slice(); }; Scale2.prototype.setExtent = function(start, end) { var thisExtent = this._extent; if (!isNaN(start)) { thisExtent[0] = start; } if (!isNaN(end)) { thisExtent[1] = end; } }; Scale2.prototype.isInExtentRange = function(value) { return this._extent[0] <= value && this._extent[1] >= value; }; Scale2.prototype.isBlank = function() { return this._isBlank; }; Scale2.prototype.setBlank = function(isBlank) { this._isBlank = isBlank; }; return Scale2; }(); enableClassManagement(Scale); var Scale$1 = Scale; export { Scale$1 as default };