KQ-1648 · TRIPWIRE/TUNER
Tripwire Tuner
An alert rule editor that replays itself over the past week: a threshold line follows the finger 1:1 across seven days of a sensor feed, the part of the series past it recolours in the same frame, and each step it crosses re-runs the rule, so alerts it would now have sent drop onto the timeline on springs.recoil in time order while alerts it no longer sends lift away on the exit ease and survivors slide to their new time on springs.glide. The would-have-alerted count rolls beside a Quiet, Steady or Noisy verdict, and on release the line lands on its step on springs.snap with the throw's velocity. The handle is a slider: arrows nudge a step, Shift or the Page keys ten, Home and End the axis ends, and markers are walked with the arrows and opened with Enter.
Cold room 3 too warm
Fieldline · cold-room-3 · temperature
6.0 °C above · 15 min · would have alerted 7 times
Install
One command — the source lands in your repo. Or copy it from the Code tab.
$ pnpm dlx shadcn@latest add @kinetiq/tripwire-tuner
Props
- chartStyle
- "area" | "line" | "bars"
- default "area"
- How the series is drawn: a line over a soft fill, the line alone, or one bar per two hours showing their peak.
- markerShape
- "pin" | "dot" | "diamond"
- default "pin"
- The shape of each would-have-fired marker on the timeline.
- accent
- string
- default "var(--warn)"
- The threshold line, the breach colour, the markers and Save, any CSS colour.
- series
- TripwireSample[]
- default defaultTripwireSeries
- Readings oldest first, evenly spaced: { t, v } with v null where the feed has no data (drawn hatched).
- now
- number
- default defaultTripwireNow
- The newest moment the chart covers, in ms; never read from the clock.
- rule / defaultRule
- TripwireRule
- default — / defaultTripwireRule
- The rule, controlled or initial: { threshold, comparison: "above" | "below", duration (minutes), channel }.
- onRuleChange
- (rule: TripwireRule) => void
- default —
- Fires from the drag, key, click or field that changed the rule, with the whole rule.
- onSave
- (rule: TripwireRule) => void | Promise<unknown>
- default —
- Save was pressed. Return a promise to show saving; a rejection keeps the draft and says so.
- status
- "ready" | "loading" | "error"
- default "ready"
- Whether the series has arrived. Loading keeps the axes; error keeps the draft under a Retry banner.
- onRetry
- () => void
- default —
- Retry was pressed after the series failed to load.
- unit
- string
- default "°C"
- The metric's unit, printed after every value.
- domain
- [number, number]
- default [0, 10]
- The y axis, low to high; the threshold stays inside it and rubber-bands past it.
- step
- number
- default 0.1
- The threshold's step: one arrow press and what a drag lands on; Shift moves ten.
- durations
- number[]
- default [0, 15, 30, 60]
- The duration choices in minutes; 0 fires at once.
- channels
- TripwireChannel[]
- default defaultTripwireChannels
- Where an alert can go: { id, label }.
- title
- string
- default "Cold room 3 too warm"
- The rule's name in the header and the editor's accessible name.
- source
- string
- default "Fieldline · cold-room-3 · temperature"
- The feed the rule watches, under the name.
- height
- number
- default 540
- Height of the editor in px; its body scrolls inside it.
- disabled
- boolean
- default false
- Nothing can be dragged, typed or saved; the editor dims.
- className
- string
- default —
- Classes for the outer surface.
| Prop | Type | Default | Description |
|---|---|---|---|
| chartStyle | "area" | "line" | "bars" | "area" | How the series is drawn: a line over a soft fill, the line alone, or one bar per two hours showing their peak. |
| markerShape | "pin" | "dot" | "diamond" | "pin" | The shape of each would-have-fired marker on the timeline. |
| accent | string | "var(--warn)" | The threshold line, the breach colour, the markers and Save, any CSS colour. |
| series | TripwireSample[] | defaultTripwireSeries | Readings oldest first, evenly spaced: { t, v } with v null where the feed has no data (drawn hatched). |
| now | number | defaultTripwireNow | The newest moment the chart covers, in ms; never read from the clock. |
| rule / defaultRule | TripwireRule | — / defaultTripwireRule | The rule, controlled or initial: { threshold, comparison: "above" | "below", duration (minutes), channel }. |
| onRuleChange | (rule: TripwireRule) => void | — | Fires from the drag, key, click or field that changed the rule, with the whole rule. |
| onSave | (rule: TripwireRule) => void | Promise<unknown> | — | Save was pressed. Return a promise to show saving; a rejection keeps the draft and says so. |
| status | "ready" | "loading" | "error" | "ready" | Whether the series has arrived. Loading keeps the axes; error keeps the draft under a Retry banner. |
| onRetry | () => void | — | Retry was pressed after the series failed to load. |
| unit | string | "°C" | The metric's unit, printed after every value. |
| domain | [number, number] | [0, 10] | The y axis, low to high; the threshold stays inside it and rubber-bands past it. |
| step | number | 0.1 | The threshold's step: one arrow press and what a drag lands on; Shift moves ten. |
| durations | number[] | [0, 15, 30, 60] | The duration choices in minutes; 0 fires at once. |
| channels | TripwireChannel[] | defaultTripwireChannels | Where an alert can go: { id, label }. |
| title | string | "Cold room 3 too warm" | The rule's name in the header and the editor's accessible name. |
| source | string | "Fieldline · cold-room-3 · temperature" | The feed the rule watches, under the name. |
| height | number | 540 | Height of the editor in px; its body scrolls inside it. |
| disabled | boolean | false | Nothing can be dragged, typed or saved; the editor dims. |
| className | string | — | Classes for the outer surface. |