Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d2b92b4c9a | ||
|
|
c8267730bf |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ag-grid-react-example",
|
"name": "ag-grid-react-example",
|
||||||
"version": "13.2.0",
|
"version": "13.3.0",
|
||||||
"description": "Example Reach applicaiton using ag-Grid.",
|
"description": "Example Reach applicaiton using ag-Grid.",
|
||||||
"main": "dist/ag-grid-react-example.js",
|
"main": "dist/ag-grid-react-example.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
@@ -58,9 +58,9 @@
|
|||||||
"typescript": "2.3.x"
|
"typescript": "2.3.x"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ag-grid": "13.2.x",
|
"ag-grid": "13.3.x",
|
||||||
"ag-grid-enterprise": "13.2.x",
|
"ag-grid-enterprise": "13.3.x",
|
||||||
"ag-grid-react": "13.2.x",
|
"ag-grid-react": "13.3.x",
|
||||||
"bootstrap": "3.3.7",
|
"bootstrap": "3.3.7",
|
||||||
"d3": "4.9.1",
|
"d3": "4.9.1",
|
||||||
"file-loader": "0.11.1",
|
"file-loader": "0.11.1",
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ class TopMoversGrid extends Component {
|
|||||||
cellRenderer: 'animateShowChange',
|
cellRenderer: 'animateShowChange',
|
||||||
cellClass: 'align-right',
|
cellClass: 'align-right',
|
||||||
sort: 'desc',
|
sort: 'desc',
|
||||||
cellFormatter(params) {
|
valueFormatter(params) {
|
||||||
return params.value.toFixed(2)
|
return params.value.toFixed(2)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,14 @@ import * as PropTypes from 'prop-types';
|
|||||||
|
|
||||||
export default class HorizontalBarComponent extends Component {
|
export default class HorizontalBarComponent extends Component {
|
||||||
|
|
||||||
|
constructor(props) {
|
||||||
|
super(props);
|
||||||
|
|
||||||
|
this.state = {
|
||||||
|
value: this.props.value
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let positiveChange = {
|
let positiveChange = {
|
||||||
fill: "green"
|
fill: "green"
|
||||||
@@ -19,7 +27,7 @@ export default class HorizontalBarComponent extends Component {
|
|||||||
textAlign: "right"
|
textAlign: "right"
|
||||||
};
|
};
|
||||||
|
|
||||||
let pctNetChange = this.props.value;
|
let pctNetChange = this.state.value;
|
||||||
let pctNetChangeBar = Math.min(Math.abs(pctNetChange) * 100, 100) / 2;
|
let pctNetChangeBar = Math.min(Math.abs(pctNetChange) * 100, 100) / 2;
|
||||||
|
|
||||||
let barWidth = `${pctNetChangeBar}%`;
|
let barWidth = `${pctNetChangeBar}%`;
|
||||||
@@ -36,6 +44,13 @@ export default class HorizontalBarComponent extends Component {
|
|||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
refresh(params) {
|
||||||
|
this.setState({
|
||||||
|
value: params.value
|
||||||
|
});
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
HorizontalBarComponent.propTypes = {
|
HorizontalBarComponent.propTypes = {
|
||||||
|
|||||||
Reference in New Issue
Block a user