Skip to content

generate_visualizations

src.generators.generate_visualizations

Generate visualizations (charts) for the research artifacts website. Creates SVG charts that can be embedded in the Jekyll site.

load_data(data_dir)

Load the generated data files

Source code in src/generators/generate_visualizations.py
21
22
23
24
25
26
27
28
29
30
31
32
def load_data(data_dir):
    """Load the generated data files"""
    with open(os.path.join(data_dir, "_data/artifacts_by_year.yml"), "r") as f:
        by_year = yaml.safe_load(f)

    with open(os.path.join(data_dir, "_data/artifacts_by_conference.yml"), "r") as f:
        by_conference = yaml.safe_load(f)

    with open(os.path.join(data_dir, "assets/data/artifacts.json"), "r") as f:
        all_artifacts = json.load(f)

    return by_year, by_conference, all_artifacts

create_category_timeline_chart(by_conference, category, output_path)

Create a line chart of artifacts per year for one category (systems or security).

Source code in src/generators/generate_visualizations.py
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
def create_category_timeline_chart(by_conference, category, output_path):
    """Create a line chart of artifacts per year for one category (systems or security)."""
    confs = [c for c in by_conference if c["category"] == category]
    if not confs:
        return

    # Collect all years and per-conf data
    conf_year_data = {}
    all_years = set()
    for conf in confs:
        label = _conf_label(conf)
        conf_year_data[label] = {}
        for yd in conf["years"]:
            conf_year_data[label][yd["year"]] = yd["total"]
            all_years.add(yd["year"])

    years = sorted(all_years)
    labels = sorted(conf_year_data.keys())

    fig, ax = plt.subplots(figsize=(max(10, len(years) * 1.0), 6))

    for i, label in enumerate(labels):
        vals = [conf_year_data[label].get(y, 0) for y in years]
        is_workshop = label.endswith("(W)")
        ax.plot(
            years,
            vals,
            label=label,
            color=_color_for(label, i),
            marker=MARKERS[i % len(MARKERS)],
            linewidth=2,
            linestyle="--" if is_workshop else "-",
            markersize=6,
        )

    ax.set_xlabel("Year", fontsize=12)
    ax.set_ylabel("Artifacts Evaluated", fontsize=12)
    title = "Systems" if category == "systems" else "Security"
    ax.set_title(f"{title} Artifacts by Conference", fontsize=14, fontweight="bold")
    ax.legend(fontsize=9, loc="upper left")
    ax.grid(True, alpha=0.3)
    ax.set_xticks(years)
    fig.tight_layout()
    fig.savefig(output_path, format="svg", bbox_inches="tight")
    plt.close(fig)

create_total_artifacts_chart(by_year, output_path)

Create a line chart of total artifacts per year, split by systems vs security.

Source code in src/generators/generate_visualizations.py
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
def create_total_artifacts_chart(by_year, output_path):
    """Create a line chart of total artifacts per year, split by systems vs security."""
    years = [item["year"] for item in by_year]
    sys_counts = [item.get("systems", 0) for item in by_year]
    sec_counts = [item.get("security", 0) for item in by_year]
    totals = [s + c for s, c in zip(sys_counts, sec_counts)]

    fig, ax = plt.subplots(figsize=(max(10, len(years) * 0.8), 6))
    ax.plot(years, totals, marker="o", label="Total", color="#333333", linewidth=2.5)
    ax.plot(years, sys_counts, marker="s", label="Systems", color="#2E86AB", linewidth=2)
    ax.plot(years, sec_counts, marker="^", label="Security", color="#A23B72", linewidth=2)

    ax.set_xlabel("Year", fontsize=12)
    ax.set_ylabel("Number of Artifacts", fontsize=12)
    ax.set_title("Total Artifact Evaluations by Year", fontsize=14, fontweight="bold")
    ax.legend(fontsize=10)
    ax.grid(True, alpha=0.3)
    ax.set_xticks(years)
    fig.tight_layout()
    fig.savefig(output_path, format="svg", bbox_inches="tight")
    plt.close(fig)

create_badge_distribution_chart(all_artifacts, output_path)

Create a line chart showing badge counts over years by type

Source code in src/generators/generate_visualizations.py
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
def create_badge_distribution_chart(all_artifacts, output_path):
    """Create a line chart showing badge counts over years by type"""
    year_badges = defaultdict(lambda: {"Available": 0, "Functional": 0, "Reproducible": 0, "Reusable": 0})

    for artifact in all_artifacts:
        year = artifact["year"]
        for badge in _normalize_badges(artifact.get("badges")):
            badge_lower = badge.lower()
            if "available" in badge_lower:
                year_badges[year]["Available"] += 1
            elif "functional" in badge_lower:
                year_badges[year]["Functional"] += 1
            elif "reproduc" in badge_lower or "replicated" in badge_lower:
                year_badges[year]["Reproducible"] += 1
            elif "reusable" in badge_lower:
                year_badges[year]["Reusable"] += 1

    years = sorted(year_badges.keys())
    badge_types = ["Available", "Functional", "Reproducible", "Reusable"]
    colors = ["#06A77D", "#2E86AB", "#A23B72", "#F18F01"]
    markers = ["o", "s", "^", "D"]

    fig, ax = plt.subplots(figsize=(12, 6))
    for btype, color, marker in zip(badge_types, colors, markers):
        vals = [year_badges[y][btype] for y in years]
        if any(v > 0 for v in vals):
            ax.plot(years, vals, marker=marker, label=btype, color=color, linewidth=2, markersize=6)
    ax.set_xlabel("Year", fontsize=12)
    ax.set_ylabel("Number Awarded", fontsize=12)
    ax.set_title("Artifact Badge Distribution Over Time", fontsize=14, fontweight="bold")
    ax.legend(fontsize=10)
    ax.grid(True, alpha=0.3)
    ax.set_xticks(years)
    fig.tight_layout()
    fig.savefig(output_path, format="svg", bbox_inches="tight")
    plt.close(fig)

create_coverage_table(by_conference, output_path)

Create an SVG table showing which conference/year combos have data.

Source code in src/generators/generate_visualizations.py
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
def create_coverage_table(by_conference, output_path):
    """Create an SVG table showing which conference/year combos have data."""
    # Build conference→years mapping
    conf_years = {}
    all_years = set()
    for conf in by_conference:
        label = _conf_label(conf)
        yrs = {yd["year"]: yd["total"] for yd in conf["years"]}
        conf_years[label] = yrs
        all_years.update(yrs.keys())

    if not all_years:
        return

    years = sorted(all_years)
    labels = sorted(conf_years.keys())

    n_rows = len(labels)
    n_cols = len(years)
    cell_w, cell_h = 1.0, 0.6
    header_w = max(2.5, max(len(label) for label in labels) * 0.12)

    fig_w = header_w + n_cols * cell_w + 0.5
    fig_h = (n_rows + 1) * cell_h + 0.5

    fig, ax = plt.subplots(figsize=(fig_w, fig_h))
    ax.set_xlim(0, header_w + n_cols * cell_w)
    ax.set_ylim(0, (n_rows + 1) * cell_h)
    ax.axis("off")

    # Header row
    for j, year in enumerate(years):
        x = header_w + j * cell_w + cell_w / 2
        y = n_rows * cell_h + cell_h / 2
        ax.text(x, y, str(year), ha="center", va="center", fontsize=8, fontweight="bold")

    # Data rows
    for i, label in enumerate(labels):
        row_y = (n_rows - 1 - i) * cell_h
        ax.text(header_w - 0.15, row_y + cell_h / 2, label, ha="right", va="center", fontsize=8)
        for j, year in enumerate(years):
            x = header_w + j * cell_w
            count = conf_years[label].get(year, None)
            if count is not None and count > 0:
                color = "#c6efce"
                text = str(count)
            elif count == 0:
                color = "#fff2cc"
                text = "0"
            else:
                color = "#f2f2f2"
                text = "—"
            rect = plt.Rectangle((x, row_y), cell_w, cell_h, facecolor=color, edgecolor="#cccccc", linewidth=0.5)
            ax.add_patch(rect)
            ax.text(
                x + cell_w / 2,
                row_y + cell_h / 2,
                text,
                ha="center",
                va="center",
                fontsize=7,
                color="#333333" if count else "#999999",
            )

    ax.set_title("Conference Coverage (artifact count per year)", fontsize=11, fontweight="bold", pad=10)
    fig.tight_layout()
    fig.savefig(output_path, format="svg", bbox_inches="tight")
    plt.close(fig)

generate_all_charts(data_dir)

Generate all charts

Source code in src/generators/generate_visualizations.py
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
def generate_all_charts(data_dir):
    """Generate all charts"""
    by_year, by_conference, all_artifacts = load_data(data_dir)

    charts_dir = os.path.join(data_dir, "assets/charts")
    os.makedirs(charts_dir, exist_ok=True)

    # Per-category timelines
    create_category_timeline_chart(by_conference, "systems", os.path.join(charts_dir, "systems_artifacts.svg"))
    create_category_timeline_chart(by_conference, "security", os.path.join(charts_dir, "security_artifacts.svg"))

    # Total artifacts (stacked systems + security)
    create_total_artifacts_chart(by_year, os.path.join(charts_dir, "total_artifacts.svg"))

    # Badge chart (combines distribution + trends into one line chart)
    create_badge_distribution_chart(all_artifacts, os.path.join(charts_dir, "badge_distribution.svg"))

    # Coverage table
    create_coverage_table(by_conference, os.path.join(charts_dir, "coverage_table.svg"))

    logger.info(f"Charts generated in {charts_dir}")