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

57 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 0d7c6c55e7 Use _ to disambiguate local vs. global d3. 2013-03-14 15:14:12 -07:00
Mike Bostock bd09d37e6c Refactor time tests for minimal load. 2013-03-14 13:29:24 -07:00
Mike Bostock 68be0ac8c8 Rename assert and XMLHttpRequest. 2013-03-14 13:00:04 -07:00
Mike Bostock a3bb93a749 Fix vows clobbering our custom asserts. 2013-03-05 09:01:18 -08:00
Mike Bostock 835c3e12d0 Add support for 0, - and _ fill padding.
For example, "%-d" formats the day with no padding, "%_d" formats the day with
space-padding equivalent to "%e", and "%0d" formats the day with zero-padding
equivalent to "%d".
2012-10-30 14:42:05 -07:00
Mike Bostock 6d7b74241a Merge branch 'locale' of git://github.com/jasondavies/d3 into 3.0 2012-10-29 09:23:18 -07:00
Mike Bostock 80009768b6 Fix for JavaScript's broken Date API. 2012-09-03 19:18:32 -07:00
Jason Davies 55acabc8e9 d3.format: support locales.
Note: the previous commit broke some tests relating to locale date
parsing, due to expecting "%m/%d/%y". On my system, the "en_US" locale
uses "%m/%d/%Y" by default. I've updated the tests to use %Y.
2012-08-13 19:58:53 +01:00
Mike Bostock 7133162c2a Fix nice implementation for time scales.
The previous implementation didn't handle polylinear domains correctly.
2012-07-31 19:38:36 -07:00
Mike Bostock cb832c147b Fix d3.time.dayOfYear test. 2012-07-31 13:29:20 -07:00
Mike Bostock 7905b83694 Merge branch 'fix-time-tests' of git://github.com/jasondavies/d3 into 2.9.7 2012-07-31 13:20:26 -07:00
Mike Bostock 90bfec5d88 Merge branch 'fix-time-full-year' into 2.9.7 2012-07-30 18:18:48 -07:00
Jason Davies 1e69f5e7b9 Fixes custom timezone tests for Node.js 0.8.x.
The process.env.TZ trick no longer seems to work. The fix automatically
adds an offset to the minutes being set, relative to the current
timezone. It assumes that the dates being tested in the scope are not in
DST, since the offset is relative to the timezone offset at the epoch.
2012-07-25 21:35:03 +01:00
Jason Davies e8f5d860e2 Fix #720: d3.time.dayOfYear floating-point error. 2012-07-23 18:34:39 +01:00
Mike Bostock 7442d95798 Merge branch 'date-2d' of git://github.com/jasondavies/d3 into fix-time-full-year 2012-07-17 14:00:08 -07:00
Mike Bostock 83b5f45997 Fix #711 for years in the first century.
Alas, the JavaScript Date constructor is Y2K-centric.
2012-07-17 13:45:34 -07:00
Jason Davies 42b9253f96 Convert 2-digit years according to POSIX.
This is also the convention used by Python 1.5.2+. Values 69-99 are
mapped to 1969-1999, and values 0–68 are mapped to 2000–2068.
2012-07-10 16:40:19 +01:00
Mike Bostock ae1fed7f4f Use shortest path for hue in d3.interpolateHsl.
Fixes #688.
2012-06-28 17:43:26 -07:00
Brandon Liu 3594c39c29 Return value of parsing invalid ISO 8601 date is consistent with other formats. 2012-05-31 20:45:54 -07:00
Mike Bostock 41371adc98 Fixes #576: leap year bug in d3.time.format.
We need to set the date fields from year down, rather than in arbitrary order.
2012-02-29 11:27:30 -08:00
Mike Bostock 2c5293675e Adopt d3.map for d3.time.format. 2012-02-21 09:03:00 -08:00
Mike Bostock b9170fb394 Add d3.time.{interval}.round. 2012-02-19 19:18:43 -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
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 35dfb87d50 Add interval.ceil. Fixes #453. 2012-02-18 21:23:17 -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
Mike Bostock 0e5bca1e0a Inclusive upper bound for time scale ticks.
Fixes #478.
2012-01-29 13:44:48 -08:00
Mike Bostock 117942e284 Sub-second and multi-year ticks for time scales.
Fixes #428. This is built on top of existing tick support for linear scales: for
small intervals, a linear scale computes ticks based on milliseconds; for large
intervals, a linear scale computes ticks based on fractional years. This commit
also extends the time scale's formatter to display milliseconds.
2012-01-29 13:28:49 -08:00
Mike Bostock c86108e522 Fix a daylight savings bug in d3.time.format.
We weren't computing the day-of-year number correctly, which affected both day
number and week number directives (%j, %U, and %W).
2011-10-12 15:37:32 -07:00
Mike Bostock 2adcdfe9d0 Add extended ISO 8601 support.
The d3.time.format.iso is designed to be compatible with the default JSON
serialization of dates, which includes milliseconds. So, d3.time.format now
supports the %L directive for formatting and parsing milliseconds. This commit
also changes d3.time.format.iso to use native ISO date methods, if available.
2011-10-11 17:46:13 -07:00
Jason Davies cc0ae766b7 Make toString return #RRGGBB for all colours.
This breaks a test case that ensures d3.hsl(x) == d3.hsl(d3.hsl(x)).

Fixes #333.
2011-10-07 17:58:58 +01:00
Mike Bostock 21f605bae5 Add test for time scale.copy. 2011-08-21 21:07:29 -07:00
Mike Bostock b0d911e90e Add tests for time.scale and time.scale.utc. 2011-08-15 11:40:42 -07:00
Mike Bostock 9a05f86c92 Add tests for time.format.parse. 2011-08-14 21:50:20 -07:00
Mike Bostock 3c3c9d122d Add test for time.format.utc. 2011-08-14 21:30:17 -07:00
Mike Bostock 7e04c3888d Add test for time.format. 2011-08-14 21:28:10 -07:00
Mike Bostock 6e7047fe5b Add test for time.format.iso. 2011-08-14 21:03:01 -07:00
Mike Bostock 5f29160efc Add test for time.years. 2011-08-14 20:55:11 -07:00
Mike Bostock 9c56e7fd0e Add test for time.year. 2011-08-14 20:54:48 -07:00
Mike Bostock e90a4666c3 Add test for time.weeks. 2011-08-14 20:47:20 -07:00
Mike Bostock 69061ea5d1 Add test for time.week. 2011-08-14 20:38:02 -07:00
Mike Bostock 521ca64a33 Add test for time.seconds. 2011-08-14 20:29:08 -07:00
Mike Bostock af8f0c571f Add test for time.second. 2011-08-14 20:23:23 -07:00
Mike Bostock 3b38d71d2e Add tests for skipping time intervals. 2011-08-14 20:18:58 -07:00
Mike Bostock a8d023d6f4 Add test for time.months. 2011-08-14 20:02:49 -07:00
Mike Bostock 959b8f9d18 Add test for time.month. 2011-08-14 19:51:53 -07:00
Mike Bostock 356d30ce28 Add test for time.minutes. 2011-08-14 19:38:02 -07:00
Mike Bostock 4ee4398d6f Add IST & NPT test for time.hours. 2011-08-14 19:22:27 -07:00
Mike Bostock 4be8e48d4d Add test for time.minute. 2011-08-14 19:16:56 -07:00
Mike Bostock b849f027bd Add test for time.hours. 2011-08-14 18:59:01 -07:00