PoonLab/covizu

Rect elements not properly scaled

Closed this issue · 4 comments

Just to put the above into words, the range of collection dates for this lineage does not line up with the time axis of the tree plot

image

The cutoff slider does not align with the time axis of the tree plot either

Looks like the issue with the xaxis scaling was because we were setting an interval of 365.25 days:

covizu/js/drawtree.js

Lines 163 to 167 in 4ab1ba4

function xaxis_to_date(x, tip) {
var coldate = new Date(tip.first_date); // collection date of reference tip
coldate = d3.timeDay.offset(coldate, 365.25*(x - tip.x));
return (coldate.toISOString().split('T')[0]);
}

I've adjusted this now to use an interval based on the earliest and latest collection date of samples from all clusters in the tree

Pending PR