Event Types
vuer.events#
- vuer.events.uuid4()#
Generate a random UUID.
- class vuer.events.Element#
Bases:
objectBase class for all elements
- tag: str = 'div'#
- serialize()#
Serialize the element to a dictionary for sending over the websocket. :return: Dictionary representing the element.
- class vuer.events.Scene#
Bases:
BlockElement- tag: str = 'Scene'#
- serialize()#
Serialize the element to a dictionary for sending over the websocket. :return: Dictionary representing the element.
- vuer.events.serializer(data)#
- class vuer.events.Event#
Bases:
objectAn event is a message sent from the server to the client.
- class vuer.events.InitEvent#
Bases:
ClientEvent
- class vuer.events.NullEvent#
Bases:
ClientEvent
- class vuer.events.ServerEvent#
Bases:
Event- serialize()#
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- class vuer.events.Noop#
Bases:
ServerEvent- etype = 'NOOP'#
- class vuer.events.Set#
Bases:
ServerEventSet 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.
- etype = 'SET'#
The Event Type.
- class vuer.events.Update#
Bases:
ServerEventUPDATE 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)
- etype = 'UPDATE'#
- serialize()#
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- class vuer.events.Add#
Bases:
ServerEventADD 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 now.
- Example:
app.add @ Element(…)
app.add @ [ Element(…), Element(…), … ]
app.add(Element, to=”my_parent_key”)
app.add([Element, …], to=”my_parent_key”)
- etype = 'ADD'#
- serialize()#
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- class vuer.events.Upsert#
Bases:
ServerEventUPSERT 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 now.
- Example:
app.upsert @ Element(…)
app.upsert @ [ Element(…), Element(…), … ]
app.upsert(Element, to=”my_parent_key”)
app.upsert([Element, …], to=”my_parent_key”)
- etype = 'UPSERT'#
- serialize()#
Serialize the event to a dictionary for sending over the websocket. :return: A dictionary representing the event.
- class vuer.events.Remove#
Bases:
ServerEventAn 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.
- etype = 'REMOVE'#
- class vuer.events.Frame#
Bases:
ServerEventA higher-level ServerEvent that wraps other ServerEvents
- ServerEvent: ServerEvent#
- etype = 'FRAME'#
- class vuer.events.End#
Bases:
ServerEventA higher-level ServerEvent that wraps other ServerEvents
- etype = 'TERMINATE'#
- class vuer.events.ServerRPC#
Bases:
ServerEvent- etype = 'RPC'#
- rtype = 'RPC_RESPONSE@{uuid}'#
- uuid: str#