Re-order quadrants in the chart

so that the first one is in the top-left corner
This commit is contained in:
Jarosław Marek
2021-04-29 22:02:51 +12:00
parent 725b6f9924
commit e8eff6bdab
4 changed files with 27 additions and 23 deletions

View File

@@ -21,9 +21,9 @@ const generateCoordinates = (enrichedBlip, xScale, yScale) => {
const radius = randomBetween(previousRingRadius + ringPadding, ringRadius - ringPadding);
/*
Multiples of PI/2. To apply the calculated position to the specific quadrant.
Order here is counter-clockwise and starts at the top left, so we need to "invert" quadrant positions
Order here is counter-clockwise, so we need to "invert" quadrant positions (i.e. swap 2 with 4)
*/
const shift = pi * [4, 3, 2, 1][enrichedBlip.quadrantPosition - 1] / 2;
const shift = pi * [1, 4, 3, 2][enrichedBlip.quadrantPosition - 1] / 2;
return {
x: xScale(Math.cos(randomDegree + shift) * radius),