Configuration
You can fully customize the viewer's behaviour by providing a configuration object to the TIDO instance.
First of all, there should be set either a collection or a manifest value.
By default, TIDO will render 5 panels displaying sequence tree, metadata, image, text content and annotation views.
There are options to
- add/remove multiple panels
- freely combine view components in panels
- show/hide header features
- change the color scheme
- and more ...
Example configuration:
Click to open
Code
The Keys in Detail
| Name | Type | Default | Description |
|---|---|---|---|
| allowNewCollections | Boolean | true | Toggles the ability to add new collections to the app through a user input. |
| annotations | AnnotationsConfig | Configures the display of annotations and their filtering options. See annotations chapter. | |
| annotations.defaultMode | String | aligned | An annotations mode toggle is shown. Initial selected mode is aligned mode |
| annotations.filters | AnnotationFiltersConfig | - | Defines a nested object of filter options. |
| annotations.filters.rootSelectionRule | String | multiple | Controls the overall behavior and layout of the filter UI. Allowed values: multiple or single. When set to single, a tab bar is rendered for root-level nodes. |
| annotations.filters.selectedIndex | Number | - | Index of the initially selected filter node in the filter tree. Only applies when rootSelectionRule is set to single. |
| annotations.filters.items | FilterNode[] | - | Array of filter nodes defining the hierarchical filter tree structure. |
| annotations.filters.items[i].types | String[] | VariantType[] | - | Array of annotation type identifiers that a filter node controls. Can be plain strings (e.g., "person", "place") or variant witness objects (e.g., { Variant: "witness_id" }). |
| annotations.filters.items[i].label | String | - | Label to display for a filter node. |
| annotations.filters.items[i].items | FilterNode[] | - | Child filter nodes for nested filtering. |
| annotations.singleMode | String | - | Specifies only one annotations mode, which can be either aligned or list |
| annotations.types | AnnotationTypeConfigMap | - | A map of config objects for annotation types. This is used to display custom labels and icons in annotation items. |
| annotations.types[i].label | String | - | Custom label to display for an annotation type. |
| annotations.tooltipTypes | String[] | - | Annotation types to display as a tooltip when clicked instead of in the sidebar. These types will be excluded from the filters. |
| container | String | #app | Specifies the CSS selector where we should append the TIDO app to. |
| lang | String (ISO 639-1 language code) | en | Specifies the current active language of the app. See translations chapter. |
| panels | PanelConfig[] | [] | Defines an array of panel objects. The panels will appear in the same order. |
| panels[i].collection | String | - | TextAPI collection URL. |
| panels[i].item | String | - | TextAPI item URL. If not specified, the first item of the collection will be used. |
| panels[i].manifest | String | - | TextAPI manifest URL. If not specified, the first manifest of the collection will be used. |
| panels[i].selectedAnnotation | String | - | Specifies the ID of a specific annotation to select/display when the panel loads. |
| panels[i].showSidebar | Boolean | - | Controls whether the annotations sidebar is visible for this panel. |
| panels[i].views | PanelViewConfig[] | - | Overrides the global panelViews config for this specific panel. Use this to customize views per panel while still inheriting unset properties from the global config. |
| panelViews | PanelViewConfig[] | DefaultPanelViews | Configures an initial distribution of content views inside each panel. The defined views here can then be toggled on/off in the "View" dropdown in the panel header. See Panel Views chapter. |
| panelViews[i].activeContentType | String | - | Specifies which content type should be active/selected by default for this view. Use with contentTypes to set the default selection. |
| panelViews[i].contentTypes | String[] | - | Specifies a list of TextAPI content type identifiers. If multiple are given, a content type toggle with a dropdown selection will be shown. Users can then switch the respective content type within a split pane. |
| panelViews[i].label | String | Image | Text | Specifies a label for a view. It appears as title prefix in the content type toggle and in the "View" selection dropdown in the panel header. |
| panelViews[i].view | image | text | image | text | Specifies a view identifier that should be loaded into a split pane. |
| panelViews[i].visible | Boolean | true | Controls whether this view is visible in the panel. When false, the view will be hidden but can be toggled on via the "View" dropdown. |
| rootCollections | String[] | [] | Specifies a list of TextAPI collection URLs that appear in the global tree on the left. Users navigate and open new panels from those collections. |
| showAddNewPanelButton | Boolean | true | Toggles the display of the "add new panel" button. |
| showContentTypeToggle | Boolean | true | Toggles the display of the content type toggle in TextViews. When false, the whole bar is hidden. |
| showGlobalTree | Boolean | true | Toggles the display of the global tree on the left. When false the toggle button in the header is hidden. |
| theme | Object | Object | Specifies theme settings for UI elements. |
| theme.primaryColor | String | #3456aa, rgb(79, 70, 229), hsl(243, 75%, 59%), oklch(0.4743 0.1405 264.94) | Primary color of UI elements. Used on buttons and other interactive elements. The value can be provided as string in following color systems (hex, rgb, hsl, oklch). Alpha channel is not supported. |
| title | String | empty | Specifies the main title of the app in the header. Translatable. |
| translations | Object | null | Specifies a custom translations object. See translations chapter. |
| translations.[lang] | TranslationNamespace | - | Defines a language key. The value is a TranslationNamespace object. |
| translations.[lang].[namespace] | Object | - | Defines a translation key/value pair for a supported language. You can override existing key/value pairs or define custom key/value pairs. There is a list that we expose for overriding in the configuration. |
| translations.[lang].[namespace].[translationKey] | String | - | Defines a translation key/value pair for a supported language. You can override existing key/value pairs or define custom key/value pairs. There is a list that we expose for overriding in the configuration. |
Panel Views
This array of PanelViewConfig objects defines the actual visible content inside a panel. It is a list of
objects, each of which creates a resizable split pane inside the panel. This configuration will be applied to all
additionally added panels. Users can toggle on/off each split pane by the "View" dropdown in the panel header.
It will show your configured labels of each PanelViewConfig as options. If no label is stated, it will show the raw
content type identifier instead.
Types
| Key | Type |
|---|---|
| DefaultPanelViews | [{label: "Image", view: "image"}, {label: "Text", view: "text"}] |
Annotations
We provide configuration options to customize both the display and filtering of annotations.
The configuration is organized by concern. Each aspect can be defined independently using its own configuration object under a dedicated key.
Working with annotations, especially variants, can be complex. Variant annotations reference one or more witnesses, which are identified by string identifiers. Within the configuration, these witness identifiers are treated as annotation types. This allows you to apply the same configuration principles to witnesses as you would to any other annotation type.
If no annotations configuration is provided at all, TIDO will discover the currently available annotations on-the-fly. The visible types and filters are highly dependent on the loaded panel content.
Types
| Key | Type |
|---|---|
| types | AnnotationTypeConfigMap |
A map of config objects for annotation types. Each key represents the annotation type string ("x-content-type").
Each value is an AnnotationTypeConfig object for setting a custom label and icon.
These values will be used in the UI to customize the display of annotations items in the panel sidebar.
As mentioned above, variant annotations are a special case. In order to configure the witnesses display,
you can set a the idno value from the refs-Array in the annotationsPage response.
Example:
Code
Filters
| Key | Type |
|---|---|
| filters | AnnotationFiltersConfig |
Annotations displayed in the sidebar can be filtered by their type. You can define a hierarchical structure for these filter options, referred to as a filter tree. Each node in the filter tree can control multiple annotation types simultaneously. Therefore, you need to specify an array of annotation types that should be affected by a given filter node.
At the root level, you can optionally define a rootSelectionRule (allowed values: multiple or single) to control
the overall behavior and layout of the filter UI:
If set to single, the UI renders a tab bar containing the root-level nodes and a content area below it.
Selecting a tab updates the content area to display the child nodes of the selected root option.
If set to multiple, a multi-selection tree is rendered without a tab bar,
allowing multiple root-level nodes to be selected simultaneously.
If the rule is not specified, we set it to multiple.
Example:
Code
AnnotationsMode
By default we provide an AnnotationsMode toggle which enables switching between list and aligned mode. Aligned mode
will arrange annotations at the top position of text targets. List mode will ignore positioning and arrange the annotations
vertically one after another.
To specify the initial selected mode you should add defaultMode in annotations config as following.
Example:
Code
You can also have only one mode of annotations. In this case AnnotationsToggle is not shown anymore.
To accomplish this, you should add singleMode key in config as shown below.
Example:
Code
If no key regarding modes is specified, then by default AnnotationsToggle is shown with aligned mode as initially selected.
Translations
We provide a flexible way to use TIDO in your desired language. First of all we keep all translation keys in files
under public/translations. Each file has to follow the naming convention [ISO 639-1 language code].json. By default,
we provide a limited amount of supported languages. However, you can configure your custom languages though the TIDO config object.
Append your language under the translations key in the config and set the lang key to your language, so it is treated
as active language.
Collection Namespaces
In TIDO we give you the ability to define custom translations for different collections.
This is how it works:
The translation key/value pairs are always wrapped by a namespace which can be either common or a collection slug.
The default namespace is common and is used as a fallback namespace.
You have to provide at least one namespace in your translation objects. If you don't need to use collection namespaces it still has to be common.
If the namespace is a TextAPI collection slug,
we check at initialization time of each panel whether there is a match between the namespace key and the slug from the loaded collection.
You don't need to provide a full set of translation key/value pairs on each namespace.
As mentioned before, common is a fallback namespace, so if any translation key is missing on your collection namespace, it will still be translated from the commonnamespace.
Hint: There is a difference between fixed keys that we use internally (like add_new_panel) or dynamic keys that we might
receive from the TextAPI (like dynamic metadata keys). If you want to translate the latter ones, just state them as keys to your translation object.
Example:
Code
You can see that the first two keys add_new_panel and title are our fixed app keys and the other two keys are custom
project keys. If you set lang to a language that we don't support and omit certain translations in your config,
we will display those in English. If you don't provide a translation for a custom key, it will be displayed just as-is.
Also notice how the manifest key is being set to a different word for special_collection.