MCPcopy Index your code
hub / github.com/apache/echarts / getActiveState

Method getActiveState

src/coord/parallel/AxisModel.ts:112–139  ·  view source on GitHub ↗

* @param value When only attempting detect whether 'no activeIntervals set', * `value` is not needed to be input.

(value?: ParsedValue)

Source from the content-addressed store, hash-verified

110 * `value` is not needed to be input.
111 */
112 getActiveState(value?: ParsedValue): ParallelActiveState {
113 const activeIntervals = this.activeIntervals;
114
115 if (!activeIntervals.length) {
116 return 'normal';
117 }
118
119 if (value == null || isNaN(+value)) {
120 return 'inactive';
121 }
122
123 // Simple optimization
124 if (activeIntervals.length === 1) {
125 const interval = activeIntervals[0];
126 if (interval[0] <= value && value <= interval[1]) {
127 return 'active';
128 }
129 }
130 else {
131 for (let i = 0, len = activeIntervals.length; i < len; i++) {
132 if (activeIntervals[i][0] <= value && value <= activeIntervals[i][1]) {
133 return 'active';
134 }
135 }
136 }
137
138 return 'inactive';
139 }
140
141}
142interface ParallelAxisModel extends AxisModelCommonMixin<ParallelAxisOption>,

Callers 2

eachActiveStateMethod · 0.80
hasAxisBrushedMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected