{% extends "base.html" %} {% block title %}Web UI Documentation{% endblock %} {% block body %}

Web UI Documentation

Everything you need to create gratings, run simulations, and plot results inside Grax Web.

Back to home Create grating

The active workspace root is {{ workspace_root }}. By default, Grax Web stores data in .grax-web/ in the current working directory unless you switch the workspace from the home page.

Storage Materials Gratings Simulations Plots Export Modify later

Where data is saved

Grax Web keeps all local state under the active workspace directory. The default workspace is .grax-web/ next to where you launch grax-web.

saved_gratings/One JSON file per saved grating spec.
runs/One run directory per simulation, with manifests and CSV outputs.
plots/Saved comparison plots and their manifests.
previews/Temporary and live preview images shown in the browser.

The workspace can be changed from the home page. When you switch workspaces, the app reads and writes future gratings, runs, and plots in the new location.

Materials

The grating form uses the same packaged Henke material list that the Python API uses. Pick a material from the dropdown. The density field is prefilled with the built-in default for that element, and you can type a measured density when your sample is a film, porous layer, or otherwise not bulk-like.

xrt-style material objects still work for compatibility during the transition, but Grax will warn that this path is deprecated and will be removed in a future release. For new work, prefer the string material name plus an optional density override.

Create and save gratings

  1. Open New grating from the top bar or the home page.
  2. Choose the grating type, period, numerical resolutions, and profile-specific parameters.
  3. Select the coating stack type and pick materials from the built-in material catalog.
  4. Use the live preview panel to confirm the shape before saving.
  5. Save the grating to store it in saved_gratings/<grating-id>.json.

After saving, the grating detail page lets you edit the profile, review the preview image, or delete the grating. Saved gratings are the starting point for simulations. The saved JSON now stores each material as a name plus density pair so the same sample can be reconstructed later.

Run simulations

  1. Open a saved grating from the home page.
  2. Pick a workflow: fixed angle, monochromator, multilayer theta search, or parameter study.
  3. Enter the energy range, diffraction order, Fourier orders, polarization, and any workflow-specific values.
  4. Add an optional run comment if you want the saved run to carry a note or experiment tag.
  5. Choose the worker mode if you want auto or manual multiprocessing.
  6. Run the sweep and follow the progress page while the simulation writes results.

Each run gets its own directory under runs/<run-id>/. The manifest records the workflow, grating metadata, selected orders, comment, and progress state. The run directory also stores the result CSV files and generated preview images for that run.

Compare and plot runs

  1. Open Plots from the top bar.
  2. Select one or more saved runs.
  3. Choose the diffraction orders you want to compare.
  4. Use the live Plotly preview to inspect the combined plot before saving it.
  5. Adjust the line color, marker type, marker size, and x/y axis scales directly in the form.
  6. Save the plot to create a dedicated entry under plots/<plot-id>/.

The saved plot page reopens the same interactive Plotly figure together with the selected runs and orders, so the comparison styling and the axis modes persist with the saved plot.

Export plots and manage saved data

How to modify the interface later

If you want to change the Web UI, these files control the main moving parts:

To change the default workspace folder, edit the create_app() setup in src/grax/web/app.py. To change the docs itself, edit this template and the matching external docs notes in docs/index.md and docs/installation/web-ui.md.

{% endblock %}