Commits on Apr 27, 2011
  1. Merge branch 'force'

    square-build-bot committed Apr 27, 2011
Commits on Apr 26, 2011
  1. Initialize node positions based on links.

    square-build-bot committed Apr 26, 2011
    This avoids excessive graph jiggling when new nodes are added to an existing
    layout. Rather than initializing the new node positions randomly, the new nodes
    are positioned to be adjacent to linked nodes.
  2. Better events for force layout.

    square-build-bot committed Apr 26, 2011
    The force layout's listeners are now scoped using the "force" namespace,
    allowing other event listeners to be registered. In addition, the force layout
    now stops propagation of mouseup events when a node is moved; this allows a
    mouseup listener on the node to fire only when it is not moved.
  3. More uniform gravity.

    square-build-bot committed Apr 26, 2011
    Gravity was getting too strong near the edges, causing bunch-up of nodes. We now
    use weaker exponential growth in gravitational strength, rather than linear.
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.

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

    mbostock committed Apr 20, 2011
    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.
  2. Don't normalize gravity.

    mbostock committed Apr 20, 2011
    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.
  3. Fix simulation restarting.

    mbostock committed Apr 20, 2011
    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).
  4. Don't postpone immediate timers.

    mbostock committed Apr 20, 2011
    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.
Commits on Apr 19, 2011
  1. More efficient restart.

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

    mbostock committed Apr 19, 2011
    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.
  3. Better center gravity.

    mbostock committed Apr 19, 2011
    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.
  4. Better force layout.

    mbostock committed Apr 19, 2011
    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.
  5. Use x+y objects for quadtree points.

    mbostock committed Apr 19, 2011
    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.
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.

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

    mbostock committed Apr 14, 2011