open-tacos
open-tacos copied to clipboard
Reduce child areas in USA table of content
Use case
As a user I'm overwhelmed by the long list of areas under Colorado and California (the 2 states with the most climbing areas in the US). We can shorten the list by only showing the top most common ancestors.
Examples:
As you can see, the Bishop areas (aka the town Bishop, CA) is the lowest common ancestor of several highly concentrated climbing areas. We can just display "Bishop areas" in the table of content and remove the rest.
| Area | Path | Link |
|---|---|---|
| Bishop areas | USA/California/Sierra Eastside/Bishop Area |
link |
| Owen River Gorge | USA/California/Sierra Eastside/Bishop Area/Owens River Gorge |
link |
| Happy/Sad Boulders | USA/California/Sierra Eastside/Bishop Area/Volcanic Tablelands (Happy/Sad Boulders) |
link |
| Pine Creek Canyon | USA/California/Sierra Eastside/Bishop Area/Pine Creek Canyon |
link |
| Buttermilk Country | USA/California/Sierra Eastside/Bishop Area/Buttermilk Country |
link |
Hints:
- See https://en.wikipedia.org/wiki/Lowest_common_ancestor
- We don't have to deal with a tree structure. The path of an area is expressed in either an array of area names,
pathTokensor a CSV list of area uuid's,ancestors. - One way to approach this is to sort areas under each state by the ancestors string and use the level 3 or 4 as the cutoff point.
- Only apply the filter when the list is more than a threshold (say 5 areas), ie, there isn't much climbing in Florida so we need to show them all.
- USA Table of content https://github.com/OpenBeta/open-tacos/blob/develop/src/app/components/USAToC.tsx
I took a look at this and would like to work on it.
A Problem I Noticed
I did notice that currently the GraphQL query filters areas out that have less than 200 routes or a density less than 0.8. It seems like there are a couple problems with this.
-Density doesn't seem to be a good measure of importance. For example Yosemite NP has a density of .000004 so it is currently excluded from the California areas. There as also some areas that have a density of zero but have hundreds of climbs,
-Excluding areas with less than 200 climbs completely removes all areas in several states (like Florida) which we are specifically trying to show here.
Potential Fix
I think removing the minimum density and setting a lower total climb limit (maybe 20?) on the query would help us get to where we want when combined with the filtering suggested above.
Could you check which areas would be shown with this proposal? We also want to avoid showing too many areas or too large areas.
On Mon, Jan 1, 2024, 23:45 Blake McCord @.***> wrote:
I took a look at this and would like to work on it. A Problem I Noticed
I did notice that currently the GraphQL query filters areas out that have less than 200 routes or a density less than 0.8. It seems like there are a couple problems with this.
-Density doesn't seem to be a good measure of importance. For example Yosemite NP has a density of .000004 so it is currently excluded from the California areas. There as also some areas that have a density of zero but have hundreds of climbs,
-Excluding areas with less than 200 climbs completely removes all areas in several states (like Florida) which we are specifically trying to show here. Potential Fix
I think removing the minimum density and setting a lower total climb limit (maybe 20?) on the query would help us get to where we want when combined with the filtering suggested above.
— Reply to this email directly, view it on GitHub https://github.com/OpenBeta/open-tacos/issues/1021#issuecomment-1873640210, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD7ET7BW4OFPBBWS7X24EHLYMONF5AVCNFSM6AAAAAA7E4Y25GVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZTGY2DAMRRGA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Here are the areas that would show with the following changes
- Remove minimum density
- Lower min route count to 20
- Show all areas if there are less than 6 in an state
- If more than 5 areas: -Show all areas with 3 ancestors (These are the first descendants of the State) -Show areas with 4 ancestors IF they have more than 300 climbs
I have played around with these variables a bit and this seems like a good middle ground, although it still doesn't show any areas in Florida 😆
I have played around with these variables a bit and this seems like a good middle ground, although it still doesn't show any areas in Florida
The density filters is a stop gap until we can reliably and accurately catalog/classify areas. For example, in the database each area has a isDestination=true | false flag to indicate whether or not an area should be listed in these types of queries. However, it requires us to go through thousands of areas and set the flag manually. (If there isn't a ticket already to set the flag on UI, we should create one).
The density filters is a stop gap until we can reliably and accurately catalog/classify areas. For example, in the database each area has a
isDestination=true | falseflag to indicate whether or not an area should be listed in these types of queries. However, it requires us to go through thousands of areas and set the flag manually. (If there isn't a ticket already to set the flag on UI, we should create one).
That makes sense. So this is really just improving the stop gap.
If we just implement a level 4 ancestor cutoff (for states with more than 5 areas) here are the areas shown. This seems like an improvement for most of Colorado and Cali (although Yosemite NP/Valley is now missing) but removes all areas from most states,