nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
emscripten: add general features to lib
[nit.git]
/
src
/
model_viz.nit
diff --git
a/src/model_viz.nit
b/src/model_viz.nit
index
270f830
..
2d0d9bb
100644
(file)
--- a/
src/model_viz.nit
+++ b/
src/model_viz.nit
@@
-39,7
+39,7
@@
class MProjectTree
end
end
end
end
- var linex_comparator: nullable LinexComparator = null
+ private var linex_comparator: nullable LinexComparator = null
# Sort modules and groups with their names
fun sort_with_alpha
# Sort modules and groups with their names
fun sort_with_alpha
@@
-135,6
+135,8
@@
end
# Interessing elements must be selected. See `mmodules`, ``
# Display configuration can be set. See `cluster_group`, `project_group`
class MProjectDot
# Interessing elements must be selected. See `mmodules`, ``
# Display configuration can be set. See `cluster_group`, `project_group`
class MProjectDot
+ super Streamable
+
# The model where to look for information
var model: Model
# The model where to look for information
var model: Model
@@
-210,8
+212,8
@@
class MProjectDot
end
end
end
end
- # Generate the dot-file named `filepath` with the current configuration
- fun render(filepath: String)
+ # Generate the dot content with the current configuration
+ redef fun write_to(stream)
do
# Collect interessing nodes
for m in model.mmodules do
do
# Collect interessing nodes
for m in model.mmodules do
@@
-235,13
+237,11
@@
class MProjectDot
end
end
end
end
- print "generating {filepath}"
- var dot = new OFStream.open(filepath)
- dot.write("digraph g \{\n")
- dot.write("rankdir=BT;node[shape=box];\n")
+ stream.write("digraph g \{\n")
+ stream.write("rankdir=BT;node[shape=box];\n")
# Generate the nodes
for p in model.mprojects do
# Generate the nodes
for p in model.mprojects do
- dot_cluster(dot, p.root.as(not null))
+ dot_cluster(stream, p.root.as(not null))
end
# Generate the edges
for m in mmodules do
end
# Generate the edges
for m in mmodules do
@@
-249,14
+249,12
@@
class MProjectDot
var nm = node_for(m)
var nsm = node_for(sm)
if m.in_importation.direct_greaters.has(sm) then
var nm = node_for(m)
var nsm = node_for(sm)
if m.in_importation.direct_greaters.has(sm) then
- dot.write("\t{nm} -> {nsm}[style=bold]\n")
+ stream.write("\t{nm} -> {nsm}[style=bold]\n")
else
else
- dot.write("\t{nm} -> {nsm}[style=solid]\n")
+ stream.write("\t{nm} -> {nsm}[style=solid]\n")
end
end
end
end
end
end
- dot.write("\}\n")
- dot.close
- # sys.system("xdot -f dot {filepath}")
+ stream.write("\}\n")
end
end
end
end