Skip to content

Commit 52556e2

Browse files
committed
link to d3-time
1 parent dcf1095 commit 52556e2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/time.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const durationWeek = durationDay * 7;
1313
const durationMonth = durationDay * 30;
1414
const durationYear = durationDay * 365;
1515

16+
// See https://github.com/d3/d3-time/blob/9e8dc940f38f78d7588aad68a54a25b1f0c2d97b/src/ticks.js#L14-L33
1617
const formats = [
1718
["millisecond", 0.5 * durationSecond],
1819
["second", durationSecond],
@@ -138,6 +139,7 @@ export function formatTimeTicks(scale, ticks, anchor) {
138139
throw new Error("unable to format time ticks");
139140
}
140141

142+
// See https://github.com/d3/d3-time/blob/9e8dc940f38f78d7588aad68a54a25b1f0c2d97b/src/ticks.js#L43-L50
141143
function getTimeTicksInterval(scale, ticks) {
142144
const [start, stop] = extent(scale.domain());
143145
const count = typeof ticks === "number" ? ticks : 10; // TODO detect ticks as time interval?

0 commit comments

Comments
 (0)