Renders a grid, using various different styles and render technologies.
Implements
- I
Remarks
Examples
Enabling grid snapping
const snapContext = new GraphSnapContext()
const gridInfo = new GridInfo(50, 50)
snapContext.nodeGridConstraintProvider = new GridConstraintProvider(
gridInfo,
)
snapContext.bendGridConstraintProvider = new GridConstraintProvider(
gridInfo,
)
snapContext.portGridConstraintProvider = new GridConstraintProvider(
gridInfo,
)
snapContext.gridSnapType = GridSnapTypes.GRID_POINTS
graphEditorInputMode.snapContext = snapContextNote that the grid visualization has to be enabled separately
graphComponent.renderTree.createElement(
graphComponent.renderTree.backgroundGroup,
gridInfo,
new GridRenderer(),
)See Also
Members
No filters for this type
Constructors
Initializes a new instance of the GridRenderer class.
Initializes a new instance of the GridRenderer class.
Parameters
Properties
Gets or sets the grid style that this implementation uses.
Gets or sets the grid style that this implementation uses.
conversionfinal
Property Value
The grid style.
Gets or sets the mode used to render the grid.
Gets or sets the mode used to render the grid.
conversionfinal
This indicates the minimum distance in the view coordinate system between two grid points. If the distance becomes smaller, the grid will not be rendered.
final
Property Value
The visibility threshold.
Gets or sets a value indicating whether this GridRenderer is visible.
Gets or sets a value indicating whether this GridRenderer is visible.
final
Property Value
true if visible; false otherwise.Methods
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
final
Parameters
- renderTag: GridInfo
- the render tag to query the bounds for
Return Value
- IBoundsProvider
- An implementation of IBoundsProvider to determine the bounds of the visualization.
Implements
IObjectRenderer.getBoundsProviderReturns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
Returns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
final
Parameters
- renderTag: GridInfo
- the render tag to do the hit testing for
Return Value
- IHitTestable
- An implementation of IHitTestable to determine visibility.
Implements
IObjectRenderer.getHitTestableReturns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
Returns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
This method may always return the same instance. By contract clients will not cache instances returned but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
final
Parameters
- renderTag: GridInfo
- the render tag to query visibility for
Return Value
- IVisibilityTestable
- An implementation of IVisibilityTestable to determine visibility.
Implements
IObjectRenderer.getVisibilityTestableReturns an implementation of IVisualCreator that will create the Visual tree for the render tag.
Returns an implementation of IVisualCreator that will create the Visual tree for the render tag.
This method may always return the same instance. By contract, clients will not cache instances returned, but will always call this method before the methods on the instance will be called. This contract enables the use of the flyweight design pattern. Implementations of this class can always return the same instance and reconfigure this instance upon each call to this method.
final
Parameters
Return Value
- IVisualCreator
- An implementation of IVisualCreator to create or update the visualization.