bookwyrm-social / bookwyrm

Social reading and reviewing, decentralized with ActivityPub
http://joinbookwyrm.com/
Other
2.26k stars 265 forks source link

Proposal: Reading statistics page a la goodreads. #963

Open Hallicopter opened 3 years ago

Hallicopter commented 3 years ago

Is your feature request related to a problem? Please describe. Not related to a problem, but I am curious about the distribution of the books I read wrt to their publishing dates. Other chart could be pages read per month, books read per month etc.

Describe the solution you'd like A stats page like that in goodreads. image

Describe alternatives you've considered The page need not look like goodreads'. I haven't considered much, just putting the feature proposal here to see peoples' thoughts on it, and put it in the backlog as an idea (since I couldn't find any other proposal for this)

Additional context Just some form of basic reading statistics would be nice.

mouse-reeve commented 3 years ago

Agreed! I think there's a lot of fun ways this could work

Ryuno-Ki commented 2 years ago

Math :heart_eyes_cat:

I mean, I'd like to take a stab at this one this week. Reading through linked issues and familiarising myself with the respective code bits right now.

Ryuno-Ki commented 2 years ago

I looked into the source code and have some questions before moving forward:

  1. Who should be able to see those stats?
  2. Where should it appear? On a user profile page? A dedicated page? Linked next to user / Your books?
  3. Would it make sense to start with some text first? This way, I can familiarise myself with the queries. From what I can tell after initial testing, it will require a few relationships. Users -> Shelves -> Books resp. User -> Status.
  4. It appears we don't have a JavaScript library for this right now. I looked into a few with respect to accessibility and would suggest to go with D3.js (unless you want to buy a license, then there are more options).

My thoughts:

  1. Start with only oneself (when logged in). This way, it is safe to gauge interest in whether it is worth putting more effort into it.
  2. I would tend towards a new page for this, because the query could quite some time and slow down the loading even further.
  3. My ideas revolve around: „Read in year X: ” and „Published in year Y: ”. Basically gathering numeric data before putting them into a chart.
  4. The process is similar to the barcode library, I guess? Shall I take another look and look closely at the license?
todrobbins commented 2 years ago

@Ryuno-Ki your thoughts are excellent. Privacy-first and a separate page is smart. Could fit nicely here as another tab:

Screen Shot 2022-05-05 at 4 59 17 PM

mouse-reeve commented 2 years ago

I looked into the source code and have some questions before moving forward:

  1. Who should be able to see those stats?

The annual review and shared lists have an option to create a revokable, sharable link. I think that would be a good pattern here too!

  1. Where should it appear? On a user profile page? A dedicated page? Linked next to user / Your books?

I agree with @todrobbins - linking from the user tabs seems like a sensible place to put it.

  1. Would it make sense to start with some text first? This way, I can familiarise myself with the queries. From what I can tell after initial testing, it will require a few relationships. Users -> Shelves -> Books resp. User -> Status.
  2. It appears we don't have a JavaScript library for this right now. I looked into a few with respect to accessibility and would suggest to go with D3.js (unless you want to buy a license, then there are more options).

Text would be a great starting place! We do already have a javascript charting library that's used in the admin dashboard: https://github.com/bookwyrm-social/bookwyrm/blob/main/bookwyrm/templates/settings/dashboard/dashboard.html#L152 -- apparently I just linked it via CDN, since it's an admin only view, but it would make sense to include it as a library.

My thoughts:

  1. Start with only oneself (when logged in). This way, it is safe to gauge interest in whether it is worth putting more effort into it.
  2. I would tend towards a new page for this, because the query could quite some time and slow down the loading even further.
  3. My ideas revolve around: „Read in year X: ” and „Published in year Y: ”. Basically gathering numeric data before putting them into a chart.
  4. The process is similar to the barcode library, I guess? Shall I take another look and look closely at the license?

These all seem like solid thoughts :)

Ryuno-Ki commented 2 years ago

Okay, let me summarise that into a checklist, so I can break it up into several PRs:

I will edit the PRs adressing each item once it's open. Comments welcome.

Ryuno-Ki commented 2 years ago

I was not able to pick it up for private reasons for several weeks, but today I studied the source code further to learn about the models.

Which „readthrough” comments are interesting for this feature? Start and finish date? Those in between? How to handle books, that were started but not finished yet? What about stopped ones? Read through a book can be tracked by pages or percentage. Don't we compare apples with pears here?

Those are questions that came up when walking through the code. Looking forward to hearing your thoughts on them.

joric3 commented 6 days ago

This would be a fun addition. What publishing date would be used - that of the edition that was marked read, or the oldest publishing date found among all editions under the related work? I'd love too see the "originally published in" date, but it's less straightforward to extract.

Ryuno-Ki commented 6 days ago

I'm not going to be able to work on this for the entire month of November 2024. Perhaps in December, but I have not enough information to work on it.

If someone wants to give it a try, be my guest.