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
101 102 103 104 105 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 101 def entity_style(entity, attributes) {}.tap do || [:fontcolor] = [:color] = :grey60 if entity.virtual? end end |
#relationship_style(relationship) ⇒ Object
107 108 109 110 111 112 113 114 115 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 107 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
117 118 119 120 121 122 |
# File 'lib/rails_erd/diagram/graphviz.rb', line 117 def specialization_style(specialization) { color: :grey60, arrowtail: :onormal, arrowhead: :none, arrowsize: 1.2 } end |