Skip to content

Latest commit

 

History

History
100 lines (71 loc) · 3.85 KB

1-to-2.md

File metadata and controls

100 lines (71 loc) · 3.85 KB

Entity Declaration

Version 1.0 entity type declaration was too verbose.

1.0

export interface AnnotationProps extends Entity.CommonProps { query: Query.Source; color: Visualization.Color; }
export interface Annotation extends Entity<Annotation, AnnotationType, AnnotationProps> { }         
export interface AnnotationType extends Entity.Type<AnnotationType, Annotation, AnnotationProps> { }   
export const Annotation = Entity.create<Annotation, AnnotationType, AnnotationProps>({ name: 'PDBe Sequence Annotation', typeClass: 'Object', shortName: 'SA', description: 'Represents PDBe sequence annotation.' }, { isSilent: true, isFocusable: true });

Creating a behaviour:

export interface BehaviourProps extends Entity.Behaviour.Props<Interactivity.Behaviour> { }
export interface Behaviour extends Entity<Behaviour, BehaviourType, BehaviourProps> { }         
export interface BehaviourType extends Entity.Type<BehaviourType, Behaviour, BehaviourProps> { }   
export const Behaviour = Entity.create<Behaviour, BehaviourType, BehaviourProps>({ name: 'PDBe Sequence Annotation Behaviour', typeClass: 'Behaviour', shortName: 'SA', description: 'Represents PDBe sequence annoation behaviour.' });

2.0

export interface Annotations extends Entity<{ data: any }> { }
export const Annotations = Entity.create<{ data: any }>({ name: 'PDBe Sequence Annotations', typeClass: 'Data', shortName: 'SA', description: 'Represents PDBe sequence annotation data.' });

The goal is to be able to write

const Annotations = Entity.create<Annotation['props']>(...)

However when I tried this, it broke the TypeScript compiler :(

Alternatively, one can do:

interface AnnotationsProps { data: any }
interface Annotations extends Entity<AnnotationsProps> { }
const Annotations = Entity.create<AnnotationsProps>(...)

but lets hope the compiler will get fixed and it will be possible to use Annotations['props'].

Creating a behaviour entity:

export interface Behaviour extends Entity<Entity.Behaviour.Props<Interactivity.Behaviour>> { }
export const Behaviour = Entity.create<Entity.Behaviour.Props<Interactivity.Behaviour>>({ name: 'PDBe Sequence Annotation Behaviour', typeClass: 'Behaviour', shortName: 'SA', description: 'Represents PDBe sequence annoation behaviour.' });

Transform Declaration

Under development. The goal is to simplify and streamline the declaration of transforms.

Internal Molecule Representation

Under developement. The goal is to allow efficient representation that can be shared between multiple models and effectively construct assemblies/symmetry mates while still allowing all the existing selection functionality to work on the transformed models as well.

Layout Region State

In the old version it was possible to hide layout regions using the hiddenRegions field

plugin.command(Command.Layout.SetState, { 
    hiddenRegions: [Bootstrap.Components.LayoutRegion.Left, Bootstrap.Components.LayoutRegion.Bottom]
});

This is now replaced with the regionStates object. In addition to Hidden a region can now be Sticky as well meaning that is it shown even if the controls are in the "hidden" state.

plugin.command(Command.Layout.SetState, { 
    regionStates: { 
        [Bootstrap.Components.LayoutRegion.Left]: 'Hidden', 
        [Bootstrap.Components.LayoutRegion.Bottom]: 'Hidden',
        [Bootstrap.Components.LayoutRegion.Right]: 'Sticky'
    }
});

Density Data
============

The parameter ``normalized`` has been removed from the ``LiteMol.Bootstrap.Entity.Transformer.Density.ParseDataParams`` interface.

Vectors
=======

Any "LiteMol object vector" of the form ``{ x, y, z}`` should now be represented as a 3 element array ``[x, y, z]``.