Skip to content

Commit 66682ad

Browse files
committed
Query artifact build level dependencies for graph visualization with GraphViz
1 parent f067d5f commit 66682ad

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
MATCH (:Artifact:Archive)-[dependencyForStatistics:DEPENDS_ON]->(:Artifact:Archive)
2+
WITH min(dependencyForStatistics.weight) AS minWeight
3+
,max(dependencyForStatistics.weight) AS maxWeight
4+
MATCH (source:Artifact:Archive)
5+
OPTIONAL MATCH (source)-[dependency:DEPENDS_ON]->(target:Artifact:Archive)
6+
//RETURN a, b, d
7+
WITH *, toFloat(dependency.weight - minWeight) / toFloat(maxWeight - minWeight) AS normalizedWeight
8+
WITH *, round((normalizedWeight * 5) + 1, 2) AS penWidth
9+
WITH *, source.name + '\\n(level ' + source.maxDistanceFromSource + ')' AS fullSourceName
10+
WITH *, target.name + '\\n(level ' + target.maxDistanceFromSource + ')' AS fullTargetName
11+
WITH *, "\" -> \"" + fullTargetName
12+
+ "\" [label = " + dependency.weight + ";"
13+
+ " penwidth = " + penWidth + ";"
14+
+ " ];" AS graphVizDotNotationEdge
15+
WITH *, "\"" + fullSourceName + coalesce(graphVizDotNotationEdge, "\" [];") AS graphVizDotNotationLine
16+
RETURN graphVizDotNotationLine
17+
//Debugging
18+
//,source.name AS sourceName
19+
//,target.name AS targetName
20+
//,penWidth
21+
//,normalizedWeight
22+
//,dependency.weight AS weight
23+
//,minWeight
24+
//,maxWeight

0 commit comments

Comments
 (0)