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

354 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 8436904cb3 Tiny optimization. 2011-09-14 11:15:50 -07:00
Mike Bostock f90bc4fd50 Avoid a bug in UglifyJS.
See <https://github.com/mishoo/UglifyJS/issues/215>.
2011-09-02 11:57:59 -07:00
Mike Bostock 7a1f67b1b6 Merge branch 'release' 2011-08-31 17:50:48 -07:00
Mike Bostock 897b0b64e2 Merge branch 'ease-clamp' into release 2011-08-31 17:50:07 -07:00
Jason Davies 3d064526d4 Reverse subpath direction for annulus. 2011-08-31 12:48:01 +01: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 fd10189458 Fix a bug with zero-delay transitions. 2011-08-29 12:13:19 -07:00
Mike Bostock 082beb1eb9 Merge branch 'release' 2011-08-29 11:56:58 -07:00
Mike Bostock fa312bfdd0 Merge branch 'ie9-style' into release 2011-08-29 11:52:45 -07:00
Mike Bostock a4038b87f9 Merge branch 'zero-transitions' into release 2011-08-29 11:52:22 -07:00
Mike Bostock 4273b224b9 Merge branch 'ordinal-string-coercion' into release 2011-08-29 11:51:58 -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 55759258fd Fire a tick immediately on start.
This improves the performance of transitions that have already ended (those with
zero duration), as the transition can end immediately on start rather than
waiting for a second tick.
2011-08-28 18:35:32 -07:00
Mike Bostock 51f6641314 Default priority to empty string, not null. 2011-08-28 17:10:52 -07:00
Mike Bostock 874c6f4503 Don't string-coerce ordinal domain values.
Fixes #274. String coerce for uniqueness, but store the original input types in
the domain for subsequent retrieval. This way, you can more easily use
non-strings as domain values (such as dates or numbers).
2011-08-28 15:23:17 -07:00
Mike Bostock 1e0b80fb3a Merge branch 'release' 2011-08-26 17:00:23 -07:00
Mike Bostock 18519d9c2d Merge branch 'concurrent-transition' into release 2011-08-26 16:58:45 -07:00
Mike Bostock 88e1a6c781 Merge branch 'array-subclass' into release 2011-08-26 16:58:15 -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 5aeb312196 Create the root selection after the prototype.
This fixes a breakage on IE9, which doesn't support array subclassing through
prototype injection. On IE9, we then use direct extension of the prototype, but
this can only be done after the prototype is fully-defined.
2011-08-26 13:17:27 -07:00
Mike Bostock f530251899 Fix zooming in Firefox.
We were mistakenly binding Firefox's DOMMouseScroll to dblclick rather than
mousewheel. Also, there's no acceleration on these events, so we need to make
them faster to match the typical behavior of mousewheel.
2011-08-25 09:13:45 -07:00
Mike Bostock fb7e69f75e Fix albersUsa, again. 2011-08-24 18:11:35 -07:00
Mike Bostock 3f6fefb557 Merge branch 'release' 2011-08-24 18:04:29 -07:00
Mike Bostock d5533276bc Add transition.transition.
This derives a new transition from the existing transition, equivalent to (and
implemented as) transition.select(function() { return this; }).
2011-08-24 17:46:10 -07:00
Mike Bostock 0f4152e042 Fix the domain path for polylinear scales. 2011-08-24 16:20:59 -07:00
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