SVG chart generator for Tech Addressed benchmark results.
- Python 100%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
- Add schema/project.schema.json and schema/chart-data.schema.json - Update README with all current fields and CLI usage - Switch font to Roboto, tune font sizes and weights - Add dynamic left margin via leftmargin in project.json - Add charttitle, units, higherlower fields to project.json - Fix margins with subplots_adjust - Add value_labels support for DNR/DNF overrides - Flip value label inside bar when within 5% of x_max - Add CLI argument for project file path Co-Authored-By: Claude Sonnet 4.6 <[email protected]> |
||
| schema | ||
| generate-charts.py | ||
| LICENSE | ||
| README.md | ||
SVG Chart Generator
Generates SVG benchmark charts for Tech Addressed articles. Uses matplotlib to produce horizontal bar charts, which are then finished in Inkscape using a custom template for headers and footers.
Dependencies
- Python 3
matplotlibnumpy
Files
generate-charts.py— Main script. Reads a project file and generates one SVG per data file.schema/project.schema.json— JSON schema for project configuration files.schema/chart-data.schema.json— JSON schema for chart data files.
Usage
python3 generate-charts.py [project.json]
The script reads project.json from the current directory if no argument is provided, or from the path specified as the first argument.
python3 generate-charts.py ./my-project/project.json
Configuration
See schema/project.schema.json and schema/chart-data.schema.json for full schema definitions.
project.json
| Field | Description |
|---|---|
prefix |
Output path prefix for generated SVG files |
imgwidth |
Output image width in pixels |
imgheight |
Output image height in pixels |
imgdpi |
DPI for the output image. Use 72 for correct SVG pixel sizing in Inkscape. |
leftmargin |
Left margin as a fraction of figure width (e.g. 0.16). Tune per project based on longest label. |
charttitle |
Chart title for the Inkscape template header |
units |
Units label for the template header (e.g. "MEASURED IN MiB/SEC") |
higherlower |
Higher/lower is better label (e.g. "HIGHER IS BETTER") |
data |
List of paths to chart data JSON files |
Chart Data Files
| Field | Description |
|---|---|
filename |
Output filename for the SVG |
title |
Chart title. Leave empty — title is handled by the Inkscape template. |
xlabel |
X-axis label. Leave empty — units are handled by the Inkscape template. |
ylabel |
Y-axis label. Typically left empty. |
xlim |
[min, max] range for the X-axis |
vertline |
Interval between vertical grid lines. Also determines x-axis tick positions. |
labels |
Bar labels (y-axis). Listed bottom-to-top — first item renders at the bottom. |
values |
Bar values corresponding to each label. Use 0 for bars with no result. |
colors |
Bar colors corresponding to each label. Accepts hex (e.g. "#808080") or named colors. |
value_labels |
(optional) Override labels for bar values. Use null to show the numeric value, or a string like "DNR" or "DNF" to override. |