example1.html 11.3 KB
Newer Older
1
<!DOCTYPE html>
Jerome Mariette's avatar
Jerome Mariette committed
2
3
4
5
<html lang="en">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="utf-8">
Jerome Mariette's avatar
Jerome Mariette committed
6
	<title>jvenn</title>
Jerome Mariette's avatar
Jerome Mariette committed
7
	<!-- Le styles -->
Jerome Mariette's avatar
Jerome Mariette committed
8
	<link href="css/bootstrap.css" rel="stylesheet" media="screen">
Jerome Mariette's avatar
Jerome Mariette committed
9
10
11
12
13
14
	<style type="text/css">
		body {
			padding-top: 60px;
			padding-bottom: 40px;
		}
	</style>
Philippe Bardou's avatar
Philippe Bardou committed
15
	<link href="css/prettify.css" rel="stylesheet" media="screen">
Jerome Mariette's avatar
Jerome Mariette committed
16
17
18
	<link href="css/bootstrap-responsive.css" rel="stylesheet" media="screen">
	<script type="text/javascript" src="js/jquery.min.js"></script>
	<script src="js/bootstrap.min.js"></script>
Jerome Mariette's avatar
Jerome Mariette committed
19
	<script type="text/javascript" src="src/jvenn.js"></script>
Jerome Mariette's avatar
Jerome Mariette committed
20
	<script language="Javascript">
21
		$(document).ready(function () {			
22
23
24
25
26
27
28
29
30
31
		
			function getArrayFromArea(areaID) {
				var lines = $("#"+areaID).val().split("\n");
				var table = new Array();
				for (var lindex in lines) {
					table.push(lines[lindex]);
				}
				return (table);
			}
		
Jerome Mariette's avatar
Jerome Mariette committed
32
			function updateJvenn() {
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
				var seriesTable = new Array();
				if ($("#area1").val() != "") {
					seriesTable.push({
						name: $("#name1").val(),
						data: getArrayFromArea("area1")
					});
				}
		           if ($("#area2").val() != "") { 
		            seriesTable.push({   
		                name: $("#name2").val(),
		                data: getArrayFromArea("area2")
		            });
		           }
		           if ($("#area3").val() != "") { 
		            seriesTable.push({   
		                name: $("#name3").val(),
		                data: getArrayFromArea("area3")
		            });
		           }
		           if ($("#area4").val() != "") { 
		            seriesTable.push({   
		                name: $("#name4").val(),
		                data: getArrayFromArea("area4")
		            });
		           }
		           if ($("#area5").val() != "") { 
		            seriesTable.push({   
		                name: $("#name5").val(),
		                data: getArrayFromArea("area5")
		            });
		           }
Philippe Bardou's avatar
Philippe Bardou committed
64
65
66
67
68
69
		           if ($("#area6").val() != "") { 
		            seriesTable.push({   
		                name: $("#name6").val(),
		                data: getArrayFromArea("area6")
		            });
		           }
70
		
Jerome Mariette's avatar
Jerome Mariette committed
71
				$("#jvenn-container").jvenn({
72
					series: seriesTable,
73
					displayMode: $("#venn-type").val(),
74
					displayStat: $("#venn-stat").val(),
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
					fnClickCallback: function() {
						var value = "";
						if (this.listnames.length == 1) {
							value += "Elements only in ";
						} else {
							value += "Common elements in ";
						}
						for (name in this.listnames) {
							value += this.listnames[name] + " ";
						}
						value += ":\n";
						for (val in this.list) {
							value += this.list[val] + "\n";
						}
						$("#names").val(value);
					}
				});
			}
93
94
95
96
97
			$("#name1").val("Actors");
			$("#area1").val("Marilyn Monroe\nArnold Schwarzenegger\nJack Nicholson\nBarbra Streisand\nRobert de Niro\nDean Martin\nHarrison Ford");
			$("#name2").val("Singers");
			$("#area2").val("Freddy Mercury\nBarbra Streisand\nDean Martin\nRicky Martin\nCeline Dion\nMarilyn Monroe");
			
98
99
100
101
			$('[id^="clear"]').click(function() {
				var index = $(this).attr("id").split("_")[1];
				$("#area" + index).val("");
				$("#name" + index).val("List " + index);
Jerome Mariette's avatar
Jerome Mariette committed
102
				updateJvenn();
103
104
105
106
			});
			
			// update the view when any fields change
			$("[id^=name]").change(function() {
Jerome Mariette's avatar
Jerome Mariette committed
107
				updateJvenn();
108
109
			});
			$("[id^=area]").change(function() {
Jerome Mariette's avatar
Jerome Mariette committed
110
				updateJvenn();
111
			});
112
			
113
			$("#venn-type").change(function() {
Jerome Mariette's avatar
Jerome Mariette committed
114
				updateJvenn();
115
116
			});
			
117
118
119
120
			$("#venn-stat").change(function() {
				updateJvenn();
			});
			
Jerome Mariette's avatar
Jerome Mariette committed
121
122
			// first init of the jvenn plugin
			updateJvenn();
123
		});
Jerome Mariette's avatar
Jerome Mariette committed
124
	</script>
125
	<style type="text/css">
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
		/*add classes control-group*/
		.control-group.yellow .control-label,
		.control-group.yellow .help-block,
		.control-group.yellow .help-inline {
		  color: #f3f300;
		}
		.control-group.yellow .checkbox,
		.control-group.yellow .radio,
		.control-group.yellow input,
		.control-group.yellow select,
		.control-group.yellow textarea {
		  color: #f3f300;
		}
		
		.control-group.yellow input,
		.control-group.yellow select,
		.control-group.yellow textarea {
		  border-color: #f3f300;
		  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		}
		
		.control-group.yellow input:focus,
		.control-group.yellow select:focus,
		.control-group.yellow textarea:focus {
		  border-color: #c0c000;
		  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f3f300;
		     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f3f300;
		          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #f3f300;
		}
		
		.control-group.yellow .input-prepend .add-on,
		.control-group.yellow .input-append .add-on {
		  color: #f3f300;
		  background-color: #ffff91;
		  border-color: #f3f300;
		}
		
165
166
167
168
169
		.control-group.orange .control-label,
		.control-group.orange .help-block,
		.control-group.orange .help-inline {
		  color: #ffa54f;
		}
170
		.control-group.orange .checkbox,
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
		.control-group.orange .radio,
		.control-group.orange input,
		.control-group.orange select,
		.control-group.orange textarea {
		  color: #ffa54f;
		}
		
		.control-group.orange input,
		.control-group.orange select,
		.control-group.orange textarea {
		  border-color: #ffa54f;
		  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
		}
		
		.control-group.orange input:focus,
		.control-group.orange select:focus,
		.control-group.orange textarea:focus {
		  border-color: #b15700;
		  -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffa54f;
		     -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffa54f;
		          box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px #ffa54f;
		}
		
		.control-group.orange .input-prepend .add-on,
		.control-group.orange .input-append .add-on {
		  color: #ffa54f;
		  background-color: #ffe1c5;
		  border-color: #ffa54f;
		}
		
	</style>
Jerome Mariette's avatar
Jerome Mariette committed
204
205
206
207
208
209
210
211
212
213
</head>
<body>
	<div class="navbar navbar-inverse navbar-fixed-top">
      	<div class="navbar-inner">
			<div class="container">
				<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
					<span class="icon-bar"></span>
				</button>
Jerome Mariette's avatar
Jerome Mariette committed
214
				<a class="brand" href="./index.html">jvenn</a>
Jerome Mariette's avatar
Jerome Mariette committed
215
216
217
218
				<div class="nav-collapse collapse">
					<ul class="nav">
						<li><a href="./index.html">About</a></li>
						<li><a href="./documentation.html">Documentation</a></li>
Jerome Mariette's avatar
Jerome Mariette committed
219
220
						<li class="active"><a href="./example1.html">Example 1</a></li>
						<li><a href="./example2.html">Example 2</a></li>
Jerome Mariette's avatar
Jerome Mariette committed
221
222
223
224
225
226
227
228
229
230
						<li><a target="_blank" href="https://mulcyber.toulouse.inra.fr/plugins/mediawiki/wiki/venny/index.php/Accueil">Sources</a></li>
						<li><a href="mailto:support.genopole@toulouse.inra.fr">Contact</a></li>
					</ul>
				</div><!--/.nav-collapse -->
			</div>
		</div>
	</div>
	<div class="container">
		<!-- Main hero unit for a primary marketing message or call to action -->
		<div class="hero-unit">
231
			<h1>Hello venn!</h1>
Philippe Bardou's avatar
Philippe Bardou committed
232
			<p class="bodytext"> Paste up to <strong>six</strong> lists using one row per element, then click 
233
234
			the numbers in the <select id="venn-type" class="input-small" style="width:110px;margin-top:5px"><option value="classic">classic</option><option value="edwards">Edwards'</option></select> venn to see the results.<br/>
			Intead of venn general statistic about data are available : <select id="venn-stat" class="input" style="width:150px;margin-top:5px"><option value="gStat">General statistics</option><option value="venn">Venn diagram</option></select>.</p>
235
236
237
238
239
240
		</div>
		<div class="row-fluid">
			<div class="span12">
				<div class="row-fluid">
					<div class="span7">
						<div class="row-fluid">
Jerome Mariette's avatar
Jerome Mariette committed
241
							<div id="jvenn-container"></div>
242
243
244
245
						</div>
						<div class="row-fluid">
							<div class="span12">
								<p> Click on a number to show the corresponding elements: </p>
Philippe Bardou's avatar
Philippe Bardou committed
246
								<textarea id="names" style="width: 100%;" wrap="off" rows="23"></textarea>
247
248
249
250
251
252
253
							</div>
						</div>
					</div>
					<div class="span5"> 
						<div class="row-fluid">
							<div class="span12">
								<div class="control-group success">
254
									<input class="span6" id="name1" type="text" style="font-weight: bold;" value="List 1" maxlength="11"/>
255
									<div class="controls controls-row">
256
										<textarea class="span10" id="area1" wrap="off" rows="4"></textarea>
257
258
259
260
261
262
263
264
										<a class="btn btn-link" id="clear_1" href="javascript:void(0)">clear</a>
									</div>
								</div>
			 				</div>
			 			</div>
			 			<div class="row-fluid">
			 				<div class="span12">
			 					<div class="control-group info">
265
									<input class="span6" id="name2" type="text" style="font-weight: bold;" value="List 2" maxlength="11"/>
266
									<div class="controls controls-row">
267
										<textarea class="span10" id="area2" wrap="off" rows="4"></textarea>
268
269
270
271
272
273
274
275
										<a class="btn btn-link" id="clear_2" href="javascript:void(0)">clear</a>
									</div>
								</div>
							</div>
			 			</div>
						<div class="row-fluid">
			 				<div class="span12">
			 					 <div class="control-group error">
276
									<input class="span6" id="name3" type="text" style="font-weight: bold;" value="List 3" maxlength="11"/>
277
									<div class="controls controls-row">
278
										<textarea class="span10" id="area3" wrap="off" rows="4"></textarea>
279
280
281
282
283
284
285
										<a class="btn btn-link" id="clear_3" href="javascript:void(0)">clear</a>
									</div>
			 					</div>
			 				</div>
			 			</div>
			 			<div class="row-fluid">
			 				<div class="span12">
286
			 					<div class="control-group yellow">
287
									<input class="span6" id="name4" type="text" style="font-weight: bold;" value="List 4" maxlength="11"/>
288
									<div class="controls controls-row">
289
										<textarea class="span10" id="area4" wrap="off" rows="4"></textarea>
290
291
292
293
294
295
296
297
										<a class="btn btn-link" id="clear_4" href="javascript:void(0)">clear</a>
									</div>
			 					</div>
			 				</div>
			 			</div>
			 			<div class="row-fluid">
			 				<div class="span12">
			 					<div class="control-group orange">
298
									<input class="span6" id="name5" type="text" style="font-weight: bold;" value="List 5" maxlength="11"/>
299
									<div class="controls controls-row">
300
										<textarea class="span10" id="area5" wrap="off" rows="4"></textarea>
301
302
303
304
305
										<a class="btn btn-link" id="clear_5" href="javascript:void(0)">clear</a>
									</div>
								</div>
							</div>
						</div>
Philippe Bardou's avatar
Philippe Bardou committed
306
307
308
309
310
311
312
313
314
315
316
						<div class="row-fluid">
			 				<div class="span12">
			 					<div class="control-group warning">
									<input class="span6" id="name6" type="text" style="font-weight: bold;" value="List 6" maxlength="11"/>
									<div class="controls controls-row">
										<textarea class="span10" id="area6" wrap="off" rows="4"></textarea>
										<a class="btn btn-link" id="clear_6" href="javascript:void(0)">clear</a>
									</div>
								</div>
							</div>
						</div>
317
					</div>
318
				</div> 
319
			</div>
Jerome Mariette's avatar
Jerome Mariette committed
320
321
322
		</div>
		<hr>
		<footer>
323
			<p>Copyright &copy; 2014, INRA | Designed by <a href="http://bioinfo.genotoul.fr/" target="_blank">GenoToul Bioinfo</a> team.</p>
Jerome Mariette's avatar
Jerome Mariette committed
324
325
326
327
328
329
330
331
332
333
		</footer>
	</div>
	<script>
     	!function ($) {
     		$(function(){
				window.prettyPrint && prettyPrint()   
			})
		}(window.jQuery)
	</script>
</body>
334
</html>