Permalink
Browse files

Properly round values in frequencies tooltip

These had effectively been floored, resulting in the sum of a given slice typically totaling 96% for flu H3N2.
  • Loading branch information...
trvrb committed Sep 26, 2018
1 parent 6cc95f8 commit 25013af1f366b89f80d58ea21db798a674331edc
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/components/frequencies/functions.js
@@ -213,7 +213,7 @@ export const drawStream = (
/* what's the closest pivot? */
const date = scales.x.invert(mousex);
const pivotIdx = pivots.reduce((closestIdx, val, idx, arr) => Math.abs(val - date) < Math.abs(arr[closestIdx] - date) ? idx : closestIdx, 0);
const freqVal = parseInt((d[pivotIdx][1] - d[pivotIdx][0]) * 100, 10) + "%";
const freqVal = Math.round((d[pivotIdx][1] - d[pivotIdx][0]) * 100) + "%";
const xvalueOfPivot = scales.x(pivots[pivotIdx]);
select("#vline")

0 comments on commit 25013af

Please sign in to comment.