Commit 83be2803 authored by Kjetil Thuen's avatar Kjetil Thuen
Browse files

Removed transition effect, started adding axes

parent 99aaf28f
......@@ -76,6 +76,7 @@ prepareFuncFactory = (callback) ->
birthyear: parseInt(birthYear[0].tid) - parseInt(birthYear[0].alder)
year: parseInt birthYear[0].tid
age: parseInt birthYear[0].alder
label: parseInt birthYear[0].alder
rvalue: birthYear[0].value
lvalue: birthYear[1].value
}
......
......@@ -17,7 +17,6 @@ margin = (chartId) ->
chartWidth(chartId) / 50
speed = -> 500
barThickness = (chartId) ->
Math.floor(chartHeight(chartId) / numBars(chartId)) - 2
......@@ -36,6 +35,14 @@ y = (chartId, val) ->
.domain(d3.extent valuesFromFrame(chartId, 0), (d) -> d.age)
.range [ 0, chartHeight(chartId) ]
x_axis = d3.svg.axis()
.orient "bottom"
.ticks 5
y_axis = d3.svg.axis()
.orient "left"
.ticks 5
addBar = (newBar, chartId) ->
barGroup = newBar.append "g"
.attr "class", "valuepoint"
......@@ -66,8 +73,6 @@ updateChart = (chartId, frameNum) ->
.data data, (d) -> d.birthyear
valuepoints.transition()
.ease "linear"
.duration speed()
.attr "transform", (d, i) ->
"translate(0, " + (y(chartId)(i) + 1) + ")"
......@@ -111,6 +116,9 @@ setupChart = (chartId, data) ->
.attr "shape-rendering", "geometricPrecision"
.attr "width", chartWidth(id)
.attr "height", chartHeight(id)
.call x_axis
.call y_axis
nextFrame id, 0
window.onresize = setupChart
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment