                 d3.scale.linear().range([0, @height]).nice()
             ]
 
-
-    selector = '.lightcurve'
-    lc = new LightCurve(selector)
-    width = lc.width
-    height = lc.height
-    svg = lc.getSvg()
-    [xScale, yScale] = lc.getScales()
-    csvUrl = $(selector).data 'csvSource'
-    d3.csv(
-        csvUrl,
-        ((d) ->
-            jd: +d.jd
-            magnitude: +d.magnitude
-        ),
-        ((error, data) ->
+        drawData: (svg, data) ->
+            [xScale, yScale] = @getScales()
             xScale.domain d3.extent data, (d) -> d.jd
             yScale.domain d3.extent data, (d) -> d.magnitude
             xAxis = d3.svg.axis().scale(xScale).orient('bottom').ticks(10)

                    cy: (d) -> yScale d.magnitude
                    fill: 'red'
                    r: '2'
            )
        )

            svg.append('g')
                .attr
                    class: 'x axis'
                    transform: "translate(0,#{@height})"
                .call(xAxis.tickSize(-@height, 0, 0))
            svg.append('g')
                .attr
                    class: 'y axis'
                .call(yAxis.tickSize(-@width, 0, 0))
            svg.selectAll('circle')
                .data(data)
                .enter()
