Skip to content

@jpmorganchase/anu / Exports / Selection

Class: Selection

Table of contents

Constructors

Properties

Constructors

constructor

new Selection(nodes, scene?): Selection

Parameters

NameType
nodesMesh[] | Node[] | TransformNode[]
scene?Scene

Returns

Selection

Defined in

selection/index.ts:46

Properties

action

action: (this: Selection, action: Action | (d: any, n: AbstractMesh, i: number) => Action) => Selection = action

Type declaration

▸ (this, action): Selection

Parameters
NameType
thisSelection
actionAction | (d: any, n: AbstractMesh, i: number) => Action
Returns

Selection

Defined in

selection/index.ts:76


addTags

addTags: (this: Selection, tags: string | (d: any, i: number) => string) => Selection = addTags

Type declaration

▸ (this, tags): Selection

Parameters
NameType
thisSelection
tagsstring | (d: any, i: number) => string
Returns

Selection

Defined in

selection/index.ts:73


ambientColor

ambientColor: (this: Selection, color: Color3 | (d: any, n: Node, i: number) => Color3) => Selection = ambientColor

Type declaration

▸ (this, color): Selection

Sets the material ambient color on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
colorColor3 | (d: any, n: Node, i: number) => Color3A instance of Color3 or a function that returns a Color3
Returns

Selection

The modified selection

Defined in

selection/index.ts:81


ambientTexture

ambientTexture: (this: Selection, texture: BaseTexture | (d: any, n: Node, i: number) => BaseTexture) => Selection = ambientTexture

Type declaration

▸ (this, texture): Selection

Sets the material ambient texture on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
textureBaseTexture | (d: any, n: Node, i: number) => BaseTextureA instance of BaseTexture or a function that returns a BaseTexture
Returns

Selection

The modified selection

Defined in

selection/index.ts:88


attr

attr: (this: Selection, accessor: string, value: any) => Selection = attr

Type declaration

▸ (this, accessor, value): Selection

Called from a selection this method allows you to set any property or subproperty of nodes in the selection given that property exists.

Parameters
NameTypeDescription
thisSelection-
accessorstringThe name of the property to be set (e.g. "renderingGroupId", "material.alpha").
valueanyThe value to set the property or a function(d, i) returing the value for said property with scope of the binded data "d", mesh "m", and the index "i".
Returns

Selection

The modified selection

Defined in

selection/index.ts:72


bind

bind: <MeshType>(this: Selection, shape: MeshType, options: Property<MeshTypes, MeshType>, data: object[]) => Selection = bind

Type declaration

▸ <MeshType>(this, shape, options?, data?): Selection

Take a selection, a shape type, and data. For each index in the data create a new mesh for each node in the selection as the parent. The data index of the mesh is also attached to the mesh node object under the metadata property.

Type parameters
NameType
MeshTypeextends keyof MeshTypes
Parameters
NameTypeDescription
thisSelection-
shapeMeshTypeA string of the type of the mesh geometry being created.
optionsProperty<MeshTypes, MeshType>A object containing the initial mesh parameters for the selected geometry, can be either values or functions.
dataobject[]The data to bind elements too, must be passed as a list of objects where each object represents a row of tabular data.
Returns

Selection

An instance of Selection, a class containing a array of selected nodes, the scene, and the functions of the class Selection, or undefined if a selection could not be made.

Defined in

selection/index.ts:55


bindInstance

bindInstance: (this: Selection, mesh: Mesh, data: object[]) => Selection = bindInstance

Type declaration

▸ (this, mesh, data?): Selection

Take a selection, a shape type, and data. For each index in the data create a new mesh for each node in the selection as the parrent. The data index of the mesh is also attached to the mesh node object under the metadate property.

Parameters
NameTypeDescription
thisSelection-
meshMeshThe mesh to create instances from.
dataobject[]The data to bind elements too, must be passed as a list of objects where each object represents a row of tabular data.
Returns

Selection

An instance of Selection, a class contating a array of selected nodes, the scene, and the functions of the class Selection, or undefined if a selection could not be made.

Defined in

selection/index.ts:57


boundingBox

boundingBox: (this: Selection, exclude: string) => BoundingInfo = boundingBox

Type declaration

▸ (this, exclude?): BoundingInfo

Calculates the cumulative bounding box of the current selection.

Parameters
NameTypeDefault value
thisSelectionundefined
excludestring""
Returns

BoundingInfo

instance of BoundingInfo class, an object containing all bounding box values.

Defined in

selection/index.ts:92


diffuseColor

diffuseColor: (this: Selection, color: Color3 | (d: any, node: Node, i: number) => Color3) => Selection = diffuseColor

Type declaration

▸ (this, color): Selection

Sets the material diffuse color on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
colorColor3 | (d: any, node: Node, i: number) => Color3A instance of Color3 or a function that returns a Color3
Returns

Selection

The modified selection

Defined in

selection/index.ts:78


diffuseTexture

diffuseTexture: (this: Selection, texture: BaseTexture | (d: any, n: Node, i: number) => BaseTexture) => Selection = diffuseTexture

Type declaration

▸ (this, texture): Selection

Sets the material diffuse texture on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
textureBaseTexture | (d: any, n: Node, i: number) => BaseTextureA instance of BaseTexture or a function that returns a BaseTexture
Returns

Selection

The modified selection

Defined in

selection/index.ts:85


dispose

dispose: (this: Selection, filter?: (d: any, i: number) => Boolean) => Selection = dispose

Type declaration

▸ (this, filter?): Selection

Parameters
NameType
thisSelection
filter?(d: any, i: number) => Boolean
Returns

Selection

Defined in

selection/index.ts:84


drawTextDT

drawTextDT: (this: Selection, text: string | (d: any, i: number) => string, font: string | (d: any, i: number) => string, x: null | number | (d: any, i: number) => number, y: null | number | (d: any, i: number) => number, color: null | string | (d: any, i: number) => string, clearColor: null | string | (d: any, i: number) => string) => Selection = drawTextDT

Type declaration

▸ (this, text, font, x?, y?, color?, clearColor?): Selection

Parameters
NameTypeDefault value
thisSelectionundefined
textstring | (d: any, i: number) => stringundefined
fontstring | (d: any, i: number) => stringundefined
xnull | number | (d: any, i: number) => numbernull
ynull | number | (d: any, i: number) => numbernull
colornull | string | (d: any, i: number) => stringnull
clearColornull | string | (d: any, i: number) => stringnull
Returns

Selection

Defined in

selection/index.ts:91


emissiveColor

emissiveColor: (this: Selection, color: Color3 | (d: any, n: Node, i: number) => Color3) => Selection = emissiveColor

Type declaration

▸ (this, color): Selection

Sets the material emissive color on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
colorColor3 | (d: any, n: Node, i: number) => Color3A instance of Color3 or a function that returns a Color3
Returns

Selection

The modified selection

Defined in

selection/index.ts:80


emissiveTexture

emissiveTexture: (this: Selection, texture: BaseTexture | (d: any, n: Node, i: number) => BaseTexture) => Selection = emissiveTexture

Type declaration

▸ (this, texture): Selection

Sets the material emissive texture on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
textureBaseTexture | (d: any, n: Node, i: number) => BaseTextureA instance of BaseTexture or a function that returns a BaseTexture
Returns

Selection

The modified selection

Defined in

selection/index.ts:87


filter

filter: (this: Selection, method: (d: any, n: Node, i: number) => boolean) => Selection = filter

Type declaration

▸ (this, method): Selection

Filters a seclection based on the function provided

Parameters
NameTypeDescription
thisSelection-
method(d: any, n: Node, i: number) => booleanA function with two parameters d (the binded data) and i (the index) that returns a boolean.
Returns

Selection

The modified selection

Defined in

selection/index.ts:93


get

get: (this: Selection, accessor: string) => Object[] = get

Type declaration

▸ (this, accessor): Object[]

Parameters
NameType
thisSelection
accessorstring
Returns

Object[]

Defined in

selection/index.ts:71


hasTags

hasTags: (this: Selection, query?: string) => Object[] = hasTags

Type declaration

▸ (this, query?): Object[]

Parameters
NameType
thisSelection
query?string
Returns

Object[]

Defined in

selection/index.ts:75


id

id: (this: Selection, id: string | (d: any, n: Node, i: number) => string) => Selection = id

Type declaration

▸ (this, id): Selection

Sets the id on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
idstring | (d: any, n: Node, i: number) => stringA string or a function that returns a string
Returns

Selection

The modified selection

Defined in

selection/index.ts:97


material

material: (this: Selection, material: Material | (d: any, n: Node, i: number) => Material) => Selection = material

Type declaration

▸ (this, material): Selection

Sets the material on all meshes in the selection, non-meshes will be skipped.

Parameters
NameTypeDescription
thisSelection-
materialMaterial | (d: any, n: Node, i: number) => MaterialA instance of the Material class or a function that returns a Material.
Returns

Selection

The modified selection

Defined in

selection/index.ts:77


metadata

metadata: (this: Selection, key: string, value: {} | (d: any, n: Node, i: number) => {}) => Selection = metadata

Type declaration

▸ (this, key, value): Selection

Adds to the metadata on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
keystringA string to be the key for your object inside node.metadata
value{} | (d: any, n: Node, i: number) => {}An object or a function that returns an object
Returns

Selection

The modified selection

Defined in

selection/index.ts:98


name

name: (this: Selection, name: string | (d: any, n: Node, i: number) => string) => Selection = name

Type declaration

▸ (this, name): Selection

Sets the Name on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
namestring | (d: any, n: Node, i: number) => stringA string or a function that returns a string
Returns

Selection

The modified selection

Defined in

selection/index.ts:96


position

position: (this: Selection, value: Vector3 | (d: any, n: Node, i: number) => Vector3) => Selection = position

Type declaration

▸ (this, value): Selection

Sets the XYZ position on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valueVector3 | (d: any, n: Node, i: number) => Vector3A instance of Vector3 or a function that returns a Vector3
Returns

Selection

The modified selection

Defined in

selection/index.ts:58


positionUI

positionUI: (this: Selection, options: positionUIOptions) => Selection = positionUI

Type declaration

▸ (this, options?): Selection

Take a selection, for each node in the selection attach UI elements that provide positioning behavior

Parameters
NameTypeDescription
thisSelection-
optionspositionUIOptionsThe associated options for this prefab.
Returns

Selection

An instance of Selection, a class containing a array of selected nodes, the scene, and the functions of the class Selection, or undefined if a selection could not be made.

Defined in

selection/index.ts:99


positionX

positionX: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = positionX

Type declaration

▸ (this, value): Selection

Sets the X position on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:59


positionY

positionY: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = positionY

Type declaration

▸ (this, value): Selection

Sets the Y position on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:60


positionZ

positionZ: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = positionZ

Type declaration

▸ (this, value): Selection

Sets the Z position on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:61


prop

prop: (this: Selection, accessor: string, value: any) => Selection = prop

Type declaration

▸ (this, accessor, value): Selection

Called from a selection this method allows you to set any property or subproperty of nodes in the selection given that property exists.

Parameters
NameTypeDescription
thisSelection-
accessorstringThe name of the property to be set (e.g. "renderingGroupId", "material.alpha").
valueanyThe value to set the property or a function(d, i) returing the value for said property with scope of the binded data "d", mesh "m", and the index "i".
Returns

Selection

The modified selection

Defined in

selection/index.ts:95


props

props: (this: Selection, properties: {}) => Selection = props

Type declaration

▸ (this, properties): Selection

Called from a selection this method allows you to set multiple properties or subproperties of nodes in the selection given that property exists. Use this method to improve performace when setting or changing many properties.

Parameters
NameTypeDescription
thisSelection-
propertiesObjectObject of key value pairs for the properties to be set or changed, e.g., {"renderingGroupId": 2, "material.alpha": 0.2}.
Returns

Selection

The modified selection

Defined in

selection/index.ts:94


registerInstancedBuffer

registerInstancedBuffer: (this: Selection, attr: string, size: number) => Selection = registerInstancedBuffer

Type declaration

▸ (this, attr, size): Selection

Parameters
NameType
thisSelection
attrstring
sizenumber
Returns

Selection

Defined in

selection/index.ts:82


removeTags

removeTags: (this: Selection, tags: string) => Selection = removeTags

Type declaration

▸ (this, tags): Selection

Parameters
NameType
thisSelection
tagsstring
Returns

Selection

Defined in

selection/index.ts:74


rotateUI

rotateUI: (this: Selection, options: rotateUIOptions) => Selection = rotateUI

Type declaration

▸ (this, options?): Selection

Parameters
NameType
thisSelection
optionsrotateUIOptions
Returns

Selection

Defined in

selection/index.ts:101


rotation

rotation: (this: Selection, value: Vector3 | (d: any, n: Node, i: number) => Vector3) => Selection = rotation

Type declaration

▸ (this, value): Selection

Sets the XYZ rotation in raidians on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valueVector3 | (d: any, n: Node, i: number) => Vector3A instance of Vector3 or a function that returns a Vector3
Returns

Selection

The modified selection

Defined in

selection/index.ts:63


rotationX

rotationX: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = rotationX

Type declaration

▸ (this, value): Selection

Sets the X rotation in radians on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:64


rotationY

rotationY: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = rotationY

Type declaration

▸ (this, value): Selection

Sets the Y rotation in radians on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:65


rotationZ

rotationZ: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = rotationZ

Type declaration

▸ (this, value): Selection

Sets the Z rotation in radians on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:66


run

run: (this: Selection, method: (d: any, node: Node, i: number) => any) => Selection = run

Type declaration

▸ (this, method): Selection

Parameters
NameType
thisSelection
method(d: any, node: Node, i: number) => any
Returns

Selection

Defined in

selection/index.ts:56


scaleDT

scaleDT: (this: Selection, value: number | (d: any, i: number) => number) => Selection = scaleDT

Type declaration

▸ (this, value): Selection

Parameters
NameType
thisSelection
valuenumber | (d: any, i: number) => number
Returns

Selection

Defined in

selection/index.ts:89


scaleToDT

scaleToDT: (this: Selection, value: number | (d: any, i: number) => number) => Selection = scaleDT

Type declaration

▸ (this, value): Selection

Parameters
NameType
thisSelection
valuenumber | (d: any, i: number) => number
Returns

Selection

Defined in

selection/index.ts:90


scaleUI

scaleUI: (this: Selection, options: scaleUIOptions) => Selection = scaleUI

Type declaration

▸ (this, options?): Selection

Parameters
NameType
thisSelection
optionsscaleUIOptions
Returns

Selection

Defined in

selection/index.ts:100


scaling

scaling: (this: Selection, value: Vector3 | (d: any, n: Node, i: number) => Vector3) => Selection = scaling

Type declaration

▸ (this, value): Selection

Sets the XYZ scaling on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valueVector3 | (d: any, n: Node, i: number) => Vector3A instance of Vector3 or a function that returns a Vector3
Returns

Selection

The modified selection

Defined in

selection/index.ts:67


scalingX

scalingX: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = scalingX

Type declaration

▸ (this, value): Selection

Sets the X scaling on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:68


scalingY

scalingY: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = scalingY

Type declaration

▸ (this, value): Selection

Sets the Y scaling on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:69


scalingZ

scalingZ: (this: Selection, value: number | (d: any, n: Node, i: number) => number) => Selection = scalingZ

Type declaration

▸ (this, value): Selection

Sets the Z scaling on all nodes in the selection.

Parameters
NameTypeDescription
thisSelection-
valuenumber | (d: any, n: Node, i: number) => numberA number or a function that returns a number.
Returns

Selection

The modified selection

Defined in

selection/index.ts:70


scene

Optional scene: Scene

Defined in

selection/index.ts:44


select

select: (this: Selection, name: string) => Selection = select

Type declaration

▸ (this, name): Selection

Select all nodes from the childern graph(s) of selected matching the indicator and return it as a instance of Selection.

selection types; .<Name> : select by Name #<ID> : select by ID $<Tags> : select by tags

Parameters
NameType
thisSelection
namestring
Returns

Selection

Defined in

selection/index.ts:51


selectId

selectId: (this: Selection, id: string | string[]) => Selection = selectId

Type declaration

▸ (this, id): Selection

Select nodes from the childern graph(s) of a selection by ID or list of IDs and return them as a instance of Selection.

Parameters
NameTypeDescription
thisSelection-
idstring | string[]A string or array of strings of ids of nodes to be selected.
Returns

Selection

A new instance of Selection with the selected nodes.

Defined in

selection/index.ts:53


selectName

selectName: (this: Selection, name: string | string[]) => Selection = selectName

Type declaration

▸ (this, name): Selection

Select nodes from the childern graph(s) of a selection by name or list of names and return them as a instance of Selection.

Parameters
NameTypeDescription
thisSelection-
namestring | string[]A string or array of strings of the names of the nodes to be selected.
Returns

Selection

A new instance of Selection with the selected nodes.

Defined in

selection/index.ts:52


selectTag

selectTag: (this: Selection, tag: string | string[]) => Selection = selectTag

Type declaration

▸ (this, tag): Selection

Select nodes from the childern graph(s) of a selection by tag or list of tags and return them as a instance of Selection.

Parameters
NameTypeDescription
thisSelection-
tagstring | string[]A string or array of strings of tags or tag unions of nodes to be selected.
Returns

Selection

A new instance of Selection with the selected nodes.

Defined in

selection/index.ts:54


selected

selected: Mesh[] | Node[] | TransformNode[]

Defined in

selection/index.ts:43


setInstancedBuffer

setInstancedBuffer: (this: Selection, attr: string, value: any) => Selection = setInstancedBuffer

Type declaration

▸ (this, attr, value): Selection

Parameters
NameType
thisSelection
attrstring
valueany
Returns

Selection

Defined in

selection/index.ts:83


specularColor

specularColor: (this: Selection, color: Color3 | (d: any, n: Node, i: number) => Color3) => Selection = specularColor

Type declaration

▸ (this, color): Selection

Sets the material specular color on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
colorColor3 | (d: any, n: Node, i: number) => Color3A instance of Color3 or a function that returns a Color3
Returns

Selection

The modified selection

Defined in

selection/index.ts:79


specularTexture

specularTexture: (this: Selection, texture: BaseTexture | (d: any, n: Node, i: number) => BaseTexture) => Selection = specularTexture

Type declaration

▸ (this, texture): Selection

Sets the material specular texture on all meshes in the selection, meshs without materials won't be affected.

Parameters
NameTypeDescription
thisSelection-
textureBaseTexture | (d: any, n: Node, i: number) => BaseTextureA instance of BaseTexture or a function that returns a BaseTexture
Returns

Selection

The modified selection

Defined in

selection/index.ts:86


translate

translate: (this: Selection, value: Vector3 | (d: any, i: number) => Vector3, distance: number | (d: any, i: number) => number, space?: Space) => Selection = translate

Type declaration

▸ (this, value, distance, space?): Selection

Parameters
NameType
thisSelection
valueVector3 | (d: any, i: number) => Vector3
distancenumber | (d: any, i: number) => number
space?Space
Returns

Selection

Defined in

selection/index.ts:62