Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
e324ef5 to
707a414
Compare
| @@ -117,3 +110,17 @@ | |||
| x2=self._box.width, | |||
There was a problem hiding this comment.
| x2=self._box.width, | |
| x2=self.width, |
| self.height = height | ||
| self.elements: List[Union[SvgElement, SvgGroup]] = [] | ||
|
|
||
| def add_background(self): |
There was a problem hiding this comment.
In the current canvas definition.
We are force to have the following sequence:
- Elements creation
- Elements Placement
- Compute Canvas size
- Create Canvas
- Create Canvas background
- Add elements to Canvas
It's a little counter intuitive to "draw" first and paste into canvas after.
Why not :
- Create Canvas (0 size or random)
- Create and add elements to canvas
- Place elements
- Resize background
There was a problem hiding this comment.
Hm, I see.
If you agree though, I would like to first implement the complete SVG generation (with edges) before changing this. New abstractions may emerge so that the sequence may more intuitive or be more easily changed.
| self._outputs.translate(x=self._box.width) | ||
| self._title.set_position(x=self._box.width / 2.0) |
There was a problem hiding this comment.
| self._outputs.translate(x=self.width) | |
| self._title.set_position(x=self.width / 2.0) |
There was a problem hiding this comment.
Personally, I avoid using @property getters in the internal methods.
An internal method can have access to internal members and it removes an indirection layer.
Ex for
triangle1:Before:

After:
