Commits on Apr 25, 2011
  1. Update version to 1.12.0.

    mbostock committed Apr 25, 2011
  2. Merge branch 'hierarchy'

    mbostock committed Apr 25, 2011
  3. Merge branch 'force'

    mbostock committed Apr 25, 2011
  4. Use default priority of "" rather than null.

    Maybe this'll make IE9 happy?
    mbostock committed Apr 25, 2011
Commits on Apr 24, 2011
Commits on Apr 20, 2011
  1. Cluster & tree layouts don't use `value`.

    These hierarchical layouts inadvertantly exposed the `value` attribute and
    default sort-by-value, even though they don't depend on a numeric node value to
    compute the layout. Additionally, the hierarchical layout would filter any nodes
    with nonpositive (or undefined) values, which was overly strict. Fixes #121.
    mbostock committed Apr 20, 2011
  2. Don't normalize gravity.

    Gravity (by which I mean a spring connecting each node to the center of the
    layout) should not decay linearly as more nodes are added to the graph;
    otherwise, repulsive charge forces will overwhelm gravity.
    mbostock committed Apr 20, 2011
  3. Fix simulation restarting.

    If the simulation cools and stops, we need to restart it, rather than just
    resetting the alpha parameter. So, it is useful to have both `resume` and
    `start` methods on the force layout. This commit also fixes a bug where
    mousedown events on draggable nodes would continue to propagate, interfering
    with other events (such as clicking to add a node).
    mbostock committed Apr 20, 2011
  4. Don't postpone immediate timers.

    Previously, rescheduling an immediate timer would cause it to be postponed again
    by a minimum of 24ms. This is undesirable if the timer is being scheduled in
    response to user events, such as mousemoves, that can occur very frequently. Now
    we schedule an early callback once, and don't touch it if it's rescheduled. In
    addition, the timer loop is now smarter about switching between short and long
    callbacks. If there's a short delay (< 24ms) until the next timer fires, the
    timer will use requestAnimationFrame. For longer delays, setTimeout is used.
    mbostock committed Apr 20, 2011
Commits on Apr 19, 2011
  1. More efficient restart.

    mbostock committed Apr 19, 2011
  2. Better force layout for dynamic graphs.

    You can now register the "drag" behavior on nodes multiple times, and the
    correct behavior will result. In addition, the gravitational force now handles
    coincident nodes, computing a small random force to separate the nodes rather
    than setting the position to NaN.
    To demonstrate the new support for dynamic graphs, this commit includes a fun
    example where you can click to add new nodes. Any existing nodes within a fixed
    distance to the cursor on click will be linked to the new node.
    mbostock committed Apr 19, 2011
  3. Better center gravity.

    Rather than applying gravity to the entire graph, we now apply it to individual
    nodes, such that disconnected nodes and subgraphs still have a tendency to drift
    towards the center. In addition, rather than using a standard gravitational
    force that drops quadratically with distance, we use a weak spring who force
    increases with distance. This makes the gravitational effect less noticeable
    near the center, and also makes the effect stronger the more the nodes drift
    from the center. To balance the center "gravity" with the repulsive charge
    force, we also normalize the strength of the gravity based on the number of
    nodes in the graph.
    mbostock committed Apr 19, 2011
  4. Better force layout.

    Use Barnes-Hut criterion (a fast multipole method) for approximating repulsive
    charge forces between nodes. This replaces the previous approach using Floyd-
    Warshall to compute the graph theoretic distance between all nodes, eliminating
    O(n^3) initialization time. Additionally, the charge force is now O(n lg n) per
    iteration rather than O(n^2).
    Using the center of mass of the graph, apply gravitional attraction towards the
    graph center (based on the layout size). This encourages the graph to stay near
    the center rather than drifting away.
    mbostock committed Apr 19, 2011
  5. Use x+y objects for quadtree points.

    This makes the quadtree implementation more compatible with the force layout.
    This change is backwards-compatible; if the points are not specified as x+y
    objects, they are assumed to be tuples and converted to objects.
    mbostock committed Apr 19, 2011
Commits on Apr 14, 2011
  1. Fix fill color for iOS.

    mbostock committed Apr 14, 2011
  2. Add bubble chart example.

    mbostock committed Apr 14, 2011
  3. Remove examples/index.html.

    This is no longer needed, as Python's SimpleHTTPServer does directory listing.
    mbostock committed Apr 14, 2011
  4. Merge branch 'release'

    mbostock committed Apr 14, 2011
  5. Merge branch 'box' into release

    mbostock committed Apr 14, 2011
  6. Remove blank line.

    mbostock committed Apr 14, 2011
  7. Fix some ordering issues with transitions.

    By default, `append` will go to the end. This could cause the center line to be
    rendered on top of the box rect if whiskers were removed then re-added. By using
    the `insert` operator, we can preserve the correct order.
    mbostock committed Apr 14, 2011
  8. Add d3.svg.diagonal.

    This is a utility for creating a Bézier curve between opposite corners of a
    rectangle. This is commonly used to draw smooth curves connecting parent and
    child nodes in a hierarchical node-link diagram. A projection may be specified
    which allows the curve to be transformed from polar coordinates.
    This commit also changes the semantics of the recently-added `links` method,
    such that the objects have `source` and `target` properties that match the
    default diagonal format.
    mbostock committed Apr 14, 2011
  9. Add `links` methods to cluster & tree.

    This method can be used to generate an array of parent+child objects for a given
    array of nodes. This is convenient for drawing paths from parent to child in
    node-link diagrams.
    mbostock committed Apr 14, 2011
  10. Simplify cluster layout.

    The `cluster` layout is now more similar to the `tree` layout, using a
    separation function rather than a group property. In addition, the breadth and
    depth properties are replaced with x and y, respectively, and scaled according
    to the size of the layout.
    I've updated the examples to make them more consistent, as well, including the
    pretty Bézier curves. In a future commit I'd like to take some of the duplicate
    code in the examples and move that into reusable methods.
    mbostock committed Apr 14, 2011
  11. Text transitions.

    You can now use the `text` operator on transitions, which has the same effect as
    setting the text value at the start of the transition. This is nice if you have
    a delayed transition, and avoids a common gotcha.
    This commit also simplifies the implementation of the `text` operator using the
    standard `textContent` property. This isn't supported on IE8-, but we could
    potentially add support in the future using `innerText`.
    mbostock committed Apr 14, 2011
  12. Add test for interpolate.

    mbostock committed Apr 14, 2011
  13. Better box chart transitions.

    Preserving object constancy across transitions is tricky! For example, what
    happens if we remove the whiskers in a transition? How do we join outliers? This
    commit makes a few assumptions explicit:
    1. The `quartiles` function must return exactly three elements. This property
    must be specified as a function.
    2. The `whiskers` function must return exactly 2 elements, or null if no
    whiskers are to be displayed. This property must be specified as a function.
    3. The `domain` function must return exactly 2 elements, or null if the default
    domain should be used. This property can be specified either as a constant or as
    a function.
    We could generalize this chart to support more than two whiskers, but it doesn't
    seem urgent, and it would complicate the transition if the number of whiskers
    changes. In a related change, the `whiskers` function does not receive a third
    argument containing the quartiles; instead, this is made available by the
    `quartiles` property on the values array (the first argument).
    The outliers are joined using the `Number` key function. The outlier data is now
    stored as indices; this allows reasonable object constancy across transitions
    with outliers. Similarly, the tick labels for the quartiles are whiskers are now
    separated, such that the whisker labels can be added or removed without spurious
    mbostock committed Apr 14, 2011
  14. Fix a bug in d3.interpolateString.

    The regular expression wasn't being reset, so we weren't always finding numbers!
    mbostock committed Apr 14, 2011
Commits on Apr 13, 2011
  1. Fix quartile calculation.

    The outliers were being incorrectly excluded when computing the quartiles.  I've
    also added a +/-1.5 IQR whiskers computation for the Morley-Michelson example,
    so it replicates the R plot exactly.
    jasondavies committed Apr 13, 2011