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 opacity to aesthetic channels. #41

Open
bmschmidt opened this issue Aug 14, 2022 · 4 comments
Open

Add opacity to aesthetic channels. #41

bmschmidt opened this issue Aug 14, 2022 · 4 comments

Comments

@bmschmidt
Copy link
Collaborator

Currently opacity can only be set globally for all points, but there are cases where you want to have a subset of points at full opacity, e.g. #35. This is pretty straightforward to implement.

@davidnmora
Copy link
Contributor

I second this, this would be really nice!

@davidnmora
Copy link
Contributor

davidnmora commented Jan 8, 2023

Just want to spec this out a bit. There's a lot of ways it could go:

@bmschmidt is this what you had in mind, supporting both options a & b?

  {
    encoding: {
      opacity: {
        // Option a: just map the domain of a field to opacity [0, 1]
        field: "percentage_of_some_thing",
        domain: [0, 100],

        // Option b: a lambda that returns the opacity value
        lambda: some_field => some_field !== "jazz" ? 0.3 : 1,
      },
    },
  }

@davidnmora
Copy link
Contributor

Looks like I'll dive into this by creating a rough "clone" of the Size aesthetic (similar API), and then from there we can tweak the API & options to get it just right!

@davidnmora
Copy link
Contributor

Screen Shot 2023-01-09 at 12 46 44 PM

For reference form our convo on how categorical columns get handled.

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

No branches or pull requests

2 participants