From 222c12faa58f3e0d49cba5b7c27fb7aa690631f6 Mon Sep 17 00:00:00 2001 From: wjsjwr Date: Sun, 27 Jul 2025 19:18:31 +0800 Subject: [PATCH] size --- embryo-backend/app.py | 4 ++-- embryo-frontend/src/components/PointCloud.tsx | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/embryo-backend/app.py b/embryo-backend/app.py index 58f2593..23af8da 100644 --- a/embryo-backend/app.py +++ b/embryo-backend/app.py @@ -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}) diff --git a/embryo-frontend/src/components/PointCloud.tsx b/embryo-frontend/src/components/PointCloud.tsx index edb02e5..adb7d07 100644 --- a/embryo-frontend/src/components/PointCloud.tsx +++ b/embryo-frontend/src/components/PointCloud.tsx @@ -83,8 +83,8 @@ const PointCloud: React.FC = ({ 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 = ({ data, isCategorical = false, au const material = new THREE.PointsMaterial({ vertexColors: true, - size: 0.1, + size: 0.01, sizeAttenuation: true, transparent: true, alphaTest: 0.5,