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

fixes, seq wrapper mark every loci, binding docs & cleanup

parent 954a5b58
No related branches found
No related tags found
No related merge requests found
......@@ -16,7 +16,7 @@ const M = ModifiersKeys
const Trigger = Binding.Trigger
const DefaultFocusLociBindings = {
clickCenterFocus: Binding(Trigger(B.Flag.Primary, M.create()), 'Center and focus the clicked element.'),
clickCenterFocus: Binding(Trigger(B.Flag.Primary, M.create()), 'Center and focus the clicked element using ${trigger}.'),
}
const FocusLociParams = {
minRadius: PD.Numeric(8, { min: 1, max: 50, step: 1 }),
......
......@@ -66,11 +66,10 @@ export const HighlightLoci = PluginBehavior.create({
const DefaultSelectLociBindings = {
clickSelect: Binding.Empty,
clickSelectExtend: Binding(Trigger(B.Flag.Primary, M.create({ shift: true })), 'Try to extend selection to clicked element along polymer.'),
clickSelectOnly: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Select only the clicked element.'),
clickSelectToggle: Binding(Trigger(B.Flag.Primary, M.create({ control: true })), 'Toggle clicked element.'),
clickSelectExtend: Binding(Trigger(B.Flag.Primary, M.create({ shift: true })), 'Extend selection to clicked element along polymer using ${trigger}.'),
clickSelectOnly: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Select only the clicked element using ${trigger}.'),
clickSelectToggle: Binding(Trigger(B.Flag.Primary, M.create({ control: true })), 'Toggle selection of clicked element using ${trigger}.'),
clickDeselect: Binding.Empty,
clickDeselectAllOnEmpty: Binding(Trigger(B.Flag.Secondary, M.create({ control: true })), 'Clear the selection when the clicked element is empty.'),
}
const SelectLociParams = {
bindings: PD.Value(DefaultSelectLociBindings, { isHidden: true }),
......@@ -120,10 +119,6 @@ export const SelectLoci = PluginBehavior.create({
if (Binding.match(this.params.bindings.clickDeselect, buttons, modifiers)) {
this.ctx.interactivity.lociSelects.deselect(current)
}
if (Binding.match(this.params.bindings.clickDeselectAllOnEmpty, buttons, modifiers)) {
this.ctx.interactivity.lociSelects.deselectAllOnEmpty(current)
}
});
this.ctx.interactivity.lociSelects.addProvider(this.lociMarkProvider)
......
......@@ -27,7 +27,7 @@ const M = ModifiersKeys
const Trigger = Binding.Trigger
const DefaultStructureRepresentationInteractionBindings = {
clickInteractionAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the structure interaction around only the clicked element.'),
clickInteractionAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the structure interaction around only the clicked element using ${trigger}.'),
}
const StructureRepresentationInteractionParams = {
bindings: PD.Value(DefaultStructureRepresentationInteractionBindings, { isHidden: true }),
......
......@@ -50,7 +50,7 @@ export namespace VolumeStreaming {
};
const DefaultBindings = {
clickVolumeAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the volume around only the clicked element.'),
clickVolumeAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the volume around only the clicked element using ${trigger}.'),
}
export function createParams(data?: VolumeServerInfo.Data, defaultView?: ViewTypes) {
......
......@@ -4,8 +4,8 @@
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { OrderedSet } from '../../../mol-data/int';
import { Loci } from '../../../mol-model/loci';
import { OrderedSet, Interval } from '../../../mol-data/int';
import { Loci, isEveryLoci } from '../../../mol-model/loci';
import { MarkerAction, applyMarkerAction } from '../../../mol-util/marker-action';
import { StructureElement, Structure, Unit } from '../../../mol-model/structure';
import { Color } from '../../../mol-util/color';
......@@ -22,9 +22,13 @@ abstract class SequenceWrapper<D> {
abstract getLoci(seqIdx: number): StructureElement.Loci
markResidue(loci: Loci, action: MarkerAction) {
return this.eachResidue(loci, (set: OrderedSet) => {
return applyMarkerAction(this.markerArray, set, action)
})
if (isEveryLoci(loci)) {
return applyMarkerAction(this.markerArray, Interval.ofLength(this.length), action)
} else {
return this.eachResidue(loci, (set: OrderedSet) => {
return applyMarkerAction(this.markerArray, set, action)
})
}
}
constructor(readonly data: D, readonly markerArray: Uint8Array, readonly length: number) {
......
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