Skip to content

Commit 5da2778

Browse files
committed
added a comment to explain why 4096 may be a good const to apply
1 parent a7c4485 commit 5da2778

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/plots/cartesian/position_defaults.js

+4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ module.exports = function handlePositionDefaults(containerIn, containerOut, coer
7272
// in the axes popover to hide domain for the overlaying axis.
7373
// perhaps I should make a private version _domain that all axes get???
7474
var domain = coerce('domain', dfltDomain);
75+
76+
// according to https://www.npmjs.com/package/canvas-size
77+
// the minimum value of max canvas width across browsers and devices is 4096
78+
// which applied in the calculation below:
7579
if(domain[0] > domain[1] - 1 / 4096) containerOut.domain = dfltDomain;
7680
Lib.noneOrAll(containerIn.domain, containerOut.domain, dfltDomain);
7781
}

0 commit comments

Comments
 (0)