react-hierarchy-tree-graph
Version:
React component to create interactive D3 tree hierarchies
167 lines (88 loc) • 1.81 kB
Markdown
`Tree` (component)
==================
Props
-----
### `allowForeignObjects`
type: `bool`
defaultValue: `false`
### `circleRadius`
type: `number`
defaultValue: `undefined`
### `collapsible`
type: `bool`
defaultValue: `true`
### `data` (required)
type: `union(array|object)`
### `depthFactor`
type: `number`
defaultValue: `undefined`
### `initialDepth`
type: `number`
defaultValue: `undefined`
### `nodeLabelComponent`
type: `object`
defaultValue: `null`
### `nodeSize`
type: `shape[object Object]`
defaultValue: `{ x: 140, y: 140 }`
### `nodeSvgShape`
type: `shape[object Object]`
defaultValue: `{
shape: 'circle',
shapeProps: {
r: 10,
},
}`
### `onClick`
type: `func`
defaultValue: `undefined`
### `onMouseOut`
type: `func`
defaultValue: `undefined`
### `onMouseOver`
type: `func`
defaultValue: `undefined`
### `onUpdate`
type: `func`
defaultValue: `undefined`
### `orientation`
type: `enum('horizontal'|'vertical')`
defaultValue: `'horizontal'`
### `pathFunc`
type: `union(enum|func)`
defaultValue: `'diagonal'`
### `scaleExtent`
type: `shape[object Object]`
defaultValue: `{ min: 0.1, max: 1 }`
### `separation`
type: `shape[object Object]`
defaultValue: `{ siblings: 1, nonSiblings: 2 }`
### `shouldCollapseNeighborNodes`
type: `bool`
defaultValue: `false`
### `styles`
type: `shape[object Object]`
defaultValue: `{}`
### `textLayout`
type: `object`
defaultValue: `{
textAnchor: 'start',
x: 10,
y: -10,
transform: undefined,
}`
### `transitionDuration`
type: `number`
defaultValue: `500`
### `translate`
type: `shape[object Object]`
defaultValue: `{ x: 0, y: 0 }`
### `useCollapseData`
type: `bool`
defaultValue: `false`
### `zoom`
type: `number`
defaultValue: `1`
### `zoomable`
type: `bool`
defaultValue: `true`