Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
Detroit v2.6.3
Light Logo Dark Logo
Detroit v2.6.3
  • Line chart
  • Area chart
  • Stack chart
  • Scatter chart
  • Bar chart
  • Histogram chart
  • Heatmap
  • Chord chart
  • Pie chart
  • Density chart
  • Geographical Map
  • Voronoi diagram
  • Tree chart
  • Treemap chart
  • Pack chart
  • Complex charts
    • Step Response of a Second Order System (Control Theory)
    • Principal Component Analysis on MNIST dataset
    • Fan Chart
    • Scatter Matrix chart
    • Kernel Speed Comparison between Numba et Cupy
    • Hertzsprung Russell Diagram
    • Gantt Chart
  • API
    • Array
    • Axis
    • Chord
      • Chords
      • Ribbons
    • Color
    • Contours
      • Contour polygons
      • Density estimation
    • Delaunay
      • Delaunay triangulations
      • Voronoi diagrams
    • Ease
    • Force
      • Force simulations
      • Center Force
      • Collide Force
      • Link Force
      • Many-body Force
      • Position Forces
    • Format
    • Geo
      • Paths
      • Projections
        • Azimuthal projections
        • Conic projections
        • Cylindrical projections
      • Streams
      • Spherical shapes
      • Spherical math
    • Hierarchy
      • Hierarchies
      • Stratify
      • Tree
      • Cluster
      • Partition
      • Pack
      • Treemap
    • Interpolate
    • Path
    • Polygon
    • Quadtree
    • Scale
      • Abstract classes
      • Continuous base classes
      • Linear scales
      • Time scales
      • Power scales
      • Log scales
      • Symlog scales
      • Ordinal scales
      • Band scales
      • Sequential scales
      • Diverging scales
      • Quantile scales
      • Quantize scales
      • Threshold scales
    • Scale Chromatic
      • Categorical schemes
      • Cyclical schemes
      • Diverging schemes
      • Sequential schemes
    • Selection
    • Shapes
      • Arcs
      • Areas
      • Curves
      • Lines
      • Links
      • Pies
      • Stacks
      • Symbols
      • Radial Areas
      • Radial Lines
    • Time
    • Time Format
    • Types
Back to top
View this page

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.

Parameters:

curve (Callable[[Selection], Curve]) – Curve factory function

Returns:

New link generator

Return type:

Link

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:

Link

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:

Link

detroit.link_radial() → Link¶

Returns a new link generator with radial tangents.

Returns:

Radial link generator

Return type:

Link

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:

Link

__call__(*args: Any) → str | None¶
Parameters:

args (Any) – Extra arguments passed through source function, target function, x function and y function.

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

Parameters:

source (Accessor[T, float]) – Source accessor function

Returns:

Itself

Return type:

Link

set_target(target: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float]) → Link¶

Sets the target function

Parameters:

target (Accessor[T, float]) – Target accessor function

Returns:

Itself

Return type:

Link

x(x: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) → Link¶

Sets x accessor function

Parameters:

x (Accessor[T, float] | Number) – x accessor function

Returns:

Itself

Return type:

Link

y(y: Callable[[T], float] | Callable[[T, int], float] | Callable[[T, int, list[Element]], float] | int | float) → Link¶

Sets y accessor function

Parameters:

y (Accessor[T, float] | Number) – y accessor function

Returns:

Itself

Return type:

Link

set_context(context: Selection | None = None) → Link¶

Sets the context.

Parameters:

context (Selection | None) – Selection

Returns:

Itself

Return type:

Link

Next
Pies
Previous
Lines
Copyright © 2024-2026, bourbonut
Made with Sphinx and @pradyunsg's Furo
On this page
  • Links
    • link()
    • link_horizontal()
    • link_vertical()
    • link_radial()
    • Link
      • Link.__call__()
      • Link.set_source()
      • Link.set_target()
      • Link.x()
      • Link.y()
      • Link.set_context()