Module: RailsERD::Diagram::Graphviz::Simple
Instance Method Summary collapse
- #entity_style(entity, attributes) ⇒ Object
- #relationship_style(relationship) ⇒ Object
- #specialization_style(specialization) ⇒ Object
Instance Method Details
#entity_style(entity, attributes) ⇒ Object
95 96 97 98 99 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 95 def entity_style(entity, attributes) {}.tap do || [:fontcolor] = [:color] = :grey60 if entity.virtual? end end |
#relationship_style(relationship) ⇒ Object
101 102 103 104 105 106 107 108 109 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 101 def relationship_style(relationship) {}.tap do || [:style] = :dotted if relationship.indirect? # Closed arrows for to/from many. [:arrowhead] = relationship.to_many? ? "normal" : "none" [:arrowtail] = relationship.many_to? ? "normal" : "none" end end |
#specialization_style(specialization) ⇒ Object
111 112 113 114 115 116 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 111 def specialization_style(specialization) { color: :grey60, arrowtail: :onormal, arrowhead: :none, arrowsize: 1.2 } end |