Eliav2 / react-xarrows

Draw arrows (or lines) between components in React!
https://codesandbox.io/embed/github/Eliav2/react-xarrows/tree/master/examples?fontsize=14&hidenavigation=1&theme=dark
MIT License
584 stars 75 forks source link

Render arrows with an optional offset #149

Closed herrKlein closed 2 years ago

herrKlein commented 2 years ago

I want to draw lines from the center of component to the center of another with a slight offset. It looks like offset is supported, but can't found out how

herrKlein commented 2 years ago

Closed cause nothing reading documentation too well.

<Xarrow start={'A'} end={'B'} color="green" endAnchor="middle" startAnchor={{ position: "middle", offset: { y: 20 } }} path='straight' showHead={false}/>
<Xarrow start={'A'} end={'B'} color="red" endAnchor="middle" startAnchor={{ position: "middle", offset: { y: 40 } }} path='straight' showHead={false}/>

offset is in X and Y and not in bottomness or rightness like I saw in the documentation here : https://www.npmjs.com/package/react-xarrows/v/1.6.1