Skip to content

Commit

Permalink
fix gender display
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Chen committed Oct 30, 2024
1 parent 4b53743 commit 6ede57b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ui-client/src/components/Visualize/Gender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export class Gender extends React.PureComponent<Props, State> {
const w = width > this.maxWidth ? this.maxWidth : width;

if (!counts) return <div style={{margin: "24px"}}>No data available</div>;
let data = Object.entries(counts)
const sorted = Object.entries(counts)
.sort((a, b) => a[0].localeCompare(b[0]));
let data = sorted
.map(([key, value]) => ({ key, value }))
.sort((a, b) => (a.value > b.value ? 0 : 1));
const len = data.length;
Expand Down

0 comments on commit 6ede57b

Please sign in to comment.