rete-connection-reroute-plugin
packageSignal types produced by the plugin
type RerouteProduces =
| { data: Object; type: "pintranslated" }
| { data: Object; type: "pinselected" }
| { data: Object; type: "pinunselected" };
Reroute plugin
class ReroutePlugin<Schemes extends BaseSchemes>
Parameter | Extends | Description |
---|---|---|
Schemes | BaseSchemes |
Extends Scope<RerouteProduces, Requires
Emits pintranslated
pinselected
pinunselected
Listens rendered
unmount
reordered
connectionpath
pointerdown
Add a new pin to the connection
add(connectionId: string, position: Position, index: number): void
Parameter | Type | Description |
---|---|---|
connectionId | string | Connection id |
position | Position | Pin position |
index | number | Pin index, if not specified, the pin will be added to the end |
Returns void
Remove pin
remove(pinId: string): Promise<void>
Parameter | Type | Description |
---|---|---|
pinId | string | Pin id |
Returns Promise<void>
Select pin
select(pinId: string): Promise<void>
Parameter | Type | Description |
---|---|---|
pinId | string | Pin id |
Returns Promise<void>
Translate pin
translate(pinId: string, dx: number, dy: number): Promise<void>
Parameter | Type | Description |
---|---|---|
pinId | string | Pin id |
dx | number | Delta x |
dy | number | Delta y |
Returns Promise<void>
Unselect pin
unselect(pinId: string): Promise<void>
Parameter | Type | Description |
---|---|---|
pinId | string | Pin id |
Returns Promise<void>
Update connection for the pin
update(pin: string | PinStorageRecord): void
Parameter | Type | Description |
---|---|---|
pin | `string | PinStorageRecord` |
Returns void
Extensions for the connection reroute plugin
Enables synchronization between pins and the selector
selectablePins(reroutePlugin: ReroutePlugin<S>, selector: Selector<SelectorEntity>, accumulating: { active: unknown }): void
Listens pinselected
pinunselected
pintranslated
Parameter | Type | Description |
---|---|---|
reroutePlugin | ReroutePlugin<S> | Reroute plugin instance |
selector | Selector<SelectorEntity> | Selector instance |
accumulating | { active: unknown } | Accumulating state |
Returns void
Signal types consumed by the plugin
type RerouteExtra =
| RenderSignal<"reroute-pins", { data: PinData }>
| { data: Object; type: "unmount" };