-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
88958ed
commit 468be8d
Showing
6 changed files
with
170 additions
and
1 deletion.
There are no files selected for viewing
109 changes: 109 additions & 0 deletions
109
.../StatisticalPlatform/client/components/Dashboard/NavBar/Clustering/DensityClusterModal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
import React, {Component} from 'react'; | ||
import {Button, Modal, Checkbox, FormGroup, ControlLabel, FormControl, FieldGroup} from 'react-bootstrap'; | ||
import NumericInput from 'react-numeric-input'; | ||
|
||
class DensityClusterModal extends Component { | ||
constructor(props) { | ||
super(props); | ||
this.state = { | ||
showResults: false, | ||
show: false | ||
}; | ||
} | ||
|
||
handleClose = () => { | ||
this.setState({ show: false }); | ||
} | ||
|
||
onClick = () => { | ||
this.setState({ showResults: true }); | ||
} | ||
|
||
handleClick = () => { | ||
this.props.onClose({showDensityCluster: false}); | ||
this.props.onClick( | ||
this, | ||
this.first.value, | ||
this.second.value, | ||
this.minpts.value, | ||
this.eps.value | ||
); | ||
} | ||
|
||
|
||
render() { | ||
|
||
const options_list = []; | ||
let inst = null; | ||
const bold_style = {'fontSize': '15', 'fontWeight': 'bold'}; | ||
|
||
if (!this.state.showResults) { | ||
inst = <Button onClick={this.onClick}>i</Button> | ||
} | ||
else { | ||
inst = <p style = {bold_style}>Description:</p>; | ||
} | ||
|
||
this.props.variables.forEach( (variable) => { | ||
options_list.push(<option value={variable}>{variable}</option>); | ||
}); | ||
|
||
return( | ||
<div className="modal-container"> | ||
<Modal.Header > | ||
<Modal.Title id="contained-modal-title"> | ||
Choose Data | ||
</Modal.Title> | ||
</Modal.Header> | ||
<Modal.Body> | ||
<form> | ||
<FormGroup controlId="formControlsSelect"> | ||
<ControlLabel>Variable - X</ControlLabel> | ||
<FormControl componentClass="select" placeholder="select" inputRef={ref => { this.first = ref; }}> | ||
{options_list} | ||
</FormControl> | ||
<br/> | ||
<ControlLabel>Variable - Y</ControlLabel> | ||
<FormControl componentClass="select" placeholder="select" inputRef={ref => { this.second = ref; }}> | ||
{options_list} | ||
</FormControl> | ||
<br/> | ||
<ControlLabel>Minimum Points</ControlLabel> | ||
<input type="number" min={ 0 } className="form-control" ref={ref => this.minpts = ref } /> | ||
<ControlLabel>Epsilon</ControlLabel> | ||
<input type="number" min={ 0 } className="form-control" ref={ref => this.eps = ref } /> | ||
</FormGroup> | ||
</form> | ||
{inst} | ||
{ this.state.showResults ? <DensityClusteringInstruction/> : null } | ||
</Modal.Body> | ||
<Modal.Footer> | ||
<Button onClick={()=>{this.props.onClose({showDensityCluster: false})}}>Close</Button> | ||
<Button bsStyle= "success" onClick={this.handleClick} type="submit">Submit</Button> | ||
</Modal.Footer> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
|
||
class DensityClusteringInstruction extends Component { | ||
render() { | ||
const style = {'fontFamily': 'DROID SANS MONO'}; | ||
return( | ||
<div id="results" className="search-results"> | ||
<p>{'Select two columns and value i.e. number of clusters.'}</p> | ||
<table style = {style}> | ||
<tr> | ||
<td>{'library(ggplot2)'}</td> | ||
</tr> | ||
<tr> | ||
<td>{'ggplot(data, aes(var_x, var_y, color = Species)) + geom_point()'}</td> | ||
</tr> | ||
</table> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
export default DensityClusterModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,3 +76,7 @@ | |
.MainPage{ | ||
color: #f40035; | ||
} | ||
|
||
#plotdiv { | ||
height: 400px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
{"status":"done","publicPath":"http://localhost:3000/assets/bundles/","chunks":{"main":[{"name":"main-3accb65f3987805f6c75.js","publicPath":"http://localhost:3000/assets/bundles/main-3accb65f3987805f6c75.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main-3accb65f3987805f6c75.js"}]}} | ||
{"status":"done","publicPath":"http://localhost:3000/assets/bundles/","chunks":{"main":[{"name":"main-03019aa429c716151a74.js","publicPath":"http://localhost:3000/assets/bundles/main-03019aa429c716151a74.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main-03019aa429c716151a74.js"},{"name":"main.ab1cbde6ee011df9e83a.hot-update.js","publicPath":"http://localhost:3000/assets/bundles/main.ab1cbde6ee011df9e83a.hot-update.js","path":"/home/tejasav/Desktop/StatisticalPlatform/StatisticalPlatform/StatisticalPlatform/static/js/bundle/main.ab1cbde6ee011df9e83a.hot-update.js"}]}} |