Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
d8cb4768
Commit
d8cb4768
authored
Apr 16, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comments and whitespace
parent
2afdb628
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
4 deletions
+3
-4
heatmap.coffee
h/js/plugin/heatmap.coffee
+3
-4
No files found.
h/js/plugin/heatmap.coffee
View file @
d8cb4768
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment