Browse Source

set isoValue param as essential

Alexander Rose 5 years ago
parent
commit
c233be4467
2 changed files with 4 additions and 3 deletions
  1. 2 1
      src/mol-repr/volume/isosurface.ts
  2. 2 2
      src/mol-util/param-definition.ts

+ 2 - 1
src/mol-repr/volume/isosurface.ts

@@ -53,7 +53,8 @@ export function createIsoValueParam(defaultValue: VolumeIsoValue, stats?: Volume
             )
         },
         (v: VolumeIsoValue) => v.kind === 'absolute' ? 'absolute' : 'relative',
-        (v: VolumeIsoValue, c: 'absolute' | 'relative') => c === 'absolute' ? VolumeIsoValue.toAbsolute(v, sts) : VolumeIsoValue.toRelative(v, sts)
+        (v: VolumeIsoValue, c: 'absolute' | 'relative') => c === 'absolute' ? VolumeIsoValue.toAbsolute(v, sts) : VolumeIsoValue.toRelative(v, sts),
+        { isEssential: true }
     );
 }
 

+ 2 - 2
src/mol-util/param-definition.ts

@@ -270,9 +270,9 @@ export namespace ParamDefinition {
         conditionForValue(v: T): keyof C
         conditionedValue(v: T, condition: keyof C): T,
     }
-    export function Conditioned<T, P extends Base<T>, C = { [k: string]: P }>(defaultValue: T, conditionParams: C, conditionForValue: (v: T) => keyof C, conditionedValue: (v: T, condition: keyof C) => T): Conditioned<T, P, C> {
+    export function Conditioned<T, P extends Base<T>, C = { [k: string]: P }>(defaultValue: T, conditionParams: C, conditionForValue: (v: T) => keyof C, conditionedValue: (v: T, condition: keyof C) => T, info?: Info): Conditioned<T, P, C> {
         const options = Object.keys(conditionParams).map(k => [k, k]) as [string, string][];
-        return { type: 'conditioned', select: Select<string>(conditionForValue(defaultValue) as string, options), defaultValue, conditionParams, conditionForValue, conditionedValue };
+        return setInfo({ type: 'conditioned', select: Select<string>(conditionForValue(defaultValue) as string, options, info), defaultValue, conditionParams, conditionForValue, conditionedValue }, info);
     }
 
     export interface Script extends Base<ScriptData> {