Links¶
- detroit.link(curve: Callable[[Selection], Curve])¶
The link shape generates a smooth cubic Bézier curve from a source point to a target point. The tangents of the curve at the start and end are either vertical or horizontal.
- detroit.link_horizontal() Link¶
Shorthand for link with
d3.curve_bump_x; suitable for visualizing links in a tree diagram rooted on the left edge of the display.- Returns:
Horizontal link generator
- Return type:
- detroit.link_vertical() Link¶
Shorthand for link
d3.curve_bump_y; suitable for visualizing links in a tree diagram rooted on the top edge of the display.- Returns:
Vertical link generator
- Return type:
- detroit.link_radial() Link¶
Returns a new link generator with radial tangents.
- Returns:
Radial link generator
- Return type:
- class detroit.shape.link.Link(curve: Callable[[Selection], Curve])¶
The link shape generates a smooth cubic Bézier curve from a source point to a target point. The tangents of the curve at the start and end are either vertical or horizontal.
- Parameters:
curve (Callable[[Selection], Curve]) – Curve factory function
- Returns:
New link generator
- Return type:
- __call__(*args: Any) str | None¶
- Parameters:
args (Any) – Extra arguments passed through
sourcefunction,targetfunction,xfunction andyfunction.- Returns:
Generated link if the link is not associated to a context
- Return type:
str | None
- set_source(source: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float]) Link¶
Sets the source function
- set_target(target: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float]) Link¶
Sets the target function
- x(x: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) Link¶
Sets x accessor function