On this page
Pipeline executor for predraw scenes.
#predraw.pipeline
#predraw.pipeline
Pipeline executor for predraw scenes.
Executes ordered postprocessing steps that modify the element tree in place.
#execute_pipeline
def execute_pipeline(scene: Scene) -> NoneExecute all pipeline steps on the scene, modifying it in place.
#_execute_step
def _execute_step(scene: Scene, step: dict) -> NoneExecute a single pipeline step.
#_find_element
def _find_element(elements: list[Element], element_id: str) -> Element | NoneFind an element by ID, searching recursively through groups.
#_find_and_remove
def _find_and_remove(elements: list[Element], element_id: str) -> Element | NoneFind and remove an element by ID from the list (top-level only).
#_center
def _center(scene: Scene, target_id: str, axis: str) -> NoneCenter an element within the scene canvas.
#_center_text
def _center_text(scene: Scene, element: Element, axis: str) -> NoneCenter a text element. Uses anchor=middle for x, baseline offset for y.
#_center_rect
def _center_rect(scene: Scene, element: Element, axis: str) -> NoneCenter a rect element by adjusting x/y.
#_center_group
def _center_group(scene: Scene, element: Element, axis: str) -> NoneCenter a group by wrapping in a translate transform.
#_center_with_transform
def _center_with_transform(scene: Scene, element: Element, axis: str) -> NoneCenter an element using a translate transform (fallback for unknown geometry).
#_place
def _place(scene: Scene, step: dict) -> NonePosition an element relative to another in a given direction.
Supports directions: below, above, right, left.
#_group
def _group(scene: Scene, target_ids: list[str], group_id: str) -> NoneWrap multiple elements into a new group.
#_replace_element
def _replace_element(elements: list[Element], element_id: str, replacement: Element) -> boolReplace an element by ID in the list, searching recursively into groups.
#_text_to_paths
def _text_to_paths(scene: Scene, target_id: str) -> NoneConvert a text element to a group of path elements using font outlines.