Within selection object. Used to find the subset of an atom selection that is within
some distance from another atom selection. When added as a field of an AtomSelectionSpec,
intersects the set of atoms in that selection with the set of atoms within a given
distance from the given AtomSelectionSpec.


 viewer.setStyle({chain: 'A', within:{distance: 10, sel:{chain: 'B'}}}, {sphere:{}});
});// stylizes atoms in chain A that are within 10 angstroms of an atom in chain B


distance :number

the distance in angstroms away from the atom selection to include atoms in the parent selection

  • number

invert :boolean

if set, selects atoms not within distance range for intersection

  • boolean

sel :AtomSelectionSpec

the selection of atoms against which to measure the distance from the parent atom selection