Expand description
Dear ImPlot3D - Rust bindings (high level)
Safe wrapper over dear-implot3d-sys, designed to integrate with
dear-imgui-rs. Mirrors dear-implot design: context + Ui facade,
builder-style helpers, optional mint inputs.
§Quick Start
use dear_imgui_rs::*;
use dear_implot3d::*;
let mut imgui_ctx = Context::create();
let plot3d_ctx = Plot3DContext::create(&imgui_ctx);
// In your main loop:
let ui = imgui_ctx.frame();
let plot_ui = plot3d_ctx.get_plot_ui(ui);
plot_ui.begin_plot("3D Plot").build(|plot| {
let xs = [0.0, 1.0, 2.0];
let ys = [0.0, 1.0, 0.0];
let zs = [0.0, 0.5, 1.0];
plot.plot_line_f32("Line", &xs, &ys, &zs, Line3DFlags::NONE);
});§Features
- mint: Enable support for
mintmath types (Point3, Vector3)
§Architecture
This crate follows the same design patterns as dear-implot:
Plot3DContext: Manages the ImPlot3D context (create once)Plot3DUi: Per-frame plot builders and context style scopesPlot3DSetup: Axis and box configuration before native setup locksPlot3DScope: Item submission and plot queries within the drawing closure- Builder pattern: Fluent API for configuring plots
- Type-safe flags: Using
bitflags!for compile-time safety
Re-exports§
pub use plots::*;
Modules§
Structs§
- Axis3D
Flags - Axis flags (per-axis)
- Colormap
Color Index - Zero-based color entry inside the active or selected colormap.
- Colormap
Index - Runtime ImPlot3D colormap index.
- Context
- An imgui context.
- Image3D
ByAxes Builder - Image by axes builder
- Image3D
ByCorners Builder - Image by corners builder
- Image3D
Flags - Image flags
- Item3D
Flags - Item flags (common to plot items)
- Line3D
Flags - Line flags
- Mesh3D
Builder - Mesh plot builder
- Mesh3D
Flags - Mesh flags
- Plot3D
Builder - Configures a 3D plot in the current ImGui window and table cell.
- Plot3D
Context - Plot3D context wrapper
- Plot3D
Data Layout - Data layout used by ImPlot3D item builders.
- Plot3D
Data Offset - Sample-index offset used by ImPlot3D item data access.
- Plot3D
Data Stride - Byte stride used by ImPlot3D item data access.
- Plot3D
Flags - Flags for ImPlot3D plot configuration
- Plot3D
Item Array Style - One-shot array-backed item style overrides for the next ImPlot3D submission. An empty slice uses the native scalar style for that property.
- Plot3D
Item Style - Common style overrides for plot items backed by
ImPlot3DSpec. - Plot3D
Scope - A drawing interface borrowed from an open plot after setup has finished.
- Plot3D
Setup - Axis and box configuration, borrowed before the plot locks setup.
- Plot3D
Ui - Frame access to an ImPlot3D context. Begin a plot to configure axes and submit items.
- Quad3D
Flags - Quad flags
- Scatter3D
Flags - Scatter flags
- Styled
Plot3D - Styled wrapper for plot types that do not store item-style state directly.
- Surface3D
Builder - Surface (grid) plot builder (f32 variant).
- Surface3D
Flags - Surface flags
- Triangle3D
Flags - Triangle flags
- Ui
- Represents the Dear ImGui user interface for one frame
Enums§
- Axis3D
- 3D axis selector (X/Y/Z)
- Colormap
- Built-in ImPlot3D colormaps.
- Marker3D
- Plot3D
Color Element - Colorable ImPlot3D style elements.
- Plot3D
Cond - Condition for setup calls (match ImGuiCond)
- Plot3D
Style Var - A context style variable and its native value type.
Traits§
- Plot3D
Item Flagged - Shared ImPlot3D item-flag builder methods for plot builders backed by
ImPlot3DSpec. - Plot3D
Item Styled - Shared ImPlot3D item-style builder methods for plot builders backed by
ImPlot3DSpec.