MCPcopy Create free account
hub / github.com/apache/echarts / optionUpdated

Method optionUpdated

src/component/visualMap/PiecewiseModel.ts:130–163  ·  view source on GitHub ↗
(newOption: PiecewiseVisualMapOption, isInit?: boolean)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 7

_determineModeMethod · 0.95
_resetSelectedMethod · 0.95
resetExtentMethod · 0.80
resetVisualMethod · 0.80
getExtentMethod · 0.65
cloneMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected