Skip to main content

Documentation for ScryLab v0.1.10

Changelogs

Plot Signal

POST /api/plot

Adds a signal to the first plot of the active tab. Creates a new tab and plot automatically if none exists.

Request

POST /api/plot HTTP/1.1
Host: localhost:5678
Content-Type: application/json

Body Parameters

ParameterTypeRequiredDescription
signal_idstringYesSignal ID from POST /api/signals/send or /api/signals/upload
{
"signal_id": "7c9e6679-7425-40de-944b-e07fc1f90ae7"
}

Response

Status Code: 200 OK

{
"status": "ok",
"result": {
"plotted": true,
"item_uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"signal_name": "Sine 5Hz",
"plot_name": "Plot 1"
}
}

Errors

StatusMeaning
400signal_id field missing
404Signal not found

Example

Terminal window
# Send a signal, capture the signal_id
SIGNAL_ID=$(curl -s -X POST http://localhost:5678/api/signals/send \
-H "Content-Type: application/json" \
-d '{"name":"Sine 5Hz","y":[0,1,0,-1,0],"target_source_id":"<source_id>"}' \
| jq -r '.result.signal_id')
# Plot it
curl -s -X POST http://localhost:5678/api/plot \
-H "Content-Type: application/json" \
-d "{\"signal_id\":\"$SIGNAL_ID\"}"

Tip

The Python client’s scry.plot() sends the signal and calls this endpoint automatically. See the Python client on GitHub.