Skip to main content

Class: SpatialComponent

component.SpatialComponent

Hierarchy#

Properties#

componentName#

â–ª Static componentName: ComponentName = "spatial"

Overrides#

Component.componentName

Defined in#

component/spatial/SpatialComponent.ts:77

Accessors#

activated#

• get activated(): boolean

Get activated.

Returns#

boolean

Value indicating if the component is currently active.

Defined in#

component/Component.ts:78


defaultConfiguration#

• get defaultConfiguration(): TConfiguration

Get default configuration.

Returns#

TConfiguration

Default configuration for component.

Defined in#

component/Component.ts:92


name#

• get name(): string

Get name.

description The name of the component. Used when interacting with the component through the Viewer's API.

Returns#

string

Defined in#

component/Component.ts:107

Methods#

configure#

â–¸ configure(configuration): void

Configure the component.

Parameters#

NameTypeDescription
configurationSpatialConfigurationComponent configuration.

Returns#

void

Inherited from#

Component.configure

Defined in#

component/Component.ts:131


fire#

â–¸ fire<T>(type, event): void

Type parameters#

Name
T

Parameters#

NameType
typeComponentEventType
eventT

Returns#

void

Inherited from#

Component.fire

Defined in#

component/Component.ts:149


getFrameIdAt#

â–¸ getFrameIdAt(pixelPoint): Promise<string>

Returns the image id of the camera frame closest to the current render camera position at the specified point.

description Notice that the pixelPoint argument requires x, y coordinates from pixel space.

With this function, you can use the coordinates provided by mouse events to get information out of the spatial component.

If no camera frame exist at the pixel point, null will be returned.

example

spatialComponent.getFrameIdAt([100, 125])    .then((imageId) => { console.log(imageId); });

Parameters#

NameTypeDescription
pixelPointnumber[]Pixel coordinates on the viewer element.

Returns#

Promise<string>

Image id of the camera frame closest to the camera. If no camera frame is intersected at the pixel point, null will be returned.

Defined in#

component/spatial/SpatialComponent.ts:121


off#

â–¸ off<T>(type, handler): void

Unsubscribe from an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typeComponentEventTypeThe name of the event to unsubscribe from.
handler(event: T) => voidThe handler to remove.

Returns#

void

Inherited from#

Component.off

Defined in#

component/Component.ts:156


on#

â–¸ on<T>(type, handler): void

Subscribe to an event by its name.

Type parameters#

Name
T

Parameters#

NameTypeDescription
typeComponentEventTypeThe name of the event to subscribe to.
handler(event: T) => voidThe handler called when the event occurs.

Returns#

void

Inherited from#

Component.on

Defined in#

component/Component.ts:163