Sparkline every message a node names

A number in the panel says where a value is, not where it has been. Each
named port in Consumes and Provides now carries a sparkline under it,
fetched once on open and extended from the socket as values arrive, held
to the same 120-point window the server keeps.

Both lists render through the shared port row, so a sink node shows what
flows through it rather than nothing. A flat series draws its mid line
and drops the redundant range label, a lone reading is just its dot, and
a series spanning decades switches to a log scale with the labels left
in real units.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KkmeRiyeYmVZqJVwuyHq9o
This commit is contained in:
Melvin Strobl
2026-08-15 21:59:30 +02:00
co-authored by Claude Opus 5
parent 0154bf3537
commit e3b3d234ce
3 changed files with 260 additions and 33 deletions
+8
View File
@@ -12,6 +12,8 @@ export const flowKeys = {
detail: (name: string) => ["flows", name] as const,
source: (name: string, nodeId: string) =>
["flows", name, "source", nodeId] as const,
history: (name: string, message: string) =>
["flows", name, "history", message] as const,
nodeTypes: ["flows", "node-types"] as const,
}
@@ -36,6 +38,12 @@ export const nodeSourceQueryOptions = (name: string, nodeId: string) => ({
queryFn: () => FlowsService.readNodeSource({ name, nodeId }),
})
/** The recent values of one message, for the panel's sparkline. */
export const messageHistoryQueryOptions = (name: string, message: string) => ({
queryKey: flowKeys.history(name, message),
queryFn: () => FlowsService.readMessageHistory({ name, message }),
})
const AUTOSAVE_DELAY = 800
/**