Change variable name
This commit is contained in:
parent
846f4549b0
commit
a5fa8bd52a
|
@ -7,7 +7,7 @@ import styles from "./PieChart.module.css";
|
|||
interface PieChartProps {
|
||||
data: PieChartData[];
|
||||
width: number;
|
||||
textPadding: number;
|
||||
labelWidth: number;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
|
@ -16,8 +16,8 @@ interface PieChartData {
|
|||
value: number;
|
||||
}
|
||||
|
||||
export function PieChart({ width, textPadding, ...props }: PieChartProps) {
|
||||
const pieWidth = width * 0.5 - textPadding;
|
||||
export function PieChart({ width, labelWidth, ...props }: PieChartProps) {
|
||||
const pieWidth = width * 0.5 - labelWidth;
|
||||
return (
|
||||
<svg className={props.className} width={width} height={width}>
|
||||
<Group top={width * 0.5} left={width * 0.5}>
|
||||
|
|
|
@ -9,7 +9,7 @@ export default function Home() {
|
|||
<h1>Playground</h1>
|
||||
<p>Show off your components here!</p>
|
||||
<div style={{ padding: "30px" }}>
|
||||
<PieChart data={mockPieData} width={800} textPadding={200} />
|
||||
<PieChart data={mockPieData} width={800} labelWidth={200} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue