Central interface used by the CanvasComponent to render elements from the scene graph.
Remarks
Implementations will be queried using the tag for the corresponding implementations of the various aspects of the render tag.
This interface can conveniently be implemented by subclassing ObjectRendererBase<TRenderTag,TVisual>.
Type Parameters
- TRenderTag
Type Details
- yFiles module
- view
See Also
Methods
Returns an implementation of IBoundsProvider that can determine the visible bounds of the rendering of the render tag.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to query the bounds for
Returns
- ↪IBoundsProvider
- An implementation of IBoundsProvider to determine the bounds of the visualization.
Returns an implementation of IHitTestable that can determine whether the rendering of the render tag has been hit at a given coordinate.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to do the hit testing for
Returns
- ↪IHitTestable
- An implementation of IHitTestable to determine visibility.
Returns an implementation of IVisibilityTestable that can determine if the rendering of the render tag would be visible in a given context.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to query visibility for
Returns
- ↪IVisibilityTestable
- An implementation of IVisibilityTestable to determine visibility.
Returns an implementation of IVisualCreator that will create the Visual tree for the render tag.
Remarks
Parameters
A map of options to pass to the method.
- renderTag - TRenderTag
- the render tag to create a Visual for
Returns
- ↪IVisualCreator
- An implementation of IVisualCreator to create or update the visualization.
Constants
A renderer that treats tag as an instance of ILookup to obtain suitable interface implementations.
Remarks
This renderer tries to cast the tag to ILookup and obtain the appropriate interface implementations for its methods from it.
If the tag does not implement ILookup nothing will be displayed.
Examples
// the node provides an IVisualCreator via its lookup
const renderTreeElement = graphComponent.renderTree.createElement(
graphComponent.renderTree.backgroundGroup,
node,
)
A renderer that treats tag as Visual to use directly.
Remarks
Examples
image
to the canvas.const image = window.document.createElementNS(
'http://www.w3.org/2000/svg',
'image',
)
image.setAttributeNS(
'http://www.w3.org/1999/xlink',
'href',
'resources/background.png',
)
image.x.baseVal.value = 1
image.y.baseVal.value = 1
image.width.baseVal.value = 100
image.height.baseVal.value = 100
const visual = new SvgVisual(image)
graphComponent.renderTree.createElement(
graphComponent.renderTree.rootGroup,
visual,
)
A renderer that treats tag as an instance of IVisualCreator.
Remarks
This renderer tries to cast the tag to IVisualCreator and use this instance to handle the visual representation of the IRenderTreeElement.
If the tag does not implement IVisualCreator nothing will be displayed.
Examples
const renderTreeElement = graphComponent.renderTree.createElement(
graphComponent.renderTree.backgroundGroup,
new RectangleVisualCreator(rectangle),
)
An immutable and shareable instance of the IObjectRenderer<T> class that renders nothing.