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

9 Коммитов

Автор SHA1 Сообщение Дата
Michael Bostock 937529eff3 Merge branch 'jasondavies-ie9_xhr' 2011-03-15 09:24:45 -07:00
Michael Bostock 62ef98e817 Restructure voronoi example. 2011-02-27 13:05:55 -08:00
Michael Bostock f8ae20da9d Simplify data join. Add insert & empty.
The data join is now specified as a single function of data, as with all other
properties. This allows the key to be computed on the previously-bound data,
rather than requiring the key to be serialized into the DOM (say, as an
attribute). In the case that there is no previously-bound data, it is still
possible to access the associated node as the `this` context.

The `enter` operator no longer performs an append. For symmetry with the `exit`
operator, you must call `append` after obtaining the entering selection. This
requires a tiny bit more code, but should make the code more clear. Also, it
provides an opportunity to use a different instantiation operator, such as the
new `insert` operator. This takes a second argument, which is a selector for the
insert-before reference element. For example, the selector ":first-child" will
prepend nodes.

The `empty` operator allows you to query whether a selection is empty (i.e.,
contains zero matching nodes).
2011-01-31 11:00:35 -08:00
Michael Bostock 156ff68f16 Move Voronoi & Delaunay code into geom module. 2010-11-07 21:09:59 -08:00
Michael Bostock ee580489b1 Make Voronoi implementation compile with Closure. 2010-11-07 15:59:40 -08:00
Michael Bostock 57059e32a3 Replace previous optimization with filter.
It's probably best to assume that if the attr is being set, it's changing, and
therefore we shouldn't check the original value. The caller can now use the
filter operator to optimize, if needed.
2010-11-07 08:53:34 -08:00
Michael Bostock cfe47b5ad5 Add mouseover interaction to Voronoi example.
Also, change svg.mouse so that it returns an array [x, y] rather than {x, y};
this makes it easier to convert to a string, e.g., for SVG's transform
attribute. Also, optimize selection.attr so that it checks the attribute value
before setting the attribute. (I thought it would be slower to check, but
surprisingly it's not!)
2010-11-07 00:12:45 -07:00
Michael Bostock 56ef531a79 Return closed polygons for Voronoi, rather than edges. 2010-11-06 19:10:50 -07:00
Michael Bostock 603408aa52 Add Voronoi tesselation example. 2010-11-06 17:23:49 -07:00