Module: Sevgi::Graphics::Mixtures::Render

Defined in:
lib/sevgi/graphics/mixtures/render.rb

Overview

DSL helpers for rendering SVG documents and children.

Instance Method Summary collapse

Instance Method Details

#Render(**options) ⇒ String

Renders this element as SVG source. Elements with inline text content may also contain inline children such as tspan; the renderer keeps those descendants in the same text line. Whitespace inside content objects is preserved as given, and encoded content is XML-escaped unless a verbatim content object is used.

Parameters:

  • options (Hash)

    renderer options

Returns:

  • (String)

    SVG source

Raises:

  • (Sevgi::ArgumentError)

    when style is missing or unsupported



322
# File 'lib/sevgi/graphics/mixtures/render.rb', line 322

def Render(**) = Renderer.(self, **)

#RenderChildren(separator = "\n\n") ⇒ String

Renders only this element's children. Child render output omits document preambles and preserves each child's text whitespace and inline mixed-content formatting.

Parameters:

  • separator (String) (defaults to: "\n\n")

    separator between child documents

Returns:

  • (String)

    rendered child fragments



329
# File 'lib/sevgi/graphics/mixtures/render.rb', line 329

def RenderChildren(separator = "\n\n") = children.map { Renderer.fragment(it) }.join(separator)