Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
grzhan committed Oct 9, 2016
1 parent 94c9df6 commit 616dc47
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion main.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,18 @@ function run() {
let ann = new Annotator(document.querySelector('#con'));
let annotations = JSON.parse(results[1]);
let relations = [];
let counter = 0;
let labels = annotations['concepts'].map(concept=> {
concept['relations'] = concept['relations'] || [];
concept['relations'].forEach(relation=> {
if (relation['attribute_id'] != undefined) {
relations.push({
id: counter,
dst: concept['meta']['id'],
src: relation['attribute_id'],
text: relation['relation_type']
})
});
counter += 1;
}
});
return {
Expand All @@ -55,4 +58,4 @@ function run() {
ann.import(results[0],categories, labels, relations)
})
}
document.querySelector('#run').addEventListener('click',()=>run());
document.querySelector('#run').addEventListener('click',()=>run());

0 comments on commit 616dc47

Please sign in to comment.