Skip to content

Commit 7575f0c

Browse files
committed
Merge branch 'master' into npm
Corrected imports and rearranged elements for compatibility with npm build
2 parents cf49311 + b5a9ca9 commit 7575f0c

18 files changed

Lines changed: 1004 additions & 504 deletions

File tree

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: 20 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,10 +66,9 @@
4766
<p><input type="checkbox" data-option="tree"> Open tree view in modal</p>
4867
</div>
4968
</div>
69+
5070
</div>
5171

52-
<script src="libs/jscolor.min.js"></script>
5372
<script src="dist/tag/js/tag.min.js"></script>
54-
5573
</body>
5674
</html>

libs/jscolor.min.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
"watch": "npm-run-all --parallel watch:css watch:js",
4242
"prewatch:css": "colors --white \" - \" --cyan \"Watching for updates to app.css. (Minified)\"",
4343
"watch:css": "onchange src/css/app.css -- cleancss -d -o dist/tag/css/tag.min.css src/css/app.css",
44-
"prewatch:js": "colors --white \" - \" --cyan \"Watching for updates to app.js. (Recompiled verbatim; run 'build' task for minification)\"",
45-
"watch:js": "watchify -g deamdify src/js/app.js -o dist/tag/js/tag.min.js -v"
44+
"prewatch:js": "colors --white \" - \" --cyan \"Watching for updates to main.js. (Recompiled verbatim; run 'build' task for minification)\"",
45+
"watch:js": "watchify -g deamdify src/js/main.js -o dist/tag/js/tag.min.js -v"
4646
},
4747
"repository": {
4848
"type": "git",
@@ -62,6 +62,7 @@
6262
"homepage": "https://github.com/CreativeCodingLab/TextAnnotationGraphs#readme",
6363
"dependencies": {
6464
"chroma-js": "^1.3.5",
65+
"colorPicker": "git+https://github.com/PitPik/colorPicker.git",
6566
"d3": "^4.12.2",
6667
"lodash": "^4.17.4",
6768
"svg.draggable.js": "^2.2.1",

src/css/app.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;

src/js/components/link.js

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

395395
// helper function to return a path string for an arrowhead
396396
arrowhead(handle) {
397-
const s = 4;
397+
const s = 4, s2 = 6;
398398
return this.top ?
399-
'M' + [handle.x - s, handle.y - s] + 'l' + [s,s * 1.5] + 'l' + [s,-s * 1.5] :
400-
'M' + [handle.x - s, handle.y + s] + 'l' + [s, -s * 1.5] + 'l' + [s, s * 1.5];
399+
'M' + [handle.x - s, handle.y - s] + 'l' + [s, s2] + 'l' + [s, -s2] :
400+
'M' + [handle.x - s, handle.y + s] + 'l' + [s, -s2] + 'l' + [s, s2];
401401
}
402402

403403
remove() {

0 commit comments

Comments
 (0)