Skip to content
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

Merged
merged 82 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
a15086f
core: Bump thirdparty versions to ImGui 1.83 and ImPlot 0.13
SamuMazzi Dec 20, 2023
a6bc209
feat (ImPlot): Add mvAxes and fix flags for plots
SamuMazzi Jan 5, 2024
272ff1e
core: Better support for plot mods and added keys
SamuMazzi Jan 8, 2024
807cffd
fix: label axes plots and free error on exit
SamuMazzi Jan 9, 2024
20b57e3
fix: tool metrics not crashing anymore
SamuMazzi Jan 9, 2024
ea49aff
fix (ImPlot): Avoid assert moving SetNextAxesToFit before BeginPlot
SamuMazzi Jan 10, 2024
49f9202
core: Bump thirdparty libraries to latest versions
SamuMazzi Jan 16, 2024
dadbd17
feat (ImPlot): add new plot and several flags
SamuMazzi Jan 17, 2024
23f9736
core: Major update
SamuMazzi Jan 18, 2024
0513f36
core: Changed internal IO handling and bugfixes
SamuMazzi Jan 19, 2024
3b1265a
feat (ImPlot): add plot flags
FabioSpano Jan 19, 2024
a6e3962
fix: Fix bug on exit
SamuMazzi Jan 19, 2024
b24cd38
fix: fix bug flags plots
SamuMazzi Jan 22, 2024
30cae29
feat (ImPlot): Implement set axis limits/zoom constraints
SamuMazzi Jan 22, 2024
42ca0f9
fix: fix crash on exit when there's no viewport
SamuMazzi Jan 23, 2024
39a3863
feat (ImPlot): Add formatter and scales to axes
SamuMazzi Jan 23, 2024
8469a42
core: new feats in ImPlot and new demo
SamuMazzi Jan 23, 2024
b003bf2
core: Update
SamuMazzi Jan 24, 2024
f86b5c7
feat (ImPlot): Enable mods for plots
SamuMazzi Jan 24, 2024
74adcee
core: Add Presentation to MetricsTool and clean code
SamuMazzi Jan 25, 2024
a1f329d
core: update plot section of dpg demo and update todo
FabioSpano Jan 25, 2024
28fd87f
feat (ImPlot): Add mvTag and labels to DragLine and DragPoint
SamuMazzi Jan 26, 2024
acc56c8
core: add subplot and axes to demo's plot section
FabioSpano Jan 26, 2024
dd0f3bc
core: add tools and custom to plot's demo
FabioSpano Jan 29, 2024
b8e007f
core: fix 2d histrogram and bar plots
FabioSpano Jan 30, 2024
938047b
core: update demo and add new plot
SamuMazzi Jan 30, 2024
8b0d64b
core: Update density demo
SamuMazzi Jan 30, 2024
72a6f6b
core: add some widget to demo
FabioSpano Jan 30, 2024
8195941
core: Update shaded plot demo and cleanup
SamuMazzi Jan 30, 2024
b836f65
core: fix Tag on axes and cleanup
SamuMazzi Jan 30, 2024
48de44f
core: fix axes context menu and add Tags demo part
SamuMazzi Jan 30, 2024
7a74b4d
core: Update
SamuMazzi Jan 31, 2024
590d29a
core: Improve ColorPicker options and fix demo
SamuMazzi Jan 31, 2024
4f41092
core: add feature to delete drag rects
FabioSpano Feb 1, 2024
594f8e9
core: Refactor demo and little cleanup
SamuMazzi Feb 1, 2024
074bbda
core: change min and max values of histogram plots to allow for defau…
FabioSpano Feb 2, 2024
7ec0c2d
core: add unsaved_document flag to show a marker if the document is n…
FabioSpano Feb 2, 2024
624d8eb
core: add repeat flag for button to continuosly call the callback whe…
FabioSpano Feb 2, 2024
913f841
feat: add fit_width flag to combo buttons
FabioSpano Feb 2, 2024
e32dc5e
core: change default color of color picker to better show alpha features
FabioSpano Feb 2, 2024
7916241
core: remove thirdparty gl3w_stripped
FabioSpano Feb 5, 2024
a7ea604
core: Refactor and little updates
SamuMazzi Feb 13, 2024
6cd66c9
hotfix: change parameter in demo
SamuMazzi Feb 15, 2024
d4d10dc
feat: add functions to reset constraint/zoom range
SamuMazzi Feb 19, 2024
f9aef3b
fix: fix label series parameters
SamuMazzi Feb 22, 2024
35710f8
feat: add recursive functionality to filter_set
SamuMazzi Feb 26, 2024
629273c
feat: add disabled feature to groups
SamuMazzi Feb 27, 2024
8e91edf
revert: revert "recursive" funcionality of filter_set
SamuMazzi Feb 27, 2024
0542b39
core: remove iostream/cout refs and disable asserts
SamuMazzi Apr 2, 2024
9c11956
core: remove set_decimal_point
SamuMazzi Apr 2, 2024
acb2193
bugfix: fix default argument for mvKey handlers
SamuMazzi Apr 2, 2024
dc0e2de
fix: fix separator behaviour
SamuMazzi Apr 2, 2024
1618e92
core: improve checking of image extensions
SamuMazzi Apr 2, 2024
40d0488
fix: fix typo in disabling asserts
SamuMazzi Apr 2, 2024
f7b4bf2
io: fix keys assignment
SamuMazzi Apr 4, 2024
986f35a
build: improve build script
SamuMazzi Apr 4, 2024
041be16
docking: reintroduce docking functionality
SamuMazzi Apr 24, 2024
e936a4d
plot: introduce `set_anti_aliasing` function
SamuMazzi Apr 24, 2024
9c01f65
core: fix detecting of case-insensitive string compare
SamuMazzi May 6, 2024
a369eca
core: change to arguments of functions and reintroduce deprecated ele…
SamuMazzi May 7, 2024
c46fe7f
plot: change names of functions/parameters and add deprecated ones
SamuMazzi May 9, 2024
b02c729
core: udpate imgui, add style vars and change/add functions and param…
SamuMazzi May 9, 2024
0a4e940
table: fix header label
SamuMazzi May 9, 2024
8d14a61
core: fix few bugs and clean up code/documentation
SamuMazzi May 17, 2024
7f4fe04
core: improve tables, restore `Mx` in mvDrawing, fix tooltip and mino…
SamuMazzi May 21, 2024
2be0449
plots: add `mvKey_ModDisabled` and `show_label` parameter for `drag_`…
SamuMazzi May 21, 2024
a7190e7
plot: add ImPlot submodule
SamuMazzi May 22, 2024
ef1747d
plot: restore `mvAreaSeries` and `query_toggle_mod`
SamuMazzi May 22, 2024
332f99c
core: fix `mvMouseButton X1/X2` and deprecate color parameters for `d…
SamuMazzi May 22, 2024
8ed471e
plot: fix `add_text_point` parameters and update demo
SamuMazzi Jun 6, 2024
e172ea8
core: improve `group` disabled and `tooltip` updating state
SamuMazzi Jun 6, 2024
f606a7d
plot: fix validation for `mvBarGroupSeries`
SamuMazzi Jun 7, 2024
3235db3
plot: rework of `DragRect`
SamuMazzi Jun 21, 2024
31a5363
core: improve query rect in plots and fix descriptions and parameters
SamuMazzi Jun 26, 2024
280517d
plot: add min/max query rects in plots
SamuMazzi Jun 27, 2024
0af53b1
plot: fix `mvBarGroupSeries` and `custom_series` parameter `no_fit`
SamuMazzi Jul 1, 2024
21e8de7
core: update to version 1.90.9
SamuMazzi Jul 9, 2024
c47dcd0
core: remove `DearPyGui_Ext` submodule and update standard `Axis` colors
SamuMazzi Jul 15, 2024
513ea28
core: fix demo, docs and query rects
SamuMazzi Jul 22, 2024
6efc626
core: fix parameters and other improvements
SamuMazzi Jul 24, 2024
f69f06a
core: remove build file and fix demo
SamuMazzi Jul 29, 2024
f80b241
core: bump imgui version to 1.91.0
SamuMazzi Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.idea/
.vs/
.vscode/
out/
cmake-build-debug/
cmake-build-release/
Expand All @@ -11,4 +12,10 @@ __pycache__/
lib_location.txt
version_number.txt
dearpygui.egg-info/
build/
build/
# Ignore only subdirectories
sandbox/*/
src/CMakeFiles/
thirdparty/CMakeFiles/
thirdparty/Makefile
thirdparty/cmake_install.cmake
7 changes: 4 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[submodule "thirdparty/imgui"]
path = thirdparty/imgui
url = https://github.com/ocornut/imgui
branch = docking
[submodule "thirdparty/implot"]
SamuMazzi marked this conversation as resolved.
Show resolved Hide resolved
path = thirdparty/implot
url = https://github.com/epezent/implot
branch = master
[submodule "thirdparty/cpython"]
path = thirdparty/cpython
Expand All @@ -13,6 +17,3 @@
[submodule "thirdparty/freetype"]
path = thirdparty/freetype
url = https://gitlab.freedesktop.org/freetype/freetype
[submodule "thirdparty/DearPyGui_Ext"]
path = thirdparty/DearPyGui_Ext
url = https://github.com/hoffstadt/DearPyGui_Ext
227 changes: 136 additions & 91 deletions dearpygui/_dearpygui.pyi

Large diffs are not rendered by default.

668 changes: 490 additions & 178 deletions dearpygui/_dearpygui_RTD.py

Large diffs are not rendered by default.

78 changes: 73 additions & 5 deletions dearpygui/_deprecated.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

from typing import Union


def deprecated(reason):

string_types = (type(b''), type(u''))
Expand Down Expand Up @@ -42,11 +45,6 @@ def new_func2(*args, **kwargs):

return new_func2

@deprecated("Use 'configure_app(docking=True, docking_space=dock_space)'.")
def enable_docking(dock_space=False):
""" deprecated function """
internal_dpg.configure_app(docking=True, docking_space=dock_space)

@deprecated("Use 'configure_app(init_file=file)'.")
def set_init_file(file="dpg.ini"):
""" deprecated function """
Expand Down Expand Up @@ -258,6 +256,76 @@ def add_same_line(**kwargs):
internal_dpg.capture_next_item(lambda s: internal_dpg.move_item(s, parent=group))
return group

@deprecated("Use: `get_plot_query_rects()`")
def is_plot_queried(plot: Union[int, str], **kwargs):
""" (deprecated function) Returns true if the plot is currently being queried.

Args:
plot (Union[int, str]):
Returns:
bool
"""

return len(internal_dpg.get_plot_query_rects(plot, **kwargs)) > 0

@deprecated("Use: `get_plot_query_rects()`")
def get_plot_query_area(plot: Union[int, str], **kwargs):
""" (deprecated function) Returns the last/current query area of the plot. If no area is available [0, 0, 0, 0] will be returned.

Args:
plot (Union[int, str]):
Returns:
Union[List[float], Tuple[float, ...]]
"""

if rects := internal_dpg.get_plot_query_rects(plot, **kwargs):
return rects[0]
else:
return [0, 0, 0, 0]

@deprecated("Use: `add_inf_line_series(horizontal=True)`")
def add_hline_series(x, **kwargs):
""" (deprecated function) Adds an infinite horizontal line series to a plot.

Args:
x (Any):
label (str, optional): Overrides 'name' as label.
user_data (Any, optional): User data for callbacks
use_internal_label (bool, optional): Use generated internal label instead of user specified (appends ### uuid).
tag (Union[int, str], optional): Unique id used to programmatically refer to the item.If label is unused this will be the label.
parent (Union[int, str], optional): Parent to add this item to. (runtime adding)
before (Union[int, str], optional): This item will be displayed before the specified item in the parent.
source (Union[int, str], optional): Overrides 'id' as value storage key.
show (bool, optional): Attempt to render widget.
id (Union[int, str], optional): (deprecated)
Returns:
Union[int, str]
"""

return internal_dpg.add_inf_line_series(x, **kwargs, horizontal=True)


@deprecated("Use: `add_inf_line_series()`")
def add_vline_series(x, **kwargs):
""" (deprecated function) Adds an infinite vertical line series to a plot.

Args:
x (Any):
label (str, optional): Overrides 'name' as label.
user_data (Any, optional): User data for callbacks
use_internal_label (bool, optional): Use generated internal label instead of user specified (appends ### uuid).
tag (Union[int, str], optional): Unique id used to programmatically refer to the item.If label is unused this will be the label.
parent (Union[int, str], optional): Parent to add this item to. (runtime adding)
before (Union[int, str], optional): This item will be displayed before the specified item in the parent.
source (Union[int, str], optional): Overrides 'id' as value storage key.
show (bool, optional): Attempt to render widget.
id (Union[int, str], optional): (deprecated)
Returns:
Union[int, str]
"""

return internal_dpg.add_inf_line_series(x, **kwargs)


@deprecated("Use: `add_child_window()`")
def add_child(**kwargs):
Expand Down
929 changes: 670 additions & 259 deletions dearpygui/dearpygui.py

Large diffs are not rendered by default.

769 changes: 653 additions & 116 deletions dearpygui/demo.py

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/source/documentation/container-slots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Items are stored in target slots within their parent container.
Below is the breakdown of slots:

Slot 0:
**mvFileExtension**, **mvFontRangeHint**, **mvNodeLink**, **mvAnnotation**, **mvDragLine**, **mvDragPoint**, **mvLegend**, **mvTableColumn**
**mvFileExtension**, **mvFontRangeHint**, **mvNodeLink**, **mvAnnotation**, **mvDragLine**, **mvDragRect**, **mvDragPoint**, **mvLegend**, **mvTableColumn**
Slot 1:
Most items
Slot 2:
Expand Down
18 changes: 11 additions & 7 deletions docs/source/documentation/plots.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ The following commands can be used to control the plot axes limits
* `get_axis_limits(...)`
* `set_axis_limits_auto(...)`
* `fit_axis_data(...)`
* `set_axis_limits_constraints(...)`
* `reset_axis_limits_constraints(...)`
* `set_axis_zoom_constraints(...)`
* `reset_axis_zoom_constraints(...)`

An example demonstrating some of this can be found below:

Expand Down Expand Up @@ -239,11 +243,11 @@ Plots can contain up to Three Y-axis for different data that needs a different s
dpg.add_line_series(sindatax, sindatay, label="y1 lines", parent=dpg.last_item())

# create y axis 2
dpg.add_plot_axis(dpg.mvYAxis, label="y2")
dpg.add_plot_axis(dpg.mvYAxis2, label="y2")
dpg.add_stem_series(sindatax, sindatay, label="y2 stem", parent=dpg.last_item())

# create y axis 3
dpg.add_plot_axis(dpg.mvYAxis, label="y3 scatter")
dpg.add_plot_axis(dpg.mvYAxis3, label="y3 scatter")
dpg.add_scatter_series(sindatax, sindatay, label="y3", parent=dpg.last_item())

dpg.create_viewport(title='Custom Title', width=800, height=600)
Expand Down Expand Up @@ -338,17 +342,17 @@ Querying
--------

Querying allows the user to select a region of the plot by
clicking and dragging the middle mouse button.
holding with the right mouse button and clicking with the left one.

Querying requires setting *query* to **True** when creating the plot.

The callback of the plot will run when the plot is being queried.

The query area is sent through the *app_data* argument as *(x_min, x_max, y_min, y_max)*.
All the query areas are sent through the *app_data* argument as
*[(x_min, x_max, y_min, y_max), (x_min, x_max, y_min, y_max), ...]*.

It is also possible to poll the plot for the query area by calling:
:py:func:`get_plot_query_area <dearpygui.dearpygui.get_plot_query_area>` and
:py:func:`is_plot_queried <dearpygui.dearpygui.is_plot_queried>`.
It is also possible to poll the plot for the query areas by calling:
:py:func:`get_plot_query_rects <dearpygui.dearpygui.get_plot_query_rects>` and

Below is an example using the callback

Expand Down
86 changes: 47 additions & 39 deletions docs/source/documentation/themes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -297,18 +297,18 @@ mvThemeCol_SliderGrab mvThemeCol_ModalWindowDimBg
Plot Colors
-----------

======================= ====================== ====================
======================= ====================== =======================
Plot Colors
======================= ====================== ====================
mvPlotCol_Line mvPlotCol_LegendBg mvPlotCol_YAxisGrid
mvPlotCol_Fill mvPlotCol_LegendBorder mvPlotCol_YAxis2
mvPlotCol_MarkerOutline mvPlotCol_LegendText mvPlotCol_YAxisGrid2
mvPlotCol_MarkerFill mvPlotCol_TitleText mvPlotCol_YAxis3
mvPlotCol_ErrorBar mvPlotCol_InlayText mvPlotCol_YAxisGrid3
mvPlotCol_FrameBg mvPlotCol_XAxis mvPlotCol_Selection
mvPlotCol_PlotBg mvPlotCol_XAxisGrid mvPlotCol_Query
mvPlotCol_PlotBorder mvPlotCol_YAxis mvPlotCol_Crosshairs
======================= ====================== ====================
======================= ====================== =======================
mvPlotCol_Line mvPlotCol_LegendBg mvPlotCol_AxisBgHovered
mvPlotCol_Fill mvPlotCol_LegendBorder mvPlotCol_AxisGrid
mvPlotCol_MarkerOutline mvPlotCol_LegendText mvPlotCol_AxisText
mvPlotCol_MarkerFill mvPlotCol_TitleText mvPlotCol_Selection
mvPlotCol_ErrorBar mvPlotCol_InlayText
mvPlotCol_FrameBg mvPlotCol_AxisBg
mvPlotCol_PlotBg mvPlotCol_AxisBgActive
mvPlotCol_PlotBorder mvPlotCol_Crosshairs
======================= ====================== =======================

Node Colors
-----------
Expand All @@ -327,34 +327,42 @@ mvNodeCol_TitleBarHovered
Core Styles
-----------

============================== ==========
Constant Components
============================== ==========
mvStyleVar_Alpha 1
mvStyleVar_WindowPadding 2
mvStyleVar_WindowRounding 1
mvStyleVar_WindowBorderSize 1
mvStyleVar_WindowMinSize 2
mvStyleVar_WindowTitleAlign 2
mvStyleVar_ChildRounding 1
mvStyleVar_ChildBorderSize 1
mvStyleVar_PopupRounding 1
mvStyleVar_PopupBorderSize 1
mvStyleVar_FramePadding 2
mvStyleVar_FrameRounding 1
mvStyleVar_FrameBorderSize 1
mvStyleVar_ItemSpacing 2
mvStyleVar_ItemInnerSpacing 2
mvStyleVar_IndentSpacing 1
mvStyleVar_CellPadding 2
mvStyleVar_ScrollbarSize 1
mvStyleVar_ScrollbarRounding 1
mvStyleVar_GrabMinSize 1
mvStyleVar_GrabRounding 1
mvStyleVar_TabRounding 1
mvStyleVar_ButtonTextAlign 2
mvStyleVar_SelectableTextAlign 2
============================== ==========
======================================= ==========
Constant Components
======================================= ==========
mvStyleVar_Alpha 1
mvStyleVar_DisabledAlpha 1
mvStyleVar_WindowPadding 2
mvStyleVar_WindowRounding 1
mvStyleVar_WindowBorderSize 1
mvStyleVar_WindowMinSize 2
mvStyleVar_WindowTitleAlign 2
mvStyleVar_ChildRounding 1
mvStyleVar_ChildBorderSize 1
mvStyleVar_PopupRounding 1
mvStyleVar_PopupBorderSize 1
mvStyleVar_FramePadding 2
mvStyleVar_FrameRounding 1
mvStyleVar_FrameBorderSize 1
mvStyleVar_ItemSpacing 2
mvStyleVar_ItemInnerSpacing 2
mvStyleVar_IndentSpacing 1
mvStyleVar_CellPadding 2
mvStyleVar_ScrollbarSize 1
mvStyleVar_ScrollbarRounding 1
mvStyleVar_GrabMinSize 1
mvStyleVar_GrabRounding 1
mvStyleVar_TabRounding 1
mvStyleVar_TabBorderSize 1
mvStyleVar_TabBarBorderSize 1
mvStyleVar_TableAngledHeadersAngle 1
mvStyleVar_TableAngledHeadersTextAlign 2
mvStyleVar_ButtonTextAlign 2
mvStyleVar_SelectableTextAlign 2
mvStyleVar_SeparatorTextBorderSize 1
mvStyleVar_SeparatorTextAlign 2
mvStyleVar_SeparatorTextPadding 2
======================================= ==========

Plot Styles
-----------
Expand Down
1 change: 0 additions & 1 deletion sandbox/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#include "dearpygui.h"
#include "mvContext.h"
#include <Windows.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
Expand Down
1 change: 0 additions & 1 deletion sandbox/main_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include <Python.h>
#include "dearpygui.h"
#include "mvViewport.h"
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
Expand Down
Empty file modified scripts/BuildPythonForLinux.sh
100644 → 100755
Empty file.
6 changes: 4 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ set(MARVEL_SOURCES
"mvAboutWindow.cpp"
"mvDocWindow.cpp"
"mvMetricsWindow.cpp"
"mvStackWindow.cpp"
"mvStyleWindow.cpp"
"mvDebugWindow.cpp"
"mvLayoutWindow.cpp"
Expand Down Expand Up @@ -88,7 +89,9 @@ set(MARVEL_SOURCES
"$<$<PLATFORM_ID:Darwin>:../thirdparty/imgui/backends/imgui_impl_glfw.cpp>"
"$<$<PLATFORM_ID:Linux>:../thirdparty/imgui/backends/imgui_impl_glfw.cpp>"
"$<$<PLATFORM_ID:Linux>:../thirdparty/imgui/backends/imgui_impl_opengl3.cpp>"
"$<$<PLATFORM_ID:Linux>:../thirdparty/imgui/examples/libs/gl3w/GL/gl3w.c>"

# gl3w
"$<$<PLATFORM_ID:Linux>:../thirdparty/gl3w/GL/gl3w.c>"
)

set(MARVEL_INCLUDE_DIR
Expand All @@ -103,7 +106,6 @@ set(MARVEL_INCLUDE_DIR
"../thirdparty/gl3w/"
"../thirdparty/imgui/misc/freetype/"
"../thirdparty/imgui/backends/"
"../thirdparty/imgui/examples/libs/gl3w"
"../thirdparty/cpython/"
"../thirdparty/cpython/Include/"
"../thirdparty/cpython/build/debug/"
Expand Down
Loading
Loading