The method existed previously, but it only makes sense in conjunction with the newly-added `entries` operator; map keys are inherently unsorted. Originally I envisioned that key-sorting could be done externally using `d3.entries`, but that's tedious for hierarchical structures.
Use the Floyd-Warshall algorithm to compute the shortest path between nodes, and use that graph theoretic distance as the distance constraint for the Gauss- Seidel relaxation. In addition, have the constraint alpha decay over time, as in Simulated Annealing.
This allows scale interpolation in HSL space. For example: var fill = d3.scale.linear() .interpolate(d3.interpolateHsl) .domain([0, 100]) .range([d3.hsl(180, .5, 1), d3.hsl(180, .5, 0)]); You could approximate this in previous versions using d3.interpolateString, but the new interpolation method is slightly faster and also provides backwards- compatibility for browsers that only understand RGB.
This fixes a bug in the pie layout sorting where we want the sort order to affect the layout, but not the order in which arcs are rendered—and furthermore we want the order of arcs to always match the order of data. (If you want to sort the data, do that before it is passed to the layout.)
This adds d3.layout.pie, which can be used to compute the start and end angles for arcs given an arbitrary array of data. In addition, d3.svg.arc now has a `centroid` method that computes the center of the arc, useful for labeling. Together these changes greatly simplify the donut & pie examples. This commit also includes a `map` method for selections, which is similar to the `filter` method. This allows you to map the data bound to the current selection. I'm not currently using it, but it seems like a useful feature for those cases where you want to rebind the current selection to different (but related) data.
D3 now supports Sizzle, preferring Sizzle to the native Selectors API if Sizzle is available. Sizzle internally uses the native Selectors API and thus this should have minimal performance implications; also, it allows you to use Sizzle proprietary extensions such as ":first". This commit also restricts the definition of the enter selection so that only append and insert operations are defined. The other operations were generally unsupported anyway, and it cleans up the code to have separate implementations for insert and append. (I might enable additional operations in the future, such as `filter`, `sort` and `each`, but this seems like a reasonable first pass.)
Includes, as the first behavior, a pan & zoom behavior. The canvas can be panned by dragging the mouse, and zoomed using the mousewheel (or by double-click). By listening to redraw events, users can decide whether to implement geometric zooming (such as by setting the "transform" attribute on an `svg:g` element) or semantic zooming (by changing the domain of a scale object and repositioning elements). This commit also includes two bug fixes. The `d3.format` class now properly groups thousands of negative numbers, and supports the sign specifier. The unicode minus symbol \u2212 is used for negative values. The `d3.scale.pow` class now properly handles negative numbers, as well.