Component Library
vuer.schemas¶

vuer.schema contains the schemas for the various components of the Vuer system. These schemas are used to validate the data that is passed to the various components of the system.

For detailed view of how these components are implemented, please refer to the typescript source code at https://github.com/vuer-ai/vuer-ts/tree/master/src/schemas.

Example Usage:

from vuer import Vuer
from vuer.schemas import DefaultScene, Sphere

vuer = Vuer()
vuer.set @ DefaultScene(up=[0, 1, 0])
vuer.upsert @ Sphere(args=[0.1, 20, 20], position=[0, 0.1, 0], key="sphere")

HTML Components¶

class vuer.schemas.html_components.BytesIO¶

Bases: _BufferedIOBase

Buffered I/O implementation using an in-memory bytes buffer.

__new__(**kwargs)¶
close()¶

Disable all I/O operations.

closed¶

True if the file is closed.

flush()¶

Does nothing.

getbuffer()¶

Get a read-write view over the contents of the BytesIO object.

getvalue()¶

Retrieve the entire contents of the BytesIO object.

isatty()¶

Always returns False.

BytesIO objects are not connected to a TTY-like device.

read(size=-1, /)¶

Read at most size bytes, returned as a bytes object.

If the size argument is negative, read until EOF is reached. Return an empty bytes object at EOF.

read1(size=-1, /)¶

Read at most size bytes, returned as a bytes object.

If the size argument is negative or omitted, read until EOF is reached. Return an empty bytes object at EOF.

readable()¶

Returns True if the IO object can be read.

readinto(buffer, /)¶

Read bytes into buffer.

Returns number of bytes read (0 for EOF), or None if the object is set not to block and has no data to read.

readline(size=-1, /)¶

Next line from the file, as a bytes object.

Retain newline. A non-negative size argument limits the maximum number of bytes to return (an incomplete line may be returned then). Return an empty bytes object at EOF.

readlines(size=None, /)¶

List of bytes objects, each a line from the file.

Call readline() repeatedly and return a list of the lines so read. The optional size argument, if given, is an approximate bound on the total number of bytes in the lines returned.

seek(pos, whence=0, /)¶

Change stream position.

Seek to byte offset pos relative to position indicated by whence:

0 Start of stream (the default). pos should be >= 0; 1 Current position - pos may be negative; 2 End of stream - pos usually negative.

Returns the new absolute position.

seekable()¶

Returns True if the IO object can be seeked.

tell()¶

Current file position, an integer.

truncate(size=None, /)¶

Truncate the file to at most size bytes.

Size defaults to the current file position, as returned by tell(). The current file position is unchanged. Returns the new size.

writable()¶

Returns True if the IO object can be written.

write(b, /)¶

Write bytes to file.

Return the number of bytes written.

writelines(lines, /)¶

Write lines to the file.

Note that newlines are not added. lines can be any iterable object producing bytes-like objects. This is equivalent to calling write() for each element.

class vuer.schemas.html_components.Element[source]¶

Bases: object

Base class for all elements

tag: str = 'div'¶
serialize()[source]¶

Serialize the element to a dictionary for sending over the websocket.

Returns:

Dictionary representing the element.

class vuer.schemas.html_components.BlockElement[source]¶

Bases: Element

serialize()[source]¶

Serialize the element to a dictionary for sending over the websocket.

Returns:

Dictionary representing the element.

class vuer.schemas.html_components.AutoScroll[source]¶

Bases: BlockElement

tag: str = 'AutoScroll'¶
class vuer.schemas.html_components.Markdown[source]¶

Bases: BlockElement

tag: str = 'Markdown'¶
class vuer.schemas.html_components.Page[source]¶

Bases: BlockElement

A Page is an element that contains other elements. It is represented by a div element in the DOM.

tag: str = 'article'¶
class vuer.schemas.html_components.div[source]¶

Bases: BlockElement

tag: str = 'Div'¶
class vuer.schemas.html_components.InputBox[source]¶

Bases: Element

An InputBox is an element that allows the user to input text. It is represented by an input element in the DOM.

tag: str = 'Input'¶
class vuer.schemas.html_components.Header1[source]¶

Bases: BlockElement

A Text element is an element that displays text. It is represented by a text, or p element in the DOM.

tag: str = 'h1'¶
vuer.schemas.html_components.Header¶

alias of Header1

class vuer.schemas.html_components.Header2[source]¶

Bases: Header1

Header 2

tag: str = 'h2'¶
class vuer.schemas.html_components.Header3[source]¶

Bases: Header1

Header 2

tag: str = 'h3'¶
class vuer.schemas.html_components.Paragraph[source]¶

Bases: BlockElement

A Text element is an element that displays text. It is represented by a text, or p element in the DOM.

tag: str = 'p'¶
class vuer.schemas.html_components.Text[source]¶

Bases: Element

A Text element is an element that displays text. It is represented by a text, or p element in the DOM.

tag: str = 'Text'¶
class vuer.schemas.html_components.Bold[source]¶

Bases: Text

class vuer.schemas.html_components.Italic[source]¶

Bases: Text

Bases: Text

tag: str = 'a'¶
class vuer.schemas.html_components.Button[source]¶

Bases: Element

A Button element is an element that allows the user to click on it. It is represented by a button element in the DOM.

tag: str = 'Button'¶
class vuer.schemas.html_components.Slider[source]¶

Bases: Element

A Slider element is an element that allows the user to slide a value. It is represented by a slider element in the DOM.

tag: str = 'Slider'¶
class vuer.schemas.html_components.Image[source]¶

Bases: Element

An Image element is an element that displays an image. It is represented by an img element in the DOM.

tag: str = 'Img'¶
class vuer.schemas.html_components.ImageUpload[source]¶

Bases: Element

A ImageUpload element is an element that allows the user to upload a file. It is represented by a file upload element in the DOM.

tag: str = 'ImageUpload'¶

3D Scene Components¶

Drei Components¶