Skip to content

Commit

Permalink
fix(shape/AreaClosed): set y0 when it equals zero (#955)
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster authored Dec 2, 2020
1 parent ed33437 commit f5b7f84
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/visx-shape/src/shapes/AreaClosed.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ export default function AreaClosed<Datum>({
...restProps
}: AddSVGProps<AreaClosedProps<Datum>, SVGPathElement>) {
const path = area<Datum>({ x, x0, x1, defined, curve });
if (y0) {
setNumOrAccessor(path.y0, y0);
} else {
if (y0 == null) {
/**
* by default set the baseline to the first element of the yRange
* @TODO take the minimum instead?
*/
path.y0(yScale.range()[0]);
} else {
setNumOrAccessor(path.y0, y0);
}
if (y && !y1) setNumOrAccessor(path.y1, y);
if (y1 && !y) setNumOrAccessor(path.y1, y1);
Expand Down

0 comments on commit f5b7f84

Please sign in to comment.