title: D3 selective Zoom
body: <p>I am working on a force directed graph layout with some added features: selectable links/nodes, tooltips, fisheye effect, and -- important for my question -- zoom and pan.</p>
  
  <p>Now, the zooming works very well like this:</p>
  
  <pre><code>d3 ... .append('svg:g').call(d3.behavior.zoom().on("zoom", redraw))... 
  </code></pre>
  
  <p>Where the redraw function looks like this...</p>
  
  <pre><code>function redraw() {
    trans = d3.event.translate;
    scale = d3.event.scale;
    vis.attr("transform", "translate(" + trans + ")" + " scale(" + scale + ")");
  }
  </code></pre>
  
  <p>However, this method zooms the entire SVG graphic, including font sizes, graph edges, the line stroke-widths surrounding the nodes, etc.</p>
  
  <p>Is it somehow possible <em>not</em> to zoom certain elements? The only solution I have seen so far is to put a line like this (took it from here <a href="http://jsfiddle.net/56RDx/2/" rel="nofollow">http://jsfiddle.net/56RDx/2/</a>) </p>
  
  <pre><code>node.attr("font-size", (nodeFontSize / d3.event.scale) + "px");
  </code></pre>
  
  <p>in the redraw method, to basically invert the zooming on certain elements on the fly. My problem is however (apart from this being an ugly hack), that my edge-widths are dynamically generated on graph-drawing (according to some graph properties...), so this 'invertion' method does not work...</p>