Connector
paper-pptx 0.2.0 API reference
Connector (line) shape.
A connector is a linear shape having end-points that can be connected to other objects (but not to other connectors). A connector can be straight, have elbows, or can be curved.
Attributes
begin_x
attributebegin_xReturn the X-position of the begin point of this connector, in
English Metric Units (as a Length object).
begin_y
attributebegin_yReturn the Y-position of the begin point of this connector, in
English Metric Units (as a Length object).
click_action
attributeclick_actionActionSettingActionSetting instance providing access to click behaviors.
Click behaviors are hyperlink-like behaviors including jumping to a hyperlink (web page)
or to another slide in the presentation. The click action is that defined on the overall
shape, not a run of text within the shape. An ActionSetting object is always returned,
even when no click behavior is defined on the shape.
element
attributeelementShapeElementlxml element for this shape, e.g. a CT_Shape instance.
Note that manipulating this element improperly can produce an invalid presentation file. Make sure you know what you're doing if you use this to change the underlying XML.
end_x
attributeend_xReturn the X-position of the end point of this connector, in English
Metric Units (as a Length object).
end_y
attributeend_yReturn the Y-position of the end point of this connector, in English
Metric Units (as a Length object).
has_chart
attributehas_chartboolTrue if this shape is a graphic frame containing a chart object.
False otherwise. When True, the chart object can be accessed using the .chart
property.
has_table
attributehas_tableboolTrue if this shape is a graphic frame containing a table object.
False otherwise. When True, the table object can be accessed using the .table
property.
has_text_frame
attributehas_text_frameboolTrue if this shape can contain text.
height
attributeheightLengthRead/write. Integer distance between top and bottom extents of shape in EMUs.
is_placeholder
attributeis_placeholderboolTrue if this shape is a placeholder.
A shape is a placeholder if it has a <p:ph> element.
left
attributeleftLengthInteger distance of the left edge of this shape from the left edge of the slide.
Read/write. Expressed in English Metric Units (EMU)
line
attributelineLineFormat instance for this connector.
Provides access to line properties such as line color, width, and line style.
ln
attributelnHelper method required by LineFormat.
The <a:ln> element containing the line format properties such as
line color and width. None if no <a:ln> element is present.
name
attributenamestrName of this shape, e.g. 'Picture 7'.
part
attributepartBaseSlidePartThe package part containing this shape.
A BaseSlidePart subclass in this case. Access to a slide part should only be required if
you are extending the behavior of pp API objects.
placeholder_format
attributeplaceholder_format_PlaceholderFormatProvides access to placeholder-specific properties such as placeholder type.
Raises ValueError on access if the shape is not a placeholder.
rotation
attributerotationfloatDegrees of clockwise rotation.
Read/write float. Negative values can be assigned to indicate counter-clockwise rotation, e.g. assigning -45.0 will change setting to 315.0.
shadow
attributeshadowShadowFormatShadowFormat object providing access to shadow for this shape.
A ShadowFormat object is always returned, even when no shadow is
explicitly defined on this shape (i.e. it inherits its shadow
behavior).
shape_id
attributeshape_idintRead-only positive integer identifying this shape.
The id of a shape is unique among all shapes on a slide.
shape_type
attributeshape_typeMember of MSO_SHAPE_TYPE identifying the type of this shape.
Unconditionally MSO_SHAPE_TYPE.LINE for a Connector object.
top
attributetopLengthDistance from the top edge of the slide to the top edge of this shape.
Read/write. Expressed in English Metric Units (EMU)
width
attributewidthLengthDistance between left and right extents of this shape.
Read/write. Expressed in English Metric Units (EMU).
Functions
begin_connect
funcbegin_connect(shape, cxn_pt_idx)EXPERIMENTAL - The current implementation only works properly with rectangular shapes, such as pictures and rectangles. Use with other shape types may cause unexpected visual alignment of the connected end-point and could lead to a load error if cxn_pt_idx exceeds the connection point count available on the connected shape. That said, a quick test should reveal what to expect when using this method with other shape types.
Connect the beginning of this connector to shape at the connection point specified by cxn_pt_idx. Each shape has zero or more connection points and they are identified by index, starting with 0. Generally, the first connection point of a shape is at the top center of its bounding box and numbering proceeds counter-clockwise from there. However this is only a convention and may vary, especially with non built-in shapes.
paramshapeparamcxn_pt_idxend_connect
funcend_connect(shape, cxn_pt_idx)EXPERIMENTAL - The current implementation only works properly with rectangular shapes, such as pictures and rectangles. Use with other shape types may cause unexpected visual alignment of the connected end-point and could lead to a load error if cxn_pt_idx exceeds the connection point count available on the connected shape. That said, a quick test should reveal what to expect when using this method with other shape types.
Connect the ending of this connector to shape at the connection point specified by cxn_pt_idx.
paramshapeparamcxn_pt_idxget_or_add_ln
funcget_or_add_ln()Helper method required by LineFormat.