Skip to main content

VisioConnect

VisioConnect represents a connection between two Visio Shapes. It contains metadata describing source and target including which part of the Shape is used as an anchor.

An important concept to understand is that in Visio projects, a connection between two shapes consists of two entities: Connect and a Shape, represented by VisioConnect and VisioShape within the plugin. VisioConnect contains metadata about the connection. It also points to the shape that visually represents the connection, as well as source and target shapes.

Methods​

getShape()​

visioConnect.getShape(): VisioShape;

Return a VisioShape representing the connection itself.

getSource()​

visioConnect.getSource(): VisioShape | null;

Return a VisioShape representing the connection source shape. In case there is no source shape, method will return null.

getTarget()​

visioConnect.getTarget(): VisioShape | null;

Return a VisioShape representing the connection target shape. In case there is no source shape, method will return null.

toLinkAttributes()​

visioConnect.toLinkAttributes(
sourceElement: dia.Element,
targetElement: dia.Element
): dia.Link.Attributes | null;

Return JointJS Link attributes, based on the VisioConnect properties and a provided sourceElement and targetElement.

Properties​

There are several properties that can be accessed:

fromCell​

visioConnect.fromCell: string;

String name of the VisioCell from which the connection originates.

fromPart​

visioConnect.fromPart: string;

Identifies the part of the Visio Shape from which a connection is made.

fromSheet​

visioConnect.fromSheet: string;

INT id of the source VisioShape.

toCell​

visioConnect.toCell: string;

String name of the VisioCell to which the connection is made.

toPart​

visioConnect.toPart: string;

Identifies the part of the VisioShape to which a connection is made.

toSheet​

visioConnect.toSheet: string;

INT id of the target VisioShape.