Module: Ea::Svg::EaEmitter::Compartment::StereotypeIcon

Defined in:
lib/ea/svg/ea_emitter/compartment/stereotype_icon.rb

Overview

Stereotype decorator icon compartment. Emits the small symbolic polygon that EA renders inside an element's body when a stereotype provides a custom icon (FeatureType diamond, Type polygon, etc.). Delegates to Element::StereotypeIconRenderer.

Rendered after the header so the icon sits inside the element body below the stereotype label.

Class Method Summary collapse

Class Method Details

.render(context) ⇒ Object



18
19
20
21
22
23
24
25
26
27
# File 'lib/ea/svg/ea_emitter/compartment/stereotype_icon.rb', line 18

def render(context)
  return nil unless context.classifier

  svg = Element::StereotypeIconRenderer.render(
    classifier: context.classifier,
    bounds: context.bounds,
    canvas: context.canvas
  )
  svg.empty? ? nil : svg
end