MCPcopy Create free account
hub / github.com/idank/explainshell / d3_time_scaleSetYear

Function d3_time_scaleSetYear

explainshell/web/static/js/d3.v3.js:8344–8348  ·  view source on GitHub ↗
(y)

Source from the content-addressed store, hash-verified

8342 };
8343 }
8344 function d3_time_scaleSetYear(y) {
8345 var d = new Date(y, 0, 1);
8346 d.setFullYear(y);
8347 return d;
8348 }
8349 function d3_time_scaleGetYear(d) {
8350 var y = d.getFullYear(), d0 = d3_time_scaleSetYear(y), d1 = d3_time_scaleSetYear(y + 1);
8351 return y + (d - d0) / (d1 - d0);

Callers 1

d3_time_scaleGetYearFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected