"""Draw trace.json files as one static page: `python -m itemator.mapview --out public/map TRACE.json [...]`. Each trace (itemator/trace.py) becomes one choice in the page web/map.html: every changed file moves through the checks into one of the bins, with a table of what each check said below. The data is inlined, so the page needs no network, works from a file, and can be screen-recorded. A trace's label is its file name unless `--label` is given; `--staged` marks the page's text "staged for this demonstration, not a real merge request".""" from __future__ import annotations import argparse import json import pathlib import sys TEMPLATE = pathlib.Path(__file__).resolve().parent.parent / "web" / "map.html" def safe_json(data) -> str: """JSON for inside a