UNPKG

molstar

Version:

A comprehensive macromolecular library.

37 lines 1.35 kB
/** * Copyright (c) 2019 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author Alexander Rose <alexander.rose@weirdbyte.de> */ import { ShapeGroup } from '../../mol-model/shape'; import { ParamDefinition as PD } from '../../mol-util/param-definition'; var DefaultSize = 1; var Description = 'Assigns sizes as defined by the shape object.'; export var ShapeGroupSizeThemeParams = {}; export function getShapeGroupSizeThemeParams(ctx) { return ShapeGroupSizeThemeParams; // TODO return copy } export function ShapeGroupSizeTheme(ctx, props) { return { factory: ShapeGroupSizeTheme, granularity: 'groupInstance', size: function (location) { if (ShapeGroup.isLocation(location)) { return location.shape.getSize(location.group, location.instance); } return DefaultSize; }, props: props, description: Description }; } export var ShapeGroupSizeThemeProvider = { name: 'shape-group', label: 'Shape Group', category: '', factory: ShapeGroupSizeTheme, getParams: getShapeGroupSizeThemeParams, defaultValues: PD.getDefaultValues(ShapeGroupSizeThemeParams), isApplicable: function (ctx) { return !!ctx.shape; } }; //# sourceMappingURL=shape-group.js.map