speckView - plotly/speck GitHub Wiki

The component appears to contain all the functions determining how the molecule is rendered.

Public Functions

new (function)

input

nothing

output

Returns deep object containing the default view settings. These settings are as follows:

{
    aspect: 1.0,
    zoom: 0.125,
    translation: {
        x: 0.0,
        y: 0.0
    },
    atomScale: 0.6,
    relativeAtomScale: 1.0,
    bondScale: 0.5,
    rotation: glm.mat4.create(),
    ao: 0.75,
    aoRes: 256,
    brightness: 0.5,
    outline: 0.0,
    spf: 32,
    bonds: false,
    bondThreshold: 1.2,
    bondShade: 0.5,
    atomShade: 0.5,
    resolution: 768,
    dofStrength: 0.0,
    dofPosition: 0.5,
    fxaa: 1
}

rotate (function)

input

v

view object as given by the new function

dx

diff in mouse x position

dy

diff in mouse y position

output

returns nothing

mutates the first parameter v provided with the updated view

passes the returned updated view through resolve first

Private Functions

resolve

Purpose is to restrict the values of certain properties in the object passed in

input

v

view object as given by the new

returns nothing

output

mutates the first parameter v provided with the updated object

note that the following properties will always be present in the updated object. if the properties are not present they would be added and given a value of NaN

ao: NaN
atomScale: NaN
atomShade: NaN
bondScale: NaN
bondShade: NaN
brightness: NaN
dofPosition: NaN
dofStrength: NaN
outline: NaN
relativeAtomScale: NaN
zoom: NaN