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

Method renderSeries

src/component/marker/MarkAreaView.ts:259–398  ·  view source on GitHub ↗
(
        seriesModel: SeriesModel,
        maModel: MarkAreaModel,
        ecModel: GlobalModel,
        api: ExtensionAPI
    )

Source from the content-addressed store, hash-verified

257 }
258
259 renderSeries(
260 seriesModel: SeriesModel,
261 maModel: MarkAreaModel,
262 ecModel: GlobalModel,
263 api: ExtensionAPI
264 ) {
265 const coordSys = seriesModel.coordinateSystem;
266 const seriesId = seriesModel.id;
267 const seriesData = seriesModel.getData();
268
269 const areaGroupMap = this.markerGroupMap;
270 const polygonGroup = areaGroupMap.get(seriesId)
271 || areaGroupMap.set(seriesId, {group: new graphic.Group()});
272
273 this.group.add(polygonGroup.group);
274 this.markKeep(polygonGroup);
275
276 const areaData = createList(coordSys, seriesModel, maModel);
277
278 // Line data for tooltip and formatter
279 maModel.setData(areaData);
280
281 // Update visual and layout of line
282 areaData.each(function (idx) {
283 // Layout
284 const points = map(dimPermutations, function (dim) {
285 return getSingleMarkerEndPoint(areaData, idx, dim, seriesModel, api);
286 });
287 const xAxisScale = coordSys.getAxis('x').scale;
288 const yAxisScale = coordSys.getAxis('y').scale;
289 const xAxisExtent = xAxisScale.getExtent();
290 const yAxisExtent = yAxisScale.getExtent();
291 const xPointExtent = [xAxisScale.parse(areaData.get('x0', idx)), xAxisScale.parse(areaData.get('x1', idx))];
292 const yPointExtent = [yAxisScale.parse(areaData.get('y0', idx)), yAxisScale.parse(areaData.get('y1', idx))];
293 numberUtil.asc(xPointExtent);
294 numberUtil.asc(yPointExtent);
295 const overlapped = !(xAxisExtent[0] > xPointExtent[1] || xAxisExtent[1] < xPointExtent[0]
296 || yAxisExtent[0] > yPointExtent[1] || yAxisExtent[1] < yPointExtent[0]);
297 // If none of the area is inside coordSys, allClipped is set to be true
298 // in layout so that label will not be displayed. See #12591
299 const allClipped = !overlapped;
300 areaData.setItemLayout(idx, {
301 points: points,
302 allClipped: allClipped
303 });
304
305 const itemModel = areaData.getItemModel<MarkAreaMergedItemOption>(idx);
306 const style = itemModel.getModel('itemStyle').getItemStyle();
307 const z2 = itemModel.get('z2');
308 const color = getVisualFromData(seriesData, 'color') as ZRColor;
309 if (!style.fill) {
310 style.fill = color;
311 if (isString(style.fill)) {
312 style.fill = colorUtil.modifyAlpha(style.fill, 0.4);
313 }
314 }
315 if (!style.stroke) {
316 style.stroke = color;

Callers

nothing calls this directly

Calls 15

getVisualFromDataFunction · 0.90
setLabelStyleFunction · 0.90
getLabelStatesModelsFunction · 0.90
setStatesStylesFromModelFunction · 0.90
toggleHoverEmphasisFunction · 0.90
getSingleMarkerEndPointFunction · 0.85
innerFunction · 0.85
setDataMethod · 0.80
setItemLayoutMethod · 0.80
getItemModelMethod · 0.80
getItemStyleMethod · 0.80
setItemVisualMethod · 0.80

Tested by

no test coverage detected