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

Wire arrowhead parameters defaults #12

Open
reinago opened this issue Jul 30, 2024 · 0 comments
Open

Wire arrowhead parameters defaults #12

reinago opened this issue Jul 30, 2024 · 0 comments

Comments

@reinago
Copy link

reinago commented Jul 30, 2024

Hi,

I just discovered this library and found it quite neat for drawing flow charts. I now have a chart where multiple boxes join in a subsequent one. I chose one of them to form the backbone and just attached the second "from the side":

result:
image

with Drawing() as d:
    width = 5.5
    height = 1
    arrowlen = d.unit / 4
    data_bg = "#ccecff"
    process_bg = "#ffbfbf"

    d.config(font="sans", lw=2)
    flow.Box.defaults["fill"] = data_bg
    flow.Box.defaults["w"] = width
    flow.Box.defaults["h"] = height
    flow.Box.defaults["minsize"] = (width, height)
    flow.RoundBox.defaults["fill"] = process_bg
    flow.RoundBox.defaults["w"] = width
    flow.RoundBox.defaults["h"] = height
    flow.RoundBox.defaults["minsize"] = (width, height)
    flow.Arrow.defaults["arrowwidth"] = 0.3
    flow.Arrow.defaults["arrowlength"] = 0.3

    # print(flow.Box.defaults)
    db = flow.Box().label("first").drop("S")
    flow.Arrow().down(arrowlen)
    aq = flow.RoundBox().label("second")

    flow.Box().at(db.W, -3.5, height/2).label("side")
    flow.Line().down(arrowlen + height / 2)
    flow.Wire(arrow="->").to(aq.W)

This is exactly what I want (layout-wise). However, the Wire I use to make the elbow connection seems to spawn some Segments internally that do not care about the changed arrowwidth/length defaults, so the arrowheads have different size. I can work around this by just chaining an Arrow to the respective anchor of aq, but where should the default go for this to work? Is this a bug or intentional?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant