Skip to content
TREB Docs

AnnotationDataBase

AnnotationDataBase interface

splitting persisted data from the annotation class. that class might disappear in the future in favor of just a type. this interface should fully match the old Partial<Annotation> we used before. note that we used to define values for all members, but they may now be undefined because the Annotation class as a Partial instance of this data.

conceptually annotation was originally intended to support types other than our own charts and images, but no one ever used it. so we could lock down the `type` field if we wanted to. or perhaps have an `external` type with opaque data. TODO.

Members
extentextent, useful for exporting. we could probably serialize this, just be sure to clear it when layout changes so it will be recalculated. the idea is to know the bottom/right row/column of the annotation, so when we preserve/restore the sheet we don't trim those rows/columns. they don't need any data, but it just looks bad. we can do this dynamically but since it won't change all that often, we might as well precalculate.
formula
string
string
optional formula. the formula will be updated on structure events (insert/delete row/column).
layoutoptionalthe new layout, persisted and takes preference over the old one
movable
boolean
boolean
annotation can be moved. this is advisory, for UI
move_with_cells
boolean
boolean
move when resizing/inserting rows/columns
rectoptional
Partial<IRectangle>
Partial<IRectangle>
the old layout used rectangles, and we need to keep support for that. this is not the layout rectangle. this rectangle is just for serialization/deserialization. the actual rectangle is maintained in the Annotation class.
removable
boolean
boolean
annotation can be removed/deleted. this is advisory, for UI
resizable
boolean
boolean
annotation can be resized. this is advisory, for UI
resize_with_cells
boolean
boolean
resize when resizing/inserting rows/columns
selectable
boolean
boolean
annotation can be selected. this is advisory, for UI
Referenced by
AnnotationImageData
AnnotationChartData
AnnotationTextBoxData
AnnotationExternalData