Commit 6167eb22 authored by Randall Leeds's avatar Randall Leeds

fix a heatmap edge case of buckets not merging

I was avoiding expanding buckets beyond the bounds of their
annotations' locations by preventing merging with empty buckets.
However, empty buckets should totally merge with empty buckets.
parent e6d9d8e7
......@@ -121,7 +121,9 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
for i in [0..@index.length-2]
# ignore buckets followed by an empty bucket
# prevents erroneous deletion of isolated buckets
if @buckets[i+1].length and (w = @index[i+1] - @index[i]) < min
if @buckets[i].length and not @buckets[i+1].length
continue
if (w = @index[i+1] - @index[i]) < min
small = i
min = w
break if min == 0 # short-circuit optimization
......
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