Vuer

vuer.events

Event

python
class Event

Source

An event is a message sent from the server to the client.

python
ts: float

ClientEvent

python
class ClientEvent(Event)

Source

ClientEvent.init

python
def __init__(self, etype=None, ts=None, **kwargs)

Source

Inherited members

python
value = None

InitEvent

python
class InitEvent(ClientEvent)

Source

InitEvent.init

python
def __init__(self, **kwargs)

Source

Inherited members

NullEvent

python
class NullEvent(ClientEvent)

Source

NullEvent.init

python
def __init__(self, **kwargs)

Source

Inherited members

ServerEvent

python
class ServerEvent(Event)

Source

ServerEvent.init

python
def __init__(self, data, etype=None, ts: Union[Datetime, Timedelta]=None, **kwargs)

Source

ServerEvent.serialize

python
def serialize(self)

Source

Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.

Inherited members

Noop

python
class Noop(ServerEvent)

Source

Noop.init

python
def __init__(self, **kwargs)

Source

Inherited members

python
etype = 'NOOP'

Set

python
class Set(ServerEvent)

Source

Set Operation (Server Event).

SET Operator is used exclusively to set the root Scene node. Throws an error (on the client side) if the data is not a Scene object.

Set.init

python
def __init__(self, data: Scene)

Source

:param data: The data to set.

Inherited members

python
etype = 'SET'

Update

python
class Update(ServerEvent)

Source

UPDATE Operator is used to update a specific node in the scene graph.

Use "$delete" value for elements you want to remove. Or "$strict" mode to copy the element verbatim.

Example: app.update @ { "key": "my_key", "value": "$delete" }

app.update({ "key": "my_key", "value": "$delete" }, strict=True)

app.update @ [ { "key": "my_key", "value": "$delete" }, ... ]

app.update({ "key": "my_key", "value": "$delete" }, ..., strict=True)

Update.init

python
def __init__(self, *elements: Element, strict=False)

Source

Update.serialize

python
def serialize(self)

Source

Inherited members

python
etype = 'UPDATE'

Add

python
class Add(ServerEvent)

Source

ADD Operator is used to insert new nodes to the scene graph. By default it inserts into the root node, but you can specify a parent node to insert into via the to argument.

Note: only supports a single parent key right timestamp.

Example: app.add @ Element(...)

app.add @ [ Element(...), Element(...), ... ]

app.add(Element, to="my_parent_key")

app.add([Element, ...], to="my_parent_key")

Add.init

python
def __init__(self, *elements: List[Element], to: str=None)

Source

Add.serialize

python
def serialize(self)

Source

Inherited members

python
etype = 'ADD'

Upsert

python
class Upsert(ServerEvent)

Source

UPSERT Operator is used to update nodes to new values, when then they do not exist, insert new ones to the scene graph.

Note: only supports a single parent key right timestamp.

Example: app.upsert @ Element(...)

app.upsert @ [ Element(...), Element(...), ... ]

app.upsert(Element, to="my_parent_key")

app.upsert([Element, ...], to="my_parent_key")

Upsert.init

python
def __init__(self, *elements: List[Element], to: str=None, strict=False)

Source

Upsert.serialize

python
def serialize(self)

Source

Inherited members

python
etype = 'UPSERT'

Remove

python
class Remove(ServerEvent)

Source

An Update ServerEvent is sent to the client when the server wants to update the client's state. It appends the data sent in the Update ServerEvent to the client's current state.

Remove.init

python
def __init__(self, *keys: List[str], **kwargs)

Source

Inherited members

python
etype = 'REMOVE'

Frame

python
class Frame(ServerEvent)

Source

A higher-level ServerEvent that wraps other ServerEvents

python
ServerEvent: ServerEvent

Frame.init

python
def __init__(self, data: ServerEvent, frame_rate=60.0, **kwargs)

Source

Frame object returns a NOOP client event, to keep the on_socket generator running at a constant rate.

:param data: :param frame_rate: default to 60, set this for wait time between frames :param kwargs:

Inherited members

python
etype = 'FRAME'

End

python
class End(ServerEvent)

Source

A higher-level ServerEvent that wraps other ServerEvents

End.init

python
def __init__(self, **kwargs)

Source

Inherited members

python
etype = 'TERMINATE'

ServerRPC

python
class ServerRPC(ServerEvent)

Source

python
uuid: str

ServerRPC.init

python
def __init__(self, data, uuid=None, **kwargs)

Source

Inherited members

python
etype = 'RPC'
python
rtype = 'RPC_RESPONSE@{uuid}'

GrabRender

python
class GrabRender(ServerRPC)

Source

A higher-level ServerEvent that wraps other ServerEvents

GrabRender.init

python
def __init__(self, *, key: str='DEFAULT', **kwargs)

Source

Inherited members

python
etype = 'GRAB_RENDER'

Public imports

These symbols are available from this module. Their definitions are documented in the linked modules.

  • Scenevuer.schemas.scene_components.Scene
  • Elementvuer.schemas.html_components.Element
  • serializervuer.serdes.serializer