Skip to content

Commit d2a5d20

Browse files
sbryngelsonclaude
andcommitted
Add --interactive mode: Dash web UI for 3D/2D/1D visualization
New file: toolchain/mfc/viz/interactive.py - Dark-themed Dash app (Catppuccin Mocha palette) - Viz modes: Slice (x/y/z + position slider), Isosurface (min/max + surface count + caps toggle), Volume (opacity + shell count + isomin/isomax); 2D heatmap and 1D line - Play/Pause with FPS slider and loop toggle via dcc.Interval - Colormap picker (48 options), log scale, vmin/vmax + auto reset - Camera angle preserved across updates (uirevision=mode) - Server-side cache avoids re-reading the same step twice viz.py: --interactive defaults --step to all; dispatches before PNG/MP4 commands.py: add --interactive / -i and --port flags Usage: ./mfc.sh viz case_dir/ --var pres --interactive ./mfc.sh viz case_dir/ --var pres --interactive --port 8080 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dbaa9f0 commit d2a5d20

3 files changed

Lines changed: 620 additions & 2 deletions

File tree

toolchain/mfc/cli/commands.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,6 +1017,20 @@
10171017
default=False,
10181018
dest="log_scale",
10191019
),
1020+
Argument(
1021+
name="interactive",
1022+
short="i",
1023+
help="Launch an interactive Dash web UI instead of saving PNG/MP4.",
1024+
action=ArgAction.STORE_TRUE,
1025+
default=False,
1026+
),
1027+
Argument(
1028+
name="port",
1029+
help="Port for the interactive web server (default: 8050).",
1030+
type=int,
1031+
default=8050,
1032+
metavar="PORT",
1033+
),
10201034
],
10211035
examples=[
10221036
Example("./mfc.sh viz case_dir/ --var pres --step 1000", "Plot pressure at step 1000"),
@@ -1031,6 +1045,7 @@
10311045
("--list-vars", "List available variables"),
10321046
("--list-steps", "List available timesteps"),
10331047
("--mp4", "Generate MP4 video"),
1048+
("--interactive / -i", "Launch interactive Dash web UI"),
10341049
("--cmap NAME", "Matplotlib colormap"),
10351050
("--slice-axis x|y|z", "Axis for 3D slice"),
10361051
],

0 commit comments

Comments
 (0)