Previously, we were computing the node position relative to the node, which is
dangerous is the node is transformed. Computing it relative to the parent allows
nodes to be positioned using the "transform" attribute.
We don't actually need the separate `fx` and `fy` attributes on each node;
instead we can modify the `x` and `y` attributes directly, since we're using
position Verlet! This commit also adds the layout's `alpha` parameter to the
tick event, such that normalized external forces can be applied.
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.
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.
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`.
We were computing the tick join based on the (new) format function, but doesn't
produce the desired effect: the new format is applied on the old data. Thus, the
wrong join occurs if, say, the value 0.5 with the new format results in "0". The
correct join compares the old text content to the new format value.
It's equivalent to `parentNode.__data__`, so it's not needed. Technically, this
is not backwards-compatible, but these two fields on the group object are not
part of the public API (despite being technically accessible).
The remove operator was completely broken in 1.8.6. I will add some tests to
make sure that doesn't happen again. Also, the data operator was broken if you
had duplicate keys in your join function; in this case, the duplicate elements
would not always be removed.
The previous behavior of selecting the parent node was extremely confusing
because it could result in the parent node being selected multiple times (when
removing siblings). Even worse, the child data would override the parent data!
This changes the `remove` operator so that it matches the behavior of the W3C
API (removeChild), returning the removed nodes.
UglifyJS requires Node.js to run, but it's a lot faster than Google's
compiler and produces smaller gzipped sizes. Some of the non-gzipped
sizes are a bit larger than Google's but I think the gzipped size is
more important. Faster runtime is also good when we start testing the
minified versions too.
Release 1.7.0. Adds partition & hierarchy layouts, step-{before,after}
interpolation for line & area, sorting for treemaps, and a few bug fixes for
time format. Oh, and a bunch of tests!