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

Network colors from a scale #1593

Merged
merged 1 commit into from
Jun 16, 2016
Merged

Network colors from a scale #1593

merged 1 commit into from
Jun 16, 2016

Conversation

davkal
Copy link
Contributor

@davkal davkal commented Jun 16, 2016

  • network-name independent
  • all colors are unique and separated enough
  • only 10 colors are available
  • contains red and green

* all colors are unique and separated enough
* only 10 colors are available
* contains red and green
@rade
Copy link
Member

rade commented Jun 16, 2016

Is this meant to fix #1592?

network-name independent

Does that mean the same network may be coloured differently, depending on context?

@davkal
Copy link
Contributor Author

davkal commented Jun 16, 2016

It's a hack that fixes #1592 for network counts <= 10.

The colouring depends on the order of which we see the networks for the first time. That means it's stable while you keep the browser window open. It may be different if you reload or visit scope at a later point.

To fix this properly, I would work on a proper solution in #1567

@foot
Copy link
Contributor

foot commented Jun 16, 2016

I think its a good, safe solution for now, will work well for demos etc.

I'll give it a test.

@rade
Copy link
Member

rade commented Jun 16, 2016

network counts <= 10

what happens when you have more? Colours get re-used? Or does it explode?

@foot
Copy link
Contributor

foot commented Jun 16, 2016

Repeats. category20 gives us 20 tho...

http://jsbin.com/kedozadozu/edit?html,js,output

@davkal
Copy link
Contributor Author

davkal commented Jun 16, 2016

cat20 is not distinct enough. It's 10 hues, with 2 different shades each:

https://github.com/d3/d3/wiki/Ordinal-Scales#categorical-colors

We could brew our own color scale...

@rade
Copy link
Member

rade commented Jun 16, 2016

stick to cat10. merge it. move on to #783.

@davkal davkal merged commit ce39b8e into master Jun 16, 2016
@davkal davkal deleted the network-colors-unique branch June 16, 2016 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants