Class: Lutaml::Xsd::Spa::Svg::Connectors::InheritanceConnector

Inherits:
Lutaml::Xsd::Spa::Svg::ConnectorRenderer show all
Defined in:
lib/lutaml/xsd/spa/svg/connectors/inheritance_connector.rb

Overview

Renders inheritance relationship with hollow triangle arrow (e.g., Type extends BaseType)

Instance Attribute Summary

Attributes inherited from Lutaml::Xsd::Spa::Svg::ConnectorRenderer

#config, #style

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ InheritanceConnector

Returns a new instance of InheritanceConnector.



13
14
15
# File 'lib/lutaml/xsd/spa/svg/connectors/inheritance_connector.rb', line 13

def initialize(config)
  super(config, "inheritance")
end

Instance Method Details

#render(from_point, to_point) ⇒ Object

Renders an inheritance connector from parent to child Hollow triangle indicates “extends” relationship



19
20
21
22
23
24
25
26
27
28
29
# File 'lib/lutaml/xsd/spa/svg/connectors/inheritance_connector.rb', line 19

def render(from_point, to_point)
  parts = []

  # Draw line from parent to child
  parts << create_line(from_point, to_point)

  # Draw hollow triangle at child end
  parts << create_hollow_triangle_at(to_point, from_point)

  parts.join("\n")
end