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

527 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 74596a90f7 Remove support for functions that return maps. 2012-08-05 15:52:10 -07:00
Mike Bostock f2b45c132d Multi-value map support for classed. 2012-08-05 14:54:02 -07:00
Mike Bostock ce8852b9b4 Multi-value map support for property. 2012-08-05 09:53:33 -07:00
Mike Bostock 5c1dd6d904 Multi-value map support for style. 2012-08-05 09:53:07 -07:00
Mike Bostock 1976674fc7 Multi-value map support for attr. 2012-08-05 09:52:31 -07:00
Mike Bostock 6dd99394d5 Merge branch 'fix-minus' into 2.9.8 2012-08-02 17:50:14 -07:00
Mike Bostock da3131c876 Use hyphen instead of unicode minus for negatives.
Although the unicode minus is typographically correct, using the standard hyphen
is more conventional (and is compatible with standard parsing).
2012-08-02 17:48:26 -07: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 ea48a4a5af Merge branch 'bisect-large' of git://github.com/jasondavies/d3 into 2.9.7 2012-07-31 13:30:39 -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
Jason Davies 65a464582d d3.bisect: support very large arrays. 2012-07-31 14:00:26 +01:00
Mike Bostock 90bfec5d88 Merge branch 'fix-time-full-year' into 2.9.7 2012-07-30 18:18:48 -07:00
Mike Bostock 151d5fe054 Merge branch 'fix-time-dayOfYear' of git://github.com/jasondavies/d3 into 2.9.7 2012-07-30 18:13:32 -07:00
Mike Bostock d449be9855 Merge branch 'transition-filter' of git://github.com/jasondavies/d3 into 2.9.7 2012-07-30 18:12:37 -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 aa3e38e398 Fix and add tests for transition.filter.
Thanks, @mbostock!
2012-07-25 19:36:21 +01:00
Jason Davies 9b3e780006 Further optimisation of d3.layout.pack.
Also avoids floating point errors without clamping, hopefully.
2012-07-25 13:46:20 +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 306a3e35cb Merge branch 'fix-interpolate-hsl' into 2.9.6 2012-07-02 18:05:51 -07:00
Mike Bostock d0b0af50b6 Fix more bugs in circle clipping.
It was returning 0 rather than null when a feature was completely clipped, and
it was crashing when a closed polygon was completely clipped.
2012-07-02 17:42:23 -07:00
Mike Bostock 54b0dcba00 Optimize greatArc and circle.
When clipping, the origin of the great arc doesn’t change, so we can cache a
number of intermediate values and accelerate the clipping computation.
2012-07-02 16:58:54 -07:00
Jason Davies 8710e5bbd1 Add some unit tests for d3.geo.circle. 2012-07-02 17:02:52 +01:00
Mike Bostock 53fa8f1a4a Custom d3.svg.{area,line} interpolators.
You can now specify a function as the interpolate property of a line or area,
allowing you to define custom interpolation behavior.
2012-06-30 10:35:58 -07:00
Mike Bostock fd6c591b76 Add support for outer padding on rangeBands.
Sometimes you want additional padding between the outer bands and the range
extent. Now you can.
2012-06-28 20:41:33 -07:00
Mike Bostock ae1fed7f4f Use shortest path for hue in d3.interpolateHsl.
Fixes #688.
2012-06-28 17:43:26 -07:00
Mike Bostock 66b439d433 Add d3.tsv for tab-separated values.
This makes the previous d3.csv code a bit more generic via a d3_dsv (delimiter-
separated values) module generator. Fixes #501. (Thanks, @vlandham!)
2012-06-28 12:58:39 -07:00
Mike Bostock 49d3c6fc39 Merge branch 'transition-test' of https://github.com/jasondavies/d3 into 2.9.4 2012-06-19 08:50:37 -07:00
Mike Bostock 0d31c17360 Merge branch 'fix-log-ticks' into 2.9.3 2012-06-14 09:33:49 -07:00
Mike Bostock 0f12c1b8a8 Always display powers-of-ten tick labels.
Previously, the log scale's tick format would hide all labels when there was not
enough room to display the requested number of ticks; now it at least displays
the power-of-ten labels. Fixes #655.
2012-06-14 09:33:08 -07:00
Mike Bostock 83c6f20dd9 Merge branch 'master' of https://github.com/bdon/d3 into 2.9.3 2012-06-14 09:29:39 -07:00
Mike Bostock bc9ac2d660 Merge branch 'line-bundle' of https://github.com/jasondavies/d3 into 2.9.3 2012-06-14 09:26:57 -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
Jason Davies 40ca7f2df7 Remove trailing commas. 2012-05-27 16:13:10 +01:00
Jason Davies 82051284b1 Fix race condition in transition tests.
The transition-test-text callback was failing to fire when using the
latest Node.js master (82bcdbb8aaa4cf58917dc8d3fd4fcfc272512a2c).  This
was most likely due to these tests being run in a different order due to
a different object enumeration order.
2012-05-27 15:25:43 +01:00
Jason Davies fe6d0fd2f2 "Bundle" interpolation for single-element arrays.
In future we may want to generate some kind of loop, but it's not clear
what orientation such a loop should have, so perhaps a "non-line" like
this is better as a default.
2012-05-09 22:04:00 +01:00
Mike Bostock 00bc3f05a7 Fix another rounding bug with SI-format.
Turns out 1400 * .001 is 1.4000000000000001, but 1400 / 1000 is 1.4.
2012-04-25 22:18:02 -07:00
Jason Davies e7025c7e4a Update jsdom to v0.2.14.
We can finally re-enable those tests!
2012-04-15 19:59:56 +01:00
Mike Bostock 39a74f49ae More efficient degenerate bin check. 2012-03-29 22:07:11 -07:00
Mike Bostock 80628239d5 Merge branch 'master' of https://github.com/jonseymour/d3 into 2.9.0 2012-03-29 22:01:48 -07:00
Mike Bostock b9516e0eee Merge branch 'line-defined' into stage-2.9.0 2012-03-29 21:55:56 -07:00
Jon Seymour f16141517a Add a test that a degenerate domain does not cause histogram to barf.
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
2012-03-24 00:22:07 +11:00
Mike Bostock 21fe6d10f2 Fix a bug when interpolating exponent notation.
We weren't properly detecting "1.e2" as a valid number.
2012-03-08 10:56:15 +01:00
Jason Davies 0200f6501c Fix typo. 2012-03-04 11:52:51 +00:00
Jason Davies dbee8568b3 Add simple tests for closed radial areas. 2012-03-04 11:37:24 +00:00
Mike Bostock 4b4010363b Merge branch 'fix-time-format-leap-year' into release 2012-03-01 16:29:17 -08: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 93c78c625e Fix drift in brush extent.
Previously, if you set the brush extent externally, the extent could drift
slightly because it was internally stored in pixel space rather than in data
space. To avoid drift, the brush now preserves the extent exactly as-set, only
nullifying the externally-set extent when the brush is moved.
2012-02-28 18:27:40 -08:00
Mike Bostock b59f117341 Add tests for d3.scale.identity.
Also, we need to coerce the input values to numbers, since this is a
quantitative scale and the ticks and tickFormat methods assume numbers.
2012-02-23 10:32:42 -08:00
Mike Bostock 74be6c13d8 Fix a bug when clearing event listeners.
We weren't deleting the reference to the removed listener, so we were leaking
memory and returning a stale value on a subsequent get. Also, we now stash the
capture value when setting an event listener, so that we can automatically
remove or replace a listener without the caller needing to specify capture.
2012-02-22 21:39:02 -08:00
Mike Bostock cb97b4a167 Fix a bug with descending rangeBands. 2012-02-22 14:06:30 -08:00
Mike Bostock 0aed1e403d Merge branch 'customticks' of https://github.com/larskotthoff/d3 into v2.8.0 2012-02-21 22:42:41 -08:00
Mike Bostock 34667bf5e0 Merge branch 'master' of https://github.com/ZeeAgency/d3 into v2.8.0 2012-02-21 22:12:11 -08:00
Mike Bostock 589b12f768 Merge branch 'bisect_accessors' of https://github.com/natevw/d3 into v2.8.0 2012-02-21 21:55:18 -08:00
Mike Bostock f13d60b2ab Force transition duration of at least 1ms.
Fixes #493. Also terminates any transitions with negative or NaN durations,
rather than having them run infinitely. Also coerces NaN delays to 0 as well, to
likewise avoid infinite transitions.
2012-02-21 18:35:13 -08:00
Mike Bostock 0cf999b08f Query data via selection.data(). Fixes #525.
This method returns the array of data for the first group in the selection. Note
that the data method cannot be used to clear data bindings, since it computes a
data join; use datum(null) to clear bound data.
2012-02-21 13:31:20 -08:00
Mike Bostock f80b1cf244 Add selection.datum. Fixes #489. 2012-02-21 10:31:15 -08:00
Mike Bostock 31b0d3f197 Slight simplification to d3.ns.qualify.
This changes the behavior slightly, but in a good way: if the namespace is
unknown, then it is ignored rather than returning an undefined namespace.
2012-02-21 10:03:23 -08:00
Mike Bostock 2c5293675e Adopt d3.map for d3.time.format. 2012-02-21 09:03:00 -08:00
Mike Bostock d69cbbdaa7 Adopt d3.map for d3.svg.line and d3.svg.area. 2012-02-21 08:55:03 -08:00
Mike Bostock 0daedb2344 Harden d3_geo_type against object built-ins. 2012-02-21 08:42:37 -08:00
Mike Bostock 003c45e5b3 Adopt d3.map for d3.ease.
Also, if an unknown easing method or mode is specified, fallback to linear-in.
2012-02-21 08:39:42 -08:00
Mike Bostock 1e10e2ca88 Rename map.delete to map.remove.
Unfortunately, "delete" is a reserved word, and older browsers (such as mobile
WebKit) crash if you use reserved words as method names. I'd rather have code
that runs than strictly maintain interface-compatibility with the ES6 map.
2012-02-21 08:23:23 -08:00
Mike Bostock a52855962c Don't support interpolating non-enumerables.
We don't need to support interpolating non-enumerable properties; make it
explicit that these properties may or may not be interpolated.
2012-02-20 22:49:31 -08:00
Mike Bostock 7187082ccc Use d3.map for d3.scale.ordinal. 2012-02-20 22:32:46 -08:00
Mike Bostock da43cf2068 map.set returns the set value.
This makes map.set(key, value) equivalent to object[key] = value.
2012-02-20 22:28:42 -08:00
Mike Bostock f1197ed8b6 Use d3.map for d3_svg_symbols.
This fixes a crash with the symbol type "hasOwnProperty", rather than defaulting
to "circle". This commit also adds new map methods to retrieve the keys, values
and entries. The map class now uses non-enumerable properties (if supported).
2012-02-20 21:30:23 -08:00
Mike Bostock 7069da0c79 Use a map for d3_rgb_names.
This way, we don't think "hasOwnProperty" is an RGB color. This commit also
replaces the map.keys method with a generic forEach iterator.
2012-02-20 20:40:43 -08:00
Jason Davies ebab983b8a Use d3.map instead of Object.hasOwnProperty.call. 2012-02-20 19:57:19 +00:00
Mike Bostock 738b634789 Add d3.map.
This is, essentially, an ES6 shim for a Harmony Map. We will use it instead of
using a bare object, so that we don't need to worry about collision with built-
in properties names (such as "__proto__" and "hasOwnProperty").
2012-02-20 11:23:36 -08:00
Jason Davies bb61f88aaf Fix interpolation of inherited object properties. 2012-02-20 08:52:45 +00:00
Jason Davies 2314b2a0cd Simplify. 2012-02-20 04:52:53 +00:00
Jason Davies 4889a08e4c Merge remote-tracking branch 'mbostock/v2.8.0' into builtin-properties
Conflicts:
	d3.v2.min.js
2012-02-20 04:46:52 +00:00
Jason Davies 2dbe80fd34 Fix another edge case for data binding. 2012-02-20 04:43:44 +00:00
Jason Davies 19dd294c50 Fix d3.nest and d3.ns for built-in properties. 2012-02-20 04:06:20 +00:00
Jason Davies 1030db1cd6 Fix d3.interpolate for built-in prototype properties. 2012-02-20 03:31:02 +00:00
Mike Bostock b9170fb394 Add d3.time.{interval}.round. 2012-02-19 19:18:43 -08:00
Jason Davies 1e63be0cdd Handle keys that are in the default object's prototype chain.
This may seem a bit improbable at first, but I ran into this when
testing something unrelated in Firefox, which turns out to have:

  "watch" in {} === true
2012-02-20 03:18:10 +00: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 1643aa9b46 Merge branch 'master' of https://github.com/trevnorris/d3 into v2.8.0
I simplified the implementation, though it still seems somewhat magical. I
would be more confident if there were an easy way to extract the mantissa and
exponent from a floating point number, but since JavaScript does not expose the
bitwise representation of numbers, there's no easy way to do it.
2012-02-18 13:05:02 -08:00
Trevor Norris 8178c2961b clean up step calculations. add better method for values with no decimal part. included additional tests to demonstrate fixes. 2012-02-15 14:23:27 -08:00
Trevor Norris de8cddc6b8 forgot to follow spacing rules 2012-02-14 16:09:52 -08:00
Trevor Norris 76b13d547f use better method for calculating error correction. add test that failed the old method. 2012-02-14 16:03:38 -08:00
Mike Bostock 744aa9696e Define behavior for mismatched domain & range. 2012-02-13 23:11:05 -08:00
Trevor Norris 87f48b7aa2 fix range increment error caused by IEEE 754 2012-02-07 14:09:39 -08:00
Mike Bostock feb1da151f Merge branches 'fix-polygon', 'fix-interpolate-transform', 'fix-multiyear-time-scale' and 'dispatch-chain' into release 2012-02-01 20:06:44 -08:00
Mike Bostock 85ad3c16b0 Fix polygon.centroid for open polygons.
The implementation assumed closed polygons, but it should work on either. This
is a partial fix for #443.
2012-01-29 14:29:14 -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 fef4f911db Merge branch 'dispatch-chain' of https://github.com/jasondavies/d3 into dispatch-chain 2012-01-29 10:43:22 -08:00
Mike Bostock cdcde01615 Merge branch 'treemap-overlap' of https://github.com/jasondavies/d3 into 2.7.x 2012-01-26 10:48:32 -08:00
Jason Davies 1708e5e7a5 Fix treemap overlap problem.
See #136.
2012-01-25 17:36:45 +00:00
Nathan Vander Wilt 61141b0be2 move accessor argument next to array param based (for #451 incorporating pull request discussion) 2012-01-24 09:04:46 -08:00
Lars Kotthoff d043d1126a setting ticks()/tickValues() sets the other one to null (mbostock) 2012-01-19 20:45:19 +00:00
Lars Kotthoff 8c2204c680 separate variable and accessor method for ticks (mbostock) 2012-01-19 20:43:57 +00:00
Lars Kotthoff 29e39cf60a test for tick positions given as list 2012-01-19 20:40:43 +00:00
Mike Bostock 5b27271364 Fix polylinear descending domains or ranges.
Fixes #446.
2012-01-18 13:10:00 -08:00
Mike Bostock f21d6b826b Fix a bug in circle-packing layout.
There's an edge condition which is not discussed in the original algorithm
("Visualization of Large Hierarchical Data by Circle Packing", Wang et. al):
what happens if the first intersecting circle C_j is equidistant from C_m and
C_n? In other words, it is both after C_n on the front-chain, and before C_m.
The correct answer is that you should splice the smaller of the two circles. If
C_m is smaller than C_n, then splice from C_j to C_n and set C_m to C_j;
otherwise, splice from C_m to C_j, and set C_n to C_j.
2012-01-17 13:02:19 -08:00
Mike Bostock 149d174029 Fix NaN in clamped log scale inversion. 2012-01-01 12:15:22 -08:00
Mike Bostock 5bae5f4788 Add test for range clamping. 2012-01-01 11:44:49 -08:00
Mike Bostock f7c98d10e9 Merge branch 'cluster' of https://github.com/jasondavies/d3 into 2.7.1 2011-12-30 11:58:36 -08:00
Mike Bostock 394d384633 Merge branch 'pie' of https://github.com/jasondavies/d3 into 2.7.1 2011-12-30 11:57:46 -08:00
Mike Bostock 6220d30689 Merge branch 'axis-ordinal' of https://github.com/jasondavies/d3 into 2.7.1 2011-12-30 11:57:32 -08:00
Mike Bostock 22cdb642cd Merge branch 'html-text-undefined' of https://github.com/jasondavies/d3 into 2.7.1 2011-12-30 11:56:59 -08:00
Mike Bostock 09c6e51dbd Use mime type for accept header.
Fixes #412.
2011-12-30 11:22:13 -08:00
Jason Davies bb47c10966 Treat undefined like null when setting html/text.
Fixes #405.
2011-12-15 17:55:03 +00:00
Jason Davies ac7e87e0a7 Test ordinal rangeExtent with explicit range. 2011-12-14 09:27:58 +00:00
Jason Davies 1a98398be0 Fix d3.svg.axis path for explicit ordinal range. 2011-12-14 09:15:25 +00:00
Jason Davies c603af8e5e d3.layout.pie: return arcs in original data order.
Fixes #406.
2011-12-13 13:32:51 +00:00
Jason Davies d49c499c68 Handle single node in d3.layout.cluster.
If there is only one node, it will be positioned at y = 0, which is
consistent with d3.layout.tree.

Fixes #396.
2011-12-13 12:49:09 +00:00
Mike Bostock a6f87e751c Allow selectors for selection.filter.
Fixes #397.
2011-12-08 17:49:22 -08:00
Mike Bostock 4a35d78848 Add selection.order.
It's like selection.sort, except it assumes that the data is already sorted;
the elements are reordered to match the selection.
2011-12-08 17:14:08 -08:00
Mike Bostock 33ab885baa Merge branch 'fix-interpolate-number' into release 2011-11-29 21:57:20 -08:00
Mike Bostock 2be4efd609 Fix #392 - interpolate string to number. 2011-11-29 21:55:51 -08:00
Mike Bostock a752b9627f Fix #394. 2011-11-29 21:36:51 -08:00
Mike Bostock 9c9266606c Merge branch 'transpose' into release 2011-11-23 12:59:49 -08:00
Mike Bostock ee3954c11f Merge branch 'ordinal-axis' into release 2011-11-23 12:59:31 -08:00
Mike Bostock 11c1e7a906 Infer namespaces for root element.
Now if you add an "svg" element, we automatically infer the namespace because
there is an "svg" namespace prefix. In conjunction with inheriting the namespace
from the parent element, this means that namespaces are almost optional!
2011-11-23 12:56:03 -08:00
Mike Bostock cc3f5da0bb Merge branch 'master' into default-namespace 2011-11-23 12:44:49 -08:00
Mike Bostock 3d6b4cf2fb Add transpose. 2011-11-23 12:44:04 -08:00
Mike Bostock 552622da17 Ordinal scales for axes. 2011-11-23 12:05:52 -08:00
Mike Bostock 1b3a3b3cb3 dispatch.on(name) returns the current listener.
Fixes #383. This includes a non-backwards-compatible change to d3.rebind, so as
to make it easier to rebind multiple methods on subclasses.
2011-11-22 14:36:09 -08:00
Mike Bostock 75ddc28368 Fix a bug when removing a shared listener.
Previously, each listener function had a private _on property which recorded
whether the listener was enabled; this was set to false when the listener was
removed. (This is necessary because of the copy-on-write semantics when the
array of listeners is modified while events are being dispatched.) If the
listener was registered for multiple event types ("foo" and "bar") then removing
the listener for any type would disable it for all types.

The fix is to wrap the listener in an object. This also has better encapsulation
since the state is kept private.
2011-11-22 13:08:55 -08:00
Mike Bostock 64c4e787e2 Merge branch 'master' into log 2011-11-16 13:53:28 -08:00
Mike Bostock 3de298bc37 Fixed precision for the default log tick format.
Also add @jmarca's test case.
2011-11-10 12:35:09 -08:00
Mike Bostock da47ae88bd Remove spurious rounding. 2011-11-10 12:31:54 -08:00
Jason Davies 4d6b5bc342 Update JSDOM and Vows versions.
This required changing assert.length to assert.lengthOf in tests, due to
a Vows.js change to be compatible with Node.js v0.6.x.  For further
details:

    https://github.com/cloudhead/vows/pull/141
2011-11-09 19:19:15 +00:00
Mike Bostock e78cd68acc Merge branch 'interpolate' of https://github.com/jasondavies/d3 into 2.5.0 2011-11-04 15:13:44 -07:00
Jason Davies e60bc4d525 Fix minor bug in exponent notation interpolation. 2011-11-04 22:01:55 +00:00
Mike Bostock 4882a6448b Fix range generation for ordinal scales.
Using d3.range with a floating point step is a bit sketchy, because there's a
chance that too many or too few elements could be generated. Instead, we now we
generate an integer range and scale it accordingly.
2011-11-04 12:03:01 -07:00
Jason Davies d11b5d9e4d Merge remote-tracking branch 'mbostock/brush' into extent
Conflicts:
	d3.js
	d3.min.js
	src/core/extent.js
	test/core/extent-test.js
2011-11-03 17:34:02 +00:00
Jason Davies a4abdc3c45 Use a single loop for d3.extent. 2011-11-03 16:59:41 +00:00
Mike Bostock 2b42dec930 Invoke accessor once per value in d3.extent.
This allows the use of nondeterministic accessors. Also add a test.
2011-11-03 09:20:06 -07:00
Mike Bostock 392ded0820 Namespaces for d3.dispatch events.
Fixes #294. This isn't backwards-compatible, but d3.dispatch is considered an
internal API so this doesn't require a major version bump.
2011-10-29 10:42:19 -07:00
Mike Bostock a62bd527ca Fix a bug in enter selection's empty.
Due to the ordering in which the prototypes are defined, it was still undefined!
Also, the empty method depends on the node method being defined. Added a test.
2011-10-19 20:57:53 -04:00
Mike Bostock 3f3569cc71 Consistent timing for subtransitions.
It was previously possible for small differences in the reference time for
subtransitions. This could lead to tearing with expensive transitions, as some
transitions would have slightly different reference times than the others. This
is fixed by passing the reference time along explicitly when deriving a new
transition, either by the transition or selection operators.
2011-10-14 13:45:16 -07: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 639f802d22 Merge branch 'nice' into release 2011-10-11 18:01:43 -07:00
Mike Bostock b5a1c34cdf Merge branch 'nice' of https://github.com/jasondavies/d3 into nice 2011-10-11 18:01:25 -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
Mike Bostock 307016e843 Fix a rounding bug in SI-prefix format.
Also, expose d3.formatPrefix so that it's easier for callers to create a
formatter for a specific prefix (such as using the "G" prefix for all ticks).
2011-10-11 16:46:47 -07:00
Jason Davies d2943a0724 Better handling of empty domains for nice scales. 2011-10-11 09:12:56 +01:00
Mike Bostock 92524e9796 Merge branch 'si-format' into release 2011-10-10 21:39:00 -07:00
Mike Bostock 1f20609a41 Merge branch 'centroid' into release 2011-10-10 21:38:26 -07:00
Mike Bostock 32d871c4a0 Merge branch 'mean' into release 2011-10-10 21:37:56 -07:00
Mike Bostock b5dc45a87c Better rounding of significant digits.
This simplifies the implementation and fixes a few bugs. The si prefix format
("s") now supports variable precision; in fact, you are strongly recommended to
specify a precision, such as ".3s".
2011-10-10 21:13:25 -07:00
Mike Bostock fe83f16321 Merge branch 'add-si-prefix-format' of https://github.com/pjjw/d3 into si-format 2011-10-10 17:54:46 -07:00
Mike Bostock 9d9a3f7ca6 Merge branch 'geom-centroid' of https://github.com/jasondavies/d3 into centroid 2011-10-10 17:50:17 -07:00
Mike Bostock 31cb66f9f1 Add d3.median. 2011-10-10 17:49:53 -07:00
Mike Bostock 9523c4d2d1 Merge branch 'mean' of https://github.com/jasondavies/d3 into mean 2011-10-10 17:41:52 -07:00
Mike Bostock d2ba3b2d2c Minor fixes for the axis component.
You can now change the orientation and the axis will redraw correctly. When an
axis is applied by a transition, the subtransitions will properly inherit the
transition id, allowing transitions on reselected elements to continue.
2011-10-10 16:45:08 -07:00
Jason Davies f9148ed4f4 Rearrange polygon tests.
This arranges them first by the type of polygon we're testing, then the
operations.  I've added tests for clockwise polygons too, for good
measure.
2011-10-08 18:19:01 +01:00
Jason Davies 3740741441 Add tests for d3.geom.polygon and fix centroid bug.
d3.geom.polygon(…).area() assumes screen pixel coordinates with (0, 0)
at the top left, and y increasing going downwards.  This results in a
positive area for counterclockwise coordinates.  Howver, the default
centroid calculation was assuming "usual" Cartesian coordinates with y
increasing going upwards, hence the centroid coordinates were
incorrectly multiplied by -1.

This fix won't affect d3.geo.path(…).centroid() as it passes a constant
to d3.geom.centroid.
2011-10-08 18:01:53 +01:00
Jason Davies 7a8460ede0 Remove dangling __data__ from other tests.
This occurs on Linux, where the directory listing order is different
from OS X and so other tests leave data bound to the "body" element.
This data is then propagated when new elements are appended, and thus
mess up some of the tests!
2011-10-08 13:01:35 +00:00
Jason Davies bf73f5c506 Fix another couple of race conditions in tests. 2011-10-08 12:42:45 +01:00
Jason Davies b9db0585cb Fix some potential race conditions in tests.
Unless .html("") is called on d3.select("body"), elements appended by
another test could interfere with data binding.

See #329.
2011-10-08 00:09:59 +01:00
Jason Davies da189667c1 Add d3.mean.
Uses Welford's algorithm to avoid overflow.

See #245.
2011-10-07 22:00:44 +01:00
Mike Bostock 9e303516f0 Merge branch 'classed' of https://github.com/jasondavies/d3 into release 2011-10-07 12:18:33 -07:00
Mike Bostock 440d96155f Merge branch 'transition-null' of https://github.com/jasondavies/d3 into release
Conflicts:
	test/core/transition-test-attr.js
2011-10-07 12:17:17 -07:00
Mike Bostock 87c1f831cb Merge branch 'area-step-interpolate' into release 2011-10-07 12:16:15 -07:00
Mike Bostock 4d1de5e175 Fix a bug in area step interpolation.
When computing the reversed baseline, we need to switch between step-before and
step-after, since the points are in reverse order. Otherwise, we're effectively
filling the gap between step-before and step-after.
2011-10-07 11:32:06 -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
Jason Davies 037493c250 Fix bug when transitioning namespaced attributes.
Also, simplify handling of nulls.
2011-10-06 20:06:14 +01:00
Jason Davies 57a3b0dbcb More efficient removal of transition properties.
Thanks, @mbostock!
2011-10-06 09:54:07 +01:00
Jason Davies db65a3849f Use removeAttribute when transitioning to null. 2011-10-05 23:05:42 +01:00
Jason Davies 878d1c1c13 Fix transitioning styles to null (removal). 2011-10-05 22:35:19 +01:00
Mike Bostock bbb126fae7 Merge pull request #324 from jasondavies/tree-test
Another test for empty children arrays.
2011-09-30 09:02:11 -07:00
Jason Davies 68f555bfc2 Add test for transition.selectAll and NodeLists.
This tests the fix in cd3d236015.
2011-09-30 16:55:30 +01:00
Jason Davies c7f58466ad Simplify. 2011-09-30 08:48:28 +01:00
Jason Davies 886b6599bb Another test for empty children arrays.
This tests for the issue fixed in
6804a60fe4.
2011-09-30 08:43:22 +01:00
Jason Davies 927426f79f Support multiple classes in classed operator.
Fixes #320.
2011-09-29 11:30:20 +01:00
Mike Bostock bbcaa27732 Fix for Bonne projection at 0° parallel. 2011-09-27 14:58:39 -07:00
Mike Bostock 6a65451b90 Merge branch 'bonne' of https://github.com/jasondavies/d3 into release 2011-09-27 13:57:56 -07:00
Mike Bostock a70975b248 Merge branch 'gnomonic' into release 2011-09-27 13:56:18 -07:00
Mike Bostock fd0759f02a Merge branch 'fix-format-zero-sigfig' into release 2011-09-27 13:56:07 -07:00
Mike Bostock 4c179d9386 Merge branch 'scale-log-ticks' into release 2011-09-27 13:55:35 -07:00
Mike Bostock 80fafd527c Add back d3_array for IE9.
This also tweaks the array conversion slightly so that it is called by
selection.selectAll rather than d3_selectAll; this guarantees that the selection
groups are always arrays, even when a function selector is used.
2011-09-27 08:45:06 -07:00
Mike Bostock 14dcdea8f6 Add d3.geo.greatArc.
The greatArc class is the new name for greatCircle, which actually represents
great arcs. Meanwhile, a new greatCircle class is for great circles. The new
greatCircle class replaces the old clip class, providing clipping and resampling
functionality (using greatArc internally). This isn't backwards-compatible, but
I may forgo the major version number bump in light of the fact that greatCircle
was just added, and not used in any (official) examples or documented.
2011-09-27 00:34:22 -07:00
Mike Bostock b678e0876d Merge branch 'gnomonic' of https://github.com/jasondavies/d3 into gnomonic 2011-09-26 16:36:46 -07:00
Jason Davies a6eb928490 Add Bonne geographic projection.
Note that the Werner projection is a special case with standard parallel
at 90°N, and the Sinusoidal projection is also a special case with
standard parallel at 0°N.
2011-09-26 00:58:59 +01:00
Mike Bostock 7895afbda5 Better log ticks.
This adds support for filtering the log ticks, such that fewer ticks can be
generated to fit in a small space. This can be used in conjunction with a
custom tick format as well. This commit also changes the default log tick format
to be exponential rather than precision, for consistency.
2011-09-21 15:32:19 -07:00
Peter Woodman 8914a38981 expand si representation range to abs(x) < 10^27 2011-09-20 18:14:00 -07:00
Peter Woodman 4918c83f41 separate variable for dropping post-decimal zeros, possibly useful for other formats. 2011-09-20 17:23:55 -07:00
Peter Woodman 0ca32a8f69 add SI prefix formatting to d3.format 2011-09-20 16:20:06 -07:00
Peter Woodman 6ca72c41e7 fix significant figures formatting ('r') when specifying a precision for input 0. 2011-09-20 15:08:51 -07:00
Jason Davies 9a8b38370b Add test for coincident circles. 2011-09-18 13:43:24 +01:00
Jason Davies 016ed70559 Make residual floating point test clearer.
This test makes sure NaN doesn't creep in due to Math.acos being called
on numbers like +/- 1.000000000004, so it's more descriptive to check
isNaN rather than the exact numerical results.
2011-09-18 10:47:03 +01:00
Mike Bostock ee10316d97 Merge branch 'pack' of https://github.com/jasondavies/d3 into release 2011-09-17 20:05:09 -07:00
Mike Bostock 76b718092a Remove unused code.
The hierarchy layout is abstract; the nodes method is defined on subclasses.
2011-09-17 19:19:23 -07:00
Mike Bostock 41329688c2 Merge branch 'hierarchy-children' of https://github.com/jasondavies/d3 into release 2011-09-17 19:04:02 -07:00
Mike Bostock 8f78039773 Rename equirect to equirectangular; add test. 2011-09-17 19:02:34 -07:00
Jason Davies d832335c6d Reinstate d3.geo.greatCircle.n.
For backwards compatibility.  Setting precision turns off n, and vice
versa.
2011-09-12 17:32:36 +01:00
Jason Davies 15dda93e3b Reinstate d3.geo.greatCircle.polyline.
For backwards compatibility.
2011-09-12 17:23:32 +01:00
Jason Davies cb8afe72b9 Fix azimuthal projections of origin point. 2011-09-12 13:45:04 +01:00