d3/d3-brush

small bug in the brush "snap" demo

Fil opened this issue · 1 comments

Fil commented

the demo at http://bl.ocks.org/mbostock/6232537 does not snap properly to a full day when you brush a small width

bug

changing line 74 seems to fix it:

-     d1[1] = d3.timeDay.offset(d0[1]);
+    d1[1] = d3.timeDay.ceil(d0[1]);

It was supposed to be:

d1[1] = d3.timeDay.offset(d1[0]);

I’ve fixed it.