forked from AllonKleinLab/SPRING_dev
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathspringViewer_1_5_dev.html
executable file
·167 lines (139 loc) · 5.98 KB
/
springViewer_1_5_dev.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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/forceLayout_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/selection_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/colorbar_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/settings_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/coexpression_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/diffex_style.css">
<link rel="stylesheet" type="text/css" href="scripts_1_5_dev/make_new_SPRINGplot_style.css">
<div id="options_bar">
<div id="button_panel">
<div id="deselect">
<button>(De)select All</button>
</div>
<div id="toggleforce">
<button >Resume dynamics</button>
</div>
<div id="settings">
<button>Settings:</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:save_coords()">Save coordinates</a>
<a href="javascript:fix()">Fix nodes</a>
<a href="javascript:unfix()">Unfix nodes</a>
<a href="javascript:rotation_update()">Rotate</a>
<a id="center_view">Center view</a>
</div>
</div>
</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:downloadEdges()">Edge list</a>
<a href="javascript:downloadRankedTerms()">Enriched terms</a>
<!--<a href="javascript:downloadPNG()">Screenshot (.png)</a> -->
<a href="javascript:downloadSVG()">Screenshot (.svg)</a>
<!--<a href="javascript:downloadPDF()">Screenshot (.pdf)</a>-->
</div>
</div>
<div class="dropdown">
<button id="goto_dropdown_button">Go to:</button>
<div id="goto_dropdown" class="dropdown-content">
<a target="_blank" id="all_SPRINGplots_menu">All subplots menu</a>
<a target="_blank" id="changeViewer_link">Static mode</a>
</div>
</div>
<!--<div id="load_colors">
<button> Load color tracks </button>
</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>
<script src="scripts_1_5_dev/d3.min.js"></script>
<script src="scripts_1_5_dev/d3-queue.v3.min.js"></script> <!-- SPARSE UPDATE -->
<script src="scripts_1_5_dev/jquery-3.1.0.min.js"></script>
<script src="scripts_1_5_dev/colorBar.js"></script>
<script src="scripts_1_5_dev/forceLayout_script.js"></script>
<script src="scripts_1_5_dev/rotation_script.js"></script>
<script src="scripts_1_5_dev/selection_script.js"></script>
<script src="scripts_1_5_dev/settings_script.js"></script>
<script src="scripts_1_5_dev/coexpression_script.js"></script>
<script src="scripts_1_5_dev/diffex_script.js"></script>
<script src="scripts_1_5_dev/simg.js"></script>
<script src="scripts_1_5_dev/jspdf.min.js" ></script>
<script src="scripts_1_5_dev/canvg.min.js"></script>
<script src="scripts_1_5_dev/FileSaver.js"></script>
<script src="scripts_1_5_dev/spin.min.js"></script>
<script src="scripts_1_5_dev/make_new_SPRINGplot_script.js"></script>
<script>
var rotator_radius = null;
setup_download_dropdown();
setup_goto_dropdown();
d3.select("#sound_toggle").append('img')
.attr('src', "scripts_1_5_dev/sound_effects/icon_mute.svg")
.on("click", function() {
if (d3.select("#sound_toggle").select("img").attr("src") == "scripts_1_5_dev/sound_effects/icon_speaker.svg") {
d3.select("#sound_toggle").select("img").attr("src","scripts_1_5_dev/sound_effects/icon_mute.svg"); }
else { d3.select("#sound_toggle").select("img").attr("src","scripts_1_5_dev/sound_effects/icon_speaker.svg"); } });
function callback() {
settings_setup();
selection_setup();
setup_layout_dropdown();
//colorBar(graph_directory, sub_directory);
//loadColors();
loadSelectedCells(graph_directory);
//coexpression_setup(graph_directory);
//diffex_setup(graph_directory);
initiateButtons();
make_new_SPRINGplot_setup();
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;
var my_origin = window.location.origin;
var my_pathname = window.location.pathname;
var path_split = my_pathname.split("/")
var path_start = path_split.slice(0, path_split.length-1).join("/")
path_split[path_split.length-1] = "springViewer_1_6_dev.html"
var static_path = path_split.join("/")
d3.select("#changeViewer_link").attr("href", my_origin + static_path + name);
base_dir_name = name.slice(1,name.length).split('/');
base_dir_name = base_dir_name.slice(0,base_dir_name.length-1).join('/');
d3.select("#all_SPRINGplots_menu").attr("href", my_origin + path_start + "/currentDatasetsList.html?"+base_dir_name);
var force_on = 1;
var n_nodes = 0;
var colors_loaded = 0;
graph_directory = name.slice(1,name.length);
var tmp = graph_directory.split('/');
graph_directory = tmp.slice(0,tmp.length-1).join('/');
sub_directory = tmp[tmp.length-1];
document.title = 'SPRING: ' + tmp[tmp.length-2]+'/'+tmp[tmp.length-1];
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, sub_directory, callback);
</script>
</body>