StaticTemplateRegistry

class StaticTemplateRegistry()

Template registry for static templates.

The current instance can be retrieved from the GraphEditor object.

Returns:

StaticTemplateRegistry

StaticTemplateRegistry.getMarkerAttachementPointInfo(markerType)

Get the line attachement point for the given marker type.

This method uses getMarkerTemplateId .

Arguments:
  • markerType (string) –

Returns:

LineAttachementInfo

StaticTemplateRegistry.getMarkerTemplate(markerType)

Get the static template for the given marker type.

This method uses getMarkerTemplateId .

Arguments:
  • markerType (string) –

Returns:

Selection<SVGGElement, unknown, any, unknown>

StaticTemplateRegistry.getMarkerTemplateId(markerType)

Get the template id for the given marker type.

If the type is null or has no registered template the id 'default-marker' is returned instead.

Arguments:
  • markerType (string) –

Returns:

string

StaticTemplateRegistry.getNodeTemplate(id)

Get the static template for the given node type.

This method uses getNodeTemplateId .

Arguments:
  • id (string) –

Returns:

Selection<SVGGElement, unknown, any, unknown>

StaticTemplateRegistry.getNodeTemplateId(nodeType)

Get the template id for the given node type.

If the type is null or has no registered template the id 'default' is returned instead.

Arguments:
  • nodeType (string) –

Returns:

string

StaticTemplateRegistry.getNodeTemplateLinkHandles(id)

Get the link handles for the given node type.

This method uses getNodeTemplateId .

Arguments:
  • id (string) –

Returns:

LinkHandle[]

StaticTemplateRegistry.getTemplateBBox(id)

Get the bounding box of a static template (without link handles!).

Arguments:
  • id (string) –

Returns:

Rect

StaticTemplateRegistry.updateTemplateCache(svg)

Update template cache from the given svg.

This method searches for templates in the first <defs> element of the given svg.

Arguments:
  • svg (Selection<SVGSVGElement, unknown, any, unknown>) –