mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-21 22:58:05 +00:00
🐛 Fix standard deviation is not showing correctly in dps line chart again
This commit is contained in:
parent
768229ecdc
commit
970e59bb7a
@ -64,12 +64,69 @@ class GCSimResultRenderer:
|
||||
]
|
||||
result["extra"]["damage"] = {
|
||||
"xAxis": [i * 0.5 for i in range(len(result["statistics"]["damage_buckets"]["buckets"]))],
|
||||
"data": {
|
||||
"mean": [bucket["mean"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
"min": [bucket["min"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
"max": [bucket["max"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
"sd": [bucket["sd"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
},
|
||||
"series": [
|
||||
{
|
||||
"data": [bucket["mean"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
"type": "line",
|
||||
"symbol": "none",
|
||||
"color": "#66ccff",
|
||||
"name": "平均伤害",
|
||||
},
|
||||
{
|
||||
"data": [bucket["min"] for bucket in result["statistics"]["damage_buckets"]["buckets"]],
|
||||
"type": "line",
|
||||
"lineStyle": {
|
||||
"opacity": 0,
|
||||
},
|
||||
"stack": "area",
|
||||
"symbol": "none",
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
max(0, bucket["mean"] - bucket["sd"])
|
||||
for bucket in result["statistics"]["damage_buckets"]["buckets"]
|
||||
],
|
||||
"type": "line",
|
||||
"lineStyle": {"opacity": 0},
|
||||
"stack": "cofidence-band",
|
||||
"symbol": "none",
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
min(bucket["mean"], bucket["sd"]) + bucket["sd"]
|
||||
for bucket in result["statistics"]["damage_buckets"]["buckets"]
|
||||
],
|
||||
"type": "line",
|
||||
"lineStyle": {
|
||||
"opacity": 0,
|
||||
},
|
||||
"areaStyle": {
|
||||
"opacity": 0.5,
|
||||
"color": "#4c9bd4",
|
||||
},
|
||||
"stack": "cofidence-band",
|
||||
"symbol": "none",
|
||||
"color": "#4c9bd4",
|
||||
"name": "标准差",
|
||||
},
|
||||
{
|
||||
"data": [
|
||||
bucket["max"] - bucket["min"] for bucket in result["statistics"]["damage_buckets"]["buckets"]
|
||||
],
|
||||
"type": "line",
|
||||
"lineStyle": {
|
||||
"opacity": 0,
|
||||
},
|
||||
"areaStyle": {
|
||||
"opacity": 0.25,
|
||||
"color": "#a5cde9",
|
||||
},
|
||||
"stack": "area",
|
||||
"symbol": "none",
|
||||
"color": "#a5cde9",
|
||||
"name": "极值",
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
return result
|
||||
|
@ -101,58 +101,7 @@
|
||||
color: 'white'
|
||||
},
|
||||
},
|
||||
series: [
|
||||
{
|
||||
data: data["damage"]["data"]["mean"],
|
||||
type: "line",
|
||||
lineStyle: {
|
||||
},
|
||||
showSymbol: false,
|
||||
name: "平均伤害",
|
||||
},
|
||||
{
|
||||
data: data["damage"]["data"]["min"],
|
||||
type: "line",
|
||||
lineStyle: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
showSymbol: false,
|
||||
name: "最小伤害",
|
||||
},
|
||||
{
|
||||
data: data["damage"]["data"]["max"],
|
||||
type: "line",
|
||||
lineStyle: {
|
||||
opacity: 0.5,
|
||||
},
|
||||
showSymbol: false,
|
||||
name: "最大伤害",
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
data: data["damage"]["data"]["mean"].map((mean, idx) => mean - data["damage"]["data"]["sd"][idx] < 0 ? mean + data["damage"]["data"]["sd"][idx] : 2 * data["damage"]["data"]["sd"][idx]),
|
||||
stack: 'confidence-band',
|
||||
stackStrategy: 'positive',
|
||||
lineStyle: {
|
||||
opacity: 0
|
||||
},
|
||||
symbol: 'none',
|
||||
},
|
||||
{
|
||||
type: "line",
|
||||
data: data["damage"]["data"]["mean"].map((mean, idx) => mean - data["damage"]["data"]["sd"][idx] < 0 ? 0 : mean - data["damage"]["data"]["sd"][idx]),
|
||||
stack: 'confidence-band',
|
||||
stackStrategy: 'positive',
|
||||
lineStyle: {
|
||||
opacity: 0
|
||||
},
|
||||
areaStyle: {
|
||||
opacity: 0.18,
|
||||
color: '#4c9bd4'
|
||||
},
|
||||
symbol: 'none',
|
||||
},
|
||||
],
|
||||
series: data["damage"]["series"],
|
||||
animation: false
|
||||
});
|
||||
</script>
|
||||
@ -160,4 +109,4 @@
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user