Skip to content

Commit

Permalink
fix hilight WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dgilperez committed Aug 20, 2013
1 parent 92d7790 commit 8817e22
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
12 changes: 4 additions & 8 deletions lib/morris.line.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,11 @@ class Morris.Line extends Morris.Grid
if @prevHilight isnt null and @prevHilight isnt index
for i in [0..@seriesPoints.length-1]
if @seriesPoints[i][@prevHilight]
@seriesPoints[i][@prevHilight].animate @pointShrinkSeries(index)
@seriesPoints[i][@prevHilight].animate @pointShrinkSeries(i)
if index isnt null and @prevHilight isnt index
for i in [0..@seriesPoints.length-1]
if @seriesPoints[i][index]
@seriesPoints[i][index].animate @pointGrowSeries(index)
@seriesPoints[i][index].animate @pointGrowSeries(i)
@prevHilight = index

colorFor: (row, sidx, type) ->
Expand Down Expand Up @@ -307,18 +307,14 @@ class Morris.Line extends Morris.Grid
# @private
pointSizeForSeries: (index) ->
if (@options.pointSize instanceof Array)
console.log(@options.pointSize)
console.log(index)
console.log(@options.pointSize.length)
console.log(index % @options.pointSize.length)
@options.pointSize[index % @options.pointSize.length]
else
@options.pointSize

# @private
pointGrowSeries: (index) ->
Raphael.animation r: @pointSizeForSeries(index) + 3, 25, 'linear'

# @private
pointShrinkSeries: (index) ->
Raphael.animation r: @pointSizeForSeries(index), 25, 'linear'
Expand Down
8 changes: 2 additions & 6 deletions morris.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8817e22

Please sign in to comment.