visualize_packs 0.5.18 → 0.5.19
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graph.dot.erb +32 -16
- data/lib/visualize_packs.rb +12 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 21c174ca9487c1d11560c585972f1da5ff9b8ddc53148537753af82d1fb66a25
|
4
|
+
data.tar.gz: 2b910b38ad69c3df0631a98b21ec4ca6651190ab973bfc4ba4692e0f1fb7d740
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 883ddfb826a9f9051b0431d289fd98b6a92d41c41a42f4e560c0fae89a9432e741c5d9fddd2802a9eae64c9c1a6073d541f26ca8269c40d7f27b946908881088
|
7
|
+
data.tar.gz: 6136452d922cefa21486b40c18b2df6fda1838f25030d66019edfd291101dcae503777f7ecc9581ccf07d0c894f5800adc44248a18b931359d2ab2e1eb65d727
|
data/lib/graph.dot.erb
CHANGED
@@ -87,19 +87,19 @@ digraph package_diagram {
|
|
87
87
|
<%- todo_types = todos_by_package[todos_to_package].group_by(&:type) -%>
|
88
88
|
<%- todo_types.keys.each do |todo_type| -%>
|
89
89
|
<%- if show_edge.call(package.name, todos_to_package) -%>
|
90
|
-
"<%= package.name -%>" -> "<%= todos_to_package -%>"<%= todo_type == 'privacy' ? ':private' : '' -%> [
|
90
|
+
"<%= package.name -%>" -> "<%= todos_to_package -%>"<%= todo_type == 'privacy' ? ':private' : '' -%> [
|
91
91
|
<%- if !options.use_todos_for_layout -%>
|
92
92
|
constraint=false
|
93
93
|
<%- end -%>
|
94
94
|
# headlabel="<%= todo_type -%>"
|
95
95
|
<%- if todo_type == 'privacy' -%>
|
96
|
-
|
96
|
+
<%= VisualizePacks::ArrowHead::PrivacyTodo.serialize %>
|
97
97
|
<%- elsif todo_type == 'architecture' -%>
|
98
|
-
|
98
|
+
<%= VisualizePacks::ArrowHead::ArchitectureTodo.serialize %>
|
99
99
|
<%- elsif todo_type == 'visibility' -%>
|
100
|
-
|
100
|
+
<%= VisualizePacks::ArrowHead::VisibilityTodo.serialize %>
|
101
101
|
<%- elsif todo_type == 'dependency' -%>
|
102
|
-
|
102
|
+
<%= VisualizePacks::ArrowHead::DependencyTodo.serialize %>
|
103
103
|
<%- end -%>
|
104
104
|
penwidth=<%= todo_edge_width(todo_types[todo_type].count, max_todo_count) -%>
|
105
105
|
]
|
@@ -128,30 +128,46 @@ digraph package_diagram {
|
|
128
128
|
subgraph cluster_legend {
|
129
129
|
fontsize=16
|
130
130
|
label="Edges Styles and Arrow Heads"
|
131
|
+
<%- if options.show_dependencies -%>
|
131
132
|
A [ fontsize=12 shape=box label="package"]
|
132
133
|
B [ fontsize=12 shape=box label="package"]
|
134
|
+
A -> B [label="accepted dependency" <%= VisualizePacks::ArrowHead::ConfiguredDependency.serialize %>]
|
135
|
+
<%- end -%>
|
136
|
+
<%- if options.show_nested_relationships -%>
|
133
137
|
K [ fontsize=12 shape=box label="package"]
|
134
138
|
L [ fontsize=12 shape=box label="package"]
|
139
|
+
K -> L [label="nested package" <%= VisualizePacks::ArrowHead::ConfiguredNested.serialize %>]
|
140
|
+
<%- end -%>
|
141
|
+
<%- if options.show_visibility -%>
|
135
142
|
M [ fontsize=12 shape=box label="package"]
|
136
143
|
N [ fontsize=12 shape=box label="package"]
|
137
|
-
|
144
|
+
M -> N [label="visibile to" <%= VisualizePacks::ArrowHead::ConfiguredVisibileTo.serialize %>]
|
145
|
+
<%- end -%>
|
146
|
+
<%- if options.show_todos -%>
|
147
|
+
<%- if options.only_todo_types.include?(EdgeTodoTypes::Privacy) -%>
|
138
148
|
C [ fontsize=12 shape=box label="package"]
|
139
149
|
D [ fontsize=12 shape=box label="package"]
|
150
|
+
C -> D [label="privacy todo" <%= VisualizePacks::ArrowHead::PrivacyTodo.serialize %>]
|
151
|
+
<%- end -%>
|
152
|
+
<%- if options.only_todo_types.include?(EdgeTodoTypes::Architecture) -%>
|
140
153
|
E [ fontsize=12 shape=box label="package"]
|
141
154
|
F [ fontsize=12 shape=box label="package"]
|
155
|
+
E -> F [label="architecture todo" <%= VisualizePacks::ArrowHead::ArchitectureTodo.serialize %>]
|
156
|
+
<%- end -%>
|
157
|
+
<%- if options.only_todo_types.include?(EdgeTodoTypes::Visibility) -%>
|
142
158
|
G [ fontsize=12 shape=box label="package"]
|
143
159
|
H [ fontsize=12 shape=box label="package"]
|
160
|
+
G -> H [label="visibility todo" <%= VisualizePacks::ArrowHead::VisibilityTodo.serialize %>]
|
161
|
+
<%- end -%>
|
162
|
+
<%- if options.only_todo_types.include?(EdgeTodoTypes::Dependency) -%>
|
144
163
|
I [ fontsize=12 shape=box label="package"]
|
145
164
|
J [ fontsize=12 shape=box label="package"]
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
E -> F [label="architecture todo" color=darkred style=dashed arrowhead=invodot]
|
153
|
-
G -> H [label="visibility todo" color=darkred style=dashed arrowhead=obox]
|
154
|
-
I -> J [label="dependency todo" color=darkred style=dashed arrowhead=odot]
|
165
|
+
I -> J [label="dependency todo" <%= VisualizePacks::ArrowHead::DependencyTodo.serialize %>]
|
166
|
+
<%- end -%>
|
167
|
+
<%- end -%>
|
168
|
+
LEGEND_NODE_1 [ label="" peripheries=0 height=0 width=0 style=invis ]
|
169
|
+
LEGEND_NODE_2 [ label="" peripheries=0 height=0 width=0 style=invis ]
|
170
|
+
LEGEND_NODE_1 -> LEGEND_NODE_2 [ style=invis ]
|
155
171
|
}
|
156
172
|
<%- end -%>
|
157
173
|
<%- if options.show_teams && all_team_names != [] -%>
|
@@ -172,7 +188,7 @@ digraph package_diagram {
|
|
172
188
|
<%- end -%>
|
173
189
|
}
|
174
190
|
<%- if options.show_legend -%>
|
175
|
-
|
191
|
+
LEGEND_NODE_2 -> "<%= all_team_names.last %><%= all_team_names.last %>" [style=invis]
|
176
192
|
<%- end -%>
|
177
193
|
<%- end -%>
|
178
194
|
}
|
data/lib/visualize_packs.rb
CHANGED
@@ -11,6 +11,18 @@ require 'visualize_packs/options'
|
|
11
11
|
module VisualizePacks
|
12
12
|
extend T::Sig
|
13
13
|
|
14
|
+
class ArrowHead < T::Enum
|
15
|
+
enums do
|
16
|
+
DependencyTodo = new('color=darkred style=dashed arrowhead=odiamond')
|
17
|
+
PrivacyTodo = new('color=darkred style=dashed arrowhead=crow')
|
18
|
+
ArchitectureTodo = new('color=darkred style=dashed arrowhead=obox')
|
19
|
+
VisibilityTodo = new('color=darkred style=dashed arrowhead=tee')
|
20
|
+
ConfiguredDependency = new('color=darkgreen')
|
21
|
+
ConfiguredVisibileTo = new('color=blue')
|
22
|
+
ConfiguredNested = new('color=purple')
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
14
26
|
sig { params(options: Options, raw_config: T::Hash[String, T.untyped], packages: T::Array[ParsePackwerk::Package]).returns(String) }
|
15
27
|
def self.package_graph!(options, raw_config, packages)
|
16
28
|
all_packages = filtered(packages, options).compact.sort_by {|x| x.name }
|