Constructor
new ModelView(model, indices)
Name | Type | Description |
---|---|---|
model | Model | Model to use for the view |
indices | Array.<int> | Indices of the atom images to include in the view |
- Source
Members
(readonly) atoms :Array.<AtomImage>
Atom images in this view
- Array.<AtomImage>
- Source
elements
Get sorted set of unique elements in the ModelView
- Source
(readonly) indices :Array.<int>
Indices of the atom images in this view
- Array.<int>
- Source
(readonly) length :int
Number of atom images in this view
- int
- Source
(readonly) model :Model
Model used by this view
- Model
- Source
Methods
addEllipsoids(data, name, args)
Add ellipsoids to the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
data | Object | | Data to use for the ellipsoid (see AtomImage.addEllipsoid for details) | |
name | String | | ellipsoid | Name of the ellipsoids |
args | Object | | Arguments for creating the ellipsoids |
- Source
addLabels(text, name, args)
Add labels to the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
text | String | | Text of the labels, as single value, array, or function returning a string for each atom image. | |
name | String | | label | Name of the label |
args | Object | | Arguments for creating the label |
- Source
and(mview) → {ModelView}
Intersection with another ModelView
Name | Type | Description |
---|---|---|
mview | ModelView | Other view |
- Source
Result
- Type:
- ModelView
ellipsoidProperties(name, property, value)
Get or set ellipsoids' properties for the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
name | String | | ellipsoid | Name of the ellipsoids |
property | String | | color | Property to get or set |
value | Any | | null | If not provided, get. If provided, set this value |
- Source
find(query) → {ModelView}
Perform a further search within the atoms included in this ModelView.
Name | Type | Description |
---|---|---|
query | Array | Query for the search, formatted as for the Model.find function. |
- Source
Result of the query
- Type:
- ModelView
hide() → {ModelView}
Make all atoms in the view invisible. Can be chained
- Source
- Type:
- ModelView
labelProperties(name, property, value)
Get or set labels' properties for the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
name | String | | label | Name of the labels |
property | String | | color | Property to get or set |
value | Any | | null | If not provided, get. If provided, set this value |
- Source
map(func) → {Array}
Run a function on each AtomImage, returning an Array of the results.
Name | Type | Description |
---|---|---|
func | function | Function to run, should take AtomImage and index as arguments |
- Source
Return values
- Type:
- Array
not() → {ModelView}
Complement to this ModelView
- Source
Result
- Type:
- ModelView
or(mview) → {ModelView}
Union with another ModelView
Name | Type | Description |
---|---|---|
mview | ModelView | Other view |
- Source
Result
- Type:
- ModelView
remove()
Remove all atoms in mview from the current view
- Source
removeEllipsoids(name)
Remove ellipsoids from the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
name | String | | ellipsoid | Name of the ellipsoids to remove |
- Source
removeLabels(name)
Remove labels from the atom images in this ModelView
Name | Type | Default | Description |
---|---|---|---|
name | String | | label | Name of the labels to remove |
- Source
setProperty(name, value)
Set some property of the atoms within the ModelView.
Name | Type | Default | Description |
---|---|---|---|
name | String | Name of the property to set | |
value | int | | null | Value to set for the atoms. It can be either:
|
- Source
show() → {ModelView}
Make all atoms in the view visible. Can be chained
- Source
- Type:
- ModelView
uniqueSites()
Unique atoms in the current view (based on site labels)
- Source
xor(mview) → {ModelView}
Exclusive OR with another ModelView
Name | Type | Description |
---|---|---|
mview | ModelView | Other view |
- Source
Result
- Type:
- ModelView