Skip to content

Commit 653f507

Browse files
committed
fix: sort faceted tag tree alphabetically
1 parent 95abbed commit 653f507

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

docs-web/src/main/webapp/src/composables/useCoOccurrenceTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function useCoOccurrenceTree(
4242
} as TreeNode
4343
})
4444
.filter((n): n is TreeNode => n !== null)
45-
.sort((a, b) => ((b.data as any).coCount ?? 0) - ((a.data as any).coCount ?? 0))
45+
.sort((a, b) => (a.label ?? '').localeCompare(b.label ?? ''))
4646
: []
4747
return {
4848
key: tag.id,
@@ -52,7 +52,7 @@ export function useCoOccurrenceTree(
5252
} as TreeNode
5353
})
5454
.filter((n) => (n.data as any).docCount > 0)
55-
.sort((a, b) => ((b.data as any).docCount ?? 0) - ((a.data as any).docCount ?? 0))
55+
.sort((a, b) => (a.label ?? '').localeCompare(b.label ?? ''))
5656
})
5757

5858
return { treeNodes, adjacency, tagMap }

0 commit comments

Comments
 (0)