You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -157,8 +149,6 @@ export default function StyledNodesTree() {
157
149
}
158
150
```
159
151
160
-
TODO: link to TreeProps page
161
-
162
152
> For more details on the `className` props for nodes, see the [TreeProps reference docs](https://bkrem.github.io/react-d3-tree/docs/interfaces/_tree_types_.treeprops.html).
163
153
164
154
<!-- For a full list of options of CSS properties that can be used for the default nodes, check the SVG circle [specification](TODO:) -->
@@ -236,121 +226,4 @@ npm start
236
226
-- TODO --
237
227
238
228
## License
239
-
MIT
240
-
241
-
----
242
-
243
-
## Keeping large trees responsive
244
-
Attempting to render large trees with animated transitions may cause significant input lag. This is due to limitations related to the way D3's `select().transition()` enqueues calls to `requestAnimationFrame`, discussed [here](https://github.com/bkrem/react-d3-tree/issues/41#issuecomment-338425414).
245
-
246
-
Until a custom debounce for expand/collapse has been implemented, **it is therefore recommended to set `props.transitionDuration` to `0` for large tree graphs** if you're experiencing responsiveness issues.
247
-
248
-
249
-
## External data sources
250
-
Statically hosted JSON or CSV files can be used as data sources via the additional `treeUtil` module.
For details regarding the `treeUtil` module, please check the module's [API docs](docs/util/util.md).
291
-
For examples of each data type that can be parsed with `treeUtil`, please check the [data source examples](docs/examples/data).
292
-
293
-
294
-
## Using foreignObjects
295
-
> ⚠️ Requires `allowForeignObjects` prop to be set due to limited browser support: [IE does not currently support `foreignObject` elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Element/foreignObject#Browser_compatibility).
296
-
297
-
> ⚠️ There is a [known bug in Safari](https://github.com/bkrem/react-d3-tree/issues/284) relating to the positioning of `foreignObject` elements. Please take this into account before opting in via `allowForeignObjects`.
298
-
299
-
The SVG spec's `foreignObject` element allows foreign XML content to be rendered into the SVG namespace, unlocking the ability to use regular React components for elements of the tree graph.
300
-
301
-
### `nodeLabelComponent`
302
-
The `nodeLabelComponent` prop provides a way to use a React component for each node's label. It accepts an object with the following signature:
303
-
```ts
304
-
{
305
-
render: ReactElement,
306
-
foreignObjectWrapper?:object
307
-
}
308
-
```
309
-
*`render` is the XML React-D3-Tree will use to render each node's label.
310
-
*`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).
311
-
312
-
**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.**
313
-
To override this behaviour for each attribute, specify `width` and/or `height` properties for your `foreignObjectWrapper`.
314
-
315
-
**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.**
316
-
317
-
#### Example
318
-
Assuming we have a React component `NodeLabel` and we want to avoid node's label overlapping with the node itself by moving its position along the Y-axis, we could implement `nodeLabelComponent` like so:
0 commit comments