-
Notifications
You must be signed in to change notification settings - Fork 0
/
mds.html
53 lines (51 loc) · 1.39 KB
/
mds.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
<html>
<head>
<script src="https://d3js.org/d3.v4.js"></script>
<script src="build/linked-charts.min.js"></script>
<script src="build/mds.js"></script>
<script src="build/heatmap.js"></script>
<link rel="stylesheet" type="text/css" href="build/linked-charts.css">
<script src = 'build/input_data.js'></script>
</head>
<body>
<table>
<tr>
<td id="heatmap" valign="top"></td>
<td id="scatterplot" valign="top"></td>
</tr>
</table>
</body>
<script>
var patientIds = Object.keys(heatmapData)
var genes = Object.keys(heatmapData[patientIds[0]])
var selPatient = patientIds[0]
var heatmap = lc.heatmapChart()
.rowIds(patientIds)
.colIds(genes)
.height(1500)
.width(1000)
.colourRange( [ -4, 4 ] )
.palette( function( val ) { return d3.interpolateRdBu( 1 - val ); })
.value(function(rowId, colId)
{
return Number(heatmapData[rowId][colId]);
})
.on_click(function(rowPatient, colGene)
{
selPatient = rowPatient;
MDS.update();
})
.place("#heatmap");
var MDS = lc.scatterChart()
.dataIds(patientIds)
.x(function(k)
{ return mds[k][0]})
.y(function(k)
{ return mds[k][1]})
.colour(function(k)
{
return k == selPatient ? "red" : "black";
})
.place("#scatterplot");
</script>
</html>