thibaud frere commited on
Commit
0fcbaa8
·
1 Parent(s): 439762d
app/src/components/Hero.astro CHANGED
@@ -89,7 +89,7 @@ const pdfFilename = `${slugify(pdfBase)}.pdf`;
89
  <style>
90
  /* Hero (full-width) */
91
  .hero { width: 100%; padding: 48px 16px 16px; text-align: center; }
92
- .hero-title { font-size: clamp(28px, 4vw, 48px); font-weight: 800; line-height: 1.1; margin: 0 0 8px; max-width: 60%; margin: auto; }
93
  .hero-banner { max-width: 980px; margin: 0 auto; }
94
  .hero-desc { color: var(--muted-color); font-style: italic; margin: 0 0 16px 0; }
95
 
 
89
  <style>
90
  /* Hero (full-width) */
91
  .hero { width: 100%; padding: 48px 16px 16px; text-align: center; }
92
+ .hero-title { font-size: clamp(28px, 4vw, 48px); font-weight: 800; line-height: 1.1; margin: 0 0 8px; max-width: 100%; margin: auto; }
93
  .hero-banner { max-width: 980px; margin: 0 auto; }
94
  .hero-desc { color: var(--muted-color); font-style: italic; margin: 0 0 16px 0; }
95
 
app/src/content/chapters/available-blocks.mdx CHANGED
@@ -109,12 +109,12 @@ Here are a few variations using the same bibliography:
109
 
110
  **Responsive images** automatically generate an optimized `srcset` and `sizes` so the browser downloads the most appropriate file for the current viewport and DPR. You can also request multiple output formats (e.g., **AVIF**, **WebP**, fallback **PNG/JPEG**) and control **lazy loading/decoding** for better **performance**.
111
 
112
- | Prop | Required | Description | Option/Note |
113
- |------------------------|----------|---------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------|
114
- | `data-zoomable` | No | Adds a zoomable lightbox (Medium-like). | Only images with this attribute will open full-screen on click. |
115
- | `data-downloadable` | No | Adds a small download button to fetch the image file. | By default uses the original filename. Can be customized with `data-download-name` and `data-download-src`. |
116
- | `loading="lazy"` | No | Lazy loads the image. | Defers image loading until it is visible on screen. |
117
- | `caption` | No | Adds a caption and credit. | Pass HTML as the `caption` prop, or use `<slot name="caption">`. Keep `<span className="image-credit">` for credits. |
118
 
119
 
120
  <ResponsiveImage
@@ -278,7 +278,6 @@ greet("Astro");
278
  </Accordion>
279
  ````
280
 
281
-
282
  ### Note
283
 
284
  Small contextual callout for tips, caveats, or emphasis.
@@ -348,7 +347,7 @@ They exist in the `app/src/content/embeds` folder.
348
  For researchers who want to stay in **Python** while targeting **D3**, the [d3blocks](https://github.com/d3blocks/d3blocks) library lets you create interactive D3 charts with only a few lines of code. In **2025**, **D3** often provides more flexibility and a more web‑native rendering than **Plotly** for custom visualizations.
349
 
350
  | Prop | Required | Description
351
- |-------------|----------|--------------------------------------------------------------------------------------------------
352
  | `src` | Yes | Path to the embed file in the `embeds` folder.
353
  | `title` | No | Short title displayed above the card.
354
  | `desc` | No | Short description displayed below the card. Supports inline HTML (e.g., links).
 
109
 
110
  **Responsive images** automatically generate an optimized `srcset` and `sizes` so the browser downloads the most appropriate file for the current viewport and DPR. You can also request multiple output formats (e.g., **AVIF**, **WebP**, fallback **PNG/JPEG**) and control **lazy loading/decoding** for better **performance**.
111
 
112
+ | Prop | Required | Description
113
+ |------------------------|----------|-------------------------------------------------------
114
+ | `data-zoomable` | No | Adds a zoomable lightbox (Medium-like).
115
+ | `data-downloadable` | No | Adds a small download button to fetch the image file.
116
+ | `loading="lazy"` | No | Lazy loads the image.
117
+ | `caption` | No | Adds a caption and credit.
118
 
119
 
120
  <ResponsiveImage
 
278
  </Accordion>
279
  ````
280
 
 
281
  ### Note
282
 
283
  Small contextual callout for tips, caveats, or emphasis.
 
347
  For researchers who want to stay in **Python** while targeting **D3**, the [d3blocks](https://github.com/d3blocks/d3blocks) library lets you create interactive D3 charts with only a few lines of code. In **2025**, **D3** often provides more flexibility and a more web‑native rendering than **Plotly** for custom visualizations.
348
 
349
  | Prop | Required | Description
350
+ |-------------|----------|----------------------------------------------------------------------------------
351
  | `src` | Yes | Path to the embed file in the `embeds` folder.
352
  | `title` | No | Short title displayed above the card.
353
  | `desc` | No | Short description displayed below the card. Supports inline HTML (e.g., links).
app/src/content/chapters/best-pratices.mdx CHANGED
@@ -1,7 +1,7 @@
1
 
2
- import { Image } from 'astro:assets';
3
  import visualPoster from '../assets/images/visual-vocabulary-poster.png';
4
  import Note from '../../components/Note.astro';
 
5
 
6
 
7
  ## Best Practices
@@ -55,12 +55,11 @@ A palette encodes **meaning** (categories, magnitudes, oppositions), preserves *
55
 
56
  Picking the right visualization depends on your goal (compare values, show distribution, part-to-whole, trends, relationships, etc.). The Visual Vocabulary poster below provides a concise mapping from **analytical task** to **chart types**.
57
 
58
- <figure>
59
- <a href={"https://raw.githubusercontent.com/Financial-Times/chart-doctor/refs/heads/main/visual-vocabulary/poster.png"} target="_blank" rel="noopener noreferrer">
60
- <Image src={visualPoster} alt="Visual Vocabulary: choosing the right chart by task" />
61
- </a>
62
- <figcaption>
63
- A handy reference to select chart types by purpose — click to enlarge.
64
- </figcaption>
65
- </figure>
66
 
 
 
 
 
 
 
 
 
1
 
 
2
  import visualPoster from '../assets/images/visual-vocabulary-poster.png';
3
  import Note from '../../components/Note.astro';
4
+ import ResponsiveImage from '../../components/ResponsiveImage.astro';
5
 
6
 
7
  ## Best Practices
 
55
 
56
  Picking the right visualization depends on your goal (compare values, show distribution, part-to-whole, trends, relationships, etc.). The Visual Vocabulary poster below provides a concise mapping from **analytical task** to **chart types**.
57
 
 
 
 
 
 
 
 
 
58
 
59
+ <a href={"https://raw.githubusercontent.com/Financial-Times/chart-doctor/refs/heads/main/visual-vocabulary/poster.png"} target="_blank" rel="noopener noreferrer">
60
+ <ResponsiveImage
61
+ src={visualPoster}
62
+ alt="Visual Vocabulary: choosing the right chart by task"
63
+ caption={'A handy reference to select chart types by purpose — click to enlarge.'}
64
+ />
65
+ </a>
app/src/content/chapters/writing-your-content.mdx CHANGED
@@ -16,7 +16,7 @@ Your **article** lives in **one place**
16
  Everything is **self-contained** under `app/src/content/`:
17
  - **MDX**: `article.mdx` and [**optional chapters**](#chapters) in `chapters/`
18
  - **Assets**: `assets/` (**images**, **audios**, **datas**, etc.) tracked via **Git LFS**)
19
- - **Embeds**: `embed/` (**HTMLEmbed** for **Plotly/D3**, etc.) — see [**HtmlEmbed**](#htmlembed)
20
 
21
  The `article.mdx` file is the **main entry point** of your article.
22
 
 
16
  Everything is **self-contained** under `app/src/content/`:
17
  - **MDX**: `article.mdx` and [**optional chapters**](#chapters) in `chapters/`
18
  - **Assets**: `assets/` (**images**, **audios**, **datas**, etc.) tracked via **Git LFS**)
19
+ - **Embeds**: `embed/` ([**HtmlEmbed**](#htmlembed) for **Plotly/D3**, etc.)
20
 
21
  The `article.mdx` file is the **main entry point** of your article.
22
 
app/src/styles/_base.css CHANGED
@@ -97,8 +97,23 @@ html { font-size: 14px; line-height: 1.6; }
97
  }
98
 
99
 
100
- .content-grid main table { border-collapse: collapse; width: 100%; margin: 0 0 var(--spacing-4); }
101
- .content-grid main th, .content-grid main td { border-bottom: 1px solid var(--border-color); padding: 6px 8px; text-align: left; font-size: 15px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
  .content-grid main thead th { border-bottom: 1px solid var(--border-color); }
103
 
104
  .content-grid main hr { border: none; border-bottom: 1px solid var(--border-color); margin: var(--spacing-5) 0; }
 
97
  }
98
 
99
 
100
+ .content-grid main table {
101
+ border-collapse: collapse;
102
+ /* Make markdown tables scroll horizontally when they overflow on small screens */
103
+ display: block;
104
+ width: 100%;
105
+ max-width: none;
106
+ overflow-x: auto;
107
+ -webkit-overflow-scrolling: touch;
108
+ margin: 0 0 var(--spacing-4);
109
+ }
110
+ .content-grid main th, .content-grid main td {
111
+ border-bottom: 1px solid var(--border-color);
112
+ padding: 6px 8px;
113
+ text-align: left;
114
+ font-size: 15px;
115
+ white-space: nowrap; /* prevent squashing; allow horizontal scroll instead */
116
+ }
117
  .content-grid main thead th { border-bottom: 1px solid var(--border-color); }
118
 
119
  .content-grid main hr { border: none; border-bottom: 1px solid var(--border-color); margin: var(--spacing-5) 0; }