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

Method render

src/chart/line/LineView.ts:635–922  ·  view source on GitHub ↗
(seriesModel: LineSeriesModel, ecModel: GlobalModel, api: ExtensionAPI)

Source from the content-addressed store, hash-verified

633 }
634
635 render(seriesModel: LineSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {
636 const coordSys = seriesModel.coordinateSystem;
637 const group = this.group;
638 const data = seriesModel.getData();
639 const lineStyleModel = seriesModel.getModel('lineStyle');
640 const areaStyleModel = seriesModel.getModel('areaStyle');
641
642 let points = data.getLayout('points') as number[] || [];
643
644 const isCoordSysPolar = coordSys.type === 'polar';
645 const prevCoordSys = this._coordSys;
646
647 const symbolDraw = this._symbolDraw;
648 let polyline = this._polyline;
649 let polygon = this._polygon;
650
651 const lineGroup = this._lineGroup;
652
653 const hasAnimation = !ecModel.ssr && seriesModel.get('animation');
654
655 const isAreaChart = !areaStyleModel.isEmpty();
656
657 const valueOrigin = areaStyleModel.get('origin');
658 const dataCoordInfo = prepareDataCoordInfo(coordSys, data, valueOrigin);
659
660 let stackedOnPoints = isAreaChart && getStackedOnPoints(coordSys, data, dataCoordInfo);
661
662 const showSymbol = seriesModel.get('showSymbol');
663
664 const connectNulls = seriesModel.get('connectNulls');
665
666 const isIgnoreFunc = showSymbol && !isCoordSysPolar
667 && getIsIgnoreFunc(seriesModel, data, coordSys as Cartesian2D);
668
669 // Remove temporary symbols
670 const oldData = this._data;
671 oldData && oldData.eachItemGraphicEl(function (el: SymbolExtended, idx) {
672 if (el.__temp) {
673 group.remove(el);
674 oldData.setItemGraphicEl(idx, null);
675 }
676 });
677
678 // Remove previous created symbols if showSymbol changed to false
679 if (!showSymbol) {
680 symbolDraw.remove();
681 }
682
683 group.add(lineGroup);
684
685 // FIXME step not support polar
686 const step = !isCoordSysPolar ? seriesModel.get('step') : false;
687 let clipShapeForSymbol: PolarArea | Cartesian2DArea;
688 if (coordSys && coordSys.getArea && seriesModel.get('clip', true)) {
689 clipShapeForSymbol = coordSys.getArea();
690 // Avoid float number rounding error for symbol on the edge of axis extent.
691 // See #7913 and `test/dataZoom-clip.html`.
692 if ((clipShapeForSymbol as Cartesian2DArea).width != null) {

Callers

nothing calls this directly

Calls 15

_newPolylineMethod · 0.95
_newPolygonMethod · 0.95
_initOrUpdateEndLabelMethod · 0.95
_doUpdateAnimationMethod · 0.95
packEventDataMethod · 0.95
prepareDataCoordInfoFunction · 0.90
convertToColorStringFunction · 0.90
setStatesStylesFromModelFunction · 0.90
toggleHoverEmphasisFunction · 0.90
warnDeprecatedFunction · 0.90
getStackedOnPointsFunction · 0.85

Tested by

no test coverage detected