Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Update code to match latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
seanlandsman committed Sep 28, 2017
1 parent 3992e3e commit c826773
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src-trader-dashboard/components/TopMoversGrid.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class TopMoversGrid extends Component {
cellRenderer: 'animateShowChange',
cellClass: 'align-right',
sort: 'desc',
cellFormatter(params) {
valueFormatter(params) {
return params.value.toFixed(2)
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@ import * as PropTypes from 'prop-types';

export default class HorizontalBarComponent extends Component {

constructor(props) {
super(props);

this.state = {
value: this.props.value
}
}

render() {
let positiveChange = {
fill: "green"
Expand All @@ -19,7 +27,7 @@ export default class HorizontalBarComponent extends Component {
textAlign: "right"
};

let pctNetChange = this.props.value;
let pctNetChange = this.state.value;
let pctNetChangeBar = Math.min(Math.abs(pctNetChange) * 100, 100) / 2;

let barWidth = `${pctNetChangeBar}%`;
Expand All @@ -36,6 +44,13 @@ export default class HorizontalBarComponent extends Component {
</div>
)
}

refresh(params) {
this.setState({
value: params.value
});
return true;
}
}

HorizontalBarComponent.propTypes = {
Expand Down

0 comments on commit c826773

Please sign in to comment.