-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathheatmap.jinja
87 lines (80 loc) · 2.51 KB
/
heatmap.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Huge Heatmap</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href='http://fonts.googleapis.com/css?family=Lato:300,400,700,900' rel='stylesheet' type='text/css'>
<style type="text/css">
body {
margin: 0px;
font-family: Verdana;
line-height: 1.25em;
background-color: black;
}
html, body, #content {
position: fixed;
width: 100%;
height: 100%;
margin: 0;
padding: 0;
}
a {
text-decoration: none;
}
div.overlay {
color: #808080;
font-size: small;
margin: 1ex;
}
div.overlay a {
color: #808080;
text-decoration: underline;
}
</style>
</head>
<body>
<div id="content">
<div id="heatmapviewer" style="width: auto; height: 600px; border: 1px solid black; background: black; color: white; margin: 0px; padding: 0px;"></div>
<div id="help" class="overlay">
Drag or arrow keys to move.<br>
Click/Mousewheel or +/− keys to zoom.
</div>
</div>
<script src="openseadragon.min.js"></script>
<script type="text/javascript">
var viewer = OpenSeadragon({
id: "heatmapviewer",
visibilityRatio: 1.0,
showNavigator: true,
navigatorPosition: "ABSOLUTE",
navigatorAutoResize: false,
navigatorRotate: false,
navigatorHeight: "200px",
navigatorWidth: "630px",
constrainDuringPan: true,
defaultZoomLevel: 3,
minZoomLevel: 1,
debugMode: false,
customControls: [
{ id: "help", anchor: OpenSeadragon.ControlAnchor.TOP_LEFT }
],
prefixUrl: "../assets/images/",
tileSources: "{{ dziname }}"
});
viewer.addHandler('open', function() {
var viewBounds = viewer.viewport.getBounds();
var viewAspect = viewBounds.height / viewBounds.width;
var imageBounds = viewer.world.getItemAt(0).getBounds(); // Assuming just a single image
var newViewWidth = imageBounds.width * 0.5;
var newBounds = new OpenSeadragon.Rect((imageBounds.width - newViewWidth) * 0.5, 0, newViewWidth, newViewWidth * viewAspect);
viewer.viewport.fitBounds(newBounds, true);
});
viewer.navigator.element.parentNode.style.right = '0';
viewer.navigator.element.parentNode.style.bottom = '0';
OpenSeadragon.supportsFullScreen = false;
viewer.setFullPage(true);
OpenSeadragon.supportsFullScreen = true;
</script>
</body>
</html>