molstar
Version:
A comprehensive macromolecular library.
33 lines (32 loc) • 1.57 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 { ElementPointVisual, ElementPointParams } from '../visual/element-point';
import { UnitsRepresentation } from '../units-representation';
import { ParamDefinition as PD } from '../../../mol-util/param-definition';
import { StructureRepresentationProvider, StructureRepresentationStateBuilder } from '../representation';
import { Representation } from '../../../mol-repr/representation';
var PointVisuals = {
'element-point': function (ctx, getParams) { return UnitsRepresentation('Points', ctx, getParams, ElementPointVisual); },
};
export var PointParams = __assign({}, ElementPointParams);
export function getPointParams(ctx, structure) {
return PD.clone(PointParams);
}
export function PointRepresentation(ctx, getParams) {
return Representation.createMulti('Point', ctx, getParams, StructureRepresentationStateBuilder, PointVisuals);
}
export var PointRepresentationProvider = StructureRepresentationProvider({
name: 'point',
label: 'Point',
description: 'Displays elements (atoms, coarse spheres) as points.',
factory: PointRepresentation,
getParams: getPointParams,
defaultValues: PD.getDefaultValues(PointParams),
defaultColorTheme: { name: 'element-symbol' },
defaultSizeTheme: { name: 'uniform' },
isApplicable: function (structure) { return structure.elementCount > 0; }
});