JBrowse 2 configuration is kept in a specialized mobx-state-tree tree. Each node in the tree is a ConfigurationSchema. ConfigurationSchemas contain ConfigurationSlot members and/or additional sub-schemas.
Each "configuration variable" is held in a ConfigurationSlot, which has a string type
name, which is something like 'string', or 'color'. Each config slot can hold either a fixed value, or a function that can be called to produce a value.
These types are specific to configuration schemas.
string
number
integer
boolean
color
- a color, usually used in renderer configsstringArray
- an array of stringsstringArrayMap
- map of string -> array[string]numberMap
- map of string -> numberfileLocation
of the formor{ uri: 'http://example.com/path/to/resource.file' }
{ localPath: '/filesystem/path/to/resource.file' }
frozen
- any data structure. assumed to be immutable; internal changes to it will not be noticed by any mobx observers
There is also a configuration construct called a ConfigurationLayer
that acts as a "layer over" another configuration schema. It has the same slots, with the same types, but all of its slot values default to whatever the default of of the corresponding slot in the parent schema is.
These are useful for "overriding" only some values of a parent schema, such as for providing a cascading configuration system for subtracks.