@jpmorganchase/anu / Exports / Selection
Class: Selection
Table of contents
Constructors
Properties
- action
- addTags
- ambientColor
- ambientTexture
- attr
- bind
- bindInstance
- boundingBox
- diffuseColor
- diffuseTexture
- dispose
- drawTextDT
- emissiveColor
- emissiveTexture
- filter
- get
- hasTags
- id
- material
- metadata
- name
- position
- positionUI
- positionX
- positionY
- positionZ
- prop
- props
- registerInstancedBuffer
- removeTags
- rotateUI
- rotation
- rotationX
- rotationY
- rotationZ
- run
- scaleDT
- scaleToDT
- scaleUI
- scaling
- scalingX
- scalingY
- scalingZ
- scene
- select
- selectId
- selectName
- selectTag
- selected
- setInstancedBuffer
- specularColor
- specularTexture
- translate
Constructors
constructor
• new Selection(nodes
, scene?
): Selection
Parameters
Name | Type |
---|---|
nodes | Mesh [] | Node [] | TransformNode [] |
scene? | Scene |
Returns
Defined in
Properties
action
• action: (this
: Selection
, action
: Action
| (d
: any
, n
: AbstractMesh
, i
: number
) => Action
) => Selection
= action
Type declaration
▸ (this
, action
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
action | Action | (d : any , n : AbstractMesh , i : number ) => Action |
Returns
Defined in
addTags
• addTags: (this
: Selection
, tags
: string
| (d
: any
, i
: number
) => string
) => Selection
= addTags
Type declaration
▸ (this
, tags
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
tags | string | (d : any , i : number ) => string |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
color | Color3 | (d : any , n : Node , i : number ) => Color3 | A instance of Color3 or a function that returns a Color3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
texture | BaseTexture | (d : any , n : Node , i : number ) => BaseTexture | A instance of BaseTexture or a function that returns a BaseTexture |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
accessor | string | The name of the property to be set (e.g. "renderingGroupId", "material.alpha"). |
value | any | The 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
The modified selection
Defined in
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
Name | Type |
---|---|
MeshType | extends keyof MeshTypes |
Parameters
Name | Type | Description |
---|---|---|
this | Selection | - |
shape | MeshType | A string of the type of the mesh geometry being created. |
options | Property <MeshTypes , MeshType > | A object containing the initial mesh parameters for the selected geometry, can be either values or functions. |
data | object [] | The data to bind elements too, must be passed as a list of objects where each object represents a row of tabular data. |
Returns
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
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
Name | Type | Description |
---|---|---|
this | Selection | - |
mesh | Mesh | The mesh to create instances from. |
data | object [] | The data to bind elements too, must be passed as a list of objects where each object represents a row of tabular data. |
Returns
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
boundingBox
• boundingBox: (this
: Selection
, exclude
: string
) => BoundingInfo
= boundingBox
Type declaration
▸ (this
, exclude?
): BoundingInfo
Calculates the cumulative bounding box of the current selection.
Parameters
Name | Type | Default value |
---|---|---|
this | Selection | undefined |
exclude | string | "" |
Returns
BoundingInfo
instance of BoundingInfo class, an object containing all bounding box values.
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
color | Color3 | (d : any , node : Node , i : number ) => Color3 | A instance of Color3 or a function that returns a Color3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
texture | BaseTexture | (d : any , n : Node , i : number ) => BaseTexture | A instance of BaseTexture or a function that returns a BaseTexture |
Returns
The modified selection
Defined in
dispose
• dispose: (this
: Selection
, filter?
: (d
: any
, i
: number
) => Boolean
) => Selection
= dispose
Type declaration
▸ (this
, filter?
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
filter? | (d : any , i : number ) => Boolean |
Returns
Defined in
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
Name | Type | Default value |
---|---|---|
this | Selection | undefined |
text | string | (d : any , i : number ) => string | undefined |
font | string | (d : any , i : number ) => string | undefined |
x | null | number | (d : any , i : number ) => number | null |
y | null | number | (d : any , i : number ) => number | null |
color | null | string | (d : any , i : number ) => string | null |
clearColor | null | string | (d : any , i : number ) => string | null |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
color | Color3 | (d : any , n : Node , i : number ) => Color3 | A instance of Color3 or a function that returns a Color3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
texture | BaseTexture | (d : any , n : Node , i : number ) => BaseTexture | A instance of BaseTexture or a function that returns a BaseTexture |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
method | (d : any , n : Node , i : number ) => boolean | A function with two parameters d (the binded data) and i (the index) that returns a boolean. |
Returns
The modified selection
Defined in
get
• get: (this
: Selection
, accessor
: string
) => Object
[] = get
Type declaration
▸ (this
, accessor
): Object
[]
Parameters
Name | Type |
---|---|
this | Selection |
accessor | string |
Returns
Object
[]
Defined in
hasTags
• hasTags: (this
: Selection
, query?
: string
) => Object
[] = hasTags
Type declaration
▸ (this
, query?
): Object
[]
Parameters
Name | Type |
---|---|
this | Selection |
query? | string |
Returns
Object
[]
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
id | string | (d : any , n : Node , i : number ) => string | A string or a function that returns a string |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
material | Material | (d : any , n : Node , i : number ) => Material | A instance of the Material class or a function that returns a Material. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
key | string | A 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
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
name | string | (d : any , n : Node , i : number ) => string | A string or a function that returns a string |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | Vector3 | (d : any , n : Node , i : number ) => Vector3 | A instance of Vector3 or a function that returns a Vector3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
options | positionUIOptions | The associated options for this prefab. |
Returns
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
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
accessor | string | The name of the property to be set (e.g. "renderingGroupId", "material.alpha"). |
value | any | The 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
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
properties | Object | Object of key value pairs for the properties to be set or changed, e.g., {"renderingGroupId": 2, "material.alpha": 0.2}. |
Returns
The modified selection
Defined in
registerInstancedBuffer
• registerInstancedBuffer: (this
: Selection
, attr
: string
, size
: number
) => Selection
= registerInstancedBuffer
Type declaration
▸ (this
, attr
, size
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
attr | string |
size | number |
Returns
Defined in
removeTags
• removeTags: (this
: Selection
, tags
: string
) => Selection
= removeTags
Type declaration
▸ (this
, tags
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
tags | string |
Returns
Defined in
rotateUI
• rotateUI: (this
: Selection
, options
: rotateUIOptions
) => Selection
= rotateUI
Type declaration
▸ (this
, options?
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
options | rotateUIOptions |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | Vector3 | (d : any , n : Node , i : number ) => Vector3 | A instance of Vector3 or a function that returns a Vector3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
run
• run: (this
: Selection
, method
: (d
: any
, node
: Node
, i
: number
) => any
) => Selection
= run
Type declaration
▸ (this
, method
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
method | (d : any , node : Node , i : number ) => any |
Returns
Defined in
scaleDT
• scaleDT: (this
: Selection
, value
: number
| (d
: any
, i
: number
) => number
) => Selection
= scaleDT
Type declaration
▸ (this
, value
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
value | number | (d : any , i : number ) => number |
Returns
Defined in
scaleToDT
• scaleToDT: (this
: Selection
, value
: number
| (d
: any
, i
: number
) => number
) => Selection
= scaleDT
Type declaration
▸ (this
, value
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
value | number | (d : any , i : number ) => number |
Returns
Defined in
scaleUI
• scaleUI: (this
: Selection
, options
: scaleUIOptions
) => Selection
= scaleUI
Type declaration
▸ (this
, options?
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
options | scaleUIOptions |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | Vector3 | (d : any , n : Node , i : number ) => Vector3 | A instance of Vector3 or a function that returns a Vector3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
value | number | (d : any , n : Node , i : number ) => number | A number or a function that returns a number. |
Returns
The modified selection
Defined in
scene
• Optional
scene: Scene
Defined in
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
Name | Type |
---|---|
this | Selection |
name | string |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
id | string | string [] | A string or array of strings of ids of nodes to be selected. |
Returns
A new instance of Selection with the selected nodes.
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
name | string | string [] | A string or array of strings of the names of the nodes to be selected. |
Returns
A new instance of Selection with the selected nodes.
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
tag | string | string [] | A string or array of strings of tags or tag unions of nodes to be selected. |
Returns
A new instance of Selection with the selected nodes.
Defined in
selected
• selected: Mesh
[] | Node
[] | TransformNode
[]
Defined in
setInstancedBuffer
• setInstancedBuffer: (this
: Selection
, attr
: string
, value
: any
) => Selection
= setInstancedBuffer
Type declaration
▸ (this
, attr
, value
): Selection
Parameters
Name | Type |
---|---|
this | Selection |
attr | string |
value | any |
Returns
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
color | Color3 | (d : any , n : Node , i : number ) => Color3 | A instance of Color3 or a function that returns a Color3 |
Returns
The modified selection
Defined in
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
Name | Type | Description |
---|---|---|
this | Selection | - |
texture | BaseTexture | (d : any , n : Node , i : number ) => BaseTexture | A instance of BaseTexture or a function that returns a BaseTexture |
Returns
The modified selection
Defined in
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
Name | Type |
---|---|
this | Selection |
value | Vector3 | (d : any , i : number ) => Vector3 |
distance | number | (d : any , i : number ) => number |
space? | Space |