UNPKG

molstar

Version:

A comprehensive macromolecular library.

38 lines (37 loc) 1.97 kB
"use strict"; /** * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ Object.defineProperty(exports, "__esModule", { value: true }); exports.PointRepresentationProvider = exports.PointRepresentation = exports.getPointParams = exports.PointParams = void 0; var tslib_1 = require("tslib"); var element_point_1 = require("../visual/element-point"); var units_representation_1 = require("../units-representation"); var param_definition_1 = require("../../../mol-util/param-definition"); var representation_1 = require("../representation"); var representation_2 = require("../../../mol-repr/representation"); var PointVisuals = { 'element-point': function (ctx, getParams) { return (0, units_representation_1.UnitsRepresentation)('Points', ctx, getParams, element_point_1.ElementPointVisual); }, }; exports.PointParams = tslib_1.__assign({}, element_point_1.ElementPointParams); function getPointParams(ctx, structure) { return param_definition_1.ParamDefinition.clone(exports.PointParams); } exports.getPointParams = getPointParams; function PointRepresentation(ctx, getParams) { return representation_2.Representation.createMulti('Point', ctx, getParams, representation_1.StructureRepresentationStateBuilder, PointVisuals); } exports.PointRepresentation = PointRepresentation; exports.PointRepresentationProvider = (0, representation_1.StructureRepresentationProvider)({ name: 'point', label: 'Point', description: 'Displays elements (atoms, coarse spheres) as points.', factory: PointRepresentation, getParams: getPointParams, defaultValues: param_definition_1.ParamDefinition.getDefaultValues(exports.PointParams), defaultColorTheme: { name: 'element-symbol' }, defaultSizeTheme: { name: 'uniform' }, isApplicable: function (structure) { return structure.elementCount > 0; } });