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

renamed lociExpansion to granularity

parent b1a0f46a
No related branches found
No related tags found
No related merge requests found
......@@ -52,17 +52,17 @@ namespace Interactivity {
export const Empty: Loci = { loci: EmptyLoci };
}
const LociExpansion = {
'none': (loci: ModelLoci) => loci,
const Granularity = {
'element': (loci: ModelLoci) => loci,
'residue': (loci: ModelLoci) => SE.isLoci(loci) ? SE.Loci.extendToWholeResidues(loci) : loci,
'chain': (loci: ModelLoci) => SE.isLoci(loci) ? SE.Loci.extendToWholeChains(loci) : loci,
'structure': (loci: ModelLoci) => SE.isLoci(loci) ? Structure.Loci(loci.structure) : loci
}
type LociExpansion = keyof typeof LociExpansion
const LociExpansionOptions = Object.keys(LociExpansion).map(n => [n, capitalize(n)]) as [LociExpansion, string][]
type Granularity = keyof typeof Granularity
const GranularityOptions = Object.keys(Granularity).map(n => [n, capitalize(n)]) as [Granularity, string][]
export const Params = {
lociExpansion: PD.Select('residue', LociExpansionOptions),
granularity: PD.Select('residue', GranularityOptions),
}
export type Props = PD.Values<typeof Params>
......@@ -92,10 +92,10 @@ namespace Interactivity {
normalizedLoci(interactivityLoci: Loci) {
let { loci, repr } = interactivityLoci
if (this.props.lociExpansion !== 'none' && Link.isLoci(loci)) {
if (this.props.granularity !== 'element' && Link.isLoci(loci)) {
loci = Link.toStructureElementLoci(loci)
}
loci = LociExpansion[this.props.lociExpansion](loci)
loci = Granularity[this.props.granularity](loci)
return { loci, repr }
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment