Implot integration - introduction & acknowledgements #64
Pinned
pthom
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ImPlot is a fantastic graphing library. I worked on it in 2020, by providing an interactive emscripten demo for it.
Python bindings
Usage of implot with python
Its usage in ImGui Bundle, especially in Python is a joy to use; and the auto-completion works like a charm.
Usage with jupyter notebook
It can also be used inside jupyter notebook
Demo video (40 seconds)
Note: the notebook integration cannot rival the level of integration ipywidgets, but it can be useful in the case of applications for which a Gui is needed inside and outside of jupyter, or in the case of python application for which a later port to C++ is planned.
Technical notes about the python bindings
The generated python bindings follow closely the ImPlot API. See the python bindings stubs (i.e. declaration) inside implot.pyi, and compare it with the implot.h from which they were generated.
The bindings transcription adheres to the following principles:
imgui_bundle.implot
namespace): see for example AxisFlags_ in Python vs ImPlotAxistFlags_ in C++ImPlot is compiled with
IMPLOT_CUSTOM_NUMERIC_TYPES
defined for all types, so that almost all numpy matrices can be handled.Integration inside ImmApp:
ImmApp is a thin extension of HelloImGui that enables to easily initialize the ImGuiBundle addons that require additional setup at startup.
Note: using ImmApp is perfectly optional. It is possible to instantiate a standard ImGui app manually.
Automatic context creation
When using ImmApp, a context for ImPlot can be created/destroyed automatically, by filling an
AddOnsParams
structure.
The code below shows the bare minimum to run an app with implot and immapp:
In C++:
Run a C++ ImPlot app with minimal boilerplate code
The previous C++ example can be compiled standalone by simply adding this CMakeLists.txt from the _example_integration folder
(alternatively, HelloImGui provides a similar quickstart example, which can be used to compile an application where implot's code is provided manually)
Beta Was this translation helpful? Give feedback.
All reactions