(newOption: PiecewiseVisualMapOption, isInit?: boolean)
| 128 | private _mode: 'pieces' | 'categories' | 'splitNumber'; |
| 129 | |
| 130 | optionUpdated(newOption: PiecewiseVisualMapOption, isInit?: boolean) { |
| 131 | super.optionUpdated.apply(this, arguments as any); |
| 132 | |
| 133 | this.resetExtent(); |
| 134 | |
| 135 | const mode = this._mode = this._determineMode(); |
| 136 | |
| 137 | this._pieceList = []; |
| 138 | resetMethods[this._mode].call(this, this._pieceList); |
| 139 | |
| 140 | this._resetSelected(newOption, isInit); |
| 141 | |
| 142 | const categories = this.option.categories; |
| 143 | |
| 144 | this.resetVisual(function (mappingOption, state) { |
| 145 | if (mode === 'categories') { |
| 146 | mappingOption.mappingMethod = 'category'; |
| 147 | mappingOption.categories = zrUtil.clone(categories); |
| 148 | } |
| 149 | else { |
| 150 | mappingOption.dataExtent = this.getExtent(); |
| 151 | mappingOption.mappingMethod = 'piecewise'; |
| 152 | mappingOption.pieceList = zrUtil.map(this._pieceList, function (piece) { |
| 153 | piece = zrUtil.clone(piece); |
| 154 | if (state !== 'inRange') { |
| 155 | // FIXME |
| 156 | // outOfRange do not support special visual in pieces. |
| 157 | piece.visual = null; |
| 158 | } |
| 159 | return piece; |
| 160 | }); |
| 161 | } |
| 162 | }); |
| 163 | } |
| 164 | |
| 165 | /** |
| 166 | * @protected |
nothing calls this directly
no test coverage detected