Skip to content

Commit 9d3ba36

Browse files
committed
smarter autoHeight if no y
1 parent efe0030 commit 9d3ba36

File tree

3 files changed

+898
-899
lines changed

3 files changed

+898
-899
lines changed

src/plot.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ function ScaleFunctions(scales) {
140140

141141
function autoHeight({y, fy, fx}) {
142142
const nfy = fy ? fy.scale.domain().length : 1;
143-
const ny = y && y.type === "ordinal" ? y.scale.domain().length : Math.max(7, 17 / nfy);
143+
const ny = y ? (y.type === "ordinal" ? y.scale.domain().length : Math.max(7, 17 / nfy)) : 1;
144144
return !!(y || fy) * Math.max(1, Math.min(60, ny * nfy)) * 20 + !!fx * 30 + 60;
145145
}

0 commit comments

Comments
 (0)