molstar
Version:
A comprehensive macromolecular library.
42 lines • 1.73 kB
JavaScript
/**
* Copyright (c) 2019 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.ShapeGroupSizeThemeProvider = exports.ShapeGroupSizeTheme = exports.getShapeGroupSizeThemeParams = exports.ShapeGroupSizeThemeParams = void 0;
var shape_1 = require("../../mol-model/shape");
var param_definition_1 = require("../../mol-util/param-definition");
var DefaultSize = 1;
var Description = 'Assigns sizes as defined by the shape object.';
exports.ShapeGroupSizeThemeParams = {};
function getShapeGroupSizeThemeParams(ctx) {
return exports.ShapeGroupSizeThemeParams; // TODO return copy
}
exports.getShapeGroupSizeThemeParams = getShapeGroupSizeThemeParams;
function ShapeGroupSizeTheme(ctx, props) {
return {
factory: ShapeGroupSizeTheme,
granularity: 'groupInstance',
size: function (location) {
if (shape_1.ShapeGroup.isLocation(location)) {
return location.shape.getSize(location.group, location.instance);
}
return DefaultSize;
},
props: props,
description: Description
};
}
exports.ShapeGroupSizeTheme = ShapeGroupSizeTheme;
exports.ShapeGroupSizeThemeProvider = {
name: 'shape-group',
label: 'Shape Group',
category: '',
factory: ShapeGroupSizeTheme,
getParams: getShapeGroupSizeThemeParams,
defaultValues: param_definition_1.ParamDefinition.getDefaultValues(exports.ShapeGroupSizeThemeParams),
isApplicable: function (ctx) { return !!ctx.shape; }
};
//# sourceMappingURL=shape-group.js.map
;