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

553 Коммитов

Автор SHA1 Сообщение Дата
Mike Bostock a3ea2d0f39 Simplify. 2012-11-11 11:23:35 -08:00
Mike Bostock ea265a87e3 Remove broken mercator example. 2012-11-11 11:22:44 -08:00
Mike Bostock 1b9aa90c38 Cleanup examples. 2012-11-11 11:20:15 -08:00
Mike Bostock 84a6255236 Checkpoint example cleanup. 2012-10-11 16:34:17 -07:00
Mike Bostock d3f855ae01 Rename d3.v3.js to d3.js.
We'll still use the major-versioned name file for d3js.org, but this is simpler.
2012-10-05 18:46:05 -07:00
Mike Bostock 223d6aa715 Transition reselection.
It is now possible to reselect elements with scheduled transitions and redefine
associated tweens; this enables "post-selection" to customize the behavior of
reusable components undergoing transitions, such as an axis. This commit also
makes it much easier to sequence transitions.

Previously, a transition's tweens were stored privately by the transition and
could only be accessed through the transition. This made it impossible to modify
transitions created by components: the transition is not accessible externally,
and cannot be reselected from the document. Consider the following snippet:

  g.select(".x.axis")
      .call(xAxis)
    .selectAll("text")
      .attr("dy", null);

If `g` is a selection, then this code alters the appearance of the axis as
expected. However, if `g` is a transition, then transition.selectAll creates a
new concurrent transition, and now multiple tweens compete to set the "dy"
attribute. Oy!

Under the new design, an element's scheduled tweens are stored semi-privately on
the node (in the existing node.__transition__). Transition parameters can thus
be reselected and modified by transitions that share the same id. If you now
reselect a transitioning element, you modify the transition rather creating a
competing transition; this should be less surprising and allow greater control.

As a side-effect of this change, it is no longer possible to schedule concurrent
transitions on the same element, even with the same id: only one transition may
be active on a given element at any time. (Note that you can still schedule
multiple future transitions on the same element, and concurrent transitions on
different elements.) For example, you could previously schedule overlapping
transitions with different easing functions, delays or durations, provided you
were careful to avoid conflict. This seems like a relatively obscure use-case
compared to modifying a transition, so I believe this is a reasonable change.

This commit also changes transition.transition, such that the returned
transition starts at the end of the originating transition, rather than
overlapping. This makes it much easier to schedule sequenced transitions without
the complexity of transition.each("end") and d3.select(this).

Also, transitions are now simply arrays of nodes, consistent with selections!
2012-10-05 13:36:11 -07:00
Mike Bostock bc998554a1 Merge branch 'examples-dx' of git://github.com/jasondavies/d3 into 2.10.1 2012-09-03 19:04:34 -07:00
Mike Bostock dceb459a27 Multitouch dragging! 2012-08-31 13:11:34 -07:00
Jason Davies e5ae048b61 Remove extraneous "dx" attribute.
Thanks, @mbostock!
2012-08-20 23:25:10 +01:00
Jason Davies 7155ffa9e3 Fix use of "dx" in examples.
Compared to WebKit, this seems to be handled differently by current
versions of Firefox and Opera, perhaps due to an ambiguity in the spec.:

  http://lists.w3.org/Archives/Public/www-svg/2011Dec/0009.html
2012-08-20 22:20:44 +01:00
Mike Bostock 2d9fe177d0 Expose d3.tween. Fixes #747.
This is a little bit more verbose, but it avoids additional optional arguments
on transition.{attr,style}.
2012-08-08 17:53:46 -07:00
Mike Bostock 79a3c0d31c Merge remote-tracking branch 'origin/pack-padding' into 2.10.0 2012-08-08 17:36:40 -07:00
Mike Bostock 7ac1ae7c77 Merge remote-tracking branch 'origin/delimiter-separated-values' into 2.10.0 2012-08-08 17:36:01 -07:00
Mike Bostock f06934831d Merge remote-tracking branch 'origin/transition-interpolate' into 2.10.0
Conflicts:
	src/core/interpolate.js
2012-08-08 17:32:32 -07:00
Mike Bostock 91630afcab Revert piecewise interpolation for transforms.
Rather than adopting CSS’s elaborate rules for detecting when the start and end
transform are the same type as using piecewise (i.e., string-based)
interpolation, we always use the consolidated transform transition. If you want
to use string-based interpolation, simply specify d3.interpolateString as the
interpolator. Fixes #746.
2012-08-04 12:13:16 -07:00
Mike Bostock b484273b46 Add test for rotate-origin transitions. 2012-08-01 14:29:21 -07:00
Mike Bostock 540d3ace3e Fix polar clock example.
The shortest-path interpolation for HSL was causing all the bars to be the same
color. Switching to string-interpolation preserves the original behavior.
2012-07-31 14:54:04 -07:00
Mike Bostock b878f258e0 Merge branch 'transform-null' of git://github.com/jasondavies/d3 into 2.9.7
Conflicts:
	examples/transform/test-rotate.html
	src/core/interpolate.js
2012-07-31 14:46:28 -07:00
Mike Bostock 06deb8f86b Don't use shortest-path for same-type transitions.
If the transform transition isn't the same type, then we can use the shortest-
path for rotate transitions. But, if the transforms are the same type, then we
should use the simpler string interpolation without the shortest-path.
2012-07-31 13:56:18 -07:00
Jason Davies 20d38f8211 Update transform/test-rotate.
We no longer pick the shortest path for same type transitions.
2012-07-31 16:15:30 +01:00
Jason Davies 11e1efa3a3 Same type transforms: support matrix functions. 2012-07-31 14:51:49 +01:00
Jason Davies ed131d2374 Add support for interpolating null transform lists.
For consistency with CSS3 [1], a null "from" or "to" transform list is
replaced by an identity function list whose types match those of the
non-null transform list.

[1]: http://www.w3.org/TR/css3-transforms/#animation
2012-07-31 13:01:45 +01:00
Mike Bostock b4d799375d Use shortest path even for large angles. 2012-07-31 00:38:13 -07:00
Mike Bostock 43360e48ff Merge branch 'linear-closed-interpolation' into 2.9.7 2012-07-31 00:30:31 -07:00
Mike Bostock f0c5c46885 Undo changes to transform/test-rotate. 2012-07-30 23:43:35 -07:00
Mike Bostock 62d18a111e Merge branch 'fix-us-counties' into 2.9.7 2012-07-30 23:39:40 -07:00
Mike Bostock ef8672cb7d Condense d3.interpolateTransform slightly.
Also, fix the transform rotate test.
2012-07-30 19:42:32 -07:00
Mike Bostock e0275d537f Merge counties into MultiPolygons as needed.
Fixes #620. Also adds county names.
2012-07-30 17:05:24 -07:00
Jason Davies 839fcd4d4d Interpolate "same type" transforms in isolation.
For consistency with CSS3's 2D transforms, two transforms with the same
number of transform functions and corresponding functions of the same
type are treated differently: each transform function is interpolated in
isolation.

This allows us to interpolate many transforms that contain constant
functions in a more useful way, e.g.

  "rotate(<variable>)translate(<constant>)"

The variable rotation angle would now be linearly interpolated on its
own, keeping the constant translation vector constant.
2012-07-24 18:45:52 +01:00
Mike Bostock 544addb462 Fix node-canvas example. 2012-07-13 09:02:12 -07:00
Mike Bostock 8c9fed492b Add linear-closed interpolation. Fixes #610. 2012-07-04 11:22:08 -07:00
Mike Bostock 66b439d433 Add d3.tsv for tab-separated values.
This makes the previous d3.csv code a bit more generic via a d3_dsv (delimiter-
separated values) module generator. Fixes #501. (Thanks, @vlandham!)
2012-06-28 12:58:39 -07:00
Mike Bostock 47adcf5d09 Add padding to d3.layout.pack.
The previous method of subtracting slightly from the radius introduces
distortion where smaller circles are disproportionately reduced. For example,
subtracting 1px from the radius scales a circle of radius 5px by 0.64x, while a
circle of radius 50px is only reduced by 0.96x.

By incorporating padding into the layout algorithm, the leaf circles’ area is
still proportional to the associated value. Due to the scale-independent nature
of the layout, the specified padding value is only approximate.
2012-06-27 20:20:22 -07:00
Mike Bostock 8598dc40bf More robust fix to d3.interpolateTransform. 2012-06-24 10:43:13 -07:00
Mike Bostock 4059d3b3f5 Fix #661; d3.interpolateTransform for rotate. 2012-06-21 17:35:23 -07:00
Jason Davies 234c834d81 Add missing semicolon to mercator example. 2012-05-10 23:23:31 +01:00
Mike Bostock cdffe18d38 Fix two errors in examples. 2012-04-15 14:30:52 -07:00
Kristofer Monisit df1bacfedc Bring zoom example up-to-date 2012-04-07 12:36:20 +08:00
Kristofer Monisit a5b94849c9 Bring voronoi example up-to-date 2012-04-07 12:34:26 +08:00
Kristofer Monisit 29ece588f0 Bring voroboids examples up-to-date 2012-04-07 12:33:34 +08:00
Kristofer Monisit 30ad8bcc55 Bring treemap examples up-to-date 2012-04-07 12:30:46 +08:00
Kristofer Monisit d4b0939ba1 Bring tree examples up-to-date 2012-04-07 12:29:53 +08:00
Kristofer Monisit c5465cad02 Bring transform example up-to-date 2012-04-07 10:03:58 +08:00
Kristofer Monisit 2fc903b550 Bring superformula examples up-to-date 2012-04-07 09:59:56 +08:00
Kristofer Monisit 8b775c032c Bring stream examples up-to-date 2012-04-07 09:48:52 +08:00
Kristofer Monisit 30e81f0eae Bring splom example up-to-date 2012-04-07 09:39:35 +08:00
Kristofer Monisit 3fd8ce2060 Bring spline example up-to-date 2012-04-07 09:35:35 +08:00
Kristofer Monisit d5585fb8dd Bring sort example up-to-date 2012-04-07 09:33:30 +08:00
Kristofer Monisit 82af78cbd3 Bring showreel example up-to-date 2012-04-07 09:26:49 +08:00
Kristofer Monisit 003dd7dd76 Bring rollup example up-to-date 2012-04-07 09:21:04 +08:00