module RailsERD::Diagram::Graphviz::Simple

Public Instance Methods

entity_style(entity, attributes) click to toggle source
# File lib/rails_erd/diagram/graphviz.rb, line 95
def entity_style(entity, attributes)
  {}.tap do |options|
    options[:fontcolor] = options[:color] = :grey60 if entity.virtual?
  end
end
relationship_style(relationship) click to toggle source
# File lib/rails_erd/diagram/graphviz.rb, line 101
def relationship_style(relationship)
  {}.tap do |options|
    options[:style] = :dotted if relationship.indirect?

    # Closed arrows for to/from many.
    options[:arrowhead] = relationship.to_many? ? "normal" : "none"
    options[:arrowtail] = relationship.many_to? ? "normal" : "none"
  end
end
specialization_style(specialization) click to toggle source
# File lib/rails_erd/diagram/graphviz.rb, line 111
def specialization_style(specialization)
  { color:     :grey60,
    arrowtail: :onormal,
    arrowhead: :none,
    arrowsize: 1.2 }
end