|
|
|
@ -22,15 +22,23 @@ export default { |
|
|
|
|
scoresMeanBest: [], |
|
|
|
|
scoresSTDBest: [], |
|
|
|
|
xaxis: [], |
|
|
|
|
valuesGlobal: [1, 0, 0, 0], // initial |
|
|
|
|
valuesGlobal: [], |
|
|
|
|
historyKey: -1, |
|
|
|
|
whereIsChange: -1, |
|
|
|
|
previousState: [], |
|
|
|
|
storeBestSoFarAV: [], |
|
|
|
|
flag: true |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
HistoryPun() { |
|
|
|
|
var state = this.globalStep + 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.globalStep = this.globalStep + 1 |
|
|
|
|
var state = this.globalStep |
|
|
|
|
if (state == 1) { |
|
|
|
|
this.storeBestSoFarAV = ((parseFloat(this.scoresMeanBest[0]) + parseFloat(this.scoresMeanBest[1]) + parseFloat(this.scoresMeanBest[2])) / 3) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var svg = d3.select("#HistoryPlot"); |
|
|
|
|
svg.selectAll("*").remove(); |
|
|
|
|
|
|
|
|
@ -62,11 +70,40 @@ export default { |
|
|
|
|
var data = [] |
|
|
|
|
|
|
|
|
|
var features = this.featuresReceived[33] |
|
|
|
|
if (this.historyKey == -1) { |
|
|
|
|
for (let i = 0; i < features.length; i++) { |
|
|
|
|
this.valuesGlobal.push([state,0,0,0]) |
|
|
|
|
} |
|
|
|
|
} else if (this.historyKey == 0) { |
|
|
|
|
this.valuesGlobal[this.whereIsChange][this.historyKey] = state |
|
|
|
|
} else if (this.historyKey == 1) { |
|
|
|
|
this.valuesGlobal[this.whereIsChange][this.historyKey] = state |
|
|
|
|
} else if (this.historyKey == 2) { |
|
|
|
|
this.valuesGlobal[this.whereIsChange][this.historyKey] = state |
|
|
|
|
} else if (this.historyKey == 3) { |
|
|
|
|
for (let j = 0; j < this.whereIsChange.length; j++) { |
|
|
|
|
this.valuesGlobal[this.whereIsChange[j]][this.historyKey] = state |
|
|
|
|
} |
|
|
|
|
} else if (this.historyKey == 4) { |
|
|
|
|
for (let j = 0; j < this.whereIsChange.length; j++) { |
|
|
|
|
this.valuesGlobal[this.whereIsChange[j]][0] = state |
|
|
|
|
} |
|
|
|
|
} else if (this.historyKey == 5) { |
|
|
|
|
this.valuesGlobal.push([state,0,0,0]) |
|
|
|
|
} else { |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var toWhichFeature = this.historyKey |
|
|
|
|
var toWhichPosition = this.whereIsChange |
|
|
|
|
var counterSet = 0 |
|
|
|
|
|
|
|
|
|
var labelsX = ['Include', 'Exclude', 'Transform', 'Generate'] |
|
|
|
|
console.log(this.valuesGlobal) |
|
|
|
|
for (let i=0; i< features.length; i++) { |
|
|
|
|
data.push({ |
|
|
|
|
label: features[i], |
|
|
|
|
values: this.valuesGlobal |
|
|
|
|
values: this.valuesGlobal[i] |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -118,6 +155,11 @@ export default { |
|
|
|
|
.attr('r', 0) |
|
|
|
|
.remove() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.storeBestSoFarAV > ((this.scoresMeanBest[0] + this.scoresMeanBest[1] + this.scoresMeanBest[2]) / 3)) { |
|
|
|
|
this.flag = true |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var previously = this.previousState |
|
|
|
|
|
|
|
|
|
var testLoc = this.flag |
|
|
|
@ -128,21 +170,25 @@ export default { |
|
|
|
|
.attr('cx', function(d, i){ return i * maxR * 2 + maxR }) |
|
|
|
|
.style('fill', function(d){ |
|
|
|
|
if (testLoc) { |
|
|
|
|
if (toWhichFeature == -1) { |
|
|
|
|
previously.push('#B15928') |
|
|
|
|
return previously[counterSet] |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
if (d == state) { |
|
|
|
|
previously.push(c(color)) |
|
|
|
|
return '#B15928' |
|
|
|
|
previously[counterSet] = 'rgb(' + c(d) + ',' + c(d) + ',' + c(d) + ')' |
|
|
|
|
} else { |
|
|
|
|
previously.push(c(0)) |
|
|
|
|
return 'rgb(' + c(d) + ',' + c(d) + ',' + c(d) + ')' |
|
|
|
|
return previously[counterSet] |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
return 'rgb(' + c(d) + ',' + c(d) + ',' + c(d) + ')' |
|
|
|
|
} |
|
|
|
|
counterSet = counterSet + 1 |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
this.flag = false |
|
|
|
|
this.previousState = previously |
|
|
|
|
|
|
|
|
|
console.log(this.previousState) |
|
|
|
|
|
|
|
|
|
var dotLabels = rows.selectAll('.dot-label') |
|
|
|
|
.data(function(d){ return d.values }) |
|
|
|
|
|
|
|
|
@ -389,6 +435,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted () { |
|
|
|
|
|
|
|
|
|
EventBus.$on('updateHistoryKey', data => { this.historyKey = data }) |
|
|
|
|
EventBus.$on('updateValuesofHistory', data => { this.whereIsChange = data }) |
|
|
|
|
|
|
|
|
|
EventBus.$on('finalResults', data => { this.ValidResultsVar = data }) |
|
|
|
|
EventBus.$on('finalResults', this.initializeLinePLot) |
|
|
|
|
|
|
|
|
|