title: stacking transforms in D3
body: <p>I have an SVG element with a transform already applied to it (this could be a single translate, or a combination of multiple transforms). I'm trying to apply additional transform to it. Problem is that this transform could be applied repeatedly and needs to stack with the existing transform state (so appending additional transforms to the end is not practical). Looking through d3 API, I didn't notice anything that lets me apply a relative transform (although I must admit, I'm not that familiar with advanced features of d3). Manually parsing the current transform string and then computing the same transformation matrix that SVG already does behind the scenes for free seems silly, is there a better way?</p>
  
  <p>For example, if existing element already has the following attribute:</p>
  
  <pre><code>transform="translate(30) rotate(45 50 50)"
  </code></pre>
  
  <p>And I invoke this transformation logic twice, wanting to offset the element by 1 pixel in each dimension each time, I would need to parse and process both, the translate and rotate calls, because the new translations cannot be applied prior to rotation.</p>