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
ab6b5703
Commit
ab6b5703
authored
Jan 03, 2013
by
Jehan Tremback
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
put heatmap into container
parent
4fed7317
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
30 deletions
+25
-30
app.scss
h/css/app.scss
+7
-9
controllers.coffee
h/js/controllers.coffee
+1
-2
heatmap.coffee
h/js/plugin/heatmap.coffee
+17
-19
No files found.
h/css/app.scss
View file @
ab6b5703
...
...
@@ -30,15 +30,13 @@ svg { -webkit-tap-highlight-color: rgba(255, 255, 255, 0); }
}
.annotator-heatmap
{
svg
{
background
:
hsla
(
0
,
0
,
0
,
.1
);
border
:
solid
thin
rgba
(
$grayLighter
,
.4
);
left
:
17px
;
height
:
100%
;
position
:
fixed
;
top
:
0
;
width
:
$heatmap-width
;
}
background
:
hsla
(
0
,
0
,
0
,
.1
);
border
:
solid
thin
rgba
(
$grayLighter
,
.4
);
left
:
17px
;
height
:
100%
;
position
:
fixed
;
top
:
0
;
width
:
$heatmap-width
;
}
...
...
h/js/controllers.coffee
View file @
ab6b5703
...
...
@@ -9,8 +9,7 @@ class App
)
->
{
plugins
,
provider
}
=
annotator
heatmap
=
annotator
.
plugins
.
Heatmap
heatmap
.
element
.
appendTo
$element
heatmap
.
element
.
appendTo
'#heatmap-container'
# Update the heatmap when the host is updated or annotations are loaded
events
=
[
'hostUpdated'
,
'annotationsLoaded'
]
for
event
in
events
...
...
h/js/plugin/heatmap.coffee
View file @
ab6b5703
...
...
@@ -5,23 +5,21 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
# heatmap svg skeleton
html
:
"""
<div class="annotator-heatmap">
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.1">
<defs>
<linearGradient id="heatmap-gradient" x2="0" y2="100%">
</linearGradient>
<filter id="heatmap-blur">
<feGaussianBlur stdDeviation="0 2"></feGaussianBlur>
</filter>
</defs>
<rect x="0" y="0" width="100%" height="100%"
fill="url('#heatmap-gradient')"
filter="url('#heatmap-blur')" >
</rect>
</svg>
</div>
<svg class="annotator-heatmap"
xmlns="http://www.w3.org/2000/svg"
version="1.1">
<defs>
<linearGradient id="heatmap-gradient" x2="0" y2="100%">
</linearGradient>
<filter id="heatmap-blur">
<feGaussianBlur stdDeviation="0 2"></feGaussianBlur>
</filter>
</defs>
<rect x="0" y="0" width="100%" height="100%"
fill="url('#heatmap-gradient')"
filter="url('#heatmap-blur')" >
</rect>
</svg>
"""
# buckets of annotations that overlap
...
...
@@ -50,9 +48,9 @@ class Annotator.Plugin.Heatmap extends Annotator.Plugin
d3
.
hcl
(
270
,
c
(
v
),
l
(
v
)).
toString
()
updateHeatmap
:
(
data
)
=>
# debugger
return
unless
d3
?
wrapper
=
this
.
element
.
offsetParent
()
wrapper
=
this
.
element
.
parents
(
"body"
)
{
highlights
,
offset
}
=
data
# Keep track of buckets of annotations above and below the viewport
...
...
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