|
|
@ -61,8 +61,9 @@ export default { |
|
|
|
featureAddRemCount: [], |
|
|
|
featureAddRemCount: [], |
|
|
|
mode: 0, // this should be 0 |
|
|
|
mode: 0, // this should be 0 |
|
|
|
KeepIDs: [], |
|
|
|
KeepIDs: [], |
|
|
|
KeepIDTransform: '', |
|
|
|
KeepIDTransform: [], |
|
|
|
keepNumberOfCompareNodes: 0 |
|
|
|
keepNumberOfCompareNodes: 0, |
|
|
|
|
|
|
|
activeLeafNode: -1 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
methods: { |
|
|
@ -96,13 +97,14 @@ export default { |
|
|
|
setLayerExplore() { |
|
|
|
setLayerExplore() { |
|
|
|
this.mode = 0 |
|
|
|
this.mode = 0 |
|
|
|
this.KeepIDs = [] |
|
|
|
this.KeepIDs = [] |
|
|
|
|
|
|
|
this.KeepIDTransform = [] |
|
|
|
this.keepNumberOfCompareNodes = 0 |
|
|
|
this.keepNumberOfCompareNodes = 0 |
|
|
|
//this.graphVizualization() |
|
|
|
//this.graphVizualization() |
|
|
|
EventBus.$emit('storeGeneration') |
|
|
|
EventBus.$emit('storeGeneration') |
|
|
|
}, |
|
|
|
}, |
|
|
|
setLayerCompare() { |
|
|
|
setLayerCompare() { |
|
|
|
this.mode = 1 |
|
|
|
this.mode = 1 |
|
|
|
this.KeepIDTransform = '' |
|
|
|
this.KeepIDTransform = [] |
|
|
|
EventBus.$emit('brushLink', -1) |
|
|
|
EventBus.$emit('brushLink', -1) |
|
|
|
this.graphVizualization() |
|
|
|
this.graphVizualization() |
|
|
|
}, |
|
|
|
}, |
|
|
@ -732,11 +734,13 @@ export default { |
|
|
|
this.VIFRemaining = [...VIFRemainingLoc] |
|
|
|
this.VIFRemaining = [...VIFRemainingLoc] |
|
|
|
this.MIRemaining = [...MIRemainingLoc] |
|
|
|
this.MIRemaining = [...MIRemainingLoc] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var activeNodeLoc = this.activeLeafNode |
|
|
|
|
|
|
|
|
|
|
|
var nodes = [] |
|
|
|
var nodes = [] |
|
|
|
var groupID = 0 |
|
|
|
var groupID = 0 |
|
|
|
listofNodes.forEach( function(element) { |
|
|
|
listofNodes.forEach( function(element) { |
|
|
|
groupID++ |
|
|
|
groupID++ |
|
|
|
nodes.push({"name": element, "group": groupID+"_root", "active": true}) |
|
|
|
nodes.push({"name": element, "group": groupID+"_root"}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
var links = [] |
|
|
|
var links = [] |
|
|
@ -753,39 +757,53 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
groupID = 0 |
|
|
|
if (activeNodeLoc != -1) { |
|
|
|
var featureNumber = 0 |
|
|
|
|
|
|
|
listofNodes.forEach( function(element) { |
|
|
|
groupID = 0 |
|
|
|
groupID++ |
|
|
|
var featureNumber = 0 |
|
|
|
nodes.push( |
|
|
|
listofNodes.forEach( function(element) { |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+0], "group": groupID, "active": false}, |
|
|
|
groupID++ |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+1], "group": groupID, "active": false}, |
|
|
|
if ((activeNodeLoc+1) == groupID) { |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+2], "group": groupID, "active": false}, |
|
|
|
nodes.push( |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+3], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+0], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+4], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+1], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+5], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+2], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+6], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+3], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+7], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+4], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+8], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+5], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+9], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+6], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+10], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+7], "group": groupID}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+11], "group": groupID, "active": false}, |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+8], "group": groupID}, |
|
|
|
) |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+9], "group": groupID}, |
|
|
|
featureNumber++ |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+10], "group": groupID}, |
|
|
|
}) |
|
|
|
{"name": featureNames[(featureNumber)*numberOfTransformations+11], "group": groupID}, |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
featureNumber++ |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
Object.entries(pushEachFinal).forEach( |
|
|
|
Object.entries(pushEachFinal).forEach( |
|
|
|
function ([index, feature]) { |
|
|
|
function ([index, feature]) { |
|
|
|
feature.value.forEach(function (element, indexIns) { |
|
|
|
if (index == activeNodeLoc) { |
|
|
|
if (element.valueIns > 0) { |
|
|
|
feature.value.forEach(function (element, indexIns) { |
|
|
|
links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#33a02c"}) |
|
|
|
// if (element.valueIns > 0) { |
|
|
|
} else if (element.valueIns == 0) { |
|
|
|
// links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#33a02c"}) |
|
|
|
links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": 0.01 * 30, "lin_color": "#D3D3D3"}) |
|
|
|
// } else if (element.valueIns == 0) { |
|
|
|
} else { |
|
|
|
// links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": 0.01 * 30, "lin_color": "#D3D3D3"}) |
|
|
|
links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#e31a1c"}) |
|
|
|
// } else { |
|
|
|
|
|
|
|
// links.push({"source": index, "target": (index*feature.value.length+pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#e31a1c"}) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
if (element.valueIns > 0) { |
|
|
|
|
|
|
|
links.push({"source": index, "target": (pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#33a02c"}) |
|
|
|
|
|
|
|
} else if (element.valueIns == 0) { |
|
|
|
|
|
|
|
links.push({"source": index, "target": (pushEachFinal.length+indexIns), "value": 0.01 * 30, "lin_color": "#D3D3D3"}) |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
links.push({"source": index, "target": (pushEachFinal.length+indexIns), "value": Math.abs(element.valueIns) * 30, "lin_color": "#e31a1c"}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.jsonData = {"nodes": nodes, "links": links}; |
|
|
|
this.jsonData = {"nodes": nodes, "links": links}; |
|
|
|
this.graphVizualization() |
|
|
|
this.graphVizualization() |
|
|
@ -793,6 +811,11 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
graphVizualization () { |
|
|
|
graphVizualization () { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var svg = d3.select("#FeatureGraph"); |
|
|
|
|
|
|
|
svg.selectAll("*").remove(); |
|
|
|
|
|
|
|
var svg = d3.select('#chartID') |
|
|
|
|
|
|
|
svg.selectAll("*").remove() |
|
|
|
|
|
|
|
|
|
|
|
var legendCall = this.legendOnlyOnce |
|
|
|
var legendCall = this.legendOnlyOnce |
|
|
|
|
|
|
|
|
|
|
|
var listofNodes = this.dataFS[34] |
|
|
|
var listofNodes = this.dataFS[34] |
|
|
@ -891,11 +914,6 @@ export default { |
|
|
|
.domain(d3.ticks([MIMin, MIMax, 5])) |
|
|
|
.domain(d3.ticks([MIMin, MIMax, 5])) |
|
|
|
.range(['#6baed6','#4292c6','#2171b5','#08519c','#08306b']); |
|
|
|
.range(['#6baed6','#4292c6','#2171b5','#08519c','#08306b']); |
|
|
|
|
|
|
|
|
|
|
|
var svg = d3.select("#FeatureGraph"); |
|
|
|
|
|
|
|
svg.selectAll("*").remove(); |
|
|
|
|
|
|
|
var svg = d3.select('#chartID') |
|
|
|
|
|
|
|
svg.selectAll("*").remove() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var marginNodes = {top: 0, right: 0, bottom: 0, left: 0}; |
|
|
|
var marginNodes = {top: 0, right: 0, bottom: 0, left: 0}; |
|
|
|
var width = 819 - marginNodes.right - marginNodes.left; |
|
|
|
var width = 819 - marginNodes.right - marginNodes.left; |
|
|
|
var height = 819 - marginNodes.top - marginNodes.bottom; |
|
|
|
var height = 819 - marginNodes.top - marginNodes.bottom; |
|
|
@ -942,91 +960,103 @@ export default { |
|
|
|
clearSendNode.push(clickedNode-1) |
|
|
|
clearSendNode.push(clickedNode-1) |
|
|
|
EventBus.$emit('updateHistoryKey', 2) |
|
|
|
EventBus.$emit('updateHistoryKey', 2) |
|
|
|
EventBus.$emit('updateValuesofHistory', clickedNode-1) |
|
|
|
EventBus.$emit('updateValuesofHistory', clickedNode-1) |
|
|
|
EventBus.$emit('UpdateIDTrans', clickedNode+"_root") |
|
|
|
EventBus.$emit('UpdateIDTrans', [clickedNode-1]) |
|
|
|
EventBus.$emit('transformNodes', clearSendNode) |
|
|
|
EventBus.$emit('transformNodes', clearSendNode) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
// for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
// var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
numb = parseInt(numb.join("")) |
|
|
|
// numb = parseInt(numb.join("")) |
|
|
|
|
|
|
|
|
|
|
|
var items = document.getElementsByClassName(numb) |
|
|
|
// var items = document.getElementsByClassName(numb) |
|
|
|
|
|
|
|
|
|
|
|
items.forEach( function (it) { |
|
|
|
// items.forEach( function (it) { |
|
|
|
it.childNodes[0].style.visibility = "hidden"; |
|
|
|
// it.childNodes[0].style.visibility = "hidden"; |
|
|
|
it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
// it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
// it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
it.childNodes[2].style.visibility = "hidden"; |
|
|
|
// it.childNodes[2].style.visibility = "hidden"; |
|
|
|
}) |
|
|
|
// }) |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
// for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
var str = String(graph.nodes[i].group) |
|
|
|
// var str = String(graph.nodes[i].group) |
|
|
|
if (!str.includes("root")) { |
|
|
|
// // if (!str.includes("root")) { |
|
|
|
graph.nodes[i].active = false |
|
|
|
// // graph.nodes[i].active = false |
|
|
|
} else { |
|
|
|
// // } else { |
|
|
|
document.getElementsByClassName(str)[0].childNodes[0].childNodes[1].style.fill = "#D3D3D3" |
|
|
|
// document.getElementsByClassName(str)[0].childNodes[0].childNodes[1].style.fill = "#D3D3D3" |
|
|
|
document.getElementById('svg'+index).childNodes[0].childNodes[1].style.fill = "#707070" |
|
|
|
// document.getElementById('svg'+index).childNodes[0].childNodes[1].style.fill = "#969696" |
|
|
|
} |
|
|
|
// //} |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
node.selectAll('text').remove(); |
|
|
|
// node.selectAll('text').remove(); |
|
|
|
|
|
|
|
|
|
|
|
var labels = node.append("text") |
|
|
|
// var labels = node.append("text") |
|
|
|
.text(function(d) { |
|
|
|
// .text(function(d) { |
|
|
|
return d.name; |
|
|
|
// return d.name; |
|
|
|
}) |
|
|
|
// }) |
|
|
|
.attr('x', 39) |
|
|
|
// .attr('x', function(d) { |
|
|
|
.attr('y', function(d) { |
|
|
|
// let characters = d.name.length |
|
|
|
if(d.active) |
|
|
|
// return 41-Math.pow(characters,1.5) |
|
|
|
return 8 |
|
|
|
// }) |
|
|
|
else |
|
|
|
// .attr('y', function(d) { |
|
|
|
return 35 |
|
|
|
// if(d.active) |
|
|
|
}); |
|
|
|
// return 6 |
|
|
|
|
|
|
|
// else |
|
|
|
node.append('title').text(function (d) { return d.name; }); |
|
|
|
// return 32 |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// node.append('title').text(function (d) { return d.name; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var items = document.getElementsByClassName(groupLoc) |
|
|
|
|
|
|
|
// items.forEach( function (it) { |
|
|
|
|
|
|
|
// if (it.childNodes[0].style.visibility == "hidden") { |
|
|
|
|
|
|
|
// it.childNodes[0].style.visibility = "visible"; |
|
|
|
|
|
|
|
// it.childNodes[1].setAttribute("transform", "translate(50,50) scale(1) rotate(180)"); |
|
|
|
|
|
|
|
// it.childNodes[1].childNodes[0].style.fill = "none"; |
|
|
|
|
|
|
|
// it.childNodes[2].style.visibility = "visible"; |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// it.childNodes[0].style.visibility = "hidden"; |
|
|
|
|
|
|
|
// it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
|
|
|
|
// it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
|
|
|
|
// it.childNodes[2].style.visibility = "hidden"; |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// var regex = /\d+/g |
|
|
|
|
|
|
|
// var string = id.group |
|
|
|
|
|
|
|
// var matches = parseInt(string.match(regex)[0]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (graph.nodes[i].group == matches) { |
|
|
|
|
|
|
|
// graph.nodes[i].active = true |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// node.selectAll('text').remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var labels = node.append("text") |
|
|
|
|
|
|
|
// .text(function(d) { |
|
|
|
|
|
|
|
// return d.name; |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// .attr('x', function(d) { |
|
|
|
|
|
|
|
// let characters = d.name.length |
|
|
|
|
|
|
|
// return 41-Math.pow(characters,1.5) |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// .attr('y', function(d) { |
|
|
|
|
|
|
|
// if(d.active) |
|
|
|
|
|
|
|
// return 6 |
|
|
|
|
|
|
|
// else |
|
|
|
|
|
|
|
// return 32 |
|
|
|
|
|
|
|
// }); |
|
|
|
var groupLoc = index + 1 |
|
|
|
var groupLoc = index + 1 |
|
|
|
var items = document.getElementsByClassName(groupLoc) |
|
|
|
let length = document.getElementsByClassName(groupLoc).length |
|
|
|
items.forEach( function (it) { |
|
|
|
// node.append('title').text(function (d) { return d.name; }); |
|
|
|
if (it.childNodes[0].style.visibility == "hidden") { |
|
|
|
if (length > 0) { |
|
|
|
it.childNodes[0].style.visibility = "visible"; |
|
|
|
EventBus.$emit('UpdateIDTrans', []) |
|
|
|
it.childNodes[1].setAttribute("transform", "translate(50,50) scale(1) rotate(180)"); |
|
|
|
EventBus.$emit('brushLink', -1) |
|
|
|
it.childNodes[1].childNodes[0].style.fill = "none"; |
|
|
|
} else { |
|
|
|
it.childNodes[2].style.visibility = "visible"; |
|
|
|
EventBus.$emit('UpdateIDTrans', [groupLoc-1]) |
|
|
|
} else { |
|
|
|
EventBus.$emit('brushLink', groupLoc-1) |
|
|
|
it.childNodes[0].style.visibility = "hidden"; |
|
|
|
|
|
|
|
it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
|
|
|
|
it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
|
|
|
|
it.childNodes[2].style.visibility = "hidden"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
var regex = /\d+/g |
|
|
|
|
|
|
|
var string = id.group |
|
|
|
|
|
|
|
var matches = parseInt(string.match(regex)[0]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (graph.nodes[i].group == matches) { |
|
|
|
|
|
|
|
graph.nodes[i].active = true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
node.selectAll('text').remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var labels = node.append("text") |
|
|
|
|
|
|
|
.text(function(d) { |
|
|
|
|
|
|
|
return d.name; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.attr('x', 39) |
|
|
|
|
|
|
|
.attr('y', function(d) { |
|
|
|
|
|
|
|
if(d.active) |
|
|
|
|
|
|
|
return 8 |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return 35 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.append('title').text(function (d) { return d.name; }); |
|
|
|
|
|
|
|
EventBus.$emit('brushLink', groupLoc-1) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var groupsColor = d3.select('#svg'+index)._groups['0'][0].childNodes[0].childNodes[1] |
|
|
|
var groupsColor = d3.select('#svg'+index)._groups['0'][0].childNodes[0].childNodes[1] |
|
|
@ -1035,7 +1065,7 @@ export default { |
|
|
|
if (groupsColor.getAttribute('fill') == "#D3D3D3") { |
|
|
|
if (groupsColor.getAttribute('fill') == "#D3D3D3") { |
|
|
|
if (selectionCounter < 3) { |
|
|
|
if (selectionCounter < 3) { |
|
|
|
// add here the different states of comparison! (=2 and =3) |
|
|
|
// add here the different states of comparison! (=2 and =3) |
|
|
|
groupsColor.setAttribute('fill', '#707070') |
|
|
|
groupsColor.setAttribute('fill', '#969696') |
|
|
|
selectionCounter = selectionCounter + 1 |
|
|
|
selectionCounter = selectionCounter + 1 |
|
|
|
EventBus.$emit('Counter', selectionCounter) |
|
|
|
EventBus.$emit('Counter', selectionCounter) |
|
|
|
IDsGather.push(idLocal); |
|
|
|
IDsGather.push(idLocal); |
|
|
@ -1060,7 +1090,7 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
EventBus.$emit('UpdateIDs', IDsGather) |
|
|
|
EventBus.$emit('UpdateIDs', IDsGather) |
|
|
|
if (selectionCounter == 1) { |
|
|
|
if (selectionCounter == 1) { |
|
|
|
//EventBus.$emit('storeGeneration') |
|
|
|
EventBus.$emit('Default') |
|
|
|
} else if (selectionCounter == 2) { |
|
|
|
} else if (selectionCounter == 2) { |
|
|
|
EventBus.$emit('UpdateIDs', IDsGather) |
|
|
|
EventBus.$emit('UpdateIDs', IDsGather) |
|
|
|
EventBus.$emit('CompareTwo', IDsGather) |
|
|
|
EventBus.$emit('CompareTwo', IDsGather) |
|
|
@ -1069,50 +1099,52 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
.on("dblclick", function(id, index) { |
|
|
|
|
|
|
|
for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
|
|
|
|
var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
|
|
|
|
numb = parseInt(numb.join("")) |
|
|
|
|
|
|
|
var items = document.getElementsByClassName(numb) |
|
|
|
|
|
|
|
items.forEach( function (it) { |
|
|
|
|
|
|
|
it.childNodes[0].style.visibility = "hidden"; |
|
|
|
|
|
|
|
it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
|
|
|
|
it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
|
|
|
|
it.childNodes[2].style.visibility = "hidden"; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
var regex = /\d+/g |
|
|
|
|
|
|
|
var string = id.group |
|
|
|
|
|
|
|
var matches = parseInt(string.match(regex)[0]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (graph.nodes[i].group == matches) { |
|
|
|
|
|
|
|
graph.nodes[i].active = false |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
document.getElementById('svg'+index).childNodes[0].childNodes[1].style.fill = "#D3D3D3" |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.selectAll('text').remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var labels = node.append("text") |
|
|
|
|
|
|
|
.text(function(d) { |
|
|
|
|
|
|
|
return d.name; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.attr('x', 39) |
|
|
|
|
|
|
|
.attr('y', function(d) { |
|
|
|
|
|
|
|
if(d.active) |
|
|
|
|
|
|
|
return 8 |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return 35 |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
node.append('title').text(function (d) { return d.name; }); |
|
|
|
|
|
|
|
EventBus.$emit('brushLink', -1) |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
// .on("dblclick", function(id, index) { |
|
|
|
|
|
|
|
// for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
|
|
|
|
// var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
|
|
|
|
// numb = parseInt(numb.join("")) |
|
|
|
|
|
|
|
// var items = document.getElementsByClassName(numb) |
|
|
|
|
|
|
|
// items.forEach( function (it) { |
|
|
|
|
|
|
|
// it.childNodes[0].style.visibility = "hidden"; |
|
|
|
|
|
|
|
// it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
|
|
|
|
// it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
|
|
|
|
// it.childNodes[2].style.visibility = "hidden"; |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// var regex = /\d+/g |
|
|
|
|
|
|
|
// var string = id.group |
|
|
|
|
|
|
|
// var matches = parseInt(string.match(regex)[0]) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (let i = 0; i < graph.nodes.length; i++) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// if (graph.nodes[i].group == matches) { |
|
|
|
|
|
|
|
// graph.nodes[i].active = false |
|
|
|
|
|
|
|
// } else { |
|
|
|
|
|
|
|
// document.getElementById('svg'+index).childNodes[0].childNodes[1].style.fill = "#D3D3D3" |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// node.selectAll('text').remove(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// var labels = node.append("text") |
|
|
|
|
|
|
|
// .text(function(d) { |
|
|
|
|
|
|
|
// return d.name; |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// .attr('x', function(d) { |
|
|
|
|
|
|
|
// let characters = d.name.length |
|
|
|
|
|
|
|
// return 41-Math.pow(characters,1.5) |
|
|
|
|
|
|
|
// }) |
|
|
|
|
|
|
|
// .attr('y', function(d) { |
|
|
|
|
|
|
|
// if(d.active) |
|
|
|
|
|
|
|
// return 6 |
|
|
|
|
|
|
|
// else |
|
|
|
|
|
|
|
// return 32 |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// node.append('title').text(function (d) { return d.name; }); |
|
|
|
|
|
|
|
// EventBus.$emit('brushLink', -1) |
|
|
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
|
|
var chartWidth = 310; |
|
|
|
var chartWidth = 310; |
|
|
|
var chartHeight = 66; |
|
|
|
var chartHeight = 66; |
|
|
@ -1127,7 +1159,7 @@ export default { |
|
|
|
chartHeight = chartHeight - margin.top - margin.bottom; |
|
|
|
chartHeight = chartHeight - margin.top - margin.bottom; |
|
|
|
|
|
|
|
|
|
|
|
var x = d3.scaleLinear() |
|
|
|
var x = d3.scaleLinear() |
|
|
|
.domain([75, 100]) |
|
|
|
.domain([0, 100]) |
|
|
|
.range([0, chartWidth]); |
|
|
|
.range([0, chartWidth]); |
|
|
|
|
|
|
|
|
|
|
|
chartSvg.append('g') |
|
|
|
chartSvg.append('g') |
|
|
@ -1142,7 +1174,8 @@ export default { |
|
|
|
.text("Weighted graph readability (%)"); |
|
|
|
.text("Weighted graph readability (%)"); |
|
|
|
|
|
|
|
|
|
|
|
var readabilityCircles = chartSvg.append('g').selectAll('circle'); |
|
|
|
var readabilityCircles = chartSvg.append('g').selectAll('circle'); |
|
|
|
// 32 parameter combinations |
|
|
|
|
|
|
|
|
|
|
|
// 48 parameter combinations |
|
|
|
var paramGroups = [ |
|
|
|
var paramGroups = [ |
|
|
|
{name: 'chargeStrength', values: [-80]}, |
|
|
|
{name: 'chargeStrength', values: [-80]}, |
|
|
|
{name: 'linkDistance', values: [-80]}, |
|
|
|
{name: 'linkDistance', values: [-80]}, |
|
|
@ -1170,31 +1203,32 @@ export default { |
|
|
|
.data(d3.map(bestParams).keys().filter(function (d) { return d !== 'positions' && d !== 'graphReadability'; })) |
|
|
|
.data(d3.map(bestParams).keys().filter(function (d) { return d !== 'positions' && d !== 'graphReadability'; })) |
|
|
|
.text(function (d) { return d + ' = ' + bestParams[d]; }); |
|
|
|
.text(function (d) { return d + ' = ' + bestParams[d]; }); |
|
|
|
} |
|
|
|
} |
|
|
|
// Plot the number line. |
|
|
|
|
|
|
|
readabilityCircles = readabilityCircles |
|
|
|
|
|
|
|
.data(readabilityCircles.data().concat(params)) |
|
|
|
|
|
|
|
.enter().append('circle') |
|
|
|
|
|
|
|
.attr('cx', function (d) { return x(d.graphReadability*100); }) |
|
|
|
|
|
|
|
.attr('cy', 5) |
|
|
|
|
|
|
|
.attr('r', 4) |
|
|
|
|
|
|
|
.on('click', function (d) { |
|
|
|
|
|
|
|
selectedParams = d; |
|
|
|
|
|
|
|
readabilityCircles.classed('selected', false); |
|
|
|
|
|
|
|
d3.select(this).classed('selected', true).raise(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bestSoFar |
|
|
|
|
|
|
|
.data(d3.map(selectedParams).keys().filter(function (d) { return d !== 'positions' && d !== 'graphReadability'; })) |
|
|
|
|
|
|
|
.text(function (d) { return d + ' = ' + selectedParams[d]; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drawGraph(); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.merge(readabilityCircles) |
|
|
|
|
|
|
|
.classed('selected', function (d) { return d === selectedParams; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readabilityCircles.filter(function (d) { return d === selectedParams; }) |
|
|
|
// Plot the number line. |
|
|
|
.raise(); |
|
|
|
readabilityCircles = readabilityCircles |
|
|
|
|
|
|
|
.data(readabilityCircles.data().concat(params)) |
|
|
|
|
|
|
|
.enter().append('circle') |
|
|
|
|
|
|
|
.attr('cx', function (d) { return x(d.graphReadability*100); }) |
|
|
|
|
|
|
|
.attr('cy', 5) |
|
|
|
|
|
|
|
.attr('r', 4) |
|
|
|
|
|
|
|
.on('click', function (d) { |
|
|
|
|
|
|
|
selectedParams = d; |
|
|
|
|
|
|
|
readabilityCircles.classed('selected', false); |
|
|
|
|
|
|
|
d3.select(this).classed('selected', true).raise(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bestSoFar |
|
|
|
|
|
|
|
.data(d3.map(selectedParams).keys().filter(function (d) { return d !== 'positions' && d !== 'graphReadability'; })) |
|
|
|
|
|
|
|
.text(function (d) { return d + ' = ' + selectedParams[d]; }); |
|
|
|
|
|
|
|
|
|
|
|
drawGraph(); |
|
|
|
drawGraph(); |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
.merge(readabilityCircles) |
|
|
|
|
|
|
|
.classed('selected', function (d) { return d === selectedParams; }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
readabilityCircles.filter(function (d) { return d === selectedParams; }) |
|
|
|
|
|
|
|
.raise(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
drawGraph(); |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
var i = 0; |
|
|
|
var i = 0; |
|
|
@ -1242,8 +1276,8 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
var data = [] |
|
|
|
var data = [] |
|
|
|
var barchartData = [] |
|
|
|
var barchartData = [] |
|
|
|
if (IDsGather.includes(indexNode)) { |
|
|
|
if (IDsGather.includes(indexNode) || IDsGatherTrans.includes(indexNode)) { |
|
|
|
data.push({value: VIFVarFormatted[indexNode], color: '#707070'}) |
|
|
|
data.push({value: VIFVarFormatted[indexNode], color: '#969696'}) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
data.push({value: VIFVarFormatted[indexNode], color: '#D3D3D3'}) |
|
|
|
data.push({value: VIFVarFormatted[indexNode], color: '#D3D3D3'}) |
|
|
|
} |
|
|
|
} |
|
|
@ -1330,6 +1364,7 @@ export default { |
|
|
|
var margin = {top: 0, right: 0, bottom: 0, left: 0}, |
|
|
|
var margin = {top: 0, right: 0, bottom: 0, left: 0}, |
|
|
|
width = 45 - margin.left - margin.right, |
|
|
|
width = 45 - margin.left - margin.right, |
|
|
|
height = 45 - margin.top - margin.bottom; |
|
|
|
height = 45 - margin.top - margin.bottom; |
|
|
|
|
|
|
|
|
|
|
|
g.each(function (d, index) { |
|
|
|
g.each(function (d, index) { |
|
|
|
var el = d3.select(this); |
|
|
|
var el = d3.select(this); |
|
|
|
var path = el.selectAll('path').each(function (r, i) { |
|
|
|
var path = el.selectAll('path').each(function (r, i) { |
|
|
@ -1394,12 +1429,14 @@ export default { |
|
|
|
}) |
|
|
|
}) |
|
|
|
//x position is 3 pixels to the right of the bar |
|
|
|
//x position is 3 pixels to the right of the bar |
|
|
|
.attr("x", function (d) { |
|
|
|
.attr("x", function (d) { |
|
|
|
return x(0); |
|
|
|
return x(38); |
|
|
|
}) |
|
|
|
}) |
|
|
|
.text(function (d) { |
|
|
|
.text(function (d) { |
|
|
|
return d.value; |
|
|
|
return d.value; |
|
|
|
}).style("font-size", "10px") |
|
|
|
}).style("font-size", "10px") |
|
|
|
.style("fill", "white") |
|
|
|
.style("fill", function(d) { |
|
|
|
|
|
|
|
return "black" |
|
|
|
|
|
|
|
}) |
|
|
|
.attr("visibility", "hidden") |
|
|
|
.attr("visibility", "hidden") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -1461,59 +1498,59 @@ export default { |
|
|
|
.text(function(d) { |
|
|
|
.text(function(d) { |
|
|
|
return d.name; |
|
|
|
return d.name; |
|
|
|
}) |
|
|
|
}) |
|
|
|
.attr('x', 39) |
|
|
|
.attr('x', function(d) { |
|
|
|
|
|
|
|
let characters = d.name.length |
|
|
|
|
|
|
|
return 41-Math.pow(characters,1.5) |
|
|
|
|
|
|
|
}) |
|
|
|
.attr('y', function(d) { |
|
|
|
.attr('y', function(d) { |
|
|
|
if(d.active) |
|
|
|
return 6 |
|
|
|
return 8 |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
return 35 |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
node.append('title').text(function (d, i) { |
|
|
|
node.append('title').text(function (d, i) { |
|
|
|
return 'Target COR: '+String(corrGlobFormatted[i])+'%'; |
|
|
|
return 'Target COR: '+String(corrGlobFormatted[i])+'%'; |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
//add zoom capabilities |
|
|
|
//add zoom capabilities |
|
|
|
var zoom_handler = d3.zoom() |
|
|
|
// var zoom_handler = d3.zoom() |
|
|
|
.on("zoom", zoom_actions); |
|
|
|
// .on("zoom", zoom_actions); |
|
|
|
|
|
|
|
|
|
|
|
zoom_handler(svg); |
|
|
|
// zoom_handler(svg); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
// for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
// var numb = graph.nodes[i]['group'].match(/\d/g) |
|
|
|
numb = parseInt(numb.join("")) |
|
|
|
// numb = parseInt(numb.join("")) |
|
|
|
var items = document.getElementsByClassName(numb) |
|
|
|
// var items = document.getElementsByClassName(numb) |
|
|
|
items.forEach( function (it) { |
|
|
|
// items.forEach( function (it) { |
|
|
|
it.childNodes[0].style.visibility = "hidden"; |
|
|
|
// it.childNodes[0].style.visibility = "hidden"; |
|
|
|
it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
// it.childNodes[1].setAttribute("transform", "translate(50,50) scale(0.32) rotate(180)"); |
|
|
|
it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
// it.childNodes[1].childNodes[0].style.fill = "#D3D3D3"; |
|
|
|
it.childNodes[2].style.visibility = "hidden"; |
|
|
|
// it.childNodes[2].style.visibility = "hidden"; |
|
|
|
}) |
|
|
|
// }) |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
//Zoom functions |
|
|
|
//Zoom functions |
|
|
|
function zoom_actions(){ |
|
|
|
// function zoom_actions(){ |
|
|
|
svg.attr("transform", d3.event.transform) |
|
|
|
// svg.attr("transform", d3.event.transform) |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
function drag_start(d) { |
|
|
|
// function drag_start(d) { |
|
|
|
if (!d3.event.active) forceSim.alphaTarget(0.3).restart(); |
|
|
|
// if (!d3.event.active) forceSim.alphaTarget(0.3).restart(); |
|
|
|
d.fx = d.x; |
|
|
|
// d.fx = d.x; |
|
|
|
d.fy = d.y; |
|
|
|
// d.fy = d.y; |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
//make sure you can't drag the circle outside the box |
|
|
|
// //make sure you can't drag the circle outside the box |
|
|
|
function drag_drag(d) { |
|
|
|
// function drag_drag(d) { |
|
|
|
d.fx = d3.event.x; |
|
|
|
// d.fx = d3.event.x; |
|
|
|
d.fy = d3.event.y; |
|
|
|
// d.fy = d3.event.y; |
|
|
|
tickActions(); |
|
|
|
// tickActions(); |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
function drag_end(d) { |
|
|
|
// function drag_end(d) { |
|
|
|
if (!d3.event.active) forceSim.alphaTarget(0); |
|
|
|
// if (!d3.event.active) forceSim.alphaTarget(0); |
|
|
|
d.fx = null; |
|
|
|
// d.fx = null; |
|
|
|
d.fy = null; |
|
|
|
// d.fy = null; |
|
|
|
} |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
|
if (legendCall) { |
|
|
|
if (legendCall) { |
|
|
|
|
|
|
|
|
|
|
@ -1764,11 +1801,11 @@ export default { |
|
|
|
.text("MI") |
|
|
|
.text("MI") |
|
|
|
} |
|
|
|
} |
|
|
|
stepper.stop(); |
|
|
|
stepper.stop(); |
|
|
|
if (IDsGatherTrans != '') { |
|
|
|
// if (IDsGatherTrans != '') { |
|
|
|
let ID = document.getElementsByClassName(IDsGatherTrans)[0].parentElement.getAttribute('id') |
|
|
|
// let ID = document.getElementsByClassName(IDsGatherTrans)[0].parentElement.getAttribute('id') |
|
|
|
d3.select('#'+ID).dispatch('click'); |
|
|
|
// d3.select('#'+ID).dispatch('click'); |
|
|
|
IDsGatherTrans = '' |
|
|
|
// IDsGatherTrans = '' |
|
|
|
} |
|
|
|
// } |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
@ -1783,8 +1820,8 @@ export default { |
|
|
|
node |
|
|
|
node |
|
|
|
.attr("id", function(d, i) { return "g" + (i); }) |
|
|
|
.attr("id", function(d, i) { return "g" + (i); }) |
|
|
|
.attr("transform", function(d, i) { |
|
|
|
.attr("transform", function(d, i) { |
|
|
|
d.x = d.x - 50 |
|
|
|
d.x = d.x - 52 |
|
|
|
d.y = d.y - 50 |
|
|
|
d.y = d.y - 45 |
|
|
|
return "translate(" + d.x + "," + d.y + ")"; |
|
|
|
return "translate(" + d.x + "," + d.y + ")"; |
|
|
|
}) |
|
|
|
}) |
|
|
|
}; |
|
|
|
}; |
|
|
@ -1868,6 +1905,8 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
mounted () { |
|
|
|
|
|
|
|
EventBus.$on('brushLink', data => { this.activeLeafNode = data }) |
|
|
|
|
|
|
|
EventBus.$on('brushLink', this.initializeNetwork) |
|
|
|
|
|
|
|
|
|
|
|
EventBus.$on('Counter', data => { this.keepNumberOfCompareNodes = data }) |
|
|
|
EventBus.$on('Counter', data => { this.keepNumberOfCompareNodes = data }) |
|
|
|
EventBus.$on('UpdateIDs', data => { this.KeepIDs = data }) |
|
|
|
EventBus.$on('UpdateIDs', data => { this.KeepIDs = data }) |
|
|
|