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

396 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 9e303516f0 Merge branch 'classed' of https://github.com/jasondavies/d3 into release 2011-10-07 12:18:33 -07:00
Mike Bostock 440d96155f Merge branch 'transition-null' of https://github.com/jasondavies/d3 into release
Conflicts:
	test/core/transition-test-attr.js
2011-10-07 12:17:17 -07:00
Mike Bostock 87c1f831cb Merge branch 'area-step-interpolate' into release 2011-10-07 12:16:15 -07:00
Mike Bostock 0b852dd892 Copy constructors for d3.rgb and d3.hsl.
Previously, these would work by coercing the input color to a string and then
parsing it. This is slow, but more importantly, this is a lossy process for HSL
colors due to the conversion to hexadecimal RGB format. This commit detects
instances of d3_Rgb and d3_Hsl on input and copies them efficiently.
2011-10-07 12:10:10 -07:00
Mike Bostock 4d1de5e175 Fix a bug in area step interpolation.
When computing the reversed baseline, we need to switch between step-before and
step-after, since the points are in reverse order. Otherwise, we're effectively
filling the gap between step-before and step-after.
2011-10-07 11:32:06 -07:00
Jason Davies cc0ae766b7 Make toString return #RRGGBB for all colours.
This breaks a test case that ensures d3.hsl(x) == d3.hsl(d3.hsl(x)).

Fixes #333.
2011-10-07 17:58:58 +01:00
Jason Davies 6b83af4256 Use ternary ? happy : unhappy.
Using the comma operator isn't so bad, and I added it to removeAttribute
for good measure in case there's an implementation out there that
returns something.
2011-10-06 20:34:06 +01:00
Jason Davies 037493c250 Fix bug when transitioning namespaced attributes.
Also, simplify handling of nulls.
2011-10-06 20:06:14 +01:00
Jason Davies 8f8c7108d8 Small optimisation. 2011-10-06 09:56:34 +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 f5c60ecfde Fix null check in style transition. 2011-10-05 22:38:30 +01:00
Jason Davies 878d1c1c13 Fix transitioning styles to null (removal). 2011-10-05 22:35:19 +01:00
Jason Davies cf882501ef Simplify.
Thanks again, @mbostock!
2011-09-30 07:51:33 +01:00
Mike Bostock 6804a60fe4 Fix a bug with empty children arrays. 2011-09-29 21:53:22 -07:00
Mike Bostock cd3d236015 Fix a NodeList bug in transition.selectAll. 2011-09-29 15:00:51 -07:00
Jason Davies adec0a6490 Short-circuit for speed.
Thanks, @mbostock!
2011-09-29 16:33:34 +01:00
Jason Davies 927426f79f Support multiple classes in classed operator.
Fixes #320.
2011-09-29 11:30:20 +01:00
Mike Bostock 9e16bee0a5 Merge branch 'release' 2011-09-27 15:00:27 -07:00
Mike Bostock fd0759f02a Merge branch 'fix-format-zero-sigfig' into release 2011-09-27 13:56:07 -07:00
Mike Bostock 4c179d9386 Merge branch 'scale-log-ticks' into release 2011-09-27 13:55:35 -07:00
Mike Bostock 886f6b8dcf Merge branch 'behavior-click' of https://github.com/jasondavies/d3 into release 2011-09-27 13:54:36 -07:00
Mike Bostock 151d09d479 Merge branch 'release' 2011-09-27 08:47:14 -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
Jason Davies a7c318b138 Restore drag click handler to its rightful place. 2011-09-22 23:50:30 +01:00
Jason Davies 4e0edeb423 Less zealous click cancelling.
The click event is prevented from propagating when a drag has occurred
i.e. the mouse has moved between mousedown and mouseup.  This is because
a click event will be triggered after a mousedown and mouseup have
occurred on the same element.  However, we were cancelling the next
click event *anywhere*, regardless of whether mousedown and mouseup
occurred on the same element or not.

As a sanity check, we also check that the click event was triggered on
the same element that mousedown *and* mouseup occurred on, before
cancelling it.  Just in case!
2011-09-22 23:47:35 +01:00
Mike Bostock 7895afbda5 Better log ticks.
This adds support for filtering the log ticks, such that fewer ticks can be
generated to fit in a small space. This can be used in conjunction with a
custom tick format as well. This commit also changes the default log tick format
to be exponential rather than precision, for consistency.
2011-09-21 15:32:19 -07:00
Mike Bostock dbd738353d Slight optimization for previous fix. 2011-09-20 16:38:52 -07:00
Jason Davies b4c086061e Fix sort due to lack of NodeList.prototype.sort.
NodeList doesn't support .sort() directly, so we need to convert to a
real Array first.  I've done this in selectAll for efficiency i.e. this
avoids a new Array being created every time the same selection is
sorted.  However, it may be slightly more efficient to create the Array
only when sorting, to avoid unnecessary Array creation when sorting
isn't used, which is probably the common case.

Unfortunately it's difficult to test this because JSDOM uses a real
Array instead of a NodeList!
2011-09-19 09:26:25 +01:00
Mike Bostock fb38f19b2e Merge branch 'release' 2011-09-17 20:35:40 -07:00
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