Skip to content
This repository has been archived by the owner on Feb 19, 2022. It is now read-only.

Commit

Permalink
Merge pull request #257 from FormidableLabs/single-point-domain
Browse files Browse the repository at this point in the history
increase verySmallNumber in single point domain calc
  • Loading branch information
boygirl authored Jun 20, 2017
2 parents 276312a + a96eb8e commit a9de497
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/victory-util/domain.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ export default {
},

getSinglePointDomain(val) {
const verySmallNumber = 1 / Number.MAX_SAFE_INTEGER;
// d3-scale does not properly resolve very small differences.
// eslint-disable-next-line no-magic-numbers
const verySmallNumber = Math.pow(10, -15);
const adjustedMin = val instanceof Date ? new Date(val - 1) : val - verySmallNumber;
const adjustedMax = val instanceof Date ? new Date(val + 1) : val + verySmallNumber;
return [adjustedMin, adjustedMax];
Expand Down

0 comments on commit a9de497

Please sign in to comment.