No description
Find a file
2020-11-22 15:55:48 +01:00
.github/workflows Update rust.yml 2020-10-30 12:57:02 +01:00
implot-examples Restructured example code 2020-11-22 15:55:48 +01:00
implot-sys Version bump 2020-11-11 20:08:07 +01:00
implot-sys-bindgen Version bump 2020-11-11 20:08:07 +01:00
src Added heatmap support. See comments. 2020-11-15 10:36:51 +01: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 Updated a dependency 2020-11-11 20:09:55 +01: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 stairs plot support 2020-11-08 19:41:51 +01:00

implot-rs

Rust bindings for ImPlot, built by running bindgen on cimplot.

The bindings are currently based on ImPlot version 0.8-WIP (see implot-sys/third-party for the exact commit currently pointed to). The status section below provides detailed information on implementation status.

Docs.rs documentation Tests

Important note: As long as the code is pre-1.0 release, the API is expected to have breaking changes between minor versions. Patch versions should be backwards compatible. After 1.0, semver will be followed more properly.

demo

Requirements

imgui-rs requires minimum Rust version 1.40, so this project does as well by extension. 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

For released versions, see Docs.rs documentation. Make sure you are looking at the right release, since the API is still changing. For the master branch, 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.

Implementation status

Currently a work in progress, coverage of the C++ API is increased steadily. The author is open to collaboration, if you'd like to help, feel free to reach out via a Github issue.

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.

While the raw bindings have versions of most functions for different data types such as 32-bit or 64-bit floats and various integers, the higher-level bindings are currently only created for 64-bit floats.

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

Developer documentation

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.