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

13 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 0f2846ef17 Add doctype to all examples for consistency. 2011-05-02 00:15:09 +01:00
Michael Bostock b4231227e1 Fix two bugs in transitions.
First, always coerce the tween target value (the value of the style or attribute
at the end of the transition) to a string. This guarantees that the correct
interpolator is chosen, and avoids a null dereference.

Second, default color channels to zero rather than undefined, so as to avoid NaN
channel values if there is an error parsing the color. This can occur, say, if
the background color of a div is unset and defaults to "rgba(0, 0, 0, 0)".
2011-02-08 15:59:03 -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 5c72d2c1c6 Add sort operator. 2010-11-01 23:28:27 -07:00
Michael Bostock 05a255ca9a Break d3 into {core,scale,svg} modules.
Also enable ADVANCED_OPTIMIZATIONS for the Google compiler.
2010-10-30 15:42:11 -07:00
Michael Bostock 99d1840275 Fix propagation of parentNode & parentData. 2010-10-24 14:03:12 -07:00
Michael Bostock 18a6e2941a Restore previous enter behavior.
It's a lot more predictable if we always use selectAll to determine the parent
node for a given group, rather than trying to infer parent nodes per node
during select.
2010-10-24 12:13:15 -07:00
Michael Bostock 7897cdddd0 Better tracking of enter parents. 2010-10-24 11:43:32 -07:00
Michael Bostock 9a28acdc62 Add "key" to join attributes. Event support. 2010-10-24 10:56:29 -07:00
Michael Bostock a5089b8918 Add `bind` action. 2010-10-21 12:53:56 -07:00
Mike Bostock 018b79577a Rename add -> append. 2010-10-02 11:00:31 -07:00
Mike Bostock 661ff7fe82 Redesign of tweens. 2010-09-28 23:18:51 -07:00
Mike Bostock ae0d06f209 Checkpoint examples. 2010-09-28 11:34:52 -07:00