src change
This commit is contained in:
parent
0de29f08c3
commit
edff033308
3 changed files with 4 additions and 4 deletions
|
|
@ -39,7 +39,6 @@ func NewGraph(ast *d2ast.Map) *Graph {
|
|||
Parent: nil,
|
||||
Children: make(map[string]*Object),
|
||||
}
|
||||
d.Root.Attributes.Direction.Value = "down"
|
||||
return d
|
||||
}
|
||||
|
||||
|
|
@ -445,9 +444,6 @@ func (obj *Object) newObject(id string) *Object {
|
|||
Label: Scalar{
|
||||
Value: idval,
|
||||
},
|
||||
Direction: Scalar{
|
||||
Value: "down",
|
||||
},
|
||||
},
|
||||
|
||||
Graph: obj.Graph,
|
||||
|
|
|
|||
|
|
@ -74,6 +74,8 @@ func Layout(ctx context.Context, d2graph *d2graph.Graph) (err error) {
|
|||
rootAttrs.rankdir = "RL"
|
||||
case "up":
|
||||
rootAttrs.rankdir = "BT"
|
||||
default:
|
||||
rootAttrs.rankdir = "TB"
|
||||
}
|
||||
configJS := setGraphAttrs(rootAttrs)
|
||||
if _, err := v8ctx.RunScript(configJS, "config.js"); err != nil {
|
||||
|
|
|
|||
|
|
@ -131,6 +131,8 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) {
|
|||
elkGraph.LayoutOptions.Direction = "RIGHT"
|
||||
case "left":
|
||||
elkGraph.LayoutOptions.Direction = "LEFT"
|
||||
default:
|
||||
elkGraph.LayoutOptions.Direction = "DOWN"
|
||||
}
|
||||
|
||||
elkNodes := make(map[*d2graph.Object]*ELKNode)
|
||||
|
|
|
|||
Loading…
Reference in a new issue