123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- import { __extends } from "tslib";
- import * as zrUtil from 'zrender/lib/core/util.js';
- import ComponentModel from '../../model/Component.js';
- import makeStyleMapper from '../../model/mixin/makeStyleMapper.js';
- import * as numberUtil from '../../util/number.js';
- import { AxisModelCommonMixin } from '../axisModelCommonMixin.js';
- var ParallelAxisModel =
- function (_super) {
- __extends(ParallelAxisModel, _super);
- function ParallelAxisModel() {
- var _this = _super !== null && _super.apply(this, arguments) || this;
- _this.type = ParallelAxisModel.type;
-
- _this.activeIntervals = [];
- return _this;
- }
- ParallelAxisModel.prototype.getAreaSelectStyle = function () {
- return makeStyleMapper([['fill', 'color'], ['lineWidth', 'borderWidth'], ['stroke', 'borderColor'], ['width', 'width'], ['opacity', 'opacity']
-
- ])(this.getModel('areaSelectStyle'));
- };
-
- ParallelAxisModel.prototype.setActiveIntervals = function (intervals) {
- var activeIntervals = this.activeIntervals = zrUtil.clone(intervals);
- if (activeIntervals) {
- for (var i = activeIntervals.length - 1; i >= 0; i--) {
- numberUtil.asc(activeIntervals[i]);
- }
- }
- };
-
- ParallelAxisModel.prototype.getActiveState = function (value) {
- var activeIntervals = this.activeIntervals;
- if (!activeIntervals.length) {
- return 'normal';
- }
- if (value == null || isNaN(+value)) {
- return 'inactive';
- }
- if (activeIntervals.length === 1) {
- var interval = activeIntervals[0];
- if (interval[0] <= value && value <= interval[1]) {
- return 'active';
- }
- } else {
- for (var i = 0, len = activeIntervals.length; i < len; i++) {
- if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {
- return 'active';
- }
- }
- }
- return 'inactive';
- };
- return ParallelAxisModel;
- }(ComponentModel);
- zrUtil.mixin(ParallelAxisModel, AxisModelCommonMixin);
- export default ParallelAxisModel;
|