Add floating canvas panels, theme settings, and SVG line-spacing analysis.
Canvas Studio now uses dockable floating panels, app settings/help navigation, and improved SVG export; the backend adds an SVG line-spacing analysis API with SciPy acceleration and new design templates.
This commit is contained in:
@@ -57,6 +57,32 @@ if [[ "$DEPS_OK" == "0" ]]; then
|
||||
"$PYTHON" -m pip install -q fastapi uvicorn python-multipart pydantic pandas openpyxl pillow numpy matplotlib
|
||||
fi
|
||||
|
||||
# SciPy is an optional accelerator for line-spacing analysis. The production
|
||||
# requirements include it, but local dev environments may already have it in
|
||||
# the base interpreter while the project venv does not. Reuse that copy when
|
||||
# the Python ABI matches so startup does not require a network install.
|
||||
EXTRA_SCIPY_SITE=""
|
||||
if ! "$PYTHON" -c 'import scipy' >/dev/null 2>&1; then
|
||||
PYTHON_ABI=$("$PYTHON" -c 'import sys; print(f"{sys.version_info.major}.{sys.version_info.minor}")')
|
||||
for cmd in python3.13 python3.12 python3.11 python3.10 python3.9 python3; do
|
||||
if command -v "$cmd" >/dev/null 2>&1; then
|
||||
SCIPY_SITE=$("$cmd" -c '
|
||||
import pathlib
|
||||
import scipy
|
||||
import sys
|
||||
expected = "'"$PYTHON_ABI"'"
|
||||
current = f"{sys.version_info.major}.{sys.version_info.minor}"
|
||||
print(pathlib.Path(scipy.__file__).parents[1] if current == expected else "")
|
||||
' 2>/dev/null || true)
|
||||
if [[ -n "$SCIPY_SITE" ]]; then
|
||||
EXTRA_SCIPY_SITE="$SCIPY_SITE"
|
||||
echo "[OK] 使用外部 SciPy 加速线距计算: $SCIPY_SITE"
|
||||
break
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
# ── C++ extension ────────────────────────────────────────
|
||||
EXT=$($PYTHON -c 'import importlib.machinery; print(importlib.machinery.EXTENSION_SUFFIXES[0])')
|
||||
EWC_SO="$ROOT_DIR/EfficientWordCloud/efficient_wordcloud/ewc_core${EXT}"
|
||||
@@ -83,6 +109,7 @@ fi
|
||||
# ── start ────────────────────────────────────────────────
|
||||
echo "[INFO] 启动后端 http://0.0.0.0:${BACKEND_PORT}"
|
||||
|
||||
WORDCLOUD_SCIPY_SITE="$EXTRA_SCIPY_SITE" \
|
||||
PYTHONPATH="$ROOT_DIR/EfficientWordCloud" \
|
||||
"$PYTHON" -m uvicorn service.app:app \
|
||||
--app-dir "$ROOT_DIR" \
|
||||
|
||||
Reference in New Issue
Block a user