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

329 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock ba2a68bb94 Allow tickFormat to be specified as a constant.
This was basically supported already, but there was a slight bug in the truthy
check for tickFormat. Now we check for null rather than falsiness.
2011-08-24 16:11:28 -07:00
Mike Bostock 4e96a35b66 More consistent timing for transitions.
Previously, the start time for a transition could be slightly different for
different elements, even when the transition was created at the same time. This
commit allows timers to be created with an explicit reference time (then),
allowing a transition to be temporaly consistent across elements.
2011-08-24 16:04:47 -07:00
Mike Bostock 6c4c7d8aae Merge branch 'release' 2011-08-24 14:12:59 -07:00
Mike Bostock c63abd74a0 Merge branch 'stray-globals' of https://github.com/jasondavies/d3 into release 2011-08-24 14:11:52 -07:00
Mike Bostock 9d4b6a02fb Fix a bug in selector functions.
They weren't being invoked with the correct syntax (being passed the data and
index, with the current node as the context). This commit also removes the
d3_array wrapper, which does not appear to be necessary; I've forgotten why it
was there in the first place.
2011-08-24 14:08:19 -07:00
Jason Davies 8223554e50 Remove some stray globals in d3.behavior.*. 2011-08-24 18:28:14 +01:00
Mike Bostock 3ea08db753 Merge branch 'release' 2011-08-23 12:53:21 -07:00
Mike Bostock 2af6fbf172 Merge branch 'axis' into release 2011-08-23 12:51:44 -07:00
Mike Bostock 545e9de74c Merge branch 'drag' of https://github.com/jasondavies/d3 into release
This also fixes a few bugs in the new implementation, restoring support for the
offset between the mouse and the dragged element by reporting a delta rather
than an absolute offset. Also, this fixes an infinite loop when an element is
removed from the DOM.
2011-08-23 12:47:46 -07:00
Mike Bostock 95805adc9b Promote the axis component to the svg module.
I'm including the axis component in the core build because it should be useful
in many different visualization types, similar to the other svg components. The
chart module contains a hodgepodge of more obscure visualization types, and
there's no reason to pull those in for more common visualizations. Perhaps most
importantly, the axis component isn't a chart type!
2011-08-23 12:02:12 -07:00
Mike Bostock a4500fcfb1 Allow `on` to return the current listener.
Fixes #216.
2011-08-22 18:50:14 -07:00
Mike Bostock a0fa7a00e5 Tolerate empty domains. Fixes #115. 2011-08-22 18:05:41 -07:00
Mike Bostock 9dc97e87fe Merge branch 'master' into axis 2011-08-22 16:20:54 -07:00
Mike Bostock b21cc8138d Merge branch 'release' 2011-08-22 14:08:18 -07:00
Mike Bostock 2f1472b67d Expose selection and transition prototypes.
This means that you can now extend D3's selections and transitions with custom
functionality! Also, you can use now instanceof to see whether something is an
instanceof d3.selection or d3.transition.
2011-08-22 11:26:40 -07:00
Mike Bostock 553bd4e36b Expose transition id. 2011-08-21 20:34:22 -07:00
Mike Bostock 51c7e58fdb Add test for transition.remove.
Also fix a bug where it would be possible for an earlier to transition to become
the lock owner. We now guarantee that the lock owner can only increase while
transitions are scheduled on an element.
2011-08-21 15:54:17 -07:00
Mike Bostock af418fb5a4 Better tests for transitions.
This caught a couple bugs in the previous commit. First, I wasn't sending the
correct index (i) to the "end" event listeners, because it was being masked by
a local variable. Second, the transition lock was being incorrectly deleted when
a transition is inherited on the same node and there is zero delay and
d3.timer.flush is called. There was potentially a related bug where the active
field was not being cleared on the transition lock. Yay tests!
2011-08-20 23:50:34 -07:00
Mike Bostock 4b25f0a62b Simplify map implementation. 2011-08-20 17:04:50 -07:00
Mike Bostock 18b9e11414 Prototype injection!
This changes the core implementation of selections and transitions to use
prototype injection rather than direct extension. This offers better performance
by eliminating per-instance overhead from closures and assignment. On browsers
that don't support prototype injection, we fall back to direct extension.

This commit isn't just about performance, though; the code ends up being a lot
cleaner and more separable if we force methods to rely solely on `this`, rather
than capturing surrounding variables with closures.

Most importantly, transitions are now "transparent", like selections. Rather
than opaque objects, transitions are now arrays of nodes, similar to selections.
The nodes are wrapped in an object that stores the delay and duration, which
means you can now inspect the computed delay and duration. (This was the
original motivation for this commit, and will allow chart components to be
call'd on transitions as well as selections.)

Transitions now support the `each` operator with one argument, which has the
same behavior as on selections. The `each` operator now passes a third argument
containing the group index (`j`). Transitions now also support a `tween`
operator, which is a generic mechanism for doing things during a transition; use
this in place of a "tick" event.

This commit also fixes a few bugs. The enter selection now supports the empty
operator; we can add other operators in the future more easily, if we so choose.
Transition's attr operator now supports namespaced attributes. Selection's
property operator no longer parses property namespaces.
2011-08-20 16:27:25 -07:00
Mike Bostock f55d002f03 Merge branch 'enter-update' into axis 2011-08-19 13:57:06 -07:00
Mike Bostock 434b9eedb9 Merge branch 'master' into scale-clone 2011-08-19 13:56:02 -07:00
Mike Bostock 83f4914831 Merge branch 'master' into enter-update 2011-08-19 13:55:43 -07:00
Mike Bostock 402c2e4922 Merge branch 'release' 2011-08-19 11:02:39 -07:00
Mike Bostock d2b152ce7f Fix a bug in ordinal.copy. More tests. 2011-08-18 14:59:55 -07:00
Mike Bostock c513f515c6 Merge branch 'master' into scale-clone 2011-08-18 12:44:31 -07:00
Mike Bostock b7fb05ab0f Merge branch 'test' 2011-08-17 16:24:19 -07:00
Mike Bostock 7c2062f289 Fix a crash when rounding very small numbers. 2011-08-17 16:13:50 -07:00
Mike Bostock 559394bdb9 Better tests for svg.arc.
This also fixes a bug when start and end angle are inverted.
2011-08-17 13:27:55 -07:00
Mike Bostock f23cb315de Add test for scale.quantize. 2011-08-16 22:51:32 -07:00
Mike Bostock 40b98c4d7b Add test for timer.
Also fix a minor bug where we might miss the delay the first callback by an
extra frame, and allow d3.timer to be called with an optional delay.
2011-08-16 21:21:16 -07:00
Mike Bostock ae4306eaa6 Merge branch 'test' 2011-08-16 12:31:00 -07:00
Mike Bostock e3886060b9 Add test for ease. 2011-08-16 12:26:47 -07:00
Mike Bostock eccef138e6 Add test for range.
Also, fix a bug where step could be specified as undefined or null, rather than
checking the arity of the arguments.
2011-08-16 11:16:53 -07:00
Mike Bostock ffb445bb1b Add test for requote.
And, fix a bug where pipes were not escaped.
2011-08-16 10:51:55 -07:00
Mike Bostock 41f769e36c Merge branch 'test' 2011-08-15 22:22:18 -07:00
Mike Bostock c8ad125aee Add test for first and last.
Also fix bugs in ascending and descending when comparing undefined and NaN.
2011-08-15 21:23:34 -07:00
Mike Bostock ceb5f7cc94 Merge branch 'release' 2011-08-15 16:45:54 -07:00
Mike Bostock 9a2c6a0657 Add test for scale.linear.
Woot! Found a bug in d3.interpolate related to string coercion and colors.
2011-08-15 15:12:54 -07:00
Mike Bostock 5d17075bf3 Add scale.copy.
This returns a copy of the scale, such that future modifications to the scale's
domain or range (or other attributes) are isolated from the copy. This is useful
for transitions where you may want to make a copy of a scale before it changes,
such that entering elements can be initialized using the previous copy.
2011-08-12 15:58:42 -07:00
Mike Bostock 5ba1c2a066 Merge branch 'ordinal' 2011-08-01 11:25:42 -07:00
Mike Bostock 9cd6a46019 Fix #236 - scale.pow accepts negative values. 2011-08-01 11:23:26 -07:00
Mike Bostock 7590713270 Fix #66 - setting domain recomputes range. 2011-08-01 11:16:38 -07:00
Mike Bostock 2c52c37b8c Merge branch 'time' 2011-07-31 17:31:24 -07:00
Mike Bostock e2346ad471 Merge branch 'release' 2011-07-31 16:11:35 -07:00
Mike Bostock 6a9eda0b57 Merge branch 'release' 2011-07-20 16:15:57 -07:00
Mike Bostock a40876cb55 Merge branch 'release' 2011-07-16 20:45:11 -07:00
Mike Bostock 0afaaa248f Update source files. 2011-07-16 20:42:49 -07:00
Jason Davies 1a456a90c7 Minor optimisation. 2011-07-16 00:49:25 +01:00
Mike Bostock 06ecb617a2 Allow multiple zoom behaviors to coexist.
Any event handlers on the window need to manage global state, as they will be
replaced when another zoom behavior is created.
2011-07-10 10:31:52 -07:00