Skip to content

Commit

Permalink
Show additional user details on hover (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
hfxbse authored May 18, 2024
1 parent 3c8e5e5 commit 98ecb16
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/visualization/graph/graph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export default class UserGraphVisualization extends HTMLElement {
.text((user: User) => {
const count = user.followerIds?.length ?? 0;

return `${user.profile.name} @${user.profile.username} (${count} follower${count > 1 ? 's' : ''})`;
const name = `${user.profile.name} @${user.profile.username}`
const counts = `${count} follower${count > 1 ? 's' : ''}, following ${user.followingCount ?? 0}`
return `${name} (${counts}${user.public ? ', public profile' : ''})`;
});

node.call(d3.drag()
Expand Down

0 comments on commit 98ecb16

Please sign in to comment.