Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Demos & Tutorials

The demos of Dear ImGui Bundle, by category, as in its demo launcher (the “Demos” page of the explorer, demo_imgui_bundle, or python -m imgui_bundle.demos_python.demo_immapp_launcher). Most of them run in your browser, in the Python playground; some also exist in C++, in the interactive explorer.

In each card, ▶︎ Run opens the demo in your browser, and Code shows its source, on GitHub.

Start here

The bundle in ten minutes: what it is, first apps, and a few lines that do a lot.

What is an Immediate GUI

What is an Immediate GUI

With Dear ImGui, your GUI code is simple and direct: no widget trees, no callbacks, no state synchronization.

More

You call functions to create widgets, and they return the current value. That’s it.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Hello world, in two lines

Hello world, in two lines

ImmApp opens the window, runs the loop, and calls your GUI function at every frame: immapp.run(gui) is all it takes.

More

Add widgets to that function, and you have an app. The C++ version is three lines.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

A parametric curve

A parametric curve

Turn the knobs, or click Random: the curve follows at once.

More

At every frame, the GUI function draws the plot with ImPlot and the knobs with imgui-knobs, and reads their values right there. No callbacks, no widget objects: that is the immediate mode.

Uses: ImPlot, knobs

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

A plot and markdown, in a few lines

A plot and markdown, in a few lines

A cosine wave moves in an ImPlot plot, under a text written in markdown.

More

Both are add-ons, activated in one call: immapp.run(gui, with_implot=True, with_markdown=True). A good start for a small app.

Uses: ImPlot

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Assets and add-ons

Assets and add-ons

Load images and icons from your assets folder, and use two add-ons: markdown and ImPlot.

More

A markdown editor with a live preview, and a pie chart whose values you can drag. Tick More info under each part to see how it is done. The add-ons are activated with immapp.AddOnsParams.

Uses: ImPlot

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

A beating heart

A beating heart

A heart curve drawn with ImPlot beats at the rate set by a knob from imgui-knobs.

More

A few lines of Python: a parametric curve, scaled by a pulse at each frame. Turn the knobs to change the heart rate, or its thickness.

Uses: ImPlot, knobs

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Butterfly effect, in a few lines

Butterfly effect, in a few lines

Two trajectories of the Lorenz system start almost at the same point, then drift apart: chaos in action.

More

Drawn in 3D with ImPlot3D. Sliders change the system’s parameters and the gap between the two starting points; Reset starts them over.

Uses: ImPlot3D, ImGuiKit

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Interactive manuals

Dear ImGui, ImPlot, ImPlot3D, ImAnim and ImGuiKit: all their features, section by section, with the code beside.

Dear ImGui: the interactive manual

Dear ImGui: the interactive manual

Every widget and feature of Dear ImGui, section by section, with the Python and C++ code of each beside it.

More

From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImGui

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImPlot: the interactive manual

ImPlot: the interactive manual

Every kind of plot of ImPlot, section by section, with the code of each beside it.

More

Lines, scatter, bars, heatmaps, histograms, real-time plots and more, in Python and C++. From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImPlot

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImPlot3D: the interactive manual

ImPlot3D: the interactive manual

The 3D plots of ImPlot3D, section by section, with the code of each beside it.

More

Lines, scatter, surfaces, meshes and more, in Python and C++. From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImPlot3D

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImAnim: the interactive manual

ImAnim: the interactive manual

The animations of ImAnim, section by section, with the code of each beside it.

More

Tweens, easings, oscillators, delays, callbacks, stagger, loops and chains, in Python and C++. From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImAnim

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImGuiKit: the interactive manual

ImGuiKit: the interactive manual

The additions of ImGuiKit to Dear ImGui, section by section, with the code of each beside it.

More

Em units, rows that fill, aligned groups, label columns, a help marker for mouse and touch, a segmented switch, in Python and C++. From Dear ImGui Explorer, the interactive manual for Dear ImGui and its libraries.

Uses: ImGuiKit

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Build an app

Layouts, docking, backgrounds, fonts, testing: what a real application needs.

Resizable panels with child windows

Resizable panels with child windows

Learn how to create resizable adjacent panels, using child windows.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Dockable windows

Dockable windows

Hello ImGui provides a docking system: define named dock spaces, then assign windows to them.

More

Windows can be dragged, tabbed, and rearranged by the user.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

A full app: docking, fonts, logs

A full app: docking, fonts, logs

A template for a real application, built with Hello ImGui: copy it and start from there.

More

Dockable windows with several layouts, colored fonts and emojis, a log window, a status bar, toolbars, menus and a theme chooser. Your settings are saved, and restored at the next start. The code is heavily commented.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Power save when idle

Power save when idle

When nothing happens, Hello ImGui lowers the frame rate to spare the CPU: after 3 seconds, the live plot and the spinner become choppy.

More

Content that changes on its own says so with hello_imgui.set_item_is_live(), and keeps the full speed while it is visible. The idling settings are global.

Uses: ImPlot, toggles, spinners

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Chinese and other non-Latin fonts

Chinese and other non-Latin fonts

The bundled fonts cover Latin, Greek and Cyrillic only: other scripts show up as ???.

More

The fix: load a font that has the glyphs you need. This demo shows two ways, with Noto Sans SC:

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Drag and drop

Drag and drop

Drag a name onto another button to copy it, move it, or swap the two: the radio buttons pick the mode.

More

Each button is both a drag source and a drop target. Adapted from the drag and drop section of the Dear ImGui demo.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Command palette

Command palette

A searchable list of commands, as in VS Code: press Ctrl+Shift+P (Cmd+Shift+P on macOS), or its button.

More

Type a few letters to filter it. One command changes the theme in two steps, another writes to the log below. Learn how to register commands and their callbacks with imgui-command-palette.

Uses: command palette

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Test engine

Test engine

Watch a ImGui Test Engine drive the mouse and the keyboard: it clicks buttons, types text, etc., and checks the results.

More

For scripted runs on top of it (automated tests, pictures, an AI agent at the mouse), see the immapp.testing demo. See the test engine doc.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

immapp.testing: scripted runs

immapp.testing: scripted runs

Easy automated tests with immapp.testing, a thin layer on the test engine: a script drives the app, then exits.

More

The test engine demo shows the engine itself, which runs in the browser too. Here, a test function drives the GUI (it clicks, moves a slider, opens a header) and captures a picture at each step; immapp.testing.run() starts the app, runs the test, then exits. The same recipe gives documentation pictures, and lets an AI agent see and drive the app it writes, with nobody at the mouse (the bundle’s screenshot skills are built on it). See the test engine doc.

Python: ▶︎ Run · Code
C++: Code

Library tours

The libraries in the bundle: full demos, widget tours, showcases.

Themes and theme tweaking

Themes and theme tweaking

Pick a complete look for your app, then fine-tune its colors, rounding and spacing.

More

The complete looks come from Hello ImGui.

Python: ▶︎ Run · Code

Knobs, toggles, spinners and more

Knobs, toggles, spinners and more

Knobs, toggle switches, spinners, a command palette, a dock-like cool bar: widgets beyond Dear ImGui’s own.

More

They come from the libraries in the bundle: imgui-knobs, imgui_toggle, imspinner, imgui-command-palette and ImCoolBar. Also file dialogs: the native ones (portable-file-dialogs), and ImFileDialog, drawn with ImGui.

Uses: knobs, toggles, spinners, cool bar, command palette, file dialogs

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Markdown tour

Markdown tour

Markdown rendered in an ImGui window: styled text, tables, code, images, math, diagrams, admonitions and more.

More

Each section shows its source, ready to copy. The page is a document: a table of contents, a search, headings that fold, and widgets between its renders (a live plot).

Uses: ImPlot

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Markdown: a document with a table of contents and a search

Markdown as a document: a table of contents beside it, links between its sections, and a search (Ctrl+F).

More

Several renders and a section of widgets (a plot) share them, in one scroll area. The search also finds the text of the code blocks and of the collapsed sections. The headings fold.

Uses: ImPlot

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Code editor

Code editor

A code editor widget, with syntax highlighting, multiple cursors, a diff view, filters, annotations and context menus.

More

Each tab shows one feature, and a checkbox shows its source. The editor is ImGuiColorTextEdit, by Johan A. Goossens.

Uses: code editor

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Markdown editor: the source and its live preview

Markdown editor: the source and its live preview

A markdown editor in a few lines: ImGuiColorTextEdit edits the source, rich_md previews it as you type.

More

On a narrow screen (a phone), two tabs show one of them at a time.

Uses: code editor

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Log window

Log window

A log window for your app, with four levels: debug, info, warning and error.

More

Call hello_imgui.log() anywhere, and show the window with hello_imgui.log_gui(). Its colors follow the theme. Adapted from ImGuiAl.

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Terminal

Terminal

A real shell in an ImGui widget: type commands, scroll back through the history, select and copy.

More

The shell runs behind a pseudo-terminal (macOS and Linux), pyte parses its VT100 output, and imgui_bundle.imgui_terminal.TerminalView draws it. A standalone version, with more comments: demos_terminal/demo_terminal_pyte.py.

Desktop only

Uses: terminal

Python: Code

ImmVision: display and inspect

ImmVision: display and inspect

Two ways to show an image (a NumPy array in Python, a cv::Mat in C++).

More

immvision.image_display_resizable() draws it, and you drag its corner to resize it. immvision.image() adds the inspection tools: zoom with the mouse wheel until the pixel values show, pan by dragging, and a button at the bottom right corner opens the settings (colormaps, channels, values).

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: the inspector

ImmVision: the inspector

Call immvision.inspector_add_image() anywhere, for example at each step of an image processing algorithm.

More

Then immvision.inspector_show() shows all the collected images, with the zoom, the pan and the pixel inspection of immvision.image(). Here, two photos at startup; on the desktop, a button adds images of every depth and channel count.

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: images that zoom together

ImmVision: images that zoom together

Image params that share a zoom_key follow each other: pan or zoom one image, and the others move with it.

More

Here, a photo and its three color channels. Pan by dragging, zoom with the mouse wheel. The image is read with OpenCV (pip install imgui-bundle[imgproc]).

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImmVision: image processing, tuned live

ImmVision: image processing, tuned live

A Sobel filter on a photo: change the blur, the derivative’s order and its orientation, and the result updates at once.

More

The original and the filtered image share a zoom key, so they pan and zoom together; the options panel of the filtered image applies colormaps. A button downloads a random photo. The processing is OpenCV’s (pip install imgui-bundle[imgproc]), the display ImmVision’s.

Uses: ImmVision, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Node editor: a color mixer

Node editor: a color mixer

Colors flow through a small graph: pick two colors, mix them, and see the result in the swatches.

More

Each link is drawn in the color it carries. A first graph with imgui-node-editor: the nodes, pins and links that the app owns, and how the user edits them.

Uses: node editor

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Node editor: an image pipeline

Node editor: an image pipeline

An image flows through a graph of filters, and each node shows its result.

More

Change a parameter, and the nodes downstream follow at once. The patterns of imgui-node-editor for a real app: typed pins, links refused with a reason, a node created by dropping a link in empty space, menus, a group.

Uses: ImPlot, ImmVision, node editor, OpenCV

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

ImGuizmo: a 3D gizmo

ImGuizmo: a 3D gizmo

Move, rotate and scale cubes with a gizmo, as in a 3D editor.

More

Pick the operation and the mode (local or world) in the editor panel, drag the gizmo’s handles, and turn the view with the cube at the top right corner. The gizmo is ImGuizmo; the camera matrices are a few lines of plain Python.

Uses: ImGuizmo

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

NanoVG: the full demo

NanoVG: the full demo

The demo of NanoVG, a vector drawing library: shapes, gradients, text, images.

More

Drawn each frame behind the GUI, or into a framebuffer that an ImGui image shows. The scene follows the mouse, and a checkbox blows it up.

Desktop only

Uses: NanoVG

Python: Code
C++: ▶︎ Run · Code

NanoVG: a beating heart

NanoVG: a beating heart

A heart drawn with NanoVG beats in an ImGui image.

More

NanoVG is a vector drawing library; the drawing goes into a framebuffer that the image shows, and a color picker changes the heart’s color. The pattern for any NanoVG drawing inside a GUI: nvg_imgui.render_nvg_to_frame_buffer().

Uses: NanoVG

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

Terminal: several shells in tabs

Terminal: several shells in tabs

Real shells in a tab bar, each behind a pseudo-terminal.

More

Type, scroll the history, select and copy, and open more terminals with the “+” tab. This file is the application only: the widget is imgui_bundle.imgui_terminal’s TerminalView, fed by a LocalShellTransport. Needs pip install "imgui-bundle[terminal]" (pyte), on macOS or Linux.

Desktop only

Uses: terminal

Python: Code

Terminal over SSH

Terminal over SSH

The same terminal widget, fed by an SSH channel instead of a local shell.

More

With paramiko: the shape of a shell on a server or a robot, from a desktop GUI. By default it connects to localhost as you, through the SSH agent; edit the host and the user in the file. Needs pip install "imgui-bundle[terminal]" paramiko.

Desktop only

Uses: terminal

Python: Code

Terminal over a websocket

Terminal over a websocket

The same terminal widget, its bytes carried by a websocket to a pty bridge server.

More

The demo starts the bridge (pty_bridge_server.py); replace it by a shell on a robot, a server or a container, and the GUI stays the same. Needs pip install "imgui-bundle[terminal]" websockets.

Desktop only

Uses: terminal

Python: Code

Python specifics

Async, Pydantic, context managers, the GLFW window, and pure Python backends.

Context managers (imgui_ctx)

Context managers (imgui_ctx)

In Python, with imgui_ctx.begin("Window"): replaces a begin() / end() pair, and the end() can no longer be forgotten.

More

The same exists for child windows, menus, popups, tables, tabs, fonts and styles, and for ImPlot with implot_ctx. Open a section to try it and read its code. See the Python tips.

Uses: ImPlot

Python: ▶︎ Run · Code

Async: compute beside the GUI

Async: compute beside the GUI

The GUI runs as an asyncio task, while a Python loop keeps computing.

More

The window shows both rates: the GUI’s frames per second, and the loop’s computations per second. The loop works in short slices, and yields between them with await asyncio.sleep(...) to share the event loop. See async support.

Python: ▶︎ Run · Code

A GUI beside a Jupyter notebook

A GUI beside a Jupyter notebook

At 60 or 120 frames per second, a live GUI beside your Jupyter notebook while the cells run.

More

In async mode (immapp.nb.start()), another cell keeps computing, as fast as it can, between the frames: stream data into a plot, or train a model and tune it while it learns. The page explains both modes; its video trains a neural network live, its learning rate on a slider.

Page · Video

Control the GLFW window

Control the GLFW window

glfw_utils.glfw_window_hello_imgui() returns the GLFW window that Hello ImGui created.

More

With it, any function of pyGLFW works on your app’s window. Here, buttons maximize, restore, minimize or center it, a slider sets its opacity, and another button makes it ask for attention in the taskbar.

Desktop only

Uses: GLFW

Python: Code

Pydantic models

Pydantic models

Save and load your app’s settings with Pydantic, ImVec2 and colors included.

More

ImVec2_Pydantic, ImVec4_Pydantic and ImColor_Pydantic are the usual ImVec2, ImVec4 and ImColor, usable as fields of a Pydantic model. The demo shows such a model, turns it into JSON, validates it back, and checks that nothing was lost.

Uses: Pydantic

Python: ▶︎ Run · Code

Python backends: GLFW, SDL, pyglet, pygame, wgpu

Python backends: GLFW, SDL, pyglet, pygame, wgpu

With a pure Python backend, you drive the full app loop.

More

See Pure Python backends. Unlike immapp.run(), there is no Hello ImGui here: no DPI handling, themes or assets.

Desktop only

Uses: OpenGL, GLFW, SDL, pyglet, pygame, wgpu

Python: Code GLFW · Code SDL2 · Code SDL3 · Code pyglet · Code pygame · Code wgpu

Plotting with Python

Python’s plotting libraries in the GUI: Matplotlib, seaborn and Cartopy figures, beside ImPlot’s real-time plots.

Matplotlib: a phase portrait

Matplotlib: a phase portrait

imgui_fig.fig() shows a Matplotlib figure in the GUI.

More

Here, the phase portrait of a damped pendulum: the flow of its motion (a stream plot) over its energy (filled contours). Click in the portrait: the pendulum starts from there, and swings beside it.

Uses: Matplotlib

Python: ▶︎ Run · Code

Seaborn: a joint plot

Seaborn: a joint plot

Seaborn draws statistics figures on top of Matplotlib, so imgui_fig.fig() shows them as they are.

More

Here, a joint plot of two correlated variables: their scatter plot in the middle, the distribution of each on its side. Move the correlation: the cloud stretches along a line.

Uses: Matplotlib, seaborn

Python: ▶︎ Run · Code

Cartopy: the shortest route around the globe

Cartopy: the shortest route around the globe

Cartopy draws maps with Matplotlib, in many projections.

More

Here, two routes between two cities: the shortest one (in red, an arc of a great circle), and the straight line that a ruler draws on a flat map (dashed). Pick the cities and the projection: on a flat map, the shortest route looks curved.

Uses: Matplotlib

Python: ▶︎ Run · Code

3D and shaders

Draw behind the GUI or into a texture with OpenGL and WebGL shaders, from Python.

Shader background, minimal

Shader background, minimal

The Mandelbrot set, drawn by a fragment shader behind the GUI.

More

Pyodide only: this demo calls the browser’s WebGL2 API directly, through Python’s js interop. On desktop, you would use PyOpenGL instead.

Browser only

Uses: browser APIs

Python: ▶︎ Run · Code

Shader background: a 3D sea

Shader background: a 3D sea

One source file, two platforms: a shader behind the GUI, with OpenGL on desktop and WebGL in the browser.

More

The shader is the famous “Seascape” from Shadertoy, by Alexander Alekseev. In the browser, the app runs with Pyodide.

Uses: OpenGL, browser APIs

Python: ▶︎ Run · Code

3D sea in OpenGL (desktop)

3D sea in OpenGL (desktop)

Draw anything behind your GUI with OpenGL: here, an animated sea whose waves and colors you can tune.

More

The Seascape shader is by Alexander Alekseev (TDM, 2014). Hello ImGui calls runner_params.callbacks.custom_background at each frame, before the GUI: that is where it draws, with OpenGL (PyOpenGL in Python).

Desktop only

Uses: OpenGL

Python: Code
C++: ▶︎ Run · Code

3D cube in a texture

3D cube in a texture

A 3D cube drawn with WebGL2 into a texture, and shown in the GUI by imgui.image().

More

No copy between the GPU and the CPU at each frame.

Browser only

Uses: browser APIs

Python: ▶︎ Run · Code

In the browser

Deploy to the web, and use the browser’s WebAudio and WebGL from Python.

Minimal HTML page

Minimal HTML page

Dear ImGui Bundle apps can run entirely in the browser using Pyodide.

More

The HTML file below is a complete, self-contained app in about 80 lines - no server, no build step.

Uses: code editor

Python: ▶︎ Run · Code

Touch screens (phones, tablets)

Touch screens (phones, tablets)

The gestures of a phone in the browser: a swipe, a tap, a long press, a pinch, the keyboard.

More

On a mobile or a tablet, Hello ImGui turns a finger into what its user expects: a swipe scrolls, a tap clicks, a held finger opens a context menu, a pinch scales the app (its font) or zooms a plot or an image, two fingers pan, and a keyboard button appears next to a text field.

Uses: ImPlot, ImmVision, ImGuiKit

Python: ▶︎ Run · Code
C++: ▶︎ Run · Code

WebAudio synthesizer

WebAudio synthesizer

A small synthesizer written in Python: play the piano with the mouse or the computer keyboard, or let it play a tune.

More

Pick a waveform, add some echo, and watch the scope. Pyodide only: it plays through the browser’s WebAudio API, via Pyodide’s js interop.

Browser only

Uses: knobs, browser APIs

Python: ▶︎ Run · Code

Interactive science

Explorable lessons in physics, chaos and machine learning, built with the bundle.

Dear ImGui Bundle excels at real-time scientific visualization: 60 frames per second or more, even under load. These demos show it.

Interactive exploration of the Mandelbrot set

Interactive exploration of the Mandelbrot set

Click a point of the Mandelbrot set to see its Julia set.

More

Fly to famous values of c, and zoom into both pictures: near each point, the two sets look alike.

Uses: ImmVision

Python: ▶︎ Run · Code

A tiny neural network learns two spirals

A tiny neural network learns two spirals

Can 16 neurons tell two spirals apart? Watch a tiny neural network learn, live, as in the TensorFlow Playground.

More

Then read how it works, formula by formula, next to its numpy code.

Uses: ImPlot

Python: ▶︎ Run · Code

Rotor run-up monitor: vibration analysis

Rotor run-up monitor: vibration analysis

A simulated three-axis accelerometer sits on the bearing housing of a rotor whose speed sweeps up and down.

More

The dashboard shows what a vibration analyst would watch:

Uses: ImPlot, knobs, toggles, node editor

Python: ▶︎ Run · Code

Simple harmonic motion

Simple harmonic motion

A mass on a spring, a pendulum, a vibrating string: they all follow the same equation.

More

It is the equation of simple harmonic motion (for the pendulum, at small angles). Adjust the mass and the spring stiffness, and watch how the motion changes.

Uses: ImPlot, knobs

Python: ▶︎ Run · Code

Double pendulum

Double pendulum

A double pendulum is a chaotic system: tiny changes in its initial conditions lead to wildly different trajectories.

More

Drag the angles to set initial positions, then release and watch chaos unfold.

Uses: ImPlot, knobs, toggles

Python: ▶︎ Run · Code

Fourier epicycles

Fourier epicycles

Any closed curve can be approximated by a sum of rotating circles (a Fourier series).

More

Adjust the number of circles to see how the approximation improves.

Uses: ImPlot, knobs, toggles

Python: ▶︎ Run · Code

Boids (flocks)

Boids (flocks)

A flock of birds emerges from three simple local rules, with no leader and no plan.

More

Each bird stays apart from its neighbors (separation), flies their way (alignment), and stays with them (cohesion). This is the boids model of Craig Reynolds (1986).

Uses: ImPlot, knobs, toggles

Python: ▶︎ Run · Code

Logistic map

Logistic map

A very simple equation, and yet it can lead to wildly different behaviors, up to chaos.

More

The logistic map, x(n+1) = r * x(n) * (1 - x(n)), models for example the growth of a population with limited resources. Depending on r, it is stable, periodic (in 2-cycles, 4-cycles, etc), or chaotic. Let’s explore this.

Uses: ImPlot, toggles

Python: ▶︎ Run · Code

Health and wealth of nations, 1800 to 2100

Health and wealth of nations, 1800 to 2100

Each bubble is a country: income per person across, life expectancy up, population as the size, world region as the color.

More

Press Play and two centuries go by. Click a bubble to pin it and draw its path through time; pick other indicators for the axes.

Uses: ImPlot, spinners

Python: ▶︎ Run · Code

Medical imaging: a chest CT, its windows, a segmentation

Medical imaging: a chest CT, its windows, a segmentation

A real chest CT, explored as a radiologist would: its slices, its windows, and a region grown from a click.

More

Choose a window preset or drag its bounds on the histogram. Click a structure: the region grows across the slices, and the app measures it and shows it in 3D. A second tab finds the blood vessels of a retina. For research and teaching, not for diagnosis.

Uses: ImPlot, ImPlot3D, ImmVision, knobs, ImGuiKit, OpenCV

Python: ▶︎ Run · Code

Gravitational lensing: a ring, arcs, the Einstein Cross

Gravitational lensing: a ring, arcs, the Einstein Cross

A mass in the foreground bends the light of a galaxy behind it.

More

The left sky shows the galaxy as it is, the right one what we see through the lens. Drag the galaxy (yellow) and the lens (blue), turn the knobs, or start from a preset: an Einstein ring, two images, a giant arc, the Einstein Cross. The thin lines are the critical curve, where the magnification diverges, and its map in the source plane, the caustic: as the galaxy crosses it, images are born or merge. Hover a pixel of the observed sky to see where its light comes from.

Uses: ImPlot, knobs, toggles

Python: ▶︎ Run · Code