Module: DBDiagram::Diagram::Graphviz::Simple

Included in:
Bachman, Crowsfoot, Uml
Defined in:
lib/db_diagram/diagram/graphviz.rb

Instance Method Summary collapse

Instance Method Details

#entity_style(entity, attributes) ⇒ Object



98
99
100
101
102
# File 'lib/db_diagram/diagram/graphviz.rb', line 98

def entity_style(entity, attributes)
  {}.tap do |options|
    options[:fontcolor] = options[:color] = :grey60 if entity.abstract?
  end
end

#relationship_style(relationship) ⇒ Object



104
105
106
107
108
109
110
111
112
# File 'lib/db_diagram/diagram/graphviz.rb', line 104

def relationship_style(relationship)
  {}.tap do |options|
    # options[:style] = :dotted #虚线

    # Closed arrows for to/from many.
    options[:arrowhead] = relationship.to_many? ? "normal" : "none"
    options[:arrowtail] = relationship.many_to? ? "normal" : "none"
  end
end