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

389 Коммитов

Автор SHA1 Сообщение Дата
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
Jason Davies 90cd1bcffa Remove source/target for great circles.
These are redundant now that we can process an array of coordinates.
2011-09-12 13:14:37 +01:00
Jason Davies e284f87b0d Add d3.geo.greatCircle.polyline and precision.
This can be used to process output from d3.geo.clip to ensure clipped
polygons are correctly curved.

The "n" option has been replaced with precision, which denotes the
approximate angular length of great-circle segments.  This is much
faster than using a fixed number of segments, particularly when
processing a large number of polygons, only a few of which may have
edges long enough to warrant being converted into a geodesic.
2011-09-12 12:46:19 +01:00
Jason Davies abc6541cd5 Add d3.geo.clip for radial clipping.
This can be used with d3.geo.path.clip to clip the input coordinates of
geographical shapes using a given origin and angular radius, e.g. for
hemispherical or near-hemispherical views.  Geodesics are inserted as
necessary.

This also includes a minor bugfix and test for d3.geo.path: the last
coordinate of Polygon features was being included unnecessarily
(MultiPolygon already handled this correctly).
2011-09-12 09:27:57 +01:00
Jason Davies afe60a14e6 Add azimuthal "equalarea" projection mode. 2011-09-10 13:42:45 +01:00
Jason Davies 1e017e60b6 Add azimuthal equidistant projection mode. 2011-09-10 13:34:19 +01:00
Jason Davies 71542f6bb1 Add "gnomonic" mode to azimuthal projection.
Also, moved d3_radians to src/geo/geo.js.
2011-09-10 12:51:19 +01:00
Jason Davies 8d6511a2d0 Use partition.nodes in tests for consistency. 2011-09-09 08:20:55 +01:00
Jason Davies 3b629b4493 Add empty children test for partition layout. 2011-09-08 09:12:38 +01:00
Jason Davies 1873142295 Add empty children test for treemap layout. 2011-09-08 09:04:13 +01:00
Jason Davies feef31a492 Add empty children/zero tests for cluster layout. 2011-09-08 09:00:24 +01:00
Jason Davies ab525c4784 Fix empty children handling for revalue.
Also, fix empty children handling for cluster layout.

Tests included.
2011-09-08 08:58:29 +01:00
Jason Davies d024c3f82c Treat nodes with empty children arrays as leaves.
Fixes #286.
2011-09-08 00:26:44 +01:00
Jason Davies 833bc5dddf Fix previous optimisation and add test. 2011-09-03 22:24:10 +01:00
Jason Davies d237320c39 Handle zero-valued nodes in d3.layout.pack.
Also fixed handling of empty children array.

Fixes #281.
2011-09-02 11:52:24 +01:00
Mike Bostock 897b0b64e2 Merge branch 'ease-clamp' into release 2011-08-31 17:50:07 -07:00
Jason Davies 3d064526d4 Reverse subpath direction for annulus. 2011-08-31 12:48:01 +01:00
Mike Bostock e7ac548105 Clamp easing functions to [0,1].
Rather than have a treshold in transitions, we now clamp the easing functions.
This guarantees that when the transition ends, the tweens will be called with
t=1, and produce clean output values. Previously, that was not the case for
certain easing functions, such as exp-out and elastic.
2011-08-30 13:07:41 -07:00
Mike Bostock 0d6c2e7692 Merge branch 'geo-invert' of https://github.com/jasondavies/d3 into release 2011-08-29 11:54:21 -07:00
Mike Bostock 1e60010370 Merge branch 'greatcircle' of https://github.com/jasondavies/d3 into release 2011-08-29 11:53:22 -07:00
Mike Bostock fa312bfdd0 Merge branch 'ie9-style' into release 2011-08-29 11:52:45 -07:00
Jason Davies c06043919f Rename d3.geo.greatcircle to d3.geo.greatCircle. 2011-08-29 18:05:09 +01:00
Jason Davies f20f416a17 Add source and target accessors.
Higher-order programming!  This makes it more akin to d3.svg.chord i.e.
it can take "d" and "i" arguments.  Thanks for the suggestion, Mike!

Also made "n" and "radius" configurable, too.
2011-08-29 11:48:51 +01:00
Mike Bostock c2e37352ac Fix for IE9's style.setProperty.
IE9 does not string-coerce values, instead throwing an error. We now wrap IE9's
implementation to force string coercion. While it would be simpler to turn on
string-coercion for all browsers inside D3's style operator, this approach
avoids penalizing standards-compliant browsers.

This commit also moves language-compatibility code to a separate directory, and
deletes the obsolete Object.create polyfill, which is no longer needed by D3.
2011-08-28 19:35:53 -07:00
Mike Bostock 874c6f4503 Don't string-coerce ordinal domain values.
Fixes #274. String coerce for uniqueness, but store the original input types in
the domain for subsequent retrieval. This way, you can more easily use
non-strings as domain values (such as dates or numbers).
2011-08-28 15:23:17 -07:00
Jason Davies 399b145a20 Add d3.geo.greatcircle.
Can be used to generate great circle paths.  Similar to R's
geosphere.gcIntermediate (in which I discovered a bug, while writing the
test case for this!)

Includes d3.geo.greatcircle().distance for computing the shortest geo
path distance using the Haversine formula.

For a tutorial on using great circles, see:
http://flowingdata.com/2011/05/11/how-to-map-connections-with-great-circles/
2011-08-28 17:06:48 +01:00
Mike Bostock a35fc55410 Inherit namespace from parent node.
This allows you to append("g") to an svg:svg, instead of append("svg:g").
2011-08-27 11:38:03 -07:00
Mike Bostock cd135d5e90 Fix a flakey test.
Need to wait a bit to allow the other transition to finish, too.
2011-08-27 10:59:24 -07:00
Jason Davies 872c9ff13b Add invert to mercator, albers and azimuthal.
Includes unit tests.

Fixes #246.
2011-08-27 13:25:40 +01:00
Mike Bostock 18519d9c2d Merge branch 'concurrent-transition' into release 2011-08-26 16:58:45 -07:00
Mike Bostock 364bf941ca Use reference count rather than owner id.
As of 2.0.0, it's possible to have multiple transitions running concurrently
with the same id. Thus, it is no longer sufficient to check the transition id
to decide whether to delete the transition lock. We now use reference counting
to determine the number of transitions that are scheduled on a given element;
when that number drops to zero, we can delete the transition lock.
2011-08-26 16:50:29 -07:00
Jason Davies 04d2d546cf Fix negatively-sized rectangles in treemap.
Includes unit test!

Fixes #136.
2011-08-26 18:46:01 +01:00
Mike Bostock 0f4152e042 Fix the domain path for polylinear scales. 2011-08-24 16:20:59 -07:00
Mike Bostock ba2a68bb94 Allow tickFormat to be specified as a constant.
This was basically supported already, but there was a slight bug in the truthy
check for tickFormat. Now we check for null rather than falsiness.
2011-08-24 16:11:28 -07:00
Mike Bostock 9d4b6a02fb Fix a bug in selector functions.
They weren't being invoked with the correct syntax (being passed the data and
index, with the current node as the context). This commit also removes the
d3_array wrapper, which does not appear to be necessary; I've forgotten why it
was there in the first place.
2011-08-24 14:08:19 -07:00
Mike Bostock 95805adc9b Promote the axis component to the svg module.
I'm including the axis component in the core build because it should be useful
in many different visualization types, similar to the other svg components. The
chart module contains a hodgepodge of more obscure visualization types, and
there's no reason to pull those in for more common visualizations. Perhaps most
importantly, the axis component isn't a chart type!
2011-08-23 12:02:12 -07:00
Mike Bostock ce947ecf76 Allow minor and end tick size to be customized. 2011-08-23 11:07:18 -07:00
Mike Bostock 5126024ad3 Tick subdivision. 2011-08-23 10:45:04 -07:00
Mike Bostock d8557e0efe Fix a bug in path z-index.
The test wasn't catching it because it wasn't updating the domain.
2011-08-22 23:01:53 -07:00