UNPKG

molstar

Version:

A comprehensive macromolecular library.

36 lines 1.67 kB
/** * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { __assign, __awaiter, __generator } from "tslib"; import { ParamDefinition as PD } from '../../mol-util/param-definition'; import { calcValenceModel, ValenceModelParams as _ValenceModelParams } from './chemistry/valence-model'; import { CustomStructureProperty } from '../common/custom-structure-property'; import { CustomPropertyDescriptor } from '../../mol-model/custom-property'; export var ValenceModelParams = __assign({}, _ValenceModelParams); export var ValenceModelProvider = CustomStructureProperty.createProvider({ label: 'Valence Model', descriptor: CustomPropertyDescriptor({ name: 'molstar_computed_valence_model', // TODO `cifExport` and `symbol` }), type: 'local', defaultParams: ValenceModelParams, getParams: function (data) { return ValenceModelParams; }, isApplicable: function (data) { return true; }, obtain: function (ctx, data, props) { return __awaiter(void 0, void 0, void 0, function () { var p; var _a; return __generator(this, function (_b) { switch (_b.label) { case 0: p = __assign(__assign({}, PD.getDefaultValues(ValenceModelParams)), props); _a = {}; return [4 /*yield*/, calcValenceModel(ctx.runtime, data, p)]; case 1: return [2 /*return*/, (_a.value = _b.sent(), _a)]; } }); }); } }); //# sourceMappingURL=valence-model.js.map