Bladeren bron

wip: param refactroing

David Sehnal 6 jaren geleden
bovenliggende
commit
1eb9d0ed5c
48 gewijzigde bestanden met toevoegingen van 194 en 194 verwijderingen
  1. 1 1
      src/mol-app/component/parameter/boolean.tsx
  2. 1 1
      src/mol-app/component/parameter/multi-select.tsx
  3. 1 1
      src/mol-app/component/parameter/number.tsx
  4. 1 1
      src/mol-app/component/parameter/range.tsx
  5. 1 1
      src/mol-app/component/parameter/select.tsx
  6. 1 1
      src/mol-app/component/parameter/text.tsx
  7. 1 1
      src/mol-app/component/parameters.tsx
  8. 5 5
      src/mol-geo/geometry/direct-volume/direct-volume.ts
  9. 9 9
      src/mol-geo/geometry/geometry.ts
  10. 5 5
      src/mol-geo/geometry/lines/lines.ts
  11. 4 4
      src/mol-geo/geometry/mesh/mesh.ts
  12. 7 7
      src/mol-geo/geometry/points/points.ts
  13. 6 6
      src/mol-model/structure/structure/unit/gaussian-density.ts
  14. 1 1
      src/mol-repr/index.ts
  15. 2 2
      src/mol-repr/shape/index.ts
  16. 4 4
      src/mol-repr/structure/complex-visual.ts
  17. 7 7
      src/mol-repr/structure/index.ts
  18. 1 1
      src/mol-repr/structure/representation/backbone.ts
  19. 5 5
      src/mol-repr/structure/representation/ball-and-stick.ts
  20. 4 4
      src/mol-repr/structure/representation/carbohydrate.ts
  21. 3 3
      src/mol-repr/structure/representation/cartoon.ts
  22. 3 3
      src/mol-repr/structure/representation/distance-restraint.ts
  23. 2 2
      src/mol-repr/structure/representation/molecular-surface.ts
  24. 1 1
      src/mol-repr/structure/representation/point.ts
  25. 1 1
      src/mol-repr/structure/representation/spacefill.ts
  26. 6 6
      src/mol-repr/structure/units-visual.ts
  27. 4 4
      src/mol-repr/structure/visual/carbohydrate-link-cylinder.ts
  28. 4 4
      src/mol-repr/structure/visual/carbohydrate-symbol-mesh.ts
  29. 3 3
      src/mol-repr/structure/visual/cross-link-restraint-cylinder.ts
  30. 4 4
      src/mol-repr/structure/visual/element-point.ts
  31. 5 5
      src/mol-repr/structure/visual/element-sphere.ts
  32. 4 4
      src/mol-repr/structure/visual/gaussian-density-point.ts
  33. 1 1
      src/mol-repr/structure/visual/gaussian-density-volume.ts
  34. 1 1
      src/mol-repr/structure/visual/gaussian-surface-mesh.ts
  35. 4 4
      src/mol-repr/structure/visual/gaussian-surface-wireframe.ts
  36. 4 4
      src/mol-repr/structure/visual/inter-unit-link-cylinder.ts
  37. 4 4
      src/mol-repr/structure/visual/intra-unit-link-cylinder.ts
  38. 1 1
      src/mol-repr/structure/visual/nucleotide-block-mesh.ts
  39. 5 5
      src/mol-repr/structure/visual/polymer-backbone-cylinder.ts
  40. 4 4
      src/mol-repr/structure/visual/polymer-direction-wedge.ts
  41. 10 10
      src/mol-repr/structure/visual/polymer-gap-cylinder.ts
  42. 9 9
      src/mol-repr/structure/visual/polymer-trace-mesh.ts
  43. 8 8
      src/mol-repr/structure/visual/util/link.ts
  44. 1 1
      src/mol-repr/volume/direct-volume.ts
  45. 3 3
      src/mol-repr/volume/index.ts
  46. 3 3
      src/mol-repr/volume/isosurface-mesh.ts
  47. 1 1
      src/mol-state/transformer.ts
  48. 28 28
      src/mol-util/param-definition.ts

+ 1 - 1
src/mol-app/component/parameter/boolean.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface BooleanParamComponentProps {
-    param: PD.BooleanParam
+    param: PD.Boolean
     value: boolean
     onChange(v: boolean): void
 }

+ 1 - 1
src/mol-app/component/parameter/multi-select.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface MultiSelectParamComponentProps<T extends string> {
-    param: PD.MultiSelectParam<T>
+    param: PD.MultiSelect<T>
     value: T[]
     onChange(v: T[]): void
 }

+ 1 - 1
src/mol-app/component/parameter/number.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface NumberParamComponentProps {
-    param: PD.NumberParam
+    param: PD.Numeric
     value: number
     onChange(v: number): void
 }

+ 1 - 1
src/mol-app/component/parameter/range.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface RangeParamComponentProps {
-    param: PD.RangeParam
+    param: PD.Range
     value: number
     onChange(v: number): void
 }

+ 1 - 1
src/mol-app/component/parameter/select.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface SelectParamComponentProps<T extends string> {
-    param: PD.SelectParam<T>
+    param: PD.Select<T>
     value: T
     onChange(v: T): void
 }

+ 1 - 1
src/mol-app/component/parameter/text.tsx

@@ -8,7 +8,7 @@ import * as React from 'react'
 import { ParamDefinition as PD } from 'mol-util/param-definition';
 
 export interface TextParamComponentProps {
-    param: PD.TextParam
+    param: PD.Text
     value: string
     onChange(v: string): void
 }

+ 1 - 1
src/mol-app/component/parameters.tsx

@@ -21,7 +21,7 @@ interface ParametersProps<P extends PD.Params> {
 
 type ParametersState = {}
 
-function getParamComponent<P extends PD.Param>(p: PD.Param, value: P['defaultValue'], onChange: (v: P['defaultValue']) => void) {
+function getParamComponent<P extends PD.Any>(p: PD.Any, value: P['defaultValue'], onChange: (v: P['defaultValue']) => void) {
     switch (p.type) {
         case 'boolean':
             return <BooleanParamComponent param={p} value={value} onChange={onChange} />

+ 5 - 5
src/mol-geo/geometry/direct-volume/direct-volume.ts

@@ -67,12 +67,12 @@ export namespace DirectVolume {
 
     export const Params = {
         ...Geometry.Params,
-        isoValueAbsolute: PD.RangeParam('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
-        isoValueRelative: PD.RangeParam('Iso Value Relative', '', 2, -10, 10, 0.1),
-        renderMode: PD.SelectParam('Render Mode', '', 'isosurface', RenderModeOptions),
-        controlPoints: PD.TextParam('Control Points', '', '0.19:0.1, 0.2:0.5, 0.21:0.1, 0.4:0.3'),
+        isoValueAbsolute: PD.Range('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
+        isoValueRelative: PD.Range('Iso Value Relative', '', 2, -10, 10, 0.1),
+        renderMode: PD.Select('Render Mode', '', 'isosurface', RenderModeOptions),
+        controlPoints: PD.Text('Control Points', '', '0.19:0.1, 0.2:0.5, 0.21:0.1, 0.4:0.3'),
     }
-    export const DefaultProps = PD.paramDefaultValues(Params)
+    export const DefaultProps = PD.getDefaultValues(Params)
     export type Props = typeof DefaultProps
 
     export async function createValues(ctx: RuntimeContext, directVolume: DirectVolume, transform: TransformData, locationIt: LocationIterator, props: Props): Promise<DirectVolumeValues> {

+ 9 - 9
src/mol-geo/geometry/geometry.ts

@@ -59,16 +59,16 @@ export namespace Geometry {
     //
 
     export const Params = {
-        alpha: PD.RangeParam('Opacity', '', 1, 0, 1, 0.01),
-        visible: PD.BooleanParam('Visible', '', true),
-        depthMask: PD.BooleanParam('Depth Mask', '', true),
-        useFog: PD.BooleanParam('Use Fog', '', false),
-        quality: PD.SelectParam<VisualQuality>('Quality', '', 'auto', VisualQualityOptions),
-        colorTheme: PD.SelectParam<ColorThemeName>('Color Theme', '', 'uniform', ColorThemeOptions),
-        colorList: PD.SelectParam<ColorScaleName>('Color Scale', '', 'default', ColorScaleOptions),
-        colorValue: PD.ColorParam('Color Value', '', Color(0xCCCCCC)),
+        alpha: PD.Range('Opacity', '', 1, 0, 1, 0.01),
+        visible: PD.Boolean('Visible', '', true),
+        depthMask: PD.Boolean('Depth Mask', '', true),
+        useFog: PD.Boolean('Use Fog', '', false),
+        quality: PD.Select<VisualQuality>('Quality', '', 'auto', VisualQualityOptions),
+        colorTheme: PD.Select<ColorThemeName>('Color Theme', '', 'uniform', ColorThemeOptions),
+        colorList: PD.Select<ColorScaleName>('Color Scale', '', 'default', ColorScaleOptions),
+        colorValue: PD.Color('Color Value', '', Color(0xCCCCCC)),
     }
-    export const DefaultProps = PD.paramDefaultValues(Params)
+    export const DefaultProps = PD.getDefaultValues(Params)
     export type Props = typeof DefaultProps
 
     export type Counts = { drawCount: number, groupCount: number, instanceCount: number }

+ 5 - 5
src/mol-geo/geometry/lines/lines.ts

@@ -93,12 +93,12 @@ export namespace Lines {
 
     export const Params = {
         ...Geometry.Params,
-        lineSizeAttenuation: PD.BooleanParam('Line Size Attenuation', '', false),
-        sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-        sizeValue: PD.NumberParam('Size Value', '', 1, 0, 10, 0.1),
-        sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
+        lineSizeAttenuation: PD.Boolean('Line Size Attenuation', '', false),
+        sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+        sizeValue: PD.Numeric('Size Value', '', 1, 0, 10, 0.1),
+        sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
     }
-    export const DefaultProps = PD.paramDefaultValues(Params)
+    export const DefaultProps = PD.getDefaultValues(Params)
     export type Props = typeof DefaultProps
 
     export async function createValues(ctx: RuntimeContext, lines: Lines, transform: TransformData, locationIt: LocationIterator, props: Props): Promise<LinesValues> {

+ 4 - 4
src/mol-geo/geometry/mesh/mesh.ts

@@ -339,11 +339,11 @@ export namespace Mesh {
 
     export const Params = {
         ...Geometry.Params,
-        doubleSided: PD.BooleanParam('Double Sided', '', false),
-        flipSided: PD.BooleanParam('Flip Sided', '', false),
-        flatShaded: PD.BooleanParam('Flat Shaded', '', false),
+        doubleSided: PD.Boolean('Double Sided', '', false),
+        flipSided: PD.Boolean('Flip Sided', '', false),
+        flatShaded: PD.Boolean('Flat Shaded', '', false),
     }
-    export const DefaultProps = PD.paramDefaultValues(Params)
+    export const DefaultProps = PD.getDefaultValues(Params)
     export type Props = typeof DefaultProps
 
     export async function createValues(ctx: RuntimeContext, mesh: Mesh, transform: TransformData, locationIt: LocationIterator, props: Props): Promise<MeshValues> {

+ 7 - 7
src/mol-geo/geometry/points/points.ts

@@ -55,14 +55,14 @@ export namespace Points {
 
     export const Params = {
         ...Geometry.Params,
-        pointSizeAttenuation: PD.BooleanParam('Point Size Attenuation', '', false),
-        pointFilledCircle: PD.BooleanParam('Point Filled Circle', '', false),
-        pointEdgeBleach: PD.NumberParam('Point Edge Bleach', '', 0.2, 0, 1, 0.05),
-        sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-        sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-        sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
+        pointSizeAttenuation: PD.Boolean('Point Size Attenuation', '', false),
+        pointFilledCircle: PD.Boolean('Point Filled Circle', '', false),
+        pointEdgeBleach: PD.Numeric('Point Edge Bleach', '', 0.2, 0, 1, 0.05),
+        sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+        sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+        sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
     }
-    export const DefaultProps = PD.paramDefaultValues(Params)
+    export const DefaultProps = PD.getDefaultValues(Params)
     export type Props = typeof DefaultProps
 
     export async function createValues(ctx: RuntimeContext, points: Points, transform: TransformData, locationIt: LocationIterator, props: Props): Promise<PointsValues> {

+ 6 - 6
src/mol-model/structure/structure/unit/gaussian-density.ts

@@ -15,13 +15,13 @@ import { Texture } from 'mol-gl/webgl/texture';
 import { WebGLContext } from 'mol-gl/webgl/context';
 
 export const GaussianDensityParams = {
-    resolution: PD.NumberParam('Resolution', '', 1, 0.1, 10, 0.1),
-    radiusOffset: PD.NumberParam('Radius Offset', '', 0, 0, 10, 0.1),
-    smoothness: PD.NumberParam('Smoothness', '', 1.5, 0.5, 2.5, 0.1),
-    useGpu: PD.BooleanParam('Use GPU', '', true),
-    ignoreCache: PD.BooleanParam('Ignore Cache', '', false),
+    resolution: PD.Numeric('Resolution', '', 1, 0.1, 10, 0.1),
+    radiusOffset: PD.Numeric('Radius Offset', '', 0, 0, 10, 0.1),
+    smoothness: PD.Numeric('Smoothness', '', 1.5, 0.5, 2.5, 0.1),
+    useGpu: PD.Boolean('Use GPU', '', true),
+    ignoreCache: PD.Boolean('Ignore Cache', '', false),
 }
-export const DefaultGaussianDensityProps = PD.paramDefaultValues(GaussianDensityParams)
+export const DefaultGaussianDensityProps = PD.getDefaultValues(GaussianDensityParams)
 export type GaussianDensityProps = typeof DefaultGaussianDensityProps
 
 function getConformation(unit: Unit) {

+ 1 - 1
src/mol-repr/index.ts

@@ -42,7 +42,7 @@ export namespace Representation {
         for (let i = 0, il = reprList.length; i < il; ++i) {
             visualsOptions.push([ i.toString(), reprList[i].label ])
         }
-        params['visuals'] = PD.MultiSelectParam<string>('Visuals', '', ['surface'], visualsOptions)
+        params['visuals'] = PD.MultiSelect<string>('Visuals', '', ['surface'], visualsOptions)
 
         if (!defaultProps.visuals) {
             defaultProps.visuals = reprList.map((r, i) => i.toString())

+ 2 - 2
src/mol-repr/shape/index.ts

@@ -24,9 +24,9 @@ export interface ShapeRepresentation<P extends RepresentationProps = {}> extends
 
 export const ShapeParams = {
     ...Mesh.Params,
-    colorTheme: PD.SelectParam<ColorThemeName>('Color Theme', '', 'shape-group', ColorThemeOptions)
+    colorTheme: PD.Select<ColorThemeName>('Color Theme', '', 'shape-group', ColorThemeOptions)
 }
-export const DefaultShapeProps = PD.paramDefaultValues(ShapeParams)
+export const DefaultShapeProps = PD.getDefaultValues(ShapeParams)
 export type ShapeProps = typeof DefaultShapeProps
 
 // TODO

+ 4 - 4
src/mol-repr/structure/complex-visual.ts

@@ -27,9 +27,9 @@ export interface  ComplexVisual<P extends StructureProps> extends Visual<Structu
 
 const ComplexParams = {
     ...StructureParams,
-    unitKinds: PD.MultiSelectParam<UnitKind>('Unit Kind', '', ['atomic', 'spheres'], UnitKindOptions),
+    unitKinds: PD.MultiSelect<UnitKind>('Unit Kind', '', ['atomic', 'spheres'], UnitKindOptions),
 }
-const DefaultComplexProps = PD.paramDefaultValues(ComplexParams)
+const DefaultComplexProps = PD.getDefaultValues(ComplexParams)
 type ComplexProps = typeof DefaultComplexProps
 
 type ComplexRenderObject = MeshRenderObject | LinesRenderObject | PointsRenderObject | DirectVolumeRenderObject
@@ -168,9 +168,9 @@ export function ComplexVisual<P extends ComplexMeshProps>(builder: ComplexVisual
 
 export const ComplexMeshParams = {
     ...StructureMeshParams,
-    unitKinds: PD.MultiSelectParam<UnitKind>('Unit Kind', '', [ 'atomic', 'spheres' ], UnitKindOptions),
+    unitKinds: PD.MultiSelect<UnitKind>('Unit Kind', '', [ 'atomic', 'spheres' ], UnitKindOptions),
 }
-export const DefaultComplexMeshProps = PD.paramDefaultValues(ComplexMeshParams)
+export const DefaultComplexMeshProps = PD.getDefaultValues(ComplexMeshParams)
 export type ComplexMeshProps = typeof DefaultComplexMeshProps
 
 export interface ComplexMeshVisualBuilder<P extends ComplexMeshProps> extends ComplexVisualBuilder<P, Mesh> { }

+ 7 - 7
src/mol-repr/structure/index.ts

@@ -21,38 +21,38 @@ export interface StructureRepresentation<P extends RepresentationProps = {}> ext
 
 export const StructureParams = {
     ...Geometry.Params,
-    colorTheme: PD.SelectParam<ColorThemeName>('Color Theme', '', 'polymer-index', ColorThemeOptions),
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    colorTheme: PD.Select<ColorThemeName>('Color Theme', '', 'polymer-index', ColorThemeOptions),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
 }
-export const DefaultStructureProps = PD.paramDefaultValues(StructureParams)
+export const DefaultStructureProps = PD.getDefaultValues(StructureParams)
 export type StructureProps = typeof DefaultStructureProps
 
 export const StructureMeshParams = {
     ...Mesh.Params,
     ...StructureParams,
 }
-export const DefaultStructureMeshProps = PD.paramDefaultValues(StructureMeshParams)
+export const DefaultStructureMeshProps = PD.getDefaultValues(StructureMeshParams)
 export type StructureMeshProps = typeof DefaultStructureMeshProps
 
 export const StructurePointsParams = {
     ...Points.Params,
     ...StructureParams,
 }
-export const DefaultStructurePointsProps = PD.paramDefaultValues(StructurePointsParams)
+export const DefaultStructurePointsProps = PD.getDefaultValues(StructurePointsParams)
 export type StructurePointsProps = typeof DefaultStructurePointsProps
 
 export const StructureLinesParams = {
     ...Lines.Params,
     ...StructureParams,
 }
-export const DefaultStructureLinesProps = PD.paramDefaultValues(StructureLinesParams)
+export const DefaultStructureLinesProps = PD.getDefaultValues(StructureLinesParams)
 export type StructureLinesProps = typeof DefaultStructureLinesProps
 
 export const StructureDirectVolumeParams = {
     ...DirectVolume.Params,
     ...StructureParams,
 }
-export const DefaultStructureDirectVolumeProps = PD.paramDefaultValues(StructureDirectVolumeParams)
+export const DefaultStructureDirectVolumeProps = PD.getDefaultValues(StructureDirectVolumeParams)
 export type StructureDirectVolumeProps = typeof DefaultStructureDirectVolumeProps
 
 export { ComplexRepresentation } from './complex-representation'

+ 1 - 1
src/mol-repr/structure/representation/backbone.ts

@@ -13,7 +13,7 @@ import { Representation } from 'mol-repr';
 export const BackboneParams = {
     ...PolymerBackboneParams
 }
-export const DefaultBackboneProps = PD.paramDefaultValues(BackboneParams)
+export const DefaultBackboneProps = PD.getDefaultValues(BackboneParams)
 export type BackboneProps = typeof DefaultBackboneProps
 
 export type BackboneRepresentation = StructureRepresentation<BackboneProps>

+ 5 - 5
src/mol-repr/structure/representation/ball-and-stick.ts

@@ -19,12 +19,12 @@ export const BallAndStickParams = {
     ...ElementSphereParams,
     ...IntraUnitLinkParams,
     ...InterUnitLinkParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.2, 0, 10, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
-    unitKinds: PD.MultiSelectParam<UnitKind>('Unit Kind', '', ['atomic'], UnitKindOptions),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.2, 0, 10, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
+    unitKinds: PD.MultiSelect<UnitKind>('Unit Kind', '', ['atomic'], UnitKindOptions),
 }
-export const DefaultBallAndStickProps = PD.paramDefaultValues(BallAndStickParams)
+export const DefaultBallAndStickProps = PD.getDefaultValues(BallAndStickParams)
 export type BallAndStickProps = typeof DefaultBallAndStickProps
 
 export type BallAndStickRepresentation = StructureRepresentation<BallAndStickProps>

+ 4 - 4
src/mol-repr/structure/representation/carbohydrate.ts

@@ -15,11 +15,11 @@ import { Representation } from 'mol-repr';
 export const CarbohydrateParams = {
     ...CarbohydrateSymbolParams,
     ...CarbohydrateLinkParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 0.1, 20),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 0.1, 20),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
 }
-export const DefaultCarbohydrateProps = PD.paramDefaultValues(CarbohydrateParams)
+export const DefaultCarbohydrateProps = PD.getDefaultValues(CarbohydrateParams)
 export type CarbohydrateProps = typeof DefaultCarbohydrateProps
 
 export type CarbohydrateRepresentation = StructureRepresentation<CarbohydrateProps>

+ 3 - 3
src/mol-repr/structure/representation/cartoon.ts

@@ -19,10 +19,10 @@ export const CartoonParams = {
     ...PolymerGapParams,
     ...NucleotideBlockParams,
     // ...PolymerDirectionParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.6, 0, 10, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.6, 0, 10, 0.1),
 }
-export const DefaultCartoonProps = PD.paramDefaultValues(CartoonParams)
+export const DefaultCartoonProps = PD.getDefaultValues(CartoonParams)
 export type CartoonProps = typeof DefaultCartoonProps
 
 export type CartoonRepresentation = StructureRepresentation<CartoonProps>

+ 3 - 3
src/mol-repr/structure/representation/distance-restraint.ts

@@ -13,10 +13,10 @@ import { Representation } from 'mol-repr';
 
 export const DistanceRestraintParams = {
     ...CrossLinkRestraintParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.25, 0, 0.05, 20),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.25, 0, 0.05, 20),
 }
-export const DefaultDistanceRestraintProps = PD.paramDefaultValues(DistanceRestraintParams)
+export const DefaultDistanceRestraintProps = PD.getDefaultValues(DistanceRestraintParams)
 export type DistanceRestraintProps = typeof DefaultDistanceRestraintProps
 
 export type DistanceRestraintRepresentation = StructureRepresentation<DistanceRestraintProps>

+ 2 - 2
src/mol-repr/structure/representation/molecular-surface.ts

@@ -17,9 +17,9 @@ export const MolecularSurfaceParams = {
     ...GaussianSurfaceParams,
     ...GaussianWireframeParams,
     ...GaussianDensityVolumeParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
 }
-export const DefaultMolecularSurfaceProps = { ...PD.paramDefaultValues(MolecularSurfaceParams), visuals: [ '0' ] }
+export const DefaultMolecularSurfaceProps = { ...PD.getDefaultValues(MolecularSurfaceParams), visuals: [ '0' ] }
 export type MolecularSurfaceProps = typeof DefaultMolecularSurfaceProps
 
 export type MolecularSurfaceRepresentation = StructureRepresentation<MolecularSurfaceProps>

+ 1 - 1
src/mol-repr/structure/representation/point.ts

@@ -13,7 +13,7 @@ import { Representation } from 'mol-repr';
 export const PointParams = {
     ...ElementPointParams,
 }
-export const DefaultPointProps = PD.paramDefaultValues(PointParams)
+export const DefaultPointProps = PD.getDefaultValues(PointParams)
 export type PointProps = typeof DefaultPointProps
 
 export type PointRepresentation = StructureRepresentation<PointProps>

+ 1 - 1
src/mol-repr/structure/representation/spacefill.ts

@@ -13,7 +13,7 @@ import { Representation } from 'mol-repr';
 export const SpacefillParams = {
     ...ElementSphereParams
 }
-export const DefaultSpacefillProps = PD.paramDefaultValues(SpacefillParams)
+export const DefaultSpacefillProps = PD.getDefaultValues(SpacefillParams)
 export type SpacefillProps = typeof DefaultSpacefillProps
 
 export type SpacefillRepresentation = StructureRepresentation<SpacefillProps>

+ 6 - 6
src/mol-repr/structure/units-visual.ts

@@ -39,9 +39,9 @@ function sameGroupConformation(groupA: Unit.SymmetryGroup, groupB: Unit.Symmetry
 
 const UnitsParams = {
     ...StructureParams,
-    unitKinds: PD.MultiSelectParam<UnitKind>('Unit Kind', '', ['atomic', 'spheres'], UnitKindOptions),
+    unitKinds: PD.MultiSelect<UnitKind>('Unit Kind', '', ['atomic', 'spheres'], UnitKindOptions),
 }
-const DefaultUnitsProps = PD.paramDefaultValues(UnitsParams)
+const DefaultUnitsProps = PD.getDefaultValues(UnitsParams)
 type UnitsProps = typeof DefaultUnitsProps
 
 type UnitsRenderObject = MeshRenderObject | LinesRenderObject | PointsRenderObject | DirectVolumeRenderObject
@@ -205,7 +205,7 @@ export const UnitsMeshParams = {
     ...StructureMeshParams,
     ...UnitsParams,
 }
-export const DefaultUnitsMeshProps = PD.paramDefaultValues(UnitsMeshParams)
+export const DefaultUnitsMeshProps = PD.getDefaultValues(UnitsMeshParams)
 export type UnitsMeshProps = typeof DefaultUnitsMeshProps
 export interface UnitsMeshVisualBuilder<P extends UnitsMeshProps> extends UnitsVisualBuilder<P, Mesh> { }
 
@@ -228,7 +228,7 @@ export const UnitsPointsParams = {
     ...StructurePointsParams,
     ...UnitsParams,
 }
-export const DefaultUnitsPointsProps = PD.paramDefaultValues(UnitsPointsParams)
+export const DefaultUnitsPointsProps = PD.getDefaultValues(UnitsPointsParams)
 export type UnitsPointsProps = typeof DefaultUnitsPointsProps
 export interface UnitsPointVisualBuilder<P extends UnitsPointsProps> extends UnitsVisualBuilder<P, Points> { }
 
@@ -251,7 +251,7 @@ export const UnitsLinesParams = {
     ...StructureLinesParams,
     ...UnitsParams,
 }
-export const DefaultUnitsLinesProps = PD.paramDefaultValues(UnitsLinesParams)
+export const DefaultUnitsLinesProps = PD.getDefaultValues(UnitsLinesParams)
 export type UnitsLinesProps = typeof DefaultUnitsLinesProps
 export interface UnitsLinesVisualBuilder<P extends UnitsLinesProps> extends UnitsVisualBuilder<P, Lines> { }
 
@@ -274,7 +274,7 @@ export const UnitsDirectVolumeParams = {
     ...StructureDirectVolumeParams,
     ...UnitsParams,
 }
-export const DefaultUnitsDirectVolumeProps = PD.paramDefaultValues(UnitsDirectVolumeParams)
+export const DefaultUnitsDirectVolumeProps = PD.getDefaultValues(UnitsDirectVolumeParams)
 export type UnitsDirectVolumeProps = typeof DefaultUnitsDirectVolumeProps
 export interface UnitsDirectVolumeVisualBuilder<P extends UnitsDirectVolumeProps> extends UnitsVisualBuilder<P, DirectVolume> { }
 

+ 4 - 4
src/mol-repr/structure/visual/carbohydrate-link-cylinder.ts

@@ -64,11 +64,11 @@ async function createCarbohydrateLinkCylinderMesh(ctx: VisualContext, structure:
 export const CarbohydrateLinkParams = {
     ...UnitsMeshParams,
     ...LinkCylinderParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-    detail: PD.NumberParam('Sphere Detail', '', 0, 0, 3, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+    detail: PD.Numeric('Sphere Detail', '', 0, 0, 3, 1),
 }
-export const DefaultCarbohydrateLinkProps = PD.paramDefaultValues(CarbohydrateLinkParams)
+export const DefaultCarbohydrateLinkProps = PD.getDefaultValues(CarbohydrateLinkParams)
 export type CarbohydrateLinkProps = typeof DefaultCarbohydrateLinkProps
 
 export function CarbohydrateLinkVisual(): ComplexVisual<CarbohydrateLinkProps> {

+ 4 - 4
src/mol-repr/structure/visual/carbohydrate-symbol-mesh.ts

@@ -148,11 +148,11 @@ async function createCarbohydrateSymbolMesh(ctx: VisualContext, structure: Struc
 
 export const CarbohydrateSymbolParams = {
     ...ComplexMeshParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 10, 0.1),
-    detail: PD.NumberParam('Sphere Detail', '', 0, 0, 3, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 10, 0.1),
+    detail: PD.Numeric('Sphere Detail', '', 0, 0, 3, 1),
 }
-export const DefaultCarbohydrateSymbolProps = PD.paramDefaultValues(CarbohydrateSymbolParams)
+export const DefaultCarbohydrateSymbolProps = PD.getDefaultValues(CarbohydrateSymbolParams)
 export type CarbohydrateSymbolProps = typeof DefaultCarbohydrateSymbolProps
 
 export function CarbohydrateSymbolVisual(): ComplexVisual<CarbohydrateSymbolProps> {

+ 3 - 3
src/mol-repr/structure/visual/cross-link-restraint-cylinder.ts

@@ -54,10 +54,10 @@ async function createCrossLinkRestraintCylinderMesh(ctx: VisualContext, structur
 export const CrossLinkRestraintParams = {
     ...ComplexMeshParams,
     ...LinkCylinderParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
 }
-export const DefaultCrossLinkRestraintProps = PD.paramDefaultValues(CrossLinkRestraintParams)
+export const DefaultCrossLinkRestraintProps = PD.getDefaultValues(CrossLinkRestraintParams)
 export type CrossLinkRestraintProps = typeof DefaultCrossLinkRestraintProps
 
 export function CrossLinkRestraintVisual(): ComplexVisual<CrossLinkRestraintProps> {

+ 4 - 4
src/mol-repr/structure/visual/element-point.ts

@@ -18,11 +18,11 @@ import { VisualContext } from 'mol-repr';
 
 export const ElementPointParams = {
     ...UnitsPointsParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 3, 0, 20, 0.1),
-    pointSizeAttenuation: PD.BooleanParam('Point Size Attenuation', '', false),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 3, 0, 20, 0.1),
+    pointSizeAttenuation: PD.Boolean('Point Size Attenuation', '', false),
 }
-export const DefaultElementPointProps = PD.paramDefaultValues(ElementPointParams)
+export const DefaultElementPointProps = PD.getDefaultValues(ElementPointParams)
 export type ElementPointProps = typeof DefaultElementPointProps
 
 // TODO size

+ 5 - 5
src/mol-repr/structure/visual/element-sphere.ts

@@ -14,12 +14,12 @@ import { SizeThemeName, SizeThemeOptions } from 'mol-theme/size';
 
 export const ElementSphereParams = {
     ...UnitsMeshParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.2, 0, 10, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
-    detail: PD.NumberParam('Sphere Detail', '', 0, 0, 3, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.2, 0, 10, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
+    detail: PD.Numeric('Sphere Detail', '', 0, 0, 3, 1),
 }
-export const DefaultElementSphereProps = PD.paramDefaultValues(ElementSphereParams)
+export const DefaultElementSphereProps = PD.getDefaultValues(ElementSphereParams)
 export type ElementSphereProps = typeof DefaultElementSphereProps
 
 export function ElementSphereVisual(): UnitsVisual<ElementSphereProps> {

+ 4 - 4
src/mol-repr/structure/visual/gaussian-density-point.ts

@@ -21,11 +21,11 @@ import { VisualContext } from 'mol-repr';
 export const GaussianDensityPointParams = {
     ...UnitsPointsParams,
     ...GaussianDensityParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-    pointSizeAttenuation: PD.BooleanParam('Point Size Attenuation', '', false),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+    pointSizeAttenuation: PD.Boolean('Point Size Attenuation', '', false),
 }
-export const DefaultGaussianDensityPointProps = PD.paramDefaultValues(GaussianDensityPointParams)
+export const DefaultGaussianDensityPointProps = PD.getDefaultValues(GaussianDensityPointParams)
 export type GaussianDensityPointProps = typeof DefaultGaussianDensityPointProps
 
 export async function createGaussianDensityPoint(ctx: VisualContext, unit: Unit, structure: Structure, props: GaussianDensityProps, points?: Points) {

+ 1 - 1
src/mol-repr/structure/visual/gaussian-density-volume.ts

@@ -30,7 +30,7 @@ export const GaussianDensityVolumeParams = {
     ...UnitsDirectVolumeParams,
     ...GaussianDensityParams,
 }
-export const DefaultGaussianDensityVolumeProps = PD.paramDefaultValues(GaussianDensityVolumeParams)
+export const DefaultGaussianDensityVolumeProps = PD.getDefaultValues(GaussianDensityVolumeParams)
 export type GaussianDensityVolumeProps = typeof DefaultGaussianDensityVolumeProps
 
 export function GaussianDensityVolumeVisual(): UnitsVisual<GaussianDensityVolumeProps> {

+ 1 - 1
src/mol-repr/structure/visual/gaussian-surface-mesh.ts

@@ -37,7 +37,7 @@ export const GaussianSurfaceParams = {
     ...UnitsMeshParams,
     ...GaussianDensityParams,
 }
-export const DefaultGaussianSurfaceProps = PD.paramDefaultValues(GaussianSurfaceParams)
+export const DefaultGaussianSurfaceProps = PD.getDefaultValues(GaussianSurfaceParams)
 export type GaussianSurfaceProps = typeof DefaultGaussianSurfaceProps
 
 export function GaussianSurfaceVisual(): UnitsVisual<GaussianSurfaceProps> {

+ 4 - 4
src/mol-repr/structure/visual/gaussian-surface-wireframe.ts

@@ -35,11 +35,11 @@ async function createGaussianWireframe(ctx: VisualContext, unit: Unit, structure
 export const GaussianWireframeParams = {
     ...UnitsLinesParams,
     ...GaussianDensityParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 2, 0, 10, 0.1),
-    lineSizeAttenuation: PD.BooleanParam('Line Size Attenuation', '', false),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 2, 0, 10, 0.1),
+    lineSizeAttenuation: PD.Boolean('Line Size Attenuation', '', false),
 }
-export const DefaultGaussianWireframeProps = PD.paramDefaultValues(GaussianWireframeParams)
+export const DefaultGaussianWireframeProps = PD.getDefaultValues(GaussianWireframeParams)
 export type GaussianWireframeProps = typeof DefaultGaussianWireframeProps
 
 export function GaussianWireframeVisual(): UnitsVisual<GaussianWireframeProps> {

+ 4 - 4
src/mol-repr/structure/visual/inter-unit-link-cylinder.ts

@@ -53,11 +53,11 @@ async function createInterUnitLinkCylinderMesh(ctx: VisualContext, structure: St
 export const InterUnitLinkParams = {
     ...ComplexMeshParams,
     ...LinkCylinderParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.2, 0, 10, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.2, 0, 10, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
 }
-export const DefaultInterUnitLinkProps = PD.paramDefaultValues(InterUnitLinkParams)
+export const DefaultInterUnitLinkProps = PD.getDefaultValues(InterUnitLinkParams)
 export type InterUnitLinkProps = typeof DefaultInterUnitLinkProps
 
 export function InterUnitLinkVisual(): ComplexVisual<InterUnitLinkProps> {

+ 4 - 4
src/mol-repr/structure/visual/intra-unit-link-cylinder.ts

@@ -67,11 +67,11 @@ async function createIntraUnitLinkCylinderMesh(ctx: VisualContext, unit: Unit, s
 export const IntraUnitLinkParams = {
     ...UnitsMeshParams,
     ...LinkCylinderParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 0.2, 0, 10, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 0.2, 0, 10, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
 }
-export const DefaultIntraUnitLinkProps = PD.paramDefaultValues(IntraUnitLinkParams)
+export const DefaultIntraUnitLinkProps = PD.getDefaultValues(IntraUnitLinkParams)
 export type IntraUnitLinkProps = typeof DefaultIntraUnitLinkProps
 
 export function IntraUnitLinkVisual(): UnitsVisual<IntraUnitLinkProps> {

+ 1 - 1
src/mol-repr/structure/visual/nucleotide-block-mesh.ts

@@ -114,7 +114,7 @@ async function createNucleotideBlockMesh(ctx: VisualContext, unit: Unit, structu
 export const NucleotideBlockParams = {
     ...UnitsMeshParams
 }
-export const DefaultNucleotideBlockProps = PD.paramDefaultValues(NucleotideBlockParams)
+export const DefaultNucleotideBlockProps = PD.getDefaultValues(NucleotideBlockParams)
 export type NucleotideBlockProps = typeof DefaultNucleotideBlockProps
 
 export function NucleotideBlockVisual(): UnitsVisual<NucleotideBlockProps> {

+ 5 - 5
src/mol-repr/structure/visual/polymer-backbone-cylinder.ts

@@ -21,11 +21,11 @@ import { addCylinder } from 'mol-geo/geometry/mesh/builder/cylinder';
 import { VisualContext } from 'mol-repr';
 
 export const PolymerBackboneCylinderParams = {
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 10, 0.1),
-    radialSegments: PD.NumberParam('Radial Segments', '', 16, 3, 56, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 10, 0.1),
+    radialSegments: PD.Numeric('Radial Segments', '', 16, 3, 56, 1),
 }
-export const DefaultPolymerBackboneCylinderProps = PD.paramDefaultValues(PolymerBackboneCylinderParams)
+export const DefaultPolymerBackboneCylinderProps = PD.getDefaultValues(PolymerBackboneCylinderParams)
 export type PolymerBackboneCylinderProps = typeof DefaultPolymerBackboneCylinderProps
 
 async function createPolymerBackboneCylinderMesh(ctx: VisualContext, unit: Unit, structure: Structure, props: PolymerBackboneCylinderProps, mesh?: Mesh) {
@@ -72,7 +72,7 @@ export const PolymerBackboneParams = {
     ...UnitsMeshParams,
     ...PolymerBackboneCylinderParams,
 }
-export const DefaultPolymerBackboneProps = PD.paramDefaultValues(PolymerBackboneParams)
+export const DefaultPolymerBackboneProps = PD.getDefaultValues(PolymerBackboneParams)
 export type PolymerBackboneProps = typeof DefaultPolymerBackboneProps
 
 export function PolymerBackboneVisual(): UnitsVisual<PolymerBackboneProps> {

+ 4 - 4
src/mol-repr/structure/visual/polymer-direction-wedge.ts

@@ -30,10 +30,10 @@ const heightFactor = 6
 const wedge = Wedge()
 
 export const PolymerDirectionWedgeParams = {
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
 }
-export const DefaultPolymerDirectionWedgeProps = PD.paramDefaultValues(PolymerDirectionWedgeParams)
+export const DefaultPolymerDirectionWedgeProps = PD.getDefaultValues(PolymerDirectionWedgeParams)
 export type PolymerDirectionWedgeProps = typeof DefaultPolymerDirectionWedgeProps
 
 async function createPolymerDirectionWedgeMesh(ctx: VisualContext, unit: Unit, structure: Structure, props: PolymerDirectionWedgeProps, mesh?: Mesh) {
@@ -93,7 +93,7 @@ export const PolymerDirectionParams = {
     ...UnitsMeshParams,
     ...PolymerDirectionWedgeParams
 }
-export const DefaultPolymerDirectionProps = PD.paramDefaultValues(PolymerDirectionParams)
+export const DefaultPolymerDirectionProps = PD.getDefaultValues(PolymerDirectionParams)
 export type PolymerDirectionProps = typeof DefaultPolymerDirectionProps
 
 export function PolymerDirectionVisual(): UnitsVisual<PolymerDirectionProps> {

+ 10 - 10
src/mol-repr/structure/visual/polymer-gap-cylinder.ts

@@ -23,12 +23,12 @@ import { VisualContext } from 'mol-repr';
 const segmentCount = 10
 
 export const PolymerGapCylinderParams = {
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 10, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 0.3, 0, 10, 0.1),
-    radialSegments: PD.NumberParam('Radial Segments', '', 16, 3, 56, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 10, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 0.3, 0, 10, 0.1),
+    radialSegments: PD.Numeric('Radial Segments', '', 16, 3, 56, 1),
 }
-export const DefaultPolymerGapCylinderProps = PD.paramDefaultValues(PolymerGapCylinderParams)
+export const DefaultPolymerGapCylinderProps = PD.getDefaultValues(PolymerGapCylinderParams)
 export type PolymerGapCylinderProps = typeof DefaultPolymerGapCylinderProps
 
 async function createPolymerGapCylinderMesh(ctx: VisualContext, unit: Unit, structure: Structure, props: PolymerGapCylinderProps, mesh?: Mesh) {
@@ -81,18 +81,18 @@ async function createPolymerGapCylinderMesh(ctx: VisualContext, unit: Unit, stru
 export const InterUnitLinkParams = {
     ...UnitsMeshParams,
     ...LinkCylinderParams,
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 0.3, 0, 10, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 0.3, 0, 10, 0.1),
 }
-export const DefaultIntraUnitLinkProps = PD.paramDefaultValues(InterUnitLinkParams)
+export const DefaultIntraUnitLinkProps = PD.getDefaultValues(InterUnitLinkParams)
 export type IntraUnitLinkProps = typeof DefaultIntraUnitLinkProps
 
 export const PolymerGapParams = {
     ...UnitsMeshParams,
     ...PolymerGapCylinderParams
 }
-export const DefaultPolymerGapProps = PD.paramDefaultValues(PolymerGapParams)
+export const DefaultPolymerGapProps = PD.getDefaultValues(PolymerGapParams)
 export type PolymerGapProps = typeof DefaultPolymerGapProps
 
 export function PolymerGapVisual(): UnitsVisual<PolymerGapProps> {

+ 9 - 9
src/mol-repr/structure/visual/polymer-trace-mesh.ts

@@ -19,15 +19,15 @@ import { addTube } from 'mol-geo/geometry/mesh/builder/tube';
 import { VisualContext } from 'mol-repr';
 
 export const PolymerTraceMeshParams = {
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 0.3, 0, 10, 0.1),
-    linearSegments: PD.NumberParam('Linear Segments', '', 8, 1, 48, 1),
-    radialSegments: PD.NumberParam('Radial Segments', '', 16, 3, 56, 1),
-    aspectRatio: PD.NumberParam('Aspect Ratio', '', 5, 0.1, 5, 0.1),
-    arrowFactor: PD.NumberParam('Arrow Factor', '', 1.5, 0.1, 5, 0.1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'physical', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 0.3, 0, 10, 0.1),
+    linearSegments: PD.Numeric('Linear Segments', '', 8, 1, 48, 1),
+    radialSegments: PD.Numeric('Radial Segments', '', 16, 3, 56, 1),
+    aspectRatio: PD.Numeric('Aspect Ratio', '', 5, 0.1, 5, 0.1),
+    arrowFactor: PD.Numeric('Arrow Factor', '', 1.5, 0.1, 5, 0.1),
 }
-export const DefaultPolymerTraceMeshProps = PD.paramDefaultValues(PolymerTraceMeshParams)
+export const DefaultPolymerTraceMeshProps = PD.getDefaultValues(PolymerTraceMeshParams)
 export type PolymerTraceMeshProps = typeof DefaultPolymerTraceMeshProps
 
 // TODO handle polymer ends properly
@@ -93,7 +93,7 @@ export const PolymerTraceParams = {
     ...UnitsMeshParams,
     ...PolymerTraceMeshParams
 }
-export const DefaultPolymerTraceProps = PD.paramDefaultValues(PolymerTraceParams)
+export const DefaultPolymerTraceProps = PD.getDefaultValues(PolymerTraceParams)
 export type PolymerTraceProps = typeof DefaultPolymerTraceProps
 
 export function PolymerTraceVisual(): UnitsVisual<PolymerTraceProps> {

+ 8 - 8
src/mol-repr/structure/visual/util/link.ts

@@ -17,15 +17,15 @@ import { LocationIterator } from 'mol-geo/util/location-iterator';
 import { VisualContext } from 'mol-repr';
 
 export const LinkCylinderParams = {
-    sizeTheme: PD.SelectParam<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
-    sizeValue: PD.NumberParam('Size Value', '', 1, 0, 20, 0.1),
-    sizeFactor: PD.NumberParam('Size Factor', '', 1, 0, 10, 0.1),
-    linkScale: PD.RangeParam('Link Scale', '', 0.4, 0, 1, 0.1),
-    linkSpacing: PD.RangeParam('Link Spacing', '', 1, 0, 2, 0.01),
-    linkRadius: PD.RangeParam('Link Radius', '', 0.25, 0, 10, 0.05),
-    radialSegments: PD.NumberParam('Radial Segments', '', 16, 3, 56, 1),
+    sizeTheme: PD.Select<SizeThemeName>('Size Theme', '', 'uniform', SizeThemeOptions),
+    sizeValue: PD.Numeric('Size Value', '', 1, 0, 20, 0.1),
+    sizeFactor: PD.Numeric('Size Factor', '', 1, 0, 10, 0.1),
+    linkScale: PD.Range('Link Scale', '', 0.4, 0, 1, 0.1),
+    linkSpacing: PD.Range('Link Spacing', '', 1, 0, 2, 0.01),
+    linkRadius: PD.Range('Link Radius', '', 0.25, 0, 10, 0.05),
+    radialSegments: PD.Numeric('Radial Segments', '', 16, 3, 56, 1),
 }
-export const DefaultLinkCylinderProps = PD.paramDefaultValues(LinkCylinderParams)
+export const DefaultLinkCylinderProps = PD.getDefaultValues(LinkCylinderParams)
 export type LinkCylinderProps = typeof DefaultLinkCylinderProps
 
 const tmpShiftV12 = Vec3.zero()

+ 1 - 1
src/mol-repr/volume/direct-volume.ts

@@ -187,7 +187,7 @@ export const DirectVolumeParams = {
     ...Geometry.Params,
     ...DirectVolume.Params
 }
-export const DefaultDirectVolumeProps = PD.paramDefaultValues(DirectVolumeParams)
+export const DefaultDirectVolumeProps = PD.getDefaultValues(DirectVolumeParams)
 export type DirectVolumeProps = typeof DefaultDirectVolumeProps
 
 export function DirectVolumeVisual(): VolumeVisual<DirectVolumeProps> {

+ 3 - 3
src/mol-repr/volume/index.ts

@@ -136,10 +136,10 @@ export interface VolumeRepresentation<P extends RepresentationProps = {}> extend
 
 export const VolumeParams = {
     ...Geometry.Params,
-    isoValueAbsolute: PD.RangeParam('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
-    isoValueRelative: PD.RangeParam('Iso Value Relative', '', 2, -10, 10, 0.1),
+    isoValueAbsolute: PD.Range('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
+    isoValueRelative: PD.Range('Iso Value Relative', '', 2, -10, 10, 0.1),
 }
-export const DefaultVolumeProps = PD.paramDefaultValues(VolumeParams)
+export const DefaultVolumeProps = PD.getDefaultValues(VolumeParams)
 export type VolumeProps = typeof DefaultVolumeProps
 
 export function VolumeRepresentation<P extends VolumeProps>(visualCtor: (volumeData: VolumeData) => VolumeVisual<P>): VolumeRepresentation<P> {

+ 3 - 3
src/mol-repr/volume/isosurface-mesh.ts

@@ -42,10 +42,10 @@ export async function createVolumeIsosurface(ctx: VisualContext, volume: VolumeD
 
 export const IsosurfaceParams = {
     ...Mesh.Params,
-    isoValueAbsolute: PD.RangeParam('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
-    isoValueRelative: PD.RangeParam('Iso Value Relative', '', 2, -10, 10, 0.1),
+    isoValueAbsolute: PD.Range('Iso Value Absolute', '', 0.22, -1, 1, 0.01),
+    isoValueRelative: PD.Range('Iso Value Relative', '', 2, -10, 10, 0.1),
 }
-export const DefaultIsosurfaceProps = PD.paramDefaultValues(IsosurfaceParams)
+export const DefaultIsosurfaceProps = PD.getDefaultValues(IsosurfaceParams)
 export type IsosurfaceProps = typeof DefaultIsosurfaceProps
 
 export function IsosurfaceVisual(): VolumeVisual<IsosurfaceProps> {

+ 1 - 1
src/mol-state/transformer.ts

@@ -20,7 +20,7 @@ export namespace Transformer {
     export type Id = string & { '@type': 'transformer-id' }
     export type Params<T extends Transformer<any, any, any>> = T extends Transformer<any, any, infer P> ? P : unknown;
     export type To<T extends Transformer<any, any, any>> = T extends Transformer<any, infer B, any> ? B : unknown;
-    export type ControlsFor<A extends StateObject, Props> = { [P in keyof Props]?: ((a: A, globalCtx: unknown) => PD.Param) }
+    export type ControlsFor<A extends StateObject, Props> = { [P in keyof Props]?: ((a: A, globalCtx: unknown) => PD.Any) }
 
     export interface ApplyParams<A extends StateObject = StateObject, P = unknown> {
         a: A,

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

@@ -2,90 +2,90 @@
  * Copyright (c) 2018 mol* contributors, licensed under MIT, See LICENSE file for more info.
  *
  * @author Alexander Rose <alexander.rose@weirdbyte.de>
+ * @author David Sehnal <david.sehnal@gmail.com>
  */
 
-import { Color } from './color';
+import { Color as ColorData } from './color';
 
 export namespace ParamDefinition {
-    export interface BaseParam<T> {
+    export interface Base<T> {
         label: string
         description: string
         defaultValue: T
     }
 
-    // TODO: is this really needed?
-    // export interface ValueParam<T> extends BaseParam<T> {
-    //     type: 'value'
-    // }
-    // export function ValueParam<T>(label: string, description: string, defaultValue: T): ValueParam<T> {
-    //     return { type: 'value', label, description, defaultValue }
-    // }
+    export interface GenericValue<T> extends Base<T> {
+        type: 'generic-value'
+    }
+    export function GenericValue<T>(label: string, description: string, defaultValue: T): GenericValue<T> {
+        return { type: 'generic-value', label, description, defaultValue }
+    }
 
-    export interface SelectParam<T extends string> extends BaseParam<T> {
+    export interface Select<T extends string> extends Base<T> {
         type: 'select'
-        /** array of (value, label) tupels */
+        /** array of (value, label) tuples */
         options: [T, string][]
     }
-    export function SelectParam<T extends string>(label: string, description: string, defaultValue: T, options: [T, string][]): SelectParam<T> {
+    export function Select<T extends string>(label: string, description: string, defaultValue: T, options: [T, string][]): Select<T> {
         return { type: 'select', label, description, defaultValue, options }
     }
 
-    export interface MultiSelectParam<E extends string, T = E[]> extends BaseParam<T> {
+    export interface MultiSelect<E extends string, T = E[]> extends Base<T> {
         type: 'multi-select'
-        /** array of (value, label) tupels */
+        /** array of (value, label) tuples */
         options: [E, string][]
     }
-    export function MultiSelectParam<E extends string, T = E[]>(label: string, description: string, defaultValue: T, options: [E, string][]): MultiSelectParam<E, T> {
+    export function MultiSelect<E extends string, T = E[]>(label: string, description: string, defaultValue: T, options: [E, string][]): MultiSelect<E, T> {
         return { type: 'multi-select', label, description, defaultValue, options }
     }
 
-    export interface BooleanParam extends BaseParam<boolean> {
+    export interface Boolean extends Base<boolean> {
         type: 'boolean'
     }
-    export function BooleanParam(label: string, description: string, defaultValue: boolean): BooleanParam {
+    export function Boolean(label: string, description: string, defaultValue: boolean): Boolean {
         return { type: 'boolean', label, description, defaultValue }
     }
 
-    export interface RangeParam extends BaseParam<number> {
+    export interface Range extends Base<number> {
         type: 'range'
         min: number
         max: number
         /** if an `integer` parse value with parseInt, otherwise use parseFloat */
         step: number
     }
-    export function RangeParam(label: string, description: string, defaultValue: number, min: number, max: number, step: number): RangeParam {
+    export function Range(label: string, description: string, defaultValue: number, min: number, max: number, step: number): Range {
         return { type: 'range', label, description, defaultValue, min, max, step }
     }
 
-    export interface TextParam extends BaseParam<string> {
+    export interface Text extends Base<string> {
         type: 'text'
     }
-    export function TextParam(label: string, description: string, defaultValue: string): TextParam {
+    export function Text(label: string, description: string, defaultValue: string = ''): Text {
         return { type: 'text', label, description, defaultValue }
     }
 
-    export interface ColorParam extends BaseParam<Color> {
+    export interface Color extends Base<ColorData> {
         type: 'color'
     }
-    export function ColorParam(label: string, description: string, defaultValue: Color): ColorParam {
+    export function Color(label: string, description: string, defaultValue: ColorData): Color {
         return { type: 'color', label, description, defaultValue }
     }
 
-    export interface NumberParam extends BaseParam<number> {
+    export interface Numeric extends Base<number> {
         type: 'number'
         min: number
         max: number
         /** if an `integer` parse value with parseInt, otherwise use parseFloat */
         step: number
     }
-    export function NumberParam(label: string, description: string, defaultValue: number, min: number, max: number, step: number): NumberParam {
+    export function Numeric(label: string, description: string, defaultValue: number, min: number, max: number, step: number): Numeric {
         return { type: 'number', label, description, defaultValue, min, max, step }
     }
 
-    export type Param = /* ValueParam<any> | */ SelectParam<any> | MultiSelectParam<any> | BooleanParam | RangeParam | TextParam | ColorParam | NumberParam
-    export type Params = { [k: string]: Param }
+    export type Any = /* ValueParam<any> | */ Select<any> | MultiSelect<any> | Boolean | Range | Text | Color | Numeric
+    export type Params = { [k: string]: Any }
 
-    export function paramDefaultValues<T extends Params>(params: T) {
+    export function getDefaultValues<T extends Params>(params: T) {
         const d: { [k: string]: any } = {}
         Object.keys(params).forEach(k => d[k] = params[k].defaultValue)
         return d as { [k in keyof T]: T[k]['defaultValue'] }