Skip to content

Commit

Permalink
Merge pull request #60 from nuagenetworks/bug/sorting-clustering
Browse files Browse the repository at this point in the history
[bug]: fix sorting and clustering issue
  • Loading branch information
natabal authored Oct 31, 2018
2 parents eb93ee2 + 4ed20fa commit eccc2f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Graphs/GeoMap/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class GeoMap extends AbstractGraph {
<MarkerClusterer
ignoreHidden={false}
averageCenter
gridSize={60}
gridSize={40}
onClusteringEnd={ this.handleClustererEnd}
onClick={ this.handleClusterClick }
>
Expand Down
12 changes: 2 additions & 10 deletions Graphs/Table/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ class Table extends AbstractGraph {
)
}

if(columnData) {
if(columnData || columnData === 0) {
data[key] = typeof(columnData) === "boolean" ? columnData.toString().toUpperCase() : columnData
}
}
Expand Down Expand Up @@ -483,15 +483,7 @@ class Table extends AbstractGraph {
}

handleStaticSorting(column, order) {
this.filterData = this.filterData.sort(
(a, b) => {
if (order === 'desc')
return b[column] > a[column] ? 1 : -1

return a[column] > b[column] ? 1 : -1
}
);

this.filterData = _.orderBy(this.filterData, [column], [order]);
/**
* Resetting the paging due to sorting
*/
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ The use of the graphs module is to provide a module to quickly shows your data i
"react-tap-event-plugin": "2.0.1",
"react-tooltip": "^3.2.1",
"object-path": "^0.11.4",
"react-google-maps": "^9.4.5"
"react-google-maps": "^9.4.5",
"prop-types": "^15.6.2",
"react-csv": "1.0.8",
"react-copy-to-clipboard": "^4.3.1",
"react-modal": "^3.5.1",
```
## Usage examples
- Make sure your current project must be a valid git project, if not then run the below command
Expand Down

0 comments on commit eccc2f6

Please sign in to comment.