Created
July 29, 2019 20:28
-
-
Save carolina-vallejo/b69722e8e116f8302b683e07b0af8f56 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private transform(d) { | |
const x = (((d.x0 + d.x1) / 2) * 180) / Math.PI; | |
const y = ((d.y0 + d.y1) / 2) * this.radius; | |
return `rotate(${x - 90}) translate(${y},0) rotate(${x < 180 ? 0 : 180})`; | |
} | |
private position(d) { | |
const x = (((d.x0 + d.x1) / 2) * 180) / Math.PI; | |
const y = ((d.y0 + d.y1) / 2) * this.radius; | |
return `rotate(${x - 90}deg) translate(${this.radius}px,0px) rotate(${x < 180 ? 0 : 180}deg)`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment