step 5: complete first gauge catalogue

This commit is contained in:
2026-07-02 14:47:05 +02:00
parent d638c512e9
commit 1a476bc91d
11 changed files with 594 additions and 16 deletions

25
examples/basic_battery.py Normal file
View File

@@ -0,0 +1,25 @@
# pyright: reportGeneralTypeIssues=false
import dearpygui.dearpygui as dpg
import dpg_gauges as dpgg
def main() -> None:
dpg.create_context()
try:
with dpg.window(label="Battery Gauge", width=320, height=180):
dpgg.battery_gauge(
tag="battery", label="Battery", value=82, unit="%", width=260, height=110
)
dpg.create_viewport(title="dpg-gauges battery", width=360, height=220)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
finally:
dpg.destroy_context()
if __name__ == "__main__":
main()

23
examples/basic_compass.py Normal file
View File

@@ -0,0 +1,23 @@
# pyright: reportGeneralTypeIssues=false
import dearpygui.dearpygui as dpg
import dpg_gauges as dpgg
def main() -> None:
dpg.create_context()
try:
with dpg.window(label="Compass Gauge", width=320, height=320):
dpgg.compass_gauge(tag="heading", label="Heading", value=275, width=240, height=240)
dpg.create_viewport(title="dpg-gauges compass", width=360, height=360)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
finally:
dpg.destroy_context()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,29 @@
# pyright: reportGeneralTypeIssues=false
import dearpygui.dearpygui as dpg
import dpg_gauges as dpgg
def main() -> None:
dpg.create_context()
try:
with dpg.window(label="Multi Value Gauge", width=340, height=220):
dpgg.multi_value_gauge(
tag="engine",
label="Engine",
values={"AFR": 12.8, "Oil": "58 psi", "Fuel": "43 psi"},
width=280,
height=150,
)
dpg.create_viewport(title="dpg-gauges multi-value", width=380, height=260)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
finally:
dpg.destroy_context()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,32 @@
# pyright: reportGeneralTypeIssues=false
import dearpygui.dearpygui as dpg
import dpg_gauges as dpgg
def main() -> None:
dpg.create_context()
try:
with dpg.window(label="Segmented Gauge", width=360, height=160):
dpgg.segmented_gauge(
tag="shift",
label="Shift lights",
value=7200,
min_value=0,
max_value=8000,
segments=12,
width=300,
height=90,
)
dpg.create_viewport(title="dpg-gauges segmented", width=400, height=200)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
finally:
dpg.destroy_context()
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,32 @@
# pyright: reportGeneralTypeIssues=false
import dearpygui.dearpygui as dpg
import dpg_gauges as dpgg
def main() -> None:
dpg.create_context()
try:
with dpg.window(label="Thermometer Gauge", width=280, height=340):
dpgg.thermometer_gauge(
tag="coolant",
label="Coolant",
value=92,
min_value=40,
max_value=120,
unit="C",
width=180,
height=260,
)
dpg.create_viewport(title="dpg-gauges thermometer", width=320, height=380)
dpg.setup_dearpygui()
dpg.show_viewport()
dpg.start_dearpygui()
finally:
dpg.destroy_context()
if __name__ == "__main__":
main()