Commit fff86753 authored by wangdong's avatar wangdong

fin

parent 71f1ccd7
<template> <template>
<div> <div>
<div id="flex1" > <!-- {{ normal_ai_u }} -->
<div id="left"> <div id="flex1">
<svg id="d3js" width="620px" height="200px"></svg> <div id="left">
<svg id="d3js1" width="620px" height="200px"></svg> <svg id="d3js" width="620px" height="200px"></svg>
<svg id="d3js2" width="620px" height="200px"></svg> <svg id="d3js1" width="620px" height="200px"></svg>
</div> <svg id="d3js2" width="620px" height="200px"></svg>
<div id="right"> </div>
<svg id="d3js4" width="620px" height="200px"></svg> <div id="right">
</div> <svg id="d3js3" width="620px" height="200px"></svg>
<!-- <iframe id="show-iframe" style="height:500px;width:100%" frameborder=0 name="showHere" scrolling=auto :src="src"></iframe> -->
</div> <svg id="d3js4" width="620px" height="200px"></svg>
</div>
<!-- <iframe id="show-iframe" style="height:500px;width:100%" frameborder=0 name="showHere" scrolling=auto :src="src"></iframe> -->
</div>
</div> </div>
</template> </template>
...@@ -19,7 +22,7 @@ import Vue from "vue"; ...@@ -19,7 +22,7 @@ import Vue from "vue";
import vueJsonTreeView from "vue-json-tree-view"; import vueJsonTreeView from "vue-json-tree-view";
import * as timechart from "../../../utils/timechart"; import * as timechart from "../../../utils/timechart";
import * as graph from "../../../utils/graph"; import * as graph from "../../../utils/graph";
import * as numbers from 'numbers' import * as numbers from "numbers";
import * as d3 from "d3"; import * as d3 from "d3";
// 渲染进程接收主进程的传参 // 渲染进程接收主进程的传参
const { ipcRenderer } = require("electron"); const { ipcRenderer } = require("electron");
...@@ -34,15 +37,18 @@ export default { ...@@ -34,15 +37,18 @@ export default {
color_arrs: ["info", "danger", "warning", "success"], color_arrs: ["info", "danger", "warning", "success"],
slices_getter: "a", slices_getter: "a",
timechart: [], timechart: [],
mult:0, mult: 0,
mult1:0, mult1: 0,
mult2:0, mult2: 0,
}; };
}, },
computed: { computed: {
slice_info() { slice_info() {
return this.$store.state.slice_info; return this.$store.state.slice_info;
}, },
up() {
return this.$store.state.up;
},
total_prb() { total_prb() {
return this.$store.state.slice_info; return this.$store.state.slice_info;
}, },
...@@ -52,7 +58,7 @@ export default { ...@@ -52,7 +58,7 @@ export default {
for (let j = 0; j < slice_info.length; j++) { for (let j = 0; j < slice_info.length; j++) {
let index = slice_info[j].id; let index = slice_info[j].id;
if (j < 3) { if (j < 3) {
res.push(Number((slice_info[j].ddqn.arb ) / 25).toFixed(2)*1); res.push(Number(slice_info[j].ddqn.arb / 25).toFixed(2) * 1);
} }
} }
return res; return res;
...@@ -64,13 +70,12 @@ export default { ...@@ -64,13 +70,12 @@ export default {
return this.$store.state.re; return this.$store.state.re;
}, },
getterSliceRate() { getterSliceRate() {
let slice_info =this.$store.state.slice_info let slice_info = this.$store.state.slice_info;
let rate=[] let rate = [];
slice_info.forEach((v,k)=>{ slice_info.forEach((v, k) => {
if(k<3) if (k < 3) rate.push([v.ddqn.thrpt1, this.$store.state.re[k]]);
rate.push([v.ddqn.thrpt1,this.$store.state.re[k]]) });
})
return rate; return rate;
}, },
ai_d() { ai_d() {
...@@ -80,7 +85,9 @@ export default { ...@@ -80,7 +85,9 @@ export default {
for (let j = 0; j < slice_info.length; j++) { for (let j = 0; j < slice_info.length; j++) {
let index = slice_info[j].id; let index = slice_info[j].id;
if (j < 3) { if (j < 3) {
res.push((Math.abs(Number(re[j] - slice_info[j].ddqn.thrpt1).toFixed(2)))); res.push(
Math.abs(Number(re[j] - slice_info[j].ddqn.thrpt1).toFixed(2))
);
} }
} }
return res; return res;
...@@ -92,174 +99,260 @@ export default { ...@@ -92,174 +99,260 @@ export default {
for (let j = 0; j < ue_list.length; j++) { for (let j = 0; j < ue_list.length; j++) {
let index = ue_list[j].id; let index = ue_list[j].id;
if (j < 3) { if (j < 3) {
res.push((Math.abs(Number(re[j] - ue_list[j].Mbs).toFixed(2)))); res.push(Math.abs(Number(re[j] - ue_list[j].Mbs).toFixed(2)));
} }
} }
return res; return res;
}, },
normal_ai_u() {
let res = 0;
let res1 = 0;
let re = this.$store.state.re;
let ue_list = this.$store.state.ue_list1;
let ue_list0 = this.$store.state.ue_list;
for (let j = 0; j < ue_list.length; j++) {
let index = ue_list[j].dlPrb;
console.log(ue_list[j].dlPrb);
res += Number(index);
}
let slice_info = this.$store.state.slice_info;
slice_info.forEach((v, k) => {
if (k < 3) {
res1 += Number(v.ddqn.arb);
console.log(v.ddqn.arb);
}
});
console.log("res")
console.log(res)
return [res * 4 > 100 ? 100 : res * 4, res1 * 4];
},
}, },
watch: { watch: {
slice_info: { slice_info: {
handler(newValue, oldValue) { handler(newValue, oldValue) {
this.mult=1/numbers.matrix.dotproduct(this.ai_u, this.ai_d); this.mult2 =
this.mult1=1/numbers.matrix.dotproduct(this.normal_d, [0.25,0.25,0.25]); this.normal_ai_u[0] - this.normal_ai_u[1] > 0
this.mult2=(this.mult-this.mult1)/this.mult1; ? this.normal_ai_u[0] - this.normal_ai_u[1]
: 0;
this.$store.commit("up", { this.$store.commit("up", {
up: Math.abs(this.mult2*100)==Infinity?0:Math.abs(this.mult2*100), up: Math.abs(this.mult2) == Infinity ? 0 : Math.abs(this.mult2),
}); });
let rate_to_show=this.getterSliceRate let rate_to_show = this.getterSliceRate;
if (this.timechart) if (this.timechart)
this.timechart.forEach((v,k)=>{ this.timechart.forEach((v, k) => {
if (v && k<3) { if (v && k < 3) {
let ue_list = this.$store.state.ue_list1; let ue_list = this.$store.state.ue_list1;
rate_to_show[k%3].push(ue_list[k].Mbs) rate_to_show[k % 3].push(ue_list[k].Mbs);
var bytes = rate_to_show[k%3]; var bytes = rate_to_show[k % 3];
var stamp = Date.now() / 1000; var stamp = Date.now() / 1000;
if (v.bytes !== undefined) { if (v.bytes !== undefined) {
v.chart.append( v.chart.append(
stamp /* seconds! */, stamp /* seconds! */,
v.bytes.map((d, i) => { v.bytes.map((d, i) => {
if (d === undefined || bytes[i] === undefined) return undefined; if (d === undefined || bytes[i] === undefined)
// Value is bits/second estimate return undefined;
else return bytes[i]; // Value is bits/second estimate
}) else return bytes[i];
); })
} );
v.bytes = bytes; }
v.stamp = stamp; v.bytes = bytes;
} v.stamp = stamp;
if (v && k>=3) { }
let ue_list = this.$store.state.ue_list1; if (v && k >= 3) {
if(k==3) let ue_list = this.$store.state.ue_list1;
var bytes = [(Math.abs(this.mult2*100)==Infinity?0:Math.abs(this.mult2*100))>400?400:(Math.abs(this.mult2*100)==Infinity?0:Math.abs(this.mult2*100)),30] if (k == 3) var bytes = this.normal_ai_u;
var stamp = Date.now() / 1000; if (k == 4) {var bytes = [Math.abs(this.mult2) == Infinity ? 0 : Math.abs(this.mult2),this.up];
if (v.bytes !== undefined) { v.chart.text(this.up,(Math.abs(this.mult2) == Infinity ? 0 : Math.abs(this.mult2)).toString())
v.chart.append(
stamp /* seconds! */,
v.bytes.map((d, i) => { }
if (d === undefined || bytes[i] === undefined) return undefined; var stamp = Date.now() / 1000;
// Value is bits/second estimate if (v.bytes !== undefined) {
else return bytes[i]; v.chart.append(
}) stamp /* seconds! */,
); v.bytes.map((d, i) => {
} if (d === undefined || bytes[i] === undefined)
v.bytes = bytes; return undefined;
v.stamp = stamp; // Value is bits/second estimate
} else return bytes[i];
}) })
);
}
v.bytes = bytes;
v.stamp = stamp;
}
});
}, },
deep: true, deep: true,
}, },
}, },
mounted() { mounted() {
this.timechart.push(this.create("rate", "App切片速率(Mps)", "#d3js"));
this.timechart.push(this.create("rate","App切片速率/目标速率(Mps)", "#d3js")); this.timechart.push(this.create("rate", "Audio切片速率(Mps)", "#d3js1"));
this.timechart.push(this.create("rate","Audio切片速率/目标速率(Mps)", "#d3js1")); this.timechart.push(this.create("rate", "Video切片速率(Mps)", "#d3js2"));
this.timechart.push(this.create("rate","Video切片速率/目标速率(Mps)", "#d3js2")); this.timechart.push(this.create("percent", "资源占用情况", "#d3js3"));
this.timechart.push(this.create("percent","资源利用提升值", "#d3js4")); this.timechart.push(this.create("percent", "资源利用提升值", "#d3js4"));
}, },
methods: { methods: {
create(mode,name, id) { create(mode, name, id) {
let colors = ['#1f77b4','#ff7f0e','2ca02c'] let colors = ["#1f77b4", "#ff7f0e", "2ca02c"];
var legend=d3.select(id) var legend = d3.select(id);
if(id=="#d3js" || id=="#d3js1" ||id=="#d3js2" ){ if (id == "#d3js" || id == "#d3js1" || id == "#d3js2") {
legend.append("rect") legend
.attr("transform", "translate(" + 535 + "," +70 + ")") .append("rect")
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置 .attr("transform", "translate(" + 535 + "," + 70 + ")")
// .attr("x", (width / 160) * 157) // .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同 // .attr("x", (width / 160) * 157)
// .attr("y", 8) //或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
.attr("width", 90) // .attr("y", 8)
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解 .attr("width", 90)
.style("fill", function(d){ .attr("height", 1) //设低一些就是线,高一些就是面,很好理解
return "#ff7f0e" .style("fill", function (d) {
}); return "#ff7f0e";
});
legend.append("text") legend
.attr("transform", "translate(" + 605 + "," +60 + ")") .append("text")
.style("text-anchor", "end") //样式对齐 .attr("transform", "translate(" + 605 + "," + 60 + ")")
.text(function(d) { .style("text-anchor", "end") //样式对齐
return "速率要求"; .text(function (d) {
}); return "目标速率";
legend.append("rect") });
.attr("transform", "translate(" + 535 + "," +100 + ")") legend
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置 .append("rect")
// .attr("x", (width / 160) * 157) .attr("transform", "translate(" + 535 + "," + 100 + ")")
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同 // .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
// .attr("y", 8) // .attr("x", (width / 160) * 157)
.attr("width", 90) //或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解 // .attr("y", 8)
.style("fill", function(d){ .attr("width", 90)
return "#1f77b4" .attr("height", 1) //设低一些就是线,高一些就是面,很好理解
}); .style("fill", function (d) {
return "#1f77b4";
});
legend.append("text") legend
.attr("transform", "translate(" + 605 + "," +90 + ")") .append("text")
.style("text-anchor", "end") //样式对齐 .attr("transform", "translate(" + 590 + "," + 90 + ")")
.text(function(d) { .style("text-anchor", "end") //样式对齐
return "切片速率"; .text(function (d) {
}); return "AI算法";
legend.append("rect") });
.attr("transform", "translate(" + 535 + "," +130 + ")") legend
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置 .append("rect")
// .attr("x", (width / 160) * 157) .attr("transform", "translate(" + 535 + "," + 130 + ")")
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同 // .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
// .attr("y", 8) // .attr("x", (width / 160) * 157)
.attr("width", 90) //或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解 // .attr("y", 8)
.style("fill", function(d){ .attr("width", 90)
return "#2ca02c" .attr("height", 1) //设低一些就是线,高一些就是面,很好理解
}); .style("fill", function (d) {
return "#2ca02c";
});
legend.append("text") legend
.attr("transform", "translate(" + 620 + "," +120 + ")") .append("text")
.style("text-anchor", "end") //样式对齐 .attr("transform", "translate(" + 605 + "," + 120 + ")")
.text(function(d) { .style("text-anchor", "end") //样式对齐
return "普通UE速率"; .text(function (d) {
}); return "轮询算法";
} });
if(id=="#d3js4" ){ }
legend.append("rect") if (id == "#d3js4") {
.attr("transform", "translate(" + 535 + "," +70 + ")") legend
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置 .append("rect")
// .attr("x", (width / 160) * 157) .attr("transform", "translate(" + 535 + "," + 70 + ")")
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同 // .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
// .attr("y", 8) // .attr("x", (width / 160) * 157)
.attr("width", 90) //或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解 // .attr("y", 8)
.style("fill", function(d){ .attr("width", 90)
return "#ff7f0e" .attr("height", 1) //设低一些就是线,高一些就是面,很好理解
}); .style("fill", function (d) {
return "#ff7f0e";
});
legend.append("text") legend
.attr("transform", "translate(" + 605 + "," +60 + ")") .append("text")
.style("text-anchor", "end") //样式对齐 .attr("transform", "translate(" + 595 + "," + 60 + ")")
.text(function(d) { .attr("id", "rates")
return "30%线"; .style("text-anchor", "end") //样式对齐
}); .text(function (d) {
legend.append("rect") return "平均值";
.attr("transform", "translate(" + 535 + "," +130 + ")") });
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置 legend
// .attr("x", (width / 160) * 157) .append("rect")
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同 .attr("transform", "translate(" + 535 + "," + 130 + ")")
// .attr("y", 8) // .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
.attr("width", 90) // .attr("x", (width / 160) * 157)
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解 //或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
.style("fill", function(d){ // .attr("y", 8)
return "#1f77b4" .attr("width", 90)
}); .attr("height", 1) //设低一些就是线,高一些就是面,很好理解
.style("fill", function (d) {
return "#1f77b4";
});
legend.append("text") legend
.attr("transform", "translate(" + 620 + "," +120 + ")") .append("text")
.style("text-anchor", "end") //样式对齐 .attr("transform", "translate(" + 595 + "," + 120 + ")")
.text(function(d) { .style("text-anchor", "end") //样式对齐
return "利用率提升"; .text(function (d) {
}); return "实时值";
} });
}
if (id == "#d3js3") {
legend
.append("rect")
.attr("transform", "translate(" + 535 + "," + 70 + ")")
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
// .attr("x", (width / 160) * 157)
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
// .attr("y", 8)
.attr("width", 90)
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解
.style("fill", function (d) {
return "#ff7f0e";
});
legend
.append("text")
.attr("transform", "translate(" + 605 + "," + 60 + ")")
.style("text-anchor", "end") //样式对齐
.text(function (d) {
return "AI算法";
});
legend
.append("rect")
.attr("transform", "translate(" + 535 + "," + 130 + ")")
// .attr("x", 400 - 25) //width是svg的宽度,x属性用来调整位置
// .attr("x", (width / 160) * 157)
//或者可以用width的分数来表示,更稳定一些,这是我试出来的,下面同
// .attr("y", 8)
.attr("width", 90)
.attr("height", 1) //设低一些就是线,高一些就是面,很好理解
.style("fill", function (d) {
return "#1f77b4";
});
legend
.append("text")
.attr("transform", "translate(" + 615 + "," + 120 + ")")
.style("text-anchor", "end") //样式对齐
.text(function (d) {
return "轮询算法";
});
}
let test = d3.select(id); let test = d3.select(id);
test.append("text") test
.text(function(d){return ""+name;}).style("fill", "red").attr("transform", "translate(" + 40 + "," +30 + ")") .append("text")
.text(function (d) {
return "" + name;
})
.style("fill", "red")
.attr("transform", "translate(" + 40 + "," + 30 + ")");
let test1 = test let test1 = test
.append("g") .append("g")
.attr("transform", "translate(" + 10 + "," + 40 + ")") .attr("transform", "translate(" + 10 + "," + 40 + ")")
...@@ -272,12 +365,10 @@ if(id=="#d3js4" ){ ...@@ -272,12 +365,10 @@ if(id=="#d3js4" ){
.style("fill", "#fff") .style("fill", "#fff")
.style("opacity", "0.5"); .style("opacity", "0.5");
let test3 = test1._groups[0]; let test3 = test1._groups[0];
let b = timechart.timechart(test1, 500, 150, 120,mode); let b = timechart.timechart(test1, 500, 150, 120, mode);
return { chart: b }; return { chart: b };
}, },
cal(arr1,arr2){ cal(arr1, arr2) {},
}
}, },
}; };
</script> </script>
...@@ -291,7 +382,6 @@ body, ...@@ -291,7 +382,6 @@ body,
} }
#flex1 { #flex1 {
display: flex; display: flex;
} }
.linepath { .linepath {
fill: none; fill: none;
......
<template> <template>
<div> <div>
<el-progress :percentage="process" :format="format" ></el-progress> <el-progress :percentage="process" :format="format" ></el-progress>
<el-popover <!-- <el-popover
placement="right" placement="right"
width="600" width="600"
trigger="hover" trigger="hover"
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
slot="reference" slot="reference"
> >
资源利用率提升比例 <span>\({U_A -U_T \over U_T}=\)</span> {{up.toFixed(2)}} <span>\(\%\)</span></br></div> 资源利用率提升比例 <span>\({U_A -U_T \over U_T}=\)</span> {{up.toFixed(2)}} <span>\(\%\)</span></br></div>
</el-popover> </el-popover> -->
<cal-page></cal-page> <cal-page></cal-page>
<d-3-page></d-3-page> <d-3-page></d-3-page>
<!-- <div id='question-id' v-html="newlatex"> <!-- <div id='question-id' v-html="newlatex">
...@@ -61,7 +61,8 @@ export default { ...@@ -61,7 +61,8 @@ export default {
return { return {
process: 0, process: 0,
works_requires:[1.98,2.0,3.39,4.69,6.01,7.35,8.69,10.01,11.4,12.79,14.01,15.41,16], works_requires:[1.98,2.0,3.39,4.69,6.01,7.35,8.69,10.01,11.4,12.79,14.01,15.41,16],
requires: [[1.98, 1.98, 1.98], [1.98, 1.98, 2.0], [1.98, 1.98, 3.39], [1.98, 1.98, 4.69], [1.98, 1.98, 6.01], [1.98, 1.98, 7.35], [1.98, 1.98, 8.69], [1.98, 1.98, 10.01], [1.98, 1.98, 11.4], [1.98, 1.98, 12.79], [1.98, 2.0, 1.98], [1.98, 2.0, 2.0], [1.98, 2.0, 3.39], [1.98, 2.0, 4.69], [1.98, 2.0, 6.01], [1.98, 2.0, 7.35], [1.98, 2.0, 8.69], [1.98, 2.0, 10.01], [1.98, 2.0, 11.4], [1.98, 2.0, 12.79], [1.98, 3.39, 1.98], [1.98, 3.39, 2.0], [1.98, 3.39, 3.39], [1.98, 3.39, 4.69], [1.98, 3.39, 6.01], [1.98, 3.39, 7.35], [1.98, 3.39, 8.69], [1.98, 3.39, 10.01], [1.98, 3.39, 11.4], [1.98, 4.69, 1.98], [1.98, 4.69, 2.0], [1.98, 4.69, 3.39], [1.98, 4.69, 4.69], [1.98, 4.69, 6.01], [1.98, 4.69, 7.35], [1.98, 4.69, 8.69], [1.98, 4.69, 10.01], [1.98, 6.01, 1.98], [1.98, 6.01, 2.0], [1.98, 6.01, 3.39], [1.98, 6.01, 4.69], [1.98, 6.01, 6.01], [1.98, 6.01, 7.35], [1.98, 6.01, 8.69], [1.98, 7.35, 1.98], [1.98, 7.35, 2.0], [1.98, 7.35, 3.39], [1.98, 7.35, 4.69], [1.98, 7.35, 6.01], [1.98, 7.35, 7.35], [1.98, 8.69, 1.98], [1.98, 8.69, 2.0], [1.98, 8.69, 3.39], [1.98, 8.69, 4.69], [1.98, 8.69, 6.01], [1.98, 10.01, 1.98], [1.98, 10.01, 2.0], [1.98, 10.01, 3.39], [1.98, 10.01, 4.69], [1.98, 11.4, 1.98], [1.98, 11.4, 2.0], [1.98, 11.4, 3.39], [1.98, 12.79, 1.98], [1.98, 12.79, 2.0], [2.0, 1.98, 1.98], [2.0, 1.98, 2.0], [2.0, 1.98, 3.39], [2.0, 1.98, 4.69], [2.0, 1.98, 6.01], [2.0, 1.98, 7.35], [2.0, 1.98, 8.69], [2.0, 1.98, 10.01], [2.0, 1.98, 11.4], [2.0, 1.98, 12.79], [2.0, 2.0, 1.98], [2.0, 2.0, 2.0], [2.0, 2.0, 3.39], [2.0, 2.0, 4.69], [2.0, 2.0, 6.01], [2.0, 2.0, 7.35], [2.0, 2.0, 8.69], [2.0, 2.0, 10.01], [2.0, 2.0, 11.4], [2.0, 2.0, 12.79], [2.0, 3.39, 1.98], [2.0, 3.39, 2.0], [2.0, 3.39, 3.39], [2.0, 3.39, 4.69], [2.0, 3.39, 6.01], [2.0, 3.39, 7.35], [2.0, 3.39, 8.69], [2.0, 3.39, 10.01], [2.0, 3.39, 11.4], [2.0, 4.69, 1.98], [2.0, 4.69, 2.0], [2.0, 4.69, 3.39], [2.0, 4.69, 4.69], [2.0, 4.69, 6.01], [2.0, 4.69, 7.35], [2.0, 4.69, 8.69], [2.0, 4.69, 10.01], [2.0, 6.01, 1.98], [2.0, 6.01, 2.0], [2.0, 6.01, 3.39], [2.0, 6.01, 4.69], [2.0, 6.01, 6.01], [2.0, 6.01, 7.35], [2.0, 6.01, 8.69], [2.0, 7.35, 1.98], [2.0, 7.35, 2.0], [2.0, 7.35, 3.39], [2.0, 7.35, 4.69], [2.0, 7.35, 6.01], [2.0, 7.35, 7.35], [2.0, 8.69, 1.98], [2.0, 8.69, 2.0], [2.0, 8.69, 3.39], [2.0, 8.69, 4.69], [2.0, 8.69, 6.01], [2.0, 10.01, 1.98], [2.0, 10.01, 2.0], [2.0, 10.01, 3.39], [2.0, 10.01, 4.69], [2.0, 11.4, 1.98], [2.0, 11.4, 2.0], [2.0, 11.4, 3.39], [2.0, 12.79, 1.98], [2.0, 12.79, 2.0], [3.39, 1.98, 1.98], [3.39, 1.98, 2.0], [3.39, 1.98, 3.39], [3.39, 1.98, 4.69], [3.39, 1.98, 6.01], [3.39, 1.98, 7.35], [3.39, 1.98, 8.69], [3.39, 1.98, 10.01], [3.39, 1.98, 11.4], [3.39, 2.0, 1.98], [3.39, 2.0, 2.0], [3.39, 2.0, 3.39], [3.39, 2.0, 4.69], [3.39, 2.0, 6.01], [3.39, 2.0, 7.35], [3.39, 2.0, 8.69], [3.39, 2.0, 10.01], [3.39, 2.0, 11.4], [3.39, 3.39, 1.98], [3.39, 3.39, 2.0], [3.39, 3.39, 3.39], [3.39, 3.39, 4.69], [3.39, 3.39, 6.01], [3.39, 3.39, 7.35], [3.39, 3.39, 8.69], [3.39, 3.39, 10.01], [3.39, 4.69, 1.98], [3.39, 4.69, 2.0], [3.39, 4.69, 3.39], [3.39, 4.69, 4.69], [3.39, 4.69, 6.01], [3.39, 4.69, 7.35], [3.39, 4.69, 8.69], [3.39, 6.01, 1.98], [3.39, 6.01, 2.0], [3.39, 6.01, 3.39], [3.39, 6.01, 4.69], [3.39, 6.01, 6.01], [3.39, 6.01, 7.35], [3.39, 7.35, 1.98], [3.39, 7.35, 2.0], [3.39, 7.35, 3.39], [3.39, 7.35, 4.69], [3.39, 7.35, 6.01], [3.39, 8.69, 1.98], [3.39, 8.69, 2.0], [3.39, 8.69, 3.39], [3.39, 8.69, 4.69], [3.39, 10.01, 1.98], [3.39, 10.01, 2.0], [3.39, 10.01, 3.39], [3.39, 11.4, 1.98], [3.39, 11.4, 2.0], [4.69, 1.98, 1.98], [4.69, 1.98, 2.0], [4.69, 1.98, 3.39], [4.69, 1.98, 4.69], [4.69, 1.98, 6.01], [4.69, 1.98, 7.35], [4.69, 1.98, 8.69], [4.69, 1.98, 10.01], [4.69, 2.0, 1.98], [4.69, 2.0, 2.0], [4.69, 2.0, 3.39], [4.69, 2.0, 4.69], [4.69, 2.0, 6.01], [4.69, 2.0, 7.35], [4.69, 2.0, 8.69], [4.69, 2.0, 10.01], [4.69, 3.39, 1.98], [4.69, 3.39, 2.0], [4.69, 3.39, 3.39], [4.69, 3.39, 4.69], [4.69, 3.39, 6.01], [4.69, 3.39, 7.35], [4.69, 3.39, 8.69], [4.69, 4.69, 1.98], [4.69, 4.69, 2.0], [4.69, 4.69, 3.39], [4.69, 4.69, 4.69], [4.69, 4.69, 6.01], [4.69, 4.69, 7.35], [4.69, 6.01, 1.98], [4.69, 6.01, 2.0], [4.69, 6.01, 3.39], [4.69, 6.01, 4.69], [4.69, 6.01, 6.01], [4.69, 7.35, 1.98], [4.69, 7.35, 2.0], [4.69, 7.35, 3.39], [4.69, 7.35, 4.69], [4.69, 8.69, 1.98], [4.69, 8.69, 2.0], [4.69, 8.69, 3.39], [4.69, 10.01, 1.98], [4.69, 10.01, 2.0], [6.01, 1.98, 1.98], [6.01, 1.98, 2.0], [6.01, 1.98, 3.39], [6.01, 1.98, 4.69], [6.01, 1.98, 6.01], [6.01, 1.98, 7.35], [6.01, 1.98, 8.69], [6.01, 2.0, 1.98], [6.01, 2.0, 2.0], [6.01, 2.0, 3.39], [6.01, 2.0, 4.69], [6.01, 2.0, 6.01], [6.01, 2.0, 7.35], [6.01, 2.0, 8.69], [6.01, 3.39, 1.98], [6.01, 3.39, 2.0], [6.01, 3.39, 3.39], [6.01, 3.39, 4.69], [6.01, 3.39, 6.01], [6.01, 3.39, 7.35], [6.01, 4.69, 1.98], [6.01, 4.69, 2.0], [6.01, 4.69, 3.39], [6.01, 4.69, 4.69], [6.01, 4.69, 6.01], [6.01, 6.01, 1.98], [6.01, 6.01, 2.0], [6.01, 6.01, 3.39], [6.01, 6.01, 4.69], [6.01, 7.35, 1.98], [6.01, 7.35, 2.0], [6.01, 7.35, 3.39], [6.01, 8.69, 1.98], [6.01, 8.69, 2.0], [7.35, 1.98, 1.98], [7.35, 1.98, 2.0], [7.35, 1.98, 3.39], [7.35, 1.98, 4.69], [7.35, 1.98, 6.01], [7.35, 1.98, 7.35], [7.35, 2.0, 1.98], [7.35, 2.0, 2.0], [7.35, 2.0, 3.39], [7.35, 2.0, 4.69], [7.35, 2.0, 6.01], [7.35, 2.0, 7.35], [7.35, 3.39, 1.98], [7.35, 3.39, 2.0], [7.35, 3.39, 3.39], [7.35, 3.39, 4.69], [7.35, 3.39, 6.01], [7.35, 4.69, 1.98], [7.35, 4.69, 2.0], [7.35, 4.69, 3.39], [7.35, 4.69, 4.69], [7.35, 6.01, 1.98], [7.35, 6.01, 2.0], [7.35, 6.01, 3.39], [7.35, 7.35, 1.98], [7.35, 7.35, 2.0], [8.69, 1.98, 1.98], [8.69, 1.98, 2.0], [8.69, 1.98, 3.39], [8.69, 1.98, 4.69], [8.69, 1.98, 6.01], [8.69, 2.0, 1.98], [8.69, 2.0, 2.0], [8.69, 2.0, 3.39], [8.69, 2.0, 4.69], [8.69, 2.0, 6.01], [8.69, 3.39, 1.98], [8.69, 3.39, 2.0], [8.69, 3.39, 3.39], [8.69, 3.39, 4.69], [8.69, 4.69, 1.98], [8.69, 4.69, 2.0], [8.69, 4.69, 3.39], [8.69, 6.01, 1.98], [8.69, 6.01, 2.0], [10.01, 1.98, 1.98], [10.01, 1.98, 2.0], [10.01, 1.98, 3.39], [10.01, 1.98, 4.69], [10.01, 2.0, 1.98], [10.01, 2.0, 2.0], [10.01, 2.0, 3.39], [10.01, 2.0, 4.69], [10.01, 3.39, 1.98], [10.01, 3.39, 2.0], [10.01, 3.39, 3.39], [10.01, 4.69, 1.98], [10.01, 4.69, 2.0], [11.4, 1.98, 1.98], [11.4, 1.98, 2.0], [11.4, 1.98, 3.39], [11.4, 2.0, 1.98], [11.4, 2.0, 2.0], [11.4, 2.0, 3.39], [11.4, 3.39, 1.98], [11.4, 3.39, 2.0], [12.79, 1.98, 1.98], [12.79, 1.98, 2.0], [12.79, 2.0, 1.98], [12.79, 2.0, 2.0]], requires:[[1.98, 1.98, 1.98], [1.98, 1.98, 2.0], [1.98, 1.98, 3.39], [1.98, 2.0, 1.98], [1.98, 2.0, 2.0], [1.98, 2.0, 3.39], [1.98, 3.39, 1.98], [1.98, 3.39, 2.0], [2.0, 1.98, 1.98], [2.0, 1.98, 2.0], [2.0, 1.98, 3.39], [2.0, 2.0, 1.98], [2.0, 2.0, 2.0], [2.0, 2.0, 3.39], [2.0, 3.39, 1.98], [2.0, 3.39, 2.0], [3.39, 1.98, 1.98], [3.39, 1.98, 2.0], [3.39, 2.0, 1.98], [3.39, 2.0, 2.0]],
// requires: [[1.98, 1.98, 1.98], [1.98, 1.98, 2.0], [1.98, 1.98, 3.39], [1.98, 1.98, 4.69], [1.98, 1.98, 6.01], [1.98, 1.98, 7.35], [1.98, 2.0, 1.98], [1.98, 2.0, 2.0], [1.98, 2.0, 3.39], [1.98, 2.0, 4.69], [1.98, 2.0, 6.01], [1.98, 2.0, 7.35], [1.98, 3.39, 1.98], [1.98, 3.39, 2.0], [1.98, 3.39, 3.39], [1.98, 3.39, 4.69], [1.98, 3.39, 6.01], [1.98, 4.69, 1.98], [1.98, 4.69, 2.0], [1.98, 4.69, 3.39], [1.98, 4.69, 4.69], [1.98, 6.01, 1.98], [1.98, 6.01, 2.0], [1.98, 6.01, 3.39], [1.98, 7.35, 1.98], [1.98, 7.35, 2.0], [2.0, 1.98, 1.98], [2.0, 1.98, 2.0], [2.0, 1.98, 3.39], [2.0, 1.98, 4.69], [2.0, 1.98, 6.01], [2.0, 1.98, 7.35], [2.0, 2.0, 1.98], [2.0, 2.0, 2.0], [2.0, 2.0, 3.39], [2.0, 2.0, 4.69], [2.0, 2.0, 6.01], [2.0, 2.0, 7.35], [2.0, 3.39, 1.98], [2.0, 3.39, 2.0], [2.0, 3.39, 3.39], [2.0, 3.39, 4.69], [2.0, 3.39, 6.01], [2.0, 4.69, 1.98], [2.0, 4.69, 2.0], [2.0, 4.69, 3.39], [2.0, 4.69, 4.69], [2.0, 6.01, 1.98], [2.0, 6.01, 2.0], [2.0, 6.01, 3.39], [2.0, 7.35, 1.98], [2.0, 7.35, 2.0], [3.39, 1.98, 1.98], [3.39, 1.98, 2.0], [3.39, 1.98, 3.39], [3.39, 1.98, 4.69], [3.39, 1.98, 6.01], [3.39, 2.0, 1.98], [3.39, 2.0, 2.0], [3.39, 2.0, 3.39], [3.39, 2.0, 4.69], [3.39, 2.0, 6.01], [3.39, 3.39, 1.98], [3.39, 3.39, 2.0], [3.39, 3.39, 3.39], [3.39, 3.39, 4.69], [3.39, 4.69, 1.98], [3.39, 4.69, 2.0], [3.39, 4.69, 3.39], [3.39, 6.01, 1.98], [3.39, 6.01, 2.0], [4.69, 1.98, 1.98], [4.69, 1.98, 2.0], [4.69, 1.98, 3.39], [4.69, 1.98, 4.69], [4.69, 2.0, 1.98], [4.69, 2.0, 2.0], [4.69, 2.0, 3.39], [4.69, 2.0, 4.69], [4.69, 3.39, 1.98], [4.69, 3.39, 2.0], [4.69, 3.39, 3.39], [4.69, 4.69, 1.98], [4.69, 4.69, 2.0], [6.01, 1.98, 1.98], [6.01, 1.98, 2.0], [6.01, 1.98, 3.39], [6.01, 2.0, 1.98], [6.01, 2.0, 2.0], [6.01, 2.0, 3.39], [6.01, 3.39, 1.98], [6.01, 3.39, 2.0], [7.35, 1.98, 1.98], [7.35, 1.98, 2.0], [7.35, 2.0, 1.98], [7.35, 2.0, 2.0]],
hover: false, hover: false,
utilization_a: 2, utilization_a: 2,
questionToOptions: "", questionToOptions: "",
...@@ -153,6 +154,7 @@ export default { ...@@ -153,6 +154,7 @@ export default {
}, },
mounted() { mounted() {
//this.requires.push=[[2.5, 4, 5],[6.5, 4, 5],[5, 3, 7.5]] //this.requires.push=[[2.5, 4, 5],[6.5, 4, 5],[5, 3, 7.5]]
//
this.count(); this.count();
}, },
methods: { methods: {
......
...@@ -31,7 +31,14 @@ const mutations = { ...@@ -31,7 +31,14 @@ const mutations = {
} }
, ,
up(state, obj) { up(state, obj) {
return state.up = obj.up; if(state.ups.length==120){
state.ups.push(obj.up).shift()
}
else{
state.ups.push(obj.up)
}
return state.up = avg(state.ups);
} }
} }
const resize_ = (arr)=>{ const resize_ = (arr)=>{
...@@ -40,4 +47,13 @@ const mutations = { ...@@ -40,4 +47,13 @@ const mutations = {
} }
return arr return arr
} }
const avg = (arr)=>{
let add =0
for( let i in arr){
add +=arr[i]
}
console.log(add)
console.log(add/arr.length)
return add/arr.length
}
export default mutations; export default mutations;
\ No newline at end of file
const state = { const state = {
flag:true, flag:true,
up:0, up:0,
ups:[],
slice_info:[], slice_info:[],
ue_list:[], ue_list:[],
ue_list1:[], ue_list1:[],
......
...@@ -233,7 +233,7 @@ export default function legend() { ...@@ -233,7 +233,7 @@ export default function legend() {
} }
export function timechart(g, width, height, duration, mode) { export function timechart(g, width, height, duration, mode) {
var legend =g
var x_values = []; var x_values = [];
var y_values = []; var y_values = [];
var y = d3.scaleLog() var y = d3.scaleLog()
...@@ -260,15 +260,15 @@ export function timechart(g, width, height, duration, mode) { ...@@ -260,15 +260,15 @@ export function timechart(g, width, height, duration, mode) {
} }
else { else {
y = d3.scaleSqrt() y = d3.scaleLinear()
.range([height, 0]) .range([height, 0])
.domain([0, 400]) .domain([1, 100])
var y_axis = g.append("g") var y_axis = g.append("g")
.attr("class", "axis y") .attr("class", "axis y")
.attr("transform", "translate(" + width + ")") .attr("transform", "translate(" + width + ")")
.call(d3.axisRight(y) .call(d3.axisRight(y)
.tickFormat(d3.format('.2s')) .tickFormat(d3.format('.2s'))
.tickValues([30, 100,400]) .tickValues([0,30,50,100])
// .tickSize(-width) // .tickSize(-width)
); );
} }
...@@ -384,11 +384,52 @@ export function timechart(g, width, height, duration, mode) { ...@@ -384,11 +384,52 @@ export function timechart(g, width, height, duration, mode) {
} }
} }
function text(text,text1){
console.log(legend.selectAll("#rates"))
if(legend.selectAll("#rates")._groups[0].length==1){
legend.select("#rates")
.text(function (d) {
return '';
})
.text(function (d) {
return text.toFixed(1)+'%';
});
legend.select("#rates1")
.text(function (d) {
return '';
})
.text(function (d) {
return Number(text1*1.0).toFixed(1)+'%';
});
}
if(legend.selectAll("#rates")._groups[0].length==0){
legend
.append("text")
.attr("transform", "translate(" + 580 + "," + 50 + ")")
.attr("id", "rates")
.style("text-anchor", "end") //样式对齐
.text(function (d) {
return text.toFixed(1)+'%';
});
legend
.append("text")
.attr("transform", "translate(" + 580 + "," + 110+ ")")
.attr("id", "rates1")
.style("text-anchor", "end") //样式对齐
.text(function (d) {
return Number(text1*1.0).toFixed(1)+'%';
});
}
}
return { return {
append: append append: append,
text: text,
}; };
} }
export function append(time, sample) { export function append(time, sample) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment