                 data: @get('points')
             }], @get('options'))
         ).observes('points')
-        
-        didInsertElement: ->
-            @plotRerender()
     )
 )
            }], @get('options'))
        ).observes('n_points', 'p_points')
        
        didInsertElement: ->
            @plotRerender()
    )
    
    
    FermiDriacGraphView: Ember.View.extend(
        dataBinding: 'parentView.data'
        classNames: ['plot', 'fermi-driac-graph']
            
        yminBinding: 'parentView.ymin'
        ymaxBinding: 'parentView.ymax'
        
        options: (->
            yaxis:
                min: @get('ymin')
                max: @get('ymax')

        exp = @get 'rawValue'
        "10^#{exp}"
    ).property('value')
)

App.GraphView = Ember.View.extend(
    dataBinding: 'parentView.data'
    classNames: ['plot']
        
    yminBinding: 'parentView.ymin'
    ymaxBinding: 'parentView.ymax'
    
    showTooltip: (x, y, contents) ->
        @set 'tooltip', $('<div class="flot-tooltip">' + contents + '</div>').css( {
            position: 'absolute',
            display: 'none',
            top: y + 5,
            left: x + 5,
            border: '1px solid #fdd',
            padding: '2px',
            'background-color': '#fee',
            opacity: 0.80
        }).appendTo("body").fadeIn(200);
            
    didInsertElement: ->
        @plotRerender()
        @$().bind("plothover", (event, pos, item) =>
            try
                @get('tooltip').remove()
            catch e
                #
                
            if item
                x = item.datapoint[0].toExponential(2)
                y = item.datapoint[1].toExponential(2)
                    
                @showTooltip(item.pageX, item.pageY, x);
                                           
        )
)

App.ApplicationView = Ember.View.extend(
