This commit is contained in:
Gavin Nishizawa 2023-09-18 16:41:46 -07:00
parent b7791c83ea
commit 37351436a4
No known key found for this signature in database
GPG key ID: AE3B177777CE55CD
2 changed files with 36 additions and 34 deletions

View file

@ -171,7 +171,7 @@ func NestedGraphInfo(obj *d2graph.Object) (gi GraphInfo) {
func ExtractSelf(container *d2graph.Object) *d2graph.Graph {
nestedGraph := d2graph.NewGraph()
nestedGraph.RootLevel = int(container.Level()) - 1
// nestedGraph.Root.Box = &geo.Box{}
nestedGraph.Root.Box = &geo.Box{}
// separate out nested edges
g := container.Graph
@ -217,6 +217,7 @@ func ExtractSelf(container *d2graph.Object) *d2graph.Graph {
func ExtractDescendants(container *d2graph.Object) *d2graph.Graph {
nestedGraph := d2graph.NewGraph()
nestedGraph.RootLevel = int(container.Level())
nestedGraph.Root.Attributes = container.Attributes
nestedGraph.Root.Box = &geo.Box{}
// separate out nested edges

View file

@ -1,47 +1,48 @@
a
b
c
# b
# c
a: {
grid-rows: 3
1
2
3: {
shape: sequence_diagram
x
y
# TODO x -> y
}
3
# 3: {
# shape: sequence_diagram
# x
# y
# # TODO x -> y
# }
near: top-right
}
b: {
shape: sequence_diagram
1 -> 2
# b: {
# shape: sequence_diagram
# 1 -> 2
# TODO This should work
near: bottom-right
#
# # TODO This should work
# near: bottom-right
# #
2: {
# TODO compile error grid on sequence actor
# grid-rows: 3
x
y
z
}
# 2: {
# # TODO compile error grid on sequence actor
# # grid-rows: 3
# x
# y
# z
# }
1: {
x: {
# TODO compile error grid in sequence (anywhere)
# grid-rows: 3
u
v
w
}
y
z
}
}
# 1: {
# x: {
# # TODO compile error grid in sequence (anywhere)
# # grid-rows: 3
# u
# v
# w
# }
# y
# z
# }
# }