]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.graphviz/scl/Visualization/ModuleDependencyGraph.scl
Migrated source code from Simantics SVN
[simantics/platform.git] / bundles / org.simantics.graphviz / scl / Visualization / ModuleDependencyGraph.scl
diff --git a/bundles/org.simantics.graphviz/scl/Visualization/ModuleDependencyGraph.scl b/bundles/org.simantics.graphviz/scl/Visualization/ModuleDependencyGraph.scl
new file mode 100644 (file)
index 0000000..ff73c5a
--- /dev/null
@@ -0,0 +1,12 @@
+import "Reflection" (moduleDependencyGraph)\r
+import "Visualization/GGraph"\r
+\r
+showModuleDependencyGraph :: <Proc> ()\r
+showModuleDependencyGraph = do\r
+    graph = newGGraph [Rankdir "LR"] $ \r -> [Label r, Shape "rect"]\r
+    for moduleDependencyGraph $ \(moduleName, deps) ->\r
+        for (filter interestingDependency deps) $ \(depModuleName, localName, importSpec) ->\r
+            newGEdge graph moduleName depModuleName []\r
+    showGGraph graph\r
+  where\r
+    interestingDependency (moduleName, localName, importSpec) = not (startsWith moduleName "http:") && localName != Nothing
\ No newline at end of file