Skip to content

Commit

Permalink
Merge pull request #814 from cggh/813
Browse files Browse the repository at this point in the history
Disable limit if subsampling genotype rows
  • Loading branch information
leehart authored Feb 9, 2017
2 parents f3f1f65 + 87378ab commit 6137442
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -270,18 +270,15 @@ let GenotypesChannel = React.createClass({
colOrder: columnTableConfig.position,
rowQry: rowQuery,
rowOrder: rowSort,
rowOffset: page * pageSize,
rowLimit: (page + 1) * pageSize,
rowRandomSample: rowRandomSubsetSize,
rowOffset: rowRandomSubsetSize ? undefined : page * pageSize,
rowLimit: rowRandomSubsetSize ? undefined : (page + 1) * pageSize,
colProperties: colProperties.join('~'),
rowProperties: rowProperties.join('~'),
'2DProperties': twoDProperties.join('~'),
colOnlyOnLimit: true
};

if (rowRandomSubsetSize !== undefined) {
APIargs.rowRandomSample = rowRandomSubsetSize;
}

let cacheArgs = {
method: 'twoDPageQuery',
regionField: columnTableConfig.position,
Expand Down Expand Up @@ -684,10 +681,10 @@ const GenotypesControls = React.createClass({
</div>
<div className="control-group">
<div className="control">
<NumericInput debounce width={5} label="Page size" value={pageSize} onChange={(pageSize) => this.redirectedProps.setProps({pageSize})}/>
<NumericInput debounce disabled={!!rowRandomSubsetSize} width={5} label="Page size" value={pageSize} onChange={(pageSize) => this.redirectedProps.setProps({pageSize})}/>
</div>
<div className="control">
<NumericInput debounce width={3} label="Page" value={page} onChange={(page) => this.redirectedProps.setProps({page})}/>
<NumericInput debounce disabled={!!rowRandomSubsetSize} width={3} label="Page" value={page} onChange={(page) => this.redirectedProps.setProps({page})}/>
</div>
</div>
<div className="control-group">
Expand Down
7 changes: 5 additions & 2 deletions webapp/src/js/components/ui/NumericInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ let NumericInput = React.createClass({
label: React.PropTypes.string,
value: React.PropTypes.number,
debounce: React.PropTypes.bool,
disabled: React.PropTypes.bool,
onChange: React.PropTypes.func.isRequired
},

getDefaultProps() {
return {
width: 6,
debounce: false
debounce: false,
disabled: false
}
},

Expand Down Expand Up @@ -63,10 +65,11 @@ let NumericInput = React.createClass({
},

render() {
let {label, width} = this.props;
let {label, width, disabled} = this.props;
let {error, value} = this.state;
return (
<TextField
disabled={disabled}
type="number"
style={{width: `${width * 30}px`}}
ref={(node) => this.textField = node}
Expand Down

0 comments on commit 6137442

Please sign in to comment.