Link Class¶
- class Link¶
Represents a Link between two node(s) and/or sub-graph(s)
- __construct(LinkableInterface $from, LinkableInterface $to, LinkStyle $style = LinkStyle::solid, int $minLength = 1, ArrowHead $arrowHead = ArrowHead::arrow)¶
Creates a Link between two node(s) and/or sub-graph(s)
- Parameters:
$from (
LinkableInterface) – The object the link is from$to (
LinkableInterface) – The object the link is to$style (
LinkStyle) – The link style (default:LinkStyle::solid)
Note
The remaining parameters are ignored if $style ===
LinkStyle::invisible- Parameters:
$minLength (
int) – The minimum link length (default: 1)$arrowHead (
ArrowHead) – The link’s arrowhead (default: ArrowHead::arrow)$biDirection (
bool) – Whether the link is bidirectional (default: unidirectional)
- Returns:
A new instance of
Link- Return type:
- bidirectional()¶
Make the link bidirectional
- Returns:
A new instance of
Linkthat is bidirectional- Return type:
- Throws:
RuntimeException on render if $style ===
LinkStyle::invisible
- withEdgeId(EdgeId $edgeId)¶
Sets an edge id
- Parameters:
$edgeId (
EdgeId) – The edge id
- Returns:
A new instance of
Linkthat has an edge id- Return type:
- Throws:
RuntimeException on render if $style ===
LinkStyle::invisible
- withText(string $text)¶
Add text to the link
- Parameters:
$text (
string) – The text
- Returns:
A new instance of
Linkwith the text- Return type:
- Throws:
RuntimeException on render if $style ===
LinkStyle::invisible