Created
May 30, 2017 16:59
-
-
Save carolina-vallejo/ca8ef3c2cfeddcb496ccdc9810724c84 to your computer and use it in GitHub Desktop.
get width in d3
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
console.log('<br>Computed style width as pixels: '); | |
console.log(node.style('width')); | |
console.log('<br>Computed style width as a number: '); | |
console.log(parseFloat(node.style('width'))); | |
console.log('<br>As a percent: '); | |
console.log(node.node().style.width); | |
console.log('<br>Actual width as number: '); | |
console.log(node.node().offsetWidth); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment