Skip to content

Commit b5a9ca9

Browse files
committed
Squashed commit of the following:
commit 7ccf3fe Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Tue Jan 23 02:17:42 2018 -0600 fix tree layout not showing up commit d7aed99 Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Tue Jan 23 02:01:33 2018 -0600 allow drag and drop single file commit 85af19c Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Mon Jan 22 19:08:34 2018 -0600 disable color checking on label change (FIX LATER) commit 4b1a9e5 Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Mon Jan 22 19:03:20 2018 -0600 switch to colorpicker dependency commit c23857e Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Mon Jan 22 13:17:04 2018 -0600 refactor data parsing parser classes for different formats are instantiated in parse.js and returns arrays of words, links, and clusters commit 87bd8fd Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Fri Jan 19 16:47:20 2018 -0600 load external files commit a99db24 Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Tue Jan 16 14:21:31 2018 -0600 convert data[6-8].json to example[1-3].ann (standoff) -overlapping/nested TBMs not handled yet commit f18c5c0 Author: Kristine Lee <hmsklee@users.noreply.github.com> Date: Tue Jan 2 15:05:24 2018 -0600 add parser for ann
1 parent 0288d68 commit b5a9ca9

File tree

17 files changed

+960
-463
lines changed

17 files changed

+960
-463
lines changed

css/style.css

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
#fill {
2+
/* ensure body takes up entire window */
3+
position:absolute;
4+
z-index:-1;
5+
top:0;
6+
left:0;
7+
width:100%;
8+
height:100%;
9+
}
110
body {
211
margin:0;
312
-moz-osx-font-smoothing:grayscale;
@@ -63,6 +72,27 @@ header > button:hover {
6372
border-bottom:1px solid grey;
6473
}
6574

75+
76+
/* input */
77+
#input-modal {
78+
}
79+
#input-modal textarea {
80+
width:100%;
81+
height:300px;
82+
padding:5px;
83+
font-size:15px;
84+
}
85+
label[for="file-input"] {
86+
padding:10px 15px;
87+
cursor:pointer;
88+
background:steelblue;
89+
color:white;
90+
margin:10px 0;
91+
display:inline-block;
92+
border-radius:5px;
93+
}
94+
95+
/* modal */
6696
.modal {
6797
color:#222;
6898
background:rgba(0,0,0,0.3);
@@ -159,9 +189,9 @@ header > button:hover {
159189
#taxonomy input[type="checkbox"] {
160190
margin-right: 0.5em;
161191
}
162-
#taxonomy input.jscolor {
192+
#taxonomy input.colorpicker {
163193
margin-left: 0.5em;
164-
width:4em;
194+
width:5em;
165195
text-align:center;
166196
display:inline-block;
167197
outline:none;
@@ -170,13 +200,19 @@ header > button:hover {
170200
border-radius: 3px;
171201
cursor: pointer;
172202
box-shadow: 0 0 8px rgba(0,0,0,0.2);
203+
text-transform:uppercase;
204+
-moz-osx-font-smoothing:initial;
205+
-webkit-font-smoothing:initial;
173206
}
174-
#taxonomy input.jscolor[disabled="true"] {
207+
#taxonomy input.colorpicker[disabled="true"] {
175208
border-color:#ccc;
176209
box-shadow: none;
177210
pointer-events:none;
178211
opacity:0.5;
179212
}
213+
.cp-app {
214+
z-index:1001;
215+
}
180216

181217
body > #tree-svg {
182218
border-top: 1px solid #ccc;

data/example1.ann

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
unlockable
2+
T1 BOUND 0 2 un
3+
T2 FREE 2 6 lock
4+
T3 BOUND 6 10 able
5+
R1 unlock controlled:T1 controller:T2
6+
R2 unlockable controller:R1 controlled:T3

data/example2.ann

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
unlockable
2+
T1 BOUND 0 2 un
3+
T2 FREE 2 6 lock
4+
T3 BOUND 6 10 able
5+
R1 lockable controlled:T2 controller:T3
6+
R2 unlockable controller:T1 controlled:R1

data/example3.ann

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Induction of p21 by p53 following DNA damage inhibits both Cdk4 and Cdk2 activities.
2+
T1 Gene_or_gene_product 13 16 p21
3+
T2 Gene_or_gene_product 20 23 p53
4+
T3 BioProcess 34 44 DNA damage
5+
T4 Gene_or_gene_product 59 63 Cdk4
6+
T5 Gene_or_gene_product 68 72 Cdk2
7+
T6 Positive_activation 0 9 Induction
8+
T7 Negative_regulation 45 53 inhibits
9+
E1 Positive_activation:T6 Controller:T2 Controlled:T1
10+
E2 Negative_regulation::T7 Controller:E1 Controlled:T4
11+
E3 Negative_regulation::T7 Controller:E1 Controlled:T5

index.html

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@
99

1010
<body>
1111

12+
<div id="fill"></div>
13+
1214
<header id="header">
15+
Examples:
1316
<select id="dataset">
1417
<option>-- select dataset --</option>
1518
<option>data1</option>
@@ -21,10 +24,26 @@
2124
<option>morpheme2</option>
2225
<option>event annotation</option>
2326
</select>
27+
<button id="custom-annotation">Custom annotation</button>
2428
<button id="taxonomy-toggle">Taxonomy</button>
2529
<button id="options-toggle">Options</button>
2630
</header>
2731

32+
<div id="input-modal" class="modal">
33+
<div>
34+
<header>
35+
<span class="tab active">Custom annotation</span>
36+
</header>
37+
<div class="page active">
38+
<form id="form">
39+
<label for="file-input">Upload file(s)</label>
40+
<input type="file" id="file-input" style="display:none;" multiple>
41+
</form>
42+
<pre id="message"></pre>
43+
</div>
44+
</div>
45+
</div>
46+
2847
<div id="main">
2948
<div id="tooltip">
3049
</div>
@@ -47,15 +66,19 @@
4766
<p><input type="checkbox" data-option="tree"> Open tree view in modal</p>
4867
</div>
4968
</div>
69+
5070
</div>
5171

5272
<script src="libs/svg.js"></script>
5373
<script src="libs/svg.draggable.js"></script>
54-
<script src="libs/jscolor.min.js"></script>
74+
<script src="libs/jsColorPicker.min.js"></script>
5575
<script src="libs/d3.min.js"></script>
5676

77+
<script src="js/xhr.js"></script>
5778
<script src="js/ymljson.js"></script>
58-
<script src="js/parser.js"></script>
79+
<script src="js/parse/parse.js"></script>
80+
<script src="js/parse/ann.js"></script>
81+
<script src="js/parse/reach.js"></script>
5982
<script src="js/treelayout.js"></script>
6083
<script src="js/main.js"></script>
6184
<script src="js/managers/tooltip.js"></script>
@@ -69,6 +92,11 @@
6992
<script src="js/components/link.js"></script>
7093

7194
<script type="text/javascript">
95+
96+
// page setup
97+
// manage input
98+
// manage visualization
99+
72100
Main.init();
73101
</script>
74102

js/components/link.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,10 @@ class Link {
390390

391391
// helper function to return a path string for an arrowhead
392392
arrowhead(handle) {
393-
const s = 4;
393+
const s = 4, s2 = 6;
394394
return this.top ?
395-
'M' + [handle.x - s, handle.y - s] + 'l' + [s,s * 1.5] + 'l' + [s,-s * 1.5] :
396-
'M' + [handle.x - s, handle.y + s] + 'l' + [s, -s * 1.5] + 'l' + [s, s * 1.5];
395+
'M' + [handle.x - s, handle.y - s] + 'l' + [s, s2] + 'l' + [s, -s2] :
396+
'M' + [handle.x - s, handle.y + s] + 'l' + [s, -s2] + 'l' + [s, s2];
397397
}
398398

399399
remove() {

0 commit comments

Comments
 (0)