No description
Find a file
2020-10-11 19:51:01 +02:00
implot-examples Linked context into things, adapted examples. 2020-10-11 16:33:26 +02:00
implot-sys specify cpp standard to compiler 2020-10-11 19:51:01 +02:00
implot-sys-bindgen Pinned imgui dependency to a fixed commit 2020-09-13 13:57:01 +02:00
src Documentation updates, test fixes. 2020-10-11 17:17:29 +02:00
.gitattributes Found linguist-generated, using that instead 2020-08-04 22:15:41 +02:00
.gitignore Initial commit 2020-07-01 19:40:18 +02:00
.gitmodules Added submodule for cimplot and some build code 2020-07-02 21:15:22 +02:00
Cargo.toml Added mutex-based locking mechanism as in imgui-rs 2020-10-11 16:33:26 +02:00
demo.png Updated readme, renamed example 2020-08-08 16:01:51 +02:00
LICENSE Initial commit 2020-07-01 19:40:18 +02:00
README.md Added missing todos to readme. 2020-10-11 16:34:10 +02:00

implot-rs

Rust bindings for ImPlot, built by running bindgen on cimplot. Currently not released on crates.io yet due to a dependency on an unreleased version of imgui-rs. One can still use it as a dependency directly from Git if desired, for example using the line

implot = { git = "https://github.com/4bb4/implot-rs/", rev = "your_favourite_commit" }

The bindings are currently based on ImPlot version 0.7. See the status section below for detailed information on implementation status.

demo

Requirements

imgui-rs requires minimum Rust version 1.40, so this project does as well by extension. Currently a pinned version (66260c123b9a80275bd3a366ef403444db11a676) of imgui-rs is used as a dependency until https://github.com/Gekkio/imgui-rs/pull/339 makes it into a release.

The sys crate compiles implot, so a C++ compiler will also be required.

Examples

Examples are being built in the implot-examples crate in this repo. To try them out, clone the repo, change into the implot-examples directory and try for example

  cargo run --example line_plots

Documentation

Since the crate is not released yet, the documentation is not hosted yet either. You can build it yourself however by cloning this repo and then doing

  cargo doc --open

An effort is made to document everything as it is being added. Feel free to open an issue if documentation is unclear or lacking.

Design approach

This repo tries to follow the approaches and style used in imgui-rs somewhat closely, because implot is to be used within imgui programs, and hence keeping the interfaces and design philosophies close should make it easier to do that.

If you spot any design inconsistencies or paper cuts, feel free to open an issue.

Status

Currently a work in progress. The author is open to collaboration, if you'd like to help, feel free to reach out via a Github issue.

Note that the API is not stabilized yet and expected to change as development progresses. Once there are actual releases on crates.io, semantic versioning will be followed.

At this point, raw bindings are working in implot-sys, and more idiomatic interfaces for plot creation as well a subset of the functionality for plots are implemented.

  • "BeginPlot"
    • Basic hello world
    • Plot flags
  • Plotting functionality
    • Line plot
    • Text plot
    • Scatter plot
    • Bar plot
      • Vertical
      • Horizontal
    • Shaded plot
    • Stem plots
    • Images
    • Error bar plot
      • Vertical
      • Horizontal
    • Heatmap
    • Pie chart
    • Digital data
  • Plot customization
    • Axis flags
    • Styling colors
    • Styling variables
    • Colormaps
  • Plot querying
    • is hovered
    • mouse position in plot
    • plot limits
    • is queried
    • get plot query
    • Choice of y axis
  • Utils
    • Plot limit setting
    • imgui-rs style safe push/pop stacks
    • Plot tick setting
    • Input remapping
    • Set Y axis setting for subsequent elements
    • Plot position and size reading
    • Pixel to plot position
    • Plot to pixel position
    • Push/pop plotclip rect (?)