Skip to content

Wire arrowhead parameters defaults #12

@reinago

Description

@reinago

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions