grid

visualife.core.shapes.grid(viewport, id_str, x, y, w, h, **kwargs)

Draws a line grid.

Draws lines making up a grid that fills the rectangle starting at (x,y) of a given width and height.

Parameters:
  • viewport – viewport for drawing
  • id_str – (string) unique ID string for the group containing grid lines
  • x – X coordinate of the top left corner of the rectangle bounding the grid
  • y – Y coordinate of the top left corner of the rectangle bounding the grid
  • w – width of the bounding rectangle
  • h – height of the bounding rectangle
  • kwargs – see below
Returns:

None

Keyword Arguments:
 
  • step (value) – grid spacing - separation between line
  • xstep (value) – vertical grid spacing
  • ystep (value) – horizontal grid spacing
  • draw (string) – which lines should be actually drawn; allowed values: "both", "horizontal" or "vertical". Default is "both"

All other arguments are passed to group construction method of the viewer