-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make node.size accept both height and width #336
Comments
I don't think it would be a good idea to change the An alternative would be to allow clients to specify the // ...
node: {
viewGenerator: () => /*your component to render in the node*/
viewWidth: 200, // numerical value representative of px
viewHeight: 100 // numerical value representative of px
//... |
@Aslug please use the issue templates next time you submit a feature request/bug fix. Thanks! |
Released in react-d3-graph 2.5.0. |
The
node.size
parameter takes anumber
and uses it to define a square area where the returnedJSX.Element
ofviewGenerator
is rendered.The problem is that if the element I want to render is not a square there will be some invisible leftover space around it that could be (wrongly) used to drag the node: i may wont to draw a 200x100 rectangle, but the draggable area would be 200x200 anyway.
Also I found by trial and error that the unit of measure is
px/10
: the node size must be2000
to be able to render correctly a JSX.Element with width 200px. This is not obvious and not described in the documentation.It would be useful to be able to define both
width
andheigh
of the node area.The text was updated successfully, but these errors were encountered: