diff options
Diffstat (limited to 'graphgraph-fe/src')
-rw-r--r-- | graphgraph-fe/src/GraphHops.js | 9 | ||||
-rw-r--r-- | graphgraph-fe/src/GraphSettings.js | 5 | ||||
-rw-r--r-- | graphgraph-fe/src/PopupSettings.js | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/graphgraph-fe/src/GraphHops.js b/graphgraph-fe/src/GraphHops.js index cd5763a..de7a4cc 100644 --- a/graphgraph-fe/src/GraphHops.js +++ b/graphgraph-fe/src/GraphHops.js @@ -50,7 +50,14 @@ class GraphHops extends React.Component { } render () { - // {createNumInput('cousin hops', this.onChangeCousin, this.state.cousinHops)} + if (this.props.edgeFilter === 'Edgerules'){ + return ( + <div className="hops-input"> + {createNumInput('edgerule hops', this.onChangeCousin, this.state.cousinHops)} + </div> + ) + } + return ( <div className="hops-input"> {createNumInput('parent hops', this.onChangeParent, this.state.parentHops)} diff --git a/graphgraph-fe/src/GraphSettings.js b/graphgraph-fe/src/GraphSettings.js index 0c036db..1e80da9 100644 --- a/graphgraph-fe/src/GraphSettings.js +++ b/graphgraph-fe/src/GraphSettings.js @@ -74,7 +74,7 @@ class GraphSettings extends React.Component { s['toNode'] = endNode s['graph'] = g s['edgeFilter'] = edgeFilter - s['showHops'] = endNode === 'none' && startNode !== 'none' && startNode !== 'all' && edgeFilter !== 'Edgerules' + s['showHops'] = endNode === 'none' && startNode !== 'none' && startNode !== 'all' s['enableDestinationNode'] = startNode !== 'none' && startNode !== 'all' this.setState(s) @@ -174,7 +174,6 @@ class GraphSettings extends React.Component { let edgeFilterItems = [ <MenuItem key='Edgerules' eventKey='Edgerules'>Edgerules</MenuItem>, <MenuItem key='Parents' eventKey='Parents'>Parent-child (OXM structure)</MenuItem>, - <MenuItem key='Both' eventKey='Both'>Both</MenuItem> ] return ( <div> @@ -211,7 +210,7 @@ class GraphSettings extends React.Component { </DropdownButton> </div> - <Popup isDisabled={!this.state.showHops} parentHops={this.state.hops.parents} childHops={this.state.hops.child} cousinHops={this.state.hops.cousin} updateHops={this.updateHops}/> + <Popup isDisabled={!this.state.showHops} edgeFilter={this.state.edgeFilter} parentHops={this.state.hops.parents} childHops={this.state.hops.child} cousinHops={this.state.hops.cousin} updateHops={this.updateHops}/> </div> </div> diff --git a/graphgraph-fe/src/PopupSettings.js b/graphgraph-fe/src/PopupSettings.js index a278bc8..cb8a533 100644 --- a/graphgraph-fe/src/PopupSettings.js +++ b/graphgraph-fe/src/PopupSettings.js @@ -9,7 +9,7 @@ class PopupMenu extends React.Component { <Popup trigger={<button className='settings-button' disabled={this.props.isDisabled}>Hops</button>} position="bottom right"> {close => ( <div> - <GraphHops parentHops={this.props.parentHops} childHops={this.props.childHops} cousinHops={this.props.cousinHops} updateHops={this.props.updateHops} /> + <GraphHops edgeFilter={this.props.edgeFilter} parentHops={this.props.parentHops} childHops={this.props.childHops} cousinHops={this.props.cousinHops} updateHops={this.props.updateHops} /> <button type="button" className="link-button, close" |