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

Make tags more colourful #7072

Merged
merged 6 commits into from Dec 5, 2018
Merged

Make tags more colourful #7072

merged 6 commits into from Dec 5, 2018

Conversation

@hexylena
Copy link
Member

@hexylena hexylena commented Dec 4, 2018

EDIT

After much discussion we've settled on these Options.

Original Post

Today I was running through the peaks2genes tutorial and found that my eyes struggled to recognise if I was looking at something tagged #peaks or #genes, and this wasn't great, they just all looked the same when scanning across a history. (I've added an example at the end.) So I've implemented coloured tags. The colours are done automatically from a hash of the string so they're stateless and consistent.

grafik

Whole UI:

grafik

It just hashes the tag, and then pulls out some bits of that number. I've done a %10 which means that the lightest colour that can theoretically be generated is which doesn't have super amazing legibility but it isn't that bad (tags are already bad due to small size for that, this isn't making it that much worse.)

grafik

I chose a hash function at random by googling, if there's something more appropriate (or already in codebase) let me know. You could probably optimise the colour distributions, I think the dark colours do not have a high perceptual difference but I'm not sure what to do about this. You could probably find a better mapping.

Light colours are also an option / nice?
grafik

Original New
These colours I found difficult when scanning my history With this patch it's much easier to scan! (Faked screenshot because I'm lazy and didn't want to backport it to 18.05)
grafik grafik
@hexylena

This comment has been hidden.

}

export function generateTagColor(tagValue) {
//var r = (15 - ((hash & 0xf) % 6)).toString(16),
Copy link
Member

@martenson martenson Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

drop?

Loading

Copy link
Member Author

@hexylena hexylena Dec 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the 'light' version, left it in so I would not forget what I did, but should be dropped before merge.

Loading

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

Is it possible that these generated colors will be unreadable/colorblind unfriendly?

Loading

@hexylena

This comment has been hidden.

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

% 10, even if it permits some light colours + W3C algo for font fix.

💯

Loading

@hexylena

This comment has been hidden.

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

@erasche border is exactly what I was just exploring after @jxtx suggested it, light grey 1px border looks very good on these I think

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

@martenson agreed, it's pretty nice! I like it.

So Galaxy community:

Option 1 Option 2

Loading

@jxtx
Copy link
Contributor

@jxtx jxtx commented Dec 4, 2018

I like option 2 but maybe the border should be the same hue as the bg but darker.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

@jxtx sure, that's possible. Give me a few minutes.

Loading

@dannon
Copy link
Member

@dannon dannon commented Dec 4, 2018

I was worried about 'too many lines' cluttering up the UI there with borders, but this looks nice. Same color but darker is a great idea.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

Dunno, can't tell much difference from grey lines. But I have imperfect colour vision (red-green blindness). Personally prefer grey lines but yeah.

grafik

Another example. I've converted the code to use HSL (so the 'darker' could be implemented easily,) and it's taking some tries to find similarly good distributions to what I saw in RGB pastels.

grafik

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

A little bit better

Pastel

grafik

Dark
grafik

Loading

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

I think @jxtx meant the background color of the dataset not the background of the tag.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

@martenson oh, hmm. (thanks for clarification)

Loading

@hexylena

This comment has been hidden.

@nsoranzo
Copy link
Member

@nsoranzo nsoranzo commented Dec 4, 2018

Pastel with gray border (i.e. Option 2) looks best to me.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

Ok created some nice fake histories with lots of tags to show it off. Here are two we can put to the community :)

Option Null Option 1 Option 2
grafik grafik grafik

Loading

@shiltemann
Copy link
Member

@shiltemann shiltemann commented Dec 4, 2018

this is cool, will be really nice for histories with many tags 👍

My vote goes to Option2 :)

Loading

@jxtx
Copy link
Contributor

@jxtx jxtx commented Dec 4, 2018

I think @jxtx meant the background color of the dataset not the background of the tag.

No, I meant the color of the tag. I liked that one.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

@jxtx Yeah, ok, when I zoom in like 500% I can see it, I'm looking at it again and it's ok. It looks a bit funny on yellow but the others are nice? Less grey is always good. I'll play around with it a bit and just find one that isn't too contrasting that certain ones stand out too much, but it's better than grey. Anything is better than grey.

Loading

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

@jxtx my apologies

We have a poll now. :) https://help.galaxyproject.org/t/what-colors-of-galaxy-tags-do-you-like-the-most/101 I will add the color-border option. @erasche can you please get me comparable screenshot?

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

@martenson I'd say don't bother updating poll due to:

  • the poll is already started, when I updated the option names to be more descriptive it wiped out previous votes
  • it's pretty subtle? I do not think anyone will notice or say "I definitely do not want pastels because of the border colour", or would be able to tell the difference between that + grey due to how much stuff is going on in the UI, there are boxes open, datasets, tool menus, etc. I will claim PR author's discretion over those 100 pixels that would change.

Loading

@martenson
Copy link
Member

@martenson martenson commented Dec 4, 2018

@erasche You got it.

when I updated the option names to be more descriptive it wiped out previous votes

This is nice behavior actually.

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 4, 2018

This is nice behavior actually.

Agreed, I can immediately imagine a bunch of bad uses for polls if it didn't. I like it!

Loading

@hexylena
Copy link
Member Author

@hexylena hexylena commented Dec 5, 2018

Final version, I'm pretty happy :) Here it is zoomed

grafik

Full screen version

grafik

Ready for review / merge.

Loading

@martenson martenson merged commit c4dbf86 into galaxyproject:dev Dec 5, 2018
0 of 6 checks passed
Loading
@martenson
Copy link
Member

@martenson martenson commented Dec 5, 2018

Thanks a bunch!

Loading

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

Successfully merging this pull request may close these issues.

None yet

6 participants