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

Commit

Permalink
increase verySmallNumber in single point domain calc
Browse files Browse the repository at this point in the history
  • Loading branch information
boygirl committed Jun 19, 2017
1 parent 276312a commit a96eb8e
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 a96eb8e

Please sign in to comment.