Flow canvas: mark streaming edges with a marching dash
A port with `stream` set publishes repeatedly during one execution, and until now nothing on the canvas said so. `deriveEdges` carries the flag from the producing `MessageSpec` onto the edge, `LiveEdge` turns it into an `edge-stream` class, and the class draws a dashed stroke whose offset marches toward the target. The pulse still lands on top: both animations share one declaration when a value arrives on a streaming edge.
This commit is contained in:
@@ -34,7 +34,7 @@ function LiveEdgeComponent({
|
||||
data,
|
||||
selected,
|
||||
}: EdgeProps) {
|
||||
const { message, producerId } = (data ?? {}) as FlowEdgeData
|
||||
const { message, producerId, stream } = (data ?? {}) as FlowEdgeData
|
||||
const live = useLiveValue(message)
|
||||
const zoom = useStore((state) => state.transform[2])
|
||||
const [pulsing, setPulsing] = useState(false)
|
||||
@@ -69,7 +69,7 @@ function LiveEdgeComponent({
|
||||
<BaseEdge
|
||||
id={id}
|
||||
path={path}
|
||||
className={cn(pulsing && "edge-live")}
|
||||
className={cn(pulsing && "edge-live", stream && "edge-stream")}
|
||||
style={selected ? { stroke: "var(--primary)" } : undefined}
|
||||
/>
|
||||
{live !== undefined && zoom >= CHIP_MIN_ZOOM ? (
|
||||
|
||||
Reference in New Issue
Block a user