about

create custom logic nodes for the scavenger patchbay - each node is a tiny program - init / onReceive / teardown over the ctx api
build it here, test it in the rig, then export a .scv - a self-contained file that holds your node's full definition in plain html
drop it on the patchbay to register it and place an instance - nodes run arbitrary js - treat any .scv file and bay like a program
to update every node instance keeping its wiring intact, re-drop the updated .scv onto the board - every instance will live update

ee
contract
init(ctx)called once when the node connects
onReceive(value, ctx)called when a value arrives on the wire
teardown(ctx)called when the node is removed
config
placeholder: 'text'input placeholder (default none)
openWidth: 400node width in px when open
label: 'text'hover tooltip (modes override)
inputType: 'number''text' or 'number'
output
ctx.emit(v)sends a value through the wire
ctx.showFloat(v)shows overlay text above node
ctx.flashError(label, err)flashes red border + console warn
ctx.valuethe node's stored value
spawn
ctx.append(el, x, y)adds an element to the board
ctx.remove(el)removes a spawned element
ctx.el / ctx.icon / ctx.inputthe node's root / icon / input
ctx.el.classListtoggle state classes: .active .node-pulse .scv-node-error
node
ctx.id / ctx.typeunique id / registered type name
ctx.x / ctx.yx/y position on the board
ctx.setPosition(x, y)repositions the node
modes
modes: [{id, icon, label, color}]declares toggleable node modes
ctx.modethe active mode id
onMode(id, ctx)called when the mode changes
about

author live html components for the scavenger patchbay - <div> / <style> / <script> - compile wraps it in a self-contained element
build it here, test it in the rig, then export a .scv - a self-contained file holding your component's full definition in plain html
drop it onto the patchbay to register it and place an instance - authored components keep their scripts and can run arbitrary js code
to update every instance keeping data and wiring intact, re-drop the updated .scv on the board - instances update to the new template

shape
data-scv-slot="name"marks a field's data - kept across a re-drop, matched by name
text > htmleditable text captured as html
img > srcan image keeps its source
input > valuea field keeps its value
checkbox > checkeda toggle keeps its state
unmarkedpure layout - replaced freely on re-drop
behavior
rootthe shadow root - query and mutate your markup
hostelement itself - listen for scv-receive to take wired value
emit(v)sends a value out the wire
addEventListenerbind events here - on* is stripped, delegate on root to survive a re-drop
wire
data-scv-emits="ch"the element's output - its value travels out on channel ch
data-scv-receives="ch"an input - values on channel ch land in the element
data-scv-action="ch"runs the element when a signal arrives on ch

      
s<av> { compiler }
◆
›
◆
›
value: -
no emissions yet — call emit(v)
no emissions yet — call emit(v)
drop .scv file hereto import a saved node definition