better-rtplot 0.2.5__tar.gz → 0.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- better_rtplot-0.4.0/PKG-INFO +149 -0
- better_rtplot-0.4.0/README.md +125 -0
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/pyproject.toml +3 -5
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/client.py +255 -86
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/server.py +8 -118
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/server_browser.py +268 -159
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/server_browser_gui.py +1 -64
- better_rtplot-0.2.5/PKG-INFO +0 -538
- better_rtplot-0.2.5/README.md +0 -512
- better_rtplot-0.2.5/rtplot/example_code.py +0 -293
- better_rtplot-0.2.5/rtplot/plot_log.py +0 -64
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/LICENSE +0 -0
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/interactive_test.py +0 -0
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/saved_plots/.gitignore +0 -0
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/static/uPlot.iife.min.js +0 -0
- {better_rtplot-0.2.5 → better_rtplot-0.4.0}/rtplot/static/uPlot.min.css +0 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: better-rtplot
|
|
3
|
+
Version: 0.4.0
|
|
4
|
+
Summary:
|
|
5
|
+
License: GPL V3.0
|
|
6
|
+
Author: jmontp
|
|
7
|
+
Author-email: jmontp@umich.edu
|
|
8
|
+
Requires-Python: >=3.9,<3.13
|
|
9
|
+
Classifier: License :: Other/Proprietary License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Provides-Extra: browser
|
|
16
|
+
Provides-Extra: server
|
|
17
|
+
Requires-Dist: aiohttp (>=3.9.0) ; extra == "browser"
|
|
18
|
+
Requires-Dist: numpy (>=1.23.5)
|
|
19
|
+
Requires-Dist: pyqtgraph (>=0.13.0) ; extra == "server"
|
|
20
|
+
Requires-Dist: pyside6 (>6.4.0) ; extra == "server"
|
|
21
|
+
Requires-Dist: pyzmq (>=25.0.0)
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
|
|
24
|
+
# rtplot — real-time plotting over ZMQ
|
|
25
|
+
|
|
26
|
+
**rtplot** pushes live data from a Python script to a browser plot —
|
|
27
|
+
locally or across a network — in a few lines of code. The plot page
|
|
28
|
+
also hosts interactive widgets (buttons, sliders, dials, numeric / text
|
|
29
|
+
displays) that feed values back to the sender in real time.
|
|
30
|
+
|
|
31
|
+
Typical use: a robot or data-acquisition script runs on a Raspberry Pi,
|
|
32
|
+
and you watch signals and tweak gains from a laptop on the same Wi-Fi.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## How it works
|
|
37
|
+
|
|
38
|
+
Two processes talking over ZMQ, plus a browser viewer:
|
|
39
|
+
|
|
40
|
+
```mermaid
|
|
41
|
+
flowchart TD
|
|
42
|
+
script["Your Python script<br/>send_array() · poll_controls()"]
|
|
43
|
+
subgraph server["rtplot-server"]
|
|
44
|
+
browser["browser tab<br/>localhost:8050"]
|
|
45
|
+
end
|
|
46
|
+
script -- "data :5555" --> server
|
|
47
|
+
server -- "controls :5556" --> script
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Sender and server don't have to be on the same machine — see the
|
|
51
|
+
[networking guide](docs/networking.md).
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## Install
|
|
56
|
+
|
|
57
|
+
**Server** — grab the prebuilt binary from the
|
|
58
|
+
[Releases page](https://github.com/jmontp/rtplot/releases):
|
|
59
|
+
|
|
60
|
+
| Platform | Asset |
|
|
61
|
+
|---|---|
|
|
62
|
+
| Windows | `rtplot-server-<version>-windows-x64.exe` |
|
|
63
|
+
| Linux | `rtplot-server-<version>-linux-x86_64.tar.gz` |
|
|
64
|
+
| macOS (Apple Silicon) | `rtplot-server-<version>-macos-arm64.tar.gz` |
|
|
65
|
+
|
|
66
|
+
No Python needed on the viewing machine. On Windows the binary opens
|
|
67
|
+
a small Tk status window showing the listening URL.
|
|
68
|
+
|
|
69
|
+
**Client** — pip install in the env that runs your script:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
pip install better-rtplot
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
(If you'd rather run the server from Python too, use
|
|
76
|
+
`pip install "better-rtplot[browser]"` — see the
|
|
77
|
+
[API reference](docs/api.md#install-detail).)
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Your first plot
|
|
82
|
+
|
|
83
|
+
```mermaid
|
|
84
|
+
flowchart TD
|
|
85
|
+
t1["terminal 1: start the server"]
|
|
86
|
+
t2["terminal 2: run your script"]
|
|
87
|
+
br["browser: open localhost:8050"]
|
|
88
|
+
t1 --> t2 --> br
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**Terminal 1 — start the server.** Run the prebuilt `rtplot-server`
|
|
92
|
+
binary you downloaded above. Open `http://localhost:8050` in a
|
|
93
|
+
browser — the page is blank until data arrives.
|
|
94
|
+
|
|
95
|
+
**Terminal 2 — run your sender script.** Save as `my_plot.py`:
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
from rtplot import client
|
|
99
|
+
import time
|
|
100
|
+
|
|
101
|
+
client.local_plot()
|
|
102
|
+
client.initialize_plots(["my signal"])
|
|
103
|
+
|
|
104
|
+
for i in range(1000):
|
|
105
|
+
client.send_array(i * 0.01)
|
|
106
|
+
time.sleep(0.01)
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
python my_plot.py
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
A rising line now draws itself in the browser tab.
|
|
114
|
+
|
|
115
|
+
---
|
|
116
|
+
|
|
117
|
+
## Highlights
|
|
118
|
+
|
|
119
|
+
- **Fast.** Binary WebSocket deltas up to 1 kHz; the browser coalesces
|
|
120
|
+
samples into one repaint per `requestAnimationFrame`, so rendering
|
|
121
|
+
tracks your monitor refresh rate regardless of sample rate.
|
|
122
|
+
- **Browser-based.** aiohttp + uPlot, no desktop GUI toolkit, works
|
|
123
|
+
over SSH port forwarding.
|
|
124
|
+
- **Remote-friendly.** Sender or plot host can bind. Live Bind /
|
|
125
|
+
Connect buttons retarget without restart.
|
|
126
|
+
- **Config lives with the data.** The sender declares plot layout.
|
|
127
|
+
- **Interactive controls.** Buttons, sliders, dials, displays — polled
|
|
128
|
+
from your loop, no threads, no callbacks.
|
|
129
|
+
- **Static HTML snapshots.** `save_snapshot("out.html")` writes a
|
|
130
|
+
self-contained ~65 KB file with the current trace embedded.
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Where to go next
|
|
135
|
+
|
|
136
|
+
- **[API reference](docs/api.md)** — every `rtplot.client` function,
|
|
137
|
+
the plot-layout schema, interactive controls, snapshots, browser UI,
|
|
138
|
+
and `rtplot-server` CLI flags.
|
|
139
|
+
- **[Networking guide](docs/networking.md)** — Mode A vs. Mode B,
|
|
140
|
+
viewing from a phone or second laptop, the WSL2 wrinkle, Cloudflare
|
|
141
|
+
Tunnel, Tailscale.
|
|
142
|
+
- **[Examples](examples/README.md)** — runnable scripts with embedded
|
|
143
|
+
HTML snapshots you can open offline.
|
|
144
|
+
|
|
145
|
+
---
|
|
146
|
+
|
|
147
|
+
Issues and feature requests:
|
|
148
|
+
[github.com/jmontp/rtplot/issues](https://github.com/jmontp/rtplot/issues).
|
|
149
|
+
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
# rtplot — real-time plotting over ZMQ
|
|
2
|
+
|
|
3
|
+
**rtplot** pushes live data from a Python script to a browser plot —
|
|
4
|
+
locally or across a network — in a few lines of code. The plot page
|
|
5
|
+
also hosts interactive widgets (buttons, sliders, dials, numeric / text
|
|
6
|
+
displays) that feed values back to the sender in real time.
|
|
7
|
+
|
|
8
|
+
Typical use: a robot or data-acquisition script runs on a Raspberry Pi,
|
|
9
|
+
and you watch signals and tweak gains from a laptop on the same Wi-Fi.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## How it works
|
|
14
|
+
|
|
15
|
+
Two processes talking over ZMQ, plus a browser viewer:
|
|
16
|
+
|
|
17
|
+
```mermaid
|
|
18
|
+
flowchart TD
|
|
19
|
+
script["Your Python script<br/>send_array() · poll_controls()"]
|
|
20
|
+
subgraph server["rtplot-server"]
|
|
21
|
+
browser["browser tab<br/>localhost:8050"]
|
|
22
|
+
end
|
|
23
|
+
script -- "data :5555" --> server
|
|
24
|
+
server -- "controls :5556" --> script
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Sender and server don't have to be on the same machine — see the
|
|
28
|
+
[networking guide](docs/networking.md).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
**Server** — grab the prebuilt binary from the
|
|
35
|
+
[Releases page](https://github.com/jmontp/rtplot/releases):
|
|
36
|
+
|
|
37
|
+
| Platform | Asset |
|
|
38
|
+
|---|---|
|
|
39
|
+
| Windows | `rtplot-server-<version>-windows-x64.exe` |
|
|
40
|
+
| Linux | `rtplot-server-<version>-linux-x86_64.tar.gz` |
|
|
41
|
+
| macOS (Apple Silicon) | `rtplot-server-<version>-macos-arm64.tar.gz` |
|
|
42
|
+
|
|
43
|
+
No Python needed on the viewing machine. On Windows the binary opens
|
|
44
|
+
a small Tk status window showing the listening URL.
|
|
45
|
+
|
|
46
|
+
**Client** — pip install in the env that runs your script:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install better-rtplot
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
(If you'd rather run the server from Python too, use
|
|
53
|
+
`pip install "better-rtplot[browser]"` — see the
|
|
54
|
+
[API reference](docs/api.md#install-detail).)
|
|
55
|
+
|
|
56
|
+
---
|
|
57
|
+
|
|
58
|
+
## Your first plot
|
|
59
|
+
|
|
60
|
+
```mermaid
|
|
61
|
+
flowchart TD
|
|
62
|
+
t1["terminal 1: start the server"]
|
|
63
|
+
t2["terminal 2: run your script"]
|
|
64
|
+
br["browser: open localhost:8050"]
|
|
65
|
+
t1 --> t2 --> br
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Terminal 1 — start the server.** Run the prebuilt `rtplot-server`
|
|
69
|
+
binary you downloaded above. Open `http://localhost:8050` in a
|
|
70
|
+
browser — the page is blank until data arrives.
|
|
71
|
+
|
|
72
|
+
**Terminal 2 — run your sender script.** Save as `my_plot.py`:
|
|
73
|
+
|
|
74
|
+
```python
|
|
75
|
+
from rtplot import client
|
|
76
|
+
import time
|
|
77
|
+
|
|
78
|
+
client.local_plot()
|
|
79
|
+
client.initialize_plots(["my signal"])
|
|
80
|
+
|
|
81
|
+
for i in range(1000):
|
|
82
|
+
client.send_array(i * 0.01)
|
|
83
|
+
time.sleep(0.01)
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
python my_plot.py
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
A rising line now draws itself in the browser tab.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Highlights
|
|
95
|
+
|
|
96
|
+
- **Fast.** Binary WebSocket deltas up to 1 kHz; the browser coalesces
|
|
97
|
+
samples into one repaint per `requestAnimationFrame`, so rendering
|
|
98
|
+
tracks your monitor refresh rate regardless of sample rate.
|
|
99
|
+
- **Browser-based.** aiohttp + uPlot, no desktop GUI toolkit, works
|
|
100
|
+
over SSH port forwarding.
|
|
101
|
+
- **Remote-friendly.** Sender or plot host can bind. Live Bind /
|
|
102
|
+
Connect buttons retarget without restart.
|
|
103
|
+
- **Config lives with the data.** The sender declares plot layout.
|
|
104
|
+
- **Interactive controls.** Buttons, sliders, dials, displays — polled
|
|
105
|
+
from your loop, no threads, no callbacks.
|
|
106
|
+
- **Static HTML snapshots.** `save_snapshot("out.html")` writes a
|
|
107
|
+
self-contained ~65 KB file with the current trace embedded.
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Where to go next
|
|
112
|
+
|
|
113
|
+
- **[API reference](docs/api.md)** — every `rtplot.client` function,
|
|
114
|
+
the plot-layout schema, interactive controls, snapshots, browser UI,
|
|
115
|
+
and `rtplot-server` CLI flags.
|
|
116
|
+
- **[Networking guide](docs/networking.md)** — Mode A vs. Mode B,
|
|
117
|
+
viewing from a phone or second laptop, the WSL2 wrinkle, Cloudflare
|
|
118
|
+
Tunnel, Tailscale.
|
|
119
|
+
- **[Examples](examples/README.md)** — runnable scripts with embedded
|
|
120
|
+
HTML snapshots you can open offline.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
Issues and feature requests:
|
|
125
|
+
[github.com/jmontp/rtplot/issues](https://github.com/jmontp/rtplot/issues).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "better-rtplot"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.4.0"
|
|
4
4
|
description = ""
|
|
5
5
|
authors = ["jmontp <jmontp@umich.edu>"]
|
|
6
6
|
license = "GPL V3.0"
|
|
@@ -13,15 +13,13 @@ python = ">= 3.9, < 3.13"
|
|
|
13
13
|
numpy = ">= 1.23.5"
|
|
14
14
|
pyzmq = ">= 25.0.0"
|
|
15
15
|
|
|
16
|
-
pandas = {version = ">= 1.5.3", optional = true}
|
|
17
|
-
pyarrow = {version=">= 11.0.0", optional = true}
|
|
18
16
|
pyqtgraph = {version = ">= 0.13.0", optional = true}
|
|
19
17
|
pyside6 = {version = "> 6.4.0", optional = true}
|
|
20
18
|
aiohttp = {version = ">= 3.9.0", optional = true}
|
|
21
19
|
|
|
22
20
|
[tool.poetry.extras]
|
|
23
|
-
server = ["pyqtgraph", "pyside6"
|
|
24
|
-
browser = ["aiohttp"
|
|
21
|
+
server = ["pyqtgraph", "pyside6"]
|
|
22
|
+
browser = ["aiohttp"]
|
|
25
23
|
|
|
26
24
|
|
|
27
25
|
[build-system]
|