molstar
Version:
A comprehensive macromolecular library.
40 lines • 2.67 kB
JavaScript
/**
* Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
*
* @author Alexander Rose <alexander.rose@weirdbyte.de>
*/
import { __assign } from "tslib";
import { Model } from '../../../mol-model/structure';
import { Representation } from '../../../mol-repr/representation';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { ComplexRepresentation } from '../complex-representation';
import { StructureRepresentationProvider, StructureRepresentationStateBuilder } from '../representation';
import { CarbohydrateLinkParams, CarbohydrateLinkVisual } from '../visual/carbohydrate-link-cylinder';
import { CarbohydrateSymbolParams, CarbohydrateSymbolVisual } from '../visual/carbohydrate-symbol-mesh';
import { CarbohydrateTerminalLinkParams, CarbohydrateTerminalLinkVisual } from '../visual/carbohydrate-terminal-link-cylinder';
var CarbohydrateVisuals = {
'carbohydrate-symbol': function (ctx, getParams) { return ComplexRepresentation('Carbohydrate symbol mesh', ctx, getParams, CarbohydrateSymbolVisual); },
'carbohydrate-link': function (ctx, getParams) { return ComplexRepresentation('Carbohydrate link cylinder', ctx, getParams, CarbohydrateLinkVisual); },
'carbohydrate-terminal-link': function (ctx, getParams) { return ComplexRepresentation('Carbohydrate terminal link cylinder', ctx, getParams, CarbohydrateTerminalLinkVisual); },
};
export var CarbohydrateParams = __assign(__assign(__assign(__assign({}, CarbohydrateSymbolParams), CarbohydrateLinkParams), CarbohydrateTerminalLinkParams), { visuals: PD.MultiSelect(['carbohydrate-symbol', 'carbohydrate-link', 'carbohydrate-terminal-link'], PD.objectToOptions(CarbohydrateVisuals)) });
export function getCarbohydrateParams(ctx, structure) {
return PD.clone(CarbohydrateParams);
}
export function CarbohydrateRepresentation(ctx, getParams) {
return Representation.createMulti('Carbohydrate', ctx, getParams, StructureRepresentationStateBuilder, CarbohydrateVisuals);
}
export var CarbohydrateRepresentationProvider = StructureRepresentationProvider({
name: 'carbohydrate',
label: 'Carbohydrate',
description: 'Displays carbohydrate symbols (3D SNFG).',
factory: CarbohydrateRepresentation,
getParams: getCarbohydrateParams,
defaultValues: PD.getDefaultValues(CarbohydrateParams),
defaultColorTheme: { name: 'carbohydrate-symbol' },
defaultSizeTheme: { name: 'uniform' },
isApplicable: function (structure) {
return structure.models.some(function (m) { return Model.hasCarbohydrate(m); });
}
});
//# sourceMappingURL=carbohydrate.js.map