nitc :: MPackageDot :: dot_cluster
# Recursively generate node and clusters for a mgroup
private fun dot_cluster(o: Writer, mgroup: MGroup)
do
# Open the cluster, if required
if mgroup.parent == null then
# is is a root group, so display the package
if package_group then
o.write("subgraph cluster_{mgroup.object_id} \{\nlabel=\"{mgroup.mpackage.name}\\n({mgroup.filepath or else "?"})\"\ncolor=black\nstyle=dotted\n")
end
else
if cluster_group then
o.write("subgraph cluster_{mgroup.object_id} \{\nlabel=\"{mgroup.name}\"\ncolor=blue\nstyle=dotted\n")
end
end
# outputs the mmodules to show
for mmodule in mgroup.mmodules do
if not mmodules.has(mmodule) then continue
o.write("\t{node_for(mmodule)} [label=\"{mmodule.name}\",color=green]\n")
end
# recursively progress on sub-clusters
for d in mgroup.in_nesting.direct_smallers do
dot_cluster(o, d)
end
# close the cluster if required
if mgroup.parent == null then
if package_group then o.write("\}\n")
else
if cluster_group then o.write("\}\n")
end
end
src/model/model_viz.nit:161,2--193,4