drugflow-molstar
Version:
Molstar implementation for DrugFlow
50 lines (49 loc) • 2.44 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PDBeDomainAnnotations = void 0;
var tslib_1 = require("tslib");
var prop_1 = require("./prop");
var color_1 = require("./color");
var param_definition_1 = require("Molstar/mol-util/param-definition");
var behavior_1 = require("Molstar/mol-plugin/behavior");
exports.PDBeDomainAnnotations = behavior_1.PluginBehavior.create({
name: 'pdbe-domain-annotations-prop',
category: 'custom-props',
display: {
name: 'Domain annotations',
description: 'Data for domain annotations, obtained via PDBe.'
},
ctor: /** @class */ (function (_super) {
tslib_1.__extends(class_1, _super);
function class_1() {
var _this = _super.apply(this, tslib_1.__spreadArray([], tslib_1.__read(arguments), false)) || this;
_this.provider = prop_1.DomainAnnotationsProvider;
_this.labelDomainAnnotations = {
label: function (loci) { return void 0; }
};
return _this;
}
class_1.prototype.register = function () {
this.ctx.customModelProperties.register(this.provider, this.params.autoAttach);
this.ctx.managers.lociLabels.addProvider(this.labelDomainAnnotations);
this.ctx.representation.structure.themes.colorThemeRegistry.add(color_1.DomainAnnotationsColorThemeProvider);
};
class_1.prototype.update = function (p) {
var updated = this.params.autoAttach !== p.autoAttach;
this.params.autoAttach = p.autoAttach;
this.params.showTooltip = p.showTooltip;
this.ctx.customModelProperties.setDefaultAutoAttach(this.provider.descriptor.name, this.params.autoAttach);
return updated;
};
class_1.prototype.unregister = function () {
this.ctx.customModelProperties.unregister(prop_1.DomainAnnotationsProvider.descriptor.name);
this.ctx.managers.lociLabels.removeProvider(this.labelDomainAnnotations);
this.ctx.representation.structure.themes.colorThemeRegistry.remove(color_1.DomainAnnotationsColorThemeProvider);
};
return class_1;
}(behavior_1.PluginBehavior.Handler)),
params: function () { return ({
autoAttach: param_definition_1.ParamDefinition.Boolean(false),
showTooltip: param_definition_1.ParamDefinition.Boolean(true)
}); }
});