// THE FINALE'S DETAILED DIET RUNS (module `runs-finale`, region `runs-finale`): // with `deck.finale.dietRuns: true`, the whole record of his diets drawn large // in the finale's timeline panel under the rail -- every run from the earliest // row, the empty years a marked break, the stops and the medication marked, // his stated weights over it, the longest runs and the one still going // labelled (chrome-runs-finale.mjs, the measure slice's `record`). A window over // the finale's, laid over it; off by default. import path from "node:path"; import { snapWindow } from "../deck.mjs"; import { recordOf, runsFinaleGeometry, runsFinaleHtml, runsFinaleWanted } from "../chrome-runs-finale.mjs"; import { assertRegion, defineModule } from "./contract.mjs"; const drawn = (schedule, render) => !!schedule?.finale && runsFinaleWanted(render) && !!recordOf(schedule) && !!runsFinaleGeometry(schedule, render); export default defineModule({ id: "runs-finale", version: 1, z: 94, kind: "overlay-window", slot: "full", title: "Diet runs in the finale", summary: "The finale's detailed diet record: every run from the first row a bar in its diet's ink, the empty years a break, the stops and medication marked, his weights over it, the long runs and the open one labelled.", docs: { heading: "Diet runs in the finale", intro: "With `deck.finale.dietRuns: true` (and a measure ledger with a regime track), the finale's timeline panel -- under the large rail's track, the rail's width, down to the panel's foot: with the weight layer (120, 202) 1704×220 at 1080p, the track staying where its labels put it and the timeline taking the room under it (up to `FINALE_SHARE.max`); without it 1704×122 -- carries the WHOLE record of his diets (the measure slice's `record`, diet-record.mjs: every regime row in scope, on camera or not, through the state's own rule): each run a bar in its diet's ink on a time axis from the earliest row; a stretch of more than two years with nothing on record squeezed to a marked break (\"2013–2018\"), and a run whose end the record does not have fading into it; a row that stopped a diet a grey tick under the bars, one naming the medication (GLP-1) a purple one; his stated weights a light line over the bars, the weights the video marks (`marks`: his heaviest as THE peak) and his low as labelled dots on it; the run still going and the longest ones labelled in two rows under the bars where they fit -- the diet's word (the run's own name when its row gives one: \"WEIGHT WATCHERS\"), its number when the cut showed it (\"DIET #6\", the shelf's), its dates and its days, the open one \"N days and counting\" to the in-record date. It sweeps in left to right over 2.6 s after the finale's grow, each label as the sweep reaches it, then holds; it stands clear of the side video, the lower column's instruments and the promise clock. It needs `deck.finale.railLabels` `sections` or `none` (the pips' labels and dates use that space) and at least 100 px under the rail.", rows: [ ["`deck.finale.dietRuns`", "`true` · `false` · `{weights, marks, low}` · default `false`", "`umtool look

deck.finale.dietRuns=true`"], ["`deck.finale.dietRuns.weights`", "`applied` · `said` · `false` · default `applied`: the WEIGHT LAYER over the bars on the dial's scale (the panel 218 design px, the finale's timeline taking that room under the track) -- every weight he gave (a `current` or `past` row with a number) at the day it APPLIED (its asOf, else its date; `said`: the day he said it). Given at the time: solid, joined -- his claimed trajectory (a bound like \"over 240\" is a point, not joined). Told 30 days or more after it applied: hollow, with a thin leader to a tick at the day he said it, so a retold weight piles up at one period from its tellings. `>`/`<` a caret, `≈` a ring, a range a bar. A loss or gain (`delta`) and \"N over\" (`overweight_by`) name no weight the ledger resolves: left out (the record counts them, `record.leftOut`). `false`: the light line of his stated weights alone", "`umtool look

deck.finale.dietRuns='{\"weights\":\"said\"}'`"], ["`deck.finale.dietRuns.marks`", "up to 8 `{row, label, peak?}`: a dot on the weight line at the row's day (its asOf, else its date) and value, the label -- his words, at most 60 characters -- and the month beside it; THE peak (the one marked `peak`, else the heaviest marked) a size up in the needle's red. A row the ledger lacks is left out", "`umtool look

deck.finale.dietRuns='{\"marks\":[{\"row\":\"w21\",\"label\":\"his heaviest · \\\"almost 400\\\"\"}]}'`"], ["`deck.finale.dietRuns.low`", "`true` · `false` · its label · default `true`: the lowest weight he stated (never a bound like \"over 240\"; of one weigh-in told twice the same day, the fuller: 291.5 over \"291.\") marked in the accent, \"his low · 291.5\"", "`umtool look

deck.finale.dietRuns='{\"low\":false}'`"], ], }, region: "runs-finale", // In the finale's page, out with it: full-frame.mjs `ownFade`. fullFrame: { ownFade: true }, workers: "narrow", noun: "the finale's diet runs'", on: drawn, check: (schedule, render) => { if (!schedule?.finale) return "the finale's diet runs need a schedule with a finale (a clip with layout \"finale\")"; if (!runsFinaleWanted(render)) return "the finale's diet runs are off (render.chrome.deck.finale.dietRuns)"; if (!recordOf(schedule)) return "the finale's diet runs need the measure slice's diet record (a measure ledger with a regime track, and render.chrome.deck.measure)"; if (!runsFinaleGeometry(schedule, render)) return "the finale's diet runs need 100 px under the large rail (a larger deck.finale.timelineShare)"; return null; }, window: (schedule, { fps, total }) => snapWindow({ segment: "runs-finale", from: schedule.finale.from, to: schedule.finale.to }, { fps, total }), names: ({ preview }) => ({ project: `runs-finale${preview ? "-preview" : ""}`, stem: "runs-finale" }), async page(ctx) { const fonts = await ctx.fonts({ regular: "DeckSans", bold: "DeckSansBold" }, { strict: true }); return runsFinaleHtml(ctx.schedule, ctx.render, ctx.window, { fonts }); }, /** Over the finale's window, laid at its own second. */ regions(schedule, { render, outDir, shift = 0, clip = null }) { const f = schedule?.finale; if (!f || !drawn(schedule, render)) return []; const g = runsFinaleGeometry(schedule, render); const fps = Number(schedule.fps ?? render.fps); const s = snapWindow({ segment: "runs-finale", from: f.from, to: f.to }, { fps, total: schedule.total }); if (clip && !(s.from < clip.at + clip.dur && s.to > clip.at)) return []; return [assertRegion({ name: "runs-finale", frames: path.join(outDir, "chrome", "runs-finale-frames"), ...g, offset: s.from - shift, frameCount: s.frames, window: s, }, "window")]; }, play: { clock: "cut", ready: "runs-finale:ready" }, // A window of the cut, as the finale's: its frame n is cut time `from` + n / fps. frameKeys: { data: "runs-finale-data", omit: ["init", "cues", "from", "dur"], offset: "from" }, });