# Area chart

> One quantity along the script with its area filled: the length of every scene from Scene 1 to Scene 58, acts marked, so the script's rhythm is visible and the area adds up to its pages.

Source: https://kwark.space/designSystem/components/area-chart

## Usage

### What it is
An area chart is a line with the space under it filled, for one measure where the amount under the line means something. Kwark's example is the **length of every scene across the script**: scene numbers run left to right, each scene is a step as tall as its page count, and the filled area adds up to the whole script, 104 pages. A writer or director sees the script's rhythm at once: the long middle of Act 2, the quick run of short scenes into Act 3.

It is a measure, not a verdict (Decision 0002). There is no "ideal" scene length, no band that turns red, no comparison with other scripts.

### When to use
- One measure along the script or the schedule where the total matters: scene length, pages shot to date, money committed to date.
- When the reader cares about shape and mass more than single values.

### When not to
- Several series stacked on each other. Stacked areas hide every series but the bottom one; use small multiples or a table.
- Values that can be negative or that fall and rise around a target. Use a [Line chart](https://kwark.space/designSystem/components/line-chart.md).
- To mark scenes as "too long". Kwark never scores the script.

### Anatomy in use
- **Steps, not curves.** A scene is a block of pages; a smoothed curve would invent lengths between scenes.
- **Acts** above the plot with their page totals, and a faint dashed divider through the plot.
- **Direct labels**: the scene open in the editor (*Scene 12*, coral), and the longest scene. Two labels at most.
- **Y gridlines** at whole pages, labelled on the left; the unit is in the foot line.

### Writing
- The reading names the count, the total and one fact: *58 scenes over 104 pages. Most run under two pages; the longest is Scene 31, at 4 2/8.*
- Page counts in eighths, never decimals.

**Do:** Mint steps from Scene 1 to 58, acts above with their pages, Scene 12 and Scene 31 labelled.

**Don't:** A smoothed curve coloured red where scenes pass three pages, captioned *Pacing issues*.

## Style

### Anatomy

1. **Frame**: `.kw-viz` card.
2. **Acts row**: 22px, act name 12px 600, pages 12px `--k-text-2`; a 1px rule under it.
3. **Plot**: 168px tall (132px on a phone). Area `--k-chart-mint` at 30% on the surface; edge 1.5px `--k-chart-mint`.
4. **Gridlines**: 1px `--k-line` at each page, labels 12px `--k-text-2` outside the left edge.
5. **Act divider**: 1px dashed `--k-text-2` at 50%.
6. **Labels**: a 2px tick and a 12px label; the current scene in `--k-chart-coral`.
7. **Axis**: scene numbers 12px `--k-text-2`, first, every 20th and last.

### Tokens

| Token | Light | Dark |
|---|---|---|
| `--k-chart-mint` | #779a8b | var(--k-brand-mint) |
| `--k-chart-coral` | #bf5d45 | var(--k-brand-coral) |
| `--k-surface` | #ffffff | #1a1a1a |
| `--k-line` | #e2e8f0 | rgba(255, 255, 255, .1) |
| `--k-text` | #0f172a | #e3e3e3 |
| `--k-text-2` | #5b6779 | #9ca3af |
| `--k-radius-card` | 10px |  |
| `--k-fs-meta` | 12px |  |

### States
| State | Look |
|---|---|
| Rest | As drawn |
| Table | The plot hides; a table of all 58 scenes scrolls inside 240px |
| Phone | Plot 132px; act page counts drop to the act name |
| Script not yet split into scenes | No chart; a sentence: *Scene lengths appear once the script has scene headings.* |

## Code

### React

Use the HTML below with `kwark.css`. The example shows the markup and styling. Supply any application behavior described on this page.

### HTML and CSS

Works anywhere with `kwark.css`.

```html
<figure class="kw-viz">
  <figcaption class="kw-viz__head"><div><p class="kw-viz__title">Scene length through the script</p><p class="kw-viz__reading">58 scenes over 104 pages. Most run under two pages; the longest is Scene 31, at 4 2/8.</p></div><label class="kw-viz__switch"><input class="kw-visually-hidden" type="checkbox" role="switch" aria-label="Show scene lengths as a table"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="3" y="4" width="18" height="16" rx="2"/><path d="M3 10h18M3 15h18M9 10v10"/></svg><span>Table</span></label></figcaption>
  <div class="kw-viz__plot">
    <div class="kw-area" aria-hidden="true">
      <div class="kw-area__acts"><span style="left:0.00%;width:24.14%"><b>Act 1</b> 21 pp</span><span style="left:24.14%;width:51.72%"><b>Act 2</b> 62 1/8 pp</span><span style="left:75.86%;width:24.14%"><b>Act 3</b> 20 7/8 pp</span></div>
      <div class="kw-area__plot">
        <span class="kw-area__grid" style="bottom:20%"><i>1</i></span><span class="kw-area__grid" style="bottom:40%"><i>2</i></span><span class="kw-area__grid" style="bottom:60%"><i>3</i></span><span class="kw-area__grid" style="bottom:80%"><i>4</i></span>
        <svg viewBox="0 0 58 40" preserveAspectRatio="none"><path class="kw-area__fill" d="M0 40 V34 H1 V25 H2 V31 H3 V30 H4 V27 H5 V26 H6 V32 H7 V21 H8 V25 H9 V27 H10 V29 H11 V29 H12 V24 H13 V32 H14 V26 H15 V27 H16 V21 H17 V28 H18 V22 H19 V23 H20 V28 H21 V29 H22 V18 H23 V18 H24 V28 H25 V24 H26 V18 H27 V27 H28 V24 H29 V22 H30 V6 H31 V26 H32 V28 H33 V18 H34 V24 H35 V27 H36 V22 H37 V25 H38 V28 H39 V19 H40 V25 H41 V25 H42 V29 H43 V18 H44 V30 H45 V21 H46 V26 H47 V30 H48 V25 H49 V28 H50 V23 H51 V25 H52 V32 H53 V31 H54 V28 H55 V33 H56 V33 H57 V28 H58 V40 Z"/><path class="kw-area__line" d="M0 34 H1 V25 H2 V31 H3 V30 H4 V27 H5 V26 H6 V32 H7 V21 H8 V25 H9 V27 H10 V29 H11 V29 H12 V24 H13 V32 H14 V26 H15 V27 H16 V21 H17 V28 H18 V22 H19 V23 H20 V28 H21 V29 H22 V18 H23 V18 H24 V28 H25 V24 H26 V18 H27 V27 H28 V24 H29 V22 H30 V6 H31 V26 H32 V28 H33 V18 H34 V24 H35 V27 H36 V22 H37 V25 H38 V28 H39 V19 H40 V25 H41 V25 H42 V29 H43 V18 H44 V30 H45 V21 H46 V26 H47 V30 H48 V25 H49 V28 H50 V23 H51 V25 H52 V32 H53 V31 H54 V28 H55 V33 H56 V33 H57 V28 H58"/></svg>
        <span class="kw-area__act" style="left:24.14%"></span><span class="kw-area__act" style="left:75.86%"></span>
        <span class="kw-area__mark kw-area__mark--here" style="left:19.83%;bottom:27.500000000000004%"><b>Scene 12</b> 1 3/8</span>
        <span class="kw-area__mark" style="left:52.59%;bottom:85%"><b>Scene 31</b> 4 2/8</span>
      </div>
      <div class="kw-area__axis"><span style="left:0">Scene 1</span><span style="left:32.76%">20</span><span style="left:67.24%">40</span><span style="left:100%">58</span></div>
    </div>
    <p class="kw-viz__foot" aria-hidden="true"><span>Height: length in pages, counted in eighths</span><span>The filled area adds up to the whole script</span></p>
  </div>
  <div class="kw-viz__table"><table><caption>Length of every scene, in pages</caption><thead><tr><th scope="col">Scene</th><th scope="col">Act</th><th scope="col" class="num">Length</th></tr></thead><tbody><tr><th scope="row">Scene 1</th><td>Act 1</td><td class="num">6/8</td></tr><tr><th scope="row">Scene 2</th><td>Act 1</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 3</th><td>Act 1</td><td class="num">1 1/8</td></tr><tr><th scope="row">Scene 4</th><td>Act 1</td><td class="num">1 2/8</td></tr><tr><th scope="row">Scene 5</th><td>Act 1</td><td class="num">1 5/8</td></tr><tr><th scope="row">Scene 6</th><td>Act 1</td><td class="num">1 6/8</td></tr><tr><th scope="row">Scene 7</th><td>Act 1</td><td class="num">1</td></tr><tr><th scope="row">Scene 8</th><td>Act 1</td><td class="num">2 3/8</td></tr><tr><th scope="row">Scene 9</th><td>Act 1</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 10</th><td>Act 1</td><td class="num">1 5/8</td></tr><tr><th scope="row">Scene 11</th><td>Act 1</td><td class="num">1 3/8</td></tr><tr><th scope="row">Scene 12</th><td>Act 1</td><td class="num">1 3/8</td></tr><tr><th scope="row">Scene 13</th><td>Act 1</td><td class="num">2</td></tr><tr><th scope="row">Scene 14</th><td>Act 1</td><td class="num">1</td></tr><tr><th scope="row">Scene 15</th><td>Act 2</td><td class="num">1 6/8</td></tr><tr><th scope="row">Scene 16</th><td>Act 2</td><td class="num">1 5/8</td></tr><tr><th scope="row">Scene 17</th><td>Act 2</td><td class="num">2 3/8</td></tr><tr><th scope="row">Scene 18</th><td>Act 2</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 19</th><td>Act 2</td><td class="num">2 2/8</td></tr><tr><th scope="row">Scene 20</th><td>Act 2</td><td class="num">2 1/8</td></tr><tr><th scope="row">Scene 21</th><td>Act 2</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 22</th><td>Act 2</td><td class="num">1 3/8</td></tr><tr><th scope="row">Scene 23</th><td>Act 2</td><td class="num">2 6/8</td></tr><tr><th scope="row">Scene 24</th><td>Act 2</td><td class="num">2 6/8</td></tr><tr><th scope="row">Scene 25</th><td>Act 2</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 26</th><td>Act 2</td><td class="num">2</td></tr><tr><th scope="row">Scene 27</th><td>Act 2</td><td class="num">2 6/8</td></tr><tr><th scope="row">Scene 28</th><td>Act 2</td><td class="num">1 5/8</td></tr><tr><th scope="row">Scene 29</th><td>Act 2</td><td class="num">2</td></tr><tr><th scope="row">Scene 30</th><td>Act 2</td><td class="num">2 2/8</td></tr><tr><th scope="row">Scene 31</th><td>Act 2</td><td class="num">4 2/8</td></tr><tr><th scope="row">Scene 32</th><td>Act 2</td><td class="num">1 6/8</td></tr><tr><th scope="row">Scene 33</th><td>Act 2</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 34</th><td>Act 2</td><td class="num">2 6/8</td></tr><tr><th scope="row">Scene 35</th><td>Act 2</td><td class="num">2</td></tr><tr><th scope="row">Scene 36</th><td>Act 2</td><td class="num">1 5/8</td></tr><tr><th scope="row">Scene 37</th><td>Act 2</td><td class="num">2 2/8</td></tr><tr><th scope="row">Scene 38</th><td>Act 2</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 39</th><td>Act 2</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 40</th><td>Act 2</td><td class="num">2 5/8</td></tr><tr><th scope="row">Scene 41</th><td>Act 2</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 42</th><td>Act 2</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 43</th><td>Act 2</td><td class="num">1 3/8</td></tr><tr><th scope="row">Scene 44</th><td>Act 2</td><td class="num">2 6/8</td></tr><tr><th scope="row">Scene 45</th><td>Act 3</td><td class="num">1 2/8</td></tr><tr><th scope="row">Scene 46</th><td>Act 3</td><td class="num">2 3/8</td></tr><tr><th scope="row">Scene 47</th><td>Act 3</td><td class="num">1 6/8</td></tr><tr><th scope="row">Scene 48</th><td>Act 3</td><td class="num">1 2/8</td></tr><tr><th scope="row">Scene 49</th><td>Act 3</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 50</th><td>Act 3</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 51</th><td>Act 3</td><td class="num">2 1/8</td></tr><tr><th scope="row">Scene 52</th><td>Act 3</td><td class="num">1 7/8</td></tr><tr><th scope="row">Scene 53</th><td>Act 3</td><td class="num">1</td></tr><tr><th scope="row">Scene 54</th><td>Act 3</td><td class="num">1 1/8</td></tr><tr><th scope="row">Scene 55</th><td>Act 3</td><td class="num">1 4/8</td></tr><tr><th scope="row">Scene 56</th><td>Act 3</td><td class="num">7/8</td></tr><tr><th scope="row">Scene 57</th><td>Act 3</td><td class="num">7/8</td></tr><tr><th scope="row">Scene 58</th><td>Act 3</td><td class="num">1 4/8</td></tr></tbody></table></div>
</figure>
```

### Drawing the steps
Use a viewBox one unit per scene wide and one unit per eighth tall, `preserveAspectRatio="none"`. Build the path as `V` (to the scene's height) then `H` (to the next scene) for every scene. Close it to the baseline for the fill and stroke it open for the edge, with `vector-effect: non-scaling-stroke`. Place labels and gridlines in HTML by percentage so text never scales.

## Accessibility

### Screen readers
- The drawing is `aria-hidden`; the reading line says the finding and the table holds every scene's length.
- The **Table** switch has `role="switch"` and a name that says what it shows.

### Keyboard
Tab reaches the **Table** switch; Space shows the table. The table scrolls with arrow keys when focused.

### Colour
One hue only. The current scene is marked by a labelled tick as well as coral.

## For agents

### Rules

- **Must** draw scene lengths as steps, never smoothed.
- **Never** stack more than one area.
- **Never** mark a scene as too long or colour a band by a threshold (Decision 0002).
- **Must** keep the baseline at zero and count pages in eighths.
- **Always** carry a table with every value.

### AI readiness test

**Task:** Show where the long scenes sit in Blank Pages for the director's prep.

**Give the agent:** Area chart, Script timeline, Decision 0002.

**Constraint:** Two scenes are omitted and keep their numbers.

**A reliable answer:**
- Steps by scene number with acts above
- Omitted scenes as gaps at zero, named in the table
- Longest scene labelled with its eighths
- No colour or word that calls a scene too long
- Table switch
