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

527 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock a7164684b2 Merge branch 'geo-area-fast' of https://github.com/jasondavies/d3 into 3.0.6 2013-02-06 10:59:09 -08:00
Mike Bostock 8ad35ce03b Merge branch 'fix-format-round' into 3.0.6 2013-02-06 10:57:55 -08:00
Mike Bostock e35f3a6484 Merge branch 'fix-force-drag' into 3.0.6 2013-02-06 10:52:35 -08:00
Mike Bostock 5988b1daf1 Merge branch 'fix-sort-null' into 3.0.6 2013-02-06 10:52:10 -08:00
Mike Bostock d287b63511 Don’t expose d3_functor for link properties.
Fixes #895.
2013-02-06 10:48:13 -08:00
Mike Bostock 093bd8485a Fix for invalid axis.orient. Fixes #905. 2013-02-06 10:25:19 -08:00
Mike Bostock 2a0e2a1266 Sort null nodes at the end.
Previously, null nodes were passed to the comparator and were indistinguishable
from non-null nodes with no bound data. For consistency with other selection
operators that skip null nodes, it seems preferrable to put null nodes at the
end of the selection rather than passing them to the comparator. Fixes #881.
2013-02-06 10:18:52 -08:00
Jason Davies b9bf5302b4 Add test case for tiny Polygon area. 2013-02-05 21:35:58 +00:00
Mike Bostock 2e24cf9be8 Use µ rather than μ.
That is, MICRO SIGN (\xb5) rather than GREEK SMALL LETTER MU (\u03bc).
2013-02-01 10:30:51 -08:00
Jason Davies 3dcdfbfe1f Fix a couple of edge cases. 2013-02-01 16:51:47 +00:00
Mike Bostock a31f59274e Fix rounded format specifier; fixes #1042. 2013-02-01 08:09:12 -08:00
Jason Davies 9c3ad8f53b Optimise d3.geo.area.
This incorporates two enhancements:

1. A simpler formulation for the area of a spherical triangle with one
   vertex at the south pole.
2. Instead of calling atan2 for every point, we use the identity:
     ∑ arg(z) = arg(∏ z),
   where z is a complex number, and only call atan2 once for each
   polygon, instead opting for a cheaper complex number multiplication
   for each point.

This is around 3x faster than the old implementation as measured by the
included benchmark.
2013-01-31 17:34:05 +00:00
Mike Bostock 183060d40f Upgrade dependencies; remove Sizzle dependency. 2013-01-24 09:26:22 -08:00
Mike Bostock 58fb99d589 Fix big with constant greatArc target.
The local variable `t` was masking the private field of the same name. The use
of single-letter variables is preferred for smaller scopes.
2013-01-13 11:02:16 -08:00
Mike Bostock c96250ecb7 Merge branch 'fix-duplicate-keys' into 3.0.3 2013-01-10 16:41:55 -08:00
Mike Bostock 9c6be3c574 Add test and fix for duplicate keys. 2013-01-08 15:32:21 -08:00
Mike Bostock 2810d3cc1b Fix for duplicate keys in selection.data.
Fixes #997. The enter, update and exit selections are now initialized as fixed-
length arrays rather than dynamically populated with nulls. If duplicate keys
are used for either data or selected elements, only the first datum or element
is considered and subsequent data or elements are ignored.
2013-01-08 15:18:59 -08:00
Jason Davies 475b18f2df Allow projection.invert to return null.
Previously this would throw errors.
2013-01-05 01:45:43 +00:00
Mike Bostock 633fd273bd Merge branch 'geo-circle' of https://github.com/jasondavies/d3 into 3.0.2 2013-01-01 15:52:03 -08:00
Mike Bostock 2e072713e3 Fix path.bounds with fallback stream.
Fixes #987.
2013-01-01 15:50:17 -08:00
Jason Davies f6891ef901 Fix d3.geo.circle.origin.
3D rotations are not commutative, so we must perform an inverse rotation
to move something from origin [0, 0] to [λ, φ].  Normally we are moving
origin [λ, φ] to [0, 0].
2012-12-29 13:09:12 +00:00
Mike Bostock 8b0c10f8e5 Merge branch 'fix-geo-bounds-collection' of https://github.com/natevw/d3 into 3.0.1 2012-12-28 09:18:41 -08:00
Mike Bostock cd1b2d0696 Merge branch 'geo-centroid' of https://github.com/jasondavies/d3 into 3.0.1 2012-12-28 09:18:15 -08:00
Nathan Vander Wilt 33bf32723f test for problematic nesting case 2012-12-28 10:37:24 -06:00
Jason Davies e7ea256dc1 d3.geo.centroid: fix handling of mixed geometries. 2012-12-27 12:57:52 +00:00
Jason Davies 963a5e862e Fix treemap slice-dice mode.
For even depths, it was falling back to Math.min(rect.dx, rect.dy)
instead of always "dicing" (rect.dy).
2012-12-25 02:51:36 +00:00
Mike Bostock 315e3ab7b8 Fix benchmark by restoring test data file. 2012-12-20 22:47:10 -08:00
Mike Bostock abaa6f1645 Fix broken tests due to missing sample data. 2012-12-20 15:37:09 -08:00
Mike Bostock 6d27e13f9f Move touch example to tests. 2012-12-19 16:50:07 -08:00
Mike Bostock d354200f5e Move more transform tests. 2012-12-19 12:55:44 -08:00
Mike Bostock 2782e793e3 Move mouse test. 2012-12-19 12:53:05 -08:00
Mike Bostock e6da19f7d0 Move transform tests. 2012-12-19 12:52:35 -08:00
Mike Bostock b5021f13c8 Oops, add missing file. 2012-12-19 12:20:14 -08:00
Mike Bostock 223a047b3a Move sample HTML file to test/data. 2012-12-19 11:49:16 -08:00
Mike Bostock 4e32681308 Use identity projection when null. 2012-12-18 20:21:22 -08:00
Mike Bostock b632cf1902 Coerce to number for d3.quantile.
This avoids string concatentation on fractional p-values.
2012-12-18 11:38:12 -08:00
Jason Davies 5396d39965 Fix CCW polygon detection issue.
The south pole rotation could result in line segments that go through
the poles.  These are characterised by a 180° longitudinal difference.
These cases were not handled properly by the approximation algorithm,
but it now handles both north and south pole cases.
2012-12-18 01:00:58 +00:00
Jason Davies 8e8699bbd5 Fix speling. 2012-12-14 13:40:45 +00:00
Jason Davies 1a7810bddd Adjust threshold for distortion resampling.
Includes test case.
2012-12-14 13:05:59 +00:00
Jason Davies 01a7e187ea Add test for pointRadius function type coercion. 2012-12-14 01:12:30 +00:00
Jason Davies b085292ea8 Add type coercion for d3.geo.path.pointRadius. 2012-12-13 19:09:15 +00:00
Jason Davies e3b7823f74 Fixes for d3.geo[.path].centroid.
Mixed geometries should now be supported correctly for both.
2012-12-13 13:34:52 +00:00
Jason Davies 44425c1874 Update centroid tests to use undefined. 2012-12-13 13:10:44 +00:00
Jason Davies 5e0c131f32 d3.geo.centroid: {Feature,Geometry}Collection.
This computes the centroid of the geometries with the highest dimension.
2012-12-13 13:00:51 +00:00
Jason Davies 3d84b49ae4 Better handling of ambiguous centroids.
Rather than doing something like picking the last seen point, return
an undefined centroid if it is ambiguous.

Users can decide what to do, e.g. when picking an origin for a rotating
globe, using the last coordinate in a MultiPoint or LineString seems
reasonable in an ambiguous situation.
2012-12-13 12:48:52 +00:00
Jason Davies b87bcbc22a Implement d3.geo.centroid via d3.geo.stream. 2012-12-13 12:22:41 +00:00
Jason Davies b8ab3ad3ef Benchmark U.S. counties.
This is useful to see how fast we can process polygons that don't
intersect with the clip edge.
2012-12-13 10:57:38 +00:00
Mike Bostock 1c529da03e Silence bogus test failures. 2012-12-12 21:22:54 -08:00
Jason Davies 37f64b74f2 Fix streaming polygon clipping. 2012-12-13 02:01:04 +00:00
Mike Bostock 08b4357087 Don't emit closing points in rings.
This breaks d3.geo.path area & centroid, and d3.geo.area. Fix incoming.
2012-12-12 16:54:58 -08:00