d3/examples/bullet
Mike Bostock c29d4dc1a7 Better box chart transitions.
Preserving object constancy across transitions is tricky! For example, what
happens if we remove the whiskers in a transition? How do we join outliers? This
commit makes a few assumptions explicit:

1. The `quartiles` function must return exactly three elements. This property
must be specified as a function.

2. The `whiskers` function must return exactly 2 elements, or null if no
whiskers are to be displayed. This property must be specified as a function.

3. The `domain` function must return exactly 2 elements, or null if the default
domain should be used. This property can be specified either as a constant or as
a function.

We could generalize this chart to support more than two whiskers, but it doesn't
seem urgent, and it would complicate the transition if the number of whiskers
changes. In a related change, the `whiskers` function does not receive a third
argument containing the quartiles; instead, this is made available by the
`quartiles` property on the values array (the first argument).

The outliers are joined using the `Number` key function. The outlier data is now
stored as indices; this allows reasonable object constancy across transitions
with outliers. Similarly, the tick labels for the quartiles are whiskers are now
separated, such that the whisker labels can be added or removed without spurious
transition.
2011-04-13 17:44:20 -07:00
..
bullet.css Extract title & subtitle from bullet chart. 2011-04-08 14:40:29 -07:00
bullet.html Restructure bullet chart example. 2011-04-09 12:38:48 -07:00
bullet.js Better box chart transitions. 2011-04-13 17:44:20 -07:00
bullets.json Restructure bullet chart example. 2011-04-09 12:38:48 -07:00