Skip to content

Commit

Permalink
fix: visual regression with circle
Browse files Browse the repository at this point in the history
  • Loading branch information
yassilah committed Sep 26, 2023
1 parent 589f66d commit 691d9ee
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/component/axis/AngleAxisView.ts
Expand Up @@ -146,9 +146,10 @@ const angelAxisElementsBuilders: Record<typeof elementList[number], AngleAxisEle
const rId = getRadiusIdx(polar);
const r0Id = rId ? 0 : 1;
let shape;
const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';

if (radiusExtent[r0Id] === 0) {
shape = new graphic.Arc({
shape = new graphic[shapeType]({
shape: {
cx: polar.cx,
cy: polar.cy,
Expand Down
3 changes: 2 additions & 1 deletion src/component/axis/RadiusAxisView.ts
Expand Up @@ -108,6 +108,7 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
const angleAxis = polar.getAngleAxis();
const RADIAN = Math.PI / 180;
const angleExtent = angleAxis.getExtent();
const shapeType = Math.abs(angleExtent[1] - angleExtent[0]) === 360 ? 'Circle' : 'Arc';

lineColors = lineColors instanceof Array ? lineColors : [lineColors];

Expand All @@ -116,7 +117,7 @@ const axisElementBuilders: Record<typeof selfBuilderAttrs[number], AxisElementBu
for (let i = 0; i < ticksCoords.length; i++) {
const colorIndex = (lineCount++) % lineColors.length;
splitLines[colorIndex] = splitLines[colorIndex] || [];
splitLines[colorIndex].push(new graphic.Arc({
splitLines[colorIndex].push(new graphic[shapeType]({
shape: {
cx: polar.cx,
cy: polar.cy,
Expand Down

0 comments on commit 691d9ee

Please sign in to comment.