I am assigning artificial attributes to a SVG-G element (SVG group object). I move the group with its content with SVG transformations and I store the x/y coordinates of the group and its width/height in those attributes.
I am using the D3 Javascript library and the call :
embeddedElemContainer = nodeBoxContainer.append('svg:g')
.attr('x', x)
.attr('y', y)
.attr('width', width)
.attr('height', height)
results in following object :
<g transform="translate(13.585786437626904,31.585786437626904)" x="13.585786437626904" y="31.585786437626904" width="43.00000000000001" height="0"></g>
This is Ok, the only ting bothering me is the fact, that the attribute values are stored as string. If I want to use them for some computation, I am forced to cast.
parseInt(@embeddedElemContainer.attr('x'))
Is there a way to store those values directly as integer/double ?