diff --git a/demo/src/App.js b/demo/src/App.js index 657a5d64..782471c7 100644 --- a/demo/src/App.js +++ b/demo/src/App.js @@ -90,6 +90,7 @@ class App extends Component { initialDepth: 1, depthFactor: undefined, zoomable: true, + draggable: true, zoom: 1, scaleExtent: { min: 0.1, max: 1 }, separation: { siblings: 2, nonSiblings: 2 }, @@ -127,6 +128,7 @@ class App extends Component { this.handleFloatChange = this.handleFloatChange.bind(this); this.toggleCollapsible = this.toggleCollapsible.bind(this); this.toggleZoomable = this.toggleZoomable.bind(this); + this.toggleDraggable = this.toggleDraggable.bind(this); this.toggleCenterNodes = this.toggleCenterNodes.bind(this); this.setScaleExtent = this.setScaleExtent.bind(this); this.setSeparation = this.setSeparation.bind(this); @@ -203,6 +205,10 @@ class App extends Component { this.setState(prevState => ({ zoomable: !prevState.zoomable })); } + toggleDraggable() { + this.setState(prevState => ({ draggable: !prevState.draggable })); + } + toggleCenterNodes() { if (this.state.dimensions !== undefined) { this.setState({ @@ -414,6 +420,15 @@ class App extends Component { /> +
dimensions
prop)
@@ -662,6 +677,7 @@ class App extends Component {
collapsible={this.state.collapsible}
initialDepth={this.state.initialDepth}
zoomable={this.state.zoomable}
+ draggable={this.state.draggable}
zoom={this.state.zoom}
scaleExtent={this.state.scaleExtent}
nodeSize={this.state.nodeSize}
diff --git a/src/Tree/index.tsx b/src/Tree/index.tsx
index 2e14dc28..8e7f538e 100644
--- a/src/Tree/index.tsx
+++ b/src/Tree/index.tsx
@@ -39,6 +39,7 @@ class Tree extends React.Component