Skip to content
New issue

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

fix: radial bars demo import in CodeSandbox #1786

Merged
merged 2 commits into from
Jan 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions packages/visx-demo/src/sandboxes/visx-radial-bars/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Group } from '@visx/group';
import { GradientLightgreenGreen } from '@visx/gradient';
import { scaleBand, scaleRadial } from '@visx/scale';
import { Text } from '@visx/text';
import letterFrequency, { LetterFrequency } from '@visx/mock-data/src/mocks/letterFrequency';
import letterFrequency, { LetterFrequency } from '@visx/mock-data/lib/mocks/letterFrequency';
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah yes, sorry I didn't catch this. tricky to catch this one in CI as well.


const data = letterFrequency;

Expand All @@ -19,7 +19,7 @@ const toRadians = (x: number) => (x * Math.PI) / 180;
const toDegrees = (x: number) => (x * 180) / Math.PI;

const barColor = '#93F9B9';
const margin = { top: 20, bottom: 20 };
const margin = { top: 20, bottom: 20, left: 20, right: 20 };

export type RadialBarsProps = {
width: number;
Expand All @@ -32,7 +32,7 @@ export default function Example({ width, height, showControls = true }: RadialBa
const [sortAlphabetically, setSortAlphabetically] = useState(true);

// bounds
const xMax = width;
const xMax = width - margin.left - margin.right;
const yMax = height - margin.top - margin.bottom;
const radiusMax = Math.min(xMax, yMax) / 2;

Expand Down Expand Up @@ -65,9 +65,9 @@ export default function Example({ width, height, showControls = true }: RadialBa
return width < 10 ? null : (
<>
<svg width={width} height={height}>
<GradientLightgreenGreen id="green" />
<rect width={width} height={height} fill="url(#green)" rx={14} />
<Group top={yMax / 2 + margin.top} left={xMax / 2}>
<GradientLightgreenGreen id="radial-bars-green" />
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙏

<rect width={width} height={height} fill="url(#radial-bars-green)" rx={14} />
<Group top={yMax / 2 + margin.top} left={xMax / 2 + margin.left}>
{data.map((d) => {
const letter = getLetter(d);
const startAngle = xScale(letter);
Expand Down
Loading