(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI)
| 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(); |
| 100 | } |
| 101 | |
| 102 | this._lastZlevel = zlevel; |
| 103 | |
| 104 | this._finished = true; |
| 105 | } |
| 106 | |
| 107 | incrementalPrepareRender(seriesModel: LinesSeriesModel, ecModel: GlobalModel, api: ExtensionAPI) { |
| 108 | const data = seriesModel.getData(); |
nothing calls this directly
no test coverage detected