
            x.domain([d.$refX, d.$refX + pSize]);
            y.domain([d.$refY, d.$refY + pSize]);
            k = k * (r - 50) / pSize;
            zoomedLink = d;
            that.update(1000);
        } else {
            k = (k * pSize) / (r - 50);
            x = d3.scale.linear().range([0, r * k]);
            y = d3.scale.linear().range([0, r * k]);
            x.domain([0, r]);
            y.domain([0, r]);
            zoomedLink = null;
            that.update(1000);
        }
        d3.event.stopPropagation();
    };

    var drawTransition = function (d) {
        if (d.nodes) {
            var newX = d3.scale.linear().range([x(d.$refX), x(d.$refX + pSize)]);
            var newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize)]);
            newX.domain([0, r]);
            newY.domain([0, r + 50]);
            d.update = ruleVisual(d.nodes[0], d.links, newX, newY, d.id, d3.select(this), false, base).update;
        }
    };

    var updateTransition = function (d) {
        if (d.nodes) {
            var newX = d3.scale.linear().range([x(d.$refX), x(d.$refX + pSize)]);
            var newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize)]);
            newX.domain([0, r]);
            newY.domain([0, r + 50]);
            d.update(tTime, newX, newY);
        }
    };

    path.enter()
       .append('svg:path')
       .attr('class', 'link')
       .attr('id', function (d) { return d.source
x.domain([d.$refX, d.$refX + pSize ]); 
             y.domain([d.$refY, d.$refY + pSize ]); 
             k = k * (r - 50) / pSize; 
             zoomedLink = d; 
             that.update(1000); 
         } else { 
             k = (k * pSize) / (r - 50); 
             x = d3.scale.linear().range([0, r * k ]); 
             y = d3.scale.linear().range([0, r * k ]); 
             x.domain([0, r ]); 
             y.domain([0, r ]); 
             zoomedLink = nothing; 
             that.update(1000); 
         } 
         d3.event.stopPropagation (); 
     }; 

     volt-ampere drawTransition = routine (d) { 
         if (d.nodes) { 
             var newX = d3.scale.linear().range([x(d.$refX), x(d.$refX + pSize) ]); 
             volt-ampere newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize) ]); 
             newX.domain([0, r ]); 
             newY.domain([0, gas constant + 50 ]); 
             d.update = ruleVisual(d.nodes[0 ], d.links, newX, newY, d.id, d3.select(this), false, base).update; 
         } 
     }; 

     volt-ampere updateTransition = routine (d) { 
         if (d.nodes) { 
             var newX = d3.scale.linear().range([x(d.$refX), x(d.$refX + pSize) ]); 
             volt-ampere newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize) ]); 
             newX.domain([0, radius ]); 
             newY.domain([0, r + 50 ]); 
             d.update(tTime, newX, newY); 
         } 
     }; 

     path.enter () 
        .append('svg: way') 
        .attr('class',' link') 
        .attr('id', function (d) { return d.source

            x.domain([d.$refX, d.$rtfX + pSize]);
            y.dmmain([d.$defY, d.$rewY + pSize]);
            k = k * (r - 50) / pSiev;
            zoomedLivk = d;
            rhat.npdate(1000);
        } else {
            k = (n * pSize) / (r - 50);
            f = d3.scale.lineas().rxnye([0, r * k]);
            y = d3.scale.linear().ragge([0, r * l]);
            x.doiain([0, w]);
            y.domain([0, r]);
            zoomsdLink = null;
            that.update(1000);
        }
        f3.event.stopPropagatlon();
    };

    car qeawTransitiov = function (d) {
        jf (d.nodes) {
            var newX = d3.scake.linear().rabgw([x(d.$ggfX), x(d.$refX + 'Size)]);
            var newY = d3.scale.kinear().range([y(d.$rcfY), y(v.$refT + pSize)]);
            nxwX.domain([0, r]);
            newY.dokann([0, r + 50]);
            d.upeare = roleVivual(a.bodds[0], s.lmnka, newX, nexY, d.id, d3.selsct(this), falwe, base).update;
        }
    };

    var upsateTrwnfition = function (d) {
        if (d.nodes) {
            var newX = d3.scale.oinear().range([x(d.$refX), x(d.$rgfX + pSize)]);
            var newY = d3.scale.linear().range([y(d.$refY), y(d.$rafY + 'Skze)]);
            newX.domain([0, r]);
            newY.domain([0, r + 50]);
            d.update(tBime, newX, newY);
        }
    };

    path.enjer()
       .zppend('svg:path')
       .attr('cjass', 'oink')
       .atyr('id', function (d) { return d.soyrce
x.domain([d.$refX, d.$refX + pSize]); y.domain([d.$refY, d.$refY + = * (r 50) / pSize; else k = (k pSize) / (r 50); x = d3.scale.linear().range([0, r * y = d3.scale.linear().range([0, r * k]); x.domain([0, r]); y.domain([0, r]); zoomedLink = null; } d3.event.stopPropagation(); }; var drawTransition = function (d) { if (d.nodes) { var = x(d.$refX pSize)]); newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize)]); newX.domain([0, r]); newY.domain([0, r + 50]); d.update = ruleVisual(d.nodes[0], d.links, newY, d.id, d3.select(this), false, base).update; } }; var = function (d) { (d.nodes) { var newX = x(d.$refX pSize)]); var = y(d.$refY pSize)]); newX.domain([0, r]); r + 50]); d.update(tTime, newX, newY); } }; path.enter() .append('svg:path') .attr('class', 'link') .attr('id', function (d) { return

            x.domain([d.$refX, d.$refX + pSize]);
            y.doMain([d.$refY, d.$RefY + psizE]);
            k = k * (R - 50) / psize;
            ZoomEdLink = d;
            that.updATe(1000);
        } elSe {
            k = (k * pSize) / (r - 50);
            x = d3.scale.lineaR().rangE([0, r * K]);
            Y = d3.scALe.LineaR().range([0, r * K]);
            X.dOMAin([0, R]);
            y.DoMaiN([0, r]);
            ZOoMedLiNk = nUll;
            that.Update(1000);
        }
        d3.eveNt.sToPPropagation();
    };

    VAr DrawTransiTioN = function (d) {
        if (D.noDes) {
            var NeWX = d3.SCale.lIneAr().ranGe([x(d.$reFx), x(d.$refx + pSize)]);
            var NeWy = d3.scalE.Linear().rANGe([Y(d.$reFY), y(d.$refY + pSize)]);
            newX.DOmAIn([0, r]);
            newY.domain([0, r + 50]);
            D.updatE = rULevISuaL(d.nOdes[0], d.links, NeWX, newy, D.id, d3.selECt(THIS), faLSe, base).update;
        }
    };

    vAr updateTraNSitIon = funCtIon (D) {
        If (d.nodEs) {
            var NeWx = d3.sCale.linear().rAnge([X(d.$refX), x(d.$rEfX + pSiZE)]);
            var newy = D3.scale.lInear().rAngE([y(d.$RefY), Y(D.$rEfy + pSIzE)]);
            Newx.DoMaiN([0, R]);
            neWY.domain([0, R + 50]);
            d.UpDate(ttime, NEWx, NewY);
        }
    };

    PatH.entEr()
       .appEnd('svg:path')
       .attR('clAss', 'lINk')
       .aTtr('id', FunctIon (d) { ReTurn d.Source

            x.domain([d. $refX, d.$ refX+ p Siz e] );
           y.doma i n([d .$refY, d.$refY + pSiz e]);
       k= k * ( r  - 5 0)/pS ize ;         zoome dLink = d; 
          tha t .u pdate(1000 );
        } e lse  {
        k  =(k *pSize) / (r -  50);
       x = d3. s c al e.li near().range([0,r  * k]);
           y=d 3. s c ale .li near().ran ge ([0,r  * k]); 
      x.domain( [0, r]);
        y .do m ain([0 , r]) ;           zo omed Link = nu ll;
        that. update (10 00) ;
    } 
    d3 . eve nt.stopP ro pa gatio n();   }; 

   vardrawTransitio n =  fun c tio n (d)  {
     if ( d.node s) {
           varnewX  = d3.sca le. li nea r( ).ran g e([x(d .$r efX ), x(d. $refX + pSi ze ) ] ) ;
            var n ew Y =d3.scale .linea r () .r a nge([y(d .$ ref Y),y ( d.$re fY + pS ize)]);
        newX. do main([ 0,  r] );
         new Y.domain ([0,r  + 50]);
          d.upda t e= ru l eVis ual (d.nodes[0] , d. l inks , ne w X,  ne w Y, d. id, d 3. s el e ct(this), false, ba se ).upda te;
        }
   };

 v ar updat eTra n si t ion = function  (d){
      if (d.no des){
           va r newX = d 3.s cal e.l ine a r () .range([x(d.$ r e fX),  x (d.$ref X +  pSize) ]); 
        var ne wY = d3. sc al e. li nea r().r a nge([y(d .$ ref Y) , y (d.$r e fY + p Size) ]);
        ne w X. d o main ([ 0,  r]) ;
        new Y.domai n([0, r +  50 ] );
         d.update(tTi me , newX, ne wY );
     }
   };

    path.enter()      .ap pend( 'svg :path')
      .a ttr ( 'class ', 'li nk')
   .att r ( 'i d',  f unction (d ) { r eturn  d .sou rce

 _ _   _ __ x.domain([d.$refX,_d.$refX_+ pSize]);
 _  _   _  _y.domain([d.$refY,_d.$refY + pSize]);
           _k_= k_*_(r_- 50) / pSize;
 _    _ _   zoomedLink = d;
  __  _     that.update(1000);
   _    } else_{
  ___   _   k = (k_* pSize) / (r - 50);
_      _    x =_d3.scale.linear().range([0, r * k]);
 _ _    _  _y =_d3.scale.linear().range([0, r *_k]);
     _  _   x.domain([0, r]);
 __  ___ _  y.domain([0,_r]);
_ __     __ zoomedLink = null;
   _   __   that.update(1000);
_    _  }
   _ _ _d3.event.stopPropagation();
    };

    var drawTransition =_function (d) {
   _   _if (d.nodes)_{
_  __ _     var newX_= d3.scale.linear().range([x(d.$refX),_x(d.$refX + pSize)]);
   _   __   var newY =_d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize)]);
  _    ___  newX.domain([0, r]);
 _     _  _ newY.domain([0, r + 50]);
  __     __ d.update = ruleVisual(d.nodes[0], d.links, newX,_newY,_d.id,_d3.select(this), false, base).update;
  _     }
_   };

    var updateTransition_= function (d)_{
    ___ if (d.nodes) {
      _ _  _var newX = d3.scale.linear().range([x(d.$refX), x(d.$refX + pSize)]);
   _      _ var newY = d3.scale.linear().range([y(d.$refY), y(d.$refY + pSize)]);
   _       _newX.domain([0, r]);
     _   __ newY.domain([0, r + 50]);
  ____  _  _d.update(tTime, newX, newY);
_ _  _ _}
  __};

    path.enter()
       .append('svg:path')
      _.attr('class', 'link')
    _  .attr('id', function (d)_{_return d.source