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

Class LinesView

src/chart/lines/LinesView.ts:42–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40import { ILineDraw } from '../helper/baseDraw';
41
42class LinesView extends ChartView {
43
44 static readonly type = 'lines';
45 readonly type = LinesView.type;
46
47 private _lastZlevel: number;
48 private _finished: boolean;
49
50 private _lineDraw: ILineDraw;
51
52 private _hasEffet: boolean;
53 private _isPolyline: boolean;
54 private _isLargeDraw: boolean;
55
56 render(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) {
57 const data = seriesModel.getData();
58
59 const lineDraw = this._updateLineDraw(data, seriesModel);
60
61 const zlevel = seriesModel.get('zlevel');
62 const trailLength = seriesModel.get(['effect', 'trailLength']);
63
64 const zr = api.getZr();
65 // Avoid the drag cause ghost shadow
66 // FIXME Better way ?
67 // SVG doesn't support
68 const isCanvas = !!getCurrentCanvasPainter(api);
69 if (isCanvas) {
70 (zr.painter as CanvasPainter).getLayer(zlevel).clear(true);
71 }
72 // Config layer with motion blur
73 if (this._lastZlevel != null && isCanvas) {
74 zr.configLayer(this._lastZlevel, {
75 motionBlur: false
76 });
77 }
78 if (this._showEffect(seriesModel) && trailLength > 0) {
79 if (isCanvas) {
80 zr.configLayer(zlevel, {
81 motionBlur: true,
82 lastFrameAlpha: Math.max(Math.min(trailLength / 10 + 0.9, 1), 0)
83 });
84 }
85 else if (__DEV__) {
86 console.warn('SVG render mode doesn\'t support lines with trail effect');
87 }
88 }
89
90 lineDraw.updateData(data as SeriesData);
91
92 const clipPath = seriesModel.get('clip', true) && createClipPath(
93 (seriesModel.coordinateSystem as Polar | Cartesian2D), false, seriesModel
94 );
95 if (clipPath) {
96 this.group.setClipPath(clipPath);
97 }
98 else {
99 this.group.removeClipPath();

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…