Commit fff86753 authored by wangdong's avatar wangdong

fin

parent 71f1ccd7
<template>
<div>
<div id="flex1" >
<div>
<!-- {{ normal_ai_u }} -->
<div id="flex1">
<div id="left">
<svg id="d3js" width="620px" height="200px"></svg>
<svg id="d3js1" width="620px" height="200px"></svg>
<svg id="d3js2" width="620px" height="200px"></svg>
</div>
<div id="right">
<svg id="d3js3" width="620px" height="200px"></svg>
<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> -->
......@@ -19,7 +22,7 @@ import Vue from "vue";
import vueJsonTreeView from "vue-json-tree-view";
import * as timechart from "../../../utils/timechart";
import * as graph from "../../../utils/graph";
import * as numbers from 'numbers'
import * as numbers from "numbers";
import * as d3 from "d3";
// 渲染进程接收主进程的传参
const { ipcRenderer } = require("electron");
......@@ -34,15 +37,18 @@ export default {
color_arrs: ["info", "danger", "warning", "success"],
slices_getter: "a",
timechart: [],
mult:0,
mult1:0,
mult2:0,
mult: 0,
mult1: 0,
mult2: 0,
};
},
computed: {
slice_info() {
return this.$store.state.slice_info;
},
up() {
return this.$store.state.up;
},
total_prb() {
return this.$store.state.slice_info;
},
......@@ -52,7 +58,7 @@ export default {
for (let j = 0; j < slice_info.length; j++) {
let index = slice_info[j].id;
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;
......@@ -64,12 +70,11 @@ export default {
return this.$store.state.re;
},
getterSliceRate() {
let slice_info =this.$store.state.slice_info
let rate=[]
slice_info.forEach((v,k)=>{
if(k<3)
rate.push([v.ddqn.thrpt1,this.$store.state.re[k]])
})
let slice_info = this.$store.state.slice_info;
let rate = [];
slice_info.forEach((v, k) => {
if (k < 3) rate.push([v.ddqn.thrpt1, this.$store.state.re[k]]);
});
return rate;
},
......@@ -80,7 +85,9 @@ export default {
for (let j = 0; j < slice_info.length; j++) {
let index = slice_info[j].id;
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;
......@@ -92,34 +99,58 @@ export default {
for (let j = 0; j < ue_list.length; j++) {
let index = ue_list[j].id;
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;
},
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: {
slice_info: {
handler(newValue, oldValue) {
this.mult=1/numbers.matrix.dotproduct(this.ai_u, this.ai_d);
this.mult1=1/numbers.matrix.dotproduct(this.normal_d, [0.25,0.25,0.25]);
this.mult2=(this.mult-this.mult1)/this.mult1;
this.mult2 =
this.normal_ai_u[0] - this.normal_ai_u[1] > 0
? this.normal_ai_u[0] - this.normal_ai_u[1]
: 0;
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)
this.timechart.forEach((v,k)=>{
if (v && k<3) {
this.timechart.forEach((v, k) => {
if (v && k < 3) {
let ue_list = this.$store.state.ue_list1;
rate_to_show[k%3].push(ue_list[k].Mbs)
var bytes = rate_to_show[k%3];
rate_to_show[k % 3].push(ue_list[k].Mbs);
var bytes = rate_to_show[k % 3];
var stamp = Date.now() / 1000;
if (v.bytes !== undefined) {
v.chart.append(
stamp /* seconds! */,
v.bytes.map((d, i) => {
if (d === undefined || bytes[i] === undefined) return undefined;
if (d === undefined || bytes[i] === undefined)
return undefined;
// Value is bits/second estimate
else return bytes[i];
})
......@@ -128,16 +159,21 @@ export default {
v.bytes = bytes;
v.stamp = stamp;
}
if (v && k>=3) {
if (v && k >= 3) {
let ue_list = this.$store.state.ue_list1;
if(k==3)
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;
if (k == 4) {var bytes = [Math.abs(this.mult2) == Infinity ? 0 : Math.abs(this.mult2),this.up];
v.chart.text(this.up,(Math.abs(this.mult2) == Infinity ? 0 : Math.abs(this.mult2)).toString())
}
var stamp = Date.now() / 1000;
if (v.bytes !== undefined) {
v.chart.append(
stamp /* seconds! */,
v.bytes.map((d, i) => {
if (d === undefined || bytes[i] === undefined) return undefined;
if (d === undefined || bytes[i] === undefined)
return undefined;
// Value is bits/second estimate
else return bytes[i];
})
......@@ -146,120 +182,177 @@ export default {
v.bytes = bytes;
v.stamp = stamp;
}
})
});
},
deep: true,
},
},
mounted() {
this.timechart.push(this.create("rate","App切片速率/目标速率(Mps)", "#d3js"));
this.timechart.push(this.create("rate","Audio切片速率/目标速率(Mps)", "#d3js1"));
this.timechart.push(this.create("rate","Video切片速率/目标速率(Mps)", "#d3js2"));
this.timechart.push(this.create("percent","资源利用提升值", "#d3js4"));
this.timechart.push(this.create("rate", "App切片速率(Mps)", "#d3js"));
this.timechart.push(this.create("rate", "Audio切片速率(Mps)", "#d3js1"));
this.timechart.push(this.create("rate", "Video切片速率(Mps)", "#d3js2"));
this.timechart.push(this.create("percent", "资源占用情况", "#d3js3"));
this.timechart.push(this.create("percent", "资源利用提升值", "#d3js4"));
},
methods: {
create(mode,name, id) {
let colors = ['#1f77b4','#ff7f0e','2ca02c']
var legend=d3.select(id)
if(id=="#d3js" || id=="#d3js1" ||id=="#d3js2" ){
legend.append("rect")
.attr("transform", "translate(" + 535 + "," +70 + ")")
create(mode, name, id) {
let colors = ["#1f77b4", "#ff7f0e", "2ca02c"];
var legend = d3.select(id);
if (id == "#d3js" || id == "#d3js1" || id == "#d3js2") {
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"
.style("fill", function (d) {
return "#ff7f0e";
});
legend.append("text")
.attr("transform", "translate(" + 605 + "," +60 + ")")
legend
.append("text")
.attr("transform", "translate(" + 605 + "," + 60 + ")")
.style("text-anchor", "end") //样式对齐
.text(function(d) {
return "速率要求";
.text(function (d) {
return "目标速率";
});
legend.append("rect")
.attr("transform", "translate(" + 535 + "," +100 + ")")
legend
.append("rect")
.attr("transform", "translate(" + 535 + "," + 100 + ")")
// .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"
.style("fill", function (d) {
return "#1f77b4";
});
legend.append("text")
.attr("transform", "translate(" + 605 + "," +90 + ")")
legend
.append("text")
.attr("transform", "translate(" + 590 + "," + 90 + ")")
.style("text-anchor", "end") //样式对齐
.text(function(d) {
return "切片速率";
.text(function (d) {
return "AI算法";
});
legend.append("rect")
.attr("transform", "translate(" + 535 + "," +130 + ")")
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 "#2ca02c"
.style("fill", function (d) {
return "#2ca02c";
});
legend.append("text")
.attr("transform", "translate(" + 620 + "," +120 + ")")
legend
.append("text")
.attr("transform", "translate(" + 605 + "," + 120 + ")")
.style("text-anchor", "end") //样式对齐
.text(function(d) {
return "普通UE速率";
.text(function (d) {
return "轮询算法";
});
}
if(id=="#d3js4" ){
legend.append("rect")
.attr("transform", "translate(" + 535 + "," +70 + ")")
}
if (id == "#d3js4") {
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"
.style("fill", function (d) {
return "#ff7f0e";
});
legend.append("text")
.attr("transform", "translate(" + 605 + "," +60 + ")")
legend
.append("text")
.attr("transform", "translate(" + 595 + "," + 60 + ")")
.attr("id", "rates")
.style("text-anchor", "end") //样式对齐
.text(function(d) {
return "30%线";
.text(function (d) {
return "平均值";
});
legend.append("rect")
.attr("transform", "translate(" + 535 + "," +130 + ")")
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"
.style("fill", function (d) {
return "#1f77b4";
});
legend.append("text")
.attr("transform", "translate(" + 620 + "," +120 + ")")
legend
.append("text")
.attr("transform", "translate(" + 595 + "," + 120 + ")")
.style("text-anchor", "end") //样式对齐
.text(function(d) {
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);
test.append("text")
.text(function(d){return ""+name;}).style("fill", "red").attr("transform", "translate(" + 40 + "," +30 + ")")
test
.append("text")
.text(function (d) {
return "" + name;
})
.style("fill", "red")
.attr("transform", "translate(" + 40 + "," + 30 + ")");
let test1 = test
.append("g")
.attr("transform", "translate(" + 10 + "," + 40 + ")")
......@@ -272,12 +365,10 @@ if(id=="#d3js4" ){
.style("fill", "#fff")
.style("opacity", "0.5");
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 };
},
cal(arr1,arr2){
}
cal(arr1, arr2) {},
},
};
</script>
......@@ -291,7 +382,6 @@ body,
}
#flex1 {
display: flex;
}
.linepath {
fill: none;
......
<template>
<div>
<el-progress :percentage="process" :format="format" ></el-progress>
<el-popover
<!-- <el-popover
placement="right"
width="600"
trigger="hover"
......@@ -34,7 +34,7 @@
slot="reference"
>
资源利用率提升比例 <span>\({U_A -U_T \over U_T}=\)</span> {{up.toFixed(2)}} <span>\(\%\)</span></br></div>
</el-popover>
</el-popover> -->
<cal-page></cal-page>
<d-3-page></d-3-page>
<!-- <div id='question-id' v-html="newlatex">
......@@ -61,7 +61,8 @@ export default {
return {
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],
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,
utilization_a: 2,
questionToOptions: "",
......@@ -153,6 +154,7 @@ export default {
},
mounted() {
//this.requires.push=[[2.5, 4, 5],[6.5, 4, 5],[5, 3, 7.5]]
//
this.count();
},
methods: {
......
......@@ -31,7 +31,14 @@ const mutations = {
}
,
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)=>{
......@@ -40,4 +47,13 @@ const mutations = {
}
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;
\ No newline at end of file
const state = {
flag:true,
up:0,
ups:[],
slice_info:[],
ue_list:[],
ue_list1:[],
......
......@@ -233,7 +233,7 @@ export default function legend() {
}
export function timechart(g, width, height, duration, mode) {
var legend =g
var x_values = [];
var y_values = [];
var y = d3.scaleLog()
......@@ -260,15 +260,15 @@ export function timechart(g, width, height, duration, mode) {
}
else {
y = d3.scaleSqrt()
y = d3.scaleLinear()
.range([height, 0])
.domain([0, 400])
.domain([1, 100])
var y_axis = g.append("g")
.attr("class", "axis y")
.attr("transform", "translate(" + width + ")")
.call(d3.axisRight(y)
.tickFormat(d3.format('.2s'))
.tickValues([30, 100,400])
.tickValues([0,30,50,100])
// .tickSize(-width)
);
}
......@@ -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 {
append: append
append: append,
text: text,
};
}
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