class Graphviz::Graph
In parameters, name and source are typically String.
Constants
- DEFAULT_FORMAT
- DEFAULT_LAYOUT
Public Class Methods
Source
# File mrblib/mrb_graphviz.rb, line 144
directed and strict are bools.
Public Instance Methods
Source
# File mrblib/mrb_graphviz.rb, line 88 def edge(tail, head, name: nil, **attributes) edge = find_or_create_edge(tail, head, name:) attributes.each do |name, value| edge.safe_update_attribute(name, value) end edge end
For compatibility with gv gem’s edge method, but note that the name parameter is an optional keyword argument. Also note that ‘name’ is not in Graphviz edge attributes.
Alias for: create_html_like_string
Source
# File mrblib/mrb_graphviz.rb, line 75 def node(name, **attributes) node = find_or_create_node(name) attributes.each do |name, value| node.safe_update_attribute(name, value) end node end
For compatibility with gv gem’s node method.
Source
# File mrblib/mrb_graphviz.rb, line 134 def render(layout: DEFAULT_LAYOUT, format: DEFAULT_FORMAT) Graphviz::Context.new.create_layout(self, layout).dump(format).content end
For compatibility with gv gem’s render method, but note that layout and format parameters are made clear by keyword arguments.
Source
# File mrblib/mrb_graphviz.rb, line 125 def save(filename, layout: DEFAULT_LAYOUT, format: DEFAULT_FORMAT) Graphviz::Context.new.create_layout(self, layout) .write(filename, format) end
For compatibility with gv gem’s save method, but note that format and layout parameters are made clear with keyword arguments.
Source
# File mrblib/mrb_graphviz.rb, line 98 def subgraph(name, **attributes) graph = find_or_create_subgraph(name) attributes.each do |name, value| graph.safe_update_attribute(name, value) end graph end
For compatibility with gv gem’s sub_graph method.
Also aliased as: sub_graph