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

49 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies c724d95f77 Update UglifyJS, JSDOM and Vows.
I ran the tests on the newly minified files too, for good measure, and
everything passed.
2011-10-13 11:35:59 +01:00
Mike Bostock 0e0ba08900 Fix a centroid bug with CCW polygons. 2011-10-07 15:37:51 -07: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 9e91339900 Add simple great-arc example. 2011-09-27 12:36:06 -07:00
Mike Bostock a81faecc85 Add clipping for Point and MultiPoint. 2011-09-27 12:14:06 -07:00
Mike Bostock 839442d523 Use almost 90 degrees rathern than 89. 2011-09-27 12:06:48 -07:00
Mike Bostock bd585e265e Add d3.geo.circle.
There is also a greatCircle as an alias, whose angle defaults to 90 degrees. (Or
should, but some projections cannot handle 90 degrees so we use 89 instead.)
2011-09-27 09:00:23 -07:00
Mike Bostock b552513e6b Don't need to default to empty string. 2011-09-27 00:51:00 -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 11c110465e Rename standardParallel to parallel.
And add missing file!
2011-09-26 02:37:51 +01: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 2a6c2dbfa5 Optimise d3.geo.clip.
We can interpolate the exact distance to the clipping edge, and use this
to interpolate the point exactly instead of computing a full path and
picking the closest point.
2011-09-12 15:23:30 +01:00
Jason Davies 8ad87e48e7 Fix clipping bug.
A point wasn't being inserted after the interpolated point when entering
the clip region.
2011-09-12 14:10:45 +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 0a1af36dcc Move earth radius constant to d3_geo_earthRadius. 2011-09-12 10:56:24 +01:00
Jason Davies aa2ee0197b Remove unintentional change to greatCircle. 2011-09-12 10:24:43 +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 ba7bb1ff08 Coerce mode to string for d3.geo.azimuthal. 2011-08-27 18:48:47 +01:00
Jason Davies f97c2613ae Standardise normalisation and minor name tweak.
Thanks to @mbostock for an excellent exposition of geo nomenclature!

<https://github.com/mbostock/d3/pull/271#r104616>
2011-08-27 18:45:26 +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
Mike Bostock fb7e69f75e Fix albersUsa, again. 2011-08-24 18:11:35 -07:00
Mike Bostock 8a77b18d84 Fix the threshold for the Florida Keys. 2011-08-24 18:02:29 -07:00
Mike Bostock b9eff658a3 Stereographic & orthographic projections!
These now have arbitrary origins, as well. Still need to clip, though.
2011-05-28 00:13:53 -07:00
Jason Davies f216c18db8 Rename "stereographic" -> "azimuthal".
The aim is to support azimuthal stereographic as one possible azimuthal
projection.  Others are listed here:
http://www.progonos.com/furuti/MapProj/Dither/ProjAz/projAz.html
2011-04-25 12:14:47 +01:00
Jason Davies 8e3f8104ad Merge branch 'mbostock-master'
Conflicts:
	d3.geo.min.js
2011-04-22 22:28:03 +01:00
Jason Davies 1dfd3350dc Replace Google's closure compiler with UglifyJS.
UglifyJS requires Node.js to run, but it's a lot faster than Google's
compiler and produces smaller gzipped sizes.  Some of the non-gzipped
sizes are a bit larger than Google's but I think the gzipped size is
more important.  Faster runtime is also good when we start testing the
minified versions too.
2011-03-25 10:28:41 +00:00
Jason Davies ae0cddd9f4 Update google-compiler to 20110119. 2011-03-12 11:32:20 +00:00
Jason Davies 92ad7c065c Add polar stereographic projection 2011-03-02 21:10:32 +00:00
Michael Bostock 3ecb7534ef Non-contiguous cartogram example.
Also includes new d3.geom.polygon.centroid method. Props to Zachary Johnson for
the inspiration!
2011-02-23 12:33:18 -08:00
Mike Bostock 0e1c1fad17 Add d3.geo.bounds.
This method can be used for computing the bounding box of arbitrary GeoJSON
objects. This commit also fixes a bug in d3.geo.path, such that it will accept
any GeoJSON object, rather than requiring GeoJSON feature objects.
2011-02-11 19:42:52 -08:00
Michael Bostock 6a4a2d1cc6 Allow d3.geo.albersUsa to be rescaled. 2011-01-11 14:25:25 -08:00
Michael Bostock bdcb648849 Turn off the compiler's "advanced" optimizations.
The renaming of attributes is totally not worth the hassle of maintaining an
externs file (or using the awkward `foo["bar"]` syntax). The file size
reduction from the advanced optimizations was negligible, besides!
2011-01-05 11:35:39 -08:00
Michael Bostock 085eb2fcd0 Add path.area().
This computes the projected area (in square pixels) of the given GeoJSON
object. This is useful for producing choropleth maps that area normalized to
the visible area.
2011-01-04 14:14:53 -08:00
Michael Bostock 138fd92978 Add Mercator projection. 2010-11-09 14:45:31 -08:00
Michael Bostock 6494412aee Don't include geo in the default build. 2010-11-05 00:25:24 -07:00