DreamLake
Browse docs

Data model

The existing schema API connects format readers to views through Model. Storage resolves files; an adapter converts them into fields and payloads; a view reads those payloads. This contract is separate from Dataset.

The model

Implement three methods to expose fields, read their values and supply an optional shared timeline:

ts
interface Model {
  fields(): Promise<Field[]>;
  read(ref: string, query?: ReadQuery): Promise<Payload>;
  timeline(): Promise<Timeline | null>;
}

Each field has a stable ref, a kind, and optional label/metadata. Put numeric dimension names in meta.dims. Views receive the catalog and a bound read function.

Field kinds

Field.kind identifies the payload a view can read. Payload.kind uses the same discriminator: series supplies timestamps and columns; video supplies a URL.

The built-in kinds

KindPayloadPresentation
videourl, start, endVideo tile.
imageurlImage tile.
fileurl, optional extExplicitly selected file/media content.
seriestimestamps, columnsLine chart.
cuescues: { start, end, label, id? }[]Timeline intervals.
framescount, optional fps, frameAt(index)Image sequence.
pose3dtimestamps, joints, shape, optional layoutMetadata placeholder in this API.
pointcloudtimestamps, points, shapeMetadata placeholder in this API.

Custom kinds require a reader and compatible view. pose3d and pointcloud are metadata placeholders here; use 3D scenes or Dataset for interactive rendering.

What each layer does with kind

Entry.type distinguishes files and directories. Adapters determine data kinds; views declare compatible kinds. Auto-layout uses those declarations to choose panels.

Reading fields

Listing fields describes the source. Reading resolves URLs or loads values: media usually yields URLs, series/cues yield parsed data, and frames expose frameAt(index) for on-demand access.

timeRange and maxPoints are read hints. Their effect depends on the adapter; they do not guarantee partial network transfers.

Adding an extension

Register a storage driver for access, an adapter for a format, or a view for presentation. The schema selects each by name.