We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Had to brush up on how to do this, but this seems to fix it. (also made sure left is left and right is right, you somehow got those all mixed up ;))
const Pythagoras = ({ maxlvl, w, x, y, lvl, left, right }) => { if (lvl > maxlvl || w < 1) { return null; } const nextLeft = .4 * Factor * w; const nextRight = .6 * Factor * w; const leftAngle = Math.deg(Math.acos((nextLeft * nextLeft + w * w - nextRight * nextRight) / (2 * nextLeft * w))); const rightAngle = Math.deg(Math.acos((nextRight * nextRight + w * w - nextLeft * nextLeft) / (2 * nextRight * w))); let rotate = ''; if (left) { rotate = `rotate(${-leftAngle} 0 ${w})`; }else if (right) { rotate = `rotate(${rightAngle} ${w} ${w})`; } return ( <g transform={`translate(${x} ${y}) ${rotate}`}> <rect width={w} height={w} x={0} y={0} style={{fill: interpolateViridis(lvl/maxlvl)}} /> <Pythagoras w={nextLeft} x={0} y={-nextLeft} lvl={lvl+1} maxlvl={maxlvl} left /> <Pythagoras w={nextRight} x={w-nextRight} y={-nextRight} lvl={lvl+1} maxlvl={maxlvl} right /> </g> ); };
The text was updated successfully, but these errors were encountered:
Merge pull request Swizec#1 from Swizec/patch-1
9bc82f3
React -> Preact in Readme
No branches or pull requests
Had to brush up on how to do this, but this seems to fix it. (also made sure left is left and right is right, you somehow got those all mixed up ;))
The text was updated successfully, but these errors were encountered: