1886d5d3eadf17bf15566b51b4e7ecffba0e87ee kent Mon Aug 27 15:52:08 2018 -0700 Making it so that facets only show most popular 20 unless you expand them. Also when you expand they are sorted alphabetically rather than by popularity. diff --git src/hg/lib/facetField.c src/hg/lib/facetField.c index 9d8edff..2b441d2 100644 --- src/hg/lib/facetField.c +++ src/hg/lib/facetField.c @@ -16,30 +16,39 @@ if (result == 0) { result = strcmp(a->val, b->val); } return result; } static int facetValCmpUseCountDesc(const void *va, const void *vb) /* Compare two facetVal so as to sort them based on useCount with most used first */ { struct facetVal *a = *((struct facetVal **)va); struct facetVal *b = *((struct facetVal **)vb); return b->useCount - a->useCount; } +int facetValCmp(const void *va, const void *vb) +/* Compare two facetVal alphabetically by val */ +{ +struct facetVal *a = *((struct facetVal **)va); +struct facetVal *b = *((struct facetVal **)vb); +return strcasecmp(a->val, b->val); +} + + static struct facetVal *facetValNew(char *val, int useCount) /* Create new facetVal structure */ { struct facetVal *facetVal; AllocVar(facetVal); facetVal->val = val; facetVal->useCount = useCount; return facetVal; } static void facetFieldAdd(struct facetField *facetField, char *tagVal, boolean selecting) /* Add information about tag to facetField */ { if (!selecting) facetField->useCount += 1;