Skip to content

Commit

Permalink
fix(vx-demo/Heatmap): fix size
Browse files Browse the repository at this point in the history
  • Loading branch information
williaster committed May 6, 2020
1 parent 86db964 commit 11b35fb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/vx-demo/src/docs-v2/examples/vx-heatmap/Example.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export default ({
margin = defaultMargin,
separation = 20,
}: Props) => {
if (width < 10) return null;

// bounds
const xMax = width / 2;
const size =
width > margin.left + margin.right ? width - margin.left - margin.right - separation : width;
const xMax = size / 2;
const yMax = height - margin.bottom - margin.top;

const binWidth = xMax / binData.length;
Expand All @@ -77,7 +77,7 @@ export default ({
xScale.range([0, xMax]);
yScale.range([yMax, 0]);

return (
return width < 10 ? null : (
<svg width={width} height={height}>
<rect x={0} y={0} width={width} height={height} rx={14} fill={bg} />
<Group top={margin.top} left={margin.left}>
Expand Down

0 comments on commit 11b35fb

Please sign in to comment.