Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Feature request: Tick pyramid #3

Open
jdmoorman opened this issue Aug 6, 2020 · 1 comment
Open

Feature request: Tick pyramid #3

jdmoorman opened this issue Aug 6, 2020 · 1 comment

Comments

@jdmoorman
Copy link

jdmoorman commented Aug 6, 2020

It would be great to have a quick way to view a summary of the particular routes you've sent at each grade. Ideally, this would include stats about each route:

  • Location
  • Number of attempts
  • Number of repeats
  • Date of redpoint (if you have sent the route)

Routes should be listed in order of the most recent sends first. The visualization should also be filterable by some natural criteria:

  • Whether to include routes which have been attempted but not sent
  • What timespan to include (e.g. last year, last month, all-time)

I was hacking around to get familiar with the mountain project API and made a quick and dirty mockup of what I'm imagining shown below. I'm a relative novice at webdev, but happy to help in any way I can.

Screen Shot 2020-08-05 at 11 05 52 PM

@derat
Copy link
Owner

derat commented Aug 6, 2020

I think that I stayed away from summaries like this due to them not fitting easily into Cloud Firestore's document model without duplicating a lot of data. src/models.ts defines the current structures, but IIRC the relevant ones are:

  • a stats/counts singleton document that contains aggregated counts, e.g. ticks per date/grade/region/etc.
  • a bunch of routes documents that contain each route's name, grade, etc., along with all of its ticks

Firestore has a 1 MB document size limit, and its pricing model disincentivizes spreading data across a bunch of documents that all get read simultaneously later -- it's inefficient to e.g. read all of the routes documents at once and group them by grade. (With a regular relational database, it'd be simple to write a SQL query joining routes to ticks and grouping by grade.)

I think that a Firestore-compatible way to implement a view like the one in your mock would be to have a document for each grade containing the name, location, and tick summary for each of the routes at that grade. Depending on the number of routes per user (I'm not sure of the max I assumed before, but I think it was on the order of a few thousand), it might be possible to fit the data for all of the grades in a single doc.

That'd likely be a fair amount of work -- the grade doc(s) would need to be rebuilt from the existing route docs. Unfortunately, it's not just a matter of creating a new view that queries existing data. :-(

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants