Class: Graphwerk::Builders::Graph
- Inherits:
-
Object
- Object
- Graphwerk::Builders::Graph
- Extended by:
- T::Sig
- Defined in:
- lib/graphwerk/builders/graph.rb
Constant Summary collapse
- OptionsShape =
T.type_alias { { layout: Graphwerk::Layout, application: T::Hash[Symbol, Object], graph: T::Hash[Symbol, Object], node: T::Hash[Symbol, Object], edge: T::Hash[Symbol, Object] } }
- DEFAULT_OPTIONS =
T.let({ layout: Graphwerk::Layout::Dot, application: { style: 'filled', fillcolor: '#333333', fontcolor: 'white' }, graph: { root: Constants::ROOT_PACKAGE_NAME, overlap: false, splines: true }, node: { shape: 'box', style: 'rounded, filled', fontcolor: 'white', fillcolor: '#EF673E', color: '#EF673E', fontname: 'Lato' }, edge: { len: '0.4' } }, OptionsShape)
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(package_set, options: {}) ⇒ Graph
constructor
A new instance of Graph.
Constructor Details
#initialize(package_set, options: {}) ⇒ Graph
45 46 47 48 49 50 |
# File 'lib/graphwerk/builders/graph.rb', line 45 def initialize(package_set, options: {}) @package_set = package_set = T.let(DEFAULT_OPTIONS.deep_merge(), OptionsShape) @graph = T.let(build_empty_graph, GraphViz) @nodes = T.let(build_empty_nodes, T::Hash[String, GraphViz::Node]) end |
Instance Method Details
#build ⇒ Object
53 54 55 56 57 58 |
# File 'lib/graphwerk/builders/graph.rb', line 53 def build setup_graph add_packages_to_graph add_package_dependencies_to_graph @graph end |