my1e5 / dpg-examples Goto Github PK
View Code? Open in Web Editor NEWA collection of example scripts which demonstrate various features/functionality in DearPyGui
Home Page: https://github.com/hoffstadt/DearPyGui
License: MIT License
A collection of example scripts which demonstrate various features/functionality in DearPyGui
Home Page: https://github.com/hoffstadt/DearPyGui
License: MIT License
Thank you for your example
Let me learn a lot of knowledge
I want to use DearPyGui to complete it
But it's unclear how to port to DearPyGui
import queue
import sys
from matplotlib.animation import FuncAnimation
import matplotlib.pyplot as plt
import numpy as np
import sounddevice as sd
channels = [1]
window = 200
interval = 30
downsample = 10
mapping = [c - 1 for c in channels]
q = queue.Queue()
def audio_callback(indata, frames, time, status):
if status:
print(status, file=sys.stderr)
q.put(indata[::downsample, mapping])
def update_plot(frame):
global plotdata
while True:
try:
data = q.get_nowait()
except queue.Empty:
break
shift = len(data)
plotdata = np.roll(plotdata, -shift, axis=0)
plotdata[-shift:, :] = data
for column, line in enumerate(lines):
line.set_ydata(plotdata[:, column])
return lines
try:
device_info = sd.query_devices(None, "input")
samplerate = device_info["default_samplerate"]
length = int(window * samplerate / (1000 * downsample))
plotdata = np.zeros((length, len(channels)))
fig, ax = plt.subplots()
lines = ax.plot(plotdata)
if len(channels) > 1:
ax.legend(
[f"thoroughfare {c}" for c in channels],
loc="lower left",
ncol=len(channels),
)
ax.axis((0, len(plotdata), -1, 1))
ax.set_yticks([0])
ax.yaxis.grid(True)
ax.tick_params(
bottom=False,
top=False,
labelbottom=False,
right=False,
left=False,
labelleft=False,
)
fig.tight_layout(pad=0)
stream = sd.InputStream(
device=None,
channels=max(channels),
samplerate=samplerate,
callback=audio_callback,
)
ani = FuncAnimation(fig, update_plot, interval=interval, blit=True)
with stream:
plt.show()
except Exception as e:
print(type(e).__name__ + ": " + str(e))
https://github.com/my1e5/dpg-examples/blob/main/plots/plot_update_time_data.py
https://dearpygui.readthedocs.io/en/latest/documentation/node-editor.html
Do you consider the Node Editor example
There are too few official tutorials
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.