1. 26 Sep, 2013 3 commits
    • Mike Bostock's avatar
    • Mike Bostock's avatar
      Don’t pollute an ordinal scale’s domain. · d2ad436f
      Mike Bostock authored
      Fixes #1550. By using the copy of the new scale (which we make anyway for a
      snapshot) we avoid polluting the scale’s domain with the old values when using
      the scale as the key function for the tick data-join.
      d2ad436f
    • Jason Davies's avatar
      Fix clipping bug for complex polygons. · 9eb878ec
      Jason Davies authored
      Intersection points are sorted along the clipping region edge relative
      to a particular point.  In the case of antimeridian clipping, this point
      is the South pole.  Previously, the first intersection was assumed to be
      an entering intersection, but this is not always the case.
      
      The fix is to see whether the clip region start point (the point
      relative to which sorting occurs) is inside or outside the polygon being
      drawn.  If it is inside, then the first intersection point must be
      outside, and so forth.
      
      The same applies to d3.geo.clipExtent.  Provision was already made for
      this, but this has now been optimised to use a single point instead of
      picking one of the four corners.
      
      Another optimisation was to reuse this clip region start point to
      determine whether to interpolate all the way around the clip region
      edge.  Previously, this was done by testing an arbitrary point in the
      clip region.
      
      The above fix seemed to have broken one of the tests, and this has been
      fixed by modifying the point-in-polygon routine slightly to handle
      points that might lie exactly on the polygon edge.
      
      Finally, I noticed a regression with the recent clipExtent fix, where a
      polygon incorrectly being marked as “clean” (no intersections) on a
      per-ring instead of per-polygon basis.
      9eb878ec
  2. 25 Sep, 2013 9 commits
  3. 24 Sep, 2013 3 commits
    • Jason Davies's avatar
      Perform winding order check on unrotated polygons. · 31ea7dc0
      Jason Davies authored
      We remove the rotation step that occurred prior to clipping, so that
      clipping processes unrotated polygons.  Note that clip regions are
      defined relative to the rotated globe, so clipping now needs a rotation
      parameter.
      
      Rather than moving the rotation step so it occurs after clipping, the
      rotation occurs as part of clipping, using the rotation parameter to
      rotate streamed points.  Alternatively, points could be clipped against
      a rotated clip region, and then subsequently rotated as a separate step,
      but this seems slightly less efficient.
      
      Fixes #1453.
      31ea7dc0
    • Jason Davies's avatar
      Simplify. · ba48daa1
      Jason Davies authored
      ba48daa1
    • Jason Davies's avatar
      Fix clipExtent bug. · b89c2d97
      Jason Davies authored
      If a polygon does not intersect with the extent, but has one or more
      rings inside the extent, then the extent should be checked to see
      whether it is inside the polygon: if so, an additional exterior ring is
      generated.
      
      Previously, this check was only made if there were no visible rings at
      all.
      
      Fixes an issue noticed in #1453.
      b89c2d97
  4. 21 Sep, 2013 2 commits
    • Mike Bostock's avatar
      Merge branch 'fix-implicit-ordinal-domain' · 7bb322f6
      Mike Bostock authored
      7bb322f6
    • Mike Bostock's avatar
      Restrict implicit domains to explicit ranges. · 113032bc
      Mike Bostock authored
      When an ordinal scale’s range is explicitly defined as an array of values, we
      can build the domain implicitly by progressively assigning values from the
      range; this is commonly done with color palettes, for example.
      
      However, when an ordinal scale’s range is rather implied by chopping a
      continuous range into a series of points or bands, then the domain must be
      specified explicitly: for the scale to be consistent, we need to know the
      cardinality of the domain to compute the implied range values.
      
      Thus, it only makes sense to extend the domain implicitly when the range is
      specified explicitly. Fixes #1536 #1535.
      113032bc
  5. 18 Sep, 2013 6 commits
  6. 16 Sep, 2013 1 commit
    • Jason Davies's avatar
      Fix point-in-polygon for multiple polar rings. · eff0a116
      Jason Davies authored
      Instead of detecting if any single polygon ring winds around a pole, we
      consider the cumulative winding of all polygon rings together.  This is
      consistent with the area calculation, which considers the cumulative
      area total of all rings.
      
      This fixes #1521: an issue with the Hammer Retroazimuthal projection,
      which uses such a polygon with two rings, covering most of the globe.
      
      In addition, drop the special handling of points at the south pole,
      which might have been there to pass an incorrect test: a CCW triangle
      touching the south pole, which was probably incorrectly thought to be
      clockwise.  This fixes an issue with a “stripe” polygon rotated so that
      a point is at the south pole, mentioned in #1453.
      eff0a116
  7. 05 Sep, 2013 8 commits
  8. 31 Aug, 2013 3 commits
  9. 30 Aug, 2013 4 commits
    • Jason Davies's avatar
      Optimise. · 36b8a0b1
      Jason Davies authored
      This block is only necessary if there are remaining touches, because
      otherwise the gesture has ended and we remove this closure along with
      locations0.  Thanks, @mbostock!
      36b8a0b1
    • Jason Davies's avatar
      Use distance instead of d3.event.scale. · abc9dbb0
      Jason Davies authored
      Unlike d3.event.scale, which is a single value provided by the browser
      (usually an average based on the position of all touches), we can
      compute separate distances for each zoom gesture and its target,
      allowing multiple gestures to occur simultaneously.
      abc9dbb0
    • Jason Davies's avatar
      Remove locations on touchend. · 340b1675
      Jason Davies authored
      This avoids a potential bug where a touch identifier might be reused in
      another gesture, but could still be referenced in locations0, thus
      causing problems for the old gesture on touchmove.
      340b1675
    • Jason Davies's avatar
      Support simultaneous zooming on multiple targets. · 4b3795e1
      Jason Davies authored
      Fixes #1497, where a zoom gesture would break if a touch was started
      outside the target during a gesture.
      
      Each zoom gesture now only considers touches that were started on its
      associated target element.  This allows multiple zoom gestures to occur
      at once without conflicts.
      4b3795e1
  10. 28 Aug, 2013 1 commit
    • Jason Davies's avatar
      Support parsing timezone offsets. · 7e2cf5ad
      Jason Davies authored
      Note that the resulting Date object can only be in the local timezone
      (or UTC), due to the limitations of JavaScript Dates.
      
      Fixes #1494.
      7e2cf5ad