diff --git a/frontend/src/components/DataSpace.vue b/frontend/src/components/DataSpace.vue index 1ff60da..351d663 100644 --- a/frontend/src/components/DataSpace.vue +++ b/frontend/src/components/DataSpace.vue @@ -2,6 +2,7 @@
+
@@ -19,7 +20,8 @@ export default { PositiveValue: 75, NegativeValue: 25, storeColor: [], - status: true + status: true, + rootIDSelected: 1, } }, methods: { @@ -155,7 +157,7 @@ export default { .data(data) beeswarm() - + nodes.enter().append("circle") .attr("class", "node") .attr("cx", function(d) { return xScale(d.x) }) @@ -163,7 +165,7 @@ export default { .attr("r", dr) .attr("fill", colorX) .style("stroke", "black") - .style("stroke-width", 4) + .style("stroke-width", 1) .on("mouseover", function(d) { tooltip.select(".system").html(d.system) return tooltip.select(".label").html(d.label) @@ -305,30 +307,6 @@ export default { .attr(lineAttributes) .call(drag); - svgLines - .append("text") - .attr("x", 0.5*width/4).attr("y", 210) - .style("text-anchor", "middle") - .style("font-size", "16px").text("Worst"); - - svgLines - .append("text") - .attr("x", 1.5*width/4).attr("y", 210) - .style("text-anchor", "middle") - .style("font-size", "16px").text("Bad"); - - svgLines - .append("text") - .attr("x", 2.5*width/4).attr("y", 210) - .style("text-anchor", "middle") - .style("font-size", "16px").text("Good"); - - svgLines - .append("text") - .attr("x", 3.5*width/4).attr("y", 210) - .style("text-anchor", "middle") - .style("font-size", "16px").text("Best"); - function dragstarted() { if (d3.select(this)[0][0].id == 2) { d3.select(this).classed(activeClassName, false); @@ -402,6 +380,153 @@ export default { d3.select(this).classed(activeClassName, false); } }, + updateSliders () { + + var svg = d3.select("#TextLabels"); + svg.selectAll("*").remove(); + + var width = 2525 + var height = 225 + + var svgLines = d3.select('#TextLabels').append('svg'); + svgLines.attr('width', width); + svgLines.attr('height', height); + + if (this.rootIDSelected == 1) { + svgLines + .append("text") + .attr("x", 0.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Worst") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 1.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Bad") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 2.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Good") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 3.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Best") + .style("font-weight", "bold"); + + } else if (this.rootIDSelected == 2) { + svgLines + .append("text") + .attr("x", 0.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Worst"); + + svgLines + .append("text") + .attr("x", 1.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Bad"); + + svgLines + .append("text") + .attr("x", 2.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Good"); + + svgLines + .append("text") + .attr("x", 3.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Best") + .style("font-weight", "bold"); + + } else if (this.rootIDSelected == 3) { + svgLines + .append("text") + .attr("x", 0.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Worst"); + + svgLines + .append("text") + .attr("x", 1.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Bad"); + + svgLines + .append("text") + .attr("x", 2.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Good") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 3.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Best"); + + } else if (this.rootIDSelected == 4) { + svgLines + .append("text") + .attr("x", 0.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Worst"); + + svgLines + .append("text") + .attr("x", 1.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Bad") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 2.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Good"); + + svgLines + .append("text") + .attr("x", 3.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Best"); + + } else { + svgLines + .append("text") + .attr("x", 0.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Worst") + .style("font-weight", "bold"); + + svgLines + .append("text") + .attr("x", 1.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Bad"); + + svgLines + .append("text") + .attr("x", 2.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Good"); + + svgLines + .append("text") + .attr("x", 3.5*width/4).attr("y", 210) + .style("text-anchor", "middle") + .style("font-size", "16px").text("Best"); + + } + }, reset () { var svg = d3.select("#BeeSwarm"); svg.selectAll("*").remove(); @@ -411,6 +536,9 @@ export default { }, }, mounted () { + EventBus.$on('keepRootFun', data => { this.rootIDSelected = data }) + EventBus.$on('dataSpace', this.updateSliders) + EventBus.$on('ConfirmDataSet', data => {this.status = false}) EventBus.$on('SendtheChangeinRangePos', data => {this.PositiveValue = data}) @@ -438,6 +566,7 @@ text { #BeeSwarm { position: absolute; top: 0; left: 0; z-index: 1} #Sliders { position: absolute; top: 0; left: 0; z-index: 2} #NoAction { position: absolute; top: 0; left: 0; z-index: -1} +#TextLabels {position: absolute; top: 0; left: 0; z-index: 3} .active-d3-item { cursor: pointer; diff --git a/frontend/src/components/FeatureSpaceDetail.vue b/frontend/src/components/FeatureSpaceDetail.vue index 8b596ac..53e2586 100644 --- a/frontend/src/components/FeatureSpaceDetail.vue +++ b/frontend/src/components/FeatureSpaceDetail.vue @@ -1,27 +1,29 @@