forked from AllonKleinLab/SPRING
-
Notifications
You must be signed in to change notification settings - Fork 0
/
springViewer.html
executable file
·151 lines (131 loc) · 5.23 KB
/
springViewer.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<link rel="stylesheet" type="text/css" href="scripts/forceLayout_style.css">
<link rel="stylesheet" type="text/css" href="scripts/selection_style.css">
<link rel="stylesheet" type="text/css" href="scripts/colorbar_style.css">
<link rel="stylesheet" type="text/css" href="scripts/settings_style.css">
<link rel="stylesheet" type="text/css" href="scripts/coexpression_style.css">
<link rel="stylesheet" type="text/css" href="scripts/diffex_style.css">
<div id="options_bar">
<div id="button_panel">
<div id="help">
<button>HELP!</button>
</div>
<div id="deselect">
<button>(De)select All</button>
</div>
<div id="settings">
<button>Settings:</button>
</div>
<div id="save_coords">
<button> Save coordinates </button>
</div>
<div class="dropdown">
<div id="layout_tools">
<button id="layout_dropdown_button">Layout tools:</button>
<div id="layout_dropdown" class="dropdown-content">
<a href="javascript:fix()">Fix nodes</a>
<a href="javascript:unfix()">Unfix nodes</a>
<a href="javascript:rotation_update()">Rotate</a>
</div>
</div>
</div>
<div id="center_view">
<button> Center view </button>
</div>
<div class="dropdown">
<button id="download_dropdown_button">Download:</button>
<div id="download_dropdown" class="dropdown-content">
<a href="javascript:downloadCoordinates()">Coordinates</a>
<a href="javascript:downloadSelection()">Selected cells</a>
<a href="javascript:downloadRankedTerms()">Enriched terms</a>
<a href="javascript:downloadPNG()">Screenshot (.png)</a>
<a href="javascript:downloadSVG()">Screenshot (.svg)</a>
</div>
</div>
<div id="sound_toggle"> </div>
</div>
<div id="color_chooser"> </div>
</div>
<div id="container">
<div id="force_layout"> </div>
<div id="termsheet" class="sidebar">
<div class="column" id="termcolumn"> </div>
<div class="column" id="scorecolumn" > </div>
</div>
<div id="legend" class="sidebar">
<div class="column" id="count_column"> </div>
<div class="column" id="label_column"> </div>
</div>
<!--
<div id="coexpression_panel" class="sidebar">
<div id="coexpression_header"> </div>
<div id="coexpression_legend" ></div>
<div id="coexpression_infobox"> </div>
<div id="coexpression_settings_box">
<div > <input type="range" min="5" value="60" max="120" id="coexpression_size_slider"> <p>Point size</p> </div>
<div> <input type="range" min="0" value="5" max="20" id="coexpression_jitter_slider"> <p>Jitter</p> </div>
<div> <input type="range" min="0" value="0" max="100" id="coexpression_zoom_slider"> <p>Zoom</p> </div>
</div>
</div>
<div id="diffex_panel" class="sidebar">
<div id="diffex_header"> </div>
<div id="diffex_legend_upper" class="diffex_legend"></div>
<div id="diffex_legend_lower" class="diffex_legend"></div>
<div id="diffex_infobox"> </div>
<div id="diffex_settings_box">
<div> <input type="range" min="5" value="60" max="120" id="diffex_size_slider"> <p>Point size</p> </div>
<div> <input type="range" min="0" value="0" max="20" id="diffex_jitter_slider"> <p>Jitter</p> </div>
<div> <input type="range" min="0" value="20" max="1600" id="diffex_zoom_slider"> <p>Zoom</p> </div>
</div>
</div>
-->
</div>
<script src="scripts/d3.min.js"></script>
<script src="scripts/jquery-3.1.0.min.js"></script>
<script src="scripts/colorBar.js"></script>
<script src="scripts/forceLayout_script.js"></script>
<script src="scripts/rotation_script.js"></script>
<script src="scripts/selection_script.js"></script>
<script src="scripts/settings_script.js"></script>
<script src="scripts/coexpression_script.js"></script>
<script src="scripts/diffex_script.js"></script>
<script src="scripts/simg.js"></script>
<script src="scripts/jspdf.min.js" ></script>
<script src="scripts/canvg.min.js"></script>
<script src="scripts/FileSaver.js"></script>
<script src="scripts/spin.min.js"></script>
<script>
var rotator_radius = null;
setup_download_dropdown();
d3.select("#sound_toggle").append('img')
.attr('src', "scripts/sound_effects/icon_mute.svg")
.on("click", function() {
if (d3.select("#sound_toggle").select("img").attr("src") == "scripts/sound_effects/icon_speaker.svg") {
d3.select("#sound_toggle").select("img").attr("src","scripts/sound_effects/icon_mute.svg"); }
else { d3.select("#sound_toggle").select("img").attr("src","scripts/sound_effects/icon_speaker.svg"); } });
function callback() {
settings_setup();
selection_setup();
setup_layout_dropdown();
colorBar(graph_directory);
loadSelectedCells(graph_directory);
//coexpression_setup(graph_directory);
//diffex_setup(graph_directory);
initiateButtons();
window.onclick = function(event) {
if (!(event.target.matches('#settings_dropdown *'))) { collapse_settings(); }
if (!event.target.matches('#download_dropdown_button')) { closeDropdown(); }
if (!event.target.matches('#layout_dropdown_button')) { closeDropdown(); }
}
}
var name = window.location.search;
graph_directory = name.slice(1,name.length);
d3.select("#force_layout").select("svg").remove()
d3.select("#color_chooser").selectAll("div").remove()
d3.select("#color_chooser").selectAll("input").remove()
d3.select("#color_chooser").selectAll("select").remove()
forceLayout(graph_directory, callback);
</script>
</body>