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

feat(defaultRenderer): enable color change #871

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rbalet
Copy link

@rbalet rbalet commented Apr 29, 2024

Thank you for opening a Pull Request!


Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Make sure to open a GitHub issue as a bug/feature request before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

Fixes #870 🦕

Copy link

google-cla bot commented Apr 29, 2024

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@rbalet
Copy link
Author

rbalet commented Apr 29, 2024

FYI, I've accepted the Cla, but don't know how to run the pipe again

@noah56
Copy link

noah56 commented Jun 8, 2024

Just leaving a comment to say I would love this feature

@tomasbruckner
Copy link

It would be great if I could pass function in constructor that will receive current cluster and returns color of the cluster.
It will be more flexible than just having 2 colors. It would also enable to change threshold value etc.

@behunin
Copy link

behunin commented Oct 12, 2024

Another +1 to this thread.

public render(
{ count, position }: Cluster,
stats: ClusterStats,
map: google.maps.Map
): Marker {
// change color if this cluster has more markers than the mean cluster
const color =
count > Math.max(10, stats.clusters.markers.mean) ? "#ff0000" : "#0000ff";
count > Math.max(10, stats.clusters.markers.mean) ? this.overMeanColor : this.underMeanColor;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
count > Math.max(10, stats.clusters.markers.mean) ? this.overMeanColor : this.underMeanColor;
count > Math.max(10, stats.clusters.markers.mean) ? var(--over-mean) : var(--under-mean);

Wondering if it would be easier to just change the hex values to css variables.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@behunin they didn't accept my original pull request, not sure what to do to make them look at this issue :/

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jpoehnelt Could you poke whomever google has assigned to this product right now? How can we get some traction here?

@jpoehnelt
Copy link
Contributor

@wangela ptal

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.

feat(DefaultRenderer): custom color
5 participants