DRAFT_PAGES

Draft Workflow Diagram Pages

How to turn a directory of draft-workflow snapshots into one HTML page of gxwf mermaid diagrams that reads as a “fill-in walk” (planned → concrete → realized). Written after building ~/draft_workflows/diagrams.html for the UC4 and MRSA walks.

Input shape

A dir of step-NN-<slug>.gxwf.yml snapshots, numerically ordered. Earlier files are class: GalaxyWorkflowDraft (some steps still planned/TODO); the final *-extracted is class: GalaxyWorkflow (all concrete). Each snapshot = one frame of the walk. Collections used here: ~/draft_workflows/UC4 (7), ~/draft_workflows/MRSA (16).

Tool: gxwf mermaid

From galaxy-tool-util-ts. The draft worktree used: /Users/jxc755/projects/worktrees/galaxy-tool-util/branch/parsed_tool_fixes.

Build the page

Self-contained HTML, mermaid ESM from CDN, one <pre class="mermaid"> per snapshot in a responsive grid, with a step number + slug + concrete/total badge + progress bar per card. Working generator: ~/draft_workflows/_build-diagrams.mjs (node _build-diagrams.mjs). Skeleton:

const GXWF = ".../packages/cli/dist/bin/gxwf.js";   // the BIN, not programs/
for (const f of files.sort(byStepNum)) {
  const { stdout } = await run("node", [GXWF, "mermaid", join(dir, f)]);
  // counts from stdout, then emit <figure class="card"><pre class="mermaid">…</pre></figure>
}
// page tail:
//   import mermaid from "https://cdn.jsdelivr.net/npm/mermaid@10/dist/mermaid.esm.min.mjs";
//   mermaid.initialize({ startOnLoad: true, securityLevel: "loose", flowchart: { useMaxWidth: true } });

Viewing

KNOWN BUG — diagrams under-connect (renderer, not the workflows)

Step→step edges into any step that carries an explicit label: are silently dropped. The source workflows are correct; the renderer is wrong.

Provenance

Snapshots come from the draft walk (gxwf draft-next-step loop → gxwf draft-extract), e.g. via /test-pipeline <slug>. Each iteration concretizes one planned step; the page just renders each saved snapshot in order.