Closed zachary-foster closed 6 years ago
sounds good to me. not sure how it works - we should do it if possible
Cool, I made a few things bold already. Its really easy, but I don't know if it will introduce edge case problems
cool to see the colors 🌈
Nice! I think the colors will help with these complex print methods. Feel free to change the specific styles here:
I am still not sure about the best styles to use for each part
I'm not sure what's best either. maybe they have best practices docs somehwere?
I searched for best practices after you suggested it and did not find any. Currently, my strategy is to copy the tibble
print methods. Unfortunately, I cant seem to find a way to print a indented tibble with colors. That would be nice for displaying tibbles stored in taxmap
objects.
okay. i guess if can't indent the table, just a newline or two to set it off visually?
That would work. Although I can get them to indent without color using :
I then was trying to add some color back, but I doubt it would be worth the trouble to completely replicate the color. I mostly just want the taxon IDs highlighted. I managed to highlight the taxon ID column name, so thats something at least.
It would be especially cool if only valid taxon IDs were colored as taxon IDs so people can tell quickly which datasets are mapped to taxa and if there is anything wrong with the IDs (e.g. a taxonless data after filtering with drop_taxa = FALSE
). However, I am not sure if it would be too much of a performance cost to check if IDs are valid every time a big object is printed.
valid in what sense?
All should be either an ID in the edge list / names(obj$taxa)
or NA
.
ah, okay, yeah, seems like it'd be fast enough
Ok cool
Seems to be working now. Things now only get the "taxon ID" green font if the are all valid taxon ids. If there is a "taxon_id" column, but there are invalid ids, then the column header gets an angry red color.
@sckott, what do you think of adding color/formatting to the output of print methods using the
crayon
package? Do have any experience with this? Do you know of potential problems with consoles that do not understand the color codes?I was trying to figure out how the
tibble
s are color coded now, but I don't see that code in thetibble
package even though it importscrayon
.