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

Method renderSeries

src/component/marker/MarkLineView.ts:296–438  ·  view source on GitHub ↗
(
        seriesModel: SeriesModel,
        mlModel: MarkLineModel,
        ecModel: GlobalModel,
        api: ExtensionAPI
    )

Source from the content-addressed store, hash-verified

294 }
295
296 renderSeries(
297 seriesModel: SeriesModel,
298 mlModel: MarkLineModel,
299 ecModel: GlobalModel,
300 api: ExtensionAPI
301 ) {
302 const coordSys = seriesModel.coordinateSystem;
303 const seriesId = seriesModel.id;
304 const seriesData = seriesModel.getData();
305
306 const lineDrawMap = this.markerGroupMap;
307 const lineDraw = lineDrawMap.get(seriesId)
308 || lineDrawMap.set(seriesId, new LineDraw());
309 this.group.add(lineDraw.group);
310
311 const mlData = createList(coordSys, seriesModel, mlModel);
312
313 const fromData = mlData.from;
314 const toData = mlData.to;
315 const lineData = mlData.line as SeriesData<MarkLineModel, LineDataVisual>;
316
317 inner(mlModel).from = fromData;
318 inner(mlModel).to = toData;
319 // Line data for tooltip and formatter
320 mlModel.setData(lineData);
321
322 // TODO
323 // Functionally, `symbolSize` & `symbolOffset` can also be 2D array now.
324 // But the related logic and type definition are not finished yet.
325 // Finish it if required
326 let symbolType = mlModel.get('symbol');
327 let symbolSize = mlModel.get('symbolSize');
328 let symbolRotate = mlModel.get('symbolRotate');
329 let symbolOffset = mlModel.get('symbolOffset');
330 // TODO: support callback function like markPoint
331 if (!isArray(symbolType)) {
332 symbolType = [symbolType, symbolType];
333 }
334 if (!isArray(symbolSize)) {
335 symbolSize = [symbolSize, symbolSize];
336 }
337 if (!isArray(symbolRotate)) {
338 symbolRotate = [symbolRotate, symbolRotate];
339 }
340 if (!isArray(symbolOffset)) {
341 symbolOffset = [symbolOffset, symbolOffset];
342 }
343
344 // Update visual and layout of from symbol and to symbol
345 mlData.from.each(function (idx) {
346 updateDataVisualAndLayout(fromData, idx, true);
347 updateDataVisualAndLayout(toData, idx, false);
348 });
349
350 // Update visual and layout of line
351 lineData.each(function (idx) {
352 const itemModel = lineData.getItemModel<MarkLineMergedItemOption>(idx);
353 const lineStyle = itemModel.getModel('lineStyle').getLineStyle();

Callers 1

renderFunction · 0.45

Calls 15

innerFunction · 0.85
isArrayFunction · 0.85
setDataMethod · 0.80
getItemModelMethod · 0.80
getLineStyleMethod · 0.80
setItemLayoutMethod · 0.80
getItemLayoutMethod · 0.80
setItemVisualMethod · 0.80
eachItemGraphicElMethod · 0.80
createListFunction · 0.70
getDataMethod · 0.65
updateDataMethod · 0.65

Tested by

no test coverage detected