Skip to content
Browse files

Add Transition#attr and #attrTween

  • Loading branch information...
1 parent d59b189 commit c5fc10e1d3c9259483960ef32b440e5762c6568d @Phrogz committed Mar 19, 2012
Showing with 44 additions and 0 deletions.
  1. +29 −0 methods/d3-Transition-attr.yaml
  2. +15 −0 methods/d3-Transition-attrTween.yaml
View
29 methods/d3-Transition-attr.yaml
@@ -0,0 +1,29 @@
+---
+- method: d3/Transition/attr§value
+ returns: d3/Transition
+ summary: Transition an attribute to a value.
+ url: https://github.com/mbostock/d3/wiki/Transitions#wiki-attr
+ seealso:
+ - d3/Transition/attr§get
+ - d3/Transition/attr§func
+ - d3/Selection/attr§value
+ params:
+ - name: name
+ kind: js/String
+ - name: value
+ kind: js/String
+ summary: Non-string values (e.g. a number like `10`) are coerced to strings before setting.
+- method: d3/Transition/attr§func
+ returns: d3/Transition
+ summary: Transition an attribute value based on data.
+ url: https://github.com/mbostock/d3/wiki/Transitions#wiki-attr
+ seealso:
+ - d3/Transition/attr§get
+ - d3/Transition/attr§value
+ - d3/Selection/attr§func
+ params:
+ - name: name
+ kind: js/String
+ - name: func
+ kind: js/Function
+ summary: Invoked for each element in the transition selection, passed the current datum and index, with the `this` context as the current DOM element. The function's return value is used to set each attribute's value at the end of the transition. A `null` value will **not** remove the specified attribute.
View
15 methods/d3-Transition-attrTween.yaml
@@ -0,0 +1,15 @@
+---
+method: d3/Transition/attrTween§value
+returns: d3/Transition
+summary: Transition an attribute to a value.
+url: https://github.com/mbostock/d3/wiki/Transitions#wiki-attrTween
+seealso:
+- d3/Transition/attr§get
+- d3/Transition/attr§func
+- d3/Selection/attr§value
+params:
+- name: name
+ kind: js/String
+- name: tweenCalculator
+ kind: js/Function
+ summary: Invoked for each element in the transition selection at the start of the transition, passed the current datum, index, and current (pre-transition) attribute value, with the `this` context as the current DOM element. This function must then return a _tween interpolator function_ to use during the transition; the interpolator will be passed parameterized time in the domain `[0,1]` and must return the desired attribute value.

0 comments on commit c5fc10e

Please sign in to comment.
Something went wrong with that request. Please try again.