<?xml version="1.0" encoding="UTF-8"?>
<rss  xmlns:atom="http://www.w3.org/2005/Atom" 
      xmlns:media="http://search.yahoo.com/mrss/" 
      xmlns:content="http://purl.org/rss/1.0/modules/content/" 
      xmlns:dc="http://purl.org/dc/elements/1.1/" 
      version="2.0">
<channel>
<title>TidyTuesday</title>
<link>https://m.canouil.dev/tidytuesday/</link>
<atom:link href="https://m.canouil.dev/tidytuesday/index.xml" rel="self" type="application/rss+xml"/>
<description>Weekly data figures drawn in Typst with Gribouille.</description>
<image>
<url>https://m.canouil.dev/tidytuesday/assets/og-card.png</url>
<title>TidyTuesday</title>
<link>https://m.canouil.dev/tidytuesday/</link>
</image>
<generator>quarto-1.10.11</generator>
<lastBuildDate>Tue, 16 Jun 2026 00:00:00 GMT</lastBuildDate>
<item>
  <title>Britain’s Gender-Neutral Baby Names</title>
  <link>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/16/</link>
  <description><![CDATA[ 

Skip to main content




<div class="cell">
<details class="code-fold">
<summary>See the code that generated this plot.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" data-filename="typst" style="background: #f1f3f5;"><pre class="sourceCode typst cw-auto code-with-copy"><code class="sourceCode typst"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Gribouille is imported by the typst-render preamble (see assets/typst/_preamble.typ);</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// do not import it here or the theme-* wrappers get rebound.</span></span>
<span id="cb1-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@preview/gribouille:0.3.0": *</span></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@local/gribouille:0.0.0": *</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #set page(width: 18cm, height: 9.45cm, margin: 0cm)</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Treat every missing sentinel as `none` so a single guard filters them out.</span></span>
<span id="cb1-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">num</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N/A"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> else { float(s) }</span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">files</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-11">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"England &amp; Wales"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/england_wales_names.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-12">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Scotland"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/scotland_names.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-13">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Northern Ireland"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/ni_names.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-14"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-15"></span>
<span id="cb1-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Keep only years where all three nations publish data (E&amp;W ends at 2024).</span></span>
<span id="cb1-17"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">start_year</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1997</span></span>
<span id="cb1-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">end_year</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2024</span></span>
<span id="cb1-19"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// A name counts as gender-neutral when the combined UK total for each sex</span></span>
<span id="cb1-20"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// reaches at least this many births; filters ONS-suppressed entries and noise.</span></span>
<span id="cb1-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">min_n</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">3</span></span>
<span id="cb1-22"></span>
<span id="cb1-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Pass 1: sum births across nations per (year, name, sex) for shared years only.</span></span>
<span id="cb1-24"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">year_name_sex</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> path<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> files <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-26">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> csv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>path<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> row-type<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> dictionary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-27">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">yr</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> int<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-28">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> yr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> start_year or yr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> end_year <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-29">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">n</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Number<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-30">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-31">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">key</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Year <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>Sex</span>
<span id="cb1-32">    year_name_sex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> year_name_sex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-33">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-34"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-35"></span>
<span id="cb1-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Pass 2: apply threshold after combining; index which names qualify per sex.</span></span>
<span id="cb1-37"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">year_name</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> total_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> year_name_sex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-39">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> total_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> min_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-40">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">parts</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>split<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-41">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">name_key</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-42">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sex</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-43">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cur</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> year_name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>name_key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-44">  cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>sex<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-45">  year_name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>name_key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-46"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-47"></span>
<span id="cb1-48"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Pass 3: count shared and total distinct names per year.</span></span>
<span id="cb1-49"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">per_year</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-50"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> counts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> year_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-51">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">yr</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>split<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">).</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-52">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cur</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> per_year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>yr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>shared: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> total: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-53">  cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"total"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>total <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-54">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Boy"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> counts and <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Girl"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> counts <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-55">    cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"shared"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shared <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-56">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-57">  per_year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>yr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> cur<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-58"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-59"></span>
<span id="cb1-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Mean total distinct names across all years (used in y-axis "% (N)" label).</span></span>
<span id="cb1-61"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">total_sum</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb1-62"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">n_yrs</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span></span>
<span id="cb1-63"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>_<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> per_year <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-64">  total_sum <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>total</span>
<span id="cb1-65">  n_yrs <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span></span>
<span id="cb1-66"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-67"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">mean_total</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> total_sum / n_yrs</span>
<span id="cb1-68"></span>
<span id="cb1-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Pass 4: find top gender-neutral name (by combined births) per 5-year interval.</span></span>
<span id="cb1-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Intervals are half-open [start, end); labels placed at midpoint year.</span></span>
<span id="cb1-71"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">intervals</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-72">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1997</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1998</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-73">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2005</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2002</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-74">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2005</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2007</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-75">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2015</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2012</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-76">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2015</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2020</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2017</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-77">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>start: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2020</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> end: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2025</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2022</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-78"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-79"></span>
<span id="cb1-80"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">interval_totals</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-81"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> total_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> year_name_sex <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-82">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">parts</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>split<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-83">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">yr</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> int<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-84">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">name</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-85">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">name_key</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> parts<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> name</span>
<span id="cb1-86">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">sexes</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> year_name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>name_key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>:<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-87">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Boy"</span> not <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> sexes or <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Girl"</span> not <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> sexes <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-88">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> intervals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>enumerate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-89">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> yr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>start and yr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&lt;</span> iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>end <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-90">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">k</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> name</span>
<span id="cb1-91">      interval_totals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>insert<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> interval_totals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> total_n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-92">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-93">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-94"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-95"></span>
<span id="cb1-96"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">label_rows</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-97"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> intervals<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>enumerate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-98">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">best_name</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span></span>
<span id="cb1-99">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">best_n</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb1-100">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> interval_totals <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-101">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> not k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>starts-with<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"|"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-102">    <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> best_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-103">      best_n <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> n</span>
<span id="cb1-104">      best_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> k<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>slice<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>i<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">).</span>len<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-105">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-106">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-107">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> best_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">continue</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-108">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">yr_data</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> per_year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>shared: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> total: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-109">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pct</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> yr_data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shared / yr_data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>total * <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb1-110">  label_rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>year: iv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mid <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> pct: pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label: best_name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-111"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-112"></span>
<span id="cb1-113"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Build one row per year, sorted chronologically.</span></span>
<span id="cb1-114"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">rows</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-115"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">max_pct</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span></span>
<span id="cb1-116"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span><span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>yr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> per_year <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-117">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pct</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>shared / v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>total * <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span></span>
<span id="cb1-118">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;</span> max_pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> max_pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-119">  rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>year: int<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>yr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> pct: pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-120"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-121"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">rows</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>sorted<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-122"></span>
<span id="cb1-123"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Okabe-Ito teal for the single series.</span></span>
<span id="cb1-124"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">teal</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009e73"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-125"></span>
<span id="cb1-126"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-127">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-128">  mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"pct"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-129">  layers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-130">    geom-area<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> teal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> position<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"identity"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-131">    geom-line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> teal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.8pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-132">    geom-label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-133">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> label_rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-134">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-135">      size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-136">      fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> teal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-137">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> white<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-138">      stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.3pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-139">      inset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-140">      radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-141">      dy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.7cm</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-142">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-143">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-144">  scales<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-145">    scale-x-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2005</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2015</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2020</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-146">    scale-y-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-147">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Share of All Distinct Names"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-148">      limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> max_pct <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-149">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Labels show percentage and approximate count in parentheses.</span></span>
<span id="cb1-150">      labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> p <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-151">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">n</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> int<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>round<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>p / <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> * mean_total<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-152">        str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>round<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>p<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> digits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"% ("</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>n<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")"</span></span>
<span id="cb1-153">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">},</span></span>
<span id="cb1-154">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-155">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-156">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-157">    title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Britain's Gender-Neutral Baby Names"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-158">    subtitle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-159">      Names registered for both <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>boys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> and <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>girls<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> across</span>
<span id="cb1-160">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> teal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>all three UK nations combined<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]]</span> (_at least 3 births each sex, 1997–2024_). <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-161">      Most-registered gender-neutral name labelled per five-year window.</span>
<span id="cb1-162">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-163">    caption<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-164">      Source: UK baby names (TidyTuesday 2026-06-16). <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-165">      Author: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>link<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://mickael.canouil.fr"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Mickaël CANOUIL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">].</span></span>
<span id="cb1-166">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-167">    x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-168">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-169">  theme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> theme-minimal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-170">  width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">auto</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-171">  height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">auto</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-172"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div></div>
</details>
<div id="fig-2026-06-16" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-2026-06-16-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div>
<div class="light-content">
<p><a href="../../../../tidytuesday/2026/06/16/./images/plot-light.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure&nbsp;1: Share of all distinct baby names registered for both boys and girls across all three UK nations combined (minimum 3 births each sex per year), from 1997 to 2024. Y-axis labels include the approximate count of gender-neutral names in parentheses. Labels mark the most-registered gender-neutral name in each window: Jordan (1997–1999), Cameron (2000–2004), Charlie (2005–2014), and Noah (2015–2024)."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/16/images/plot-light.svg" class="img-fluid figure-frame figure-img" alt="An area chart with a teal shaded region showing the share of baby names registered for both boys and girls across all three UK nations combined from 1997 to 2024. The shaded area fluctuates between about 3.5 percent and 5 percent across the period. Six text labels appear above the line at five-year intervals marking the most-registered gender-neutral name in each window: Jordan near 1998, Cameron near 2002, Charlie near 2007 and 2012, Noah near 2017 and 2022. The y-axis labels pair the percentage with an approximate count of names in parentheses."></a></p>
</div>
<div class="dark-content">
<p><a href="../../../../tidytuesday/2026/06/16/./images/plot-dark.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure&nbsp;1: Share of all distinct baby names registered for both boys and girls across all three UK nations combined (minimum 3 births each sex per year), from 1997 to 2024. Y-axis labels include the approximate count of gender-neutral names in parentheses. Labels mark the most-registered gender-neutral name in each window: Jordan (1997–1999), Cameron (2000–2004), Charlie (2005–2014), and Noah (2015–2024)."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/16/images/plot-dark.svg" class="img-fluid figure-frame figure-img" alt="An area chart with a teal shaded region showing the share of baby names registered for both boys and girls across all three UK nations combined from 1997 to 2024. The shaded area fluctuates between about 3.5 percent and 5 percent across the period. Six text labels appear above the line at five-year intervals marking the most-registered gender-neutral name in each window: Jordan near 1998, Cameron near 2002, Charlie near 2007 and 2012, Noah near 2017 and 2022. The y-axis labels pair the percentage with an approximate count of names in parentheses."></a></p>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-2026-06-16-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Share of all distinct baby names registered for both boys and girls across all three UK nations combined (minimum 3 births each sex per year), from 1997 to 2024. Y-axis labels include the approximate count of gender-neutral names in parentheses. Labels mark the most-registered gender-neutral name in each window: Jordan (1997–1999), Cameron (2000–2004), Charlie (2005–2014), and Noah (2015–2024).
</figcaption>
</figure>
</div>
</div>
<p>Data: <a href="https://github.com/rfordatascience/tidytuesday/tree/main/data/2026/2026-06-16">TidyTuesday 2026-06-16</a>.</p>
<p>Combining births registered across all three UK nations, roughly 4–5 per cent of all distinct names in use each year are registered for both boys and girls — around 400 to 600 names depending on the year. A name counts here only when at least three babies of each sex were registered with it in the combined UK total for that year, filtering out statistical noise and names suppressed for small counts. The shaded area shows each year; the y-axis label pairs the percentage with the approximate count in parentheses so both scales are readable without a dual axis.</p>
<p>Each label marks the single most-registered gender-neutral name in its window. Jordan led in the late 1990s, Cameron took over briefly in the early 2000s, and Charlie then dominated for a full decade. Noah claimed the top spot from 2015 onwards and held it through 2024. The leaders change across periods, but the overall share stays in a similar range, suggesting that the pool of gender-neutral names is relatively stable rather than systematically expanding.</p>
<p>This stable pool sits alongside the declining concentration visible in the top-ten names’ share of births: naming is becoming more diverse, but whether gender-neutral naming specifically is growing is less clear from this data alone.</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a> ]]></description>
  <category>2026</category>
  <guid>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/16/</guid>
  <pubDate>Tue, 16 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/16/images/featured-light.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Panned by Critics, Paid by Audiences</title>
  <link>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/09/</link>
  <description><![CDATA[ 

Skip to main content




<div class="cell">
<details class="code-fold">
<summary>See the code that generated this plot.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" data-filename="typst" style="background: #f1f3f5;"><pre class="sourceCode typst cw-auto code-with-copy"><code class="sourceCode typst"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Gribouille is imported by the typst-render preamble (see assets/typst/_preamble.typ);</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// do not import it here or the theme-* wrappers get rebound.</span></span>
<span id="cb1-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@preview/gribouille:0.2.0": *</span></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@local/gribouille:0.0.0": *</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #set page(width: 18cm, height: 9.45cm, margin: 0cm)</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Treat every missing sentinel as `none` so a single guard filters them out.</span></span>
<span id="cb1-8"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">num</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"N/A"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> else { float(s) }</span>
<span id="cb1-9"></span>
<span id="cb1-10"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">raw</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> csv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/game_films.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> row-type<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> dictionary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-11"></span>
<span id="cb1-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// CinemaScore is an opening-night audience grade; map the letters onto a 0-100</span></span>
<span id="cb1-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// scale so it can be read against the critic percentage on the same ruler.</span></span>
<span id="cb1-14"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cinemascore</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-15">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A+"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">95</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A-"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">90</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-16">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B+"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">85</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"B-"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">75</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-17">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C+"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">65</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"C-"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-18">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D+"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">55</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">50</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"D-"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">45</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-19">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"F"</span>: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-20"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-21"></span>
<span id="cb1-22"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Okabe-Ito accents (colourblind-safe). Vermillion = lost money, teal = profit;</span></span>
<span id="cb1-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// the diverging fill pivots at break-even (box office = budget). Accent matches</span></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// the site theme so the inset border tracks the light / dark toggle.</span></span>
<span id="cb1-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">loss</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d55e00"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">profit</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009e73"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">accent</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0f8b8d"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-28"></span>
<span id="cb1-29"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Main frame: keep one currency ($) so the y axis reads in dollars, and only</span></span>
<span id="cb1-30"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// rows carrying budget + critic score so every channel (x, y, size, fill) is</span></span>
<span id="cb1-31"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// honest. All such rows happen to be theatrical releases; the split that earns</span></span>
<span id="cb1-32"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// the shape channel is therefore time, not category.</span></span>
<span id="cb1-33"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">films</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-34">  raw</span>
<span id="cb1-35">    .filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-36">      r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>worldwide_box_office_currency <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\u</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">{0024}"</span></span>
<span id="cb1-37">        and num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>worldwide_box_office<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span></span>
<span id="cb1-38">        and num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>budget_high<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span></span>
<span id="cb1-39">        and num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rotten_tomatoes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span></span>
<span id="cb1-40">        and num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>release_date<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>slice<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span></span>
<span id="cb1-41">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-42">    .map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-43">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">box</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>worldwide_box_office<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-44">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">bud</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>budget_high<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-45">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">yr</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> int<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>release_date<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>slice<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-46">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">era</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> yr <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">&gt;=</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2019</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2019 onward"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">else</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Before 2019"</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-47">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-48">        title: r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-49">        rt: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rotten_tomatoes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-50">        box: box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-51">        budget: bud<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-52">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// log10 of the profit multiple so the fill spreads evenly across orders</span></span>
<span id="cb1-53">        <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// of magnitude and pivots at 0 = break-even (box office = budget).</span></span>
<span id="cb1-54">        logmult: calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>log<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>box / bud<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> base<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-55">        era: era<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-56">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-57">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">})</span></span>
<span id="cb1-58"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-59"></span>
<span id="cb1-60"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Inset frame: every film scored by both critics and an opening audience. The</span></span>
<span id="cb1-61"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// two means carry the whole sub-story, so the inset only needs those numbers.</span></span>
<span id="cb1-62"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">scored</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> raw<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-63">  num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rotten_tomatoes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">!=</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span> and r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>cinema_score <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> cinemascore</span>
<span id="cb1-64"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-65"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">critic-mean</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> scored<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>rotten_tomatoes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)).</span>sum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span> / scored.len()</span>
<span id="cb1-66"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">audience-mean</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> scored<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> cinemascore<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>cinema_score<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)).</span>sum<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span> / scored.len()</span>
<span id="cb1-67"></span>
<span id="cb1-68"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Hand-drawn dumbbell on a 0-100 track: the gap between the critic dot and the</span></span>
<span id="cb1-69"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// audience dot IS the disagreement. Built from std Typst primitives (no nested</span></span>
<span id="cb1-70"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// canvas) and reads `page.fill` so the card tracks the light / dark site toggle.</span></span>
<span id="cb1-71"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">inset</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> context {</span>
<span id="cb1-72">  let bg = if page.fill in (auto, none) { white } else { page.fill }</span>
<span id="cb1-73">  let w = 4.6cm</span>
<span id="cb1-74">  box(</span>
<span id="cb1-75">    fill: bg,</span>
<span id="cb1-76">    inset: 7pt,</span>
<span id="cb1-77">    radius: 4pt,</span>
<span id="cb1-78">    stroke: 0.5pt + accent,</span>
<span id="cb1-79">  )[</span>
<span id="cb1-80">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#set</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">text</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-81">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#set</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">par</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>leading<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-82">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Critics pan them; audiences don't<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]]</span></span>
<span id="cb1-83">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-84">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span></span>
<span id="cb1-85">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>left <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> horizon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4pt</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">75%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span></span>
<span id="cb1-86">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-87">        left <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> horizon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-88">        dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> critic-mean / <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> * w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-89">        line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-90">          length<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>audience-mean <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> critic-mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> / <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> * w<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-91">          stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4pt</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">55%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-92">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-93">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-94">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-95">        left <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> horizon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-96">        dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> critic-mean / <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> * w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-97">        circle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> loss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-98">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-99">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-100">        left <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> horizon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-101">        dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> audience-mean / <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span> * w <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-102">        circle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> profit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-103">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-104">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-105">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(-</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-106">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>grid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-107">      columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1fr</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1fr</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-108">      align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>left<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> right<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-109">      text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> loss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Critics<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> (_mean_): <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>round<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>critic-mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)],</span></span>
<span id="cb1-110">      text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> profit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Audiences<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> (_mean_): <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>round<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>audience-mean<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)],</span></span>
<span id="cb1-111">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-112">  ]</span>
<span id="cb1-113">}</span>
<span id="cb1-114"></span>
<span id="cb1-115"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Label with a translucent paper background so the text stays legible over the</span></span>
<span id="cb1-116"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// marker cloud; the background reads `page.fill` to track the light / dark site.</span></span>
<span id="cb1-117"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">pill</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>body<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> context {</span>
<span id="cb1-118">  let bg = if page.fill in (auto, none) { white } else { page.fill }</span>
<span id="cb1-119">  box(</span>
<span id="cb1-120">    fill: bg.transparentize(12%),</span>
<span id="cb1-121">    inset: (x: 2pt, y: 0.5pt),</span>
<span id="cb1-122">    radius: 1.5pt,</span>
<span id="cb1-123">  )[<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>body<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span>]</span>
<span id="cb1-124">}</span>
<span id="cb1-125"></span>
<span id="cb1-126"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Real dataset title -&gt; the pill content to draw for it. Keys select which films</span></span>
<span id="cb1-127"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// are emphasised; coordinates come from the inherited frame, never hardcoded.</span></span>
<span id="cb1-128"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">label-text</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-129">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"The Super Mario Bros. Movie"</span>: align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>*The <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>Super Mario Bros. <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>Movie*<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-130">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Pokémon Detective Pikachu"</span>: align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>*Detective <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>Pikachu*<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-131">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sonic the Hedgehog 3"</span>: align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>*Sonic <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>the Hedgehog 3*<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-132">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Postal"</span>: align<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>*Postal* <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>(Uwe Boll)<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-133"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-134"></span>
<span id="cb1-135"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-136">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> films<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-137">  mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-138">    x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rt"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-139">    y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"box"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-140">    fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"logmult"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-141">    size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"budget"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-142">    shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"era"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-143">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-144">  layers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-145">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Shade the "panned but paid" zone: rotten with critics (left of 60) yet</span></span>
<span id="cb1-146">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// grossing past $100M. Painted first so points sit on top of it. A direct</span></span>
<span id="cb1-147">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// geom-rect with a fixed fill keeps it off the continuous fill scale.</span></span>
<span id="cb1-148">    geom-rect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-149">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>xmin: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> xmax: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymin: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymax: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3e9</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),),</span></span>
<span id="cb1-150">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>xmin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xmin"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> xmax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"xmax"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ymin"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ymax"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-151">      fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> accent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>transparentize<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">90%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-152">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> accent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-153">      stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-154">      inherit-aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-155">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-156">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// The Rotten Tomatoes "fresh" threshold.</span></span>
<span id="cb1-157">    annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-158">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"vline"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-159">      xintercept<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-160">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">55%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-161">      stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.6pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-162">      linetype<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"dashed"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-163">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-164">    geom-point<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.95</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">45%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-165">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Accent outline on the labelled films so the eye finds them in the cloud;</span></span>
<span id="cb1-166">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// inherits the plot mapping, so the ring matches each film's shape and size.</span></span>
<span id="cb1-167">    geom-point<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-168">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>title <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> label-text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-169">      fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-170">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> accent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-171">      stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.2pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-172">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-173">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Direct labels instead of a per-film legend; the data function filters the</span></span>
<span id="cb1-174">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// inherited frame and attaches each film's pill, so coordinates come from films.</span></span>
<span id="cb1-175">    geom-typst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-176">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> d</span>
<span id="cb1-177">        .filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>title <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> label-text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-178">        .map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>..r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> lab: pill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>label-text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))),</span></span>
<span id="cb1-179">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"rt"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"box"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"lab"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-180">      anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"south"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-181">      dy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.35</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-182">      inherit-aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-183">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-184">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Inset dumbbell parked in the sparse top-left corner above the cloud.</span></span>
<span id="cb1-185">    annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typst"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">25</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.75e6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> inset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"north-west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-186">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-187">  scales<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-188">    scale-x-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-189">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Rotten Tomatoes Critics' Score (%)"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-190">      limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-191">      breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">20</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">40</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">60</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">80</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">100</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-192">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-193">    scale-y-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-194">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Worldwide Box Office (US$)"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-195">      transform<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"log10"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-196">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// limits: (8e4, 3e9),</span></span>
<span id="cb1-197">      breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e7</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1e9</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-198">      labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$100K"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$1M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$10M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$100M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$1B"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-199">      <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// expand: (5%, 25%),</span></span>
<span id="cb1-200">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-201">    scale-fill-gradient2<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-202">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Box Office / Budget Ratio"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-203">      low<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> loss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mid<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#cfcfcf"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> high<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> profit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-204">      midpoint<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-205">      breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-206">      labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">([</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$1/64$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$1/16$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$1/4$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$1$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$4$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="ss" style="color: #20794D;
background-color: null;
font-style: inherit;">$16$</span>×<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]),</span></span>
<span id="cb1-207">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-208">    scale-size-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-209">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Production Budget"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-210">      range<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-211">      breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">50e6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">100e6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">200e6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-212">      labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$50M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$100M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"$200M"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-213">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-214">    scale-shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-215">      name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Release Era"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-216">      limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Before 2019"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2019 onward"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-217">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-218">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-219"></span>
<span id="cb1-220">  guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-221">    shape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-222">    fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guide-legend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"horizontal"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-223">    size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guide-legend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>direction<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"horizontal"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-224">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-225">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-226">    title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Panned by Critics, Paid by Audiences"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-227">    subtitle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-228">      A poor critics' score has rarely stopped a theatrical video-game adaptation</span>
<span id="cb1-229">      from making money: most films land <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> profit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>in profit<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-230">      rather than at a <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> loss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>loss<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span>, the biggest grossers</span>
<span id="cb1-231">      carry the biggest budgets, and the runaway hits now belong to the</span>
<span id="cb1-232">      post-<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>emph<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Detective Pikachu<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> boom <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-233">      (<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>rect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4.6pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">55%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4pt</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span>~2019 onward,</span>
<span id="cb1-234">      not <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>circle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>radius<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.6pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">55%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.4pt</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span>~before).</span>
<span id="cb1-235">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-236">    caption<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> typst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">([</span></span>
<span id="cb1-237">      Source: Films and series based on video games (TidyTuesday 2026-06-09). <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-238">      Author: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>link<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://mickael.canouil.fr"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Mickaël CANOUIL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">].</span></span>
<span id="cb1-239">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]),</span></span>
<span id="cb1-240">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-241">  theme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> theme-minimal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-242">  width<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">auto</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-243">  height<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">auto</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-244"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div></div>
</details>
<div id="fig-2026-06-09" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-2026-06-09-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div>
<div class="light-content">
<p><a href="../../../../tidytuesday/2026/06/09/./images/plot-light.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure&nbsp;1: Theatrical video-game film adaptations by critics’ score and worldwide box office, with marker size for production budget, fill colour for box office divided by budget, and shape for release era. An inset contrasts the mean critics’ score with the mean audience CinemaScore."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/09/images/plot-light.svg" class="img-fluid figure-frame figure-img" alt="Scatter plot of theatrical video-game film adaptations with the Rotten Tomatoes critics’ score on the x axis and worldwide box office on a logarithmic y axis from 100 thousand to 1 billion US dollars. A shaded band marks the zone left of the 60 percent ‘fresh’ line where films still gross past 100 million dollars, and many markers sit inside it. The Super Mario Bros.&nbsp;Movie tops the chart near 1.4 billion dollars at 59 percent, with Sonic the Hedgehog 3 the best reviewed at 86 percent and Detective Pikachu also labelled, and Postal by Uwe Boll at the bottom; these four labelled films are circled in teal. Marker size encodes the production budget, fill colour encodes box office divided by budget on a vermillion-to-teal scale pivoting at break-even, and marker shape splits films released before 2019 (circles) from those released 2019 onward (squares). An inset dumbbell in the top-left shows the mean critics’ score at 33 far below the mean audience CinemaScore at 76."></a></p>
</div>
<div class="dark-content">
<p><a href="../../../../tidytuesday/2026/06/09/./images/plot-dark.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure&nbsp;1: Theatrical video-game film adaptations by critics’ score and worldwide box office, with marker size for production budget, fill colour for box office divided by budget, and shape for release era. An inset contrasts the mean critics’ score with the mean audience CinemaScore."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/09/images/plot-dark.svg" class="img-fluid figure-frame figure-img" alt="Scatter plot of theatrical video-game film adaptations with the Rotten Tomatoes critics’ score on the x axis and worldwide box office on a logarithmic y axis from 100 thousand to 1 billion US dollars. A shaded band marks the zone left of the 60 percent ‘fresh’ line where films still gross past 100 million dollars, and many markers sit inside it. The Super Mario Bros.&nbsp;Movie tops the chart near 1.4 billion dollars at 59 percent, with Sonic the Hedgehog 3 the best reviewed at 86 percent and Detective Pikachu also labelled, and Postal by Uwe Boll at the bottom; these four labelled films are circled in teal. Marker size encodes the production budget, fill colour encodes box office divided by budget on a vermillion-to-teal scale pivoting at break-even, and marker shape splits films released before 2019 (circles) from those released 2019 onward (squares). An inset dumbbell in the top-left shows the mean critics’ score at 33 far below the mean audience CinemaScore at 76."></a></p>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-2026-06-09-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Theatrical video-game film adaptations by critics’ score and worldwide box office, with marker size for production budget, fill colour for box office divided by budget, and shape for release era. An inset contrasts the mean critics’ score with the mean audience CinemaScore.
</figcaption>
</figure>
</div>
</div>
<p>Data: <a href="https://github.com/rfordatascience/tidytuesday/tree/main/data/2026/2026-06-09">TidyTuesday 2026-06-09</a>.</p>
<p>Video-game film adaptations have a long reputation for being review-proof. The horizontal axis is the Rotten Tomatoes critics’ score, the vertical axis is worldwide box office on a logarithmic scale, and the shaded band marks the films that critics called rotten yet that still grossed past one hundred million dollars. The band is crowded, which is the whole point: a low score has rarely stopped one of these films from making money.</p>
<p>The biggest earners cluster towards the recent end of the story. The Super Mario Bros.&nbsp;Movie sits at the top with about 1.4 billion dollars on a fifty-nine per cent score, and Sonic the Hedgehog 3, the best reviewed of the set at eighty-six per cent, follows well behind it. Marker shape separates the films released before 2019 from those released since, and the post-Detective Pikachu boom is where the heaviest grossing titles now live.</p>
<p>Colour reads profitability as worldwide box office divided by the production budget, pivoting at break-even, so vermillion markers lost money and teal markers cleared their budget several times over. Most of the cloud is comfortably in profit; the clearest losses belong to the cheap, savaged titles in the lower left, with Postal by Uwe Boll at the very bottom.</p>
<p>The inset makes the critic-versus-audience split explicit. Averaged over every film scored by both, the mean critics’ score sits around thirty-three while the mean opening-night CinemaScore, mapped onto the same nought-to-one-hundred ruler, sits around seventy-six. Critics and audiences are not watching these films the same way, and the box office sides with the audiences.</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a> ]]></description>
  <category>2026</category>
  <guid>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/09/</guid>
  <pubDate>Tue, 09 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/09/images/featured-light.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Whose Leave Is It Anyway?</title>
  <link>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/02/</link>
  <description><![CDATA[ 

Skip to main content




<div class="cell">
<details class="code-fold">
<summary>See the code that generated this plot.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" data-filename="typst" style="background: #f1f3f5;"><pre class="sourceCode typst cw-auto code-with-copy"><code class="sourceCode typst"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Gribouille comes from the typst-render preamble; do not re-import (rebinds the</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// theme-* wrappers).</span></span>
<span id="cb1-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@preview/gribouille:0.2.0": *</span></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@local/gribouille:0.0.0": *</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #set page(width: 18cm, height: 9.45cm, margin: 0cm)</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// EPLP missing sentinels all mean "no leave", so map them to 0; this keeps every</span></span>
<span id="cb1-8"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// year balanced at 21 countries for an honest mean.</span></span>
<span id="cb1-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">num</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">in</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Not applicable"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-98"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"-99"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> else {</span>
<span id="cb1-10">  float(s)</span>
<span id="cb1-11">}</span>
<span id="cb1-12"></span>
<span id="cb1-13"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">raw</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> csv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/eplp.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> row-type<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> dictionary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-14"></span>
<span id="cb1-15"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Each series bound to one Okabe-Ito hue (colourblind-safe), reused by strokes,</span></span>
<span id="cb1-16"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// labels, and boxes; insertion order fixes the scale order. Both series share one</span></span>
<span id="cb1-17"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// months axis so the gap between the lines is the story (Wilke).</span></span>
<span id="cb1-18"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">series-colours</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-19">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mothers"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072b2"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-20">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#d55e00"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-21"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-22"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">series</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>keys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-23"></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Boxed callout that lifts prose off the lines. Background reads the ambient</span></span>
<span id="cb1-25"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// `page.fill`, so the box tracks the light / dark site toggle.</span></span>
<span id="cb1-26"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">accent</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0f8b8d"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-27"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">callout</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>body<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> context {</span>
<span id="cb1-28">  let bg = if page.fill in (auto, none) { white } else { page.fill }</span>
<span id="cb1-29">  box(</span>
<span id="cb1-30">    fill: bg,</span>
<span id="cb1-31">    inset: (x: 5pt, y: 4pt),</span>
<span id="cb1-32">    radius: 3pt,</span>
<span id="cb1-33">    stroke: 0.5pt + accent,</span>
<span id="cb1-34">  )[<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>body]</span>
<span id="cb1-35">}</span>
<span id="cb1-36"></span>
<span id="cb1-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Maternity leave spans four columns; sum them per country-year.</span></span>
<span id="cb1-38"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">mat-cols</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mat_m_ld_bb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mat_m_ld_ab"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mat_v_ld_bb"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mat_v_ld_ab"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">mother-leave</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mat-cols<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>fold<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>a<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> a <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span></span>
<span id="cb1-40"></span>
<span id="cb1-41"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Long format, one row per country x year x series; the layers mean these via</span></span>
<span id="cb1-42"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// stat-summary.</span></span>
<span id="cb1-43"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">obs</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-44">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">acc</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-45">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> r <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> raw <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-46">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> float<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-47">    acc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>year: y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mothers"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: mother-leave<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span></span>
<span id="cb1-48">    acc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>year: y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>co_ld<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)))</span></span>
<span id="cb1-49">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-50">  acc</span>
<span id="cb1-51"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-52"></span>
<span id="cb1-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// ISO-2 codes to full names for the secondary panel's y axis.</span></span>
<span id="cb1-54"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">country-names</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-55">  AT: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Austria"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> BE: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Belgium"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> CZ: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Czechia"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> DE: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Germany"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> DK: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Denmark"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-56">  EE: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Estonia"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ES: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Spain"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> FI: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Finland"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> FR: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"France"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> GR: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Greece"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-57">  HU: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hungary"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> IE: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Ireland"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> IT: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Italy"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> LT: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Lithuania"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> NL: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Netherlands"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-58">  NO: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Norway"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> PL: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Poland"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> SE: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Sweden"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> SI: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Slovenia"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> SK: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Slovakia"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-59">  UK: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"United Kingdom"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-60"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-61"></span>
<span id="cb1-62"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Secondary panel data: where each country stands in 2024. One row per country</span></span>
<span id="cb1-63"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// with its mother and co-parent months and the gap between them, sorted so the</span></span>
<span id="cb1-64"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// closest-to-parity sits at the top of the dumbbell.</span></span>
<span id="cb1-65"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">gap-2024</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-66">  raw</span>
<span id="cb1-67">    .filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> float<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>year<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2024</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-68">    .map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-69">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">m</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> mother-leave<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-70">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">co</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>co_ld<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-71">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">name</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> country-names<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> r<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-72">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>country: name<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> mother: m<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> coparent: co<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> spread: m <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">-</span> co<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-73">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">})</span></span>
<span id="cb1-74">    .sorted<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>key<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"spread"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-75"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-76"></span>
<span id="cb1-77"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// y order for the discrete country axis. gap-2024 is sorted parity-first; the</span></span>
<span id="cb1-78"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// discrete y axis draws its first level at the bottom, so reverse to put parity</span></span>
<span id="cb1-79"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// (smallest gap) at the top of the dumbbell.</span></span>
<span id="cb1-80"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">country-order</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> gap-2024<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">).</span>rev<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-81"></span>
<span id="cb1-82"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// The two dots per country, long format, coloured by series like the main panel.</span></span>
<span id="cb1-83"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">gap-dots</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-84">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">acc</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-85">  <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">for</span> row <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">in</span> gap-2024 <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-86">    acc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>country: row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mothers"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>mother<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-87">    acc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>push<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>country: row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>coparent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span></span>
<span id="cb1-88">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-89">  acc</span>
<span id="cb1-90"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-91"></span>
<span id="cb1-92"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">main</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> defer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-93">  plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-94">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> obs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-95">  mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"months"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-96">  layers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-97">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// +/-1 SE band per series via stat-summary(mean-se); drawn first so it sits</span></span>
<span id="cb1-98">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// under the line. fill: "series" tints it in each line's hue.</span></span>
<span id="cb1-99">    geom-ribbon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-100">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-101">      stat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> stat-summary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean-se"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-102">      alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-103">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-104">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Per-year mean line: stat-summary buckets each series by year, fun: "mean".</span></span>
<span id="cb1-105">    geom-line<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.6pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> stat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> stat-summary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-106">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Direct labels instead of a legend: bold series name at a hand-placed point,</span></span>
<span id="cb1-107">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// coloured by series via the shared scale.</span></span>
<span id="cb1-108">    geom-typst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-109">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-110">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>year: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1983</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">19.4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mothers"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*Mothers*"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-111">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>year: <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> months: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.75</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> series: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label: <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"*Co-parents*"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-112">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-113">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"months"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-114">      anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-115">      inherit-aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-116">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-117">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// End-value labels: `data` filters the inherited frame to the final year, then</span></span>
<span id="cb1-118">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// stat-summary means it like the line; the box sits at that mean and after-stat</span></span>
<span id="cb1-119">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// binds its text to the same value, so the number can never drift from the line.</span></span>
<span id="cb1-120">    geom-label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-121">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> d <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> d<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>o <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> o<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>year <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2024</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-122">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-123">        x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-124">        y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"months"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-125">        fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-126">        label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> after-stat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ctx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> str<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>calc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>round<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">" months"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-127">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-128">      stat<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> stat-summary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fun<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mean"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> axis<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"y"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-129">      size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-130">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> white<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-131">      dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-132">      dy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-133">      segment<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-134">      inherit-aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-135">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-136">    <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Callout in the empty wedge between the lines.</span></span>
<span id="cb1-137">    annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-138">      <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typst"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-139">      x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1977</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-140">      y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">9</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-141">      label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> callout<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-142">        Leave reserved for the</span>
<span id="cb1-143">        <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"semibold"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>co-parent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-144">        barely existed until 2000. <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-145">        *4* countries offered it in *1980*; *19* do in *2024*.</span>
<span id="cb1-146">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-147">      size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-148">      anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-149">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-150">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-151">  scales<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-152">    scale-x-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-153">      breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1970</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1980</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1990</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2024</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-154">      expand<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">10%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-155">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-156">    scale-y-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-157">    scale-colour-discrete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-158">      limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-159">      palette<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-160">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-161">    scale-fill-discrete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-162">      limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-163">      palette<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-164">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-165">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-166">  guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-167">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Months of Leave"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-168">  theme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> theme-minimal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-169"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-170"></span>
<span id="cb1-171"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Secondary panel: a 2024 snapshot of all 21 countries as a dumbbell. A grey</span></span>
<span id="cb1-172"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// segment per country spans its mother dot to its co-parent dot, so the bar</span></span>
<span id="cb1-173"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// length IS the gap; sorted with parity at the top. Different axes (months by</span></span>
<span id="cb1-174"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// country) make this read as a different question from the time series, not a</span></span>
<span id="cb1-175"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// lookalike. Colour still means series, tying it to the main panel.</span></span>
<span id="cb1-176"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">secondary</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> defer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-177">  plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-178">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> gap-dots<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-179">  mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"months"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"country"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"series"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-180">  layers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-181">    geom-segment<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-182">      data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> gap-2024<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-183">      mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"coparent"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"country"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> xend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"mother"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> yend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"country"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-184">      stroke<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-185">      colour<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> luma<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">70%</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-186">      inherit-aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">false</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-187">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-188">    geom-point<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">3.4pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-189">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-190">  scales<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-191">    scale-x-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">44</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">12</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">24</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">36</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-192">    scale-y-discrete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> country-order<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-193">    scale-fill-discrete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> palette<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()),</span></span>
<span id="cb1-194">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-195">  guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-196">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Months of Leave"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-197">  theme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> theme-minimal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-198">    axis-text-y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> element-text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>font<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"DejaVu Sans Mono"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">7pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-199">    tick-length-y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.08cm</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-200">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-201"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-202"></span>
<span id="cb1-203"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>compose<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-204">  main<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-205">  secondary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-206">  columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-207">  widths<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1.4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-208">  tag-levels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"A"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-209">  tag-prefix<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"("</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-210">  tag-suffix<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">")"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-211">  align-panels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">true</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-212">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-213">    title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Europe Still Reserves Far More Leave for Mothers Than for the Co-Parent"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-214">    subtitle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>*(A)* the gap between <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Mothers"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>mothers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> and the <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> series-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Co-parents"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span> weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bold"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>co-parent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> has narrowed since 2000 yet mothers still get far more; <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>*(B)* in 2024 it ranges from parity (Spain, Slovakia, UK) to roughly 40 months (Ireland).<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-215">    caption<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> typst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">([</span></span>
<span id="cb1-216">      Source: European Parenting Leave Policies (TidyTuesday 2026-06-02). <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-217">      Author: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>link<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://mickael.canouil.fr"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Mickaël CANOUIL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">].</span></span>
<span id="cb1-218">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]),</span></span>
<span id="cb1-219">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-220"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span></code></pre></div></div>
</details>
<div id="fig-2026-06-02" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-2026-06-02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div>
<div class="light-content">
<p><a href="../../../../tidytuesday/2026/06/02/./images/plot-light.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure&nbsp;1: (A): mean months of statutory leave reserved for each parent across 21 European countries, 1970 to 2024, with a band of plus or minus one standard error around each line. (B): a dumbbell chart of all 21 countries in 2024, each drawn as two dots joined by a bar whose length is the gap between mothers and the co-parent, sorted with the countries closest to parity on top."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/02/images/plot-light.svg" class="img-fluid figure-frame figure-img" alt="Two panels. Panel (A) is a two-line chart of mean months of statutory leave reserved for each parent across 21 European countries from 1970 to 2024, each line wrapped in a shaded band of plus or minus one standard error: the blue mothers line rises from about 14 months to a peak above 21 around 2010 then eases to roughly 18, while the vermillion co-parent line sits near zero until 2000 and climbs to about 5 months by 2024, and the mothers band is consistently wider. Panel (B) is a dumbbell chart, a 2024 snapshot of all 21 countries, each shown as a blue mothers dot and a vermillion co-parent dot joined by a grey bar whose length is the gap; countries are sorted with the smallest gaps on top, where Spain, Slovakia and the United Kingdom reach parity, down to Ireland with the widest gap at the bottom."></a></p>
</div>
<div class="dark-content">
<p><a href="../../../../tidytuesday/2026/06/02/./images/plot-dark.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure&nbsp;1: (A): mean months of statutory leave reserved for each parent across 21 European countries, 1970 to 2024, with a band of plus or minus one standard error around each line. (B): a dumbbell chart of all 21 countries in 2024, each drawn as two dots joined by a bar whose length is the gap between mothers and the co-parent, sorted with the countries closest to parity on top."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/02/images/plot-dark.svg" class="img-fluid figure-frame figure-img" alt="Two panels. Panel (A) is a two-line chart of mean months of statutory leave reserved for each parent across 21 European countries from 1970 to 2024, each line wrapped in a shaded band of plus or minus one standard error: the blue mothers line rises from about 14 months to a peak above 21 around 2010 then eases to roughly 18, while the vermillion co-parent line sits near zero until 2000 and climbs to about 5 months by 2024, and the mothers band is consistently wider. Panel (B) is a dumbbell chart, a 2024 snapshot of all 21 countries, each shown as a blue mothers dot and a vermillion co-parent dot joined by a grey bar whose length is the gap; countries are sorted with the smallest gaps on top, where Spain, Slovakia and the United Kingdom reach parity, down to Ireland with the widest gap at the bottom."></a></p>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-2026-06-02-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: (A): mean months of statutory leave reserved for each parent across 21 European countries, 1970 to 2024, with a band of plus or minus one standard error around each line. (B): a dumbbell chart of all 21 countries in 2024, each drawn as two dots joined by a bar whose length is the gap between mothers and the co-parent, sorted with the countries closest to parity on top.
</figcaption>
</figure>
</div>
</div>
<p>Data: <a href="https://github.com/rfordatascience/tidytuesday/tree/main/data/2026/2026-06-02">TidyTuesday 2026-06-02</a>.</p>
<p>Europe has long earmarked far more statutory leave for mothers than for the co-parent. In 1970 the average country set aside about fourteen months for mothers and almost nothing for the co-parent. That asymmetry is the oldest and most stubborn feature of the data.</p>
<p>The co-parent line stays close to the floor until the turn of the century. Only four countries reserved any leave for the co-parent in 1980, but nineteen did by 2024, as “use it or lose it” quotas spread across the continent. The line lifts off after 2000 and reaches roughly five months, about a third of what mothers receive, so the gap closes but only slowly.</p>
<p>The shaded band around each line spans one standard error of the mean, so it widens when countries disagree. The mothers band is consistently the wider of the two, a reminder that “European maternity leave” hides very different national choices, and the mean is pulled upward by a few countries with unusually long leave. The point of the left panel is the shape of the two trends and the gap between them, not the precise height of either line.</p>
<p>The right panel is a dumbbell chart that makes the national divergence concrete by ranking all twenty-one countries in 2024. Each country is a pair of dots, one for mothers and one for the co-parent, joined by a bar whose length is the gap between them. Spain, Slovakia and the United Kingdom have closed it completely, reserving the same amount for both parents, while at the other end Ireland reserves forty-two months for mothers and barely two for the co-parent. France sits in the lower half: sixteen months for mothers but only about four for the co-parent, despite matching Spain on maternity leave. That is the spread the European average smooths away.</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a> ]]></description>
  <category>2026</category>
  <guid>https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/02/</guid>
  <pubDate>Tue, 02 Jun 2026 00:00:00 GMT</pubDate>
  <media:content url="https://m.canouil.dev/tidytuesday/tidytuesday/2026/06/02/images/featured-light.png" medium="image" type="image/png"/>
</item>
<item>
  <title>Sustainable Energy for All</title>
  <link>https://m.canouil.dev/tidytuesday/tidytuesday/2026/05/26/</link>
  <description><![CDATA[ 

Skip to main content




<div class="cell">
<details class="code-fold">
<summary>See the code that generated this plot.</summary>
<div class="code-copy-outer-scaffold"><div class="sourceCode cell-code" id="cb1" data-filename="typst" style="background: #f1f3f5;"><pre class="sourceCode typst cw-auto code-with-copy"><code class="sourceCode typst"><span id="cb1-1"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Gribouille is imported by the typst-render preamble (see assets/typst/_preamble.typ);</span></span>
<span id="cb1-2"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// do not import it here or the theme-* wrappers get rebound.</span></span>
<span id="cb1-3"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@preview/gribouille:0.1.0": *</span></span>
<span id="cb1-4"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #import "@local/gribouille:0.0.0": *</span></span>
<span id="cb1-5"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// #set page(width: 18cm, height: 9.45cm, margin: 0cm)</span></span>
<span id="cb1-6"></span>
<span id="cb1-7"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">num</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>s<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="cf" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">if</span> s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"NA"</span> or s <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">""</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span> else { float(s) }</span>
<span id="cb1-8"></span>
<span id="cb1-9"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">raw</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> csv<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"data/energy_cleaned.csv"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> row-type<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> dictionary<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-10"></span>
<span id="cb1-11"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Four mutually exclusive, exhaustive slices of the renewable total (% of final</span></span>
<span id="cb1-12"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// energy). One dictionary keeps each category bound to its Okabe-Ito colour, so</span></span>
<span id="cb1-13"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// labels, the stacking order, and the legend can never drift out of sync.</span></span>
<span id="cb1-14"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Okabe-Ito is colourblind-safe; warm "old" biomass through cool "new" turbines.</span></span>
<span id="cb1-15"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cat-colours</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-16">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Traditional biomass"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#e69f00"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-17">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Modern bioenergy"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#009e73"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-18">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hydropower"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#56b4e9"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-19">  <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Wind &amp; solar"</span>: rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0072b2"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-20"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-21"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cats</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>keys<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-22"></span>
<span id="cb1-23"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// One-line definition per category, aligned with `cats`. Each rolls up the</span></span>
<span id="cb1-24"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// raw columns summed in `reshape`, so the legend names what every band is.</span></span>
<span id="cb1-25"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">cat-labels</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-26">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Traditional biomass<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>wood, charcoal &amp; dung for cooking<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-27">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Modern bioenergy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>biogas, biofuels &amp; waste-to-energy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-28">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Hydropower<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>electricity from flowing water<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-29">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>strong<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>Wind &amp; solar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>plus geothermal &amp; marine<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-30"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-31"></span>
<span id="cb1-32"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">accent</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> rgb<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"#0f8b8d"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-33"></span>
<span id="cb1-34"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// Box-styled callout: a translucent paper background plus a hairline accent</span></span>
<span id="cb1-35"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// border lifts the prose off the stacked bands so it stays legible. The paper</span></span>
<span id="cb1-36"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// colour comes from the ambient `page.fill` (typst-render sets the page fill to</span></span>
<span id="cb1-37"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// the document background), mirroring how ink is read from `text.fill`, so the</span></span>
<span id="cb1-38"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// boxes track the light / dark site toggle.</span></span>
<span id="cb1-39"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">callout</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>body<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> context {</span>
<span id="cb1-40">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// `page.fill` is `auto` when the document sets no page fill (standalone</span></span>
<span id="cb1-41">  <span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// compile); typst-render sets it to the background, so fall back to white.</span></span>
<span id="cb1-42">  let bg = if page.fill in (auto, none) { white } else { page.fill }</span>
<span id="cb1-43">  box(</span>
<span id="cb1-44">    fill: bg.transparentize(12%),</span>
<span id="cb1-45">    inset: (x: 5pt, y: 3pt),</span>
<span id="cb1-46">    radius: 3pt,</span>
<span id="cb1-47">    stroke: 0.5pt + accent.transparentize(45%),</span>
<span id="cb1-48">  )[<span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>body]</span>
<span id="cb1-49">}</span>
<span id="cb1-50"></span>
<span id="cb1-51"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// One row per (year, category) carrying the stacked band bounds (ymin, ymax).</span></span>
<span id="cb1-52"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// geom-area draws every band from y = 0, so stacked areas would paint over one</span></span>
<span id="cb1-53"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// another; geom-ribbon with explicit bounds is the honest stacking primitive.</span></span>
<span id="cb1-54"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">reshape</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-55">  raw</span>
<span id="cb1-56">    .filter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>country_name <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">==</span> country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-57">    .map<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-58">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">y</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> float<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>yr<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-59">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">shares</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-60">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Traditional biomass"</span>: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>traditional_biomass_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-61">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Modern bioenergy"</span>: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>modern_biomass_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-62">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>biogas_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-63">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>liquid_biofuels_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-64">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>waste_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-65">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Hydropower"</span>: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>hydro_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-66">        <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Wind &amp; solar"</span>: num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>wind_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-67">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>solar_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-68">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>geothermal_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-69">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> num<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>row<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>marine_energy_consumption_tfec_pct<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-70">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-71">      cats</span>
<span id="cb1-72">        .fold<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>acc: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0.0</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> out: <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()),</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>st<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=&gt;</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">{</span></span>
<span id="cb1-73">          <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">hi</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> st<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>acc <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> shares<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-74">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-75">            acc: hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-76">            out: st<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>out <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">((</span>year: y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> category: c<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymin: st<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>acc<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymax: hi<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),),</span></span>
<span id="cb1-77">          <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-78">        <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">})</span></span>
<span id="cb1-79">        .out</span>
<span id="cb1-80">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">})</span></span>
<span id="cb1-81">    .flatten<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">()</span></span>
<span id="cb1-82"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">}</span></span>
<span id="cb1-83"></span>
<span id="cb1-84"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">vn</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reshape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Vietnam"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-85"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">de</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> reshape<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Germany"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-86"></span>
<span id="cb1-87"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">panel</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> annotations<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> defer<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-88">  plot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-89">  data<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> rows<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-90">  mapping<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> aes<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"year"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymin<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ymin"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> ymax<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"ymax"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"category"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-91">  layers<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>geom-ribbon<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>alpha<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),)</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> annotations<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-92">  scales<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-93">    scale-x-continuous<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>breaks<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">1990</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2000</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2010</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-94">    scale-fill-discrete<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>limits<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cats<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> palette<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>values<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span> labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-labels<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-95">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-96">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> country<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"% Final Energy"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="bu" style="color: null;
background-color: null;
font-style: inherit;">none</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-97">  theme<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> theme-minimal<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(),</span></span>
<span id="cb1-98"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-99"></span>
<span id="cb1-100"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// In-panel callouts: the total renewable share at each end, plus a one-line</span></span>
<span id="cb1-101"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// "why" sitting in the empty corner of each panel. Text colour is left to the</span></span>
<span id="cb1-102"><span class="co" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">// theme ink so the callouts track the light / dark site toggle.</span></span>
<span id="cb1-103"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">vn-annot</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-104">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1990.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">79</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"76%"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-105">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2009.8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">42</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"35%"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"east"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-106">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-107">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typst"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-108">    x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2009.6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-109">    y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">70</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-110">    label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> callout<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-111">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-112">        fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Traditional biomass"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-113">        weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"semibold"</span></span>
<span id="cb1-114">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Traditional biomass<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>emph<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>for cooking<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span> <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-115">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>emph<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>fades as fossil fuels spread<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-116">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-117">    size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-118">    anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"east"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-119">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-120"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-121"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">de-annot</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-122">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1990.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2.5</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"2%"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-123">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"label"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2009.8</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">11.4</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"11%"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"east"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-124">  annotate<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-125">    <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"typst"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-126">    x<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1990.2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-127">    y<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">9.6</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-128">    label<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> callout<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-129">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-130">        fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Modern bioenergy"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-131">        weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"semibold"</span></span>
<span id="cb1-132">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Modern bioenergy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span>,</span>
<span id="cb1-133">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>emph<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>then<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-134">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-135">        fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Wind &amp; solar"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-136">        weight<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"semibold"</span></span>
<span id="cb1-137">      <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>wind &amp; solar<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span>, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-138">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>emph<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span>built from almost nothing<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-139">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">],</span></span>
<span id="cb1-140">    size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">6.5pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-141">    anchor<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"west"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-142">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-143"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-144"></span>
<span id="cb1-145"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#let</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">panels</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">=</span> compose<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-146">  panel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>vn<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Vietnam"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> vn-annot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-147">  panel<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>de<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Germany"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> de-annot<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-148">  layout<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"grid"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-149">  columns<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="dv" style="color: #AD0000;
background-color: null;
font-style: inherit;">2</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-150">  collect<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"fill"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,),</span></span>
<span id="cb1-151">  guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guides<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>default<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> guide-legend<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>position<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"bottom"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)),</span></span>
<span id="cb1-152">  gutter<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">1cm</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-153">  labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> labs<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span></span>
<span id="cb1-154">    title<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"What </span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">Renewable Energy</span><span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\"</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;"> Means Depends on How Rich a Country Is"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-155">    subtitle<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Renewable share of final energy use, by source, 1990 to 2010."</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span></span>
<span id="cb1-156">    caption<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> typst<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">([</span></span>
<span id="cb1-157">      Source: Sustainable Energy for All (TidyTuesday 2026-05-26). <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\</span></span>
<span id="cb1-158">      Author: <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>link<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"https://mickael.canouil.fr"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span>Mickaël CANOUIL<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">].</span></span>
<span id="cb1-159">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">])</span></span>
<span id="cb1-160">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">),</span></span>
<span id="cb1-161"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-162"></span>
<span id="cb1-163"><span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">[</span></span>
<span id="cb1-164">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>panels</span>
<span id="cb1-165">  <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>place<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>top <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">+</span> center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> dx<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">0pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> dy<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2cm</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)[</span></span>
<span id="cb1-166">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#set</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">align</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>center<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-167">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#set</span> <span class="va" style="color: #111111;
background-color: null;
font-style: inherit;">text</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">8pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> style<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"italic"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> accent<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-168">    As incomes rise, <span class="sc" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">\ </span>two roads diverge</span>
<span id="cb1-169">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>v<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-170">    <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>box<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>inset<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>x: <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">2pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))[</span></span>
<span id="cb1-171">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Traditional biomass"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))[</span>↓<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-172">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>h<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">4pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">)</span></span>
<span id="cb1-173">      <span class="kw" style="color: #003B4F;
background-color: null;
font-weight: bold;
font-style: inherit;">#</span>text<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span>size<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> <span class="fl" style="color: #AD0000;
background-color: null;
font-style: inherit;">40pt</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">,</span> fill<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">:</span> cat-colours<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">.</span>at<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">(</span><span class="st" style="color: #20794D;
background-color: null;
font-style: inherit;">"Wind &amp; solar"</span><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">))[</span>↑<span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-174">    <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-175">  <span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span>
<span id="cb1-176"><span class="op" style="color: #5E5E5E;
background-color: null;
font-style: inherit;">]</span></span></code></pre></div></div>
</details>
<div id="fig-2026-05-26" class="quarto-float quarto-figure quarto-figure-center anchored">
<figure class="quarto-float quarto-float-fig figure">
<div aria-describedby="fig-2026-05-26-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
<div>
<div class="light-content">
<p><a href="../../../../tidytuesday/2026/05/26/./images/plot-light.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-1" title="Figure&nbsp;1: Renewable energy by source as a share of total final energy consumption, 1990 to 2010, for Vietnam and Germany."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/05/26/images/plot-light.svg" class="img-fluid figure-frame figure-img" alt="Two stacked-area panels of renewable energy by source, 1990 to 2010. Vietnam’s traditional biomass band shrinks and its renewable share falls from 76% to 35%, while Germany’s modern bioenergy and wind and solar grow and its share rises from 2% to 11%."></a></p>
</div>
<div class="dark-content">
<p><a href="../../../../tidytuesday/2026/05/26/./images/plot-dark.svg" class="lightbox" data-gallery="quarto-lightbox-gallery-2" title="Figure&nbsp;1: Renewable energy by source as a share of total final energy consumption, 1990 to 2010, for Vietnam and Germany."><img src="https://m.canouil.dev/tidytuesday/tidytuesday/2026/05/26/images/plot-dark.svg" class="img-fluid figure-frame figure-img" alt="Two stacked-area panels of renewable energy by source, 1990 to 2010. Vietnam’s traditional biomass band shrinks and its renewable share falls from 76% to 35%, while Germany’s modern bioenergy and wind and solar grow and its share rises from 2% to 11%."></a></p>
</div>
</div>
</div>
<figcaption class="quarto-float-caption-bottom quarto-float-caption quarto-float-fig" id="fig-2026-05-26-caption-0ceaefa1-69ba-4598-a22c-09a6ac19f8ca">
Figure&nbsp;1: Renewable energy by source as a share of total final energy consumption, 1990 to 2010, for Vietnam and Germany.
</figcaption>
</figure>
</div>
</div>
<p>Data: <a href="https://github.com/rfordatascience/tidytuesday/tree/main/data/2026/2026-05-26">TidyTuesday 2026-05-26</a>.</p>
<p>The Sustainable Energy for All dataset tracks each country’s energy mix from 1990 to 2010. A high renewable share is not always a sign of clean, modern energy. Across countries in 2010, the renewable share correlates 0.88 with the share coming from traditional biomass, that is wood, charcoal, and dung burned for cooking and heating.</p>
<p>Vietnam shows what happens as a poor country grows richer. Its renewable share falls from 76% to 35%, not because it abandons clean energy, but because fossil fuels expand faster than traditional biomass can be replaced.</p>
<p>Germany shows the opposite road. Starting from almost nothing, it builds modern bioenergy and then wind and solar, lifting its renewable share from 2% to 11%. The same headline number hides two very different stories.</p>



<a onclick="window.scrollTo(0, 0); return false;" id="quarto-back-to-top"><i class="bi bi-arrow-up"></i> Back to top</a> ]]></description>
  <category>2026</category>
  <guid>https://m.canouil.dev/tidytuesday/tidytuesday/2026/05/26/</guid>
  <pubDate>Tue, 26 May 2026 00:00:00 GMT</pubDate>
  <media:content url="https://m.canouil.dev/tidytuesday/tidytuesday/2026/05/26/images/featured-light.png" medium="image" type="image/png"/>
</item>
</channel>
</rss>
