diff --git a/src/Graph.tsx b/src/Graph.tsx index aac98ca..38c8b06 100644 --- a/src/Graph.tsx +++ b/src/Graph.tsx @@ -135,7 +135,7 @@ function XAxisMarks({ xMarks, projectX, }: { - height: number; + height: Accessor; xMarks: number[]; projectX: Projector; }) { @@ -148,12 +148,12 @@ function XAxisMarks({ - + {xMark} @@ -214,7 +214,6 @@ function Path({ y: projectY(y), })) ); - // .toArray(); /** * A semicolon-separated list of entire path definitions (d="..."). This is where you define the key shapes: @@ -292,8 +291,7 @@ export default function Graph({ entries, width }: Properties) { to: days, }); - // const width = 100; - const height = 100; + const height = width; function projectX(x: number) { const percentage = x / days; @@ -340,7 +338,7 @@ export default function Graph({ entries, width }: Properties) { const length = to - from; const percentage = (y - from) / length; - const inSvg = height - percentage * height; + const inSvg = height() - percentage * height(); return inSvg; } @@ -366,7 +364,7 @@ export default function Graph({ entries, width }: Properties) { return (