JS d3 obtained element width is less than the hardcoded value

CSS:

#full_bar {
  width: 240px;
}

JS:

console.log(d3.select('#full_bar').style('width'));

Output is ‘208px’.
If I change the hardcoded value of ‘240’ to a different one, the output is always a fixed percentage of the hardcoded value. I assume the CSS style is being overwritten, but I don’t know where. If I inspect it in the browser it says the width is 240px, and the visual bar doesn’t appear to be cropped at all.
Any advice?