(
polar: Polar,
hasAnimation: boolean,
seriesModel: SeriesModelWithLineWidth
)
| 107 | } |
| 108 | |
| 109 | export function createPolarClipPath( |
| 110 | polar: Polar, |
| 111 | hasAnimation: boolean, |
| 112 | seriesModel: SeriesModelWithLineWidth |
| 113 | ) { |
| 114 | const sectorArea = polar.getArea(); |
| 115 | // Avoid float number rounding error for symbol on the edge of axis extent. |
| 116 | |
| 117 | const r0 = round(sectorArea.r0, 1); |
| 118 | const r = round(sectorArea.r, 1); |
| 119 | const clipPath = new graphic.Sector({ |
| 120 | shape: { |
| 121 | cx: round(polar.cx, 1), |
| 122 | cy: round(polar.cy, 1), |
| 123 | r0: r0, |
| 124 | r: r, |
| 125 | startAngle: sectorArea.startAngle, |
| 126 | endAngle: sectorArea.endAngle, |
| 127 | clockwise: sectorArea.clockwise |
| 128 | } |
| 129 | }); |
| 130 | |
| 131 | if (hasAnimation) { |
| 132 | const isRadial = polar.getBaseAxis().dim === 'angle'; |
| 133 | |
| 134 | if (isRadial) { |
| 135 | clipPath.shape.endAngle = sectorArea.startAngle; |
| 136 | } |
| 137 | else { |
| 138 | clipPath.shape.r = r0; |
| 139 | } |
| 140 | |
| 141 | graphic.initProps(clipPath, { |
| 142 | shape: { |
| 143 | endAngle: sectorArea.endAngle, |
| 144 | r: r |
| 145 | } |
| 146 | }, seriesModel); |
| 147 | } |
| 148 | return clipPath; |
| 149 | } |
| 150 | |
| 151 | export function createClipPath( |
| 152 | coordSys: CoordinateSystem, |
no test coverage detected
searching dependent graphs…