         dataSet = @get("data")
     if !dataSet
         return
-    width = 750
-    height = 450
-    radius = Math.min(width, height) / 2
-    radiuso = 135
-    radiusi = 90
-    color = d3.scale.category20()
-    pie = d3.layout.pie()#.sort(null)
-    arc = d3.svg.arc().innerRadius(radiusi).outerRadius(radiuso)#.innerRadius(radius - 100).outerRadius(radius - 50)
-    svg = d3.select(@node).append('svg').attr('width', width).attr('height', height).append('g').attr('transform', 'translate(' + width / 2 + ',' + height / 2 + ')')
+    @width = 750
+    @height = 450
+    @radius = Math.min(@width, @height) / 2
+    @radiuso = 135
+    @radiusi = 90
+    @color = d3.scale.category20()
+    @pie = d3.layout.pie()#.sort(null)
+    @arc = d3.svg.arc().innerRadius(@radiusi).outerRadius(@radiuso)
+    @svg = d3.select(@node).append('svg').attr('width', @width).attr('height', @height).append('g').attr('transform', 'translate(' + @width / 2 + ',' + @height / 2 + ')')
     console.log 'update pie', dataSet
     that = this
-    piedata = pie(dataSet[0].value)
+    piedata = @pie(dataSet[0].value)
     console.log 'update pie', piedata
     #create a marker element if it doesn't already exist
-    defs = svg.select('defs')
+    defs = @svg.select('defs')
     if defs.empty()
-      defs = svg.append('defs')
+      defs = @svg.append('defs')
     marker = defs.select('marker#circ')
     if marker.empty()
       defs.append('marker').attr('id', 'circ').attr('markerWidth', 6).attr('markerHeight', 6).attr('refX', 3).attr('refY', 3).append('circle').attr('cx', 3).attr('cy', 3).attr 'r', 3
     #Create/select <g> elements to hold the different types of graphics
     #and keep them in the correct drawing order
-    pathGroup = svg.select('g.piePaths')
+    pathGroup = @svg.select('g.piePaths')
     if pathGroup.empty()
-      pathGroup = svg.append('g').attr('class', 'piePaths')
-    pointerGroup = svg.select('g.pointers')
+      pathGroup = @svg.append('g').attr('class', 'piePaths')
+    pointerGroup = @svg.select('g.pointers')
     if pointerGroup.empty()
-      pointerGroup = svg.append('g').attr('class', 'pointers')
-    labelGroup = svg.select('g.labels')
+      pointerGroup = @svg.append('g').attr('class', 'pointers')
+    labelGroup = @svg.select('g.labels')
     if labelGroup.empty()
-      labelGroup = svg.append('g').attr('class', 'labels')
+      labelGroup = @svg.append('g').attr('class', 'labels')
     path = pathGroup.selectAll('path.pie').data(piedata)
     #console.log("path",this.path.empty())
     path.enter().append('path').attr('class', 'pie').attr 'fill', (d, i) ->
-      color i
+      @color i
     #@path.transition().duration(1500).attrTween 'd', that.pieTween
     path.transition()
         .duration(1000)

            i = d3.interpolate({startAngle: 0, endAngle: 0}, {startAngle: d.startAngle, endAngle: d.endAngle})
            return (t) -> 
                b = i(t)
                return arc(b)
        )
    #@path.exit().transition().duration(300).attrTween('d', that.removePieTween).remove()
    path.exit()

    labels.exit().remove()
    labelLayout = d3.geom.quadtree().extent([
      [
        -@width
        -@height
      ]
      [
        @width
        @height
      ]
    ]).x((d) ->
      d.x
