<!-- Answer -->
The issue you're encountering with the alignment and size discrepancies between triangles and other shapes like circles and squares in G6 seems to stem from how G6 calculates the center point and dimensions of these shapes. Each shape's center and size are determined by its SVG path and the specific commands used to draw it. For example, a circle's center is at its starting point, defined by the 'M' (move to) command, while a triangle's center can be inferred as the centroid of the points used to draw it.
It's important to note that the size
attribute behaves differently based on the input provided (single number or an array of numbers), affecting the rendered size of the shapes. However, there doesn't appear to be a known issue or change in G6's handling of shape sizes and alignment from version 4.3.11 to the latest versions that would directly cause the discrepancies you're seeing.
If updating to the latest version of G6 does not resolve the issue, it might be indicative of a bug or an undocumented feature. In such cases, reporting this to the G6 repository could help address the problem more directly.
Understanding how G6 interprets the size
attribute and calculates the center points based on the SVG path commands might offer some insight into the behavior you're observing and assist in adjusting your shapes for better alignment.
Sources
<!-- Dosu Comment Footer -->
<details>
<summary>
About Dosu
</summary>
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research.
Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant.
If you want to continue the conversation, start your reply with @dosu-bot.
</details>