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

36 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock 9c3df31216 Demote JSDOM to development dependency; fix #2190.
Code that previously assumed a global document or window now uses the related
node’s ownerDocument or ownerDocument.defaultView as appropriate.

If no related node is available, the corresponding code will crash; however, the
rest of D3 will work just fine. For example, you can’t use d3.select(string)
unless a global document is available; it just doesn’t make sense. Use
d3.select(node) instead, followed by selection.select(string).

Code that previously checked for a global on the window (e.g., XDomainRequest)
now uses the global context (`this`) rather than the window.
2015-02-06 22:41:51 -08:00
Mike Bostock 4e4709ce47 Fix selection.interrupt.
Even if no further transitions are scheduled on the element, we must still
advance the active counter to interrupt the active transition. Fixes #2165. Also
added better tests that verify interruption.
2014-12-30 09:03:54 -08:00
Mike Bostock d316211810 Better interruption semantics.
When a transition is interrupted, the interrupt event is dispatched immediately
(such as within a call to selection.interrupt). This is easier to understand and
guarantees that the interrupt event on an interrupted transition is dispatched
prior to the start event on an interrupting transition, fixing #2140.

Calling selection.interrupt repeatedly no longer cancels any scheduled (but
inactive) transitions, fixing #2141. Calling selection.interrupt when there is
no active transition now has no effect.

An interrupt event is only dispatched if the active transition is interrupted,
and not if a scheduled transition was cancelled, as when a delayed transition is
superceded by an earlier transition on the same element. These transitions are
cancelled silently, fixing #2144.

Lastly, transition event listeners now see the latest bound data, rather than
using the data that was captured shortly after the transition was scheduled.
Fixes #2142.
2014-12-08 10:39:53 -08:00
Mike Bostock 1398d4d8a3 Simplify benchmark. 2014-10-16 23:22:56 -07:00
Mike Bostock 4222a62983 Add @jfirebaugh’s benchmark. 2014-10-14 10:15:38 -07:00
Mike Bostock f38ed05731 Fix for JSDOM update. 2014-10-09 12:16:04 -07:00
Mike Bostock 2d83168df3 Merge remote-tracking branch 'origin/enter-size' into 3.4.12 2014-10-08 07:45:27 -07:00
Jason Davies a35000b744 Fix #2043: selection.enter.size. 2014-10-03 22:05:25 +01:00
Yves Le Maout b5ddd2b07b Update to JSDom 1.0.0
To fix this issue : https://github.com/petkaantonov/bluebird/issues/291
2014-10-02 13:28:44 +02:00
Jason Davies 54ca304673 selection.classed: coerce name to string.
Fixes #1625.
2014-06-30 11:42:01 +01:00
Mike Bostock 0a12e31fe2 Fix #1664 - empty classed string.
The regex used for split was returning [""] for the input "", rather than [].
2013-12-13 15:57:10 -08:00
Mike Bostock fc5a586414 Fix missing d3.transition in IE. Fixes #1491.
IE doesn’t support __proto__ patching, so if the selection.prototype.transition
method isn’t yet defined at the time d3_selectionRoot is defined, it won’t
inherit the method when the prototype is patched later! This restores the
original order of dependencies so that the transition method is defined before
d3_selectionRoot is created.
2013-08-26 22:39:58 -07:00
Mike Bostock e7e6c3a616 Fix #1410 - add selection.interrupt.
This also changes the imports so that it’s possible to build a version of D3
with selections but without transitions.
2013-08-12 16:33:20 -07:00
Mike Bostock 9192c11ba9 Fix #1431 - sort with null nodes. 2013-07-31 11:00:11 -07:00
Mike Bostock 8c5558a6ba Color interpolators return strings.
This partially reverts ce6526cfe3. Although this
lacks the occasional convenience of a color instance, it has several advantages:
strings are immutable, so there is no concern of modifying the return value
(#1030); performance is improved; sometimes (e.g., Canvas, IE9 #1371) automatic
string coercion of values is unavailable, so strings are more convenient.
2013-07-18 23:08:56 -04:00
Mike Bostock 87799fece4 Merge branch 'interpolate-color' into 3.2.4 2013-07-05 11:19:04 -07:00
Mike Bostock ce6526cfe3 Color interpolators return color instances.
Fixes #1029. Previously, these interpolators returned RGB hexadecimal strings,
as the intent was for the color to be used to set attributes and styles.
However, since #333, all colors return RGB hexadecimal strings when coerced to a
string, so we can get the equivalent behavior by returning a color instance
rather than a string. Returning a color instance is also more useful in the case
where additional color manipulation (such as brighter/darker) is desired.
2013-07-05 11:18:06 -07:00
Mike Bostock 27a7252dce Merge branch 'master' into enter-insert-in-order
Conflicts:
	src/selection/insert.js
2013-07-03 10:08:27 -07:00
Mike Bostock 6fa6e04ab6 Remember last non-null following sibling.
This way, we don’t rescan the same null elements.
2013-07-02 21:09:53 -07:00
Mike Bostock 99f6e65769 Fix test and add symmetric test for append. 2013-07-02 10:28:23 -07:00
Mike Bostock 2f4c228b65 Simplify test. 2013-07-02 10:23:30 -07:00
Mike Bostock 51d4d0ac7d Add test for enter-insert. 2013-07-02 10:22:18 -07:00
Mike Bostock a27d2d3600 Test for append(function). 2013-06-30 10:50:57 -07:00
Mike Bostock 0b83ad6315 Add tests for transition.{size,node}. 2013-06-20 08:52:00 -07:00
Mike Bostock 1221458a73 Add selection.size. Fixes #1177. 2013-05-30 12:26:24 -07:00
Mike Bostock 9120507d47 Fix #1220 #1218 re. d3.select and d3.selectAll.
This commit fixes d3.select so that it no longer propagates data from the
document element to the selected node when a selector is used. This commit also
fixes d3.select and d3.selectAll such that the returned selection’s group’s
parent node is set to the document element.
2013-04-30 14:49:33 -07:00
Mike Bostock b96e4e3363 Select the document element, not the document.
Fixes #1219.
2013-04-30 14:12:02 -07:00
Mike Bostock 0d7c6c55e7 Use _ to disambiguate local vs. global d3. 2013-03-14 15:14:12 -07:00
Mike Bostock 68be0ac8c8 Rename assert and XMLHttpRequest. 2013-03-14 13:00:04 -07:00
Mike Bostock 4c3469d336 Refactor selection tests for better isolation.
Fixes #939.
2013-03-14 12:36:21 -07:00
Mike Bostock 36c59cd233 Fix two failing assert.throws.
Since smash.load uses a separate context, any exceptions it throws use a
different Error class, and thus the assert.throws fails. So, instead, just allow
any exception type to be thrown.
2013-03-14 10:58:17 -07:00
Jason Davies dd971666a6 Refactor selection tests for minimal loading. 2013-03-14 17:25:23 +00:00
Mike Bostock 608902c907 Checkpoint test refactoring. 2013-03-13 23:21:23 -07:00
Mike Bostock 5c4282f51a Don't import index; move ns to core. 2013-03-13 13:58:41 -07:00
Jason Davies 9d1925012d Support for {selection,dispatch}.on(".foo", null).
This allows all listeners with a particular name to be removed.

Fixes #880.
2013-03-13 12:15:17 +00:00
Mike Bostock 58dc604177 Move tests to match new source structure. 2013-03-13 02:08:02 -07:00