whitecanvas.types package

Module contents

class whitecanvas.types.Alignment(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

BOTTOM = 'bottom'
BOTTOM_LEFT = 'bottom_left'
BOTTOM_RIGHT = 'bottom_right'
CENTER = 'center'
LEFT = 'left'
RIGHT = 'right'
TOP = 'top'
TOP_LEFT = 'top_left'
TOP_RIGHT = 'top_right'
classmethod merge(vertical, horizontal: whitecanvas.types._enums.Alignment) whitecanvas.types._enums.Alignment[source]
split() tuple[whitecanvas.types._enums.Alignment, whitecanvas.types._enums.Alignment][source]

Split the alignment into vertical and horizontal components.

class whitecanvas.types.FacePattern(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

CROSS = '+'
DIAGONAL_BACK = '/'
DIAGONAL_CROSS = 'x'
DIAGONAL_FORWARD = '\\'
DOTS = '.'
HORIZONTAL = '-'
SOLID = ''
VERTICAL = '|'
class whitecanvas.types.LineStyle(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

DASH = '--'
DASH_DOT = '-.'
DOT = ':'
SOLID = '-'
class whitecanvas.types.Modifier(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

ALT = 'alt'
CTRL = 'ctrl'
META = 'meta'
SHIFT = 'shift'
class whitecanvas.types.MouseButton(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

BACK = 'back'
FORWARD = 'forward'
LEFT = 'left'
MIDDLE = 'middle'
NONE = 'none'
RIGHT = 'right'
class whitecanvas.types.MouseEvent(button: 'MouseButton', modifiers: 'tuple[Modifier, ...]', pos: 'tuple[float, float]', type: 'MouseEventType')[source]

Bases: object

button: whitecanvas.types._enums.MouseButton
modifiers: tuple[whitecanvas.types._enums.Modifier, ...]
pos: tuple[float, float]
type: whitecanvas.types._enums.MouseEventType
class whitecanvas.types.MouseEventType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

CLICK = 'click'
DOUBLE_CLICK = 'double_click'
MOVE = 'move'
RELEASE = 'release'
class whitecanvas.types.Orientation(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

HORIZONTAL = 'horizontal'
VERTICAL = 'vertical'
property is_vertical
classmethod parse(value)[source]
transpose()[source]
class whitecanvas.types.Rect(left: float, right: float, bottom: float, top: float)[source]

Bases: NamedTuple

Rectangular range.

bottom: float

Alias for field number 2

property center: tuple[float, float]

Center of the range.

property height: float

Height of the range.

left: float

Alias for field number 0

right: float

Alias for field number 1

property size: tuple[float, float]

Size (width, height) of the range.

top: float

Alias for field number 3

property width: float

Width of the range.

class whitecanvas.types.Symbol(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: whitecanvas.types._enums._strEnum

CIRCLE = 'o'
CROSS = 'x'
DIAMOND = 'D'
DOT = '.'
HBAR = '_'
PLUS = '+'
SQUARE = 's'
STAR = '*'
TRIANGLE_DOWN = 'v'
TRIANGLE_LEFT = '<'
TRIANGLE_RIGHT = '>'
TRIANGLE_UP = '^'
VBAR = '|'
has_face() bool[source]
class whitecanvas.types.XYData(x: NDArray[_D], y: NDArray[_D])[source]

Bases: NamedTuple, Generic[whitecanvas.types._tuples._D]

Tuple of x and y array.

Used for data of Line, Markers etc.

stack() numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]][source]

Data as a stacked (N, 2) array.

x: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]

Alias for field number 0

y: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]

Alias for field number 1

class whitecanvas.types.XYYData(x: NDArray[_D], y0: NDArray[_D], y1: NDArray[_D])[source]

Bases: NamedTuple, Generic[whitecanvas.types._tuples._D]

Tuple of x, y0, and y1 array.

Used for data of Bars, Errorbars etc.

x: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]

Alias for field number 0

y0: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]

Alias for field number 1

y1: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]

Alias for field number 2

property ycenter: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]
property ydiff: numpy.ndarray[Any, numpy.dtype[whitecanvas.types._tuples._D]]