Skip to content

docs: draw the solutions of the crons on the problem pages (#314, phase C) - #420

Merged
ocots merged 2 commits into
mainfrom
feat/314-docs-results
Nov 7, 2026
Merged

ocots merged 2 commits into
mainfrom
feat/314-docs-results

Conversation

@ocots

@ocots ocots commented Nov 7, 2026

Copy link
Copy Markdown
Member

Part of #314, phase C of the plan. Stacked on #419 (phase B), itself stacked on #417 (phase A).

Conventions: ct-conventions v0.11.0 (SITE rules), ct-agents v0.4.0.

What

Each modeling tab now has a Solution section, and Compare a Solutions side by side section. The solutions are those the convergence crons publish (phase B), and the browser draws them. Julia computes, it does not draw: no plotting library, and nothing is solved at build time.

ProblemPlot.vue, written in plain SVG:

  • solves to overlay: the legend chips toggle them. Each chip shows the objective, and an "older version" tag when the solve is stale;
  • three views:
    • against time: one small panel per component, in a responsive grid;
    • phase plane: any two components, or time, on the axes;
    • 3D: any three, rotated by dragging or with the arrow keys;
  • components: state, control and costate, chosen one by one or by group; "All" shows every figure. By default the state and the control are shown, not the costate;
  • a time cursor shared by every view: set by hovering a panel, by the slider, or played (▶, 6 s from start to end). Draw up to t draws the trajectories up to the cursor only, so playing it animates the trajectory as it is traced;
  • values at the cursor: in the header of each panel, and as a table (accessibility);
  • variable values (for instance tf) listed under the plots;
  • colors: the reference categorical palette, validated in light and dark. Each solve keeps its slot whatever is shown, and colors are never cycled. In Compare, the line dash tells the modeling apart, as a secondary encoding;
  • in Compare, when a costate is drawn with JuMP among the modelings, a note says that the JuMP costate has the opposite sign ([Dev] Align the costate and dual signs of the JuMP models with OptimalControl #326).

docs/results.jl:

  • reads the results branch: git fetch --depth=1 origin results, then git archive read with the Tar stdlib. OCP_RESULTS_DIR=<dir> reads a local tree instead; that is how I built it here;
  • freshness, per modeling: up to date when every result carries the current fingerprint of the problem (OptimalControlProblems._fingerprint, the same function the tests use, from test: record the trajectories, the environment and the fingerprint of the solves (#314, phase A) #417), stale otherwise, or no results yet. The badge names the run, its date and its commit;
  • Reproducibility block (<details>): the run, the commit, and for each platform Julia, the system, the CPU and the threads. It has a table of package versions per platform, links to download Project.toml, Manifest.toml, versioninfo and Pkg.status, and the command to solve again. It says honestly that the versions resolved later may differ, and that the manifest lists those of the run;
  • copies what the pages draw into the site (docs/src/public/results/, git-ignored): one JSON per problem, and the trajectory of one platform per configuration (Linux first). Platforms agree to the solver tolerance, so one is enough, and the site stays small;
  • without results (the results branch has no problems/ yet, or no network), the build works and the pages say "No results yet".

ResultLink.vue: a link to a file of public/results/ that follows the base of the deployed version (dev, stable, previews).

Choices

  • No chart library. A dependency (Plotly is about 3 MB) would be a second tool, for lines, an orthographic projection and a cursor. The component is about 600 lines and covers exactly what the pages need.
  • One platform per configuration is copied, as said above. The trajectories are rounded to 6 digits (test: record the trajectories, the environment and the fingerprint of the solves (#314, phase A) #417), so they barely change from week to week, and gh-pages does not grow every week either.
  • The Reproducibility block and the badges are rendered at build time (HTML, searchable). Only the plot is client-side.

Verification

🤖 Generated with Claude Code

ocots and others added 2 commits November 7, 2026 17:24
Each modeling tab, and Compare, now shows the solutions the convergence
crons published (#314): `ProblemPlot.vue` draws them in the browser, from
the trajectories, with no plotting library.

- the reader chooses the solves to overlay, the components (state, control,
  costate), and the view: against time (one panel per component), phase
  plane (any two components, or time), or 3D (dragged, or the arrow keys);
- a time cursor shared by the views, moved by hovering, by the slider, or
  played; "Draw up to t" draws the trajectories up to the cursor;
- the values at the cursor in each panel, and as a table;
- the reference categorical palette, one slot per solve, never cycled; in
  Compare, one dash pattern per modeling.

`docs/results.jl` reads the `results` branch (or `OCP_RESULTS_DIR`), says
whether each modeling's results are those of the current version of the
problem (same `_fingerprint`), adds a Reproducibility block (run, commit,
environment of each platform, Project.toml and Manifest.toml to download),
and copies what the pages draw into the site, one platform per
configuration. Without results the build works and the pages say so.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…he screen

- Compare names the modeling of each freshness badge;
- the time axis spans the time grids exactly (a free final time is not
  rounded up), with nice ticks inside;
- solves that agree stay all visible: the first ones drawn wider, under;
- the phase plane and the 3D view take a smaller size on a narrow screen,
  so their text keeps its size.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ocots ocots added the run documentation Trigger the Documentation workflow on this PR label Nov 7, 2026
Base automatically changed from feat/314-publish-results to main November 7, 2026 22:10
@ocots
ocots merged commit fef946d into main Nov 7, 2026
17 checks passed
@ocots
ocots deleted the feat/314-docs-results branch November 7, 2026 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run documentation Trigger the Documentation workflow on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant