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

25 Коммитов

Автор SHA1 Сообщение Дата
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 0daedb2344 Harden d3_geo_type against object built-ins. 2012-02-21 08:42:37 -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 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 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 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
Mike Bostock 0d6c2e7692 Merge branch 'geo-invert' of https://github.com/jasondavies/d3 into release 2011-08-29 11:54:21 -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
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
Jason Davies 872c9ff13b Add invert to mercator, albers and azimuthal.
Includes unit tests.

Fixes #246.
2011-08-27 13:25:40 +01:00