def render(options = {})
options[:graph_id] ||= 'scruffy_graph'
options[:complexity] ||= (global_complexity || :normal)
rendertime_renderer = self.clone
rendertime_renderer.instance_eval { before_render if respond_to?(:before_render) }
svg = Builder::XmlMarkup.new(:indent => 2)
svg.instruct!
svg.declare!(:DOCTYPE, :svg, :PUBLIC, "-//W3C//DTD SVG 1.1//EN", "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd")
svg.svg(:xmlns => "http://www.w3.org/2000/svg", 'xmlns:xlink' => "http://www.w3.org/1999/xlink", :viewBox => "#{options[:size].first} 100 #{options[:size].last} 200") {
svg.g(:id => options[:graph_id]) {
rendertime_renderer.components.each do |component|
component.render(svg,
bounds_for( options[:size], component.position, component.size ),
options)
end
}
}
svg.target!
end