MCPcopy
hub / github.com/apache/echarts / render

Method render

src/chart/custom/CustomView.ts:215–269  ·  view source on GitHub ↗
(
        customSeries: CustomSeriesModel,
        ecModel: GlobalModel,
        api: ExtensionAPI,
        payload: Payload
    )

Source from the content-addressed store, hash-verified

213 private _progressiveEls: Element[];
214
215 render(
216 customSeries: CustomSeriesModel,
217 ecModel: GlobalModel,
218 api: ExtensionAPI,
219 payload: Payload
220 ): void {
221
222 // Clear previously rendered progressive elements.
223 this._progressiveEls = null;
224
225 const oldData = this._data;
226 const data = customSeries.getData();
227 const group = this.group;
228 const renderItem = makeRenderItem(customSeries, data, ecModel, api);
229
230 if (!oldData) {
231 // Previous render is incremental render or first render.
232 // Needs remove the incremental rendered elements.
233 group.removeAll();
234 }
235
236 data.diff(oldData)
237 .add(function (newIdx) {
238 createOrUpdateItem(
239 api, null, newIdx, renderItem(newIdx, payload), customSeries, group,
240 data
241 );
242 })
243 .remove(function (oldIdx) {
244 const el = oldData.getItemGraphicEl(oldIdx);
245 el && applyLeaveTransition(el, customInnerStore(el).option, customSeries);
246 })
247 .update(function (newIdx, oldIdx) {
248 const oldEl = oldData.getItemGraphicEl(oldIdx);
249
250 createOrUpdateItem(
251 api, oldEl, newIdx, renderItem(newIdx, payload), customSeries, group,
252 data
253 );
254 })
255 .execute();
256
257 // Do clipping
258 const clipPath = customSeries.get('clip', true)
259 ? createClipPath(customSeries.coordinateSystem, false, customSeries)
260 : null;
261 if (clipPath) {
262 group.setClipPath(clipPath);
263 }
264 else {
265 group.removeClipPath();
266 }
267
268 this._data = data;
269 }
270
271 incrementalPrepareRender(
272 customSeries: CustomSeriesModel,

Callers

nothing calls this directly

Calls 13

applyLeaveTransitionFunction · 0.90
createClipPathFunction · 0.90
makeRenderItemFunction · 0.85
createOrUpdateItemFunction · 0.85
renderItemFunction · 0.85
executeMethod · 0.80
diffMethod · 0.80
getItemGraphicElMethod · 0.80
getDataMethod · 0.65
updateMethod · 0.65
removeMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected