Link label is not positioned correctly #420
Labels
Comments
|
Hi @facultymatt , Thank you for reporting this issue. Both your solutions seem to work. Would you like to submit a PR implementing your solution? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Describe the bug
On the link component
textAnchoris used as a style property like so:<text style={{ textAnchor: "middle" }} {...textProps}>buttextPropscontainsstyleand thus overwrites thestyleproperty fortextAnchor.react-d3-graph/src/components/link/Link.jsx
Lines 96 to 103 in 0ac8c47
Here
stylegets overwritten bytextProps.stylereact-d3-graph/src/components/link/Link.jsx
Line 109 in 0ac8c47
There are two ways to make this work as expected, one is to use
text-anchoras an attr. See the docs here: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/text-anchorSecond is to include it in the style object above, so you'd have
To Reproduce
Steps to reproduce the behavior:
renderLabeland changelabelPropertytosourceExpected behavior
Expected the label to be centered. Its not because the style usage of
textAnchoris ignored.Screenshots
Image showing the settings to change
Image showing the labels not centered

Environment:
Additional context
None
The text was updated successfully, but these errors were encountered: