anchor.diff:      // process.
       graph = copyAndInitGraph(graph);
   
  -    // Create zoom elements
  -    var svg = this.zoomSetup(graph, orgSvg);
  +    // Create zoom elements.
  +    final svg = zoomSetup(graph, orgSvg);
   
       // Create layers
       svg
         .selectAll('g.edgePaths, g.edgeLabels, g.nodes')
         .data(['edgePaths', 'edgeLabels', 'nodes'])
         .enter()
  -        .append('g')
  -        .attr('class', (d) { return d; });
  +        ..append('g')
  +        ..attr('class', (d) { return d; });
   
       // Create node and edge roots, attach labels, and capture dimension
       // information for use with layout.
  -    var svgNodes = this.drawNodes(graph, svg.select('g.nodes'));
  -    var svgEdgeLabels = this.drawEdgeLabels(graph, svg.select('g.edgeLabels'));
  -
  -    svgNodes.each((u) { calculateDimensions(this, graph.node(u)); });
  -    svgEdgeLabels.each((e) { calculateDimensions(this, graph.edge(e)); });
  +    final svgNodes = drawNodes(graph, svg.select('g.nodes'));
  +    final svgEdgeLabels = drawEdgeLabels(graph, svg.select('g.edgeLabels'));
  +
  +    svgNodes.each((Element node, Object u, int i, int j) {
  +      calculateDimensions(this, graph.node(u));
  +    });
  +    svgEdgeLabels.each((Element node, Object e, int i, int j) {
  +      calculateDimensions(this, graph.edge(e));
  +    });
   
       // Now apply the layout function
  -    BaseGraph result = runLayout(graph, this.layout);
  +    BaseGraph result = runLayout(graph, layout);
   
       // Copy useDef attribute from input graph to output graph
  -    graph.eachNode((u, a) {
  -      if (a.useDef) {
  -        result.node(u).useDef = a.useDef;
  +    graph.eachNode((u, Map a) {
  +      if (a.containsKey('useDef')) {
  +        result.node(u)['useDef'] = a['useDef'];
         }
       });
   
       // Run any user-specified post layout processing
  -    this.postLayout(result, svg);
  -
  -    var svgEdgePaths = this.drawEdgePaths(graph, svg.select('g.edgePaths'));
  +    postLayout(result, svg);
  +
  +    final svgEdgePaths = drawEdgePaths(graph, svg.select('g.edgePaths'));
   
       // Apply the layout information to the graph
  -    this.positionNodes(result, svgNodes);
  -    this.positionEdgeLabels(result, svgEdgeLabels);
  -    this.positionEdgePaths(result, svgEdgePaths, orgSvg);
  -
  -    this.postRender(result, svg);
  +    positionNodes(result, svgNodes);
  +    positionEdgeLabels(result, svgEdgeLabels);
  +    positionEdgePaths(result, svgEdgePaths, orgSvg);
  +
  +    postRender(result, svg);
   
       return result;
     }
   }
   
  -copyAndInitGraph(BaseGraph graph) {
  -  var copy = graph.copy();
  +BaseGraph copyAndInitGraph(BaseGraph graph) {
  +  final copy = graph.copy();
   
     if (copy.graph() == null) {
       copy.graph({});
     }
   
     if (!(copy.graph().containsKey('arrowheadFix'))) {
  -    copy.graph().arrowheadFix = true;
  -  }
  -
  -  // Init labels if they were not present in the source graph
  +    copy.graph()['arrowheadFix'] = true;
  +  }
  +
  +  // Init labels if they were not present in the source graph.
     copy.nodes().forEach((u) {
  -    var value = copyObject(copy.node(u));
  +    final value = copyObject(copy.node(u));
       copy.node(u, value);
  -    if (!(value.containsKey('label'))) { value.label = ''; }
  +    if (!(value.containsKey('label'))) {
  +      value['label'] = '';
  +    }
     });
   
     copy.edges().forEach((e) {
       var value = copyObject(copy.edge(e));
       copy.edge(e, value);
  -    if (!(value.containsKey('label'))) { value.label = ''; }
  +    if (!(value.containsKey('label'))) {
  +      value['label'] = '';
  +    }
     });
   
     return copy;
   }
   
  -copyObject(Map obj) {
  +Map copyObject(Map obj) {
     var copy = {};
     for (var k in obj.keys) {
       copy[k] = obj[k];
  
positive.code:   return obj is svg.PolygonElement;
  }
  
  intersectNode(nd, p1, root) {
    if (nd.useDef) {
      var definedFig = root.select('defs #' + nd.useDef).node();
      if (definedFig) {
        var outerFig = definedFig.childNodes[0];
        if (isCircle(outerFig) || isEllipse(outerFig)) {
          return intersectEllipse(nd, outerFig, p1);
  
negative.code:     final bbox = root.node.getBBox();
  
      rect
        ..attr('rx', node.containsKey('rx') ? node['rx'] : 5)
        ..attr('ry', node.containsKey('ry') ? node['ry'] : 5)
        ..attr('x', -(bbox.width / 2 + marginX))
        ..attr('y', -(bbox.height / 2 + marginY))
        ..attr('width', bbox.width + 2 * marginX)
        ..attr('height', bbox.height + 2 * marginY)
        ..attr('fill', '#fff');
  
      if (addingNode) {
        applyStyle(node['style'], rect);
  