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

[WIP] Better handling for missing in colors #3857

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

asinghvi17
Copy link
Member

@asinghvi17 asinghvi17 commented May 12, 2024

Description

This PR aims to support users passing Array{Union{Missing, <: Number}} to a plot's color argument in all circumstances. The usecase is passing vectors from DataFrames straight to color - in many cases, this fails because the vectors have missing values, which then have to be changed manually (which is a chore!)

Changes are:

  • Allow numbers_to_colors to pass missings through, and use the nan color to represent them.
  • Call replace(color_array, missing => NaN) when presented with such an array in assemble_colors
  • Let all CairoMakie functions use calculated_color instead of relying on color.
  • Add unit tests for this kind of data

Type of change

Delete options that do not apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • Added an entry in CHANGELOG.md (for new features and breaking changes)
  • Added or changed relevant sections in the documentation
  • Added unit tests for new algorithms, conversion methods, etc.
  • Added reference image tests for new plotting functions, recipes, visual options, etc.

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