This commit augments d3.time.week and d3.time.weeks with weekday-specific
methods, so that you may pick a starting day for the week other than Sunday. For
backwards-compatibility, the new sunday methods have aliases:
d3.time.sunday = d3.time.week
d3.time.sundays = d3.time.weeks
This commit also adds new weekdayOfYear methods, so that you can determine the
week number without needing to use a d3.time.format. For example, sundayOfYear
returns the week number, where weeks start on Sunday; mondayOfYear does the same
where weeks start on Monday. This commit also adds a dayOfYear method which
returns the day-of-year number for a given date, similar to the time format's %j
directive, but zero-based.
Fixes#512. Fixes#513.
This commit provides a standard interface for time intervals:
interval.floor(date)
interval.ceil(date)
interval.offset(date, k)
interval.range(start, stop, step)
All local-time intervals (such as d3.time.day) have a UTC-equivalent interval,
available as interval.utc (such as d3.time.day.utc).
Fixes#463. Note that for the time.scale, an interval function is required to
nice (such as d3.time.day). In the future, we might relax that to allow a count
of ticks, similar to the ticks method, but in that case we'd also need the
ability to floor to a given tick number (e.g., every other week) and likewise
for ceil. This seems like a reasonable first implementation.
Rather than having two implementations for local time and UTC time, we now have
a single local-time implementation and use d3_time_utc to adapt for UTC.
Rather than producing separate files for each module, the default build now
produces a single file. This should encourage better page-load performance as
the files were relatively small. Also, it's easier to deal with only one file
rather than many, especially if you're not quite sure what the dependencies are.
You may still create minimized builds, if you don't want every feature.
This commit also demotes the chart components to the examples directory, rather
than keeping them as part of the core library. As always, D3 is not a charting
library, and these were ever only intended to serve as examples.