From 998bb8ff490a8bc772d6c72b290e469005b157ba Mon Sep 17 00:00:00 2001 From: Emily Liu Date: Thu, 2 Oct 2025 10:27:08 -0400 Subject: [PATCH 01/13] Add experimental web UI --- pyproject.toml | 4 + simopt/cli.py | 59 ++ simopt/test.py | 134 ++++ simopt/web/__init__.py | 1 + simopt/web/plots.py | 578 +++++++++++++ simopt/web/server.py | 1741 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 2517 insertions(+) create mode 100644 simopt/cli.py create mode 100644 simopt/test.py create mode 100644 simopt/web/__init__.py create mode 100644 simopt/web/plots.py create mode 100644 simopt/web/server.py diff --git a/pyproject.toml b/pyproject.toml index 0f7c7845..68f2c9d7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,6 +36,7 @@ dependencies = [ "boltons>=25.0.0", "colorama>=0.4.6", "cvxpy>=1.7.3", + "fastapi[standard]>=0.128.8", "joblib>=1.5.2", "matplotlib>=3.10.7", "mrg32k3a[rust]>=2.0.0", @@ -65,6 +66,9 @@ ext = [ "simopt-extensions", ] +[project.scripts] +simopt = "simopt.cli:main" + [project.urls] "Homepage" = "https://github.com/simopt-admin/simopt" "Documentation" = "https://simopt.readthedocs.io/en/latest/" diff --git a/simopt/cli.py b/simopt/cli.py new file mode 100644 index 00000000..6b467972 --- /dev/null +++ b/simopt/cli.py @@ -0,0 +1,59 @@ +"""Command-line interface for SimOpt.""" + +import click + + +@click.group(context_settings={"help_option_names": ["-h", "--help"]}) +def main() -> None: + """Run SimOpt command-line tools.""" + + +@main.command() +@click.option( + "--host", + default="127.0.0.1", + show_default=True, + help="Interface to bind the web server to.", +) +@click.option( + "--port", + default=8000, + show_default=True, + type=click.IntRange(min=1, max=65535), + help="Port to bind the web server to.", +) +@click.option( + "--reload/--no-reload", + "reload_enabled", + default=True, + show_default=True, + help="Restart the server when source files change.", +) +@click.option( + "--log-level", + default="info", + show_default=True, + type=click.Choice( + ["critical", "error", "warning", "info", "debug", "trace"], + case_sensitive=False, + ), + help="Uvicorn log verbosity.", +) +def web(host: str, port: int, reload_enabled: bool, log_level: str) -> None: + """Start the SimOpt FastAPI web interface.""" + import uvicorn + + click.echo("Starting SimOpt Web Interface...") + click.echo(f"SimOpt is running at http://{host}:{port}") + click.echo("Press Ctrl+C to stop.") + uvicorn.run( + "simopt.web.server:app", + host=host, + port=port, + reload=reload_enabled, + log_level=log_level, + ) + + +if __name__ == "__main__": + main() diff --git a/simopt/test.py b/simopt/test.py new file mode 100644 index 00000000..851891be --- /dev/null +++ b/simopt/test.py @@ -0,0 +1,134 @@ +import re +from playwright.sync_api import Playwright, sync_playwright, expect + + +def run(playwright: Playwright) -> None: + browser = playwright.chromium.launch(headless=False) + context = browser.new_context() + page = context.new_page() + + #Test 1: Check all plot functionality + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ADAM") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").nth(2).select_option("CNTNEWS-1 (Max Profit for Continuous Newsvendor)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(2).select_option("SAN-1 (Min Mean Longest Path for Stochastic Activity Network)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(1).select_option("ALL") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("MEAN") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("QUANTILE") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("AREA_MEAN") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("AREA_STD_DEV") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("SOLVE_TIME_QUANTILE") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("SOLVE_TIME_CDF") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("CDF_SOLVABILITY") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("QUANTILE_SOLVABILITY") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("AREA") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("BOX") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("VIOLIN") + page.get_by_role("button", name="+ Add Plot").click() + page.get_by_role("combobox").nth(1).select_option("TERMINAL_SCATTER") + page.get_by_role("button", name="+ Add Plot").click() + with page.expect_popup() as page1_info: + page.get_by_role("button", name="Run Experiment").click() + page1 = page1_info.value + page1.goto("http://localhost:5173/results/20260412_182438/index.html") + + #Test 2: Edit a solver + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ADAM") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("button", name="ADAM ▶ ×").click() + page.get_by_role("button", name="Edit").click() + page.get_by_role("textbox", name="r", exact=True).click() + page.get_by_role("textbox", name="r", exact=True).press("ArrowRight") + page.get_by_role("textbox", name="r", exact=True).press("ArrowRight") + page.get_by_role("textbox", name="r", exact=True).fill("35") + page.get_by_role("button", name="Apply Changes").click() + page.get_by_role("button", name="ADAM ▶ ×").click() + + #Test 3: Replace a solver in edit panel with one from summary panel + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ASTRODF (ASTRO-DF)") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").first.select_option("RNDSRCH (Random Search)") + page.get_by_role("button", name="ASTRODF (ASTRO-DF) ▶ ×").click() + page.get_by_role("button", name="Edit").click() + page.get_by_role("button", name="Replace").click() + + #Test 4: Cancel replacement of solver in edit panel with one from summary panel + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ALOE") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").first.select_option("ASTRODF (ASTRO-DF)") + page.get_by_role("button", name="ALOE ▶ ×").click() + page.get_by_role("button", name="Edit").click() + page.get_by_role("button", name="Cancel").click() + + #Test 5: Partial plot (run plot for only select problems) + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ADAM") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").nth(2).select_option("SAN-1 (Min Mean Longest Path for Stochastic Activity Network)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(2).select_option("CNTNEWS-1 (Max Profit for Continuous Newsvendor)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(1).select_option("MEAN") + page.get_by_role("checkbox", name="CNTNEWS-1 (Max Profit for").check() + page.get_by_role("button", name="+ Add Plot").click() + with page.expect_popup() as page2_info: + page.get_by_role("button", name="Run Experiment").click() + page2 = page2_info.value + + #Test 6: Check output log functionality + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ADAM") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").nth(2).select_option("SAN-1 (Min Mean Longest Path for Stochastic Activity Network)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(1).select_option("MEAN") + page.get_by_role("button", name="+ Add Plot").click() + with page.expect_popup() as page3_info: + page.get_by_role("button", name="Run Experiment").click() + page3 = page3_info.value + page3.get_by_text("Output Log ▼ Auto-scroll: ON").click() + + #Test 7: Check that experiment does not rerun when only plot is added + page.goto("http://localhost:5173/") + page.get_by_role("combobox").first.select_option("ADAM") + page.get_by_role("button", name="+ Add Solver").click() + page.get_by_role("combobox").nth(2).select_option("SAN-1 (Min Mean Longest Path for Stochastic Activity Network)") + page.get_by_role("button", name="+ Add Problem").click() + page.get_by_role("combobox").nth(1).select_option("MEAN") + page.get_by_role("button", name="+ Add Plot").click() + with page.expect_popup() as page5_info: + page.get_by_role("button", name="Run Experiment").click() + page5 = page5_info.value + page5.goto("http://localhost:5173/results/20260412_182820/index.html") + page.get_by_role("combobox").nth(1).select_option("BOX") + page.get_by_role("button", name="+ Add Plot").click() + with page.expect_popup() as page6_info: + page.get_by_role("button", name="Run Experiment").click() + page6 = page6_info.value + + # --------------------- + context.close() + browser.close() + + +with sync_playwright() as playwright: + run(playwright) + + diff --git a/simopt/web/__init__.py b/simopt/web/__init__.py new file mode 100644 index 00000000..e8ddc6f3 --- /dev/null +++ b/simopt/web/__init__.py @@ -0,0 +1 @@ +"""Web UI support for SimOpt.""" diff --git a/simopt/web/plots.py b/simopt/web/plots.py new file mode 100644 index 00000000..93b12fcd --- /dev/null +++ b/simopt/web/plots.py @@ -0,0 +1,578 @@ +"""Plot configuration models for the SimOpt web API.""" + +from typing import Annotated, Optional + +from pydantic import BaseModel, Field + +from simopt.experiment_base import PlotType + + +class PlotProgressCurvesConfig(BaseModel): + """Options for experiment_base.plot_progress_curves (excluding `experiments`).""" + + plot_type: Annotated[ + PlotType, + Field( + default=PlotType.ALL, + description="Type of plot to produce (ALL, MEAN, or QUANTILE).", + ), + ] + + beta: Annotated[ + float, + Field( + default=0.50, + description=( + "Quantile level to plot (0 < beta < 1). Used for QUANTILE plots." + ), + gt=0.0, + lt=1.0, + ), + ] + + normalize: Annotated[ + bool, + Field( + default=True, + description="If True, normalize curves by optimality gaps.", + ), + ] + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + n_bootstraps: Annotated[ + int, + Field( + default=100, + description="Number of bootstrap samples.", + ge=1, + ), + ] + + conf_level: Annotated[ + float, + Field( + default=0.95, + description="Confidence level for CIs (0 < conf_level < 1).", + gt=0.0, + lt=1.0, + ), + ] + + plot_conf_ints: Annotated[ + bool, + Field( + default=True, + description="If True, plot bootstrapped confidence intervals.", + ), + ] + + print_max_hw: Annotated[ + bool, + Field( + default=True, + description="If True, print caption with max half-width.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + legend_loc: Annotated[ + Optional[str], + Field( + default=None, + description='Legend location (e.g., "best", "lower right").', + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + +class PlotSolvabilityCDFConfig(BaseModel): + """Options for experiment_base.plot_progress_curves (excluding `experiments`).""" + + solve_tol: Annotated[ + float, + Field( + default=0.1, + description=( + "Optimality gap that defines when a problem is considered solved" + ), + gt=0.0, + le=1.0, + ), + ] + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + n_bootstraps: Annotated[ + int, + Field( + default=100, + description="Number of bootstrap samples.", + ge=1, + ), + ] + + conf_level: Annotated[ + float, + Field( + default=0.95, + description="Confidence level for CIs (0 < conf_level < 1).", + gt=0.0, + lt=1.0, + ), + ] + + plot_conf_ints: Annotated[ + bool, + Field( + default=True, + description="If True, plot bootstrapped confidence intervals.", + ), + ] + + print_max_hw: Annotated[ + bool, + Field( + default=True, + description="If True, print caption with max half-width.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + legend_loc: Annotated[ + Optional[str], + Field( + default=None, + description='Legend location (e.g., "best", "lower right").', + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + +class PlotAreaScatterplotsConfig(BaseModel): + """Options for experiment_base.plot_area_scatterplots (excluding `experiments`).""" + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + n_bootstraps: Annotated[ + int, + Field( + default=100, + description="Number of bootstrap samples.", + ge=1, + ), + ] + + conf_level: Annotated[ + float, + Field( + default=0.95, + description="Confidence level for CIs (0 < conf_level < 1).", + gt=0.0, + lt=1.0, + ), + ] + + plot_conf_ints: Annotated[ + bool, + Field( + default=True, + description="If True, plot bootstrapped confidence intervals.", + ), + ] + + print_max_hw: Annotated[ + bool, + Field( + default=True, + description="If True, print caption with max half-width.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + legend_loc: Annotated[ + str, + Field( + default="best", + description='Legend location (e.g., "best", "lower right").', + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + problem_set_name: Annotated[ + str, + Field( + default="PROBLEM_SET", + description="Label for problem group in plot titles.", + min_length=1, + ), + ] + + +class PlotSolvabilityProfilesConfig(BaseModel): + """Options for experiment_base.plot_solvability_profiles.""" + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + n_bootstraps: Annotated[ + int, + Field( + default=100, + description="Number of bootstrap samples.", + ge=1, + ), + ] + + conf_level: Annotated[ + float, + Field( + default=0.95, + description="Confidence level for CIs (0 < conf_level < 1).", + gt=0.0, + lt=1.0, + ), + ] + + plot_conf_ints: Annotated[ + bool, + Field( + default=True, + description="If True, plot bootstrapped confidence intervals.", + ), + ] + + print_max_hw: Annotated[ + bool, + Field( + default=True, + description="If True, print caption with max half-width.", + ), + ] + + solve_tol: Annotated[ + float, + Field( + default=0.1, + description=( + "Optimality gap that defines when a problem is considered solved" + ), + gt=0.0, + le=1.0, + ), + ] + + beta: Annotated[ + float, + Field( + default=0.5, + description="Quantile level for quantile solvability (0 < beta < 1).", + gt=0.0, + lt=1.0, + ), + ] + + ref_solver: Annotated[ + Optional[str], + Field( + default=None, + description="Reference solver for difference plots.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + legend_loc: Annotated[ + Optional[str], + Field( + default=None, + description='Legend location (e.g., "best", "lower right").', + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + problem_set_name: Annotated[ + str, + Field( + default="PROBLEM_SET", + description="Label for problem group in plot titles.", + min_length=1, + ), + ] + + +class PlotTerminalProgressCurvesConfig(BaseModel): + """Options for experiment_base.plot_progress_curves (excluding `experiments`).""" + + plot_type: Annotated[ + PlotType, + Field( + default=PlotType.VIOLIN, + description="Type of plot to produce.", + ), + ] + + normalize: Annotated[ + bool, + Field( + default=True, + description="If True, normalize curves by optimality gaps.", + ), + ] + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + +class PlotTerminalScatterplotsConfig(BaseModel): + """Options for experiment_base.plot_progress_curves (excluding `experiments`).""" + + plot_type: Annotated[ + PlotType, + Field( + default=PlotType.TERMINAL_SCATTER, + description="Type of plot to produce (TERMINAL_SCATTER).", + ), + ] + + all_in_one: Annotated[ + bool, + Field( + default=True, + description="If True, plot all curves in one figure.", + ), + ] + + plot_title: Annotated[ + Optional[str], + Field( + default=None, + description="Custom plot title (used only if all_in_one=True).", + ), + ] + + legend_loc: Annotated[ + Optional[str], + Field( + default=None, + description='Legend location (e.g., "best", "lower right").', + ), + ] + + ext: Annotated[ + str, + Field( + default=".png", + description='File extension for saved plots (e.g., ".png").', + ), + ] + + save_as_pickle: Annotated[ + bool, + Field( + default=False, + description="If True, also save a pickle of the plot.", + ), + ] + + solver_set_name: Annotated[ + str, + Field( + default="SOLVER_SET", + description="Label for solver group in plot titles.", + min_length=1, + ), + ] + + problem_set_name: Annotated[ + str, + Field( + default="PROBLEM_SET", + description="Label for problem group in plot titles.", + min_length=1, + ), + ] diff --git a/simopt/web/server.py b/simopt/web/server.py new file mode 100644 index 00000000..3e075ef7 --- /dev/null +++ b/simopt/web/server.py @@ -0,0 +1,1741 @@ +"""FastAPI server for the SimOpt web interface.""" + +# ruff: noqa: ANN001, ANN201, ANN202, D101, D103, E501 + +import threading + +import matplotlib + +matplotlib.use("Agg") # Non-interactive backend +import inspect +from pathlib import Path +from typing import Annotated, Any, Optional + +import matplotlib.pyplot as plt +from fastapi import Body, FastAPI +from fastapi.middleware.cors import CORSMiddleware +from fastapi.responses import FileResponse, Response +from fastapi.staticfiles import StaticFiles +from pydantic import BaseModel + +from simopt import experiment_base as eb +from simopt.directory import ( + problem_directory, + solver_directory, +) +from simopt.experiment_base import ProblemsSolvers +from simopt.web.plots import ( + PlotAreaScatterplotsConfig, + PlotProgressCurvesConfig, + PlotSolvabilityCDFConfig, + PlotSolvabilityProfilesConfig, + PlotTerminalProgressCurvesConfig, + PlotTerminalScatterplotsConfig, +) + + +# ── Pydantic request models ── +# These define the expected shape of incoming JSON payloads for each endpoint. +class ProblemRequest(BaseModel): + name: str + rename: Optional[str] = None + fixed_factors: dict[str, Any] + model_fixed_factors: dict[str, Any] = {} + + +class SolverRequest(BaseModel): + name: str + rename: Optional[str] = None + fixed_factors: dict[str, Any] + + +class PlotRequest(BaseModel): + plot_type: str + params: dict[str, Any] = {} + + +class ExperimentParams(BaseModel): + num_macroreps: int + num_postreps: int + num_postnorms: int + + +class ExperimentRequest(BaseModel): + experiment_params: ExperimentParams + problems: list[ProblemRequest] + solvers: list[SolverRequest] + plots: list[PlotRequest] + + +# ── Path configuration ── +# WEB_DIR points to simopt/web; the built frontend is always served from there. +# BASE_DIR points to the repository root for existing result-file storage. +WEB_DIR = Path(__file__).resolve().parent +BASE_DIR = WEB_DIR.parent.parent +RESULTS_DIR = BASE_DIR / "svelte-app" / "results" +STATIC_DIR = WEB_DIR / "static" + +# ── FastAPI app setup ── +app = FastAPI(title="SimOpt API") + +# Allow all origins so the frontend (served on the same server) can make API calls. +app.add_middleware( + CORSMiddleware, + allow_origins=["*"], + allow_credentials=True, + allow_methods=["*"], + allow_headers=["*"], +) + +# Load post-replicate and post-normalize defaults from SimOpt if available. +try: + from simopt.experiment_base import POST_NORMALIZE_DEFAULTS, POST_REPLICATE_DEFAULTS +except Exception: + POST_REPLICATE_DEFAULTS = {} + POST_NORMALIZE_DEFAULTS = {} + + +# ── Static file serving ── +@app.get("/") +def serve_frontend(): + """Serve the main frontend HTML page.""" + return FileResponse(str(STATIC_DIR / "index.html")) + + +@app.get("/results/{run_id}/experiment.log") +def serve_log(run_id: str): + """Serve experiment log file for a given run. + + Reads the file fresh on each request to avoid Content-Length mismatches + that occur when the static file handler caches file size at request start + while the background thread is still writing to the file. + """ + path = RESULTS_DIR / run_id / "experiment.log" + if not path.exists(): + return Response(content="", media_type="text/plain") + try: + with path.open(encoding="utf-8", errors="replace") as f: + content = f.read() + return Response(content=content, media_type="text/plain") + except Exception: + return Response(content="", media_type="text/plain") + + +@app.get("/results/{run_id}/index.html") +def serve_result(run_id: str): + """Serve the results page for a given run. + + Same rationale as serve_log — reads fresh each time to avoid + Content-Length errors while update_status() is still rewriting the file. + """ + path = RESULTS_DIR / run_id / "index.html" + if not path.exists(): + return Response(content="", media_type="text/html") + content = path.read_text(encoding="utf-8", errors="replace") + return Response(content=content, media_type="text/html") + + +# Mount static directories. Routes defined above take priority over these mounts +# because FastAPI processes explicit routes before static mounts. +RESULTS_DIR.mkdir(exist_ok=True) +app.mount("/results", StaticFiles(directory=str(RESULTS_DIR)), name="results") +app.mount("/static", StaticFiles(directory=str(STATIC_DIR)), name="static") + + +# ── Name mappings ── +def create_name_mappings(): + """Create bidirectional mappings between abbreviated and full names.""" + solver_abbr_to_full = {} + solver_full_to_abbr = {} + + for abbr_name in solver_directory: + solver_cls = solver_directory[abbr_name] + full_name = getattr(solver_cls, "class_name", abbr_name) + display_name = ( + f"{abbr_name} ({full_name})" if full_name != abbr_name else abbr_name + ) + solver_abbr_to_full[abbr_name] = display_name + solver_full_to_abbr[display_name] = abbr_name + + problem_abbr_to_full = {} + problem_full_to_abbr = {} + + for abbr_name in problem_directory: + problem_cls = problem_directory[abbr_name] + full_name = getattr(problem_cls, "class_name", abbr_name) + display_name = ( + f"{abbr_name} ({full_name})" if full_name != abbr_name else abbr_name + ) + problem_abbr_to_full[abbr_name] = display_name + problem_full_to_abbr[display_name] = abbr_name + + return ( + solver_abbr_to_full, + solver_full_to_abbr, + problem_abbr_to_full, + problem_full_to_abbr, + ) + + +SOLVER_ABBR_TO_FULL, SOLVER_FULL_TO_ABBR, PROBLEM_ABBR_TO_FULL, PROBLEM_FULL_TO_ABBR = ( + create_name_mappings() +) + + +# ── Schema endpoints ── +@app.get("/postreplicate_schema") +def postreplicate_schema() -> dict[str, Any]: + """Returns a simple schema for the post-replicate form.""" + d = { + "num_post_reps": 100, + "crn_diff_times": True, + "crn_diff_macroreps": True, + } + d.update(POST_REPLICATE_DEFAULTS or {}) + return { + "params": [ + { + "name": "num_post_reps", + "label": "Number of post-replications", + "type": "int", + "default": d["num_post_reps"], + }, + { + "name": "crn_diff_times", + "label": "Use CRN on post-replications for solutions recommended at different times?", + "type": "bool", + "default": d["crn_diff_times"], + }, + { + "name": "crn_diff_macroreps", + "label": "Use CRN on post-replications for solutions recommended on different macro-replications?", + "type": "bool", + "default": d["crn_diff_macroreps"], + }, + ] + } + + +@app.get("/postnormalize_schema") +def postnormalize_schema() -> dict[str, Any]: + """Returns a simple schema for the post-normalize form.""" + d = { + "num_post_reps_init_opt": 100, + "crn_init_opt": True, + } + d.update(POST_NORMALIZE_DEFAULTS or {}) + return { + "params": [ + { + "name": "num_post_reps_init_opt", + "label": "Number of post-replications at initial and optimal solutions", + "type": "int", + "default": d["num_post_reps_init_opt"], + }, + { + "name": "crn_init_opt", + "label": "Use CRN on post-replications for initial and optimal solution?", + "type": "bool", + "default": d["crn_init_opt"], + }, + ] + } + + +@app.get("/plots") +def list_plots(): + """Returns a flat list of plot names derived from experiment_base.PlotType.""" + if not hasattr(eb, "PlotType"): + return {"plots": [], "source": "missing PlotType"} + + plot_type_cls = eb.PlotType + + plots = [] + try: + plots = [member.name for member in plot_type_cls] + source = "enum" + except TypeError: + plots = [n for n in dir(plot_type_cls) if n.isupper()] + source = "class-attrs" + + return {"plots": plots, "source": source} + + +def extract_params_from_config(config_cls): + """Extract parameter info (name, default, description) from a Pydantic BaseModel config.""" + params = [] + if config_cls and hasattr(config_cls, "model_fields"): + for name, field in config_cls.model_fields.items(): + default = None + if field.default_factory is not None: + try: + default = field.default_factory() + except Exception: + default = "" + else: + default = field.default + + params.append( + { + "name": name, + "default": default, + "description": field.description or "", + } + ) + return params + + +# ── Solver and problem info endpoints ─ +@app.get("/solvers") +def get_solvers(): + """Return all available solvers with display names.""" + return {"solvers": list(SOLVER_ABBR_TO_FULL.values())} + + +@app.get("/problems") +def get_problems(): + """Return all available problems with display names.""" + return {"problems": list(PROBLEM_ABBR_TO_FULL.values())} + + +@app.get("/solver_params/{solver_name}") +def get_solver_params(solver_name: str): + """Return parameters for a solver (accepts display name).""" + # Convert display name to abbreviated name + abbr_name = SOLVER_FULL_TO_ABBR.get(solver_name, solver_name) + solver_cls = solver_directory.get(abbr_name) + if solver_cls is None: + return {"parameters": []} + + params = [] + config_cls = getattr(solver_cls, "config_class", None) + params += extract_params_from_config(config_cls) + + return {"parameters": params} + + +@app.get("/problem_params/{problem_name}") +def get_problem_params(problem_name: str): + """Return parameters for both the problem and its model config (accepts display name).""" + abbr_name = PROBLEM_FULL_TO_ABBR.get(problem_name, problem_name) + problem_cls = problem_directory.get(abbr_name) + if problem_cls is None: + return {"parameters": []} + + params = [] + config_cls = getattr(problem_cls, "config_class", None) + params += extract_params_from_config(config_cls) + + model_cls = getattr(problem_cls, "model_class", None) + if model_cls is not None: + model_config_cls = getattr(model_cls, "config_class", None) + params += extract_params_from_config(model_config_cls) + else: + try: + sig = inspect.signature(problem_cls) + if "model" in sig.parameters: + model_default = sig.parameters["model"].default + model_config_cls = getattr( + model_default.__class__, "config_class", None + ) + params += extract_params_from_config(model_config_cls) + except Exception: + pass + + return {"parameters": params} + + +@app.get("/plot_params/{plot_name}") +def get_plot_params(plot_name: str): + """Return parameter specs for plots that need them.""" + name = plot_name.strip().upper() + if name in ["ALL", "MEAN", "QUANTILE"]: + return {"parameters": extract_params_from_config(PlotProgressCurvesConfig)} + if name in ["VIOLIN", "BOX"]: + return { + "parameters": extract_params_from_config(PlotTerminalProgressCurvesConfig) + } + if name in [ + "CDF_SOLVABILITY", + "QUANTILE_SOLVABILITY", + "DIFFERENCE_OF_CDF_SOLVABILITY", + "DIFFERENCE_OF_QUANTILE_SOLVABILITY", + ]: + return {"parameters": extract_params_from_config(PlotSolvabilityProfilesConfig)} + if name in ["AREA", "AREA_MEAN", "AREA_STD_DEV"]: + return {"parameters": extract_params_from_config(PlotAreaScatterplotsConfig)} + if name == "SOLVE_TIME_CDF": + return {"parameters": extract_params_from_config(PlotSolvabilityCDFConfig)} + if name == "TERMINAL_SCATTER": + return { + "parameters": extract_params_from_config(PlotTerminalScatterplotsConfig) + } + return {"parameters": []} + + +# ── Compatibility checking ── +@app.post("/check_compatibility") +def check_compatibility(payload: dict): + """Check compatibility between solvers and problems.""" + solvers = payload.get("solvers", []) + problems = payload.get("problems", []) + + compatibility = {} + + for display_name in solvers: + abbr_name = SOLVER_FULL_TO_ABBR.get(display_name, display_name) + solver_cls = solver_directory.get(abbr_name) + if not solver_cls: + continue + solver = solver_cls() + compatibility[display_name] = {} + + for prob_display_name in problems: + prob_abbr_name = PROBLEM_FULL_TO_ABBR.get( + prob_display_name, prob_display_name + ) + problem_cls = problem_directory.get(prob_abbr_name) + if not problem_cls: + continue + problem = problem_cls() + + try: + exp = ProblemsSolvers(solvers=[solver], problems=[problem]) + err = exp.check_compatibility() + if err.strip() == "": + compatibility[display_name][prob_display_name] = { + "compatible": True, + "message": "", + } + else: + compatibility[display_name][prob_display_name] = { + "compatible": False, + "message": err, + } + except Exception as e: + compatibility[display_name][prob_display_name] = { + "compatible": False, + "message": str(e), + } + + return {"compatibility": compatibility} + + +# ── Rerun detection ── +def _check_rerun_logic(payload: dict) -> bool: + """Returns True if experiment needs to rerun, False if only plots changed.""" + last_run_id = payload.get("last_run_id") + if not last_run_id: + print("check_rerun: no last_run_id, needs rerun") + return True + + config_path = RESULTS_DIR / last_run_id / "experiment_config.json" + experiments_path = RESULTS_DIR / last_run_id / "experiments.pkl" + + if not config_path.exists() or not experiments_path.exists(): + print( + f"check_rerun: missing files - config:{config_path.exists()} pkl:{experiments_path.exists()}" + ) + return True + + import json + + with config_path.open() as f: + saved = json.load(f) + + new_problems = [ + { + "name": PROBLEM_FULL_TO_ABBR.get(p["name"], p["name"]), + "fixed_factors": p.get("fixed_factors", {}), + "model_fixed_factors": p.get("model_fixed_factors", {}), + } + for p in payload.get("problems", []) + ] + new_solvers = [ + { + "name": SOLVER_FULL_TO_ABBR.get(s["name"], s["name"]), + "fixed_factors": s.get("fixed_factors", {}), + } + for s in payload.get("solvers", []) + ] + new_params = payload.get("experiment_params", {}) + + problems_match = saved["problems"] == new_problems + solvers_match = saved["solvers"] == new_solvers + params_match = saved["experiment_params"] == new_params + + print( + f"check_rerun: problems={problems_match}, solvers={solvers_match}, params={params_match}" + ) + if not problems_match: + print(f" saved problems: {saved['problems']}") + print(f" new problems: {new_problems}") + if not solvers_match: + print(f" saved solvers: {saved['solvers']}") + print(f" new solvers: {new_solvers}") + if not params_match: + print(f" saved params: {saved['experiment_params']}") + print(f" new params: {new_params}") + + return not (problems_match and solvers_match and params_match) + + +# ── Plot generation ── +def generate_plots( + plots_config, + all_experiments, + needed_solver_indices, + needed_problem_indices, + solver_idx_map, + problem_idx_map, + solvers_config, + problems_config, + folder, +): + """Shared plot generation logic used by both run_experiment_async and run_plots_only.""" + from simopt.experiment_base import ( + PlotType, + plot_area_scatterplots, + plot_progress_curves, + plot_solvability_cdfs, + plot_solvability_profiles, + plot_terminal_progress, + plot_terminal_scatterplots, + ) + + plot_files = [] + + for plot_cfg in plots_config: + plot_type_name = plot_cfg.get("plot_type", "MEAN").upper() + plot_params = plot_cfg.get("params", {}) + plot_solvers = plot_cfg.get("solvers") + plot_problems = plot_cfg.get("problems") + + # Map selected indices to experiment array positions + if plot_solvers: + plot_solver_abbrs = [SOLVER_FULL_TO_ABBR.get(s, s) for s in plot_solvers] + orig_solver_indices = [ + i + for i, s in enumerate(solvers_config) + if s["name"] in plot_solver_abbrs + ] + solver_exp_indices = [solver_idx_map[i] for i in orig_solver_indices] + else: + solver_exp_indices = list(range(len(needed_solver_indices))) + + if plot_problems: + plot_problem_abbrs = [PROBLEM_FULL_TO_ABBR.get(p, p) for p in plot_problems] + orig_problem_indices = [ + i + for i, p in enumerate(problems_config) + if p["name"] in plot_problem_abbrs + ] + problem_exp_indices = [problem_idx_map[i] for i in orig_problem_indices] + else: + problem_exp_indices = list(range(len(needed_problem_indices))) + + if not solver_exp_indices or not problem_exp_indices: + continue + + if plot_type_name in ["ALL", "MEAN", "QUANTILE"]: + # Generate progress curves for each problem + for exp_prob_idx in problem_exp_indices: + try: + plt.figure(figsize=(10, 6)) + + all_in_one = plot_params.get("all_in_one", True) + normalize = plot_params.get("normalize", False) + + plot_type_map = { + "ALL": PlotType.ALL, + "MEAN": PlotType.MEAN, + "QUANTILE": PlotType.QUANTILE, + } + plot_type_enum = plot_type_map.get(plot_type_name, PlotType.MEAN) + + plot_progress_curves( + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ], + plot_type=plot_type_enum, + all_in_one=all_in_one, + normalize=normalize, + ) + actual_prob_idx = needed_problem_indices[exp_prob_idx] + filename = f"{plot_type_name.lower()}_progress_curves_problem_{actual_prob_idx + 1}.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print( + f"Error generating {plot_type_name} plot for problem {exp_prob_idx + 1}: {e}" + ) + import traceback + + traceback.print_exc() + continue + + elif plot_type_name in ["VIOLIN", "BOX"]: + # Generate terminal progress plots (BOX or VIOLIN) for each problem + for exp_prob_idx in problem_exp_indices: + try: + plt.figure(figsize=(10, 6)) + + # Extract parameters with defaults + normalize = plot_params.get("normalize", True) + all_in_one = plot_params.get("all_in_one", True) + + # Determine which PlotType to use + plot_type_enum = ( + PlotType.VIOLIN if plot_type_name == "VIOLIN" else PlotType.BOX + ) + + plot_terminal_progress( + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ], + plot_type=plot_type_enum, + normalize=normalize, + all_in_one=all_in_one, + ) + actual_prob_idx = needed_problem_indices[exp_prob_idx] + filename = f"{plot_type_name.lower()}_progress_curves_problem_{actual_prob_idx + 1}.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print( + f"Error generating {plot_type_name} plot for problem {exp_prob_idx + 1}: {e}" + ) + import traceback + + traceback.print_exc() + continue + + elif plot_type_name in ["AREA", "AREA_MEAN", "AREA_STD_DEV"]: + # Generate area scatterplots for each problem + if len(problem_exp_indices) < 2: + print( + f"Warning: {plot_type_name} requires multiple problems. Skipping." + ) + continue + try: + print(f"Generating {plot_type_name} plot...") + plt.figure(figsize=(10, 6)) + # Extract parameters with defaults + all_in_one = plot_params.get("all_in_one", True) + n_bootstraps = plot_params.get("n_bootstraps", 100) + conf_level = plot_params.get("conf_level", 0.95) + plot_conf_ints = plot_params.get("plot_conf_ints", True) + print_max_hw = plot_params.get("print_max_hw", True) + solver_set_name = plot_params.get("solver_set_name", "SOLVER_SET") + problem_set_name = plot_params.get("problem_set_name", "PROBLEM_SET") + + plot_type_map = { + "AREA": PlotType.AREA, + "AREA_MEAN": PlotType.AREA_MEAN, + "AREA_STD_DEV": PlotType.AREA_STD_DEV, + } + plot_type_enum = plot_type_map.get(plot_type_name) + + filtered_experiments = [ + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ] + for exp_prob_idx in problem_exp_indices + ] + + plot_area_scatterplots( + filtered_experiments, + all_in_one=all_in_one, + n_bootstraps=n_bootstraps, + conf_level=conf_level, + plot_conf_ints=plot_conf_ints, + print_max_hw=print_max_hw, + solver_set_name=solver_set_name, + problem_set_name=problem_set_name, + ) + filename = f"{plot_type_name.lower()}_area_scatterplot.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print(f"Error generating {plot_type_name} plot: {e}") + import traceback + + traceback.print_exc() + + elif plot_type_name in [ + "CDF_SOLVABILITY", + "QUANTILE_SOLVABILITY", + "DIFFERENCE_OF_CDF_SOLVABILITY", + "DIFFERENCE_OF_QUANTILE_SOLVABILITY", + ]: + # Solvability profiles require multiple problems + if len(problem_exp_indices) < 2: + print( + f"Warning: {plot_type_name} requires multiple problems. Skipping." + ) + continue + try: + print(f"Generating {plot_type_name} plot...") + plt.figure(figsize=(10, 6)) + # Extract parameters with defaults + all_in_one = plot_params.get("all_in_one", True) + n_bootstraps = plot_params.get("n_bootstraps", 100) + conf_level = plot_params.get("conf_level", 0.95) + plot_conf_ints = plot_params.get( + "plot_conf_ints", False + ) # Disabled by default + print_max_hw = plot_params.get("print_max_hw", False) + solve_tol = plot_params.get("solve_tol", 0.1) + beta = plot_params.get("beta", 0.5) + ref_solver = plot_params.get("ref_solver", None) + solver_set_name = plot_params.get("solver_set_name", "SOLVER_SET") + problem_set_name = plot_params.get("problem_set_name", "PROBLEM_SET") + # Map plot type name to PlotType enum + plot_type_map = { + "CDF_SOLVABILITY": PlotType.CDF_SOLVABILITY, + "QUANTILE_SOLVABILITY": PlotType.QUANTILE_SOLVABILITY, + "DIFFERENCE_OF_CDF_SOLVABILITY": PlotType.DIFFERENCE_OF_CDF_SOLVABILITY, + "DIFFERENCE_OF_QUANTILE_SOLVABILITY": PlotType.DIFFERENCE_OF_QUANTILE_SOLVABILITY, + } + plot_type_enum = plot_type_map.get(plot_type_name) + + filtered_experiments = [ + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ] + for exp_prob_idx in problem_exp_indices + ] + + plot_solvability_profiles( + filtered_experiments, + plot_type=plot_type_enum, + all_in_one=all_in_one, + n_bootstraps=n_bootstraps, + conf_level=conf_level, + plot_conf_ints=plot_conf_ints, + print_max_hw=print_max_hw, + solve_tol=solve_tol, + beta=beta, + ref_solver=ref_solver, + solver_set_name=solver_set_name, + problem_set_name=problem_set_name, + ) + filename = f"{plot_type_name.lower()}_solvability_profile.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print(f"Error generating {plot_type_name} plot: {e}") + import traceback + + traceback.print_exc() + + elif plot_type_name == "SOLVE_TIME_CDF": + # Generate solvability CDF plots for each problem + for exp_prob_idx in problem_exp_indices: + try: + plt.figure(figsize=(10, 6)) + + # Extract parameters with defaults + solve_tol = plot_params.get("solve_tol", 0.1) + all_in_one = plot_params.get("all_in_one", True) + n_bootstraps = plot_params.get("n_bootstraps", 100) + conf_level = plot_params.get("conf_level", 0.95) + plot_conf_ints = plot_params.get( + "plot_conf_ints", False + ) # Disabled by default to avoid bootstrap errors + print_max_hw = plot_params.get("print_max_hw", False) + + plot_solvability_cdfs( + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ], + solve_tol=solve_tol, + all_in_one=all_in_one, + n_bootstraps=n_bootstraps, + conf_level=conf_level, + plot_conf_ints=plot_conf_ints, + print_max_hw=print_max_hw, + ) + filename = f"solvability_cdf_problem_{exp_prob_idx + 1}.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print( + f"Error generating SOLVE_TIME_CDF plot for problem {exp_prob_idx + 1}: {e}" + ) + import traceback + + traceback.print_exc() + continue + + elif plot_type_name == "TERMINAL_SCATTER": + # Generate terminal scatterplot (requires multiple problems) + if len(problem_exp_indices) < 2: + print("Warning: TERMINAL_SCATTER requires multiple problems. Skipping.") + continue + + try: + print("Generating TERMINAL_SCATTER plot...") + plt.figure(figsize=(10, 6)) + + # Extract parameters with defaults + all_in_one = plot_params.get("all_in_one", True) + solver_set_name = plot_params.get("solver_set_name", "SOLVER_SET") + problem_set_name = plot_params.get("problem_set_name", "PROBLEM_SET") + + filtered_experiments = [ + [ + all_experiments[exp_prob_idx][exp_solver_idx] + for exp_solver_idx in solver_exp_indices + ] + for exp_prob_idx in problem_exp_indices + ] + + plot_terminal_scatterplots( + filtered_experiments, + all_in_one=all_in_one, + solver_set_name=solver_set_name, + problem_set_name=problem_set_name, + ) + filename = "terminal_scatterplot.png" + plt.savefig(folder / filename, dpi=150, bbox_inches="tight") + plt.close() + plot_files.append(filename) + print(f" Saved {filename}") + except Exception as e: + print(f"Error generating TERMINAL_SCATTER plot: {e}") + import traceback + + traceback.print_exc() + + return plot_files + + +# ── Output capture ── +def setup_print_capture(log_file): + """Sets up stdout capture to log file. Returns (original_stdout, capture_instance).""" + import json as _json + import sys + import threading + + write_lock = threading.Lock() + + class PrintCapture: + def __init__(self, original) -> None: + self.original = original + self.buf = "" + + def write(self, text): + self.original.write(text) + self.buf += text + while "\n" in self.buf: + line, self.buf = self.buf.split("\n", 1) + line = line.strip() + if line: + entry = { + "time": __import__("datetime") + .datetime.now() + .strftime("%H:%M:%S"), + "level": "INFO", + "msg": line, + } + with write_lock, log_file.open("a") as f: + f.write(_json.dumps(entry) + "\n") + + def flush(self): + self.original.flush() + + def isatty(self): + return False + + original_stdout = sys.stdout + sys.stdout = PrintCapture(original_stdout) + return original_stdout + + +# ── Experiment runner ── +def run_experiment_async(run_id: str, payload: dict): + """Run the experiment in a background thread.""" + folder = RESULTS_DIR / run_id + print(f"Results folder: {folder}") + print(f"Folder exists: {folder.exists()}") + + import json as _json + import sys + + log_file = folder / "experiment.log" + + original_stdout = setup_print_capture(log_file) + import logging as _logging + + class PrintForwardHandler(_logging.Handler): + def emit(self, record): + if record.name.startswith(("matplotlib", "PIL", "urllib", "findfont")): + return + msg = self.format(record) + if msg.startswith("findfont:"): + return + print(msg) + + log_handler = PrintForwardHandler() + log_handler.setFormatter(_logging.Formatter("%(message)s")) + log_handler.setLevel(_logging.DEBUG) + + root_logger = _logging.getLogger() + original_level = root_logger.level + root_logger.setLevel(_logging.DEBUG) + root_logger.addHandler(log_handler) + + try: + update_status(folder, "Running experiments...") + + exp_params = payload.get("experiment_params", {}) + num_macroreps = exp_params.get("num_macroreps", 10) + num_postreps = exp_params.get("num_postreps", 100) + num_postnorms = exp_params.get("num_postnorms", 200) + + problems_config = payload.get("problems", []) + solvers_config = payload.get("solvers", []) + plots_config = payload.get("plots", []) + + # Convert display names to abbreviated names + for solver_cfg in solvers_config: + display_name = solver_cfg["name"] + abbr_name = SOLVER_FULL_TO_ABBR.get(display_name, display_name) + solver_cfg["name"] = abbr_name + print(f"Converted solver: '{display_name}' -> '{abbr_name}'") + + for prob_cfg in problems_config: + display_name = prob_cfg["name"] + abbr_name = PROBLEM_FULL_TO_ABBR.get(display_name, display_name) + prob_cfg["name"] = abbr_name + print(f"Converted problem: '{display_name}' -> '{abbr_name}'") + + from simopt.experiment_base import ProblemSolver, post_normalize + + # Validate solver and problem names + for solver_cfg in solvers_config: + if solver_cfg["name"] not in solver_directory: + raise ValueError( + f"Solver '{solver_cfg['name']}' not found in solver directory. Available solvers: {list(solver_directory.keys())[:10]}" + ) + + for prob_cfg in problems_config: + if prob_cfg["name"] not in problem_directory: + raise ValueError( + f"Problem '{prob_cfg['name']}' not found in problem directory. Available problems: {list(problem_directory.keys())[:10]}" + ) + + needed_solver_indices = set() + needed_problem_indices = set() + + for plot_cfg in plots_config: + plot_solvers = plot_cfg.get("solvers") + plot_problems = plot_cfg.get("problems") + + if plot_solvers: + plot_solver_abbrs = [ + SOLVER_FULL_TO_ABBR.get(s, s) for s in plot_solvers + ] + for i, s in enumerate(solvers_config): + if s["name"] in plot_solver_abbrs: + needed_solver_indices.add(i) + else: + needed_solver_indices.update(range(len(solvers_config))) + + if plot_problems: + plot_problem_abbrs = [ + PROBLEM_FULL_TO_ABBR.get(p, p) for p in plot_problems + ] + for i, p in enumerate(problems_config): + if p["name"] in plot_problem_abbrs: + needed_problem_indices.add(i) + else: + needed_problem_indices.update(range(len(problems_config))) + + # Convert to sorted lists + needed_solver_indices = sorted(needed_solver_indices) + needed_problem_indices = sorted(needed_problem_indices) + + solver_idx_map = { + orig_idx: new_idx for new_idx, orig_idx in enumerate(needed_solver_indices) + } + problem_idx_map = { + orig_idx: new_idx for new_idx, orig_idx in enumerate(needed_problem_indices) + } + + print( + f"Running experiments for {len(needed_solver_indices)} solvers and {len(needed_problem_indices)} problems" + ) + + # Run experiments for each problem + all_experiments = [] + for prob_idx in needed_problem_indices: + prob_cfg = problems_config[prob_idx] + print(f"Running problem {prob_idx + 1}: {prob_cfg['name']}...") + + experiments_same_problem = [] + + for solver_idx in needed_solver_indices: + solver_cfg = solvers_config[solver_idx] + print( + f"Creating ProblemSolver with solver={solver_cfg['name']}, problem={prob_cfg['name']}" + ) + print(f" Solver factors: {solver_cfg.get('fixed_factors', {})}") + print(f" Problem factors: {prob_cfg.get('fixed_factors', {})}") + + experiment = ProblemSolver( + solver_name=solver_cfg["name"], + solver_rename=solver_cfg.get("rename", solver_cfg["name"]), + solver_fixed_factors=solver_cfg.get("fixed_factors", {}), + problem_name=prob_cfg["name"], + problem_rename=prob_cfg.get("rename", prob_cfg["name"]), + problem_fixed_factors=prob_cfg.get("fixed_factors", {}), + model_fixed_factors=prob_cfg.get("model_fixed_factors", {}), + ) + + print(f"Running experiment with {num_macroreps} macroreps...") + experiment.run(n_macroreps=num_macroreps) + print(f"Post-replicating with {num_postreps} postreps...") + experiment.post_replicate(n_postreps=num_postreps) + experiments_same_problem.append(experiment) + + # Post-normalize + print(f"Post-normalizing with {num_postnorms} postnorms...") + post_normalize( + experiments=experiments_same_problem, + n_postreps_init_opt=num_postnorms, + ) + + all_experiments.append(experiments_same_problem) + import pickle + + with (folder / "experiments.pkl").open("wb") as f: + pickle.dump(all_experiments, f) + with (folder / "index_maps.pkl").open("wb") as f: + pickle.dump( + { + "needed_solver_indices": needed_solver_indices, + "needed_problem_indices": needed_problem_indices, + "solver_idx_map": solver_idx_map, + "problem_idx_map": problem_idx_map, + }, + f, + ) + + print("Generating plots...") + plot_files = generate_plots( + plots_config=plots_config, + all_experiments=all_experiments, + needed_solver_indices=needed_solver_indices, + needed_problem_indices=needed_problem_indices, + solver_idx_map=solver_idx_map, + problem_idx_map=problem_idx_map, + solvers_config=solvers_config, + problems_config=problems_config, + folder=folder, + ) + + config_to_save = { + "problems": [ + { + "name": p["name"], + "fixed_factors": p.get("fixed_factors", {}), + "model_fixed_factors": p.get("model_fixed_factors", {}), + } + for p in problems_config + ], + "solvers": [ + {"name": s["name"], "fixed_factors": s.get("fixed_factors", {})} + for s in solvers_config + ], + "experiment_params": exp_params, + } + with (folder / "experiment_config.json").open("w") as f: + _json.dump(config_to_save, f) + + # Create final results page with plots + update_status(folder, "Complete!", plot_files) + print(f"Experiment {run_id} completed successfully!") + + except Exception as e: + error_msg = f"Error: {e!s}" + update_status(folder, error_msg) + print(f"Experiment {run_id} failed: {error_msg}") + import traceback + + traceback.print_exc() + + finally: + sys.stdout = original_stdout + root_logger.removeHandler(log_handler) + root_logger.setLevel(original_level) + + +# ── Results page generation ── +def update_status( + folder: Path, + status: str, + plot_files: Optional[list[str]] = None, +): + """Update the results page with current status and plots.""" + run_id = folder.name + plots_html = "" + if plot_files: + plot_cards = "" + minimized_icons = "" + preview_data = "" + for i, plot_file in enumerate(plot_files): + plot_id = f"plot_{i}" + label = plot_file.replace("_", " ").replace(".png", "") + plot_cards += f""" +
+
+ {label} + +
+ {plot_file} +
+ """ + minimized_icons += f""" + + """ + preview_data += f'"{plot_id}": {{"src": "/results/{run_id}/{plot_file}", "label": "{label}"}},' + + plots_html = f""" +
{plot_cards}
+
{minimized_icons}
+ + + """ + + status_class = ( + "success" + if status == "Complete!" + else ("error" if status.startswith("Error:") else "running") + ) + is_running_js = "true" if status_class == "running" else "false" + + html_content = f""" + + + Experiment Results - {run_id} + + + + + + + +

Results

+
+ +
+

Experiment Details

+
+

Experiment ID: {run_id}

+

Status: {status}

+
+
+ +
+
+
+
+ Output Log + +
+
+ + +
+
+
+
+
Waiting for output...
+
+
+
+ + {plots_html} + +
+ + +""" + + with (folder / "index.html").open("w") as f: + f.write(html_content) + + +# ── Plot-only rerun ── +def run_plots_only(run_id: str, payload: dict): + """Regenerate plots only using saved experiment objects.""" + import pickle + + folder = RESULTS_DIR / run_id + + import sys + + log_file = folder / "experiment.log" + + original_stdout = setup_print_capture(log_file) + + try: + print("Reusing existing experiment results, generating new plots only...") + update_status(folder, "Generating plots...") + + with (folder / "experiments.pkl").open("rb") as f: + all_experiments = pickle.load(f) + with (folder / "index_maps.pkl").open("rb") as f: + maps = pickle.load(f) + + needed_solver_indices = maps["needed_solver_indices"] + needed_problem_indices = maps["needed_problem_indices"] + solver_idx_map = maps["solver_idx_map"] + problem_idx_map = maps["problem_idx_map"] + + plot_files = [] + + plots_config = payload.get("plots", []) + solvers_config = payload.get("solvers", []) + problems_config = payload.get("problems", []) + + # Convert display names + for solver_cfg in solvers_config: + solver_cfg["name"] = SOLVER_FULL_TO_ABBR.get( + solver_cfg["name"], solver_cfg["name"] + ) + for prob_cfg in problems_config: + prob_cfg["name"] = PROBLEM_FULL_TO_ABBR.get( + prob_cfg["name"], prob_cfg["name"] + ) + + plot_files = generate_plots( + plots_config=plots_config, + all_experiments=all_experiments, + needed_solver_indices=needed_solver_indices, + needed_problem_indices=needed_problem_indices, + solver_idx_map=solver_idx_map, + problem_idx_map=problem_idx_map, + solvers_config=solvers_config, + problems_config=problems_config, + folder=folder, + ) + + update_status(folder, "Complete!", plot_files) + print("Plots generated successfully!") + + except Exception as e: + print(f"Error generating plots: {e}") + import traceback + + traceback.print_exc() + update_status(folder, f"Error: {e!s}") + finally: + sys.stdout = original_stdout + + +# ── API endpoints ── +@app.post("/api/run") +def run_experiment(payload: Annotated[dict[str, Any], Body()]): + from datetime import datetime + + needs_rerun = _check_rerun_logic(payload) + + if needs_rerun: + run_id = datetime.now().strftime("%Y%m%d_%H%M%S") + folder = RESULTS_DIR / run_id + folder.mkdir(parents=True, exist_ok=True) + update_status(folder, "Initializing...") + thread = threading.Thread(target=run_experiment_async, args=(run_id, payload)) + thread.daemon = True + thread.start() + else: + run_id = payload.get("last_run_id") + folder = RESULTS_DIR / run_id + print(f"Skipping rerun, generating plots only for {run_id}") + thread = threading.Thread(target=run_plots_only, args=(run_id, payload)) + thread.daemon = True + thread.start() + + return {"id": run_id} + + +@app.get("/api/results/{experiment_id}") +def get_results(experiment_id: str): + """Get results for an experiment.""" + path = Path(f"svelte-app/results/{experiment_id}") + images = [ + f"svelte-app/results/{experiment_id}/{p.name}" for p in path.glob("*.png") + ] + return {"images": images} From 4d51fe7270ec7676973cba557eb4a80ef50f04c8 Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 21:40:24 -0400 Subject: [PATCH 02/13] Initial commit for simopt-web --- simopt-web/.gitignore | 24 + simopt-web/README.md | 47 ++ simopt-web/index.html | 13 + simopt-web/package-lock.json | 1273 ++++++++++++++++++++++++++++++ simopt-web/package.json | 21 + simopt-web/public/favicon.svg | 1 + simopt-web/public/icons.svg | 24 + simopt-web/src/App.svelte | 89 +++ simopt-web/src/app.css | 296 +++++++ simopt-web/src/assets/hero.png | Bin 0 -> 13057 bytes simopt-web/src/assets/svelte.svg | 1 + simopt-web/src/assets/vite.svg | 1 + simopt-web/src/main.ts | 9 + simopt-web/svelte.config.js | 2 + simopt-web/tsconfig.app.json | 20 + simopt-web/tsconfig.json | 7 + simopt-web/tsconfig.node.json | 24 + simopt-web/vite.config.ts | 7 + 18 files changed, 1859 insertions(+) create mode 100644 simopt-web/.gitignore create mode 100644 simopt-web/README.md create mode 100644 simopt-web/index.html create mode 100644 simopt-web/package-lock.json create mode 100644 simopt-web/package.json create mode 100644 simopt-web/public/favicon.svg create mode 100644 simopt-web/public/icons.svg create mode 100644 simopt-web/src/App.svelte create mode 100644 simopt-web/src/app.css create mode 100644 simopt-web/src/assets/hero.png create mode 100644 simopt-web/src/assets/svelte.svg create mode 100644 simopt-web/src/assets/vite.svg create mode 100644 simopt-web/src/main.ts create mode 100644 simopt-web/svelte.config.js create mode 100644 simopt-web/tsconfig.app.json create mode 100644 simopt-web/tsconfig.json create mode 100644 simopt-web/tsconfig.node.json create mode 100644 simopt-web/vite.config.ts diff --git a/simopt-web/.gitignore b/simopt-web/.gitignore new file mode 100644 index 00000000..a547bf36 --- /dev/null +++ b/simopt-web/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/simopt-web/README.md b/simopt-web/README.md new file mode 100644 index 00000000..e6cd94fc --- /dev/null +++ b/simopt-web/README.md @@ -0,0 +1,47 @@ +# Svelte + TS + Vite + +This template should help get you started developing with Svelte and TypeScript in Vite. + +## Recommended IDE Setup + +[VS Code](https://code.visualstudio.com/) + [Svelte](https://marketplace.visualstudio.com/items?itemName=svelte.svelte-vscode). + +## Need an official Svelte framework? + +Check out [SvelteKit](https://github.com/sveltejs/kit#readme), which is also powered by Vite. Deploy anywhere with its serverless-first approach and adapt to various platforms, with out of the box support for TypeScript, SCSS, and Less, and easily-added support for mdsvex, GraphQL, PostCSS, Tailwind CSS, and more. + +## Technical considerations + +**Why use this over SvelteKit?** + +- It brings its own routing solution which might not be preferable for some users. +- It is first and foremost a framework that just happens to use Vite under the hood, not a Vite app. + +This template contains as little as possible to get started with Vite + TypeScript + Svelte, while taking into account the developer experience with regards to HMR and intellisense. It demonstrates capabilities on par with the other `create-vite` templates and is a good starting point for beginners dipping their toes into a Vite + Svelte project. + +Should you later need the extended capabilities and extensibility provided by SvelteKit, the template has been structured similarly to SvelteKit so that it is easy to migrate. + +**Why `global.d.ts` instead of `compilerOptions.types` inside `jsconfig.json` or `tsconfig.json`?** + +Setting `compilerOptions.types` shuts out all other types not explicitly listed in the configuration. Using triple-slash references keeps the default TypeScript setting of accepting type information from the entire workspace, while also adding `svelte` and `vite/client` type information. + +**Why include `.vscode/extensions.json`?** + +Other templates indirectly recommend extensions via the README, but this file allows VS Code to prompt the user to install the recommended extension upon opening the project. + +**Why enable `allowJs` in the TS template?** + +While `allowJs: false` would indeed prevent the use of `.js` files in the project, it does not prevent the use of JavaScript syntax in `.svelte` files. In addition, it would force `checkJs: false`, bringing the worst of both worlds: not being able to guarantee the entire codebase is TypeScript, and also having worse typechecking for the existing JavaScript. In addition, there are valid use cases in which a mixed codebase may be relevant. + +**Why is HMR not preserving my local component state?** + +HMR state preservation comes with a number of gotchas! It has been disabled by default in both `svelte-hmr` and `@sveltejs/vite-plugin-svelte` due to its often surprising behavior. You can read the details [here](https://github.com/rixo/svelte-hmr#svelte-hmr). + +If you have state that's important to retain within a component, consider creating an external store which would not be replaced by HMR. + +```ts +// store.ts +// An extremely simple external store +import { writable } from 'svelte/store' +export default writable(0) +``` diff --git a/simopt-web/index.html b/simopt-web/index.html new file mode 100644 index 00000000..81a02815 --- /dev/null +++ b/simopt-web/index.html @@ -0,0 +1,13 @@ + + + + + + + simopt-web + + +
+ + + diff --git a/simopt-web/package-lock.json b/simopt-web/package-lock.json new file mode 100644 index 00000000..8f107192 --- /dev/null +++ b/simopt-web/package-lock.json @@ -0,0 +1,1273 @@ +{ + "name": "simopt-web", + "version": "0.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "simopt-web", + "version": "0.0.0", + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^7.1.2", + "@tsconfig/svelte": "^5.0.8", + "@types/node": "^24.12.3", + "svelte": "^5.55.5", + "svelte-check": "^4.4.8", + "typescript": "~6.0.2", + "vite": "^8.0.12" + } + }, + "node_modules/@emnapi/core": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.10.0.tgz", + "integrity": "sha512-yq6OkJ4p82CAfPl0u9mQebQHKPJkY7WrIuk205cTYnYe+k2Z8YBh11FrbRG/H6ihirqcacOgl2BIO8oyMQLeXw==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.10.0.tgz", + "integrity": "sha512-ewvYlk86xUoGI0zQRNq/mC+16R1QeDlKQy21Ki3oSYXNgLb45GV1P6A0M+/s6nyCuNDqe5VpaY84BzXGwVbwFA==", + "dev": true, + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.5.tgz", + "integrity": "sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.1.4.tgz", + "integrity": "sha512-3NQNNgA1YSlJb/kMH1ildASP9HW7/7kYnRI2szWJaofaS1hWmbGI4H+d3+22aGzXXN9IJ+n+GiFVcGipJP18ow==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1", + "@emnapi/runtime": "^1.7.1" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.130.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.130.0.tgz", + "integrity": "sha512-ibD2usx9JRu7f5pu2tMKMI4cpA4NgXJQoYRP4pQ7Pxmn1l6k/53qWtQWZayhYy3X4QZkt90Ot+mJEaeXouio6Q==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/@rolldown/binding-android-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.1.tgz", + "integrity": "sha512-fJI3I0r3C3Oj/zdBCpaCmBRZYf07xpaq4yCfDDoSFm+beWNzbIl26puW8RraUdugoJw/95zerNOn6jasAhzSmg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.0.1.tgz", + "integrity": "sha512-cKnAhWEsV7TPcA/5EAteDp6KcJZBQ2G+BqE7zayMMi7kMvwRsbv7WT9aOnn0WNl4SKEIf43vjS31iUPu80nzXg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-darwin-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.0.1.tgz", + "integrity": "sha512-YKrVwQjIRBPo+5G/u03wGjbdy4q7pyzCe93DK9VJ7zkVmeg8LJ7GbgsiHWdR4xSoe4CAXRD7Bcjgbtr64bkXNg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-freebsd-x64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.0.1.tgz", + "integrity": "sha512-z/oBsREo46SsFqBwYtFe0kpJeBijAT48O/WXLI4suiCLBkr03RTtTJMCzSdDd2znlh8VJizL09XVkQgk8IZonw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm-gnueabihf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.0.1.tgz", + "integrity": "sha512-ik8q7GM11zxvYxFc2PeDcT6TBvhCQMaUxfph/M5l9sKuTs/Sjg3L+Byw0F7w0ZVLBZmx30P+gG0ECzzN+MFcmQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.0.1.tgz", + "integrity": "sha512-QoSx2EkyrrdZ6kcyE8stqZ62t0Yra8Fs5ia9lOxJrh6TMQJK7gQKmscdTHf7pOXKREKrVwOtJcQG3qVSfc866A==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-arm64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.0.1.tgz", + "integrity": "sha512-uwNwFpwKeNiZawfAWBgg0VIztPTV3ihhh1vV334h9ivnNLorxnQMU6Fz8wG1Zb4Qh9LC1/MkcyT3YlDXG3Rsgg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-ppc64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.0.1.tgz", + "integrity": "sha512-zY1bul7OWr7DFBiJ++wofXvnr8B45ce3QsQUhKrIhXsygAh7bTkwyeM1bi1a2g5C/yC/N8TZyGDEoMfm/l9mpg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-s390x-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.0.1.tgz", + "integrity": "sha512-0frlsT/f4Ft6I7SMESTKnF3cZsdicQn1dCMkF/jT9wDLE+gGoiQfv1nmT9e+s7s/fekvvy6tZM2jHvI2tkbJDQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-gnu": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.0.1.tgz", + "integrity": "sha512-XABVmGp9Tg0WspTVvwduTc4fpqy6JnAUrSQe6OuyqD/03nI7r0O9OWUkMIwFrjKAIqolvqoA4ZrJppgwE0Gxmw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-linux-x64-musl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.0.1.tgz", + "integrity": "sha512-bV4fzswuzVcKD90o/VM6QqKxnxlDq0g2BISDLNVmxrnhpv1DDbyPhCIjYfvzYLV+MvkKKnQt2Q6AO86SEBULUQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-openharmony-arm64": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.0.1.tgz", + "integrity": "sha512-/Mh0Zhq3OP7fVs0kcQHZP6lZEthMGTaSf8UBQYSFEZDWGXXlEC+nJ6EqenaK2t4LBXMe3A+K/G2BVXXdtOr4PQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-wasm32-wasi": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-wasm32-wasi/-/binding-wasm32-wasi-1.0.1.tgz", + "integrity": "sha512-+1xc9X45l8ufsBAm6Gjvx2qDRIY9lTVt0cgWNcJ+1gdhXvkbxePA60yRTwSTuXL09CMhyJmjpV7E3NoyxbqFQQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.10.0", + "@emnapi/runtime": "1.10.0", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-arm64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.0.1.tgz", + "integrity": "sha512-1D+UqZdfnuR+Jy1GgMJwi85bD40H21uNmOPRWQhw4oRSuolZ/B5rixZ45DK2KXOTCvmVCecauWgEhbw8bI7tOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/binding-win32-x64-msvc": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.1.tgz", + "integrity": "sha512-INAycaWuhlOK3wk4mRHGsdgwYWmd9cChdPdE9bwWmy6rn9VqVNYNFGhOdXrofXUxwHIncSiPNb8tNm8knDVIeQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@sveltejs/acorn-typescript": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@sveltejs/acorn-typescript/-/acorn-typescript-1.0.9.tgz", + "integrity": "sha512-lVJX6qEgs/4DOcRTpo56tmKzVPtoWAaVbL4hfO7t7NVwl9AAXzQR6cihesW1BmNMPl+bK6dreu2sOKBP2Q9CIA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "acorn": "^8.9.0" + } + }, + "node_modules/@sveltejs/vite-plugin-svelte": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@sveltejs/vite-plugin-svelte/-/vite-plugin-svelte-7.1.2.tgz", + "integrity": "sha512-DrUBA2UXRfDmUX/ZTiEopd3X40yavsJF1FX2RygcuIScHL7o5YX1fMvoYnDhjeJQC4weCOklirpNWlcb2NiSeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "deepmerge": "^4.3.1", + "magic-string": "^0.30.21", + "obug": "^2.1.0", + "vitefu": "^1.1.2" + }, + "engines": { + "node": "^20.19 || ^22.12 || >=24" + }, + "peerDependencies": { + "svelte": "^5.46.4", + "vite": "^8.0.0-beta.7 || ^8.0.0" + } + }, + "node_modules/@tsconfig/svelte": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/@tsconfig/svelte/-/svelte-5.0.8.tgz", + "integrity": "sha512-UkNnw1/oFEfecR8ypyHIQuWYdkPvHiwcQ78sh+ymIiYoF+uc5H1UBetbjyqT+vgGJ3qQN6nhucJviX6HesWtKQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.2", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.2.tgz", + "integrity": "sha512-RoBvJ2X0wuKlWFIjrwffGw1IqZHKQqzIchKaadZZfnNpsAYp2mM0h36JtPCjNDAHGgYez/15uMBpfGwchhiMgg==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@types/estree": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz", + "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "24.12.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.12.4.tgz", + "integrity": "sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/trusted-types": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@types/trusted-types/-/trusted-types-2.0.7.tgz", + "integrity": "sha512-ScaPdn1dQczgbl0QFTeTOmVHFULt394XJgOQNoyVhZ6r2vLnMLJfBPd53SB52T/3G36VI1/g2MZaX0cwDuXsfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/acorn": { + "version": "8.16.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.16.0.tgz", + "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/aria-query": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/aria-query/-/aria-query-5.3.1.tgz", + "integrity": "sha512-Z/ZeOgVl7bcSYZ/u/rh0fOpvEpq//LZmdbkXyc7syVzjPAhfOa9ebsdTSjEBDU4vs5nC98Kfduj1uFo0qyET3g==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/axobject-query": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", + "integrity": "sha512-qIj0G9wZbMGNLjLmg1PT6v2mE9AH2zlnADJD/2tC6E00hgmhUOfEB6greHPAfLRSufHqROIUTkw6E+M3lH0PTQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/deepmerge": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", + "integrity": "sha512-3sUqbMEc77XqpdNO7FRyRog+eW3ph+GYCbj+rK+uYyRMuwsVy0rMiVtPn+QJlKFvWP/1PYpapqYn0Me2knFn+A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/detect-libc": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz", + "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devalue": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/devalue/-/devalue-5.8.1.tgz", + "integrity": "sha512-4CXDYRBGqN+57wVJkuXBYmpAVUSg3L6JAQa/DFqm238G73E1wuyc/JhGQJzN7vUf/CMphYau2zXbfWzDR5aTEw==", + "dev": true, + "license": "MIT" + }, + "node_modules/esm-env": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", + "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/esrap": { + "version": "2.2.9", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.2.9.tgz", + "integrity": "sha512-4KijP+NxCWthMCUC3qHbE6n4vCjqgJS1uAYKhuT/GWfFTf1Qyive2TgOjep+gzbSzRfnNyaN/UU9YmdOt8Eg0A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + }, + "peerDependencies": { + "@typescript-eslint/types": "^8.2.0" + }, + "peerDependenciesMeta": { + "@typescript-eslint/types": { + "optional": true + } + } + }, + "node_modules/fdir": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz", + "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12.0.0" + }, + "peerDependencies": { + "picomatch": "^3 || ^4" + }, + "peerDependenciesMeta": { + "picomatch": { + "optional": true + } + } + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/is-reference": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", + "integrity": "sha512-ixkJoqQvAP88E6wLydLGGqCJsrFUnqoH6HnaczB8XmDH1oaWU+xxdptvikTgaEhtZ53Ky6YXiBuUI2WXLMCwjw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/estree": "^1.0.6" + } + }, + "node_modules/lightningcss": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz", + "integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "detect-libc": "^2.0.3" + }, + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "lightningcss-android-arm64": "1.32.0", + "lightningcss-darwin-arm64": "1.32.0", + "lightningcss-darwin-x64": "1.32.0", + "lightningcss-freebsd-x64": "1.32.0", + "lightningcss-linux-arm-gnueabihf": "1.32.0", + "lightningcss-linux-arm64-gnu": "1.32.0", + "lightningcss-linux-arm64-musl": "1.32.0", + "lightningcss-linux-x64-gnu": "1.32.0", + "lightningcss-linux-x64-musl": "1.32.0", + "lightningcss-win32-arm64-msvc": "1.32.0", + "lightningcss-win32-x64-msvc": "1.32.0" + } + }, + "node_modules/lightningcss-android-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.32.0.tgz", + "integrity": "sha512-YK7/ClTt4kAK0vo6w3X+Pnm0D2cf2vPHbhOXdoNti1Ga0al1P4TBZhwjATvjNwLEBCnKvjJc2jQgHXH0NEwlAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-arm64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.32.0.tgz", + "integrity": "sha512-RzeG9Ju5bag2Bv1/lwlVJvBE3q6TtXskdZLLCyfg5pt+HLz9BqlICO7LZM7VHNTTn/5PRhHFBSjk5lc4cmscPQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-darwin-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.32.0.tgz", + "integrity": "sha512-U+QsBp2m/s2wqpUYT/6wnlagdZbtZdndSmut/NJqlCcMLTWp5muCrID+K5UJ6jqD2BFshejCYXniPDbNh73V8w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-freebsd-x64": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.32.0.tgz", + "integrity": "sha512-JCTigedEksZk3tHTTthnMdVfGf61Fky8Ji2E4YjUTEQX14xiy/lTzXnu1vwiZe3bYe0q+SpsSH/CTeDXK6WHig==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm-gnueabihf": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.32.0.tgz", + "integrity": "sha512-x6rnnpRa2GL0zQOkt6rts3YDPzduLpWvwAF6EMhXFVZXD4tPrBkEFqzGowzCsIWsPjqSK+tyNEODUBXeeVHSkw==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.32.0.tgz", + "integrity": "sha512-0nnMyoyOLRJXfbMOilaSRcLH3Jw5z9HDNGfT/gwCPgaDjnx0i8w7vBzFLFR1f6CMLKF8gVbebmkUN3fa/kQJpQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-arm64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.32.0.tgz", + "integrity": "sha512-UpQkoenr4UJEzgVIYpI80lDFvRmPVg6oqboNHfoH4CQIfNA+HOrZ7Mo7KZP02dC6LjghPQJeBsvXhJod/wnIBg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-gnu": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.32.0.tgz", + "integrity": "sha512-V7Qr52IhZmdKPVr+Vtw8o+WLsQJYCTd8loIfpDaMRWGUZfBOYEJeyJIkqGIDMZPwPx24pUMfwSxxI8phr/MbOA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-linux-x64-musl": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.32.0.tgz", + "integrity": "sha512-bYcLp+Vb0awsiXg/80uCRezCYHNg1/l3mt0gzHnWV9XP1W5sKa5/TCdGWaR/zBM2PeF/HbsQv/j2URNOiVuxWg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-arm64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.32.0.tgz", + "integrity": "sha512-8SbC8BR40pS6baCM8sbtYDSwEVQd4JlFTOlaD3gWGHfThTcABnNDBda6eTZeqbofalIJhFx0qKzgHJmcPTnGdw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/lightningcss-win32-x64-msvc": { + "version": "1.32.0", + "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz", + "integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MPL-2.0", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 12.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/locate-character": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-character/-/locate-character-3.0.0.tgz", + "integrity": "sha512-SW13ws7BjaeJ6p7Q6CO2nchbYEc3X3J6WrmTTDto7yMPqVSZTUyY5Tjbid+Ab8gLnATtygYtiDIJGQRRn2ZOiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/mri": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mri/-/mri-1.2.0.tgz", + "integrity": "sha512-tzzskb3bG8LvYGFF/mDTpq3jpI6Q9wc3LEmBaghu+DdCssd1FakN7Bc0hVNmEyGq1bq3RgfkCb3cmQLpNPOroA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/nanoid": { + "version": "3.3.12", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz", + "integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, + "node_modules/obug": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/obug/-/obug-2.1.1.tgz", + "integrity": "sha512-uTqF9MuPraAQ+IsnPf366RG4cP9RtUi7MLO1N3KEc+wb0a6yKpeL0lmk2IB1jY5KHPAlTc6T/JRdC/YqxHNwkQ==", + "dev": true, + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "dev": true, + "license": "ISC" + }, + "node_modules/picomatch": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz", + "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/postcss": { + "version": "8.5.14", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.14.tgz", + "integrity": "sha512-SoSL4+OSEtR99LHFZQiJLkT59C5B1amGO1NzTwj7TT1qCUgUO6hxOvzkOYxD+vMrXBM3XJIKzokoERdqQq/Zmg==", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.11", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, + "node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/rolldown": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.1.tgz", + "integrity": "sha512-X0KQHljNnEkWNqqiz9zJrGunh1B0HgOxLXvnFpCOcadzcy5qohZ3tqMEUg00vncoRovXuK3ZqCT9KnnKzoInFQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "=0.130.0", + "@rolldown/pluginutils": "^1.0.0" + }, + "bin": { + "rolldown": "bin/cli.mjs" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "optionalDependencies": { + "@rolldown/binding-android-arm64": "1.0.1", + "@rolldown/binding-darwin-arm64": "1.0.1", + "@rolldown/binding-darwin-x64": "1.0.1", + "@rolldown/binding-freebsd-x64": "1.0.1", + "@rolldown/binding-linux-arm-gnueabihf": "1.0.1", + "@rolldown/binding-linux-arm64-gnu": "1.0.1", + "@rolldown/binding-linux-arm64-musl": "1.0.1", + "@rolldown/binding-linux-ppc64-gnu": "1.0.1", + "@rolldown/binding-linux-s390x-gnu": "1.0.1", + "@rolldown/binding-linux-x64-gnu": "1.0.1", + "@rolldown/binding-linux-x64-musl": "1.0.1", + "@rolldown/binding-openharmony-arm64": "1.0.1", + "@rolldown/binding-wasm32-wasi": "1.0.1", + "@rolldown/binding-win32-arm64-msvc": "1.0.1", + "@rolldown/binding-win32-x64-msvc": "1.0.1" + } + }, + "node_modules/sade": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/sade/-/sade-1.8.1.tgz", + "integrity": "sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==", + "dev": true, + "license": "MIT", + "dependencies": { + "mri": "^1.1.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/svelte": { + "version": "5.55.8", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-5.55.8.tgz", + "integrity": "sha512-4D6lyrMHmDaZalQOEBMCWCCidyZjSnec14/oPn0k627G6goxcck9xqMwz1tFLlQz+ZFvtTTHfFOlUayuAz0z6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/remapping": "^2.3.4", + "@jridgewell/sourcemap-codec": "^1.5.0", + "@sveltejs/acorn-typescript": "^1.0.5", + "@types/estree": "^1.0.5", + "@types/trusted-types": "^2.0.7", + "acorn": "^8.12.1", + "aria-query": "5.3.1", + "axobject-query": "^4.1.0", + "clsx": "^2.1.1", + "devalue": "^5.8.1", + "esm-env": "^1.2.1", + "esrap": "^2.2.4", + "is-reference": "^3.0.3", + "locate-character": "^3.0.0", + "magic-string": "^0.30.11", + "zimmerframe": "^1.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/svelte-check": { + "version": "4.4.8", + "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.4.8.tgz", + "integrity": "sha512-67adfgBox5eNSNIvIIwgFizKGdcRrGpiMoNO2obHcYuLz7iTa8Xgm/NGU3ntMFnNm8K1grFOIG6HhMLX/vcN8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.25", + "chokidar": "^4.0.1", + "fdir": "^6.2.0", + "picocolors": "^1.0.0", + "sade": "^1.7.4" + }, + "bin": { + "svelte-check": "bin/svelte-check" + }, + "engines": { + "node": ">= 18.0.0" + }, + "peerDependencies": { + "svelte": "^4.0.0 || ^5.0.0-next.0", + "typescript": ">=5.0.0" + } + }, + "node_modules/tinyglobby": { + "version": "0.2.16", + "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz", + "integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fdir": "^6.5.0", + "picomatch": "^4.0.4" + }, + "engines": { + "node": ">=12.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/SuperchupuDev" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD", + "optional": true + }, + "node_modules/typescript": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", + "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, + "node_modules/vite": { + "version": "8.0.13", + "resolved": "https://registry.npmjs.org/vite/-/vite-8.0.13.tgz", + "integrity": "sha512-MFtjBYgzmSxmgA4RAfjIyXWpGe1oALnjgUTzzV7QLx/TKxCzjtMH6Fd9/eVK+5Fg1qNoz5VAwsmMs/NofrmJvw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lightningcss": "^1.32.0", + "picomatch": "^4.0.4", + "postcss": "^8.5.14", + "rolldown": "1.0.1", + "tinyglobby": "^0.2.16" + }, + "bin": { + "vite": "bin/vite.js" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/vitejs/vite?sponsor=1" + }, + "optionalDependencies": { + "fsevents": "~2.3.3" + }, + "peerDependencies": { + "@types/node": "^20.19.0 || >=22.12.0", + "@vitejs/devtools": "^0.1.18", + "esbuild": "^0.27.0 || ^0.28.0", + "jiti": ">=1.21.0", + "less": "^4.0.0", + "sass": "^1.70.0", + "sass-embedded": "^1.70.0", + "stylus": ">=0.54.8", + "sugarss": "^5.0.0", + "terser": "^5.16.0", + "tsx": "^4.8.1", + "yaml": "^2.4.2" + }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + }, + "@vitejs/devtools": { + "optional": true + }, + "esbuild": { + "optional": true + }, + "jiti": { + "optional": true + }, + "less": { + "optional": true + }, + "sass": { + "optional": true + }, + "sass-embedded": { + "optional": true + }, + "stylus": { + "optional": true + }, + "sugarss": { + "optional": true + }, + "terser": { + "optional": true + }, + "tsx": { + "optional": true + }, + "yaml": { + "optional": true + } + } + }, + "node_modules/vitefu": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/vitefu/-/vitefu-1.1.3.tgz", + "integrity": "sha512-ub4okH7Z5KLjb6hDyjqrGXqWtWvoYdU3IGm/NorpgHncKoLTCfRIbvlhBm7r0YstIaQRYlp4yEbFqDcKSzXSSg==", + "dev": true, + "license": "MIT", + "workspaces": [ + "tests/deps/*", + "tests/projects/*", + "tests/projects/workspace/packages/*" + ], + "peerDependencies": { + "vite": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "vite": { + "optional": true + } + } + }, + "node_modules/zimmerframe": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.4.tgz", + "integrity": "sha512-B58NGBEoc8Y9MWWCQGl/gq9xBCe4IiKM0a2x7GZdQKOW5Exr8S1W24J6OgM1njK8xCRGvAJIL/MxXHf6SkmQKQ==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/simopt-web/package.json b/simopt-web/package.json new file mode 100644 index 00000000..6e8e6aed --- /dev/null +++ b/simopt-web/package.json @@ -0,0 +1,21 @@ +{ + "name": "simopt-web", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "vite", + "build": "vite build", + "preview": "vite preview", + "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" + }, + "devDependencies": { + "@sveltejs/vite-plugin-svelte": "^7.1.2", + "@tsconfig/svelte": "^5.0.8", + "@types/node": "^24.12.3", + "svelte": "^5.55.5", + "svelte-check": "^4.4.8", + "typescript": "~6.0.2", + "vite": "^8.0.12" + } +} diff --git a/simopt-web/public/favicon.svg b/simopt-web/public/favicon.svg new file mode 100644 index 00000000..6893eb13 --- /dev/null +++ b/simopt-web/public/favicon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/simopt-web/public/icons.svg b/simopt-web/public/icons.svg new file mode 100644 index 00000000..e9522193 --- /dev/null +++ b/simopt-web/public/icons.svg @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/simopt-web/src/App.svelte b/simopt-web/src/App.svelte new file mode 100644 index 00000000..dafc575f --- /dev/null +++ b/simopt-web/src/App.svelte @@ -0,0 +1,89 @@ + + +
+
+ + Svelte logo + Vite logo +
+
+

Get started

+

Edit src/App.svelte and save to test HMR

+
+ +
+ +
+ +
+
+ +

Documentation

+

Your questions, answered

+ +
+
+ +

Connect with us

+

Join the Vite community

+ +
+
+ +
+
diff --git a/simopt-web/src/app.css b/simopt-web/src/app.css new file mode 100644 index 00000000..527d4fba --- /dev/null +++ b/simopt-web/src/app.css @@ -0,0 +1,296 @@ +:root { + --text: #6b6375; + --text-h: #08060d; + --bg: #fff; + --border: #e5e4e7; + --code-bg: #f4f3ec; + --accent: #aa3bff; + --accent-bg: rgba(170, 59, 255, 0.1); + --accent-border: rgba(170, 59, 255, 0.5); + --social-bg: rgba(244, 243, 236, 0.5); + --shadow: + rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; + + --sans: system-ui, 'Segoe UI', Roboto, sans-serif; + --heading: system-ui, 'Segoe UI', Roboto, sans-serif; + --mono: ui-monospace, Consolas, monospace; + + font: 18px/145% var(--sans); + letter-spacing: 0.18px; + color-scheme: light dark; + color: var(--text); + background: var(--bg); + font-synthesis: none; + text-rendering: optimizeLegibility; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + + @media (max-width: 1024px) { + font-size: 16px; + } +} + +@media (prefers-color-scheme: dark) { + :root { + --text: #9ca3af; + --text-h: #f3f4f6; + --bg: #16171d; + --border: #2e303a; + --code-bg: #1f2028; + --accent: #c084fc; + --accent-bg: rgba(192, 132, 252, 0.15); + --accent-border: rgba(192, 132, 252, 0.5); + --social-bg: rgba(47, 48, 58, 0.5); + --shadow: + rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px; + } + + #social .button-icon { + filter: invert(1) brightness(2); + } +} + +body { + margin: 0; +} + +h1, +h2 { + font-family: var(--heading); + font-weight: 500; + color: var(--text-h); +} + +h1 { + font-size: 56px; + letter-spacing: -1.68px; + margin: 32px 0; + @media (max-width: 1024px) { + font-size: 36px; + margin: 20px 0; + } +} +h2 { + font-size: 24px; + line-height: 118%; + letter-spacing: -0.24px; + margin: 0 0 8px; + @media (max-width: 1024px) { + font-size: 20px; + } +} +p { + margin: 0; +} + +code, +.counter { + font-family: var(--mono); + display: inline-flex; + border-radius: 4px; + color: var(--text-h); +} + +code { + font-size: 15px; + line-height: 135%; + padding: 4px 8px; + background: var(--code-bg); +} + +.counter { + font-size: 16px; + padding: 5px 10px; + border-radius: 5px; + color: var(--accent); + background: var(--accent-bg); + border: 2px solid transparent; + transition: border-color 0.3s; + margin-bottom: 24px; + + &:hover { + border-color: var(--accent-border); + } + &:focus-visible { + outline: 2px solid var(--accent); + outline-offset: 2px; + } +} + +.hero { + position: relative; + + .base, + .framework, + .vite { + inset-inline: 0; + margin: 0 auto; + } + + .base { + width: 170px; + position: relative; + z-index: 0; + } + + .framework, + .vite { + position: absolute; + } + + .framework { + z-index: 1; + top: 34px; + height: 28px; + transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) + scale(1.4); + } + + .vite { + z-index: 0; + top: 107px; + height: 26px; + width: auto; + transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) + scale(0.8); + } +} + +#app { + width: 1126px; + max-width: 100%; + margin: 0 auto; + text-align: center; + border-inline: 1px solid var(--border); + min-height: 100svh; + display: flex; + flex-direction: column; + box-sizing: border-box; +} + +#center { + display: flex; + flex-direction: column; + gap: 25px; + place-content: center; + place-items: center; + flex-grow: 1; + + @media (max-width: 1024px) { + padding: 32px 20px 24px; + gap: 18px; + } +} + +#next-steps { + display: flex; + border-top: 1px solid var(--border); + text-align: left; + + & > div { + flex: 1 1 0; + padding: 32px; + @media (max-width: 1024px) { + padding: 24px 20px; + } + } + + .icon { + margin-bottom: 16px; + width: 22px; + height: 22px; + } + + @media (max-width: 1024px) { + flex-direction: column; + text-align: center; + } +} + +#docs { + border-right: 1px solid var(--border); + + @media (max-width: 1024px) { + border-right: none; + border-bottom: 1px solid var(--border); + } +} + +#next-steps ul { + list-style: none; + padding: 0; + display: flex; + gap: 8px; + margin: 32px 0 0; + + .logo { + height: 18px; + } + + a { + color: var(--text-h); + font-size: 16px; + border-radius: 6px; + background: var(--social-bg); + display: flex; + padding: 6px 12px; + align-items: center; + gap: 8px; + text-decoration: none; + transition: box-shadow 0.3s; + + &:hover { + box-shadow: var(--shadow); + } + .button-icon { + height: 18px; + width: 18px; + } + } + + @media (max-width: 1024px) { + margin-top: 20px; + flex-wrap: wrap; + justify-content: center; + + li { + flex: 1 1 calc(50% - 8px); + } + + a { + width: 100%; + justify-content: center; + box-sizing: border-box; + } + } +} + +#spacer { + height: 88px; + border-top: 1px solid var(--border); + @media (max-width: 1024px) { + height: 48px; + } +} + +.ticks { + position: relative; + width: 100%; + + &::before, + &::after { + content: ''; + position: absolute; + top: -4.5px; + border: 5px solid transparent; + } + + &::before { + left: 0; + border-left-color: var(--border); + } + &::after { + right: 0; + border-right-color: var(--border); + } +} diff --git a/simopt-web/src/assets/hero.png b/simopt-web/src/assets/hero.png new file mode 100644 index 0000000000000000000000000000000000000000..02251f4b956c55af2d76fd0788124d7eee2b45eb GIT binary patch literal 13057 zcmV+cGycqpP)V|)f$;Qooc7=_G zlYe)HToTQIc!$)^+J1M1y0*T%w!p~7%ux`!eRhO?c80XDxKQ*R^lUUMnA>6NT^?feoZ8xxvP32D&s-9ow zqjcM}eesrC)NeDmsf)*P7wJ|K!&xP%Zy4iI8lF)Tv2!reW)tCzg_1=PmOwd1SQfxa z8;58t!=z~Ba7CYlNWVG>he8aRPY|+-JmozNhn!#9i#77Aa_Edt$ijyCWL#=~I>~2X zZNrQ8I0=D+NWD4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RLl9#CEN|Fg8>nbmsTg3a1;#M9enQ$RgWk}kp#-5wh=EF&1tl%mJln2V^8o%Qv(*=zEuO7y z=m*8?xpUn-*@h5Cl_3BK3joiGkyaScK+>|MWdMRWm@RT!Q1piAlv5hL@B6>3&GI8) zP!xBc6}ZNIpJLL%2a8Y!+(<=f%WX>_uWVxlga9!D*oYt$l0cxRDMvqfU;Kq_mLK5k z)dvqYcgLa_Lz?3HyeF)@$%$&6lI?r4I>6W#M*<)vq{?&Oqrx``d`mhpVPr> z#q078F6gw_X<=?KR>8%^t%@wbITvNMu!hKiTSkCTJkw>1!e*Y{%31#_yMf=LW7{RJ zYoC^w$6%3cBtVG5)x#{Hg6IVTh9XEcM{gQwXk!R^y95^f-hZ`d{aVa+xW1EO4wDV4 zB?JgD7*?qkvc|$nIykTvNl2x0j3Q!MXoLL^)~}d7jcYf(H8D~c+?$pKL(px>Z3`eb z04RzS6_AgFT6Pn#iZAg$Sl_j8#;6ShF%&(Fag#E2asU@@LaN;=b=Wf7sgPKhfzhBM zC@eFL8^MrnA*9&Khe*Ab@CC9*uyJGXyi(;y2>lQLJZt;ShtJi?3Yf_t`F+$hY!+Q2Ndsx=U+bjTiAy7djLji>7k%k`$9&--f<*BNA3Hy&ZrHH|4 zG5H&9cB?O#zI1_OOf0Ce%mDfQxdtp3vU%(iY6yji3iISS61XLv#z|!zI_sZqza@B+ zyu9st5-h+`H7QUKx9}3w@oU@EO}&cEzG?fu!!bLO->%zkcg;i9^j`S~=WKMnDi1f= P00000NkvXXu0mjft=yBf literal 0 HcmV?d00001 diff --git a/simopt-web/src/assets/svelte.svg b/simopt-web/src/assets/svelte.svg new file mode 100644 index 00000000..c5e08481 --- /dev/null +++ b/simopt-web/src/assets/svelte.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/simopt-web/src/assets/vite.svg b/simopt-web/src/assets/vite.svg new file mode 100644 index 00000000..5101b674 --- /dev/null +++ b/simopt-web/src/assets/vite.svg @@ -0,0 +1 @@ +Vite diff --git a/simopt-web/src/main.ts b/simopt-web/src/main.ts new file mode 100644 index 00000000..664a057a --- /dev/null +++ b/simopt-web/src/main.ts @@ -0,0 +1,9 @@ +import { mount } from 'svelte' +import './app.css' +import App from './App.svelte' + +const app = mount(App, { + target: document.getElementById('app')!, +}) + +export default app diff --git a/simopt-web/svelte.config.js b/simopt-web/svelte.config.js new file mode 100644 index 00000000..0cf7db32 --- /dev/null +++ b/simopt-web/svelte.config.js @@ -0,0 +1,2 @@ +/** @type {import("@sveltejs/vite-plugin-svelte").SvelteConfig} */ +export default {} diff --git a/simopt-web/tsconfig.app.json b/simopt-web/tsconfig.app.json new file mode 100644 index 00000000..d774b201 --- /dev/null +++ b/simopt-web/tsconfig.app.json @@ -0,0 +1,20 @@ +{ + "extends": "@tsconfig/svelte/tsconfig.json", + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", + "target": "es2023", + "module": "esnext", + "types": ["svelte", "vite/client"], + "noEmit": true, + /** + * Typecheck JS in `.svelte` and `.js` files by default. + * Disable checkJs if you'd like to use dynamic types in JS. + * Note that setting allowJs false does not prevent the use + * of JS in `.svelte` files. + */ + "allowJs": true, + "checkJs": true, + "moduleDetection": "force" + }, + "include": ["src/**/*.ts", "src/**/*.js", "src/**/*.svelte"] +} diff --git a/simopt-web/tsconfig.json b/simopt-web/tsconfig.json new file mode 100644 index 00000000..1ffef600 --- /dev/null +++ b/simopt-web/tsconfig.json @@ -0,0 +1,7 @@ +{ + "files": [], + "references": [ + { "path": "./tsconfig.app.json" }, + { "path": "./tsconfig.node.json" } + ] +} diff --git a/simopt-web/tsconfig.node.json b/simopt-web/tsconfig.node.json new file mode 100644 index 00000000..d3c52ea6 --- /dev/null +++ b/simopt-web/tsconfig.node.json @@ -0,0 +1,24 @@ +{ + "compilerOptions": { + "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", + "target": "es2023", + "lib": ["ES2023"], + "module": "esnext", + "types": ["node"], + "skipLibCheck": true, + + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "verbatimModuleSyntax": true, + "moduleDetection": "force", + "noEmit": true, + + /* Linting */ + "noUnusedLocals": true, + "noUnusedParameters": true, + "erasableSyntaxOnly": true, + "noFallthroughCasesInSwitch": true + }, + "include": ["vite.config.ts"] +} diff --git a/simopt-web/vite.config.ts b/simopt-web/vite.config.ts new file mode 100644 index 00000000..d32eba1d --- /dev/null +++ b/simopt-web/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import { svelte } from '@sveltejs/vite-plugin-svelte' + +// https://vite.dev/config/ +export default defineConfig({ + plugins: [svelte()], +}) From a1355b5371f3300ace613d068258e8756838d89b Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 21:45:57 -0400 Subject: [PATCH 03/13] Add frontend --- simopt-web/index.html | 2 +- simopt-web/src/App.svelte | 1596 +++++++++++++++++++++++++++++++++++-- simopt-web/src/app.css | 310 +------ 3 files changed, 1556 insertions(+), 352 deletions(-) diff --git a/simopt-web/index.html b/simopt-web/index.html index 81a02815..696f03ea 100644 --- a/simopt-web/index.html +++ b/simopt-web/index.html @@ -4,7 +4,7 @@ - simopt-web + SimOpt
diff --git a/simopt-web/src/App.svelte b/simopt-web/src/App.svelte index dafc575f..f8d795d9 100644 --- a/simopt-web/src/App.svelte +++ b/simopt-web/src/App.svelte @@ -1,89 +1,1523 @@ -
-
- - Svelte logo - Vite logo +
- -
- -
-
- -

Documentation

-

Your questions, answered

+ -
- -

Connect with us

-

Join the Vite community

- -
-
+ + +
+ {#if currentPage === "Simulator"} +
+ +
+ +
+

Choose Solver

+ + {#if selectedSolverName} + + {/if} + +
+ +
+ + {#if selectedSolverName} +
+

Solver Parameters

+ {#each solverParams as param, idx} + + {/each} +
+ {/if} +
+ + +
+ + + {#if showPostProcess} + + {/if} +
+ + +
+

Choose Plot

+ + {#if selectedPlotName} + + {/if} + +
+ +
+ + {#if plotParams.length} +
+

Plot Parameters ({selectedPlotName})

+ {#each plotParams as p, i} + + {/each} +
+ {/if} + + {#if selectedPlotName} +
+

Select Solvers (leave empty for all)

+ {#if summarySolvers.length === 0} +

No solvers added yet

+ {:else} + {#each summarySolvers as solver} + + {/each} + {/if} +
+ +
+

Select Problems (leave empty for all)

+ {#if summaryProblems.length === 0} +

No problems added yet

+ {:else} + {#each summaryProblems as problem} + + {/each} + {/if} +
+ {/if} +
+
+ + +
+ +
+

Choose Problem

+ + {#if selectedProblemName} + + {/if} + +
+ +
+ + {#if selectedProblemName} +
+

Problem Parameters

+ {#each problemParams as param, idx} + + {/each} +
+ {/if} +
+ + +
+ + + {#if showPostNormalize} + + {/if} +
+
+ + +
+
+

Summary

+ + +
+

Solvers

+ {#if summarySolvers.length === 0} +

No solvers added.

+ {/if} + {#each summarySolvers as s, i} +
+ + {#if s.expanded} +
    + {#each s.params as p}
  • {p.name}: {p.value ?? p.default ?? ""}
  • {/each} +
+ + {/if} +
+ {/each} +
+ + +
+

Problems

+ {#if summaryProblems.length === 0} +

No problems added.

+ {/if} + {#each summaryProblems as p, i} +
+ + {#if p.expanded} +
    + {#each p.params as q}
  • {q.name}: {q.value ?? q.default ?? ""}
  • {/each} +
+ + {/if} +
+ {/each} +
+ + +
+

Plots

+ {#if summaryPlots.length === 0} +

No plots added.

+ {/if} + + {#each summaryPlots as pl, i} +
+ + + {#if pl.expanded} + {#if pl.params && pl.params.length} +
    + {#each pl.params as p} +
  • {p.name}: {p.value ?? p.default ?? ""}
  • + {/each} +
+ {:else} +

No parameters.

+ {/if} + + {/if} +
+ {/each} +
+
+ + + {#if summarySolvers.length && summaryProblems.length} +
+
+

Compatibility

+ + {#if totalCompatCells > 0} + + {greenPct}% compatible + + {/if} +
+ + {#if totalCompatCells > 0} +
+ +
+ {:else} +

Add at least one solver and one problem to see compatibility.

+ {/if} + + +
+ {/if} +
+
+ +
+ +
+ + + {#if showConfirm} + + {/if} + + {#if showCompatModal} + + {/if} + {/if} +
+ + \ No newline at end of file diff --git a/simopt-web/src/app.css b/simopt-web/src/app.css index 527d4fba..60253163 100644 --- a/simopt-web/src/app.css +++ b/simopt-web/src/app.css @@ -1,296 +1,66 @@ :root { - --text: #6b6375; - --text-h: #08060d; - --bg: #fff; - --border: #e5e4e7; - --code-bg: #f4f3ec; - --accent: #aa3bff; - --accent-bg: rgba(170, 59, 255, 0.1); - --accent-border: rgba(170, 59, 255, 0.5); - --social-bg: rgba(244, 243, 236, 0.5); - --shadow: - rgba(0, 0, 0, 0.1) 0 10px 15px -3px, rgba(0, 0, 0, 0.05) 0 4px 6px -2px; + font-family: system-ui, Avenir, Helvetica, Arial, sans-serif; + line-height: 1.5; + font-weight: 400; - --sans: system-ui, 'Segoe UI', Roboto, sans-serif; - --heading: system-ui, 'Segoe UI', Roboto, sans-serif; - --mono: ui-monospace, Consolas, monospace; - - font: 18px/145% var(--sans); - letter-spacing: 0.18px; color-scheme: light dark; - color: var(--text); - background: var(--bg); + color: #213547; + background-color: #ffffff; + font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; - - @media (max-width: 1024px) { - font-size: 16px; - } } -@media (prefers-color-scheme: dark) { - :root { - --text: #9ca3af; - --text-h: #f3f4f6; - --bg: #16171d; - --border: #2e303a; - --code-bg: #1f2028; - --accent: #c084fc; - --accent-bg: rgba(192, 132, 252, 0.15); - --accent-border: rgba(192, 132, 252, 0.5); - --social-bg: rgba(47, 48, 58, 0.5); - --shadow: - rgba(0, 0, 0, 0.4) 0 10px 15px -3px, rgba(0, 0, 0, 0.25) 0 4px 6px -2px; - } - - #social .button-icon { - filter: invert(1) brightness(2); - } +a { + font-weight: 500; + color: #2563eb; /* blue link */ + text-decoration: none; +} +a:hover { + color: #1d4ed8; } body { margin: 0; -} - -h1, -h2 { - font-family: var(--heading); - font-weight: 500; - color: var(--text-h); + display: block; /* no flex centering */ + min-width: 320px; + min-height: 100vh; + background-color: #ffffff; } h1 { - font-size: 56px; - letter-spacing: -1.68px; - margin: 32px 0; - @media (max-width: 1024px) { - font-size: 36px; - margin: 20px 0; - } -} -h2 { - font-size: 24px; - line-height: 118%; - letter-spacing: -0.24px; - margin: 0 0 8px; - @media (max-width: 1024px) { - font-size: 20px; - } -} -p { - margin: 0; -} - -code, -.counter { - font-family: var(--mono); - display: inline-flex; - border-radius: 4px; - color: var(--text-h); -} - -code { - font-size: 15px; - line-height: 135%; - padding: 4px 8px; - background: var(--code-bg); -} - -.counter { - font-size: 16px; - padding: 5px 10px; - border-radius: 5px; - color: var(--accent); - background: var(--accent-bg); - border: 2px solid transparent; - transition: border-color 0.3s; - margin-bottom: 24px; - - &:hover { - border-color: var(--accent-border); - } - &:focus-visible { - outline: 2px solid var(--accent); - outline-offset: 2px; - } -} - -.hero { - position: relative; - - .base, - .framework, - .vite { - inset-inline: 0; - margin: 0 auto; - } - - .base { - width: 170px; - position: relative; - z-index: 0; - } - - .framework, - .vite { - position: absolute; - } - - .framework { - z-index: 1; - top: 34px; - height: 28px; - transform: perspective(2000px) rotateZ(300deg) rotateX(44deg) rotateY(39deg) - scale(1.4); - } - - .vite { - z-index: 0; - top: 107px; - height: 26px; - width: auto; - transform: perspective(2000px) rotateZ(300deg) rotateX(40deg) rotateY(39deg) - scale(0.8); - } + font-size: 2em; + line-height: 1.2; } #app { - width: 1126px; - max-width: 100%; - margin: 0 auto; - text-align: center; - border-inline: 1px solid var(--border); - min-height: 100svh; - display: flex; - flex-direction: column; - box-sizing: border-box; -} - -#center { - display: flex; - flex-direction: column; - gap: 25px; - place-content: center; - place-items: center; - flex-grow: 1; - - @media (max-width: 1024px) { - padding: 32px 20px 24px; - gap: 18px; - } + margin: 0; /* no auto centering */ + padding: 0; /* some spacing around content */ + text-align: left; /* left-align all content */ + max-width: none; /* allow full width */ } -#next-steps { - display: flex; - border-top: 1px solid var(--border); - text-align: left; - - & > div { - flex: 1 1 0; - padding: 32px; - @media (max-width: 1024px) { - padding: 24px 20px; - } - } - - .icon { - margin-bottom: 16px; - width: 22px; - height: 22px; - } - - @media (max-width: 1024px) { - flex-direction: column; - text-align: center; - } -} - -#docs { - border-right: 1px solid var(--border); - - @media (max-width: 1024px) { - border-right: none; - border-bottom: 1px solid var(--border); - } -} - -#next-steps ul { - list-style: none; - padding: 0; - display: flex; - gap: 8px; - margin: 32px 0 0; - - .logo { - height: 18px; - } - - a { - color: var(--text-h); - font-size: 16px; - border-radius: 6px; - background: var(--social-bg); - display: flex; - padding: 6px 12px; - align-items: center; - gap: 8px; - text-decoration: none; - transition: box-shadow 0.3s; - - &:hover { - box-shadow: var(--shadow); - } - .button-icon { - height: 18px; - width: 18px; - } - } - - @media (max-width: 1024px) { - margin-top: 20px; - flex-wrap: wrap; - justify-content: center; - - li { - flex: 1 1 calc(50% - 8px); - } - - a { - width: 100%; - justify-content: center; - box-sizing: border-box; - } - } +button { + border-radius: 6px; + border: 1px solid transparent; + padding: 0.6em 1.2em; + font-size: 1em; + font-weight: 500; + font-family: inherit; + background-color: #2563eb; /* blue buttons */ + color: #fff; + cursor: pointer; + transition: background-color 0.25s, border-color 0.25s; } -#spacer { - height: 88px; - border-top: 1px solid var(--border); - @media (max-width: 1024px) { - height: 48px; - } +button:hover { + background-color: #1d4ed8; } -.ticks { - position: relative; - width: 100%; - - &::before, - &::after { - content: ''; - position: absolute; - top: -4.5px; - border: 5px solid transparent; - } - - &::before { - left: 0; - border-left-color: var(--border); - } - &::after { - right: 0; - border-right-color: var(--border); - } +button:focus, +button:focus-visible { + outline: 3px solid #93c5fd; + outline-offset: 2px; } From 7c10f4ccd41e07a17077069f30df2b4462afca99 Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 22:52:25 -0400 Subject: [PATCH 04/13] Update results path --- simopt/web/server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simopt/web/server.py b/simopt/web/server.py index 3e075ef7..9a22245c 100644 --- a/simopt/web/server.py +++ b/simopt/web/server.py @@ -72,7 +72,7 @@ class ExperimentRequest(BaseModel): # BASE_DIR points to the repository root for existing result-file storage. WEB_DIR = Path(__file__).resolve().parent BASE_DIR = WEB_DIR.parent.parent -RESULTS_DIR = BASE_DIR / "svelte-app" / "results" +RESULTS_DIR = BASE_DIR / "simopt-web" / "results" STATIC_DIR = WEB_DIR / "static" # ── FastAPI app setup ── From 5e667b696e37f0228b9f10f3fb1166e8ace177ce Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 23:26:05 -0400 Subject: [PATCH 05/13] Change build directory --- simopt-web/vite.config.ts | 6 +++++- simopt/web/server.py | 7 ++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/simopt-web/vite.config.ts b/simopt-web/vite.config.ts index d32eba1d..92e29c22 100644 --- a/simopt-web/vite.config.ts +++ b/simopt-web/vite.config.ts @@ -4,4 +4,8 @@ import { svelte } from '@sveltejs/vite-plugin-svelte' // https://vite.dev/config/ export default defineConfig({ plugins: [svelte()], -}) + build: { + outDir: '../simopt/web/dist', + emptyOutDir: true, + }, +}); diff --git a/simopt/web/server.py b/simopt/web/server.py index 9a22245c..736fb1df 100644 --- a/simopt/web/server.py +++ b/simopt/web/server.py @@ -73,7 +73,8 @@ class ExperimentRequest(BaseModel): WEB_DIR = Path(__file__).resolve().parent BASE_DIR = WEB_DIR.parent.parent RESULTS_DIR = BASE_DIR / "simopt-web" / "results" -STATIC_DIR = WEB_DIR / "static" +DIST_DIR = WEB_DIR / "dist" +STATIC_DIR = DIST_DIR / "assets" # ── FastAPI app setup ── app = FastAPI(title="SimOpt API") @@ -99,7 +100,7 @@ class ExperimentRequest(BaseModel): @app.get("/") def serve_frontend(): """Serve the main frontend HTML page.""" - return FileResponse(str(STATIC_DIR / "index.html")) + return FileResponse(str(DIST_DIR / "index.html")) @app.get("/results/{run_id}/experiment.log") @@ -139,7 +140,7 @@ def serve_result(run_id: str): # because FastAPI processes explicit routes before static mounts. RESULTS_DIR.mkdir(exist_ok=True) app.mount("/results", StaticFiles(directory=str(RESULTS_DIR)), name="results") -app.mount("/static", StaticFiles(directory=str(STATIC_DIR)), name="static") +app.mount("/assets", StaticFiles(directory=str(STATIC_DIR)), name="static") # ── Name mappings ── From 14e4e4465fca9455115da0739d7f2f717496897f Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 23:31:53 -0400 Subject: [PATCH 06/13] Include build files in Python package --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 68f2c9d7..c155cf77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,7 @@ exclude = ["build*"] [tool.setuptools.package-data] "simopt.data_farming" = ["*.npz"] +"simopt.web" = ["dist/*", "dist/**/*"] [tool.uv.sources] simopt-extensions = { git = "https://github.com/cenwangumass/simopt-extensions", rev = "b40a9c8" } From 44e6d35870897023b31f684119bb502b9b2f2111 Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 23:36:53 -0400 Subject: [PATCH 07/13] Add oxfmt --- simopt-web/package-lock.json | 414 ++++++++++++++++++++++++++++++++++- simopt-web/package.json | 5 +- 2 files changed, 410 insertions(+), 9 deletions(-) diff --git a/simopt-web/package-lock.json b/simopt-web/package-lock.json index 8f107192..dae2b8ac 100644 --- a/simopt-web/package-lock.json +++ b/simopt-web/package-lock.json @@ -11,6 +11,7 @@ "@sveltejs/vite-plugin-svelte": "^7.1.2", "@tsconfig/svelte": "^5.0.8", "@types/node": "^24.12.3", + "oxfmt": "^0.50.0", "svelte": "^5.55.5", "svelte-check": "^4.4.8", "typescript": "~6.0.2", @@ -24,7 +25,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "@emnapi/wasi-threads": "1.2.1", "tslib": "^2.4.0" @@ -37,7 +37,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "dependencies": { "tslib": "^2.4.0" } @@ -132,6 +131,353 @@ "url": "https://github.com/sponsors/Boshen" } }, + "node_modules/@oxfmt/binding-android-arm-eabi": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm-eabi/-/binding-android-arm-eabi-0.50.0.tgz", + "integrity": "sha512-ICXQVKrDvsWUtfx6EiVJxfWrajKTwTfRV8vz2XiMkxZeuCKJLgD4YAj6dE3BWvpqDlkVkie4VSTAtMUWO9LDXg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-android-arm64": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-android-arm64/-/binding-android-arm64-0.50.0.tgz", + "integrity": "sha512-quwjLQFkuW6OwLHeDeIXsTzOmipQFQbqsYN9HLk2B5I01IlAQZHP1UiLIg0O7pP+dUgPD2AD7SCYA3gs6NH5/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-arm64": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-arm64/-/binding-darwin-arm64-0.50.0.tgz", + "integrity": "sha512-ikU5umElcMi78/TNI334wtjr5WZ5F4nWa1aIDseAKKGL0W3ygxeYKkrIJ0fggWa8MOon66BmG3xCqmX1m9YAOw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-darwin-x64": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-darwin-x64/-/binding-darwin-x64-0.50.0.tgz", + "integrity": "sha512-WT4MOYG4mv9IXrH0m60vHsJh+rRMPSOKTQmwDpwmgQ+DuW/i5dU4pqc0HDO5uclO5vjz5IFX5z/taW86LSVe/g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-freebsd-x64": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-freebsd-x64/-/binding-freebsd-x64-0.50.0.tgz", + "integrity": "sha512-gH0rycVXqV4juWkvLs2uPMtTyppDc7qEUVzXAxnQ7FpcSZNXqKowUgtjH8q67ngj416r8+4NnAlyR/D35zwwhQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-gnueabihf": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.50.0.tgz", + "integrity": "sha512-wL/k+o0hiTeRvi/gPzeC1L/yTHTXIeHDKWU09s2zTBmv7ma59wTm+fADNSGYxhJQDxyavQbwTf1QpW3Zj924tQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm-musleabihf": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.50.0.tgz", + "integrity": "sha512-Y59FKqoUM3Gf00E395b4ixfWyJGwO2GzaZawF5MZoVWcb3f6CkWUXyao0jyOvoIxDMzMybcVRuXyG7ih/Nxweg==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-gnu": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.50.0.tgz", + "integrity": "sha512-OvXbfTjMignXWyJXg/NOFsiy996vFe8wb9tkxJaUq8ylq0XrzJg3ttavC5Tcmm6F8/GUs2r3XFJWWu9q/27uYw==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-arm64-musl": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.50.0.tgz", + "integrity": "sha512-rqmvHZm7vMa3NLYa0khwkhReCmp9tqKnF23TFZ7S5cYJLvIE4b0k8famWE7kO897/DXznJe675n5SohFBggbxA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-ppc64-gnu": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.50.0.tgz", + "integrity": "sha512-49bAdYbMSde42tzPDtuHnBWzOgmoS0PT9THCjvMnDVYMQYiHzPc2Mv5rkpBHVQOXM+PHfafJlxgK0anXSWBVvw==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-gnu": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.50.0.tgz", + "integrity": "sha512-VFT25/6kckkIM62KeWB2bi+xCEmC/zC+DcMaIpEfaio8ulkGDLSiTz11TyK0eqgTl3x5OklYEGDWohvAgOr8Bw==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-riscv64-musl": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.50.0.tgz", + "integrity": "sha512-BBJMuNy6jjkXjUUINF5UTQqb/nvjmtJad43Gp7bab0AAURAdthhJvduR7rHpWInpWYiaMzYsdrmURNcrmpxdZA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-s390x-gnu": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.50.0.tgz", + "integrity": "sha512-Xd4y+yjAYHKmryXhyUUwbyRD01iKfcvI74iE01L6p4F8SwjhZQXDshK+T8PcrPZLiFqH263P5xqJk94amjkjzQ==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-gnu": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.50.0.tgz", + "integrity": "sha512-Qp96rYJru7l++7mk4R+eh8qq9GFfFAMdmoN6VGoRHI8AA1XMnUIzH4u+zOcKZZwY+irHdsaBldDearwB4nOH7A==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-linux-x64-musl": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-linux-x64-musl/-/binding-linux-x64-musl-0.50.0.tgz", + "integrity": "sha512-5XLGp+yd5w2Key5LMqJO+X3XVsJKgeeUKljy32+MBF/J/JZ5m8WHl6dI5eOQOr3ixopxPiXIyDAxn3slI3UXiQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-openharmony-arm64": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-openharmony-arm64/-/binding-openharmony-arm64-0.50.0.tgz", + "integrity": "sha512-QAxwzh7+GHugCD7WuERolVs8TKQwXNIAZXAHHTecbKVc9oWBkWzOiLauQuezXS57tVcof5zhi1IjZ8tOV0htTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-arm64-msvc": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.50.0.tgz", + "integrity": "sha512-3nKN/kqClm9iCFWTwtJ9UpR5SGyExp5l3nw6uIiBt+3XitQtszin+vjHrL7JHfDksZ7Svigdaow2zqz/IKCfqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-ia32-msvc": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.50.0.tgz", + "integrity": "sha512-3r6XZ8+X6qlLbXaPW2NygfiAWSpKbkE36pAVzS83mY+cYY+pSMalJ+qnCgkr92tr+Iqv988XKQ1CpARTg9ITbQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxfmt/binding-win32-x64-msvc": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/@oxfmt/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.50.0.tgz", + "integrity": "sha512-BSE8D8KsvquMG9vU+Qt4qGuoOcZ36rxU5S6ZkHNguj+MlWkXWCBETnno3yJ9CfWvfCrbmieaN9LK6hdcdHNZ/w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, "node_modules/@rolldown/binding-android-arm64": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.0.1.tgz", @@ -457,7 +803,6 @@ "integrity": "sha512-GUUEShf+PBCGW2KaXwcIt3Yk+e3pkKwWKb9GSyM9WQVE+ep2jzmHdGsHzu4wgcZy5fN9FBdVzjpBQsYlpfpgLA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "undici-types": "~7.16.0" } @@ -475,7 +820,6 @@ "integrity": "sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==", "dev": true, "license": "MIT", - "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -942,6 +1286,54 @@ ], "license": "MIT" }, + "node_modules/oxfmt": { + "version": "0.50.0", + "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.50.0.tgz", + "integrity": "sha512-owwjTnhfM5aCOJhYeqDvk7iM504OeYFZpdRU7cxx7xtZMo4uVpjlryTUon+Cf76CugsvnqA32e6rC73pr1hXaw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinypool": "2.1.0" + }, + "bin": { + "oxfmt": "bin/oxfmt" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxfmt/binding-android-arm-eabi": "0.50.0", + "@oxfmt/binding-android-arm64": "0.50.0", + "@oxfmt/binding-darwin-arm64": "0.50.0", + "@oxfmt/binding-darwin-x64": "0.50.0", + "@oxfmt/binding-freebsd-x64": "0.50.0", + "@oxfmt/binding-linux-arm-gnueabihf": "0.50.0", + "@oxfmt/binding-linux-arm-musleabihf": "0.50.0", + "@oxfmt/binding-linux-arm64-gnu": "0.50.0", + "@oxfmt/binding-linux-arm64-musl": "0.50.0", + "@oxfmt/binding-linux-ppc64-gnu": "0.50.0", + "@oxfmt/binding-linux-riscv64-gnu": "0.50.0", + "@oxfmt/binding-linux-riscv64-musl": "0.50.0", + "@oxfmt/binding-linux-s390x-gnu": "0.50.0", + "@oxfmt/binding-linux-x64-gnu": "0.50.0", + "@oxfmt/binding-linux-x64-musl": "0.50.0", + "@oxfmt/binding-openharmony-arm64": "0.50.0", + "@oxfmt/binding-win32-arm64-msvc": "0.50.0", + "@oxfmt/binding-win32-ia32-msvc": "0.50.0", + "@oxfmt/binding-win32-x64-msvc": "0.50.0" + }, + "peerDependencies": { + "svelte": "^5.0.0" + }, + "peerDependenciesMeta": { + "svelte": { + "optional": true + } + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -955,7 +1347,6 @@ "integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12" }, @@ -1069,7 +1460,6 @@ "integrity": "sha512-4D6lyrMHmDaZalQOEBMCWCCidyZjSnec14/oPn0k627G6goxcck9xqMwz1tFLlQz+ZFvtTTHfFOlUayuAz0z6Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@jridgewell/remapping": "^2.3.4", "@jridgewell/sourcemap-codec": "^1.5.0", @@ -1133,6 +1523,16 @@ "url": "https://github.com/sponsors/SuperchupuDev" } }, + "node_modules/tinypool": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tinypool/-/tinypool-2.1.0.tgz", + "integrity": "sha512-Pugqs6M0m7Lv1I7FtxN4aoyToKg1C4tu+/381vH35y8oENM/Ai7f7C4StcoK4/+BSw9ebcS8jRiVrORFKCALLw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.0.0 || >=22.0.0" + } + }, "node_modules/tslib": { "version": "2.8.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", @@ -1147,7 +1547,6 @@ "integrity": "sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==", "dev": true, "license": "Apache-2.0", - "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -1169,7 +1568,6 @@ "integrity": "sha512-MFtjBYgzmSxmgA4RAfjIyXWpGe1oALnjgUTzzV7QLx/TKxCzjtMH6Fd9/eVK+5Fg1qNoz5VAwsmMs/NofrmJvw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "lightningcss": "^1.32.0", "picomatch": "^4.0.4", diff --git a/simopt-web/package.json b/simopt-web/package.json index 6e8e6aed..bc59fd24 100644 --- a/simopt-web/package.json +++ b/simopt-web/package.json @@ -7,12 +7,15 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json" + "check": "svelte-check --tsconfig ./tsconfig.app.json && tsc -p tsconfig.node.json", + "fmt": "oxfmt", + "fmt:check": "oxfmt --check" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^7.1.2", "@tsconfig/svelte": "^5.0.8", "@types/node": "^24.12.3", + "oxfmt": "^0.50.0", "svelte": "^5.55.5", "svelte-check": "^4.4.8", "typescript": "~6.0.2", From 890c26c802521440efea314ee42483590e2be2ba Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Mon, 18 May 2026 23:40:55 -0400 Subject: [PATCH 08/13] Run oxfmt --- simopt-web/README.md | 4 ++-- simopt-web/package.json | 2 +- simopt-web/src/app.css | 14 ++++++++------ simopt-web/src/main.ts | 12 ++++++------ simopt-web/svelte.config.js | 2 +- simopt-web/tsconfig.json | 5 +---- simopt-web/vite.config.ts | 6 +++--- 7 files changed, 22 insertions(+), 23 deletions(-) diff --git a/simopt-web/README.md b/simopt-web/README.md index e6cd94fc..a45e2a0b 100644 --- a/simopt-web/README.md +++ b/simopt-web/README.md @@ -42,6 +42,6 @@ If you have state that's important to retain within a component, consider creati ```ts // store.ts // An extremely simple external store -import { writable } from 'svelte/store' -export default writable(0) +import { writable } from "svelte/store"; +export default writable(0); ``` diff --git a/simopt-web/package.json b/simopt-web/package.json index bc59fd24..cb977b6b 100644 --- a/simopt-web/package.json +++ b/simopt-web/package.json @@ -1,7 +1,7 @@ { "name": "simopt-web", - "private": true, "version": "0.0.0", + "private": true, "type": "module", "scripts": { "dev": "vite", diff --git a/simopt-web/src/app.css b/simopt-web/src/app.css index 60253163..ed5c354b 100644 --- a/simopt-web/src/app.css +++ b/simopt-web/src/app.css @@ -24,7 +24,7 @@ a:hover { body { margin: 0; - display: block; /* no flex centering */ + display: block; /* no flex centering */ min-width: 320px; min-height: 100vh; background-color: #ffffff; @@ -36,10 +36,10 @@ h1 { } #app { - margin: 0; /* no auto centering */ - padding: 0; /* some spacing around content */ - text-align: left; /* left-align all content */ - max-width: none; /* allow full width */ + margin: 0; /* no auto centering */ + padding: 0; /* some spacing around content */ + text-align: left; /* left-align all content */ + max-width: none; /* allow full width */ } button { @@ -52,7 +52,9 @@ button { background-color: #2563eb; /* blue buttons */ color: #fff; cursor: pointer; - transition: background-color 0.25s, border-color 0.25s; + transition: + background-color 0.25s, + border-color 0.25s; } button:hover { diff --git a/simopt-web/src/main.ts b/simopt-web/src/main.ts index 664a057a..d47b9308 100644 --- a/simopt-web/src/main.ts +++ b/simopt-web/src/main.ts @@ -1,9 +1,9 @@ -import { mount } from 'svelte' -import './app.css' -import App from './App.svelte' +import { mount } from "svelte"; +import "./app.css"; +import App from "./App.svelte"; const app = mount(App, { - target: document.getElementById('app')!, -}) + target: document.getElementById("app")!, +}); -export default app +export default app; diff --git a/simopt-web/svelte.config.js b/simopt-web/svelte.config.js index 0cf7db32..ed459535 100644 --- a/simopt-web/svelte.config.js +++ b/simopt-web/svelte.config.js @@ -1,2 +1,2 @@ /** @type {import("@sveltejs/vite-plugin-svelte").SvelteConfig} */ -export default {} +export default {}; diff --git a/simopt-web/tsconfig.json b/simopt-web/tsconfig.json index 1ffef600..d32ff682 100644 --- a/simopt-web/tsconfig.json +++ b/simopt-web/tsconfig.json @@ -1,7 +1,4 @@ { "files": [], - "references": [ - { "path": "./tsconfig.app.json" }, - { "path": "./tsconfig.node.json" } - ] + "references": [{ "path": "./tsconfig.app.json" }, { "path": "./tsconfig.node.json" }] } diff --git a/simopt-web/vite.config.ts b/simopt-web/vite.config.ts index 92e29c22..b6c39d72 100644 --- a/simopt-web/vite.config.ts +++ b/simopt-web/vite.config.ts @@ -1,11 +1,11 @@ -import { defineConfig } from 'vite' -import { svelte } from '@sveltejs/vite-plugin-svelte' +import { defineConfig } from "vite"; +import { svelte } from "@sveltejs/vite-plugin-svelte"; // https://vite.dev/config/ export default defineConfig({ plugins: [svelte()], build: { - outDir: '../simopt/web/dist', + outDir: "../simopt/web/dist", emptyOutDir: true, }, }); From 0cf18854504c5a92d2838038afdcbf9beae5de23 Mon Sep 17 00:00:00 2001 From: Cen Wang Date: Tue, 19 May 2026 14:47:31 -0400 Subject: [PATCH 09/13] Fix svelte-check issues --- simopt-web/src/App.svelte | 315 ++++++++++++++++++++++---------------- simopt-web/src/types.ts | 40 +++++ 2 files changed, 221 insertions(+), 134 deletions(-) create mode 100644 simopt-web/src/types.ts diff --git a/simopt-web/src/App.svelte b/simopt-web/src/App.svelte index f8d795d9..44f5a146 100644 --- a/simopt-web/src/App.svelte +++ b/simopt-web/src/App.svelte @@ -1,22 +1,35 @@ -