Support vertical graph layouts

This commit is contained in:
jolo
2017-01-14 02:11:59 +01:00
parent 570835227b
commit 0e8ea6363a
3 changed files with 38 additions and 13 deletions
+8 -2
View File
@@ -11,15 +11,21 @@ import (
"os/exec"
)
// GET /api/graph.:ext
// GET /api/graph.:ext/:vertical
func apiGraph(c *gin.Context) {
var (
err error
output []byte
vertical bool = false
)
ext := c.Params.ByName("ext")
// TODO: api is untested!
if c.Params.ByName("vertical") == "vertical" {
vertical = true
}
factory := context.CollectionFactory()
factory.RemoteRepoCollection().RLock()
@@ -31,7 +37,7 @@ func apiGraph(c *gin.Context) {
factory.PublishedRepoCollection().RLock()
defer factory.PublishedRepoCollection().RUnlock()
graph, err := deb.BuildGraph(factory)
graph, err := deb.BuildGraph(factory, vertical)
if err != nil {
c.JSON(500, err)
return