3.0 #846

merged 161 commits into from Dec 21, 2012


None yet

2 participants

D3 member

See the 3.0 release notes for details. For tips on migrating from 2.x, see Upgrading to 3.0.

This was referenced Oct 5, 2012
D3 member

Candidates for removal:

  • d3.first
  • d3.last
  • d3.geom.contour (moved to d3-plugins)
  • d3.geo.azimuthal (replaced by d3.geo.orthographic et al.)
  • d3.geo.greatCircle (replaced by d3.geo.circle)
  • d3.split (replaced by line.defined and area.defined)
  • selection.map (replaced by selection.datum)
  • d3.svg.mouse (replaced by d3.mouse)
  • d3.svg.touches (replaced by d3.touches)
  • d3.xhr deprecated callback (replaced by node-style callback)
  • d3.layout.hierarchy deprecated inlined data (replaced by wrapped data)
  • d3.geom.quadtree deprecated array input (replaced by x-y object input)
D3 member

Blocking issues:

  • Use spherical coordinates for more robust polygon winding order detection in d3.geo.path (#950).
  • Should we expose d3.geo.projectionMutator? I'm not sure I like it.
  • Can we minimize the d3.geo.projection interface, or support automatic promotion from point-function to projection?
  • Move d3.geom.hull to a d3 plugin?


  • Use spherical coordinates for d3.geo.centroid and d3.geo.area (#941).
  • Expose d3_geo_greatArcInterpolate.
  • Expose d3.geo.type (#945)?
  • Performance improvements; running benchmark on commit history.
  • Code reuse?
D3 member

So, the internals of d3.geo.projection are kind of a mess. Considering only projection of points, we have the following public methods:

  • projection - accepts {[degrees, degrees]}, returns [pixel, pixel]. Calls projectRotate which calls rotate and project by way of d3_geo_compose.
  • projection.point - accepts {[degrees, degrees], context}, returns void. Calls clip.point which calls resample.point which is an alias for point, which calls context.point. point calls projectPoint, which calls project.

And the following private methods:

  • rotate - accepts {radians, radians}, returns [radians, radians].
  • project - accepts {radians, radians}, returns [pixel, pixel].
  • projectRotate - accepts {radians, radians}, returns [pixel, pixel]. Calls rotate and project via d3_geo_compose.
  • point - accepts {radians, radians}, returns void. Calls context.point and projectPoint. projectPoint calls project.
  • projectPoint - accepts {radians, radians}, returns [pixel, pixel]. Calls project.
  • rotatePoint - accepts {[degrees, degrees]}, returns [radians, radians]. Calls rotate.
  • clip.point - accepts {degrees, degrees}, returns void. Calls context.point and projectPoint. projectPoint calls project.
  • resample.point - alias for point.
  • context.point - accepts {degrees, degrees}, and returns void.
mbostock and others added some commits Dec 12, 2012
@mbostock mbostock Add tests for d3.geo.stream. 2e88ce7
@mbostock mbostock Merge branch 'geo-refactor' of https://github.com/jasondavies/d3 into…
… 3.0
@mbostock mbostock Fix for projected d3_geo_bounds. 3cbb9ce
@mbostock mbostock Rewrite d3.geo.area using d3.geo.stream. 88890a6
@mbostock mbostock Rename & inline a bit. 6c68339
@mbostock mbostock Tiny optimization. 278e086
@mbostock mbostock Delete d3.geo.rotation.
That was for demonstration purposes only.
@mbostock mbostock Don't cache d3_geo_bounds for projection.
I mean, we could, but it seems simpler not to, for now.
@mbostock mbostock Fix lineStart reset bug in d3.geo.area. e7fa28b
@mbostock mbostock Implement path.area using d3.geo.stream. ffd047b
@mbostock mbostock Fix a bug in d3.geo.path area. 8f02a72
@mbostock mbostock Implement d3.geo.path centroid via d3.geo.stream. 1a779c6
@mbostock mbostock Add missing globals, TODO. 342c1b8
@mbostock mbostock Return undefined for empty buffers. 6ca6d3e
@mbostock mbostock Don't emit closing points in rings.
This breaks d3.geo.path area & centroid, and d3.geo.area. Fix incoming.
@mbostock mbostock Fixes for streaming area and centroid. 604c57d
@jasondavies jasondavies Fix streaming polygon clipping. 37f64b7
@jasondavies jasondavies Fix Polygon clipping issue.
The missing endpoint was causing issues with the algorithm.
@mbostock mbostock Polygon area is consistent with holes. 3b11c2c
@mbostock mbostock Fix for re-entrant area calculation. 4a9a9ca
@mbostock mbostock Silence bogus test failures. 1c529da
@jasondavies jasondavies Benchmark U.S. counties.
This is useful to see how fast we can process polygons that don't
intersect with the clip edge.
@jasondavies jasondavies Fix d3.geo.albersUsa. 7697f20
@jasondavies jasondavies Implement d3.geo.centroid via d3.geo.stream. b87bcbc
@jasondavies jasondavies 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.
@jasondavies jasondavies d3.geo.centroid: {Feature,Geometry}Collection.
This computes the centroid of the geometries with the highest dimension.
@jasondavies jasondavies Update centroid tests to use undefined. 44425c1
@jasondavies jasondavies Fixes for d3.geo[.path].centroid.
Mixed geometries should now be supported correctly for both.
@jasondavies jasondavies Update some TODOs. 2ecf8f3
@jasondavies jasondavies Optimise d3_geo_clip. 157dc9f
@jasondavies jasondavies Update UglifyJS.
The package name has now changed back to "uglify-js" on NPM.
@jasondavies jasondavies Cache d3.geo.path listeners. c25939c
@jasondavies jasondavies Update TODO. 361cac2
@mbostock mbostock Fix for UglifyJS 2.x. ec1c7cf
@mbostock mbostock Move buffer to d3_geo_pathBuffer. ae86cce
@jasondavies jasondavies Minor d3.geo.centroid tweak.
The previous version always reassigned .lineEnd in .lineStart anyway,
but this is slightly more efficient to only do so in .ringEnd.
@jasondavies jasondavies Add type coercion for d3.geo.path.pointRadius. b085292
@jasondavies jasondavies Coerce d3.geo.path.pointRadius functions, too. ee2e784
@jasondavies jasondavies Remove extraneous type coercion.
Not needed since we already do it in the public API.
@mbostock mbostock Handle distortions near poles. c7d4fab
@jasondavies jasondavies Add test for pointRadius function type coercion. 01a7e18
@jasondavies jasondavies Adjust threshold for distortion resampling.
Includes test case.
@jasondavies jasondavies Resample between first and last ring points. 32b0449
@jasondavies jasondavies Fix speling. 8e8699b
@mbostock mbostock Fallback for projections that don't stream. c7be968
@jasondavies jasondavies Improve locale parsing in Linux. a2753ee
@mbostock mbostock Rename for clarity.
d3_geo_cut is now d3_geo_clipAntimeridian.
d3_geo_circleClip is now d3_geo_clipCircle.
@mbostock mbostock Minor optimization to d3.geo.circle. 4782853
@mbostock mbostock Minor optimizations to d3_geo_resample. 0c295a2
@mbostock mbostock Oops, add generated file. 392ee52
@mbostock mbostock Delete unused code. 9cc79b4
@mbostock mbostock Move rotation modulus to radian conversion code. a76c08c
@mbostock mbostock Optimize d3_geo_compose slightly. ca2c943
@mbostock mbostock Fix a bug with d3_geo_resample lineStart. 90f09a7
@jasondavies jasondavies Optimise d3.geo.clip area calculation.
Only the area sign is needed to determine the polygon winding order, so
a fast approximation is sufficient.

U.S. counties benchmark: 84ms/op → 51ms/op.
@jasondavies jasondavies Explain wondrous mathematics. 3f26583
@mbostock mbostock Increase threshold for ccw polygon detection. d33169e
@jasondavies jasondavies Drop redundant variable. 4dd25f7
@jasondavies jasondavies 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.
@mbostock mbostock Restore tighter threshold for CCW polygons. 89c3e75
@mbostock mbostock Coerce to number for d3.quantile.
This avoids string concatentation on fractional p-values.
D3 member

Decided we should revert c363519 and keep backwards-compatibility for old-style d3.xhr callback, since there hasn't been enough advance warning for this backwards-incompatible change.

mbostock added some commits Dec 19, 2012
@mbostock mbostock Revert "Remove backwards-compatibility for d3.xhr."
This reverts commit c363519.
@mbostock mbostock Use identity projection when null. 4e32681
@mbostock mbostock Remove deprecated support for wrapping data. ebdffc0
@mbostock mbostock 3.0.0 RC1! 9c1d383
@mbostock mbostock Remove population example. ef44535
@mbostock mbostock Remove tree-radial example. 49fc109
@mbostock mbostock Remove showreel example. 1674ee4
@mbostock mbostock Remove custom example. 91faf8b
@mbostock mbostock Remove tree-dynamic example. 00e2274
@mbostock mbostock Remove contour example. ef36125
@mbostock mbostock Remove tree-interactive example. 9675f54
@mbostock mbostock Remove sizzle example. c9b997e
@mbostock mbostock Remove treemap example. 62c2f88
@mbostock mbostock Remove partition-sunburst example. 20ad1f1
@mbostock mbostock Remove stream example. 577a069
@mbostock mbostock Remove stack example. e9c05c3
@mbostock mbostock Remove voronoi example. b4a26b3
@mbostock mbostock Remove tree example. 98af410
@mbostock mbostock Remove clock example. ff83d66
@mbostock mbostock Remove sort example. 858e999
@mbostock mbostock Remove box example. 94e53f1
@mbostock mbostock Remove pack example. aaaf59d
@mbostock mbostock Remove treemap-svg example. c491456
@mbostock mbostock Remove pie example. 50119f3
@mbostock mbostock Remove marimekko example. f081425
@mbostock mbostock Remove hive examples. 2b53a64
@mbostock mbostock Remove cartogram examples. 0250c3c
@mbostock mbostock Remove choropleth examples. 1272053
@mbostock mbostock Remove bullet example. 0b50c66
@mbostock mbostock Remove splom example. 8ad3143
@mbostock mbostock Remove Moiré example. 2926953
@mbostock mbostock Remove cluster example. a62f01e
@mbostock mbostock Remove cluster-radial example. 05a6664
@mbostock mbostock Remove force example. 421bde9
@mbostock mbostock Remove area-defined example. f455c4a
@mbostock mbostock Remove histogram example. 3a6fb75
@mbostock mbostock Remove bar example. 5ba4ee3
@mbostock mbostock Remove bundle-radial example. 14eb09e
@mbostock mbostock Remove crimea-stacked-bar. b7802c5
@mbostock mbostock Remove crimea-stacked-area. 78ca20f
@mbostock mbostock Remove horizon example. 382b3e9
@mbostock mbostock Remove partition-icicle-zoom example. 6c7f7f0
@mbostock mbostock Remove zoom-pan example. 0251fcf
@mbostock mbostock Remove hello-world examples. 7b532d9
@mbostock mbostock Remove hierarchical bar example. 345deb9
@mbostock mbostock Remove force-map example. 6deae4a
@mbostock mbostock Remove area-radial examples. 00efc57
@mbostock mbostock Remove area example. 17b5849
@mbostock mbostock Move sample HTML file to test/data. 223a047
@mbostock mbostock Remove bubble example. a913d6e
@mbostock mbostock Remove chord examples. f03708d
@mbostock mbostock Remove line example. 96ff57f
@mbostock mbostock Remove dot example. 8b91f76
@mbostock mbostock Oops, add missing file. b5021f1
@mbostock mbostock Remove force-multi-foci example. 79e3a8d
@mbostock mbostock Remove force-collapsible example. 5eac181
@mbostock mbostock Move transform tests. e6da19f
@mbostock mbostock Move mouse test. 2782e79
@mbostock mbostock Move more transform tests. d354200
@mbostock mbostock Remove bundle-treemap example. 96f1be9
@mbostock mbostock Remove calendar examples. c9629d4
@mbostock mbostock Remote delaunay example. 7c8abc0
@mbostock mbostock Remove donut example. 24f0b57
@mbostock mbostock Remove zoom example. 2cfbbe7
@mbostock mbostock Remove parallel example. 356d55c
@mbostock mbostock Remove pie-transition. d07d709
@mbostock mbostock Remove marker example. e7c6120
@mbostock mbostock Remove hull example. ea202e3
@mbostock mbostock Remove transform example. 1926a88
@mbostock mbostock Remove line examples. 688da4a
@mbostock mbostock Remove cruft. 8728e24
@mbostock mbostock Remove kde example. 8e4deb3
@mbostock mbostock Remove great-arc example. f940bbd
@mbostock mbostock Remove drag example. 8d33199
@mbostock mbostock Remove mercator examples. 8fb69fa
@mbostock mbostock Remove symbol-map example. f430c20
@mbostock mbostock Move touch example to tests. 6d27e13
@mbostock mbostock Remove axis-multiples example. 542726c
@mbostock mbostock Remove axis-transition example. 211ae9f
@mbostock mbostock Remove node-canvas example. 301abe6
@mbostock mbostock Remove spline example. c7ef833
@mbostock mbostock Remove rollup example. 67fcbfb
@mbostock mbostock Remove quadtree example. 42b17f9
@mbostock mbostock Remove zoom-pan-transform example. e56f217
@mbostock mbostock Add direct link to examples. 29f7ade
@mbostock mbostock Remove partition-icicle example. 3b641b6
@mbostock mbostock Remove partition-sunburst-zoom example. 626dd3a
@mbostock mbostock Remove force-html example. 3208345
@mbostock mbostock Remove force-dynamic example. dba9baf
@mbostock mbostock Remove force-bounds example. e1443c9
@mbostock mbostock Remove qq example. 6e89c98
@mbostock mbostock Remove force-cluster example.
Would be nice to update, but perhaps another time.
@mbostock mbostock Remove axis examples.
Replaced by <http://bl.ocks.org/4349486>, among others.
@mbostock mbostock Remove brush-x-resizer example. dd3dced
@mbostock mbostock Remove brush-ordinal example. 36876f1
@mbostock mbostock Remove brush examples. 7a67b00
@mbostock mbostock Fix broken tests due to missing sample data. abaa6f1
@mbostock mbostock Merge branch 'master' into 3.0 ca14516
@mbostock mbostock Fix benchmark by restoring test data file. 315e3ab
@mbostock mbostock merged commit 315e3ab into master Dec 21, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment