diff --git a/src/mol-plugin/behavior/dynamic/labels.ts b/src/mol-plugin/behavior/dynamic/labels.ts index f717178939a788da751fa6bb364176fa7a41b391..f30f4464e52091c277f7cdcf9531faf4f5d5a5c5 100644 --- a/src/mol-plugin/behavior/dynamic/labels.ts +++ b/src/mol-plugin/behavior/dynamic/labels.ts @@ -74,6 +74,7 @@ function getLabelsText(data: LabelsData, props: PD.Values<Text.Params>, text?: T export const SceneLabels = PluginBehavior.create<SceneLabelsProps>({ name: 'scene-labels', display: { name: 'Scene Labels', group: 'Labels' }, + canAutoUpdate: () => true, ctor: class extends PluginBehavior.Handler<SceneLabelsProps> { private data: LabelsData = { transforms: [Mat4.identity()], diff --git a/src/mol-plugin/context.ts b/src/mol-plugin/context.ts index 069805cb01d623126d81116f43fd632e0449076e..6de25de940cab524258ede72007a227af87d05a7 100644 --- a/src/mol-plugin/context.ts +++ b/src/mol-plugin/context.ts @@ -136,7 +136,7 @@ export class PluginContext { const tree = this.state.behaviorState.tree.build(); for (const b of this.spec.behaviors) { - tree.toRoot().apply(b.transformer, b.defaultParams || { }, { ref: b.transformer.id }); + tree.toRoot().apply(b.transformer, b.defaultParams, { ref: b.transformer.id }); } await this.runTask(this.state.behaviorState.update(tree)); diff --git a/src/mol-plugin/index.ts b/src/mol-plugin/index.ts index 55eed51e3f48ae9a6945a6f2e1c9a3110aa17b02..169ab40370fd6b273ddcb865a7f4c40d24a3cdb6 100644 --- a/src/mol-plugin/index.ts +++ b/src/mol-plugin/index.ts @@ -14,8 +14,6 @@ import { PluginSpec } from './spec'; import { DownloadStructure, CreateComplexRepresentation, OpenStructure } from './state/actions/basic'; import { StateTransforms } from './state/transforms'; import { PluginBehaviors } from './behavior'; -import { ParamDefinition as PD } from 'mol-util/param-definition' -import { SceneLabelsParams } from './behavior/dynamic/labels'; function getParam(name: string, regex: string): string { let r = new RegExp(`${name}=(${regex})[&]?`, 'i'); @@ -40,7 +38,7 @@ const DefaultSpec: PluginSpec = { PluginSpec.Behavior(PluginBehaviors.Representation.DefaultLociLabelProvider), PluginSpec.Behavior(PluginBehaviors.Camera.FocusLociOnSelect, { minRadius: 20, extraRadius: 4 }), PluginSpec.Behavior(PluginBehaviors.Animation.StructureAnimation, { rotate: false, rotateValue: 0, explode: false, explodeValue: 0 }), - PluginSpec.Behavior(PluginBehaviors.Labels.SceneLabels, { ...PD.getDefaultValues(SceneLabelsParams) }), // TODO how to properly call PluginBehaviors.Labels.SceneLabels.definition.params() + PluginSpec.Behavior(PluginBehaviors.Labels.SceneLabels), PluginSpec.Behavior(PluginBehaviors.CustomProps.PDBeStructureQualityReport, { autoAttach: true }), PluginSpec.Behavior(PluginBehaviors.CustomProps.RCSBAssemblySymmetry, { autoAttach: true }), ]