ArrowLineSegment

class indicatortools.ArrowLineSegment(arrow_width=0.25, dash_fraction=1, dash_period=None, left_broken_padding=None, left_broken_text=False, left_hspace=0.25, left_padding=None, left_stencil_align_direction_y=Center, right_arrow=True, right_broken_arrow=None, right_broken_padding=0, right_padding=1.5, right_stencil_align_direction_y=Center, style=None)

Arrow line segment.

>>> import abjad

String contact position spanner:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> f(abjad.ArrowLineSegment())
abjad.ArrowLineSegment(
    arrow_width=0.25,
    dash_fraction=1,
    left_broken_text=False,
    left_hspace=0.25,
    left_stencil_align_direction_y=Center,
    right_arrow=True,
    right_broken_padding=0,
    right_padding=1.5,
    right_stencil_align_direction_y=Center,
    )
>>> spanner.attach(abjad.Markup('pont.'), staff[0])
>>> spanner.attach(abjad.Markup('ord.'), staff[-1])
>>> spanner.attach(abjad.ArrowLineSegment(), staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Arrow line segment is a preconfigured line segment.

Follow the piecewise definition protocol shown here.

Lineage

digraph InheritanceGraph { graph [background=transparent, bgcolor=transparent, color=lightslategrey, fontname=Arial, outputorder=edgesfirst, overlap=prism, penwidth=2, rankdir=LR, root="__builtin__.object", splines=spline, style="dotted, rounded", truecolor=true]; node [colorscheme=pastel19, fontname=Arial, fontsize=12, penwidth=2, style="filled, rounded"]; edge [color=lightsteelblue2, penwidth=2]; subgraph cluster_abctools { graph [label=abctools]; "abjad.tools.abctools.AbjadObject.AbjadObject" [color=1, group=0, label=AbjadObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbstractBase" [color=1, group=0, label=AbstractBase, shape=box]; "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" [color=1, group=0, label=AbjadValueObject, shape=box]; "abjad.tools.abctools.AbjadObject.AbjadObject" -> "abjad.tools.abctools.AbjadValueObject.AbjadValueObject"; "abjad.tools.abctools.AbjadObject.AbstractBase" -> "abjad.tools.abctools.AbjadObject.AbjadObject"; } subgraph cluster_indicatortools { graph [label=indicatortools]; "abjad.tools.indicatortools.ArrowLineSegment.ArrowLineSegment" [color=black, fontcolor=white, group=2, label=<<B>ArrowLineSegment</B>>, shape=box, style="filled, rounded"]; "abjad.tools.indicatortools.LineSegment.LineSegment" [color=3, group=2, label=LineSegment, shape=box]; "abjad.tools.indicatortools.LineSegment.LineSegment" -> "abjad.tools.indicatortools.ArrowLineSegment.ArrowLineSegment"; } subgraph cluster_builtins { graph [label=builtins]; "builtins.object" [color=2, group=1, label=object, shape=box]; } "abjad.tools.abctools.AbjadValueObject.AbjadValueObject" -> "abjad.tools.indicatortools.LineSegment.LineSegment"; "builtins.object" -> "abjad.tools.abctools.AbjadObject.AbstractBase"; }

Attribute summary

arrow_width Gets arrow width of arrow.
dash_fraction Gets dash fraction of arrow.
dash_period Gets dash period of arrow.
left_broken_padding Gets left broken padding of line segment.
left_broken_text Gets left broken text of arrow.
left_hspace Gets left hspace of line segment.
left_padding Gets left padding of line segment.
left_stencil_align_direction_y Gets left stencil align direction Y of line segment.
right_arrow Is true when right end of line segment carries an arrow.
right_broken_arrow Is true when arrow should appear immediately before line break.
right_broken_padding Gets right broken padding of line segment.
right_padding Gets right padding of line segment.
right_stencil_align_direction_y Gets right stencil align direction Y of line segment.
style Gets style of arrow.
__copy__(*arguments) Copies Abjad value object.
__eq__(argument) Is true when all initialization values of Abjad value object equal the initialization values of argument.
__format__([format_specification]) Formats Abjad object.
__hash__() Hashes Abjad value object.
__ne__(argument) Is true when Abjad object does not equal argument.
__repr__() Gets interpreter representation of Abjad object.

Read-only properties

ArrowLineSegment.arrow_width

Gets arrow width of arrow.

Arrow line segment width equals 0.25:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(arrow_width=0.25)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in thin arrow head.

This is default behavior.

Arrow line segment width equals 0.5:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(arrow_width=0.5)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in wide arrow head.

Arrow line segment width equals 1:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(arrow_width=1)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in very wide arrow head.

Defaults to 0.25.

Returns integer or float.

ArrowLineSegment.dash_fraction

Gets dash fraction of arrow.

Dash fraction equals 100% of dash period:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(dash_fraction=1)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

This is default behavior.

Dash fraction equals 50% of dash period:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(dash_fraction=0.5)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Dash fraction equals 10% of dash period:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(dash_fraction=0.1)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Defaults to 1.

Returns integer or float.

ArrowLineSegment.dash_period

Gets dash period of arrow.

Dash period equals none:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(
...     dash_period=None,
...     )
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in a solid line.

This is default behavior.

Dash period equals 1 (with dash fraction equal to 25%):

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(
...     dash_fraction=0.25,
...     dash_period=1,
...     )
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in fine dashes.

Dash period equals 4 (with dash fraction equal to 25%):

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(
...     dash_fraction=0.25,
...     dash_period=4,
...     )
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in coarse dashes.

Defaults to none.

Returns integer or float.

(LineSegment).left_broken_padding

Gets left broken padding of line segment.

Returns float or none.

ArrowLineSegment.left_broken_text

Gets left broken text of arrow.

Left broken text set to false:

>>> staff = abjad.Staff("c'4. d' e' f' g' a' b' c''")
>>> abjad.attach(abjad.TimeSignature((3, 8)), staff[0])
>>> score = abjad.Score([staff])
>>> command = abjad.LilyPondCommand('break', 'after')
>>> abjad.attach(command, staff[3])
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[2:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment()
>>> f(arrow)
abjad.ArrowLineSegment(
    arrow_width=0.25,
    dash_fraction=1,
    left_broken_text=False,
    left_hspace=0.25,
    left_stencil_align_direction_y=Center,
    right_arrow=True,
    right_broken_padding=0,
    right_padding=1.5,
    right_stencil_align_direction_y=Center,
    )
>>> spanner.attach(start_markup, staff[2])
>>> spanner.attach(stop_markup, staff[6])
>>> spanner.attach(arrow, staff[2])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in no text immediately after line break. (This is default behavior.)

Left broken text set explicitly:

>>> staff = abjad.Staff("c'4. d' e' f' g' a' b' c''")
>>> abjad.attach(abjad.TimeSignature((3, 8)), staff[0])
>>> score = abjad.Score([staff])
>>> command = abjad.LilyPondCommand('break', 'after')
>>> abjad.attach(command, staff[3])
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[2:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> left_broken_markup = abjad.Markup('(pont./ord.)').upright()
>>> arrow = abjad.ArrowLineSegment(
...     left_broken_text=left_broken_markup,
... )
>>> f(arrow)
abjad.ArrowLineSegment(
    arrow_width=0.25,
    dash_fraction=1,
    left_broken_text=abjad.Markup(
        contents=[
            abjad.MarkupCommand(
                'upright',
                '(pont./ord.)'
                ),
            ],
        ),
    left_hspace=0.25,
    left_stencil_align_direction_y=Center,
    right_arrow=True,
    right_broken_padding=0,
    right_padding=1.5,
    right_stencil_align_direction_y=Center,
    )
>>> spanner.attach(start_markup, staff[2])
>>> spanner.attach(stop_markup, staff[6])
>>> spanner.attach(arrow, staff[2])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Set to markup, boolean or none.

(LineSegment).left_hspace

Gets left hspace of line segment.

Returns float or none.

(LineSegment).left_padding

Gets left padding of line segment.

Returns float or none.

(LineSegment).left_stencil_align_direction_y

Gets left stencil align direction Y of line segment.

Returns float or none.

(LineSegment).right_arrow

Is true when right end of line segment carries an arrow. Otherwise false.

Returns true, false or none.

ArrowLineSegment.right_broken_arrow

Is true when arrow should appear immediately before line break. Otherwise false.

Right broken arrow set to none:

>>> staff = abjad.Staff("c'4. d' e' f' g' a' b' c''")
>>> abjad.attach(abjad.TimeSignature((3, 8)), staff[0])
>>> score = abjad.Score([staff])
>>> command = abjad.LilyPondCommand('break', 'after')
>>> abjad.attach(command, staff[3])
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[2:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment()
>>> f(arrow)
abjad.ArrowLineSegment(
    arrow_width=0.25,
    dash_fraction=1,
    left_broken_text=False,
    left_hspace=0.25,
    left_stencil_align_direction_y=Center,
    right_arrow=True,
    right_broken_padding=0,
    right_padding=1.5,
    right_stencil_align_direction_y=Center,
    )
>>> spanner.attach(start_markup, staff[2])
>>> spanner.attach(stop_markup, staff[6])
>>> spanner.attach(arrow, staff[2])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Results in arrow immediately before line break. (This is default behavior.)

Right broken arrow set to false:

>>> staff = abjad.Staff("c'4. d' e' f' g' a' b' c''")
>>> abjad.attach(abjad.TimeSignature((3, 8)), staff[0])
>>> score = abjad.Score([staff])
>>> command = abjad.LilyPondCommand('break', 'after')
>>> abjad.attach(command, staff[3])
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[2:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(
...     right_broken_arrow=False,
... )
>>> f(arrow)
abjad.ArrowLineSegment(
    arrow_width=0.25,
    dash_fraction=1,
    left_broken_text=False,
    left_hspace=0.25,
    left_stencil_align_direction_y=Center,
    right_arrow=True,
    right_broken_arrow=False,
    right_broken_padding=0,
    right_padding=1.5,
    right_stencil_align_direction_y=Center,
    )
>>> spanner.attach(start_markup, staff[2])
>>> spanner.attach(stop_markup, staff[6])
>>> spanner.attach(arrow, staff[2])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Set to true, false or none.

(LineSegment).right_broken_padding

Gets right broken padding of line segment.

Returns float or none.

(LineSegment).right_padding

Gets right padding of line segment.

Returns float or none.

(LineSegment).right_stencil_align_direction_y

Gets right stencil align direction Y of line segment.

Returns float or none.

ArrowLineSegment.style

Gets style of arrow.

Style equals none:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(style=None)
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

LilyPond defaults to solid line.

This is default behavior.

Style equals zig-zag:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(style='zigzag')
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Style equals trill:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(style='trill')
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Style equals dotted line:

>>> staff = abjad.Staff("c'4 d'4 e'4 f'4")
>>> spanner = abjad.TextSpanner()
>>> abjad.attach(spanner, staff[:])
>>> start_markup = abjad.Markup('pont.').upright()
>>> stop_markup = abjad.Markup('ord.').upright()
>>> arrow = abjad.ArrowLineSegment(style='dotted-line')
>>> spanner.attach(start_markup, staff[0])
>>> spanner.attach(stop_markup, staff[-1])
>>> spanner.attach(arrow, staff[0])
>>> abjad.override(staff).text_script.staff_padding = 1.25
>>> abjad.override(staff).text_spanner.staff_padding = 2
>>> show(staff) 

Defaults to none.

Returns string or none.

Special methods

(AbjadValueObject).__copy__(*arguments)

Copies Abjad value object.

Returns new Abjad value object.

(AbjadValueObject).__eq__(argument)

Is true when all initialization values of Abjad value object equal the initialization values of argument.

Returns true or false.

(AbjadObject).__format__(format_specification='')

Formats Abjad object.

Set format_specification to ‘’ or ‘storage’. Interprets ‘’ equal to ‘storage’.

Returns string.

(AbjadValueObject).__hash__()

Hashes Abjad value object.

Returns integer.

(AbjadObject).__ne__(argument)

Is true when Abjad object does not equal argument. Otherwise false.

Returns true or false.

(AbjadObject).__repr__()

Gets interpreter representation of Abjad object.

Returns string.