人脸识别与大模型问答
This commit is contained in:
parent
c2d92915a7
commit
483b3bfbd4
|
|
@ -61,7 +61,7 @@ export default {
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 图表初始化
|
// 图表初始化
|
||||||
//this.pieInit();
|
this.pieInit();
|
||||||
this.echartsInit();
|
this.echartsInit();
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -110,13 +110,13 @@ export default {
|
||||||
this.$router.push(route);
|
this.$router.push(route);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 初始化3D饼状图
|
|
||||||
pieInit() {
|
pieInit() {
|
||||||
let myChart = this.$echarts.init(this.$refs.pie);
|
let myChart = this.$echarts.init(this.$refs.pie);
|
||||||
this.option = this.getPie3D(this.optionData, 0.85);
|
this.option = this.getPie3D(this.optionData, 0.85);
|
||||||
myChart.setOption(this.option);
|
myChart.setOption(this.option);
|
||||||
},
|
},
|
||||||
// 生成3D饼图的配置项
|
|
||||||
|
// 生成3D饼图的配置项
|
||||||
getPie3D(pieData, internalDiameterRatio) {
|
getPie3D(pieData, internalDiameterRatio) {
|
||||||
let series = [];
|
let series = [];
|
||||||
let sumValue = pieData.reduce((acc, cur) => acc + cur.value, 0);
|
let sumValue = pieData.reduce((acc, cur) => acc + cur.value, 0);
|
||||||
|
|
@ -162,7 +162,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// 图例配置
|
// 图例配置
|
||||||
getLegendConfig(pieData) {
|
getLegendConfig(pieData) {
|
||||||
return {
|
return {
|
||||||
data: pieData.map(item => ({name: item.name, value: item.value})),
|
data: pieData.map(item => ({name: item.name, value: item.value})),
|
||||||
|
|
@ -174,7 +174,7 @@ export default {
|
||||||
lineHeight: 20,
|
lineHeight: 20,
|
||||||
color: '#A1E2FF',
|
color: '#A1E2FF',
|
||||||
fontSize: '1rem',
|
fontSize: '1rem',
|
||||||
padding: [30, 60, 10, 20],
|
padding: [30, 60, 10, 20]
|
||||||
},
|
},
|
||||||
itemHeight: 14,
|
itemHeight: 14,
|
||||||
itemWidth: 14,
|
itemWidth: 14,
|
||||||
|
|
@ -186,7 +186,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提示框配置
|
// 提示框配置
|
||||||
getTooltipConfig(series) {
|
getTooltipConfig(series) {
|
||||||
return {
|
return {
|
||||||
formatter: params => {
|
formatter: params => {
|
||||||
|
|
@ -200,7 +200,7 @@ export default {
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// 3D 网格配置
|
// 3D 网格配置
|
||||||
getGrid3DConfig(series) {
|
getGrid3DConfig(series) {
|
||||||
const boxHeight = this.getHeight3D(series, 1);
|
const boxHeight = this.getHeight3D(series, 1);
|
||||||
return {
|
return {
|
||||||
|
|
@ -211,18 +211,27 @@ export default {
|
||||||
viewControl: {
|
viewControl: {
|
||||||
alpha: 25,
|
alpha: 25,
|
||||||
distance: 200,
|
distance: 200,
|
||||||
autoRotate: true
|
autoRotate: true, // 可以禁用或调整 autoRotate
|
||||||
|
autoRotateSpeed: 5 // 减缓旋转速度
|
||||||
|
},
|
||||||
|
postEffect: {
|
||||||
|
enable: true // 启用 GPU 加速渲染
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
main: {
|
||||||
|
intensity: 1.2 // 增强光照效果
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// 计算3D饼图的高度
|
// 计算3D饼图的高度
|
||||||
getHeight3D(series, height) {
|
getHeight3D(series, height) {
|
||||||
const maxValue = Math.max(...series.map(item => item.pieData.value));
|
const maxValue = Math.max(...series.map(item => item.pieData.value));
|
||||||
return height * 25 / maxValue;
|
return height * 25 / maxValue;
|
||||||
},
|
},
|
||||||
|
|
||||||
// 生成扇形曲面的参数方程
|
// 生成扇形曲面的参数方程
|
||||||
getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) {
|
getParametricEquation(startRatio, endRatio, isSelected, isHovered, k, h) {
|
||||||
const midRatio = (startRatio + endRatio) / 2;
|
const midRatio = (startRatio + endRatio) / 2;
|
||||||
const startRadian = startRatio * Math.PI * 2;
|
const startRadian = startRatio * Math.PI * 2;
|
||||||
|
|
@ -230,11 +239,11 @@ export default {
|
||||||
const midRadian = midRatio * Math.PI * 2;
|
const midRadian = midRatio * Math.PI * 2;
|
||||||
const offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
|
const offsetX = isSelected ? Math.cos(midRadian) * 0.1 : 0;
|
||||||
const offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
|
const offsetY = isSelected ? Math.sin(midRadian) * 0.1 : 0;
|
||||||
const hoverRate = isHovered ? 1.05 : 1;
|
const hoverRate = isHovered ? 1.02 : 1; // 优化后的 hoverRate
|
||||||
|
|
||||||
return {
|
return {
|
||||||
u: {min: -Math.PI, max: Math.PI * 3, step: Math.PI / 32},
|
u: {min: -Math.PI, max: Math.PI * 3, step: Math.PI / 16}, // 优化后的步长
|
||||||
v: {min: 0, max: Math.PI * 2, step: Math.PI / 20},
|
v: {min: 0, max: Math.PI * 2, step: Math.PI / 10}, // 优化后的步长
|
||||||
x: (u, v) => {
|
x: (u, v) => {
|
||||||
if (u < startRadian) return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
|
if (u < startRadian) return offsetX + Math.cos(startRadian) * (1 + Math.cos(v) * k) * hoverRate;
|
||||||
if (u > endRadian) return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
|
if (u > endRadian) return offsetX + Math.cos(endRadian) * (1 + Math.cos(v) * k) * hoverRate;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue