utils.EventPosition

utils.EventPosition()

Pydantic model for a single event position.

This model defines the position and label of an event within a visual layout. Coordinates represent one corner of a queue or resource - the bottom-right by default, or the bottom-left when direction="right" - and an optional label, resource, or build direction can be associated with the event.

Attributes

Name Type Description
event str The name of the event. Must match the event names as they appear in your event log. For the two mandatory arrival/departure events, ArrivalPosition and ExitPosition set this for you.
x int The x-coordinate for the event. With the default direction="left" this is the bottom-right corner of the queue or resource (the front of the queue); with direction="right" it is the bottom-left corner instead.
y int The y-coordinate for the event. Represents the lowest row of the queue or the central point of the resources.
label str The display label for the event. Used if display_stage_labels=True. Allows for a more user-friendly version of the event name (e.g., ‘Queuing for Till’).
resource Optional[str] The optional resource associated with the event. Must match a resource name provided in your scenario object or dict.
direction Optional[str] Which way this queue builds out from its anchor: "left" (entities stack up to the left of x; the anchor is the bottom-right corner) or "right" (entities extend to the right; the anchor is the bottom-left corner - useful when entity emojis face right). None (the default) inherits the animation-wide queue_direction passed to animate_activity_log / generate_animation.
flip_icons Optional[bool] Whether entity icons (and a custom_resource_icon) at this event are mirrored horizontally - useful when an emoji faces the wrong way for this stage’s layout. None (the default) inherits the animation-wide flip_entity_icons passed to animate_activity_log / generate_animation. Requires the CSS from vidigi.utils.inject_icon_flip_css / entity_icon_flip_css to reach the page - see their docstrings.
resource_icon Optional[str] Overrides custom_resource_icon for this event’s resources. A URL, a local file path, or a data: URI (judged by an image file extension or URL scheme - anything else is treated as a text glyph, exactly like custom_resource_icon) is drawn as a static image instead of text. Unlike the entity icon flip, an image resource icon cannot be mirrored by flip_entity_icons - supply it pre-mirrored if needed.
Back to top