VElementGroup
VElementGroup
Element transform group with complete SVG transform capabilities
Supports advanced transforms including custom transform origins, non-uniform scaling, skew transforms, and direct matrix transforms. Can hold and animate other elements with full transform control.
Constructor
VElementGroup(self, *, elements: 'List[VElement]' = None, state: 'Optional[VElementGroupState]' = None, states: 'Optional[List[VElementGroupState]]' = None, keyframes: 'Optional[List[Tuple[float, VElementGroupState]]]' = None, easing: 'Optional[Dict[str, Callable[[float], float]]]' = None) -> 'None'
Initialize an element group, which handles * positioning * scaling * rotation * opacity of the grouped child elements.
Args: elements: List of child elements to group state: Single state for static group states: List of states for evenly-timed animation keyframes: List of (frame_time, state) tuples for precise timing easing: Optional dict to override default easing functions
Methods
add_element(self, child: 'VElement') -> 'None'
Add a child element to the container
Args: child: Element to add
add_elements(self, elements: 'List[VElement]') -> 'None'
Add multiple child elements to the container
Args: elements: List of elements to add
get_elements(self) -> 'List[VElement]'
Get the list of child elements
Returns: List of child elements
is_animatable(self) -> 'bool'
Check if this element can be animated
Returns: True if element has multiple keyframes
remove_element(self, child: 'VElement') -> 'None'
Remove a child element from the container
Args: child: Element to remove
render(self) -> 'dw.Group'
Render the element group in its initial state (static rendering)
Returns: drawsvg Group element representing the group and its elements
render_at_frame_time(self, t: 'float') -> 'dw.Group'
Render the element transform group at a specific animation time
Args: t: Time factor from 0.0 to 1.0
Returns: drawsvg Group element representing the group at time t
set_keyframes(self, keyframes: 'List[Tuple[float, State]]') -> 'None'
Set explicit keyframes
set_state(self, state: 'State') -> 'None'
Set a single static state
set_states(self, states: 'List[State]') -> 'None'
Set evenly-timed states