react-node-graph
react-node-graph copied to clipboard
Style dependent position calculations
Hello,
are you going to update position calculations to be independent on style, or maybe configurable with props?
I guess those are the options - I'd prefer to not pass props. Do you think its safe to calculate using dom methods (e.g. getBoundingClientRect)? I'll take a shot or you can send me a PR, the example should suffice for validation.
I think it is safe, but we will lose server side rendering suppor If we will use them. I think best option would be to use inline styles and allow to pass custom style prop. Then we can use properties like width, padding and line height from style object in calculations and also it can be changed with passed style
agreed