Closed pawamoy closed 3 months ago
Hey Timothée! Thanks, I've updated the README. But for me it works using unit_x
as the second argument to beside
:
- return smaller.above(smaller.beside(smaller).center_xy())
+ return smaller.above(smaller.beside(smaller, unit_x).center_xy())
This second argument to beside
specifies the direction on which to place the two objects next to each other. If direction
is unit_x
(that is, the vector (1, 0)) this means: place the second diagram horizontally next to the first one. The horizontal placement can also be achieved with the |
(__or__
) operator:
return smaller.above((smaller | smaller).center_xy())
I hope this is clearer.
Ah, right, I suppose unit_x
is imported from chalk
thanks to the wildcard import. That's what I was missing, thanks :)
And thanks for the update to the readme!
The sierpinski example is incomplete.
beside
takes a "direction", but I'm not sure what this is. The docs mention "unit_x" but this doesn't really help: https://chalk-diagrams.github.io/api/combinators/?h=beside#beside....gives
TypeError: beside() missing 1 required positional argument: 'direction'
.Any hint :relaxed:?