(lineData: SeriesData, idx: number)
| 64 | } |
| 65 | |
| 66 | private _updateEffectSymbol(lineData: SeriesData, idx: number) { |
| 67 | const itemModel = lineData.getItemModel<LineDrawModelOption>(idx); |
| 68 | const effectModel = itemModel.getModel('effect'); |
| 69 | let size = effectModel.get('symbolSize'); |
| 70 | const symbolType = effectModel.get('symbol'); |
| 71 | if (!zrUtil.isArray(size)) { |
| 72 | size = [size, size]; |
| 73 | } |
| 74 | |
| 75 | const lineStyle = lineData.getItemVisual(idx, 'style'); |
| 76 | const color = effectModel.get('color') || (lineStyle && lineStyle.stroke); |
| 77 | let symbol = this.childAt(1) as ECSymbolOnEffectLine; |
| 78 | |
| 79 | if (this._symbolType !== symbolType) { |
| 80 | // Remove previous |
| 81 | this.remove(symbol); |
| 82 | |
| 83 | symbol = createSymbol( |
| 84 | symbolType, -0.5, -0.5, 1, 1, color |
| 85 | ) as ECSymbolOnEffectLine; |
| 86 | symbol.z2 = 100; |
| 87 | symbol.culling = true; |
| 88 | |
| 89 | this.add(symbol); |
| 90 | } |
| 91 | |
| 92 | // Symbol may be removed if loop is false |
| 93 | if (!symbol) { |
| 94 | return; |
| 95 | } |
| 96 | |
| 97 | // Shadow color is same with color in default |
| 98 | symbol.setStyle('shadowColor', color as ColorString); |
| 99 | symbol.setStyle(effectModel.getItemStyle(['color'])); |
| 100 | |
| 101 | symbol.scaleX = size[0]; |
| 102 | symbol.scaleY = size[1]; |
| 103 | |
| 104 | symbol.setColor(color); |
| 105 | |
| 106 | this._symbolType = symbolType; |
| 107 | this._symbolScale = size; |
| 108 | |
| 109 | this._updateEffectAnimation(lineData, effectModel, idx); |
| 110 | } |
| 111 | |
| 112 | private _updateEffectAnimation( |
| 113 | lineData: SeriesData, |
no test coverage detected