Let a dashboard be read against runs instead of the live engine

This commit is contained in:
2026-08-25 11:48:15 +02:00
parent d2951a325e
commit 5ece544b14
13 changed files with 438 additions and 32 deletions
@@ -1,5 +1,5 @@
import { slotsFor } from "@/components/Common/UplotChart"
import { useLiveValues } from "@/components/Flow/liveStore"
import { useBoundValues } from "./dataContext"
import { usePalette } from "./settings"
import { useUi } from "./ui"
import { rowsOf } from "./ui/core/config"
@@ -24,7 +24,7 @@ import type { WidgetProps } from "./widgets"
export function BarWidget({ widget }: WidgetProps) {
const { Bar } = useUi()
const rows = rowsOf(widget).filter((row) => row.message)
const live = useLiveValues(rows.map((row) => row.message as string))
const live = useBoundValues(rows.map((row) => row.message as string))
// The dashboard's own data colours, in the order a chart would take them, so
// a bar and a chart of the same readings agree about which line is which.
const colors = slotsFor(rows.length, usePalette())