Photoshop/static/echar.js

516 lines
11 KiB
JavaScript

// prettier-ignore
$.get('https://testbd.trustie.net/maturityAnalyse/?owner=GitLink&repository=gitea_hat').done(function(data) {
var e = data.data.scores
});
var step = 2;
var yadd= step * 3 -1
e=[
{
"name": "license_score",
"score": 0,
"description": "开源许可证评分",
"criteria": {
"0": "无许可证",
"100": "使用标准开源许可证(MIT/Apache/GPL等)"
},
"suggestion": "建议使用标准的开源许可证以明确项目的使用条款和限制",
"itemStyle": {
"color": "#74add1"
},
"value": [
8,
1+yadd,
0
]
},
{
"name": "open_issue_score",
"score": 100,
"description": "未解决issue评分",
"criteria": {
"80-100": "未解决issue较少",
"60-80": "未解决issue较多",
"0-60": "未解决issue很多"
},
"suggestion": "保持适度的未解决issue数量,及时处理重要issue",
"itemStyle": {
"color": "#74add1"
},
"value": [
3,
1+yadd,
100
]
},
{
"name": "closed_issue_score",
"score": 99,
"description": "已解决issue评分",
"criteria": {
"80-100": "已解决issue很多",
"60-80": "已解决issue较多",
"0-60": "已解决issue较少"
},
"suggestion": "提高issue解决率,保持良好的问题跟踪和处理机制",
"itemStyle": {
"color": "#74add1"
},
"value": [
3,
2+yadd,
99
]
},
{
"name": "low_advisory_score",
"score": 100,
"description": "低风险安全警告评分",
"criteria": {
"0": "多个低风险警告",
"100": "无低风险警告"
},
"suggestion": "定期检查并修复安全隐患,即使是低风险问题也应重视",
"itemStyle": {
"color": "#ffffbf"
},
"value": [
5,
1+yadd,
100
]
},
{
"name": "moderate_advisory_score",
"score": 100,
"description": "中等风险安全警告评分",
"criteria": {
"0": "多个中风险警告",
"100": "无中等风险警告"
},
"suggestion": "优先处理中等风险安全问题,避免安全隐患扩大",
"itemStyle": {
"color": "#fee090"
},
"value": [
5,
2+yadd,
100
]
},
{
"name": "high_advisory_score",
"score": 100,
"description": "高风险安全警告评分",
"criteria": {
"0": "多个高风险警告",
"100": "无高风险警告"
},
"suggestion": "高风险安全问题必须立即处理,可考虑发布安全补丁版本",
"itemStyle": {
"color": "#fdae61"
},
"value": [
4,
1+yadd,
100
]
},
{
"name": "critical_advisory_score",
"score": 100,
"description": "严重风险安全警告评分",
"criteria": {
"0": "多个严重风险警告",
"100": "无严重风险警告"
},
"suggestion": "严重安全问题需要紧急修复并及时通知用户更新",
"itemStyle": {
"color": "#f46d43"
},
"value": [
4,
2+yadd,
100
]
},
{
"name": "stars_score",
"score": 0,
"description": "项目Star数评分",
"criteria": {
"80-100": "Star很多",
"60-80": "Star较多",
"0-60": "Star较少"
},
"suggestion": "提高项目影响力,完善文档和功能以吸引更多用户关注",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
0,
1+yadd,
100
]
},
{
"name": "watching_score",
"score": 100,
"description": "项目关注者评分",
"criteria": {
"80-100": "关注者很多",
"60-80": "关注者较多",
"0-60": "关注者较少"
},
"suggestion": "增加项目曝光度,保持更新以维持用户关注度",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
0,
2+yadd,
100
]
},
{
"name": "fork_score",
"score": 0,
"description": "项目分支数评分",
"criteria": {
"80-100": "分支数很多",
"60-80": "分支数较多",
"0-60": "分支数较少"
},
"suggestion": "鼓励社区贡献,完善协作指南以促进分支开发",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
1,
1+yadd,
0
]
},
{
"name": "commits_number_score",
"score": 28,
"description": "提交次数评分",
"criteria": {
"80-100": "提交次数很多",
"60-80": "提交次数较多",
"0-60": "提交次数较少"
},
"suggestion": "保持稳定的开发活跃度,定期提交代码更新",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
2,
1+yadd,
28
]
},
{
"name": "developer_number_score",
"score": 0,
"description": "开发者数量评分",
"criteria": {
"80-100": "开发者数量很多",
"60-80": "开发者数量较多",
"0-60": "开发者数量较少"
},
"suggestion": "扩大开发团队,培养核心贡献者",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
2,
2+yadd,
28
]
},
{
"name": "release_number_score",
"score": 0,
"description": "发布版本数评分",
"criteria": {
"80-100": "发布版本数很多",
"60-80": "发布版本数较多",
"0-60": "发布版本数较少"
},
"suggestion": "建立规范的版本发布流程,保持稳定的迭代节奏",
"itemStyle": {
"color": "#93AAFC"
},
"value": [
1,
2+yadd,
0
]
}
]
var t = [
"活跃度",
"活跃度",
"活跃度",
"质量安全",
"质量安全",
"质量安全",
"基础要素",
"基础要素",
"基础要素"
];
// 基础要素:开源许可证评分,
// 质量: 未解决issue评分,已解决issue评分, 安全性评分
// 活跃度: Star数评分,关注者评分,Fork数评分,提交次数评分,开发者数量评分,发布版本数评分
// var i = [
// "协作",
// "协作",
// "协作",
// "社区活跃度",
// "社区活跃度",
// "社区活跃度",
// "开发活跃度",
// "开发活跃度",
// "开发活跃度"
// ];
var i = [
"成熟型",
"成熟型",
"成熟型",
"稳定型",
"稳定型",
"稳定型",
"成长型",
"成长型",
"成长型"
];
// var i = [
// "项目成熟,维护良好",
// "项目成熟,维护良好",
// "项目成熟,维护良好",
// "项目稳定,有待改进",
// "项目稳定,有待改进",
// "项目稳定,有待改进",
// "项目基本可用,需要加强维护",
// "项目基本可用,需要加强维护",
// "项目基本可用,需要加强维护",
// "项目初期或疏于维护",
// "项目初期或疏于维护",
// "项目初期或疏于维护",
// // "质量",
// // "基础要素",
// // "基础要素",
// // "基础要素",
// ];
var a = 3;
var n = 3;
var o = false;
// prettier-ignore
// var days = ['', 'Friday', '',
// 'Wednesday', '', '', 'Sunday'];
// prettier-ignore
const l = o ? "white" : "#333"
, r = o ? "rgba(255,255,255,0.5)" : "#aaa";
// var data = [ [0, 16, 4], [0, 17, 6], [0, 18, 4], [0, 19, 4], [0, 20, 3], [0, 21, 3], [0, 22, 2], [0, 23, 5], [1, 0, 7], [1, 1, 0], [1, 2, 0]];
option = {
tooltip: {
textStyle: {
fontWeight: "bolder"
},
formatter: e => "mock" === e.data.validity ? e.name + ": \u5373\u5c06\u4e0a\u7ebf" : e.data.description + ": " + e.data.value[2]
},
visualMap: {
max: 20,
inRange: {
color: [
'#313695',
'#4575b4',
'#74add1',
'#abd9e9',
'#e0f3f8',
'#ffffbf',
'#fee090',
'#fdae61',
'#f46d43',
'#d73027',
'#a50026'
]
}
},
xAxis3D: {
name: " ",
type: "category",
data: t,
interval: 2,
axisLine: {
lineStyle: {
width: 1,
color: l
}
},
splitLine: {
show: !0,
interval: a - 1
},
axisLabel: {
interval: a - 1,
textStyle: {
color: r,
padding: [10, 10, 0, 0]
}
},
axisTick: {
interval: a - 1,
length: 1
}
},
yAxis3D: {
name: " ",
type: "category",
data: i,
axisLine: {
lineStyle: {
width: 1,
color: l
}
},
axisTick: {
interval: n - 1,
length: 0
},
splitArea: {
show: !0,
areaStyle: {
color: ["rgba(255,247,207,0.5)", "rgba(255,231,231,0.5)", "rgba(226,226,226,0.5)"]
}
},
axisLabel: {
interval: n - 1,
textStyle: {
lineHeight: 2,
color: r,
padding: [10, 0, 0, 0]
}
},
splitLine: {
show: !0,
interval: n - 1
}
},
zAxis3D: {
name: " ",
type: "value",
splitNumber: 4,
axisLine: {
lineStyle: o ? {
width: 1,
opacity: .2,
color: l
} : {
width: .1,
opacity: .5,
color: l
}
},
splitArea: {
show: !0,
areaStyle: {
color: ["#ffffff", "#ffffff", "#ffffff"]
}
},
axisLabel: {
show: !1
},
axisTick: {
show: !1
}
},
grid3D: {
axisLine: {
interval: 1
},
axisPointer: {
lineStyle: {
opacity: .2
},
label: {
show: !1
}
},
splitLine: {
interval: 2
},
viewControl: {
projection: "perspective",
zoomSensitivity: 0,
rotateSensitivity: [1, 0],
distance: 380,
alpha: 20,
beta: 25
},
top: -40,
boxWidth: 150,
boxDepth: 150,
environment: "none",
light: {
main: {
intensity: .8,
alpha: 50
},
ambient: {
intensity: .5
}
}
},
series: [{
type: "bar3D",
data: e,
shading: "realistic",
bevelSize: .1,
bevelSmoothness: 2,
barSize: 10,
label: {
show: !1,
fontSize: 12,
fontWeight: 500,
borderWidth: 1,
color: "#333",
distance: -20,
formatter: function (e) {
for (var t = e.data.description, i = 2, a = Math.ceil(t.length / i), n = "\n", o = 0; o < a; o++) {
var l = o * i
, r = l + i;
n += t.substring(l, r) + "\n"
}
return n
}
},
itemStyle: {
opacity: .95
},
emphasis: {
label: {
show: !1
},
itemStyle: {
color: "#FFB800",
opacity: .7
}
}
}]
};