New to KendoReact? Start a free 30-day trial

The visual link between two Shapes through the intermediate of Connectors.

Definition

Package:@progress/kendo-react-diagram

Properties

The adorner used for visual feedback during interactions.

The data item associated with this diagram element.

Array of path definers for intermediate points along the connection.

events

string[]

Array of event names that this observable supports.

The source endpoint of the connection (Shape, Connector, or Point).

id

string

The unique identifier of this diagram element.

isSelected

boolean

Indicates whether this element is currently selected.

Configuration options for the observable instance.

The polyline visual element that represents the connection path.

The connector at the source end of the connection.

The connector at the target end of the connection.

The target endpoint of the connection (Shape, Connector, or Point).

The visual representation (Group) of this diagram element.

Methods

Gets all the points of this connection. This is the combination of the sourcePoint, the points and the targetPoint.

Returns:

Point[]

Array of all points including source, intermediate, and target points

Binds event handlers to one or more events.

Parameters:eventEventNames | { [key: string]: Handler }

The event name(s) to bind to, or an object mapping event names to handlers

handlers?EventHandlers

The event handler(s) to bind. Can be a function or an object mapping event names to handlers

one?boolean

If true, the handler will be executed only once and then automatically unbound

Returns:

this

The Observable instance for method chaining

Gets the current bounds of the connection.

Returns:

Rect

The current connection bounds.

Sets the bounds of the connection.

Parameters:valueRect

The new connection bounds.

Returns a clone of this connection.

Returns:

Connection

A new Connection instance that is a copy of this connection

Gets the current content of the connection.

Returns:

undefined | ConnectionContent | ConnectionRichTextContent

The connection content, or undefined when no content is configured.

Sets the content of the connection.

Parameters:contentConnectionContent | ConnectionRichTextContent

The new connection content.

Returns:

ConnectionContent | ConnectionRichTextContent

The applied connection content.

Destroys the observable instance and removes all event handlers. This method should be called when the observable is no longer needed to prevent memory leaks.

Binds event handlers to be executed first (prepends to the handlers list). These handlers will be called before any previously bound handlers for the same event.

Parameters:eventNameEventNames

The event name(s) to bind to

handlersEventHandlers

The event handler(s) to bind

Returns:

this

The Observable instance for method chaining

Binds event handlers that will be executed only once. After execution, the handlers are automatically unbound.

Parameters:eventNamesEventNames

The event name(s) to bind to

handlersEventHandlers

The event handler(s) to bind

Returns:

this

The Observable instance for method chaining

Gets the intermediate points of the connection.

Returns:

Point[]

The current intermediate points.

Sets the intermediate points of the connection.

Parameters:valuePointLike[]

The points or point-like objects to use as intermediate points.

Sets the position of the diagram element.

Parameters:pointPoint

The new element position.

Redraws the connection with new options.

Parameters:options?ConnectionOptionsBase

The options to apply when redrawing the connection

Refreshes the connection's visual representation. Resolves connectors, refreshes the path, aligns content, and updates adorners.

Selects or deselects this connection.

Parameters:valueboolean

True to select, false to deselect the connection

Returns:

undefined | boolean

True if the selection state changed; otherwise undefined.

Returns a serialized connection in JSON format. Consists of the options and the dataItem.

Returns:

{ options: ConnectionOptionsBase; from?: string | ConnectionEndpointJson; to?: string | ConnectionEndpointJson; dataItem?: string }

Serialized connection object containing options, endpoints, and data

Gets the resolved source endpoint of the connection.

Returns:

ConnectionResolvedEndpoint

The resolved source endpoint.

Sets the source endpoint of the connection.

Parameters:sourcenull | ConnectionEndpoint

The source shape, connector, point, or null to detach the endpoint.

undoable?boolean

Whether the operation can be undone.

Returns:

ConnectionResolvedEndpoint

The resolved source endpoint.

Gets the path definer for the source point.

Returns:

PathDefiner

The source point path definer.

Sets the path definer for the source point. The left part is cleared because it defines the source tangent.

Parameters:valuePathDefiner

The source path definer.

Gets the Point where the source of the connection resides. If the endpoint is Auto-connector the location of the resolved connector will be returned. If the endpoint is floating the location of the endpoint is returned.

Returns:

Point

The source point of the connection

Gets the resolved target endpoint of the connection.

Returns:

ConnectionResolvedEndpoint

The resolved target endpoint.

Sets the target endpoint of the connection.

Parameters:targetnull | ConnectionEndpoint

The target shape, connector, point, or null to detach the endpoint.

undoable?boolean

Whether the operation can be undone.

Returns:

ConnectionResolvedEndpoint

The resolved target endpoint.

Gets the path definer for the target point.

Returns:

PathDefiner

The target point path definer.

Sets the path definer for the target point. The right part is cleared because it defines the target tangent.

Parameters:valuePathDefiner

The target path definer.

Gets the Point where the target of the connection resides.

Returns:

Point

The target point of the connection

Converts the connection to a JSON representation for serialization.

Returns:

{ from: ConnectionEndpointJson; to: ConnectionEndpointJson }

Object containing the connection's endpoints information

Returns a string representation of the diagram element.

Returns:

string

The element ID.

Triggers an event, calling all bound handlers for that event.

Parameters:eventNamestring

The name of the event to trigger

eventArgs?any

Optional event arguments to pass to the handlers

Returns:

boolean

True if any handler called preventDefault(), false otherwise

Gets the current connection type.

Returns:

ConnectionType

The current connection type.

Sets the connection type.

Parameters:valueConnectionType

The new connection type.

Removes event handlers from events.

Parameters:eventName?string

The event name to unbind from. If undefined, all events are unbound

handler?EventHandlers

The specific handler to remove. If undefined, all handlers for the event are removed

Returns:

this

The Observable instance for method chaining

Updates the connection options from the model data.

Parameters:model?any

The model data to extract options from

Gets the visibility of the diagram element.

Returns:

boolean

true when the element is visible; otherwise, false.

Sets the visibility of the diagram element.

Parameters:valueboolean

Whether the element should be visible.