components¶
Frontend components.
All web components / widgets for being web UI. Larger components are grouped in their own directory / module.
Being widget gallery:
Submodules¶
Submodules¶
components/plotter¶
- class Line(ctx, color="#000000", maxlen=100, lineWidth=2)¶
Line artist. Contains ring buffer for line data and knows how to draw itself.
- Arguments
ctx (
CanvasRenderingContext2D()
) – Canvas rendering context.color (
string()
) – Line color.maxlen (
number()
) – Maximum number of data points.lineWidth (
number()
) – Line width.
- Line.length¶
type: number
Number of data points.
- Line.maxlen¶
type: number
Get / set maxlen of buffer.
- Line.x_data¶
First data column.
- Line.y_data¶
Second data column.
- Line.append_data(pt)¶
Append new data point to data buffer.
- Arguments
pt (
array()
) – Data point to append.
- Line.calc_bbox()¶
Calculate line width of Line artist.
- Returns
BBox – Data bounding box.
- Line.clear()¶
Reset data buffer.
- Line.draw()¶
Draw line. Transforms have to be set from the outside.
- class Plotter()¶
Data plotter widget.
Holds a canvas / SVG with its own viewport bounding box. Manages data space <-> view space transformations.
- Plotter.maxlen¶
type: number
Get / set maxlen for all current and future lines.
- Plotter.auto_scale()¶
Update viewport bounding box current line data.
- Plotter.change_viewport(bbox)¶
Change viewport and redraw.
- Arguments
bbox (
BBox()
) – New viewport bounding box.
- Plotter.clear_canvas()¶
Clear canvas.
- Plotter.clear_lines()¶
Clear all lines.
- Plotter.draw()¶
Draw everything
- Plotter.draw_axis_and_tick_labels(color="silver")¶
Draw axis and tick labels.
- Arguments
color (
string()
) – Axis and tick label color.
- Plotter.draw_canvas()¶
Rescale and draw canvas.
- Plotter.draw_lines()¶
Draw all line artists.
- Plotter.expand_viewport_by_bbox(bbox)¶
Expand viewport by some other bounding box.
- Arguments
bbox (
BBox()
) – Bounding box.
- Plotter.expand_viewport_vertically(ymin, ymax)¶
Expand viewport vertically and redraw.
- Arguments
ymin (
number()
) – Lower vertical bound.ymax (
number()
) – Upper vertical bound.
- Plotter.forget()¶
Make lines forget one value.
- Plotter.init_new_line(lineNr)¶
Create a new line artist for the given line number.
- Arguments
lineNr (
number()
) – Line number.
- Plotter.mouse_coordinates(evt)¶
Coordinates of mouse event inside view space.
- Arguments
evt (
MouseEvent()
) – Mouse event to transform into data space.
- Returns
array – Coordinate point.
- Plotter.plot_being_state_message(msg)¶
Plot all values across time in a being state message.
- Arguments
msg (
object()
) – Being state message.
- Plotter.plot_value(timestamp, value, lineNr=0)¶
Plot single new value.
- Arguments
timestamp (
number()
) – Timestamp.value (
number()
) – Scalar value.lineNr (
number()
) – Line number to append new values to.
- Plotter.plot_values(timestamp, values)¶
Plot some new values. Get appended to current lines.
- Arguments
timestamp (
number()
) – Timestamp value.values (
array()
) – Values to plot.
- Plotter.resize()¶
Resize plotter. Adjust canvas size and recompute transformation matrices.
- Plotter.transform_point(pt)¶
Transform a data point to view space.
- Arguments
pt (
array()
) – 2d data point.
- Returns
array – Transformed 2d point.
- Plotter.transform_points(pts)¶
Transform multiple data point into view space.
- Arguments
pts (
array()
) – Array of 2d data points.
- Returns
array – Array of 2d transformed points.
- Plotter.update_transformation_matrices()¶
Update transformation matrices from current viewport.