Skip to content

Commit ee92e68

Browse files
committed
Exposes circleRadius prop (#18)
1 parent 86e4db2 commit ee92e68

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

src/Node/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@ export default class Node extends React.Component {
114114
}
115115

116116
Node.defaultProps = {
117-
circleRadius: 10,
118117
textAnchor: 'start',
119118
attributes: undefined,
120119
};
@@ -130,6 +129,6 @@ Node.propTypes = {
130129
name: PropTypes.string.isRequired,
131130
attributes: PropTypes.object,
132131
textAnchor: PropTypes.string,
133-
circleRadius: PropTypes.number,
132+
circleRadius: PropTypes.number.isRequired,
134133
styles: PropTypes.object.isRequired,
135134
};

src/Node/tests/index.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ describe('<Node />', () => {
2222
orientation: 'horizontal',
2323
transitionDuration: 500,
2424
onClick: () => {},
25+
circleRadius: 10,
2526
styles: {},
2627
};
2728

src/Tree/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,7 @@ export default class Tree extends React.Component {
246246
pathFunc,
247247
transitionDuration,
248248
zoomable,
249+
circleRadius,
249250
styles,
250251
} = this.props;
251252

@@ -267,6 +268,7 @@ export default class Tree extends React.Component {
267268
name={nodeData.name}
268269
attributes={nodeData.attributes}
269270
onClick={this.handleNodeToggle}
271+
circleRadius={circleRadius}
270272
styles={styles.nodes}
271273
/>
272274
)}
@@ -300,6 +302,7 @@ Tree.defaultProps = {
300302
scaleExtent: { min: 0.1, max: 1 },
301303
nodeSize: { x: 140, y: 140 },
302304
separation: { siblings: 1, nonSiblings: 2 },
305+
circleRadius: 10,
303306
styles: {
304307
nodes: {
305308
node: {
@@ -348,6 +351,7 @@ Tree.propTypes = {
348351
siblings: PropTypes.number,
349352
nonSiblings: PropTypes.number,
350353
}),
354+
circleRadius: PropTypes.number,
351355
styles: PropTypes.shape({
352356
nodes: PropTypes.object,
353357
links: PropTypes.object,

0 commit comments

Comments
 (0)