1. 19 Jun, 2013 1 commit
  2. 18 Jun, 2013 4 commits
    • Mike Bostock's avatar
      Restore undefined behavior for d3.bisect. · 301b6d3b
      Mike Bostock authored
      Rather than return NaN, this change restores the previous undefined behavior
      when an unorderable value is used for bisection. After discussing with Jason, I
      think this is more consistent given that d3.bisect also requires that the input
      array is sortable, and therefore only contains orderable values. Thus, it is the
      responsibility of the caller to check that the search value is defined before
      doing bisection, and so this commit fixes the threshold scale rather than the
      bisect method. (Also, this is consistent with the existing quantile scale.)
      301b6d3b
    • Mike Bostock's avatar
      Return undefined, not NaN. · 0edad183
      Mike Bostock authored
      Since the quantile scale allows arbitrary values in the range, there’s no reason
      the return value for unorderable input needs to be a number.
      0edad183
    • Mike Bostock's avatar
      Slightly shorter. · 538108b0
      Mike Bostock authored
      538108b0
    • Mike Bostock's avatar
      Fixes for non-orderable values. · aad1b188
      Mike Bostock authored
      In addition to NaN, which is not equal to itself, you can have objects that are
      not orderable due to defined valueOf functions which return NaN. For example:
      
        var o = new Number(NaN);
      
      Here, o == o is true, but o <= o is false. Therefore it was possible for d3.min,
      d3.max and d3.extent to observe these non-orderable values rather than ignore
      them as intended. The fix is to check !(o <= o) rather than o == o.
      
      This commit also fixes d3.bisect when the search value is non-orderable.
      Previously, bisectLeft returned lo for non-orderable values, and bisectRight
      returned hi. However, if the search value is non-orderable, then this return
      value does not satisfy the conditions of bisection. This commit changes the
      bisection methods to return NaN when the search value is non-orderable.
      
      As a side-effect, the fix to d3.bisect now causes d3.scale.threshold to return
      undefined when passed a non-orderable value, such as undefined. (Previously, a
      threshold scale would return the highest value in the range, because it used
      bisectRight internally.)
      aad1b188
  3. 14 Jun, 2013 1 commit
  4. 13 Jun, 2013 4 commits
  5. 12 Jun, 2013 4 commits
    • Mike Bostock's avatar
      More robust vendor prefix detection. · 9e66a853
      Mike Bostock authored
      The previous implementation depended on CSS3 transforms being vendor-prefixed,
      and would assume no vendor prefix if the browser supports transforms natively.
      Now we detect the vendor prefix on a case-by-case prefix, rather than assuming a
      single global prefix.
      9e66a853
    • Mike Bostock's avatar
      Merge branch 'user-select' into 3.2 · 5adac77b
      Mike Bostock authored
      5adac77b
    • Mike Bostock's avatar
      Add pack.radius for explicit radius. · a8952189
      Mike Bostock authored
      Fixes #857. By default, the radius of each circle in the pack layout is derived
      from the square root of the node’s value, which is then scaled according to the
      bounding box of all circles and the layout’s size. By specifying a radius
      function, you can now explictly control the radius, disabling automatic scaling.
      
      The radius function takes the value as input and returns the corresponding
      radius. If no radius function is specified, automatic scaling is enabled; this
      is the default. Conveniently, d3.scale.sqrt can be used as a radius function.
      a8952189
    • Jason Davies's avatar
      Use user-select: none instead of preventDefault. · 53cd4d46
      Jason Davies authored
      The use of preventDefault while dragging or zooming was preventing
      desirable defaults from being triggered.  Using user-select: none is a
      less intrusive way to prevent text from being selected.
      
      If user-select or a vendor-prefixed user-select is not supported, we
      suppress the selectstart event instead (for IE9).
      
      Note that Firefox has a bug where absolutely-positioned elements do not
      inherit the -moz-user-select style from the body element, so users may
      wish to additionally set -moz-user-select: none on absolutely-positioned
      elements, at least until this bug is fixed:
      
        https://bugzilla.mozilla.org/show_bug.cgi?id=648624
      
      Fixes #1288, #1099.
      53cd4d46
  6. 11 Jun, 2013 5 commits
  7. 08 Jun, 2013 5 commits
  8. 04 Jun, 2013 2 commits
  9. 03 Jun, 2013 3 commits
  10. 02 Jun, 2013 1 commit
    • Jason Davies's avatar
      Add area-weighted geographic polygon centroids. · 492215ad
      Jason Davies authored
      This generalises the centre of mass formula given in:
      
        J. E. Brock, The Inertia Tensor for a Spherical Triangle,
        J. Applied Mechanics 42, 239 (1975)
      
      In addition, centroids of zero-extent features now fall back to the
      centroid of the feature treated as a lower dimension, i.e. polygons →
      lines → points.
      
      Specifically, if the centroid of a polygon or multipolygon feature is
      ambiguous, it will treat it as a set of lines.  Similarly (but not
      exactly the same), if a line or set of lines has zero length, it will be
      treated as a set of points.
      
      This also applies to d3.geo.path.centroid, except that the fallback
      always occurs if the feature has zero extent (area or length).  For
      geographic polygons, it was simpler to fall back if the centroid was
      undefined, as area is not tracked in a simple fashion.
      
      Fixes #1011.
      
      Optimised d3_acos, and used d3_asin and d3_acos where appropriate
      instead of Math.min and Math.max.
      492215ad
  11. 01 Jun, 2013 2 commits
  12. 30 May, 2013 8 commits