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

Add basic implementation of the data_color() method #109

Merged
merged 102 commits into from
Jan 19, 2024

Conversation

rich-iannone
Copy link
Member

@rich-iannone rich-iannone commented Jan 9, 2024

This adds in the data_color() method, and it allows for adding color to data cells based on their values. The data_color() method automatically computes colors based on the column type (allowing you to choose a specific methodology). Here is a basic example of how this method works in practice:

from great_tables import GT
from great_tables.data import gtcars

(
    GT(gtcars[["mfr", "model", "msrp"]], groupname_col="mfr", rowname_col="model")
    .data_color(columns="msrp", palette=["white", "lightgreen"])
    .fmt_currency(columns="msrp", use_subunits=False)
)
data_color_method

@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 15:39 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 15:54 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 15:59 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 16:16 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 19:26 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 9, 2024 19:29 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 15, 2024 21:14 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 15, 2024 21:39 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 15, 2024 22:20 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 16, 2024 15:14 Destroyed
@machow
Copy link
Collaborator

machow commented Jan 17, 2024

Ah, I think we need to pin griffe==0.38.1 in our dev dependencies of pyproject.toml for now. A release from yesterday changed how it represents unrecognized sections. (It should be a quick fix to update quartodoc, and once that's released we can unpin it! Also I made the PR to change the behavior in griffe so this is on me 😅)

@rich-iannone
Copy link
Member Author

Excellent investigative work! I’ll do what you said, thanks!

@github-actions github-actions bot temporarily deployed to pr-109 January 18, 2024 15:09 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 18, 2024 20:19 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 18, 2024 20:19 Destroyed
@github-actions github-actions bot temporarily deployed to pr-109 January 18, 2024 20:21 Destroyed
@rich-iannone rich-iannone marked this pull request as ready for review January 18, 2024 20:44
@github-actions github-actions bot temporarily deployed to pr-109 January 19, 2024 18:50 Destroyed
@rich-iannone rich-iannone merged commit f843832 into main Jan 19, 2024
7 checks passed
@rich-iannone rich-iannone deleted the data-color-method branch January 19, 2024 20:06
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.

None yet

2 participants