The goal is for the diagram to convey a clear conclusion even when detached from the main text, while also delivering an editable, traceable source diagram. By default, use uncompressed .drawio XML; only data-driven statistical charts should prioritize Python plotting.
Workflow
- First extract from the main text an information skeleton of "object/problem → research stage or content → validation → expected understanding." Do not fabricate research content, evidence, or causal relationships for the sake of layout aesthetics.
- Choose a layout based on the main relationships:
- Progressive process: horizontal or vertical technical route;
- Multiple content items jointly supporting the objective: parallel columns then convergence;
- Repeated correction between theory and experiment: closed loop, but draw a loop only when the main text truly contains a feedback relationship;
- Time and tasks: Gantt chart, do not force it into a flowchart.
- Compress the main text into two levels of text. Card titles express actions or outputs, and explanatory text retains only the information needed to distinguish that card; avoid moving paragraphs into the diagram.
- Prioritize generating or editing Draw.io source files:
python nsfc-figure/scripts/generate_roadmap.py \
--config nsfc-figure/assets/three-stage-roadmap.json \
--output roadmap.drawio
Three-stage or four-stage column-based technical routes can directly use the script. When free-form composition, experimental setups, or complex schematics are needed, continue editing the generated result in diagrams.net; do not degrade it into a non-editable screenshot. 5. Run structural validation:
python nsfc-figure/scripts/validate_drawio.py roadmap.drawio
-
Before delivery, use the official Draw.io Desktop to actually export SVG/PDF/PNG, open the exported files, and check them at the actual dimensions used in the application. Merely having parseable XML, a successful export command, or a third-party rendering result cannot replace visual acceptance. If official rendering cannot be completed on this machine, clearly state "XML has been validated; rendering export was not executed on this machine," and mark the result as pending visual acceptance; it must not be called ready for direct use.
-
Check the final SVG/PNG for accidental embedding of the complete editing source:
python nsfc-figure/scripts/check_export_metadata.py roadmap.svg
Draw.io Delivery Constraints
- Keep uncompressed XML to facilitate version review, local modification, and error localization.
- All
mxCellIDs are unique; the top level contains0、1two root cells; edges must reference existing source/target nodes. - Specify geometric dimensions for nodes, use orthogonal connectors, and try to keep the main reading direction consistent and avoid crossings.
- Use one set of fonts, rounded corners, borders, and semantic colors. Colors are responsible for distinguishing research stages, not for decoration.
- If images are unavoidable, they should be embedded in the file or use transferable relative resources; retaining absolute paths that are valid only on the author's machine is prohibited.
- When an unpublished application is involved, prioritize using the local desktop version for editing, and do not upload
.drawiosource files or the complete main text to unauthorized online services. - Check the terminology, numbering, and main text in the diagram item by item. The caption explains "what the diagram shows"; do not repeat all the text inside the diagram.
- Internal work packages should retain both
.drawiosource files and vector previews; SVG/PNG for formal submission or public distribution should not embed the complete editing source, and hidden layers, off-canvas objects, and metadata must be checked. Use high-resolution PNG only when the submission system requires it.
Resource Routing
- When choosing layout, color scheme, font size, or export format, read references/drawio-authoring.md。
- When you need to quickly set up a column-based technical roadmap, copy and modify assets/three-stage-roadmap.json, then run the generation script.
- When you need to check the generator's complete use cases, see examples/fictional-technical-roadmap.json, the corresponding
.drawiosource file, and the PNG preview exported from official Draw.io. The examples are fictional content, used only to validate the workflow.
Acceptance
- Looking only at the diagram, can you state the core problem, research stages, validation methods, and final convergence point?
- After scaling to the actual width in the application, is the smallest text still readable?
- Do the arrows express real dependencies, rather than merely connecting all the cards?
- Does XML validation pass? Have the SVG/PDF/PNG exported from official Draw.io actually been opened to confirm there is no cropping, overflow, font substitution, connector misalignment, or accidentally embedded editing source?
- Are the terminology, order, numbering, and expected outputs in the diagram consistent with the main text?