     # clear canvas
     @context.clearRect 0, 0, @viewport.width, @viewport.height
     @context.save()
-
     # translate & scale viewport
     @context.translate @viewport.center.x+@viewport.translate.x, @viewport.center.y+@viewport.translate.y
     @context.scale @viewport.scale, @viewport.scale
-    
+    # draw relations
     @drawRelations()
-    
+    # draw relations labels
     if @node_active or @node_hovered
       @drawRelationsLabels()
-    
+    # draw nodes
     @drawNodes()
-    
+    # draw nodes labels
     if @parameters.showNodesLabel or @node_active or @node_hovered
       @drawNodesLabels()
-
+    # context restore
     @context.restore()
 
   drawNodes: ->

  setNodeFill: (d) ->
    if d.disabled
      d.fill = '#d3d7db'
    #else if @parameters.showNodesImage and d.image != null
    #  fill = 'url(#node-pattern-'+d.id+')'
    else if @parameters.nodesColor == 'qualitative' or @parameters.nodesColor == 'quantitative'
      d.fill = @color_scale d[@parameters.nodesColorColumn] 
    else
      d.fill = @COLOR_SOLID[@parameters.nodesColor]

  setNodeStroke: (d) ->
    if @node_active and d.id == @node_active.id

      @setNodeFill d
      @setNodeStroke d
      @setNodeFont d
      @setNodeLabel d
      @setNodeImage d
    # Reorder nodes data if size is dynamic (in order to add bigger nodes after small ones)
    if @parameters.nodesSize == 1
      @data_nodes.sort @sortNodes
