Skip to content
Snippets Groups Projects
Commit 4bff55b6 authored by Alexander Rose's avatar Alexander Rose
Browse files

improve theme applicability checks

parent dbc4e099
No related branches found
No related tags found
No related merge requests found
......@@ -69,5 +69,5 @@ export const CarbohydrateSymbolColorThemeProvider: ColorTheme.Provider<Carbohydr
factory: CarbohydrateSymbolColorTheme,
getParams: getCarbohydrateSymbolColorThemeParams,
defaultValues: PD.getDefaultValues(CarbohydrateSymbolColorThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.carbohydrates.elements.length > 0
}
\ No newline at end of file
......@@ -72,5 +72,5 @@ export const CrossLinkColorThemeProvider: ColorTheme.Provider<CrossLinkColorThem
factory: CrossLinkColorTheme,
getParams: getCrossLinkColorThemeParams,
defaultValues: PD.getDefaultValues(CrossLinkColorThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.crossLinkRestraints.count > 0
}
\ No newline at end of file
......@@ -64,5 +64,5 @@ export const ModelIndexColorThemeProvider: ColorTheme.Provider<ModelIndexColorTh
factory: ModelIndexColorTheme,
getParams: getModelIndexColorThemeParams,
defaultValues: PD.getDefaultValues(ModelIndexColorThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models.length > 1
}
\ No newline at end of file
......@@ -63,5 +63,5 @@ export const OccupancyColorThemeProvider: ColorTheme.Provider<OccupancyColorThem
factory: OccupancyColorTheme,
getParams: getOccupancyColorThemeParams,
defaultValues: PD.getDefaultValues(OccupancyColorThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models.some(m => m.atomicConformation.occupancy.isDefined)
}
\ No newline at end of file
......@@ -67,5 +67,5 @@ export const UncertaintyColorThemeProvider: ColorTheme.Provider<UncertaintyColor
factory: UncertaintyColorTheme,
getParams: getUncertaintyColorThemeParams,
defaultValues: PD.getDefaultValues(UncertaintyColorThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models.some(m => m.atomicConformation.B_iso_or_equiv.isDefined || m.sourceData.data.ihm_sphere_obj_site.rmsf.isDefined)
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ import { ParamDefinition as PD } from '../../mol-util/param-definition'
import { ThemeDataContext } from '../../mol-theme/theme';
const DefaultSize = 1
const Description = 'Assigns a physical size.'
const Description = 'Assigns a physical size, i.e. vdW radius for atoms or given radius for coarse spheres.'
export const PhysicalSizeThemeParams = {}
export type PhysicalSizeThemeParams = typeof PhysicalSizeThemeParams
......
......@@ -57,5 +57,5 @@ export const UncertaintySizeThemeProvider: SizeTheme.Provider<UncertaintySizeThe
factory: UncertaintySizeTheme,
getParams: getUncertaintySizeThemeParams,
defaultValues: PD.getDefaultValues(UncertaintySizeThemeParams),
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure // TODO check if the structure has Uncertainty (B-factor, RMSF, ...) values
isApplicable: (ctx: ThemeDataContext) => !!ctx.structure && ctx.structure.models.some(m => m.atomicConformation.B_iso_or_equiv.isDefined || m.sourceData.data.ihm_sphere_obj_site.rmsf.isDefined)
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment