This commit is contained in:
wjsjwr 2025-07-27 19:18:31 +08:00
parent b39288fb9f
commit 222c12faa5
2 changed files with 5 additions and 5 deletions

View File

@ -52,7 +52,7 @@ def get_gene_expression():
return jsonify({"error": "No spatial coordinates found"}), 500
result = [
{"x": float(x), "y": -float(y), "z": float(z), "value": float(v)}
{"x": float(x), "y": float(y), "z": float(z), "value": float(v)}
for (x, y, z), v in zip(coords, expr)
]
return jsonify({"gene": gene, "expression": result})
@ -89,7 +89,7 @@ def get_cell_types():
return jsonify({"error": "No spatial coordinates found"}), 500
result = [
{"x": float(x), "y": -float(y), "z": float(z), "value": str(ct)}
{"x": float(x), "y": float(y), "z": float(z), "value": str(ct)}
for (x, y, z), ct in zip(coords, cell_types)
]
return jsonify({"stage": stage, "cells": result})

View File

@ -83,8 +83,8 @@ const PointCloud: React.FC<PointCloudProps> = ({ data, isCategorical = false, au
// 初始化场景、相机、渲染器
const scene = new THREE.Scene();
sceneRef.current = scene; // 存储scene引用
const camera = new THREE.PerspectiveCamera(10, width / height, 0.1, 1000);
camera.position.set(0, 0, -1); // 从左下后方观察使Z轴指向右上方
const camera = new THREE.PerspectiveCamera(20, width / height, 0.1, 1000);
camera.position.set(1.5, 0.2, 0.5); // 从左下后方观察使Z轴指向右上方
camera.lookAt(0, 0, 0); // 确保相机朝向原点
const renderer = new THREE.WebGLRenderer({ antialias: true });
@ -147,7 +147,7 @@ const PointCloud: React.FC<PointCloudProps> = ({ data, isCategorical = false, au
const material = new THREE.PointsMaterial({
vertexColors: true,
size: 0.1,
size: 0.01,
sizeAttenuation: true,
transparent: true,
alphaTest: 0.5,