-
-
Notifications
You must be signed in to change notification settings - Fork 660
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
…ments - add `DEPRECATED_KEYWORD_ARG` to use in cases where you accept a deprecated argument but you suggest the user to move to the new one. - changed `invert` to `reverse_dir` argument in `color_map_scale` - changed some helper text - restored `cumlative` as deprecated argument - add old functions as deprecated: `add_hline_series` and `add_vline_series`
- `mvGroupBarSeries` to `mvBarGroupSeries` and change its parameters - `mvTag` to `mvAxisTag`, together with `add_axis_tag` instead of `add_plot_tag`. Also now it is a type 1 item. - change some parameters' names - reintroduce removed parameters as DEPRECATED and changed other parameters' names in `add_plot`, `add_axis_plot` and `add_label_series` - change `no_outliers` to `outliers` in Histograms - reintroduce deprecated `is_plot_queried` and `get_plot_query_area`
…eters - add style variables: `TabBorderSize`, `TabAngledHeadersAngle`, `TableAngleHeaderTextAlign` - fix `angled_header` parameter for TableColumn - effectively reactivate `frame_padding` in `ImageButton` - fix typo in `ImGuiStyleVar_TabBarBorderSize` - add some `span_` parameters to `tree_node` and added them to Demo (others still need to be tested) - update ProgressBar documentation to tell the user the possibility to enable indeterminate progress bar - update ImGui backend to 1.90.6
A note on key modifiers in the plot (this seems to be the only place where we can pass modifiers): While it might look natural to pass It would be even better to modify the code so that |
- fix typos and remove useless comments - restore old documentation - revert BOM changes - revert adding of `set_anti_aliasing` function in favour of adding new parameters to `configure_app` - change documentation of some parameters - remove useless variables like `unsaved_document` - fix "Mouse clicks count" so that now shows the number of counts and not the button creating them - implement `_query_dirty` to make the query rects behave correctly inside plots and fix callback for them - change `DEPRECATED_KEYWORD_ARG` parameter - hide redundant window in `StackWindow` - fix bug related to tooltip with angle headers - restore missing Docking style colors
This breaks the old behavior of having multiple Y axes of type v-ein/DearPyGui-fixes@c62d78d...bugfix/auto-y-axes In addition, the fix removes Here's a script to test it all: import dearpygui.dearpygui as dpg
dpg.create_context()
dpg.create_viewport(title=f"Test - {dpg.get_dearpygui_version()}", width=500, height=750)
with dpg.window(label="Old way"):
with dpg.plot():
dpg.add_plot_axis(dpg.mvXAxis)
dpg.add_plot_axis(dpg.mvYAxis, label="Y1")
dpg.add_plot_axis(dpg.mvYAxis)
dpg.add_plot_axis(dpg.mvYAxis, label="Y3")
if hasattr(dpg, "mvYAxis2"):
with dpg.window(label="New way", pos=(0, 350)):
with dpg.plot():
dpg.add_plot_axis(dpg.mvXAxis)
dpg.add_plot_axis(dpg.mvYAxis, label="Y1")
dpg.add_plot_axis(dpg.mvYAxis2)
dpg.add_plot_axis(dpg.mvYAxis3, label="Y3")
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context() (The label on Y2 is omitted deliberately in order to test label assignment). |
So you're telling to just put in the explanation of the parameters that you can disable that feature by just putting -1? (Ignoring the alternative of modifying implot itself) Otherwise tell me if I got it wrong |
Yeah, kind of that. We can even define a new constant, like setup.about = "Adds a plot which is used to hold series, and can be drawn to with draw commands. For all _mod parameters use mvKey_ModX enums, or mvKey_ModDisabled to disable the modifier."; |
…r fixes - Remove hideable arguments in `add_table` in demo - Improve documentation and change some parameters' names - Remove `disabled` parameter in `add_table_column` - Update state of tooltip when not shown - Change type of `decimalPoint` - Restore old `Mx` instead of `ImPlot::GetCurrentContext()->Style.LineWeight` - Remove useless performance improvement in `GetItem`
… widgets Also, improve internal handling of flags and names of axes together with slight changes to parameters default values
I'm done with my "first pass" through the changes. Once all comments I added above get resolved in this way or that, I'm going to scan through the changes once more (faster this time) and see if we still have any issues. |
- fix `add_text_point` parameters, now accepting single values instead than arrays (only supports double now) - change `opposite` parameter name and `axis_opposite` parameter name - add `add_text_point` and "Ordering Axes Plot" in demo
- handle `disable` group state from `enable` parameter - always update `lastFrameUpdate` of tooltip - improve build script
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.