Transform tween
HTML
<script src="http://d3js.org/d3.v3.js"></script>
<script src="http://d3js.org/d3.v3.js"></script>
CSS
div{background-color:skyblue}
JavaScript
d3.select('body')
.append('div')
.style({
width: '50px',
height: '200px'
})
.transition()
.call(customStyleTween, 'transform', 'translate(0px, 0px)')
.transition()
.call(customStyleTween, 'transform', 'translate(100px, 0px)');
function customStyleTween(transition, name, value) {
transition.styleTween(name, function() {
return d3.interpolateString(this.style[name], value);
});
}