d3 / d3-transition

Animated transitions for D3 selections.
https://d3js.org/d3-transition
ISC License
224 stars 64 forks source link

Can't transition path's stroke-width #50

Closed matt-ts closed 8 years ago

matt-ts commented 8 years ago

selection.transition().style("stroke-width", 10) does nothing. Here is a fiddle illustrating the problem, hovering over the red line should transition it to a wider line. https://jsfiddle.net/t26bn8k9/

I also wired in onclick to set the stroke-width without the transition, to show that this does work as expected.

For reference, here is the same example using d3.v3 and this one works. https://jsfiddle.net/v0a27zay/

Thanks, Matt

mbostock commented 8 years ago

CSS properties require units, so 10 is not a valid value; you must use '10px' instead. I didn't investigate why this worked in the past, but invalid values such as this are not supported.

matt-ts commented 8 years ago

Fabulous, thank you.