anim.plane.arrow¶
- class anim.plane.arrow(points, color='grey', thickness=0.005, linestyle='-', path_color=None, head_shape='dart', head_segment=-1, head_location=1, head_color=None, string='', fontname='Helvetica', fontsize=None, text_segment=-1, text_location=0.5, text_color=None, text_style='', group=None, zvalue=0, draggable=False, clickable=False)¶
Arrow item (composite)
An arrow is defined by its:
points (the point of reference is the first point)
head
text (optional)
styling
Parameters ══════════
- name
str The arrow’s name
- head_shape
‘dart’, ‘disk’ default: ‘dart’ The arrow head shape.
- string
str, [* str(*)] default: ‘’ The arrow text’s string. HTML formatting is supported by default.
- group
anim.plane.group default: None The arrow’s group. If None, the position of the reference point is in absolute coordinates. Otherwise, the positions are relative to the group’s reference point.
─── positions ───────────────────────────────
- points
[(float, float)], [[float, float]], [complex] Positions of the arrow points.
- head_segment
int default: -1 Path segment where the arrowhead stands
- head_location
float ∈ [0,1] default: 1 Location of the arrowhead on the specified path segment
- text_segment
int default: -1 Path segment where the text stands
- text_location
float ∈ [0,1] default: 0.5 Location of the text on the specified path segment
─── transformations ─────────────────────────
- draggable
bool default: False Boolean specifying if the arrow can be dragged. If True, the dragging callback is defined in the ‘itemChange’ method of the event class, which is transfered to the canva’s ‘event’ method (recommended).
─── stack ───────────────────────────────────
- zvalue
float default: 0 Z-value (stack order) of the arrow.
─── style ───────────────────────────────────
- thickness
float default: 0.005 Arrow line thickness, in scene units. When it is equal to 0, the stroke has the minimal thickness of 1 pixel.
- linestyle
‘solid’/’-’, ‘dash’/’–’, ‘dot’/’..’/’:’, ‘dashdot’/’-.’ default: ‘-’ Line style.
- fontname
str default: ‘Helvetica’ Font name
- fontsize
float default: 0.05 Text font size, in scene units.
- style
str default: ‘’ Associated document’s css style sheet. Global styling is accessed through the html selector. Example: ‘html { background-color: yellow; }’
- color
str, QColor default: ‘grey’ Arrow color. By default all the subitems have this color.
- path_color
None, str, QColor default: color Stroke color. None stands for transparency.
- head_color
None, str, QColor default: color Arrowhead color. None stands for transparency.
- text_color
None, str, QColor default: color Text color. None stands for transparency.
- __init__(points, color='grey', thickness=0.005, linestyle='-', path_color=None, head_shape='dart', head_segment=-1, head_location=1, head_color=None, string='', fontname='Helvetica', fontsize=None, text_segment=-1, text_location=0.5, text_color=None, text_style='', group=None, zvalue=0, draggable=False, clickable=False)¶
Arrow item constructor
Methods
Lx()Ly()__init__(points[, color, thickness, ...])Arrow item constructor
initialize()Initialize the item
rotate(angle)Relative rotation
setGeometry()Arrow geometry
setHeadShape()setOrientation()Set the qitem orientation
setPosition([position])Sets the qitem's position.
translate(dx[, dy])Relative translation
Attributes
center_of_rotationclickablecolordraggablefontnamefontsizegrouphead_colorhead_locationhead_segmenthead_shapelinestyleorientationpath_colorpointspositionstringstyletext_colortext_locationtext_segmentthicknessxyzvalue