trnsystor.linkstyle.LinkStyle

class trnsystor.linkstyle.LinkStyle(u, v, loc, color='black', linestyle='-', linewidth=None, path=None, autopath=True)[source]

LinkStyle class.

Initialize class.

Parameters
  • u (Component) – from Model.

  • v (Component) – to Model.

  • loc (str or tuple) – loc (str): The location of the anchor. The strings ‘top-left’, ‘top-right’, ‘bottom-left’, ‘bottom-right’ place the anchor point at the corresponding corner of the TrnsysModel. The strings ‘top-center’, ‘center-right’, ‘bottom-center’, ‘center-left’ place the anchor point at the edge of the corresponding TrnsysModel. The string ‘best’ places the anchor point at the location, among the eight locations defined so far, with the shortest distance with the destination TrnsysModel (other). The location can also be a 2-tuple giving the coordinates of the origin TrnsysModel and the destination TrnsysModel.

  • color (str or tuple) – The color of the line. Accepts any matplotlib color. You can specify colors in many ways, including full names (‘green’), hex strings (‘#008000’), RGB or RGBA tuples ((0,1,0,1)) or grayscale intensities as a string (‘0.8’).

  • linestyle (str) – Possible values: ‘-‘ or ‘solid’, ‘–’ or ‘dashed’, ‘-.’ or ‘dashdot’, ‘:’ or ‘dotted’, ‘-.’ or ‘dashdotdot’.

  • linewidth (float) – The link line width in points.

  • path (LineString or MultiLineString) – The path the link should follow.

  • autopath (bool) – If True, find best path.

property path

Return the path of self.

property anchor_ids

Return studio anchor ids.

set_color(color)[source]

Set the color of the line.

get_color()[source]

Return the line color.

set_linestyle(ls)[source]

Set the linestyle of the line.

Parameters

ls (str) – Possible values: ‘-‘ or ‘solid’, ‘–’ or ‘dashed’, ‘-.’ or ‘dashdot’, ‘:’ or ‘dotted’, ‘-.’ or ‘dashdotdot’.

get_linestyle()[source]

Return the linestyle.

See also set_linestyle().

set_linewidth(lw)[source]

Set the line width in points.

Parameters

lw (float) – The line width in points.

get_linewidth()[source]

Return the linewidth.

See also set_linewidth().