durian-hypermediaStyle

All fixtures · The composed stage (from the Format page) · stage/34-animation-bins.dh.md

Source
---
title: "Animation: bins"
description: A fixture made from the Format page section of the same name (a composed stage).
roles:
  client: c1
  server: c2
  store: c3
  job: c4
  cache: c5
  ops: c6
  plain: c0
---

## Animation: bins

A `bins:` block sorts an inventory into named bins. `items p1..p8: words` names the things (one label for all, or one per id split by `;`); `items 40: word` is a count with no names, drawn as small squares. Each `bin role id "Label": the rule | a second line` is one bin, coloured by its role. In a step, `into <bin>: p1, p2..p4` drops those things, or `into <bin>: 12` drops the next 12 left. The block works out the count of each bin, the leftover in the inventory and a running total, and draws them: every thing has one place in the inventory and one reserved slot in its bin, so nothing moves between steps. A narrow screen stacks the bins.

```animation
title: Library returns | one trolley run
bins: Returned books | books
items b1..b9: Atlas; Birds; Cooking; Dunes; Engines; Fungi; Gardens; Harbours; Insects
bin job s "Science": shelves 500 to 599
bin store r "Reference": stays in the building
bin ops h "Home": goes back to a branch
@step Science: Natural history goes to the science shelves.
into s: b2, b4, b6, b9
@step Reference: Two heavy books stay in the building.
into r: b1, b5
@step Branch: Three go back to a branch.
into h: b3, b7, b8
@step Done: Every book has a bin; the inventory is empty.
```

The same block with many unnamed things: each square is one thing, the counts do the talking.

```animation
title: Seed packets | 60 packets, sorted by season
bins: Packets by season | packets
items 60: packet
bin job a "Spring": sow in March
bin store b "Summer": sow in June
bin ops c "Autumn": sow in September
@step Spring: The first batch is spring seed.
into a: 24
@step Summer: Then summer seed.
into b: 20
@step Autumn: Twelve go to autumn; four are left over.
into c: 12
```

A thing can drop again in a later step: it **moves** to another bin, and its old place stays as a dashed outline. `show c` in step 2 makes bin c appear there (its place is reserved from the start); `light c: words` lights a bin with a note in it. `ledger: Photo | Album` (or `... | Album from 0` to number the bins from 0) adds a list of every thing with the number of its bin in each step; a move reads `1 → 3` in the warning tone. A long label wraps inside its chip; it is never cut. `inventory: off` drops the inventory frame when everything is binned in step 1.

```animation
title: Photo albums | nine photos, re-sorted
bins: Albums | photos
items p1..p9: Beach · sunny; Beach · dusk; Hike · summit; Hike · lake; City · night; City · market; Beach · kite; Hike · camp; City · bridge
bin job a "Album 1": the first sort
bin store b "Album 2": the first sort
bin ops c "Album 3": added in step 2
ledger: Photo | Album
inventory: off
@step Two albums: Nine photos sit in two albums.
into a: p1, p2, p7, p3, p4
into b: p5, p6, p8, p9
@step Three albums: A third album appears and four photos move to it.
show c
light c: four photos move here
into c: p3, p4, p8, p9
```
LLM view
---
title: "Animation: bins"
description: A fixture made from the Format page section of the same name (a composed stage).
source: stage/34-animation-bins.dh.md
---
<!-- Made by dh llm from the source; nobody edits this file. -->

## Animation: bins

A `bins:` block sorts an inventory into named bins. `items p1..p8: words` names the things (one label for all, or one per id split by `;`); `items 40: word` is a count with no names, drawn as small squares. Each `bin role id "Label": the rule | a second line` is one bin, coloured by its role. In a step, `into <bin>: p1, p2..p4` drops those things, or `into <bin>: 12` drops the next 12 left. The block works out the count of each bin, the leftover in the inventory and a running total, and draws them: every thing has one place in the inventory and one reserved slot in its bin, so nothing moves between steps. A narrow screen stacks the bins.

Library returns (one trolley run)
Returned books: 9 books in the inventory (Atlas, Birds, Cooking, Dunes, Engines, Fungi, Gardens, Harbours, Insects). Bins: Science (shelves 500 to 599); Reference (stays in the building); Home (goes back to a branch).
1. Science: Natural history goes to the science shelves.
   Into Science: Birds, Dunes, Fungi, Insects (4 in it now).
   Total: 4 of 9 in bins, 5 left.
2. Reference: Two heavy books stay in the building.
   Into Reference: Atlas, Engines (2 in it now).
   Total: 6 of 9 in bins, 3 left.
3. Branch: Three go back to a branch.
   Into Home: Cooking, Gardens, Harbours (3 in it now).
   Total: 9 of 9 in bins, 0 left.
4. Done: Every book has a bin; the inventory is empty.

The same block with many unnamed things: each square is one thing, the counts do the talking.

Seed packets (60 packets, sorted by season)
Packets by season: 60 packets in the inventory. Bins: Spring (sow in March); Summer (sow in June); Autumn (sow in September).
1. Spring: The first batch is spring seed.
   Into Spring: 24 packets (24 in it now).
   Total: 24 of 60 in bins, 36 left.
2. Summer: Then summer seed.
   Into Summer: 20 packets (20 in it now).
   Total: 44 of 60 in bins, 16 left.
3. Autumn: Twelve go to autumn; four are left over.
   Into Autumn: 12 packets (12 in it now).
   Total: 56 of 60 in bins, 4 left.

A thing can drop again in a later step: it **moves** to another bin, and its old place stays as a dashed outline. `show c` in step 2 makes bin c appear there (its place is reserved from the start); `light c: words` lights a bin with a note in it. `ledger: Photo | Album` (or `... | Album from 0` to number the bins from 0) adds a list of every thing with the number of its bin in each step; a move reads `1 → 3` in the warning tone. A long label wraps inside its chip; it is never cut. `inventory: off` drops the inventory frame when everything is binned in step 1.

Photo albums (nine photos, re-sorted)
Albums: 9 photos (Beach · sunny, Beach · dusk, Hike · summit, Hike · lake, City · night, City · market, Beach · kite, Hike · camp, City · bridge). Bins: 1. Album 1 (the first sort); 2. Album 2 (the first sort); 3. Album 3 (added in step 2), from step 2.
1. Two albums: Nine photos sit in two albums.
   Into Album 1: Beach · sunny, Beach · dusk, Beach · kite, Hike · summit, Hike · lake (5 in it now).
   Into Album 2: City · night, City · market, Hike · camp, City · bridge (4 in it now).
   Total: 9 of 9 in bins, 0 left.
2. Three albums: A third album appears and four photos move to it.
   Album 3 comes in.
   Into Album 3: Hike · summit, Hike · lake, Hike · camp, City · bridge (4 in it now; moved from Album 1, Album 2: Hike · summit, Hike · lake, Hike · camp, City · bridge).
   Total: 9 of 9 in bins, 0 left.
   Album 3: four photos move here.

Animation: bins

A bins: block sorts an inventory into named bins. items p1..p8: words names the things (one label for all, or one per id split by ;); items 40: word is a count with no names, drawn as small squares. Each bin role id "Label": the rule | a second line is one bin, coloured by its role. In a step, into <bin>: p1, p2..p4 drops those things, or into <bin>: 12 drops the next 12 left. The block works out the count of each bin, the leftover in the inventory and a running total, and draws them: every thing has one place in the inventory and one reserved slot in its bin, so nothing moves between steps. A narrow screen stacks the bins.

Library returnsone trolley run1 / 4

Library returns (one trolley run) Returned books: 9 books in the inventory (Atlas, Birds, Cooking, Dunes, Engines, Fungi, Gardens, Harbours, Insects). Bins: Science (shelves 500 to 599); Reference (stays in the building); Home (goes back to a branch). 1. Science: Natural history goes to the science shelves. Into Science: Birds, Dunes, Fungi, Insects (4 in it now). Total: 4 of 9 in bins, 5 left. 2. Reference: Two heavy books stay in the building. Into Reference: Atlas, Engines (2 in it now). Total: 6 of 9 in bins, 3 left. 3. Branch: Three go back to a branch. Into Home: Cooking, Gardens, Harbours (3 in it now). Total: 9 of 9 in bins, 0 left. 4. Done: Every book has a bin; the inventory is empty.

Natural history goes to the science shelves.

The same block with many unnamed things: each square is one thing, the counts do the talking.

Seed packets60 packets, sorted by season1 / 3

Seed packets (60 packets, sorted by season) Packets by season: 60 packets in the inventory. Bins: Spring (sow in March); Summer (sow in June); Autumn (sow in September). 1. Spring: The first batch is spring seed. Into Spring: 24 packets (24 in it now). Total: 24 of 60 in bins, 36 left. 2. Summer: Then summer seed. Into Summer: 20 packets (20 in it now). Total: 44 of 60 in bins, 16 left. 3. Autumn: Twelve go to autumn; four are left over. Into Autumn: 12 packets (12 in it now). Total: 56 of 60 in bins, 4 left.

The first batch is spring seed.

A thing can drop again in a later step: it moves to another bin, and its old place stays as a dashed outline. show c in step 2 makes bin c appear there (its place is reserved from the start); light c: words lights a bin with a note in it. ledger: Photo | Album (or ... | Album from 0 to number the bins from 0) adds a list of every thing with the number of its bin in each step; a move reads 1 → 3 in the warning tone. A long label wraps inside its chip; it is never cut. inventory: off drops the inventory frame when everything is binned in step 1.

Photo albumsnine photos, re-sorted1 / 2

Photo albums (nine photos, re-sorted) Albums: 9 photos (Beach · sunny, Beach · dusk, Hike · summit, Hike · lake, City · night, City · market, Beach · kite, Hike · camp, City · bridge). Bins: 1. Album 1 (the first sort); 2. Album 2 (the first sort); 3. Album 3 (added in step 2), from step 2. 1. Two albums: Nine photos sit in two albums. Into Album 1: Beach · sunny, Beach · dusk, Beach · kite, Hike · summit, Hike · lake (5 in it now). Into Album 2: City · night, City · market, Hike · camp, City · bridge (4 in it now). Total: 9 of 9 in bins, 0 left. 2. Three albums: A third album appears and four photos move to it. Album 3 comes in. Into Album 3: Hike · summit, Hike · lake, Hike · camp, City · bridge (4 in it now; moved from Album 1, Album 2: Hike · summit, Hike · lake, Hike · camp, City · bridge). Total: 9 of 9 in bins, 0 left. Album 3: four photos move here.

Nine photos sit in two albums.