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

801 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 9915e30d9c Listen for "mousemove" on window.
I think this gives a better experience on big monitors. :-) I've also used
d3.timer to update the paths in case there is a backlog of mousemove events.
I'm not sure this is necessary but in testing on a fast machine sometimes it
processes two mousemove events and only draws the most recent one with this
change.
2011-06-22 20:03:49 +01:00
Jason Davies 4efd99f6be Revert "Use approximate sin/cos for faster interpolation."
This reverts commit c5450fa62a.

It turns out this approximation is not that much faster than Math.{sin,cos}; I
think the perceived performance is more related to the responsiveness to the
"mousemove" event.
2011-06-22 19:54:43 +01:00
Jason Davies c5450fa62a Use approximate sin/cos for faster interpolation.
This particular approximation is taken from
<http://www.devmaster.net/forums/showthread.php?t=5784> but there may well be
better ones out there.  This seems to work nicely though!
2011-06-22 18:56:58 +01:00
Mike Bostock 5f41452ed2 Change bundle strength on mousemove. 2011-06-22 10:25:57 -07:00
Mike Bostock 0aba0702a5 Hierarchical edge bundling improvements.
The input to the layout is now an array of edges to bundle, rather than nodes.
This eliminates the need for an `outgoing` accessor, since the links are passed
to the bundle layout directly.

The svg line generator now supports a beta (straightening; bundle strength)
parameter. I haven't decided if this is the right place or the right name for
it, but it seems like a reasonable starting point. I'm not happy with the cos &
sin needed to produce radial lines (both here and for the diagonal projection in
other examples), but I don't have a good alternative yet.

This commit also tries to make the construction of the links from the layout
nodes a bit easier to follow. The previous code was used another intermediate
representation, and I think it's cleaner to construct the default format
expected by the layouts. However, there's still a good chunk of code required to
massage the JSON format into a node hierarchy and array of dependencies, so I'd
like to find a way to simplify that, too.
2011-06-22 09:46:52 -07:00
Jason Davies 65a2370526 Make d3.layout.bundle layout-independent.
I've included an example of using it with treemaps.
2011-06-22 09:11:23 +01:00
Jason Davies 209a020114 Add ticks tests for pow scale. 2011-06-18 11:19:06 +01:00
Jason Davies c159980f7d Linear and log ticks: support descending domains.
See #185.
2011-06-17 21:18:40 +01:00
Jason Davies b17d4e1133 Minor clean ups. 2011-06-17 18:39:56 +01:00
Jason Davies a386da4e6c Add hierarchical edge bundling layout!
Based on <http://cs.stanford.edu/people/mbostock/iv/dependency-tree.html>.

See #194.
2011-06-17 18:34:49 +01:00
Jason Davies 0752a014af d3.svg.area: evaluate x-accessor once per element.
I played with extracting d3_svg_linePoints but this seems simpler.

Fixes #187.
2011-06-17 14:42:23 +01:00
Mike Bostock 68424aeff4 Merge branch 'release' 2011-06-16 21:12:37 -07:00
Mike Bostock 27158fdeb4 Merge branch 'voroboid' into release 2011-06-16 21:11:31 -07:00
Mike Bostock de92ecd6f3 Merge branch 'sum' into release 2011-06-16 21:09:41 -07:00
Jason Davies b7e20a4310 Couple of tweaks to reset gravity.
Firstly, when the mouse exits the area the gravity coordinates are nullified.
Secondly, if the user switches to another window, the gravity coordinates are
nullified (otherwise the appropriate "mouseout" event may be missed).
2011-06-15 23:20:14 +01:00
Mike Bostock ba6fc56997 Add tests for d3.time.format.iso. 2011-06-15 10:59:15 -07:00
Mike Bostock bbbf287daa Extract tests for d3.time.format.utc. 2011-06-15 10:50:46 -07:00
Mike Bostock 54805a6bc0 Add tests for d3.time.format.utc.parse. 2011-06-15 10:48:20 -07:00
Jason Davies 8e2d4ba599 Minor fixes to min/max test cases. 2011-06-15 17:47:54 +01:00
Jason Davies f90554f41e Add d3.sum.
Fixes #191.
2011-06-15 17:44:58 +01:00
Mike Bostock 068e66de31 Add UTC & ISO time formats. 2011-06-15 00:16:46 -07:00
Mike Bostock e2119b8ccf Merge branch 'release' 2011-06-13 17:37:57 -07:00
Mike Bostock 1cbda3067d Default nodes and links to empty.
Fixes #188.
2011-06-13 17:35:08 -07:00
Mike Bostock db0de49838 Expose force layout's friction parameter.
This was accidentally hidden by the drag behavior. Probably, the drag behavior
should be broken out and moved to the d3.behavior module. But this is a nice fix
for the immediate problem of name collision. Fixes #192.
2011-06-13 17:34:51 -07:00
Mike Bostock 4f16bbd9e7 Regenerate files. 2011-06-13 17:30:30 -07:00
Kevin J. Lynagh 69dc5efceb Add a semicolon at the end of modules to prevent trouble when modules are concatenated into the same file. 2011-06-13 15:54:45 -07:00
Mike Bostock 563b6d1cc3 Merge branch 'boid' 2011-06-12 14:07:08 -07:00
Jason Davies cac32ebc58 Move d3.ai.boid to voroboids example.
From Mike:

> This way, we keep the core library small, and we can make
> non-backwards compatible changes without bumping the major version
> number.
2011-06-12 21:40:58 +01:00
Jason Davies 0270071984 Merge remote branch 'mbostock/boid' into boid 2011-06-12 21:13:43 +01:00
Mike Bostock 24431337d7 Add force multi-foci example. 2011-06-12 13:11:48 -07:00
Mike Bostock fe9ed1bd1d Color voronoi cells by area. 2011-06-12 12:59:02 -07:00
Jason Davies a8bc56d914 U.S. spelling for consistency. 2011-06-12 20:42:36 +01:00
Jason Davies 3d3ac3b147 Add "boid" flocking: d3.ai.boid().
Includes interactive "voroboids" example!
2011-06-12 20:09:15 +01:00
Mike Bostock 1dfcda4888 Better nicing for pow scales. 2011-06-11 18:11:15 -07:00
Mike Bostock 9bf55832ea Minor tweak. 2011-06-11 17:15:35 -07:00
Mike Bostock 54031e1363 Add superformula explorer. 2011-06-11 16:59:42 -07:00
Mike Bostock acdc72799e Relocate superformula dot example. 2011-06-11 13:00:28 -07:00
Mike Bostock 4964bb6362 Merge branch 'superformula' 2011-06-11 12:57:35 -07:00
Mike Bostock 920d980b3b Move d3.svg.superformula into an example.
This way, people can play with superformulas if they want them, but we keep the
core library small. If we want to replace the default symbol implementation with
superformulas in the future, we can do that too. For now, be conservative.
2011-06-11 12:54:44 -07:00
Mike Bostock 852ac949d2 Merge branch 'master' into superformula 2011-06-11 12:49:22 -07:00
Mike Bostock 7dc7fe4f53 Merge branch 'release' 2011-06-11 12:40:43 -07:00
Mike Bostock 3f6e2e2983 Remove trailing whitespace. 2011-06-11 12:38:50 -07:00
Mike Bostock afbeb4cec1 Merge branch 'interpolators' into release 2011-06-11 12:37:23 -07:00
Mike Bostock 093089fd6b Add test for registering custom interpolator. 2011-06-11 12:36:51 -07:00
Mike Bostock 40ba7913e0 Add d3.interpolators registry.
This is useful when other modules want to register interpolators for
d3.interpolate without adding an explicit dependency to d3.core.  The
interpolators are applied in reverse order, and the first one that returns
a function is used.

(This commit was authored by @jasondavies and cherry picked.)
2011-06-11 12:32:41 -07:00
Mike Bostock 54ac5e6749 Merge branch 'nice' into release 2011-06-11 12:20:57 -07:00
Mike Bostock a9b5476da7 Merge branch 'optional-tweening' into release 2011-06-11 12:20:34 -07:00
Mike Bostock 0607c580be Reduce code duplication.
I'm not totally sure about the nicing behavior for pow scales; we might want it
to behave more like nicing for log scales. But this works for now!
2011-06-11 12:17:47 -07:00
Mike Bostock d756caa0d8 Simplify subclassing of hierarchy layout.
The subclasses can't use the same object as the parent class, because they are
functions. But, there's no reason to duplicate the code that rebinds the methods
onto the subclass.
2011-06-11 11:31:42 -07:00
Mike Bostock de35e0d094 Tweens are now optional.
If the tween function returns null, then no tween will be applied for the
specified element. The default tween function now returns null if the start and
end value are the same, thus avoiding redundant interpolation.
2011-06-11 11:12:51 -07:00