Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchox5 committed Jul 29, 2024
1 parent 85b0910 commit b7b6339
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/js/orbit-slice.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
}
.slice {
stroke: var(--o-slice-color, var(--o-cyan-light));
stroke-width: calc(var(--o-radius) / var(--o-orbit-number) * var(--o-size-ratio, 1));
transition: stroke 0.3s;
}
Expand Down Expand Up @@ -63,13 +64,13 @@
path.setAttribute('marker-start', 'url(#tail)');
}

const { strokeWidth, realRadius, sliceColor, gap } = this.getAttributes();
const { realRadius, sliceColor, gap } = this.getAttributes();
const angle = this.calculateAngle();
const { d } = this.calculateArcParameters(angle, realRadius, gap);

path.setAttribute('d', d);
path.setAttribute('stroke', sliceColor);
path.setAttribute('stroke-width', strokeWidth);
// path.setAttribute('stroke-width', strokeWidth);
}

getAttributes() {
Expand Down Expand Up @@ -114,7 +115,7 @@
return sliceAngle - gap;
}

calculateArcParameters(angle, realRadius, gap) {
calculateArcParameters(angle, realRadius) {
const radiusX = realRadius / 1;
const radiusY = realRadius / 1;
const startX = 50 + radiusX * Math.cos(-Math.PI / 2);
Expand Down

0 comments on commit b7b6339

Please sign in to comment.