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

1833 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 8bdfc67f98 Rename for clarity. 2012-10-01 21:58:19 -07:00
Mike Bostock d27a70f0c0 Refactor d3_geo_type. 2012-10-01 21:50:18 -07:00
Mike Bostock bdc7c3f9e6 Add tests for d3.geo.bounds. 2012-10-01 20:39:38 -07:00
Mike Bostock 95c88ebd06 Enforce built-in precision for outline, too. 2012-10-01 18:20:14 -07:00
Mike Bostock fb449fca26 Don't use function.apply; it's slower. 2012-09-29 15:54:07 -07:00
Mike Bostock 4d49ef72b3 More precision setter down. 2012-09-29 15:52:37 -07:00
Mike Bostock a0ef36d5d5 Rename p to projection for clarity. 2012-09-29 14:11:12 -07:00
Mike Bostock 85041c616d Replace projection.ring with projection.polygon.
This is now forwards-compatible should desire complex clipping.
2012-09-29 13:55:30 -07:00
Mike Bostock e3b58c4550 Merge pull request #826 from jasondavies/projection
Only attempt to resample if distance < δ.
2012-09-28 08:53:49 -07:00
Jason Davies 8d326607ff Increase resampling min. distance threshold.
It seems reasonable to expect that the perpendicular distance will be
less than half the distance between two points, especially if they are
already close together.
2012-09-28 09:15:06 +01:00
Jason Davies 71df2b80e6 Only attempt to resample if distance < δ.
This improves performance in the case where our input data is already of
a high enough resolution, even when subject to distortion. It’s unlikely
that the Douglas–Peucker estimate (perpendicular distance) will be
greater than δ if the two input points are already closer than δ. We
could probably even increase the threshold a little more e.g. 2 * δ
seems reasonable.
2012-09-28 08:57:26 +01:00
Mike Bostock 67c4bf8b3f Increase default precision. 2012-09-27 15:29:36 -07:00
Mike Bostock 2616f03311 Fix a typo. 2012-09-27 15:21:51 -07:00
Mike Bostock c2fdedd348 Adaptive using Douglas–Peucker estimate.
Use deviation from straight line rather than distance between points.
2012-09-27 15:14:39 -07:00
Mike Bostock 5d02d49877 Bah, fix another bug. Need tests, stat! 2012-09-27 12:39:23 -07:00
Mike Bostock 96d2f9adb0 Fix bug in previous commit. 2012-09-27 12:13:01 -07:00
Mike Bostock 815c76f79f Setting path.context(null) restores default. 2012-09-27 12:11:20 -07:00
Mike Bostock 06cf988c5a Expose raw projections. 2012-09-26 21:19:56 -07:00
Mike Bostock 99c444ddaf path(null) should return null.
This frequently happens when a feature is fully clipped.
2012-09-26 21:01:42 -07:00
Mike Bostock f36a6acdf3 Fix for precision(0). 2012-09-26 17:33:55 -07:00
Mike Bostock e499edf533 Merge branch 'projection' of https://github.com/jasondavies/d3 into projection 2012-09-26 17:25:55 -07:00
Mike Bostock 650ebcffab Fix for garticule.outline. 2012-09-26 12:23:32 -07:00
Mike Bostock e40787c165 Expose d3.geo.azimuthalEqualArea.raw. 2012-09-26 11:51:49 -07:00
Mike Bostock 83af6c4c0b Resampling for closePath, too. 2012-09-26 11:50:20 -07:00
Mike Bostock 3b480a2549 Expose d3.geo.projectionMutator. 2012-09-26 11:34:39 -07:00
Jason Davies f7e6dc93dc Simplify. 2012-09-26 11:25:14 -07:00
Jason Davies 04b85ef364 Make resampling precision configurable. 2012-09-26 11:25:14 -07:00
Jason Davies a91954bbac Simplify. 2012-09-26 18:30:36 +01:00
Jason Davies f7174ce1a1 Make resampling precision configurable. 2012-09-26 17:29:44 +01:00
Mike Bostock 9ac8ad3c7d Merge pull request #823 from jasondavies/projection
Interpolate polygon cuts correctly, and resample.
2012-09-26 07:58:33 -07:00
Jason Davies 7af2884394 Improve interpolation at poles. 2012-09-26 14:57:55 +01:00
Jason Davies 9c7e3a8d9a Increase resampling recursion depth.
Otherwise Albers shows some graticule artefacts near the North Pole for
rotate([0, 0, 45]). It may be worth investigating what happens to k near
the poles, in case we need to override it.
2012-09-26 14:47:21 +01:00
Jason Davies e8b3ac10bc Restore graticule precision.
This is not configurable for now, since resampling should do the rest.
The distortion of parallels is quite noticeable without this,
particularly nearer the poles (since parallels are not all great
circles), so we need *some* precision to begin with here.
2012-09-26 14:30:40 +01:00
Jason Davies 9399591f9a Simplify. 2012-09-26 14:16:03 +01:00
Jason Davies c7284d7dc3 Fix accuracy issue when interpolating near poles. 2012-09-26 14:14:13 +01:00
Jason Davies 45d4b31461 Adaptive resampling.
Can still be optimised further by caching trig. results.
2012-09-26 13:35:51 +01:00
Jason Davies 302576bbcd Initial version of resampling.
This non-adaptively uses d3.geo.greatArc at the moment. This needs to be
rewritten to be adaptive, more efficient, and handle interpolating at
poles e.g. 〈-180°, -90°〉↦〈180°, -90°〉 should interpolate
longitudinally.
2012-09-26 12:18:04 +01:00
Jason Davies 6b16dfa4cd Checkpoint adaptive resampling. 2012-09-26 12:07:00 +01:00
Jason Davies b8a47f1c8c Minor optimisation. 2012-09-26 10:01:32 +01:00
Jason Davies 48dacb3599 Minor optimisation. 2012-09-26 09:59:49 +01:00
Jason Davies cc123a96be Fix bug at rotate([62, -174, 0]).
Includes a minor optimisation.
2012-09-26 09:51:47 +01:00
Jason Davies e431bc5962 Another minor optimisation. 2012-09-26 09:29:01 +01:00
Jason Davies 57ee53a232 Minor optimisation. 2012-09-26 09:23:58 +01:00
Jason Davies 69b36c117f Interpolate polygon cuts correctly. 2012-09-26 09:14:48 +01:00
Mike Bostock e4ead4e008 Tiny optimization. 2012-09-25 17:15:11 -07:00
Jason Davies 62fbc0c210 Add some TODO comments. 2012-09-26 00:35:02 +01:00
Jason Davies a59b718cfc Better polygon cutting.
One more thing left to do: interpolate along the cut line when joining
endpoints. Ideally, the distance between interpolated points should be
less than 180°. This should probably also apply to points interpolated
at ±90° latitudes.
2012-09-26 00:28:27 +01:00
Mike Bostock b12a5352d8 Remove unnecessary modulo. 2012-09-25 15:46:29 -07:00
Mike Bostock 448c3d085f Extract static function. 2012-09-25 15:36:07 -07:00
Mike Bostock 1b7c291179 Merge branch 'projection' of https://github.com/jasondavies/d3 into projection 2012-09-25 15:29:29 -07:00