Skip to content

Commit c0c661c

Browse files
committed
Adds "Large trees" section in docs (#160)
1 parent 6fa29aa commit c0c661c

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
React D3 Tree is a [React](http://facebook.github.io/react/) component that lets you represent hierarchical data (e.g. ancestor trees, organisational structure, package dependencies) as an animated & interactive tree graph by leveraging [D3](https://d3js.org/)'s `tree` layout.
1111

1212

13-
## Contents
14-
- [Contents](#contents)
13+
## Contents <!-- omit in toc -->
1514
- [Demo](#demo)
1615
- [Installation](#installation)
1716
- [Usage](#usage)
@@ -21,6 +20,7 @@ React D3 Tree is a [React](http://facebook.github.io/react/) component that lets
2120
- [Individual `shapeProps`](#individual-shapeprops)
2221
- [Styling](#styling)
2322
- [Pre-defining a node's `_collapsed` state](#pre-defining-a-nodes-_collapsed-state)
23+
- [Keeping large trees responsive](#keeping-large-trees-responsive)
2424
- [External data sources](#external-data-sources)
2525
- [Example](#example)
2626
- [Using foreignObjects](#using-foreignobjects)
@@ -280,6 +280,13 @@ Clarifications:
280280

281281
> **Note:** `props.useCollapseData` and `props.initialDepth` are mutually exclusive. If `useCollapseData` is set, `initialDepth` values will be ignored.
282282
283+
284+
## Keeping large trees responsive
285+
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).
286+
287+
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.
288+
289+
283290
## External data sources
284291
Statically hosted JSON or CSV files can be used as data sources via the additional `treeUtil` module.
285292

0 commit comments

Comments
 (0)