-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Knowledge graph UI test #100
base: development
Are you sure you want to change the base?
Conversation
Gruppe C test
This reverts commit cc33aea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Har lige et par kommentare.
I må bare skrive hvis i er uenige 😁
function Search(id) { | ||
document.getElementById('table').innerHTML = ""; | ||
document.getElementById('svg-body').innerHTML = ""; | ||
|
||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'http://localhost:3030/SNOMEDTEST?query=PREFIX+skos%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3ESELECT+%3FSUBJECT+%3FPREDICATE+%3FOBJECT+where%7B%0A++%3Chttp%3A%2F%2Fwww.example.org%2F'+id+'%3E+(skos%3A%7C!skos%3A)%7B0%7D+%3FSUBJECT.%0A++%3FSUBJECT+%3FPREDICATE+%3FOBJECT+%0A%7DLIMIT+150%0A', true); | ||
xhr.withCredentials = true; | ||
xhr.send(null); | ||
xhr.onloadend = (event) => {ResponseToTable(xhr.response)}; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kan anbefale at følge 'Service pattern'. der er eksempler på dem i /knox-ui/Services/
document.getElementById('svg-body').innerHTML = ""; | ||
|
||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', 'http://localhost:3030/SNOMEDTEST?query=PREFIX+skos%3A%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3ESELECT+%3FSUBJECT+%3FPREDICATE+%3FOBJECT+where%7B%0A++%3Chttp%3A%2F%2Fwww.example.org%2F'+id+'%3E+(skos%3A%7C!skos%3A)%7B0%7D+%3FSUBJECT.%0A++%3FSUBJECT+%3FPREDICATE+%3FOBJECT+%0A%7DLIMIT+150%0A', true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I må meget gerne flytte links ud i .env filen, så skal man ikke rette links i koden hvis de en gang skulle ændre sig, eller hvis man vil køre UI'en lokalt.
så kan man lave en '.env.local' når det skal køres localt og en '.env.production' når det skal køres på serveren.
React app er lidt anderledes når man tilføjer env variabler, de skal følge REACT_APP_[ENV_VAR_NAME]
(i kan se på /knox-ui/Services/ hvis det ikke er helt klart)
function id(){ | ||
return "kl"; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Der er ingen grund til at bruge 'function' hvis den alligevel altid returnere det samme.
function id(){ | |
return "kl"; | |
} | |
const id = "kl"; |
var force = d3.layout.force().size([1000, 500]); | ||
|
||
var graph = triplesToGraph(svg); | ||
console.log(graph); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fjern gerne console.log, det høre ikke til i production.
console.log(graph); |
//linkTexts.append("title") | ||
// .text(function(d) { return d.predicate; }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hvis dette ikke skal bruges må i gerne fjerne det.
//linkTexts.append("title") | |
// .text(function(d) { return d.predicate; }); |
.call(force.drag) | ||
;//nodes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.call(force.drag) | |
;//nodes | |
.call(force.drag); |
.text( function (d) { return d.label; }) | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I har mange "floating" semikoloner.
.text( function (d) { return d.label; }) | |
; | |
.text( function (d) { return d.label; }); |
.attr("y", function(d) { return d.y + 3; }) | ||
|
||
|
||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.attr("y", function(d) { return d.y + 3; }) | |
; | |
.attr("y", function(d) { return d.y + 3; }); |
.attr("y", function(d) { return 4 + (d.s.y + d.p.y + d.o.y)/3 ; }) | ||
|
||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.attr("y", function(d) { return 4 + (d.s.y + d.p.y + d.o.y)/3 ; }) | |
; | |
.attr("y", function(d) { return 4 + (d.s.y + d.p.y + d.o.y)/3 ; }); |
.start() | ||
; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.start() | |
; | |
.start(); |
; | ||
|
||
} | ||
function hej(){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hej 😄
Den burde have et andet navn før den bliver skubbet op 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Er enig i de ting Kasper også har sat kommentarer ved. Tænker at det kunne være dejligt at sørge for at koden er ryddet op inden den skubbes op på branchen 😊
No description provided.