diff --git a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts index 8a5da762cb8ce85f352247902ac3f62f2c0940d4..0469f6895888095521d8384726740f55ff5d9592 100644 --- a/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts +++ b/src/mol-plugin/behavior/dynamic/volume-streaming/behavior.ts @@ -49,11 +49,11 @@ export namespace VolumeStreaming { valuesInfo: [{ mean: 0, min: -1, max: 1, sigma: 0.1 }, { mean: 0, min: -1, max: 1, sigma: 0.1 }] }; - const DefaultBindings = { + export const DefaultBindings = { clickVolumeAroundOnly: Binding(Trigger(B.Flag.Secondary, M.create()), 'Show the volume around only the clicked element using ${trigger}.'), } - export function createParams(data?: VolumeServerInfo.Data, defaultView?: ViewTypes) { + export function createParams(data?: VolumeServerInfo.Data, defaultView?: ViewTypes, binding?: typeof DefaultBindings) { // fake the info const info = data || { kind: 'em', header: { sampling: [fakeSampling], availablePrecisions: [{ precision: 0, maxVoxels: 0 }] }, emDefaultContourLevel: VolumeIsoValue.relative(0) }; const box = (data && data.structure.boundary.box) || Box3D.empty(); @@ -84,7 +84,7 @@ export namespace VolumeStreaming { 'fo-fc(+ve)': channelParam('Fo-Fc(+ve)', Color(0x33BB33), VolumeIsoValue.relative(3), info.header.sampling[0].valuesInfo[1]), 'fo-fc(-ve)': channelParam('Fo-Fc(-ve)', Color(0xBB3333), VolumeIsoValue.relative(-3), info.header.sampling[0].valuesInfo[1]), }, { isFlat: true }), - bindings: PD.Value(DefaultBindings, { isHidden: true }), + bindings: PD.Value(binding || DefaultBindings, { isHidden: true }), }; } diff --git a/src/mol-plugin/behavior/dynamic/volume-streaming/transformers.ts b/src/mol-plugin/behavior/dynamic/volume-streaming/transformers.ts index 492ef447fe102d20cd7ffe934ced22e533ccdb55..d4f3940b79ea1ab73872ac2aadc09e9383b02759 100644 --- a/src/mol-plugin/behavior/dynamic/volume-streaming/transformers.ts +++ b/src/mol-plugin/behavior/dynamic/volume-streaming/transformers.ts @@ -35,6 +35,7 @@ export const InitVolumeStreaming = StateAction.build({ defaultView: PD.Select<VolumeStreaming.ViewTypes>(method === 'em' ? 'cell' : 'selection-box', VolumeStreaming.ViewTypeOptions as any), behaviorRef: PD.Text('', { isHidden: true }), emContourProvider: PD.Select<'wwpdb' | 'pdbe'>('wwpdb', [['wwpdb', 'wwPDB'], ['pdbe', 'PDBe']], { isHidden: true }), + bindings: PD.Value(VolumeStreaming.DefaultBindings, { isHidden: true }), }; }, isApplicable: (a) => a.data.models.length === 1 @@ -61,7 +62,7 @@ export const InitVolumeStreaming = StateAction.build({ const infoObj = await state.updateTree(infoTree).runInContext(taskCtx); const behTree = state.build().to(infoTree.ref).apply(CreateVolumeStreamingBehavior, - PD.getDefaultValues(VolumeStreaming.createParams(infoObj.data, params.defaultView)), + PD.getDefaultValues(VolumeStreaming.createParams(infoObj.data, params.defaultView, params.bindings)), { ref: params.behaviorRef ? params.behaviorRef : void 0 }); if (params.method === 'em') {