forked from bbglab/muts-needle-plot
-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.html
57 lines (45 loc) · 1.36 KB
/
index.html
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
<!DOCTYPE html>
<meta charset="utf-8">
<link href="build/muts-needle-plot.css" rel="stylesheet" type="text/css">
<style>
text {
font: 12px sans-serif;
}
</style>
<body>
<div id="yourDiv"> </div>
<script src="build/muts-needle-plot.js"></script>
<script src="src/js/dependencies/d3.js"></script>
<script>
colorMap = {
// mutation categories
"missense_variant": "yellow",
"frameshift_variant": "blue",
"stop_gained": "red",
"stop_lost": "orange",
"synonymous_variant": "lightblue",
// regions
"X-binding": "olive",
"region1": "olive"
};
legends = {
x: "Corresponding protein positions to transcript X",
y: "Number of recorded mutation in transcript X of Gene Y and CT Z"
};
//Crate config Object
plotConfig = {
maxCoord : 350,
minCoord : 0,
height: 450,
targetElement : "yourDiv",
mutationData: "snippets/data/muts.json",
//mutationData: [{"category": "test", "coord": "99", "value": 77}],
regionData: "snippets/data/regions.json",
//regionData: {"beautiful-region": "99-199"},
colorMap: colorMap,
legends: legends
};
// Instantiate a plot
MutsNeedlePlot = require("muts-needle-plot");
p = new MutsNeedlePlot(plotConfig);
</script>