-
-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updating backend ImGui/ImPlot/ImNodes to latest versions #2275
base: master
Are you sure you want to change the base?
Conversation
- added submodule implot - discontinued docking support - updated documentation - bump imgui and implot versions to ImGui 1.83 and ImPlot 0.13 - renamed variables to match the new backend - added new flags to several plots - Added legacy support for new IO backend - Changed (but not functioning yet) query in plots - Added gl3w to "thirdparty" to avoid dependency in imgui "examples" folder - Modified build process - Added style variable `mvStyleVar_DisabledAlpha` - Added flags to Drag* widgets
For those who're wondering, it wasn't possible to do an incremental update to the latest version mostly because of several problems with the OpenGL libraries. In the end, bump directly to the latest version seemed the most stable and overall best solution. - `str_ends_with` added to check images extensions - assertion enabled - Implemented some of the ImGuiChildFlags - Removed old parameters for plots - Mocked (/commented) several functions so that they can be improved later (ImageButton, ColormapScale, PlotXLines, etc...) - Cast every key input to ImGuiKey - IMPORTANT: Changed GetItem logic because it was deeply broken (for some unknown problem, so maybe the problem is still there) - Removed useless dependencies - Assigned default values in struct for mvPlotConfig "_mod" - Replaced `IM_OFFSETOF` with `offsetof` - Updated ImGui to version 1.90.1 - Updated ImPlot to version 0.16 - Updated ImNodes to latest release - Added TODO.md
- added Infinite Line Series - udpated todo
- Start migration to new IO (deleting GetKeyConstants) - Update all .py files - Updated some of the flags of plots (still not all of them) - Added if statement to BeginTooltip, to mantain consistency with other widgets - Add "SeparatorText()" - Add script to build and generate python files automatically - Started Stack Tool window - IsMouseDoubleClicked() -> GetMouseClickedCount() as suggested in ImGui - Fixed metric windows - Several refactors - New table params
- Removed keys data structure - Fix regression custom series - Fix drawing plots
Also: - added parameters for stairs plot
Also: - removed deprecated keys - fix typo in param of subplots function
- Fix no_outliers typo - Clean .md files - Added flags for InputText
- Added GroupBarSeries - Reimplemented quering in plots - Cleaned internal mvPlotConfig - Fixed demo
- Removed 'area_series` in favor of `line_series` + `shaded` flag - Added remaining flags to plots - Refactor of `XSeriesConfig` structs - Added some mvKeys - Updated documentation mainly for DragTools and ChildWindow
- Added ImageSeriesFlags - Update implot version
- Fixed ColormapScale and added flags - Added DigitalSeries - Updated demo, also removing dependency to numpy
Specifically: - remove build files - restore old `README.md` - add possibility to color query rect in plots - effectively enable `query` parameter in plots - fix deletion of query rects - fix deprecated `add_vline_series` and `add_hline_series` - remove `no_legend` parameter for subplots - correct descriptions - remove useless part with `IMGUI_DISABLE_OBSOLETE_FUNCTIONS` - fix validation of BarGroupPlot paramters
I also considered this approach but it's probably less obvious for the user when he draws one rect, two, three, a dozen and then the first one disappears. The user's attention will probably be on the last rectangle and not on the first one (the first one might already be scrolled away). But, well... who knows :). We could even add an option to control the behavior of the query when the max is reached, but won't that be an overkill?.. |
Yes but then the user won't be able, in any way, to delete all the other rects... anyway no I wouldn't add another option so I'll stick to your version |
Also, remove useless `no_label` parameter from `mvColorMapScale`
Also: - remove `no_label` parameter in colormap scale - fix `PlotStems` flags - fix `share_series` parameter in Subplots
Let's do it in a separate PR. This one is close to completion, let's not add any more stuff. |
Not sure what to do with the commit
I'd recommend to do all that on a separate clone of your repo (not on the copy you use for bugfixing). Technically, steps 1-3 are absolutely safe for your GitHub repo. Step 4 is more of an experiment, but since the branch or tag added in step 1 holds a reference to |
It didn't work even if I managed to create the tag... can I actually just try to delete the modification (some kind of |
You mean, add another commit that rolls back the changes? Yes, that's one of the ways to do it. Least preferrable, but if other ways don't work... well.
That's exactly what I wanted to do: to move the |
Did it! I had to force-push but I have the changes locally so no problem I'd say |
Replying to an earlier comment that I only now got a chance to check:
With the latest commit, seems to be working fine for me. Whichever query rect I double click, that rect gets deleted, not the last rect. |
Would you please also look at this comment - it's feeling a bit forlorn: |
Also rename `resizable_x/y` left from previous change together with a couple of other parameters' name fixes
I'm done with my final pass of code review. Several things (mentioned in recent comments) still need to be fixed. Also, we need to make sure that the PR description contains some text to be used as Release Notes. One more thing that bothers me is that there's going to be a merge conflict when the PR gets closed. To prevent it (or, better, to help Jonathan and relieve him from the need to resolve that conflict 😂), we can merge current The conflict is trivial and is caused by changes to |
Specifically: - Get anti-alias info from `get_app_configuration` - Remove `offset` parameter from `digital_series` - Remove/comment out leftovers - Fix typo - Improve docs
name: Updating backend ImGui/ImPlot/ImNodes
about: Updated backends
title: Updating backend ImGui/ImPlot/ImNodes
assignees: ''
Description
This PR aims to update the
Im*
backends of DPG to way more recent versions.Currently DPG relies on ImGui 1.83 (last commit around May 2021), ImPlot 0.11 (always around that date) and ImNodes (which is the less updated). With this PR we'll have ImGui 1.90.6 and ImPlot 0.17 (for the major updates see below).
Background: ImGui is currently sponsored by big tech companies like Adobe, Blizzard, Activision, etc. so we can expect a lot of improvements with the update (there are already ton of them) and we can expect a lot of people working on the really ugly/hard things like graphical backend libraries.
Why?
In my workplace we are about to ship a product based on DPG. Because of my job, I had to edit the backend and then I found out that what I edited was already modified in the new ImGui and then I also found out that the ImGui version we were relying on in DPG was really old.
We want to stick with this library but I honestly told them that I don't see the point of relying on an almost dead (okay, no, maintenance mode) library, so we decided to either upgrade it or drop it and replace it with something else.
I know that this is quite a huge change, and that several problems can arise but I also think that it can be definitely worth it. Also with this huge community all of these changes can be "easily" tested.
Changes
If you want to take a look to the original releases you can find them here for ImGui and here for ImPlot
You'll probably find better explanations (and images/videos) of what I'm gonna tell you below.
(Keep in mind that many other improvements have been made, but these are the most important ones in my opinion)
OpenGL
(This has been on of the hardest problem to solve actually)
Currently, for the build, DPG relies on gl3w in the examples folder of ImGui. This doesn't sound like a really stable thing and indeed a couple of releases later, that's been removed, so I added gl3w directly in the
thirdparty
folder.Also ImGui decided to make some heavy changings in order to be more cross-platform. One of these, which is also my biggest concern about all of this work, is about the buttons of the keyboard. These are now less than before, and they have been all mapped to predefined values in ImGui. So if someone used them heavily now they could have some problem.
Issues solved (afaik)
New Features
Drag*
widgets there are new parametersdelayed
,no_cursor
,no_fit
,no_inputs
_mod
button to enable certain actions only when that button is pressed (i.e. select, zoom, override, etc...) and you can also decide the zoom rateStackToolWindow
Infinite line series
(just a wrapper for Vertical and Horizontal line series), Digital Series, Group Bar Seriesset_axis_limits_constraints()
andset_axis_zoom_constraints()
dpg.add_plot_tag()
: now there can be tags attached to the axesdpg.add_window()
dpg.add_legend()
ColorMapScale
filter_set
(beta)dpg.add_group()
(equivalent of new featureImGui::BeginDisabled()
)Breaking changes
mvStyleVar
optionsdpg.add_plot_axis(mvXAxis2)
)dpg.add_child_window()
Changes expected in the future from ImGui
Major concerns
Notes
Everything was tested with Valgrind in order to be sure that there wasn't any kind of accidental memory leak (or at least not more than those who were already there).
Don't look at the README.md and TODO.md, it's nothing but development garbage, it'll be removed when merged. In case you'll read the TODO you'll see that there are still many (not too many) things to do. These are all new features and I'd say, almost all little ones, or difficult to implement, so they can actually be implemented later in the future.
My main goal here was to have a real feedback from the most expert users on this work.
I hope I was clear enough!
I'd like to improve this library because I think it's really great, so any kind of suggestion will be well accepted.