Skip to content

Commit 031755b

Browse files
authored
Adds missing explanation of foreignObjectWrapper BASE_MARGIN (#120)
1 parent 9ea9c17 commit 031755b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ The `nodeLabelComponent` prop provides a way to use a React component for each n
284284
* `render` is the XML React-D3-Tree will use to render each node's label.
285285
* `foreignObjectWrapper` contains a set of attributes that should be passed to the `<foreignObject />` that wraps `nodeLabelComponent`. For possible attributes please check the [spec](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject#Global_attributes).
286286

287-
**Note: `foreignObjectWrapper` will set its width and height attributes to whatever values `nodeSize.x` and `nodeSize.y` return by default.**
287+
**Note: By default, `foreignObjectWrapper` will set its width and height attributes to `nodeSize.x - 24px` and `nodeSize.y - 24px` respectively; where a base margin of 24px is subtracted to avoid the overlapping of elements.**
288288
To override this behaviour for each attribute, specify `width` and/or `height` properties for your `foreignObjectWrapper`.
289289

290290
**Note:** The ReactElement passed to `render` is cloned with its existing props and **receives an additional `nodeData` object prop, containing information about the current node.**

0 commit comments

Comments
 (0)