Skip to main content

Coordination Types

Vitessce defines several coordination types upon which views can be coordinated via the view config. The coordination types found on this page are all valid values for the keys of the coordinationSpace object in the view config.

Initial coordination values

Coordination values may be defined in the coordinationSpace object in the view config upon the initial load of Vitessce.

To simplify the configuration process for the most common use cases of Vitessce, coordination values are automatically initialized where possible. There are multiple mechanisms by which automatic initialization of coordination values can occur. In general, when user-defined coordination values are present in the configuration, the user-defined values will take precedence over automatically-initialized values.

Default values

Every coordination type is accompanied by a default value. During initialization of the view config (prior to any views being rendered or data being loaded), default values are filled in for any views that use the coordination type but lack a coordination value/scope mapping. This process is limited to a single level of coordination and cannot account for data-dependent values.

Data-dependent values (single-level)

Each data loader may return a coordinationValues object from its load method, which looks like:

{
someCoordinationType: 'someInitialValue',
}

The values in this object will be used if the view config does not specify a value for the coordination type (i.e., if the initial value is null or undefined).

Data-dependent values (multi-level)

Multi-level coordination initialization is complex as it relies on meta-coordination. For views that support multi-level coordination, the coordinationValues object returned by a data loader class may contain CoordinationLevel (CL) objects:

{
primaryCoordinationType: CL([
{
secondaryCoordinationType: 'someInitialValue',
},
]),
}

This will be automatically expanded into:

{
primaryCoordinationType: {
'init_{datasetUid}_{dataType}_0': '',
},
secondaryCoordinationType: {
'init_{datasetUid}_{dataType}_0': 'someInitialValue',
},
metaCoordinationScopes: {
'init_{datasetUid}_{dataType}_0': {
primaryCoordinationType: ['init_{datasetUid}_{dataType}_0'],
},
},
metaCoordinationScopesBy: {
'init_{datasetUid}_{dataType}_0': {
primaryCoordinationType: {
secondaryCoordinationType: {
'init_{datasetUid}_{dataType}_0': 'init_{datasetUid}_{dataType}_0',
},
},
},
}
}

The automatically-generated metaCoordinationScopes and metaCoordinationScopesBy scopes will be mapped to views by prepending them so that existing meta-coordination takes precedence. If any of the automatically-generated scopes already exist (i.e., were user-defined), they will not be overwritten. The generation of these coordination scope names is deterministic to enable the user to override their values manually if desired. However, it is recommended to define all values when possible.

Data-dependent values via file options

In some cases, the initial value may be partially data-dependent. Data loader classes may use values from the options property of a file definition to define the values in the coordinationValues object. Whether this pattern is supported (and how) will depend on the implementation of each data loader class.

Multi-level coordination

The spatialBeta and layerControllerBeta views support multi-level coordination. They support the following hierarchies of coordination types:

  • imageLayer
    • fileUid
    • spatialLayerVisible
    • spatialLayerOpacity
    • spatialLayerColormap
    • spatialLayerTransparentColor
    • spatialLayerModelMatrix
    • volumetricRenderingAlgorithm
    • spatialTargetResolution
    • spatialSliceX
    • spatialSliceY
    • spatialSliceZ
    • photometricInterpretation
    • pixelHighlight
    • tooltipsVisible
    • spatialChannelLabelsVisible
    • spatialChannelLabelsOrientation
    • spatialChannelLabelSize
    • imageChannel
      • spatialTargetC
      • spatialChannelVisible
      • spatialChannelColor
      • spatialChannelWindow
  • segmentationLayer
    • fileUid
    • spatialLayerVisible
    • spatialLayerOpacity
    • segmentationChannel
      • obsType
      • spatialTargetC
      • spatialChannelVisible
      • spatialChannelOpacity
      • spatialChannelColor
      • spatialSegmentationFilled
      • spatialSegmentationStrokeWidth
      • obsColorEncoding
      • featureSelection
      • featureValueColormap
      • featureValueColormapRange
      • obsSetColor
      • obsSetSelection
      • additionalObsSets
      • obsHighlight
      • tooltipsVisible
      • tooltipCrosshairsVisible
      • legendVisible
  • spotLayer
    • obsType
    • spatialLayerVisible
    • spatialLayerOpacity
    • spatialSpotRadius
    • spatialSpotFilled
    • spatialSpotStrokeWidth
    • obsColorEncoding
    • featureSelection
    • featureValueColormap
    • featureValueColormapRange
    • obsSetColor
    • obsSetSelection
    • additionalObsSets
    • spatialLayerColor
    • obsHighlight
    • tooltipsVisible
    • tooltipCrosshairsVisible
    • legendVisible
  • pointLayer
    • obsType
    • spatialLayerVisible
    • spatialLayerOpacity
    • obsColorEncoding
    • featureSelection
    • featureValueColormap
    • featureValueColormapRange
    • spatialLayerColor
    • obsHighlight
    • tooltipsVisible
    • tooltipCrosshairsVisible
    • legendVisible