Skip to content

Commit

Permalink
Alerts user when loading custom ontology fails! (#180)
Browse files Browse the repository at this point in the history
closes #137 

* Alerts user when loading ontology fails!

* Indented and changed alert message.

* Simplified code by adding return statement.

* Removed extra parenthesis and added space!

* Added code to remove details section while loading custom.
  • Loading branch information
sakshi-dhamija authored May 18, 2021
1 parent df466c3 commit 9539720
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 2 additions & 0 deletions js/tree-edam-stand-alone.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ function interactive_edam_browser(){
reader.readAsText(file);
reader.onload = function(event) {
json = JSON.parse(event.target.result);
if(json == null)
return;
if(typeof json.meta=="undefined"){
json.meta={"version":"v n/a"};
}
Expand Down
5 changes: 4 additions & 1 deletion js/tree-reusable-d3.js
Original file line number Diff line number Diff line change
Expand Up @@ -811,13 +811,16 @@ function interactive_tree() {
identifierToElement={};
data_url = value;
d3.json(value, function(json) {
if(json==null) {
alert('Unable to read content of "' + data_url + '"');
}else{
if(typeof json.meta=="undefined"){
json.meta={"version":"v n/a", "date":"n/a"};
}
json.meta.data_url=data_url;
chart.data(json);
}
);
});
return chart;
};
/**
Expand Down

0 comments on commit 9539720

Please sign in to comment.