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

Method render

src/chart/parallel/ParallelView.ts:60–124  ·  view source on GitHub ↗

* @override

(
        seriesModel: ParallelSeriesModel,
        ecModel: GlobalModel,
        api: ExtensionAPI,
        payload: Payload
    )

Source from the content-addressed store, hash-verified

58 * @override
59 */
60 render(
61 seriesModel: ParallelSeriesModel,
62 ecModel: GlobalModel,
63 api: ExtensionAPI,
64 payload: Payload
65 ) {
66
67 const dataGroup = this._dataGroup;
68
69 // Clear previously rendered progressive elements.
70 this._progressiveEls = [];
71 dataGroup.removeAll();
72
73 const data = seriesModel.getData();
74 const oldData = this._data;
75 const coordSys = seriesModel.coordinateSystem;
76 const dimensions = coordSys.dimensions;
77 const seriesScope = makeSeriesScope(seriesModel);
78
79 data.diff(oldData)
80 .add(add)
81 .update(update)
82 .remove(remove)
83 .execute();
84
85 function add(newDataIndex: number) {
86 const line = addEl(data, dataGroup, newDataIndex, dimensions, coordSys);
87 updateElCommon(line, data, newDataIndex, seriesScope);
88 }
89
90 function update(newDataIndex: number, oldDataIndex: number) {
91 const line = oldData.getItemGraphicEl(oldDataIndex) as graphic.Polyline;
92 dataGroup.add(line);
93
94 const points = createLinePoints(data, newDataIndex, dimensions, coordSys);
95 data.setItemGraphicEl(newDataIndex, line);
96
97 graphic.updateProps(line, {shape: {points: points}}, seriesModel, newDataIndex);
98
99 saveOldStyle(line);
100
101 updateElCommon(line, data, newDataIndex, seriesScope);
102 }
103
104 function remove(oldDataIndex: number) {
105 const line = oldData.getItemGraphicEl(oldDataIndex);
106 dataGroup.remove(line);
107 }
108
109 // First create
110 if (!this._initialized) {
111 this._initialized = true;
112 const clipPath = createGridClipShape(
113 coordSys, seriesModel, function () {
114 // Callback will be invoked immediately if there is no animation
115 setTimeout(function () {
116 dataGroup.removeClipPath();
117 });

Callers

nothing calls this directly

Calls 8

executeMethod · 0.80
diffMethod · 0.80
makeSeriesScopeFunction · 0.70
createGridClipShapeFunction · 0.70
getDataMethod · 0.65
removeMethod · 0.65
updateMethod · 0.65
addMethod · 0.45

Tested by

no test coverage detected