File
Blob: worker/src/client/exhibit/diagram/diagram-model.ts
| 1 | export const BRANCHES = ['audio', 'spectrum', 'robot'] as const; |
| 2 | export type Branch = (typeof BRANCHES)[number]; |
| 3 | export type Selection = Branch | 'board' | 'sfu'; |
| 4 | |
| 5 | export type SignalDetails = { selection: Selection; anchor: HTMLButtonElement }; |
| 6 | export type ExplanationTrigger = { |
| 7 | expanded: boolean; |
| 8 | onSelect: (anchor: HTMLButtonElement) => void; |
| 9 | }; |
| 10 | |
| 11 | /** Shared anchors for drawing board-to-SFU and SFU-to-browser streams. */ |
| 12 | export const anchors = { |
| 13 | board: 'board', |
| 14 | wifi: 'source-wifi', |
| 15 | sfuInput: 'sfu-input', |
| 16 | sources: { audio: 'source-audio', spectrum: 'source-spectrum', robot: 'source-robot' }, |
| 17 | relay: { audio: 'sfu-audio', spectrum: 'sfu-spectrum', robot: 'sfu-robot' }, |
| 18 | receivers: { audio: 'leaf-audio', spectrum: 'leaf-spectrum', robot: 'leaf-robot' }, |
| 19 | } as const; |
| 20 | |
| 21 | export const branchStyles = { |
| 22 | audio: { text: 'text-audio', variable: '[--branch:var(--color-audio)]', icon: 'sound' }, |
| 23 | spectrum: { text: 'text-spectrum', variable: '[--branch:var(--color-spectrum)]', icon: 'wave' }, |
| 24 | robot: { text: 'text-robot', variable: '[--branch:var(--color-robot)]', icon: 'control' }, |
| 25 | } as const; |