Граф коммитов

15 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock f37fd52100 Add d3.scale.identity. Fixes #483. 2012-02-19 20:52:44 -08:00
Mike Bostock b9170fb394 Add d3.time.{interval}.round. 2012-02-19 19:18:43 -08:00
Mike Bostock 1fac89e74f Merge branch 'mouse' of https://github.com/jasondavies/d3 into jasondavies-mouse 2012-02-19 17:14:41 -08:00
Mike Bostock c2780d5075 Add various weekday methods, and dayOfYear.
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.
2012-02-19 17:00:04 -08:00
Jason Davies 064822630e Slightly more graceful check for createSVGPoint.
Less brittle, anyway.
2012-02-19 23:56:06 +00:00
Jason Davies 1a6efaddca Simplify. 2012-02-19 23:20:56 +00:00
Mike Bostock 0b48ec4a9a Merge branch 'zoom-extent' into v2.8.0 2012-02-19 13:28:16 -08:00
Mike Bostock 380a2f4eb6 Merge branch 'decorative-brush-resizers' into v2.8.0 2012-02-19 13:24:57 -08:00
Mike Bostock 4af8633d88 Add tests for interval.offset.
Also, don't modify the passed-in date; for consistency with other methods, and
for convenience over performance, return a new date.
2012-02-19 12:24:38 -08:00
Jason Davies 9c124a687e Merge branch 'master' into mouse
Conflicts:
	Makefile
	d3.min.js
	d3.v2.js
	examples/zoom/zoom.html
2012-02-19 20:18:07 +00:00
Mike Bostock 077411a236 Add interval.range, and time.scale.nice.
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.
2012-02-18 22:56:54 -08:00
Mike Bostock 82cd7257f9 Add d3.time.{interval}.offset. Fixes #435.
This method can be used to advance a given date by a given interval.
2012-02-18 22:00:47 -08:00
Mike Bostock 35dfb87d50 Add interval.ceil. Fixes #453. 2012-02-18 21:23:17 -08:00
Mike Bostock 0e4fc7cdc6 Unify interval definitions via d3_time_utc.
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.
2012-02-18 20:36:06 -08:00
Mike Bostock 3081dd45ef Consolidate everything into d3.v2.js.
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.
2012-02-18 14:04:01 -08:00