losalamos.tools.build_figures#

Build image outputs from a folder of SVG files using a JSON parameter file.

This tool iterates over all .svg files in a source folder and exports each one to the specified format (png, jpeg, pdf, svg) using Inkscape as the rendering backend.

Shell usage

# Export all SVGs in a folder to JPEG
python -m losalamos.tools.build_figures \
    --src /path/to/svgs \
    --dst /path/to/output \
    --par /path/to/params.json

# Using short flags
python -m losalamos.tools.build_figures -s ./svgs -d ./out -p ./params.json

Parameter file format

{
    "figure_format": "jpeg",
    "crop_id":       "frame",
    "show_layers":   ["main", "leader_lines", "labels_en"],
    "hide_layers":   ["frames", "labels_pt"],
    "suffix":        "en"
}

Note

figure_format accepts "png", "jpeg", "pdf", or "svg". crop_id may be null to export the full page. suffix is optional — when provided it is appended to the output filename stem.

Functions

losalamos.tools.build_figures.get_arguments()[source]#
losalamos.tools.build_figures.main() None[source]#