Code-Driven Presentations: From Static Slides to Interactive Scenes
Learn how to build presentations as reproducible, interactive scene programs rather than isolated slides. This article covers scene graphs, shared timelines, interpolated transitions, interaction states, AI-assisted development, accessibility, performance, and deployment, while explaining where procedural visuals are—and are not—a good fit.
Presentations have traditionally been treated as a sequence of page layouts. That model works well for outlines, tables, and spoken explanations. But when a narrative requires continuous camera movement, objects moving through space, or an audience changing the viewpoint in real time, pagination becomes a bottleneck.
Each slide is an isolated canvas. Transitions are usually predefined switches, media often depends on external image, video, and audio files, and interaction rarely extends beyond advancing to the next slide.
Turning a presentation into a code-driven program is not about replacing every office workflow. It offers a more controllable medium when a story needs continuous space and time, along with reproducible visuals.
Why the Slide Model Limits Expression
Pagination has three structural limitations.
First, time is discrete. Slides do not share a unified clock. Even when animations exist, they usually belong to a single slide’s lifecycle, making it difficult to preserve camera speed, focal length, and spatial continuity across slides.
Second, objects lack persistent identities. A point in a chart disappears when the slide changes. It cannot naturally become a planet, a cursor, or a camera target in the next scene, so visual symbols cannot carry the narrative forward.
Third, assets and logic are separate. When visuals depend on binary media files, their style, resolution, and licensing are constrained by those files. Changing the pacing of a movement often means returning to a design tool and exporting again, rather than adjusting a parameter.
A code-driven approach reverses these constraints: one scene description spans the presentation, an explicit clock drives motion, and graphics, transitions, and even simple tones become computational processes. The presentation “rewriting itself” is then a literal result of state changes updating the scene graph over time.
Define the Presentation as a Scene Program
A maintainable code-driven presentation should have at least four layers.
Scene Layer
The scene layer describes what exists in the world at a given moment: backgrounds, primary objects, annotations, cameras, and lighting parameters.
Instead of scattering pixel-level operations throughout the code, maintain a scene graph. Each node should have an identifier, transforms, and style tokens such as colors, font sizes, line widths, and durations.
Time Layer
The time layer describes how the world changes.
Use normalized progress t, from 0 to 1, or an absolute time in milliseconds as input. Express position, opacity, clipping, and camera parameters as outputs of easing functions. Keyframes can be stored as data rather than implemented through scattered timers.
Transition Layer
The transition layer defines how to interpolate between scene configurations.
A transition is not simply a background replacement. Shared object identifiers connect two configurations, allowing their properties to be interpolated. The same node can move from “a circle in a chart” to “a sphere in space” because its radius, position, and material parameters change—not because two unrelated media clips are played in sequence.
Interaction Layer
The interaction layer describes how audience actions change time or camera behavior.
Hover highlights, orbit dragging, and clicks that explore a data point should all enter explicit states rather than directly changing styles. Otherwise, automatic playback and manual exploration can compete for control.
The structure can be simple and independent of any particular UI framework:
scene = { nodes: [...], camera: { pos, target, fov } }timeline = [ { at, sceneId, duration, easing } ]state = { mode: "auto" | "scrub" | "focus", t, focusId }render(scene, state) // Interpolate and draw each frame based on t
The rendering backend might use vector graphics, a 2D canvas, or a 3D viewport with programmable shaders. The choice depends on whether the presentation needs actual depth, lighting, or large numbers of instances.
The key principle is to separate narrative data from rendering so the same timeline can fall back to a 2D projection on less capable devices.
Camera Movement, Visual Symbols, and Continuity
A cinematic feel comes primarily from continuity, not from the density of effects. Four practical checks help preserve it.
Keep subjects persistent. Objects being explained should have stable identifiers. An item in a bar chart can become a sphere or a geographic marker in the next scene while retaining the same identity. This helps the audience understand that the selected object is being developed further, rather than replaced by an unrelated animation.
Give camera movement a reason. Moving closer, orbiting a subject, or switching to a wide view should serve the information. Zoom in to read a value; pull back to reveal system boundaries. Unmotivated camera movement turns a presentation into a screensaver.
Use familiar presentation symbols as anchors. Cursors, selection boxes, guides, and page numbers can connect scenes with very different visual styles. They remind the audience that this is still a presentation: material that can be paused and questioned, not just a finished film.
Control changes in spatial scale. A transition from a chart to a planet can work, but it needs one or two intermediate stages—for example, from a data point to a marker on Earth’s surface, then to an orbital view. Without them, spatial relationships become difficult to follow and the information loses continuity.
Collaborating with AI: Constrain the Goals, Not Every Visual Choice
Large language models are useful for translating narrative intent into a runnable frontend. They should not independently define business facts without human review.
An effective division of responsibility is straightforward: people own the argument, data definitions, and prohibited actions; the model handles scene decomposition, motion, and code structure.
Prompts should be concise and concrete rather than overloaded with visual adjectives. Specify:
- The topic and sequence of arguments.
- Required data and units.
- Total duration or number of scenes.
- Keyboard operability.
- No requests for external image or font files.
- The ability to pause all motion.
Visual style can remain flexible, allowing the model to work within a shared token system. Those tokens must still be editable: the number of primary colors, corner radii, and maximum number of simultaneously moving elements, for example. This turns “good taste” into reviewable constraints instead of an outcome that depends on luck.
Acceptance testing should focus on four questions, not whether the result looks impressive:
- Can it reproduce the same result offline after a refresh?
- Does scrubbing to any point produce the same state as automatic playback?
- Is the keyboard focus order complete?
- Is the main information still readable at a laptop-sized window width?
A single generation is usually a draft. Quality comes from incremental changes to the timeline and scene data, not from repeatedly rewriting the prompt with more dramatic adjectives.
Compute and latency are engineering budgets. Long presentations consume substantial context and generation time, so divide the work by scene: first create the outline and data, then implement each scene’s rendering, and finally unify the transitions.
Do not ask a model to fill in unverified numbers. It can arrange data and animate it; it must not invent metrics.
The Limits of Procedural Visuals
Generating graphics, simple waveforms, and transitions in code offers several advantages: no external media assets, a consistent style, and changes that are easy to review in version-control diffs.
The limitations are equally clear. Photorealistic textures, human performances, and complex musical arrangements cannot be reliably replaced by a few lines of code.
If the narrative requires real footage, document its source and licensing and treat it as an optional layer. Wherever possible, keep the central argument driven by vectors, annotations, and data so a lost network connection does not leave the presentation blank.
Make 3D Serve the Information
Depth, occlusion, and perspective can hide labels. Important conclusions need a fallback that does not depend on perceiving depth, such as values in a sidebar or a small 2D chart.
Motion must also respect accessibility:
- Provide a reduced-motion option.
- Do not use flashing frequency as the sole way to convey meaning.
- Maintain sufficient color contrast for reading.
- Make automatic playback pausable.
Control Per-Frame Work
Batch drawing operations, limit particle and light counts, and avoid running physics simulations for scenes that are not visible.
Use one main loop for the timeline rather than an uncontrolled timer for every element. On low-end devices, monitor frame times. If frame drops persist, reduce instance counts or disable post-processing instead of allowing the entire page to stall.
Data, State, and Presentability
Once a presentation becomes programmable, it can drift toward something that is easy to watch but difficult to explain.
Give each scene one conclusion that stands on its own. Annotation text in the code should agree with the spoken script.
Normalize data before it enters the scene. Store missing-value information, units, and time ranges in the data objects, and have the rendering layer read those fields. When an interaction focuses on a node, update the explanatory text along with the highlight. Otherwise, the visuals may move forward while the conclusion remains stuck in the previous scene.
The state machine should include at least:
- Automatic playback.
- Manual scrubbing.
- Focus on an individual object.
- Ended.
During focus, pause the global clock or advance only local animations. Resume playback when focus ends. This prevents automatic camera movement from competing with the presenter during questions and answers.
A state-transition table is easier to maintain than layers of conditional logic inside click handlers, and makes it less likely that later changes will introduce unintended jumps.
Deployment and Team Workflows
These presentations are essentially static assets plus client-side logic, making them suitable for delivery as shareable single-page applications.
Place build artifacts in object storage or on a static site, and use content delivery to accelerate access. Associate each narrative revision with a version number so it can be rolled back.
Logging and monitoring generally need to cover loading failures and script errors. A presentation does not require a complex backend of its own. If recording which scene viewers stop on becomes necessary, consider minimal anonymous events with appropriate privacy notice rather than collecting them by default.
For team collaboration, store scene data—text, numbers, and durations—separately from rendering code. Non-developers should not need to edit drawing logic to change a number, and developers should not need to alter data definitions to adjust easing.
Code reviews should check for:
- External resources with unclear origins.
- Infinite loops that cannot be paused.
- Unverified conclusions hard-coded into animations.
Where This Approach Fits—and Where It Does Not
Code-driven presentations work well for explaining product mechanisms, system evolution, spatial or hierarchical relationships, and educational material where audiences need to manipulate parameters themselves.
They are less suitable for formal documents with strict compliance and fixed-layout requirements, materials that must match a printed version pixel for pixel, or situations where animation creates a sense of certainty around facts that have not been verified.
Code can raise the ceiling for expression. It cannot make facts more accurate.
The shift from static slides to interactive scenes is not about making one generated result as spectacular as possible. It is about establishing a scene graph, a shared clock, interpolated transitions, and pausable interaction states.
Within those constraints, AI-assisted coding accelerates the draft, while people remain responsible for the argument, data, and acceptance testing. The creative task then expands from arranging the next slide to designing a narrative program that is reproducible, interruptible, and able to degrade gracefully.
