Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/statistic #267

Merged
merged 8 commits into from
Apr 21, 2018
Merged

Feature/statistic #267

merged 8 commits into from
Apr 21, 2018

Conversation

rachmadaniHaryono
Copy link
Collaborator

@rachmadaniHaryono rachmadaniHaryono commented Apr 20, 2018

based on discussion on #251

statistic page

  • link added to navbar and index page
  • result data saved on global variable (see below for description)
  • add chart.js file and arrow package for humanizing statistic datetime
  • refresh button to recalculate the data

TODO (maybe)

  • tag statistic
  • table for netloc and tag, which are hidden by default and expanded on button
  • confirmation or enable/disable statistic page

from related discussion

it can more expanded, e.g. 
- most common word on description, 
- domain to tag relationship
- nlt for description
- (new) color generation
- (new) configurable number of common item
FUN idea: Badge:
- 0, 10, 100, 1k bookmark/tag
- sfw/nsfw/category bookmark achieved (have x website bookmark with max or min number)
- unique domain award (when unique domain is the most dominant)
- website bookmark (only bookmark certain website or it is 80% of the bookmark)

motivation

i decide to create pr for it even if it may not be merged.

the original motivation is just to search dominant netloc, but it is expanded and turned into some prototype about what can be done by a plugin on bukuserver


saved data

the original branch start without saving data to anything. it mean on each request the data will be calculated. the disadvantage of this is the time required when user have million of bookmark.

jarun:I think if we add this feature, users may want the data to be persistent. Hence, at some point we will have to work on making it persistent and add that option to enable it.

based on that recommendation, i try these method

  • flask.g: i could be wrong when using this method to get bukudb (may have to create another pr to subtitute the entire use of this). related I think if we add this feature, users may want the data to be persistent. Hence, at some point we will have to work on making it persistent and add that option to enable it.
  • class view: i thought the attribute on class view will be kept between request, but it is not.
  • flask session: it is possible, but there is warning when there is too much data and browser may ignore it
/home/<user>/envs/Buku/lib/python3.6/site-packages/werkzeug/wrappers.py:1116:
UserWarning: The "b'session'" cookie is too large:
the value was 31762 bytes but the header required 26 extra bytes.
The final size was 31788 bytes but the limit is 4093 bytes.
Browsers may silently ignore cookies larger than this.

@jarun
Copy link
Owner

jarun commented Apr 20, 2018

Megalike! 👍

@rachmadaniHaryono
Copy link
Collaborator Author

rachmadaniHaryono commented Apr 21, 2018

maybe last commit for this feature

now tag statistic is also on the page.

there is view all button which will open modal page showing table of the rank

e: also enable and disable statistic page ignored for now and (maybe) will be added on future commit


known issue

  • it seems the time indicator may not work, so it will only show created x ago indefinitely.
  • buku don't can't search bookmark, which don't have any netloc (something like javascript:....). so no link for (No Netloc) entry
  • colors and number of default item is constant
  • loading for the first time, which may take some time
  • cache (may) not work

@jarun jarun merged commit d9b2fac into jarun:master Apr 21, 2018
@jarun
Copy link
Owner

jarun commented Apr 21, 2018

Thank you!

@jarun
Copy link
Owner

jarun commented Apr 21, 2018

I misunderstood the statistics proposal earlier. It's aswesome @rachmadaniHaryono!

@jarun
Copy link
Owner

jarun commented Apr 21, 2018

It would be great if one can click on the circle and open the corresponding bookmarks.

@rachmadaniHaryono rachmadaniHaryono deleted the feature/statistic branch April 21, 2018 09:33
@rachmadaniHaryono
Copy link
Collaborator Author

There should be possible by setting something here http://www.chartjs.org/docs/latest/general/interactions/events.html

Related https://stackoverflow.com/questions/26257268/click-events-on-pie-charts-in-chart-js

Maybe I can add that on next pr

@jarun
Copy link
Owner

jarun commented Apr 21, 2018

Maybe I can add that on next pr

That would be great!

@github-actions github-actions bot locked and limited conversation to collaborators Jun 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants