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

Nicer sparkline scaling for comparing hashtags #21917

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

naught101
Copy link

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.

@Gargron
Copy link
Member

Gargron commented Dec 15, 2022

I would like some screenshots to confirm that it looks good and looks better than before.

@naught101
Copy link
Author

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.

@naught101
Copy link
Author

@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 #hashtag, 4 with #hashtagMedium, and one with #hashtagSmall

image

@naught101
Copy link
Author

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.

@github-actions
Copy link
Contributor

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.
@github-actions
Copy link
Contributor

This pull request has resolved merge conflicts and is ready for review.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 3, 2023

This pull request has merge conflicts that must be resolved before it can be merged.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 4, 2023

This pull request has resolved merge conflicts and is ready for review.

Copy link
Contributor

This pull request has merge conflicts that must be resolved before it can be merged.

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

Successfully merging this pull request may close these issues.

None yet

2 participants