diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-11 14:17:51 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-11 14:43:13 -0300 |
| commit | a72831d5c322078260314c305ddd940e4967947d (patch) | |
| tree | 458d51d67bf1c0ce5c79396bd7bb0224450ee3fa /design/motion | |
| parent | 4862e778af7779bbdb047b9c71adfb62add319b2 (diff) | |
| download | computeranim-a72831d5c322078260314c305ddd940e4967947d.tar.gz computeranim-a72831d5c322078260314c305ddd940e4967947d.zip | |
design: rings; nothing from after the moment shown
From the user. A loop is a ring its blocks sit on, upright, an inner loop
a smaller ring touching its parent, a way out leaving along the tangent;
layers stay for functions that are trees of branches; the track is
withdrawn. A graph shows only what the run has done by the moment shown:
counts so far, a block or edge not reached yet drawn quiet, a fold of
what is not reached yet that opens when the run arrives (reach, unfold);
the rule stands in Forbidden for every block. A pane unrolls from its
strip into its whole column and rolls back, so the whole function or the
whole stack can be shown for a beat and a far jump is travelled.
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNCKgYCGiANnEwcEQxa
Diffstat (limited to 'design/motion')
| -rw-r--r-- | design/motion/motion.py | 49 |
1 files changed, 44 insertions, 5 deletions
diff --git a/design/motion/motion.py b/design/motion/motion.py index 66571be..87823ff 100644 --- a/design/motion/motion.py +++ b/design/motion/motion.py @@ -47,11 +47,48 @@ REGIONS = { "boundary": (0, 528, W, 96), "kernel": (0, 624, W, 272), "caption": CAPTION}, "zoom": {"head": HEAD, "source": cols(0, 5, 0, 384), "registers": cols(0, 5, 408, 360), "stack": cols(5, 7, 0, 768), "caption": CAPTION}, - # The working frame (README.md, "The frame"): the two columns, the caption's text alone (not the clock's count - # at its right, which changes every step), the clock, the minimap. The default for any other name. - "frame": {"program": (64, 48, 880, 840), "state": (976, 48, 880, 840), "caption": (64, 906, 1400, 126), - "clock": (64, 894, 1600, 52), "minimap": (1664, 906, 192, 120)}, + # The working frame (README.md, "The frame"): the two columns, each less the strips of its panes' minimaps at + # its right (secondary action, their own regions), the caption's text alone (not the clock's count at its + # right, which changes every step), the clock. The default for any other name. + "frame": {"program": (64, 48, 838, 840), "program strips": (902, 48, 40, 840), "state": (976, 48, 838, 840), + "state strips": (1814, 48, 40, 840), "caption": (64, 906, 1400, 126), "clock": (64, 894, 1792, 52)}, } + + +# Each pane's minimap (README.md, "The map and the minimap"): a strip 40 wide inside its frame at its right, +# under the tag; the source, the disassembly, the stack and a dump (the band's view) have one. A pane's region +# stops at its strip, which is a region of its own, secondary action. +def strips(panes): + out = {} + for name, (x, y, w, h) in panes.items(): + if name in ("source", "disasm", "stack", "view"): + out[name] = (x, y, w - 42, h) + out[name + " strip"] = (x + w - 42, y + 24, 40, h - 26) + else: + out[name] = (x, y, w, h) + return out + + +def split(drawing, view, source, disasm, slots, backtrace=0): + """A split's panes (theme.layout.split): a panel of n rows is 32 + 24 n, 12 apart.""" + ph = lambda n: 32 + 24 * n + out = {"drawing": (64, 48, 880, drawing), "view": (976, 48, 880, view)} if drawing else {} + left, right = 48 + (drawing + 12 if drawing else 0), 48 + (view + 12 if view else 0) + out.update({"source": (64, left, 880, ph(source)), "disasm": (64, left + ph(source) + 12, 880, ph(disasm)), + "registers": (976, right, 880, ph(17)), "stack": (976, right + ph(17) + 12, 880, ph(slots))}) + if backtrace: + out["backtrace"] = (976, right + ph(17) + 12 + ph(slots) + 12, 880, ph(backtrace)) + return out + + +# The working frame by split, its strips apart (`--regions none|beside|subject|blocks`): `blocks` is the +# graph over the program column, the source alone (twenty lines), the disassembly its view, seven rows. +_words = {"caption": (64, 906, 1400, 126), "clock": (64, 894, 1792, 52)} +_blocks = {**split(296, 200, 10, 9, 6), "view": (976, 48, 880, 32 + 24 * 7), "source": (64, 356, 880, 32 + 24 * 20)} +del _blocks["disasm"] +for _name, _panes in {"none": split(0, 0, 14, 17, 8, 4), "beside": split(152, 152, 8, 17, 8), + "subject": split(296, 200, 10, 9, 6), "blocks": _blocks}.items(): + REGIONS[_name] = {**strips(_panes), **_words} PALETTE = ["#9aa6d9", "#e8c46a", "#6fd6e6", "#7fdc9a", "#d59cf5", "#ff6a4a", "#eee6d2", "#17a0b0"] @@ -187,7 +224,9 @@ def report(video, names, counts, soft, sizes, fps): return ev, "\n".join(lines) -WORDS = ("head", "caption", "clock", "minimap") # regions that are not panels +# Regions that are not panels: the words, and the panes' minimaps (secondary action). +WORDS = ("head", "caption", "clock", "minimap", "program strips", "state strips", + "source strip", "disasm strip", "stack strip", "view strip") # One-frame changes that are right, by name: each a test of (region, frame, pixels moved there) that says # whether the POP at that frame is one of its kind. They are counted apart, never silently dropped. |
