UNPKG

molstar

Version:

A comprehensive macromolecular library.

28 lines 1.11 kB
/** * Copyright (c) 2019-2020 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal <david.sehnal@gmail.com> * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { CustomElementProperty } from '../../mol-model-props/common/custom-element-property'; import { Color } from '../../mol-util/color'; export var StripedResidues = CustomElementProperty.create({ label: 'Residue Stripes', name: 'basic-wrapper-residue-striping', getData: function (model) { var map = new Map(); var residueIndex = model.atomicHierarchy.residueAtomSegments.index; for (var i = 0, _i = model.atomicHierarchy.atoms._rowCount; i < _i; i++) { map.set(i, residueIndex[i] % 2); } return { value: map }; }, coloring: { getColor: function (e) { return e === 0 ? Color(0xff0000) : Color(0x0000ff); }, defaultColor: Color(0x777777) }, getLabel: function (e) { return e === 0 ? 'Odd stripe' : 'Even stripe'; } }); //# sourceMappingURL=coloring.js.map