Merge branch 'main' of http://10.80.10.11/wjsjwr/digital-embryo
This commit is contained in:
commit
bc60273eca
@ -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})
|
||||
|
||||
@ -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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user