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

194 Коммитов

Автор SHA1 Сообщение Дата
Jason Davies 037493c250 Fix bug when transitioning namespaced attributes.
Also, simplify handling of nulls.
2011-10-06 20:06:14 +01:00
Jason Davies 57a3b0dbcb More efficient removal of transition properties.
Thanks, @mbostock!
2011-10-06 09:54:07 +01:00
Jason Davies db65a3849f Use removeAttribute when transitioning to null. 2011-10-05 23:05:42 +01:00
Jason Davies 878d1c1c13 Fix transitioning styles to null (removal). 2011-10-05 22:35:19 +01:00
Jason Davies 68f555bfc2 Add test for transition.selectAll and NodeLists.
This tests the fix in cd3d236015.
2011-09-30 16:55:30 +01:00
Jason Davies 927426f79f Support multiple classes in classed operator.
Fixes #320.
2011-09-29 11:30:20 +01:00
Mike Bostock fd0759f02a Merge branch 'fix-format-zero-sigfig' into release 2011-09-27 13:56:07 -07:00
Mike Bostock 80fafd527c Add back d3_array for IE9.
This also tweaks the array conversion slightly so that it is called by
selection.selectAll rather than d3_selectAll; this guarantees that the selection
groups are always arrays, even when a function selector is used.
2011-09-27 08:45:06 -07:00
Peter Woodman 8914a38981 expand si representation range to abs(x) < 10^27 2011-09-20 18:14:00 -07:00
Peter Woodman 4918c83f41 separate variable for dropping post-decimal zeros, possibly useful for other formats. 2011-09-20 17:23:55 -07:00
Peter Woodman 0ca32a8f69 add SI prefix formatting to d3.format 2011-09-20 16:20:06 -07:00
Peter Woodman 6ca72c41e7 fix significant figures formatting ('r') when specifying a precision for input 0. 2011-09-20 15:08:51 -07:00
Mike Bostock e7ac548105 Clamp easing functions to [0,1].
Rather than have a treshold in transitions, we now clamp the easing functions.
This guarantees that when the transition ends, the tweens will be called with
t=1, and produce clean output values. Previously, that was not the case for
certain easing functions, such as exp-out and elastic.
2011-08-30 13:07:41 -07:00
Mike Bostock c2e37352ac Fix for IE9's style.setProperty.
IE9 does not string-coerce values, instead throwing an error. We now wrap IE9's
implementation to force string coercion. While it would be simpler to turn on
string-coercion for all browsers inside D3's style operator, this approach
avoids penalizing standards-compliant browsers.

This commit also moves language-compatibility code to a separate directory, and
deletes the obsolete Object.create polyfill, which is no longer needed by D3.
2011-08-28 19:35:53 -07:00
Mike Bostock a35fc55410 Inherit namespace from parent node.
This allows you to append("g") to an svg:svg, instead of append("svg:g").
2011-08-27 11:38:03 -07:00
Mike Bostock cd135d5e90 Fix a flakey test.
Need to wait a bit to allow the other transition to finish, too.
2011-08-27 10:59:24 -07:00
Mike Bostock 364bf941ca Use reference count rather than owner id.
As of 2.0.0, it's possible to have multiple transitions running concurrently
with the same id. Thus, it is no longer sufficient to check the transition id
to decide whether to delete the transition lock. We now use reference counting
to determine the number of transitions that are scheduled on a given element;
when that number drops to zero, we can delete the transition lock.
2011-08-26 16:50:29 -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
Mike Bostock a4500fcfb1 Allow `on` to return the current listener.
Fixes #216.
2011-08-22 18:50:14 -07:00
Mike Bostock eecd123ecc Add missing semicolons. 2011-08-22 11:33:13 -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 1704957cb0 Add test for transition.tween. 2011-08-21 17:50:22 -07:00
Mike Bostock 3f22d76fb3 Better tests for transition.attr. 2011-08-21 17:43:37 -07:00
Mike Bostock f577542eff Add test for transition.selectAll. 2011-08-21 17:36:24 -07:00
Mike Bostock 80fa16a351 Add test for transition.select. 2011-08-21 17:28:32 -07:00
Mike Bostock e2b112bc81 Add tests for attrTween and styleTween. 2011-08-21 17:16:57 -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 8cc290a00a Add test for transition.call. 2011-08-21 15:21:57 -07:00
Mike Bostock aeae92ca5c Add test for transition.text. 2011-08-21 15:19:09 -07:00
Mike Bostock 5764e49992 Add tests for transition delay and duration. 2011-08-21 15:01:31 -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 3b04b4f5ee Oops, didn't mean to comment this out.
(Still passes though!)
2011-08-20 17:04:04 -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 7c2062f289 Fix a crash when rounding very small numbers. 2011-08-17 16:13:50 -07:00
Mike Bostock 746ec74663 Add tests for xhr and friends. 2011-08-16 22:28:15 -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 e3886060b9 Add test for ease. 2011-08-16 12:26:47 -07:00
Mike Bostock 7d018fbc41 Add test for dispatch. 2011-08-16 11:32:32 -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 22732f5da8 Add test for quantile. 2011-08-16 10:59:34 -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 a0e3e84972 Add test for rebind. 2011-08-15 22:19:58 -07:00
Mike Bostock d756660748 Add test for functor. 2011-08-15 21:47:14 -07:00
Mike Bostock aa1ef3ba3b Add test for split. 2011-08-15 21:41:03 -07:00
Mike Bostock 09c5e5157d Add test for merge. 2011-08-15 21:29:55 -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 3a5a6c6c0d Add test for transition. 2011-08-14 13:07:20 -07:00
Mike Bostock 03253fcff6 Add test for nest. 2011-08-14 12:57:09 -07:00
Mike Bostock 0cd0ede546 Add test for interpolate. 2011-08-14 11:52:59 -07:00
Mike Bostock 3771bf5f64 Add test for hsl. 2011-08-14 11:16:03 -07:00
Mike Bostock 3685a428fe Add test for rgb. 2011-08-14 10:53:34 -07:00
Mike Bostock 6d138b2510 Add test for format. 2011-08-14 10:11:37 -07:00
Mike Bostock 01fb201f4e Add test for round. 2011-08-14 09:29:42 -07:00
Mike Bostock cb7ebe11e8 Add test for permute. 2011-08-14 09:11:33 -07:00
Mike Bostock 80ca9b8f8e Add test for entries. 2011-08-14 09:03:00 -07:00
Mike Bostock 15d7e87fdb Add test for d3.values. 2011-08-13 23:13:28 -07:00
Mike Bostock 5f998d68e3 Add test for keys. 2011-08-13 23:09:37 -07:00
Mike Bostock 6b74562910 Add test for d3.sum. 2011-08-13 23:00:24 -07:00
Mike Bostock 318b6713e1 Add test for zip. 2011-08-13 22:54:08 -07:00
Mike Bostock e6638b66b8 Add tests for min and max. 2011-08-13 22:45:02 -07:00
Mike Bostock 96c2a750bb Update comment. 2011-08-13 19:25:54 -07:00
Mike Bostock 9d85f339f8 Add test for selection.on. 2011-08-13 19:10:38 -07:00
Mike Bostock 695834b99d Remove old tests for insert and remove. 2011-08-13 18:47:23 -07:00
Mike Bostock ca8476097d Add test for selection.remove. 2011-08-13 18:46:20 -07:00
Mike Bostock 5f5d8a227e Test selection operator return values. 2011-08-13 18:40:38 -07:00
Mike Bostock e7ad8bb185 Add test for selection.insert. 2011-08-13 18:22:13 -07:00
Mike Bostock c88d9d14c9 Add test for enter-append. 2011-08-13 18:15:14 -07:00
Mike Bostock b65f4de740 Verify that data is propagated on append. 2011-08-13 18:08:34 -07:00
Mike Bostock 354765c309 Add test for selection.data. 2011-08-13 18:05:02 -07:00
Mike Bostock 8986f76af6 Add test for d3.version. 2011-08-13 18:04:34 -07:00
Mike Bostock 247a6c6e9d Add tests for d3.ascending and d3.descending. 2011-08-13 17:33:45 -07:00
Mike Bostock 94800d39d2 Add test for selection.sort. 2011-08-13 17:27:54 -07:00
Mike Bostock f72cc35359 Add test for selection.html. 2011-08-13 16:45:10 -07:00
Mike Bostock f58bed27fd Add test for selection.text. 2011-08-13 14:43:04 -07:00
Mike Bostock f4a7a610f6 Add test for selection.each. 2011-08-13 14:23:02 -07:00
Mike Bostock 68e9f96f03 Add test for selection.node. 2011-08-13 11:36:39 -07:00
Mike Bostock 2ed5801e72 Add test for selection.empty. 2011-08-13 11:34:41 -07:00
Mike Bostock badce35c76 Add test for selection.map. 2011-08-13 11:28:40 -07:00
Mike Bostock c22d45027c Add tests for ignoring null nodes. 2011-08-13 11:13:38 -07:00
Mike Bostock 7718469d91 Add selection.filter test. 2011-08-13 11:00:52 -07:00
Mike Bostock ca424e1724 Add test for selection.classed. 2011-08-13 10:48:01 -07:00
Mike Bostock 983d77ba98 Add test for selection.call. 2011-08-13 10:26:40 -07:00
Mike Bostock 7a6ebbfb15 Remove old tests for bisect. 2011-08-13 10:19:14 -07:00
Mike Bostock b881b520ea Remove old tests for append and attr. 2011-08-13 10:18:49 -07:00
Mike Bostock d59f7a9f6f Add test for bisect methods. 2011-08-13 10:18:40 -07:00
Mike Bostock 2fb6d98ef1 Add tests for namespacing and property removal. 2011-08-12 23:58:56 -07:00
Mike Bostock 1444698b22 Add tests for selection select and selectAll. 2011-08-12 23:26:46 -07:00
Mike Bostock 822bcdd1a1 Update tests for select and selectAll. 2011-08-12 21:52:45 -07:00
Mike Bostock 53326dac6c Add tests for selection.{attr,property,style}. 2011-08-12 21:52:10 -07:00
Mike Bostock 1035e71450 Add test for selection.append. 2011-08-12 21:50:50 -07:00
Mike Bostock 07b068ea6c Add test for d3.ns. 2011-08-12 21:42:40 -07:00
Mike Bostock 0e9589d1f2 Checkpoint new test framework using Vows. 2011-08-12 18:07:42 -07:00
Mike Bostock e37031a38c Organize tests into modules. 2011-07-18 18:08:06 -07:00