Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

specify rows/cols #983

Closed
alixander opened this issue Mar 6, 2023 · 4 comments · Fixed by #1122
Closed

specify rows/cols #983

alixander opened this issue Mar 6, 2023 · 4 comments · Fixed by #1122
Assignees

Comments

@alixander
Copy link
Collaborator

alixander commented Mar 6, 2023

we should be able to specify arrangement of shapes per container, which could work no matter the layout engine.

e.g. a rows and columns keyword. we make these in a step before the main layout engines, replace it with a placeholder node of given dimensions, and then swap back in the real nodes after

Screen Shot 2023-03-06 at 7 48 11 AM

source: https://github.com/gravitational/teleport

the only thing is that it wouldn't work if something in that container was connected (unless it's TALA). we have to make it a constraint that anything using these keywords are just composed of unconnected children

@cyborg-ts cyborg-ts added this to D2 Mar 6, 2023
@bo-ku-ra
Copy link
Contributor

bo-ku-ra commented Mar 6, 2023

It's nice (#920 (comment))

ex. (v0.2.3)

x->y
x->z

y:""{
 #x
  shape:image
  icon:a.svg
}

z:""{
 #x
  shape:image
  icon:b.svg
}

layers{
 a{
 style{
 stroke:red
 stroke-width:2
 }
 direction:down
 y->z
 }
 b{
 style{
 stroke:red
 stroke-width:2
 }
 direction:right
 y->z
 }
}

image

@gavin-ts gavin-ts self-assigned this Mar 31, 2023
@alixander
Copy link
Collaborator Author

another example of what can be done with this

Screen Shot 2023-03-31 at 4 01 14 PM

@gavin-ts
Copy link
Contributor

so it is just the inner grids here and not the outer deployment rows right? no recursive grids (at least for now) right?

@alixander
Copy link
Collaborator Author

ooo what if the children of grid containers can specify how many cols/rows they occupy. allowing for diagrams like

Screen Shot 2023-04-01 at 3 15 01 PM

https://twitter.com/solomonstre/status/1641938062816210944

e.g.

container: {
  cols: 3
  # This would take up 100% width
  hey: { cols: 3 }
  # These three would take up 33% of width
  one; two; three
}

@github-project-automation github-project-automation bot moved this to Done in D2 Apr 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants