Граф коммитов

22 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 915be32ef7 Merge branch 'tree' 2011-04-10 18:44:45 -07:00
Mike Bostock f6975bb739 Fix prefix in private functions. 2011-04-10 18:28:59 -07:00
Mike Bostock 2c03029045 Compute wrap-around separation. 2011-04-10 13:56:34 -07:00
Mike Bostock ed1042f395 A tiny bit cleaner. 2011-04-10 13:15:15 -07:00
Mike Bostock 6e901439fd Move temporary state to node._tree. 2011-04-10 13:04:21 -07:00
Mike Bostock 111e8e53e6 More readability improvements. 2011-04-10 12:47:32 -07:00
Mike Bostock ca3c272d98 More readability improvements. 2011-04-10 12:36:58 -07:00
Mike Bostock 3571cc3845 Rewrite `firstWalk` for readability. 2011-04-10 12:16:26 -07:00
Mike Bostock 0c88813f56 Generalizing tree layout.
Rather than specifying an orientation, compute the layout in normalized space. In a future change,
I'd also like to clean up the temporary state that is stored on tree nodes, and record dx and dy
attributes per node that could be used to compute a space-filling layout.
2011-04-10 12:07:17 -07:00
Jason Davies f208a5be09 Add Reingold-Tilford tree layout.
This is based on the Protovis layout; virtually no changes were needed
to the code aside from handling of previous and next siblings.
2011-04-10 16:20:51 +01:00
Michael Bostock 5f4e950002 Sticky treemap layouts!
The treemap layout can now be set to "sticky" mode, which preserves the row
arrangements from an earlier layout. This is particularly handy for animating
treemaps, as it avoids the temporary occlusion as nodes swap positions. Thanks
to @philogb and the New York Times for the inspiration!
2011-03-14 23:39:11 -07:00
Mike Bostock 52bf6c978a Expose d3.layout.hierarchy.sort.
Also, add nifty transitions to the sunburst example.
2011-03-12 21:14:07 -08:00
Michael Bostock abae3f9263 Add hierarchy & partition layouts.
Also, expose d3.rebind to make it a bit easier to compose classes.
2011-03-12 10:27:05 -08:00
Michael Bostock 166f8b5868 Expose d3.timer, for requestAnimationFrame.
This allows external classes to hook into D3's timer mechanism, such as the
iterative force-directed graph layout.
2011-03-08 23:29:59 -08:00
Michael Bostock 36e935a8c8 Add force & treemap to d3.layout. 2011-03-03 15:43:57 -08:00
Michael Bostock a29c802a77 Sort for layout, but don't reorder.
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.)
2011-02-24 14:36:57 -08:00
Michael Bostock ade083dd56 More convenient pies.
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.
2011-02-24 14:13:05 -08:00
Mike Bostock 59c32fc669 Fix subgroup sorting in chord layout. 2011-02-23 09:09:43 -08:00
Michael Bostock 65307730a3 Add d3.layout.stack, d3.min, d3.max. 2011-01-17 12:27:29 -08:00
Michael Bostock bdcb648849 Turn off the compiler's "advanced" optimizations.
The renaming of attributes is totally not worth the hassle of maintaining an
externs file (or using the awkward `foo["bar"]` syntax). The file size
reduction from the advanced optimizations was negligible, besides!
2011-01-05 11:35:39 -08:00
Michael Bostock bbcf25ef7d Fix a bug with zero-duration transitions.
Also, don't generate chords if both the source and target value are zero.
2010-11-28 16:28:48 -08:00
Mike Bostock 6307364a45 Add layout module, with layout.chord class. 2010-11-28 13:15:07 -08:00