Skip to main content

ConnectionLayerTool

geovisto-map • Readme | API


geovisto-map / ConnectionLayerTool

Class: ConnectionLayerTool

This class represents Connection layer tool. It uses SVG layer and D3 to draw the lines.

Author​

Jiri Hynek

Extends​

Implements​

Constructors​

new ConnectionLayerTool()​

new ConnectionLayerTool(props?): ConnectionLayerTool

It creates a new tool with respect to the props.

Parameters​

• props?: IConnectionLayerToolProps

Returns​

ConnectionLayerTool

Overrides​

AbstractLayerTool.constructor

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:77

Properties​

animateDirectionUtil​

private animateDirectionUtil: AnimateDirectionUtil

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:68


connectionsPaths​

private connectionsPaths: Record\<string, Selection\<BaseType, any, any, any>>

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:70


mapForm​

private mapForm: IMapForm

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:64


selectionChangeAdapter​

private selectionChangeAdapter: ConnectionLayerToolSelectionChangeAdapter

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:66


themeChangeAdapter​

private themeChangeAdapter: ConnectionLayerToolThemeChangeAdapter

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:67

Methods​

bucketHashToGeoIds()​

protected bucketHashToGeoIds(bucketHash): string[]

It returns the the geo ids (from, to) used in data bucket hash.

Parameters​

• bucketHash: string

Returns​

string[]

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:224


copy()​

copy(): IConnectionLayerTool\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>, IConnectionLayerToolConfig, IMapToolInitProps\<IConnectionLayerToolConfig>>

It creates a copy of the uninitialized tool.

Returns​

IConnectionLayerTool\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>, IConnectionLayerToolConfig, IMapToolInitProps\<IConnectionLayerToolConfig>>

Implementation of​

IConnectionLayerTool.copy

Overrides​

AbstractLayerTool.copy

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:86


create()​

create(): this

It creates new layer with respect to configuration

Returns​

this

Implementation of​

IConnectionLayerTool.create

Inherited from​

AbstractLayerTool.create

Source​

model/internal/layer/AbstractLayerTool.ts:89


createDefaults()​

protected createDefaults(): IConnectionLayerToolDefaults

It creates new defaults of the tool.

Returns​

IConnectionLayerToolDefaults

Overrides​

AbstractLayerTool.createDefaults

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:107


createLayerItems()​

protected createLayerItems(): Layer[]

It creates layer items.

Returns​

Layer[]

Overrides​

AbstractLayerTool.createLayerItems

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:184


createMapForm()​

protected createMapForm(): IMapForm

It creates new tab control.

Returns​

IMapForm

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:168


createState()​

protected createState(): IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>

It returns default tool state.

Returns​

IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>

Overrides​

AbstractLayerTool.createState

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:121


deleteLayerItems()​

protected deleteLayerItems(): void

It deletes layer items.

Returns​

void

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:200


geoIdsToBucketHash()​

protected geoIdsToBucketHash(from, to): string

It returns the hash of (from, to) used in data buckets.

Parameters​

• from: string

• to: string

Returns​

string

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:215


getAPIGetter()​

getAPIGetter(): undefined | IMapToolAPIGetter

It returns the tool API

Returns​

undefined | IMapToolAPIGetter

Implementation of​

IConnectionLayerTool.getAPIGetter

Inherited from​

AbstractLayerTool.getAPIGetter

Source​

model/internal/tool/MapTool.ts:74


getAnimateDirectionUtil()​

protected getAnimateDirectionUtil(): AnimateDirectionUtil

It returns theme change adapter.

Returns​

AnimateDirectionUtil

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:148


getDefaults()​

getDefaults(): IConnectionLayerToolDefaults

It returns default values of the state properties.

Returns​

IConnectionLayerToolDefaults

Implementation of​

IConnectionLayerTool.getDefaults

Overrides​

AbstractLayerTool.getDefaults

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:100


getId()​

getId(): string

Help function which returns the id of the object.

Returns​

string

Implementation of​

IConnectionLayerTool.getId

Inherited from​

AbstractLayerTool.getId

Source​

model/internal/object/MapObject.ts:93


getLayerItems()​

getLayerItems(): Layer[]

It returns layer items which should be rendered.

Returns​

Layer[]

Implementation of​

IConnectionLayerTool.getLayerItems

Inherited from​

AbstractLayerTool.getLayerItems

Source​

model/internal/layer/AbstractLayerTool.ts:163


getMap()​

getMap(): undefined | IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Help function returns map which uses this tool.

Do not override this function. Use the state class instead.

Returns​

undefined | IMap\<IMapProps, IMapDefaults, IMapState\<IMapProps, IMapDefaults, IMapConfig>, IMapConfig, IMapInitProps\<IMapConfig>>

Implementation of​

IConnectionLayerTool.getMap

Inherited from​

AbstractLayerTool.getMap

Source​

model/internal/tool/MapTool.ts:112


getMapForm()​

getMapForm(): IMapForm

It returns a sidebar tab with respect to the configuration.

Returns​

IMapForm

Implementation of​

IMapFormControl.getMapForm

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:158


getProps()​

getProps(): IConnectionLayerToolProps

It returns the props given by the programmer.

Returns​

IConnectionLayerToolProps

Implementation of​

IConnectionLayerTool.getProps

Overrides​

AbstractLayerTool.getProps

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:93


getSelectionChangeAdapter()​

protected getSelectionChangeAdapter(): ConnectionLayerToolSelectionChangeAdapter

It returns selection change adapter.

Returns​

ConnectionLayerToolSelectionChangeAdapter

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:128


getState()​

getState(): IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>

It returns the layer tool state.

Returns​

IConnectionLayerToolState\<IConnectionLayerToolProps, IConnectionLayerToolDefaults, IConnectionLayerToolConfig, object, object>

Implementation of​

IConnectionLayerTool.getState

Overrides​

AbstractLayerTool.getState

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:114


getThemeChangeAdapter()​

protected getThemeChangeAdapter(): ConnectionLayerToolThemeChangeAdapter

It returns theme change adapter.

Returns​

ConnectionLayerToolThemeChangeAdapter

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:138


getType()​

getType(): string

Help function which returns the type of the object.

Returns​

string

Implementation of​

IConnectionLayerTool.getType

Inherited from​

AbstractLayerTool.getType

Source​

model/internal/object/MapObject.ts:86


handleEvent()​

handleEvent(event): void

This function is called when a custom event is invoked.

Parameters​

• event: IMapEvent\<IMapObject\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectState\<IMapObjectProps, IMapObjectDefaults\<IMapObjectProps, IMapObjectConfig>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>, IMapObjectConfig, IMapObjectInitProps\<IMapObjectConfig>>>

Returns​

void

Overrides​

AbstractLayerTool.handleEvent

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:632


hideLayerItems()​

protected hideLayerItems(): void

Help function which hides layer items

This function is meant to be private.

Returns​

void

Inherited from​

AbstractLayerTool.hideLayerItems

Source​

model/internal/layer/AbstractLayerTool.ts:147


initialize()​

initialize(initProps): this

Overrides the super method.

Parameters​

• initProps: IMapToolInitProps\<IConnectionLayerToolConfig>

Returns​

this

Implementation of​

IConnectionLayerTool.initialize

Overrides​

AbstractLayerTool.initialize

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:177


isEnabled()​

isEnabled(): boolean

Help getter which returns enabled property of state.

Do not override this function. Use the state class instead.

Returns​

boolean

Implementation of​

IConnectionLayerTool.isEnabled

Inherited from​

AbstractLayerTool.isEnabled

Source​

model/internal/tool/MapTool.ts:130


isSingleton()​

isSingleton(): boolean

Help getter which returns a logtical value whether the tool type is singleton.

Returns​

boolean

Implementation of​

IConnectionLayerTool.isSingleton

Inherited from​

AbstractLayerTool.isSingleton

Source​

model/internal/tool/MapTool.ts:81


render()​

render(type, animateOptions?): void

It reloads data and redraw the layer.

Parameters​

• type: number

• animateOptions?: IDataChangeAnimateOptions

Returns​

void

Implementation of​

IConnectionLayerTool.render

Overrides​

AbstractLayerTool.render

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:578


renderConnections()​

protected renderConnections(animateOptions): void

This function is called when layer items are rendered. It uses the D3 force layout simulation to arrange the connections.

Parameters​

• animateOptions: IDataChangeAnimateOptions= undefined

Returns​

void

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:392


setEnabled()​

setEnabled(enabled): void

It changes layer state to enabled/disabled.

Parameters​

• enabled: boolean

Returns​

void

Implementation of​

IConnectionLayerTool.setEnabled

Inherited from​

AbstractLayerTool.setEnabled

Source​

model/internal/layer/AbstractLayerTool.ts:102


setProps()​

protected setProps(props): void

It updates the props.

Parameters​

• props: IMapObjectProps

Returns​

void

Inherited from​

AbstractLayerTool.setProps

Source​

model/internal/object/MapObject.ts:38


showLayerItems()​

protected showLayerItems(): void

Help function which shows layer items.

This function is meant to be private.

Returns​

void

Inherited from​

AbstractLayerTool.showLayerItems

Source​

model/internal/layer/AbstractLayerTool.ts:126


switchEnabled()​

switchEnabled(): void

Help function which switches enabled state (enabled/disabled).

Do not override this function. Use setEnabled instead.

Returns​

void

Implementation of​

IConnectionLayerTool.switchEnabled

Inherited from​

AbstractLayerTool.switchEnabled

Source​

model/internal/tool/MapTool.ts:158


updateData()​

protected updateData(): object

It prepares data for connections.

Returns​

object

connections​

connections: Map\<string, IMapAggregationBucket>

nodes​

nodes: Set\<string>

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:231


updateDimension()​

updateDimension(dimension, value, renderType): void

It updates the dimension.

Parameters​

• dimension: IMapDimension\<unknown>

• value: string

• renderType: undefined | number

Returns​

void

Implementation of​

IConnectionLayerTool.updateDimension

Overrides​

AbstractLayerTool.updateDimension

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:607


updateStyle()​

protected updateStyle(): void

Help method which updates styles

Returns​

void

Source​

tools/layers/connection/model/internal/tool/ConnectionLayerTool.ts:566