Skip to content
Snippets Groups Projects
Commit ad57d36a authored by Marc Feger's avatar Marc Feger
Browse files

Update to use Arguments

parent bc4a3ea6
No related branches found
No related tags found
Loading
......@@ -2,7 +2,7 @@
<meta charset="utf-8">
<style>
svg {
background: black;
background: #000000;
}
</style>
<body>
......
......@@ -4,6 +4,7 @@ export const elements = {
ARGUMENT: "Argument",
SUPPORT: "Support",
ATTACK: "Attack",
REASON: "REASONS",
REGARDING: "REGARDING",
CONCLUDES: "CONCLUDES",
PREMISEOF: "PREMISE_OF"
......
......@@ -38,7 +38,8 @@ export class GraphCreator {
"id": relation.identity.toInt(),
"source": relation.start.toInt(),
"target": relation.end.toInt(),
"type": relation.type
"type": relation.type,
"bond": relation.properties.bond
};
graph.addEdge(newEdge);
}
......@@ -48,4 +49,21 @@ export class GraphCreator {
});
return graph;
}
async replaceArgumentsByEdges(graph) {
console.log(graph.edges);
console.log(graph.nodes);
const argumentNodes = graph.nodes.filter(function (element) {
return element.labels.includes(elements.ARGUMENT);
});
const argumentNodeIds = argumentNodes.map(function (element) {
return element.id;
})
const adjecentEdges = [];
graph.edges.forEach(function (element) {
});
console.log(argumentNodeIds);
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ import {getIssueTooltipOf, getStatementTooltipOf, getArgumentTooltipOf, getEdgeT
export class Network {
async showNetwork(query) {
const graph = await new GraphCreator().fill(new Graph(), query);
await new GraphCreator().replaceArgumentsByEdges(graph);
var tooltip = d3.select("body")
.append("div")
......@@ -39,12 +40,21 @@ export class Network {
link
.attr('class', 'link')
.attr('stroke', function (l) {
console.log(l);
if (l.type.includes(elements.REGARDING)) {
return "#A9A9A9";
} else if (l.type.includes(elements.CONCLUDES)) {
return "#ce34ff";
} else if (l.type.includes(elements.PREMISEOF)) {
return "#7b6fcc";
}else if (l.type.includes(elements.REASON)){
console.log(l.bond);
if (l.bond.includes(elements.ATTACK)){
return '#ff0000'
}
else if (l.bond.includes(elements.SUPPORT)){
return '#00ff00'
}
}
})
.on('mouseover.tooltip', function (d) {
......@@ -93,7 +103,7 @@ export class Network {
.duration(300)
.style("opacity", .8);
let info = "";
if (d.labels.includes("Issue")) {
if (d.labels.includes(elements.ISSUE)) {
info = getIssueTooltipOf(d);
} else if (d.labels.includes(elements.STATEMENT)) {
info = getStatementTooltipOf(d);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment