From: David Schoonover Date: Wed, 27 Jun 2012 17:16:56 +0000 (-0700) Subject: Whitespace X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=fb58dac218e7a1ae59f3332ab910bf7404ad8bc4;p=kraken-ui.git Whitespace --- fb58dac218e7a1ae59f3332ab910bf7404ad8bc4 diff --cc lib/chart/type/d3-chart.co index 0df734f,99d0b6d..d7b2548 --- a/lib/chart/type/d3-chart.co +++ b/lib/chart/type/d3-chart.co @@@ -28,11 -31,10 +31,10 @@@ class exports.D3ChartType extends Chart legend : '.graph-legend' - # constructor: function D3ChartType - -> super ... + -> super ... - + getData: -> @model.dataset.getColumns() @@@ -61,7 -63,7 +63,7 @@@ # Calculate extents using all the data points (but not dates) # allValues = d3.merge @model.dataset.getDataColumns() allValues = d3.merge cols -- ++ # Update the x-scale with the extents of the dates. xScale .domain d3.extent dates @@@ -100,19 -101,27 +102,23 @@@ xAxis = d3.svg.axis().scale(xScale).orient("bottom").tickSize(6, 0) frame.select ".x.axis.time" .attr "transform", "translate(0,#{yScale.range()[0]})" - .call xAxis - - - + .call xAxis + + # this is wrong. should work using d3 datajoins. + # i.e. use the enter/exit function to add/remove + # metrics from the graph for i,metric in @model.dataset.metrics.models # metric defined charttype - chartType = metric.get "chartType" - chartElement = metric.get "chartElement" ++ chartElement = metric.get "chartElement" # otherwise the graph defined charttype # FOR NOW take line as default - chartType or= 'd3-line' # @model.get "chartType" - - # create d3 charttype and render it - model = ChartType.create chartType - model.renderChartType metric, frame ,xScale, yScale - + chartElement ?= 'd3-line' # @model.get "chartType" + + + # create d3 chart element and render it - chEl = D3ChartElement.create chartElement - console.log chEl ++ chEl = D3ChartElement.create chartElement ++ console.log chEl + chEl.renderChartElement metric, frame ,xScale, yScale - svg