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

elk: postprocess to balance bends #1791

Open
alixander opened this issue Dec 25, 2023 · 0 comments
Open

elk: postprocess to balance bends #1791

alixander opened this issue Dec 25, 2023 · 0 comments

Comments

@alixander
Copy link
Collaborator

We can postprocess ELK layouts to make the bends in the middle of routes to look nicer.

Screen Shot 2023-12-25 at 1 09 48 PM
style: {
  fill: transparent
}
*.style: {
  fill: transparent
  stroke: black
}

# How to apply stroke color to all connections?
# * -> *.style: {
#   stroke: black
# }

# This will override terminator class styling.
# *: {
#   height: 100
#   width: 150
# }

classes: {
  terminator: {
    # label: ""
    height: 50
    width: 150
    style: {
      border-radius: 1000
    }
  }
  process: {
    height: 100
    width: 150
  }
  input: {
    height: 100
    width: 150
    shape: parallelogram
  }
  condition: {
    height: 100
    width: 150
    shape: diamond
  }
  loop: {
    height: 100
    width: 150
    shape: hexagon
  }
}

start1 -> data -> condition1

true: from diamond's\n right corner
false: from diamond's\n left corner

condition1 -> false: no
condition1 -> true: yes

false -> end1
true -> end1

start2 -> loop1 -> process1
process1 -> loop1: continue
loop1 -> end2: break

start1.class: terminator
start2.class: terminator
end1.class: terminator
end2.class: terminator
process1: inside loop
process1.class: process

data.class: input

loop1: i = 0(1)n
loop1.class: loop

condition1
condition1.class: condition

https://play.d2lang.com/?script=lJPBitswEIbv8xQ_m0PbhQ32wl4Eba99gB57UexJLKJozEhpGkrevUi2vGYbSjcQohn9880vjRLT1bPBbwL2znuDpDbE0SqHRDd63P5TAMSkcmSDnbfdkW5EG3yTC5LAjqO_zvvoxIuWrPfoJATukpMQv9IGj3j6glWjDd5iNyjg74OLuDjvIT9Z1fWMxHpywSZRdN7GiExx4bDN3Aob2B2GZNA2TYkvrk-DQfvSTORSyXE65CtxioENvN2xN3h4KHHFvTQlXNFQnC_3lT870Z71SW3vzrFYmGQ3mr6jSscx1oK11b_gWe_CeE7_pQbiYEc2GK1a79nLQe1pxnQSepcn8D5U7-xJQj9DvMj4vvqBf9mDhFJ_I4rJamrz-HubbP5dfLVESc9ssFc51b4f4o8AzY3QiQZW2lsf74k87xcNvUJzi7kkyJv81O7KkSZqznHo2-JjCSbPzznOxy-V8wxbqotl1-QDJRfOTIuaQ_9ssFO2x3oD2_ICzertzW3ubGQX99P31NWRgQsx_2GyjSVbC-aYKI-hJstLI5rP4fAZzcf2U5gSVVRwq4tcLatkydCfAAAA__8%3D&layout=elk&

@cyborg-ts cyborg-ts added this to D2 Dec 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: No status
Development

No branches or pull requests

1 participant