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

Colorize contigs by non-numeric attributes #95

Closed
fedarko opened this issue Mar 14, 2018 · 1 comment
Closed

Colorize contigs by non-numeric attributes #95

fedarko opened this issue Mar 14, 2018 · 1 comment

Comments

@fedarko
Copy link
Member

fedarko commented Mar 14, 2018

e.g. an assigned species attribute or something.

Something like this project, a JS library which supports the generation of arbitrary-length sequences of visually distinct colors, would make this fairly simple. Pseudocode for implementing this feature:

  1. Identify the number of unique values of the given attribute (depending on the situation, we should probably do this with a case insensitive search). Let's call this value c. We should probably define a default value, if it's not guaranteed that every node will have the attribute in question defined.
  2. Save all unique values as an array or something.
  3. var colorList = distinctColors({count: c});
  4. Next, iterate over the array of unique values to create an Object mapping of unique value to a distinct color. Might wanna define a helper function to convert Color objects to hex color strings. This mapping should probably be a global variable, so it can be accessed multiple times.
  5. At this point we can just modify getNodeColorization() or something accordingly, using the mapping as a guide.
@fedarko
Copy link
Member Author

fedarko commented Apr 13, 2023

Closing in favor of #243.

@fedarko fedarko closed this as not planned Won't fix, can't repro, duplicate, stale Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant