Commit d8cb4768 authored by Randall Leeds's avatar Randall Leeds

comments and whitespace

parent 2afdb628
...@@ -112,16 +112,15 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin ...@@ -112,16 +112,15 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
# Remove redundant points and merge close buckets until done # Remove redundant points and merge close buckets until done
while @buckets.length > 2 while @buckets.length > 2
# Find the two closest points # Find the two closest points
# TODO: dynamic programming
small = 0 small = 0
threshold = min = 60 threshold = min = 60
for i in [0..@index.length-2] for i in [0..@index.length-2]
# ignore buckets followed by an empty bucket # Don't merge empty with non-empty buckets
# prevents erroneous deletion of isolated buckets
if @buckets[i].length and not @buckets[i+1].length if @buckets[i].length and not @buckets[i+1].length
continue continue
# Maintain the index of the smallest delta
if (w = @index[i+1] - @index[i]) < min if (w = @index[i+1] - @index[i]) < min
small = i small = i
min = w min = w
......
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