Conversation
Gruppe C test
This reverts commit cc33aea.
KasperHenningsen
left a comment
There was a problem hiding this comment.
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.
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.
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.
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.
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.
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.
| .call(force.drag) | |
| ;//nodes | |
| .call(force.drag); |
| .text( function (d) { return d.label; }) | ||
| ; |
There was a problem hiding this comment.
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.
| .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.
| .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.
| .start() | |
| ; | |
| .start(); |
| ; | ||
|
|
||
| } | ||
| function hej(){ |
There was a problem hiding this comment.
Hej 😄
Den burde have et andet navn før den bliver skubbet op 😄
selectionator
left a comment
There was a problem hiding this comment.
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.