Permalink
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.

    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.
    square-build-bot committed Apr 26, 2011
  2. Better events for force layout.

    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.
    square-build-bot committed Apr 26, 2011
  3. More uniform gravity.

    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.
    square-build-bot committed Apr 26, 2011
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