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
Nicer sparkline scaling for comparing hashtags #21917
base: main
Are you sure you want to change the base?
Conversation
I would like some screenshots to confirm that it looks good and looks better than before. |
Fair enough, I will try to get a dev server set up. Any tips on creating sufficient content to get some data to show would be useful. |
@Gargron it does work as I hoped. I don't know how to generate lots of old tag data, but here are some examples - there are 19 toots with |
With this, a 20 tag peak uses 2/3 of the available height. I think that this is a good scaling for hashtag searches, where most hashtags only have a couple of hits. Perhaps not so good for the popular hashtags feed though, where most of the hashtags have hundreds of hits, and so the scaling will always be nearly 100%. It still gives you a bit of difference though, and the relative change is still there, so I think this is still a good change as-is. Potentially you could figure out a way to store the maximum hash tag hits among all displayed, and do something like add 10% to the max, so if you had one 1000 hit tag, that would be at about 90%, and a 100 hit tag in the same feed would show 50%, and a 10 hit tag would show ~9%. But maybe not worth it. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This will plot empty hashtags as a line at the bottom of the graph, instead of in the middle. It will also scale small hashtags, so that e.g. something with 1 tag will only use ~10% of the available graph height, where something with 10 tags will use ~50% of the height, and something with 100 tags will use ~90% of the height, etc.
65c7555
to
fe5074c
Compare
This pull request has resolved merge conflicts and is ready for review. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This pull request has resolved merge conflicts and is ready for review. |
This pull request has merge conflicts that must be resolved before it can be merged. |
This will plot empty hashtags as a line at the bottom of the graph, instead of in the middle.
It will also scale small hashtags, so that e.g. something with 1 tag will only use ~10% of the available graph height, where something with 10 tags will use ~50% of the height, and something with 100 tags will use ~90% of the height, etc.
I haven't had time to set up a dev environment, so this is untested, but I'm 99% sure it should work as advertised, following the react-sparkline docs.