From 4d57b28e2e65fe36682150bc004ab1b6c833ba41 Mon Sep 17 00:00:00 2001 From: Dandaedre Date: Thu, 20 Aug 2026 17:21:42 +0200 Subject: [PATCH] Radar graphs --- setup/generation/radar_graphs.typ | 12 ++++-- setup/models/school.typ | 72 ++++++++++++++++++------------- 2 files changed, 51 insertions(+), 33 deletions(-) diff --git a/setup/generation/radar_graphs.typ b/setup/generation/radar_graphs.typ index 37a782a..e65c6d1 100644 --- a/setup/generation/radar_graphs.typ +++ b/setup/generation/radar_graphs.typ @@ -14,8 +14,8 @@ (field: "C.C", display: "Contrôle", aliases: ()), (field: "Altérations", display: "Altérations", aliases: ()), (field: "QoL", display: "Confort", aliases: ()), - (field: "AB", display: "Brise-armure", aliases: ()), - (field: "Compléxité", display: "Complexité", aliases: ("Complexité", "Compl")), + (field: "AB", display: "Armure", aliases: ()), + // (field: "Compléxité", display: "Complexité", aliases: ("Complexité", "Compl")), ) // Canonical public class names and their data sources. @@ -108,7 +108,7 @@ // Render a class radar graph. `fields` can override `radar-fields` for a // one-off graph while keeping the same field/display/aliases structure. -#let radar-graph(class-name, fields: radar-fields, size: 170pt) = { +#let radar-graph(class-name, fields: radar-fields, size: 155pt) = { let name = canonical-class-name(class-name) if name not in school-sources { panic( @@ -138,8 +138,12 @@ theme: ( palette: (theme.blood,), text-color: theme.ink, - border-color: theme.border, + text-color-light: theme.muted-ink, + axis-stroke: 0.7pt + theme.dark-gold.transparentize(32%), + grid-stroke: 0.7pt + theme.dark-gold.transparentize(32%), + marker-stroke: 0.6pt + theme.parchment-light, background: none, + border: none, show-grid: true, base-size: 6pt, base-gap: 4pt, diff --git a/setup/models/school.typ b/setup/models/school.typ index fb118f9..12cf2f8 100644 --- a/setup/models/school.typ +++ b/setup/models/school.typ @@ -375,26 +375,55 @@ v(0.7em) grid( - columns: (1fr, 1.35fr), + columns: (0.55fr, 1fr), column-gutter: 1.2em, align: top, //----- Class profile / radar ----- [ - #block( - fill: theme.parchment, - stroke: 0.7pt + theme.border, - inset: 0.65em, - )[ - #align(center)[ - #spacers.fantasy-section("PROFIL", theme-name: "warm")[ - #if type(class_info.radar) == str { - image(class_info.radar, width: 82%) - } else { - class_info.radar - } + #context { + layout(cell => { + let side = cell.width + block( + width: side, + height: side, + clip: true, + fill: theme.parchment, + stroke: 0.7pt + theme.border, + inset: (top: 0.8em, left:0em, right: 0em), + )[ + #grid( + rows: (auto, 1fr), + align: center, + [#spacers.fantasy-label("PROFIL", theme-name: "warm")], + [#align(center + horizon)[ + #if type(class_info.radar) == str { + image(class_info.radar, width: 82%) + } else { + box( + height: 160pt, + clip: true, + class_info.radar, + ) + } + ]], + ) ] - ] + }) + } + + #v(0.7em) + + //----- Display the class difficulty rating ----- + #grid( + columns: (1fr, auto), + align: horizon, + )[ + #spacers.fantasy-label("DIFFICULTÉ", theme-name: "warm") + ][ + #grid( + column-gutter: 0.25em, + )[ #macros.difficulty-stars(class_info.difficulty) ] ] ], @@ -435,21 +464,6 @@ ] ] - - #v(0.7em) - - //----- Display the class difficulty rating ----- - #grid( - columns: (1fr, auto), - align: horizon, - )[ - #spacers.fantasy-label("DIFFICULTÉ", theme-name: "warm") - ][ - #grid( - // columns: repeat(5, 0.7em), - column-gutter: 0.25em, - )[ #macros.difficulty-stars(class_info.difficulty) ] - ] ], )