From: David Schoonover Date: Wed, 27 Jun 2012 16:57:25 +0000 (-0700) Subject: Whitespace X-Git-Url: http://git.less.ly:3516/?a=commitdiff_plain;h=c1bd968369628886d622aba764517b7f6089421c;p=limn.git Whitespace --- diff --git a/lib/chart/type/d3/d3-bar-chart-type.co b/lib/chart/type/d3/d3-bar-chart-type.co index 83ef067..6bab42b 100644 --- a/lib/chart/type/d3/d3-bar-chart-type.co +++ b/lib/chart/type/d3/d3-bar-chart-type.co @@ -173,7 +173,7 @@ class exports.BarChartType extends ChartType # TODO grab color from graph spec .attr "fill", "red" .attr "stroke", "white" - + ### Mouse Lens lens = root.lens = frame.selectAll "g.lens" @@ -197,7 +197,7 @@ class exports.BarChartType extends ChartType .style "font", "12px Helvetica" .style "font-weight", "bold" - + mf = frame.selectAll "g.mf" .data ["mf"] .enter().append "g" @@ -219,7 +219,6 @@ class exports.BarChartType extends ChartType .ease("exp") .text "Uh boy, the target would be:"+d[1] .style "font-size", "25px" - .on "mouseout", (d, i) -> mf @@ -229,7 +228,6 @@ class exports.BarChartType extends ChartType .style "font-size", "0px" - # {x:lineX, y:lineY} = root.pt = line.indexToPoint idx # lens = frame.select "g.lens" # .attr "transform", "translate(#lineX, #lineY)" diff --git a/lib/chart/type/d3/d3-chart-type.co b/lib/chart/type/d3/d3-chart-type.co index 8f73c54..0df734f 100644 --- a/lib/chart/type/d3/d3-chart-type.co +++ b/lib/chart/type/d3/d3-chart-type.co @@ -84,36 +84,35 @@ class exports.D3ChartType extends ChartType # Update chart dimensions. svg .attr "width", width .attr "height", height - + frame = svg.select "g.frame" .attr "transform", "translate(#{margin.left},#{margin.top})" .attr "width", width - margin.left - margin.right .attr "height", height - margin.top - margin.bottom - - + + # x-axis. # TODO move axis to separate chart-type enterFrame.append "g" - .attr "class", "x axis time" + .attr "class", "x axis time" + - 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 + for i,metric in @model.dataset.metrics.models # metric defined charttype - chartType = metric.get "chartType" + chartType = metric.get "chartType" # 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 = ChartType.create chartType model.renderChartType metric, frame ,xScale, yScale - + svg diff --git a/lib/data/metric-model.co b/lib/data/metric-model.co index 605f1b8..8381076 100644 --- a/lib/data/metric-model.co +++ b/lib/data/metric-model.co @@ -43,7 +43,7 @@ Metric = exports.Metric = BaseModel.extend do # {{{ transforms : [] scale : 1.0 - + chartType : null