Skip to main content

Home > @jsplumbtoolkit/browser-ui-plugin-background > GeneratedGridBackground

GeneratedGridBackground class

A background that generates an SVG grid based upon the current content bounds, ensuring that there is always a grid visible underneath the content. The grid may consist of lines or dots - control this via the gridType option.

The size of the grid can be mandated in the options for the background, or it can be extracted from the surface.

You can hide/show the background grid via the hide(), show(), toggle() or setVisible(boolean) methods.

Signature:

export declare class GeneratedGridBackground implements Background 

Implements: Background

Constructors

ConstructorModifiersDescription
(constructor)(params)Constructs a new instance of the GeneratedGridBackground class

Properties

PropertyModifiersTypeDescription
_maximumExtentsReached{ minX: number; minY: number; maxX: number; maxY: number; }
_suspendedboolean
autoShrinkboolean
backgroundContainerSVGElement
currentBoundsViewportBounds
dotRadiusnumber
gridGrid
gridTypeGridType
maxHeightnumber
maxWidthnumber
minHeightnumber
minWidthnumber
showBorderboolean
showTickMarksboolean
surfaceSurface
tickDotRadiusnumber
tickMarksPerCellnumber
typestring
typestaticstring

Methods

MethodModifiersDescription
_setVisible(v)Sets the visible state of the grid
destroy()
getHeight()
getWidth()
owns(el)
pan()
setZoom(zoom, doNotDebounce)