* @param value When only attempting detect whether 'no activeIntervals set', * `value` is not needed to be input.
(value?: ParsedValue)
| 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 | } |
| 142 | interface ParallelAxisModel extends AxisModelCommonMixin<ParallelAxisOption>, |
no outgoing calls
no test coverage detected