2020-10-18 16:30:59 +00:00
|
|
|
|
2020-07-01 17:41:31 +00:00
|
|
|
# implot-rs
|
|
|
|
|
2020-08-08 14:01:51 +00:00
|
|
|
Rust bindings for [ImPlot](https://github.com/epezent/implot), built by running
|
|
|
|
[bindgen](https://github.com/rust-lang/rust-bindgen) on [cimplot](https://github.com/cimgui/cimplot).
|
2020-10-12 15:57:00 +00:00
|
|
|
|
2020-10-31 10:04:13 +00:00
|
|
|
The bindings are currently based on ImPlot version 0.8-WIP (see
|
2020-10-31 10:05:39 +00:00
|
|
|
[implot-sys/third-party](implot-sys/third-party) for the exact commit currently pointed to).
|
2020-10-31 10:04:13 +00:00
|
|
|
The status section below provides detailed information on implementation status.
|
2020-10-18 14:22:37 +00:00
|
|
|
|
2020-10-18 16:30:59 +00:00
|
|
|
[![Docs.rs documentation](https://docs.rs/implot/badge.svg)](https://docs.rs/implot/)
|
|
|
|
![Tests](https://github.com/4bb4/implot-rs/workflows/Tests/badge.svg)
|
|
|
|
|
2020-10-18 14:22:37 +00:00
|
|
|
**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.
|
2020-07-01 19:50:14 +00:00
|
|
|
|
2020-08-08 14:01:51 +00:00
|
|
|
![demo](demo.png)
|
2020-07-01 19:50:14 +00:00
|
|
|
|
2020-08-08 14:01:51 +00:00
|
|
|
## Requirements
|
2020-11-22 15:00:58 +00:00
|
|
|
imgui-rs requires minimum Rust version 1.43, so this project requires at least that. In
|
|
|
|
addition, doc aliases as released in 1.48 (https://blog.rust-lang.org/2020/11/19/Rust-1.48.html)
|
|
|
|
were added, so currently the requirement is 1.48 - if that presents a problem, a workaround
|
|
|
|
good be looked for though. Open an issue if you're in that situation.
|
|
|
|
|
2020-08-23 18:10:24 +00:00
|
|
|
The sys crate compiles implot, so a C++ compiler will also be required.
|
2020-08-08 14:01:51 +00:00
|
|
|
|
2020-09-06 14:59:25 +00:00
|
|
|
## 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
|
2020-10-18 14:22:37 +00:00
|
|
|
For released versions, see
|
|
|
|
[![Docs.rs documentation](https://docs.rs/implot/badge.svg)](https://docs.rs/implot/).
|
2020-11-22 15:04:13 +00:00
|
|
|
Make sure to look at the right release, since the API is still changing.
|
|
|
|
For the master branch, the docs can be built by cloning this repository and then running
|
2020-09-06 14:59:25 +00:00
|
|
|
```
|
|
|
|
cargo doc --open
|
|
|
|
```
|
|
|
|
An effort is made to document everything as it is being added. Feel free to open an issue
|
2020-11-22 15:04:13 +00:00
|
|
|
if documentation is unclear or lacking. Note that doc aliases are being added now, which
|
|
|
|
means one should be able to look for things with the name they have in the C++ code and
|
|
|
|
rustdoc should show the correspondingly-named item. Sometimes this is just a matter of
|
|
|
|
changing camelcase to snake case, other times the idiomatic bindings do things a bit
|
|
|
|
differently.
|
2020-08-08 14:01:51 +00:00
|
|
|
|
2020-10-18 14:22:37 +00:00
|
|
|
## 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.
|
2020-08-30 09:01:28 +00:00
|
|
|
|
2020-08-08 14:01:51 +00:00
|
|
|
At this point, raw bindings are working in implot-sys, and more idiomatic interfaces
|
2020-08-23 19:26:27 +00:00
|
|
|
for plot creation as well a subset of the functionality for plots are implemented.
|
2020-08-23 18:10:24 +00:00
|
|
|
|
2020-10-31 10:04:13 +00:00
|
|
|
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.
|
|
|
|
|
2020-08-23 18:10:24 +00:00
|
|
|
- [x] "BeginPlot"
|
|
|
|
- [x] Basic hello world
|
|
|
|
- [x] Plot flags
|
|
|
|
- [ ] Plotting functionality
|
2020-08-23 18:31:28 +00:00
|
|
|
- [x] Line plot
|
|
|
|
- [x] Text plot
|
2020-09-13 14:09:21 +00:00
|
|
|
- [x] Scatter plot
|
|
|
|
- [x] Bar plot
|
|
|
|
- [x] Vertical
|
|
|
|
- [x] Horizontal
|
2020-11-08 18:41:51 +00:00
|
|
|
- [x] Stairs plot
|
2020-10-11 14:34:10 +00:00
|
|
|
- [ ] Shaded plot
|
|
|
|
- [ ] Stem plots
|
|
|
|
- [ ] Images
|
2020-08-23 18:10:24 +00:00
|
|
|
- [ ] Error bar plot
|
|
|
|
- [ ] Vertical
|
|
|
|
- [ ] Horizontal
|
|
|
|
- [ ] Heatmap
|
|
|
|
- [ ] Pie chart
|
|
|
|
- [ ] Digital data
|
2020-10-31 10:04:13 +00:00
|
|
|
- [ ] Annotations
|
|
|
|
- [ ] Dragline
|
|
|
|
- [ ] Dragpoint
|
2020-10-31 11:05:57 +00:00
|
|
|
- [x] Plot customization
|
2020-08-23 19:26:27 +00:00
|
|
|
- [x] Axis flags
|
|
|
|
- [x] Styling colors
|
2020-08-30 09:01:28 +00:00
|
|
|
- [x] Styling variables
|
2020-09-27 18:21:30 +00:00
|
|
|
- [x] Colormaps
|
2020-10-31 11:05:57 +00:00
|
|
|
- [x] Legend locations
|
|
|
|
- [ ] Plot querying
|
2020-08-23 19:26:27 +00:00
|
|
|
- [x] is hovered
|
|
|
|
- [x] mouse position in plot
|
|
|
|
- [x] plot limits
|
2020-08-30 09:01:28 +00:00
|
|
|
- [x] is queried
|
|
|
|
- [x] get plot query
|
2020-10-18 14:22:37 +00:00
|
|
|
- [x] are axes hovered
|
|
|
|
- [x] Choice of y axis
|
2020-10-31 11:05:57 +00:00
|
|
|
- [ ] Are legend entries hovered
|
2020-08-23 18:10:24 +00:00
|
|
|
- [ ] Utils
|
|
|
|
- [x] Plot limit setting
|
2020-08-30 09:01:28 +00:00
|
|
|
- [x] imgui-rs style safe push/pop stacks
|
2020-09-20 19:47:48 +00:00
|
|
|
- [x] Plot tick setting
|
2020-11-08 14:17:14 +00:00
|
|
|
- [x] Pixel to plot position
|
|
|
|
- [x] Plot to pixel position
|
2020-10-18 14:22:37 +00:00
|
|
|
- [x] Set Y axis setting for subsequent elements
|
2020-11-08 14:17:14 +00:00
|
|
|
- [ ] Input remapping
|
2020-10-18 14:22:37 +00:00
|
|
|
- [ ] Set non-default Y axis ticks and labels
|
2020-08-23 19:26:27 +00:00
|
|
|
- [ ] Plot position and size reading
|
2020-08-23 18:10:24 +00:00
|
|
|
- [ ] Push/pop plotclip rect (?)
|
2020-10-18 14:22:37 +00:00
|
|
|
|
|
|
|
# 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.
|