|
|
|
@ -1,15 +1,15 @@ |
|
|
|
|
<template> |
|
|
|
|
<div class="column"> |
|
|
|
|
<div id="FeatureGraph" style="border-style: solid; border-width: 2px; border-color: yellow; min-height: 504px; max-height: 504px; min-width: 1230px"></div> |
|
|
|
|
<div id="toolbar" style="min-height: 66px; max-height: 66px; margin-top: 20px"> |
|
|
|
|
<div id="toolbar" style="min-height: 67px; max-height: 67px; margin-top: 20px"> |
|
|
|
|
<div class="panel panel-default" data-placement="center"> |
|
|
|
|
<div class="panel-body" id="resetAllFilters" data-placement="center" style="margin-top: 3px"> |
|
|
|
|
<table class="table table-borderless centerTable" > |
|
|
|
|
<tbody> |
|
|
|
|
<tr> |
|
|
|
|
<td scope="row"><button class="btn btn-primary active" onclick="setLayerProj();" style="margin-left: -1px !important" ><font-awesome-icon icon="search" style="margin-right: 5px"/>Feature exploration</button></td> |
|
|
|
|
<td><button class="btn btn-primary" onclick="setLayerComp();" style="margin-left: -1.4px"><font-awesome-icon icon="balance-scale-left" style="margin-right: 5px" />Feature comparison</button></td> |
|
|
|
|
<td scope="row"><button class="btn btn-primary" onclick="setLayerSche();" style="margin-left: -2px !important"><font-awesome-icon icon="wrench" style="margin-right: 5px" />Feature engineering</button></td> |
|
|
|
|
<td scope="row"><button class="btn btn-primary active" id="initButton" v-on:click="setLayerExplore" style="margin-left: -1px !important" ><font-awesome-icon icon="search" style="margin-right: 5px"/>Feature exploration</button></td> |
|
|
|
|
<td><button class="btn btn-primary" v-on:click="setLayerCompare" style="margin-left: -1.4px"><font-awesome-icon icon="balance-scale-left" style="margin-right: 5px" />Feature comparison</button></td> |
|
|
|
|
<td scope="row"><button class="btn btn-primary" v-on:click="setLayerEngineer" style="margin-left: -2px !important"><font-awesome-icon icon="wrench" style="margin-right: 5px" />Feature engineering</button></td> |
|
|
|
|
</tr> |
|
|
|
|
</tbody> |
|
|
|
|
</table> |
|
|
|
@ -39,11 +39,22 @@ export default { |
|
|
|
|
corrMatrixCombTotal: [], |
|
|
|
|
VIFRemaining: [], |
|
|
|
|
MIRemaining: [], |
|
|
|
|
computeNodes: 0, |
|
|
|
|
featureAddRemCount: [], |
|
|
|
|
mode: 0, // this should be 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
setLayerExplore() { |
|
|
|
|
this.mode = 0 |
|
|
|
|
this.graphVizualization() |
|
|
|
|
}, |
|
|
|
|
setLayerCompare() { |
|
|
|
|
this.mode = 1 |
|
|
|
|
this.graphVizualization() |
|
|
|
|
}, |
|
|
|
|
setLayerEngineer() { |
|
|
|
|
this.mode = 2 |
|
|
|
|
}, |
|
|
|
|
computeOnce () { |
|
|
|
|
var listofNodes = this.dataFS[0] |
|
|
|
|
var dataLocOnce = [] |
|
|
|
@ -328,8 +339,6 @@ export default { |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
graphVizualization () { |
|
|
|
|
|
|
|
|
|
var computeNodesVar = this.computeNodes |
|
|
|
|
var listofNodes = this.dataFS[0] |
|
|
|
|
|
|
|
|
|
var corrTarget = JSON.parse(this.dataFS[8+this.quadrantNumber]) |
|
|
|
@ -449,7 +458,9 @@ export default { |
|
|
|
|
.enter().append('line') |
|
|
|
|
.attr("stroke", function(d) { return d.lin_color; }) |
|
|
|
|
.attr("stroke-width", function(d) { return Math.sqrt(d.value); }); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var modeLoc = this.mode |
|
|
|
|
var selectionCounter = 0 |
|
|
|
|
|
|
|
|
|
var node = svg.append('g') |
|
|
|
|
.attr('class', 'nodes') |
|
|
|
@ -457,24 +468,38 @@ export default { |
|
|
|
|
.data(graph.nodes) |
|
|
|
|
.enter().append('g') |
|
|
|
|
.on("click", 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) |
|
|
|
|
if (modeLoc == 0) { |
|
|
|
|
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.style.visibility = "hidden"; |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
var groupLoc = index + 1 |
|
|
|
|
var items = document.getElementsByClassName(groupLoc) |
|
|
|
|
items.forEach( function (it) { |
|
|
|
|
it.style.visibility = "hidden"; |
|
|
|
|
if (it.style.visibility == "hidden") { |
|
|
|
|
it.style.visibility = "visible"; |
|
|
|
|
} else { |
|
|
|
|
it.style.visibility = "hidden"; |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
var groupLoc = index + 1 |
|
|
|
|
var items = document.getElementsByClassName(groupLoc) |
|
|
|
|
items.forEach( function (it) { |
|
|
|
|
if (it.style.visibility == "hidden") { |
|
|
|
|
it.style.visibility = "visible"; |
|
|
|
|
EventBus.$emit('brushLink', groupLoc-1) |
|
|
|
|
} else { |
|
|
|
|
var groupsColor = d3.select('#svg'+index)._groups['0'][0].childNodes[3].childNodes[0] |
|
|
|
|
if (groupsColor.getAttribute('fill') == "black") { |
|
|
|
|
if (selectionCounter < 3) { |
|
|
|
|
// add here the different states of comparison! (=2 and =3) |
|
|
|
|
groupsColor.setAttribute('fill', 'yellow') |
|
|
|
|
selectionCounter = selectionCounter + 1 |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
it.style.visibility = "hidden"; |
|
|
|
|
groupsColor.setAttribute('fill', 'black') |
|
|
|
|
selectionCounter = selectionCounter - 1 |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
EventBus.$emit('brushLink', groupLoc-1) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.on("dblclick", function(id, index) { |
|
|
|
|
for (let i = 0; i < listofNodes.length; i++) { |
|
|
|
@ -553,7 +578,7 @@ export default { |
|
|
|
|
var innerRadius = arcSize * 2; |
|
|
|
|
|
|
|
|
|
var svgLoc = node.append('svg').attr('width', widthLoc).attr('height', widthLoc).attr("class", function(d, i) { return d.group; }) |
|
|
|
|
.attr("id", function(d, i) { return "svg" + (i+computeNodesVar); }) |
|
|
|
|
.attr("id", function(d, i) { return "svg" + (i); }) |
|
|
|
|
|
|
|
|
|
graph.nodes.forEach(function(itemVal, indexNode) { |
|
|
|
|
|
|
|
|
@ -564,8 +589,7 @@ export default { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var length = data.length |
|
|
|
|
data.push({value: 100, label: corrGlobFormatted[indexNode], color: '#000000', lcolor: colorsScaleNodes(MIVar[indexNode])}) |
|
|
|
|
|
|
|
|
|
data.push({value: 100, label: corrGlobFormatted[indexNode], color: 'black', lcolor: colorsScaleNodes(MIVar[indexNode])}) |
|
|
|
|
|
|
|
|
|
var border = VIFVarFormatted[indexNode] |
|
|
|
|
|
|
|
|
@ -592,7 +616,7 @@ export default { |
|
|
|
|
return d.value; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
var id = indexNode + computeNodesVar |
|
|
|
|
var id = indexNode |
|
|
|
|
var g = d3.select('#svg'+id).selectAll('g').data(pieData).enter() |
|
|
|
|
.append('g') |
|
|
|
|
.attr('transform', 'translate(' + widthLoc / 2 + ',' + widthLoc / 2 + ') rotate(180)'); |
|
|
|
@ -655,12 +679,12 @@ export default { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
var drag_handler = d3.drag() |
|
|
|
|
.on("start", drag_start) |
|
|
|
|
.on("drag", drag_drag) |
|
|
|
|
.on("end", drag_end); |
|
|
|
|
// var drag_handler = d3.drag() |
|
|
|
|
// .on("start", drag_start) |
|
|
|
|
// .on("drag", drag_drag) |
|
|
|
|
// .on("end", drag_end); |
|
|
|
|
|
|
|
|
|
drag_handler(node); |
|
|
|
|
// drag_handler(node); |
|
|
|
|
|
|
|
|
|
var labels = node.append("text") |
|
|
|
|
.text(function(d) { |
|
|
|
@ -725,7 +749,7 @@ export default { |
|
|
|
|
.attr('y2', function (d) { return d.target.y; }); |
|
|
|
|
|
|
|
|
|
node |
|
|
|
|
.attr("id", function(d, i) { return "g" + (i+computeNodesVar); }) |
|
|
|
|
.attr("id", function(d, i) { return "g" + (i); }) |
|
|
|
|
.attr("transform", function(d, i) { |
|
|
|
|
d.x = d.x - 50 |
|
|
|
|
d.y = d.y - 50 |
|
|
|
@ -802,10 +826,6 @@ export default { |
|
|
|
|
return forceSim; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.computeNodes = this.computeNodes + graph.nodes.length |
|
|
|
|
|
|
|
|
|
EventBus.$emit('countNodes2', this.computeNodes) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
reset () { |
|
|
|
|
var svg = d3.select("#FeatureGraph"); |
|
|
|
@ -814,17 +834,33 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
EventBus.$on('updateSlice', data => { this.quadrantNumber = data }) |
|
|
|
|
EventBus.$on('updateSlice', data => { |
|
|
|
|
document.getElementById("initButton").click() |
|
|
|
|
}) |
|
|
|
|
EventBus.$on('updateSlice', this.setLayerExplore) |
|
|
|
|
EventBus.$on('updateSlice', this.initializeNetwork) |
|
|
|
|
|
|
|
|
|
EventBus.$on('quadTrans', data => { this.dataFSTrans = data }) |
|
|
|
|
EventBus.$on('quad', data => { this.dataFS = data }) |
|
|
|
|
EventBus.$on('quad', this.computeOnce) |
|
|
|
|
EventBus.$on('quad', this.initializeNetwork) |
|
|
|
|
EventBus.$on('countNodes1', data => { this.computeNodes = data }) |
|
|
|
|
|
|
|
|
|
EventBus.$on('removeFeatures', data => { this.featureAddRemCount = data }) |
|
|
|
|
|
|
|
|
|
EventBus.$on('reset', this.reset) |
|
|
|
|
|
|
|
|
|
// Get the container element |
|
|
|
|
var btnContainer2 = document.getElementById("resetAllFilters"); //resetAllFilters button |
|
|
|
|
// Get all buttons with class="btn" inside the container |
|
|
|
|
var btns2 = btnContainer2.getElementsByClassName("btn"); |
|
|
|
|
|
|
|
|
|
for (var i = 0; i < btns2.length; i++) { |
|
|
|
|
btns2[i].addEventListener("click", function() { |
|
|
|
|
let current = document.getElementsByClassName("active"); |
|
|
|
|
current[0].className = current[0].className.replace("btn btn-primary active", "btn btn-primary"); |
|
|
|
|
this.className += " active"; |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|