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): custom color #870

Open
rbalet opened this issue Apr 29, 2024 · 0 comments · May be fixed by #871
Open

feat(DefaultRenderer): custom color #870

rbalet opened this issue Apr 29, 2024 · 0 comments · May be fixed by #871
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@rbalet
Copy link

rbalet commented Apr 29, 2024

Is your feature request related to a problem? Please describe.
To avoid having the recreate the renderer just to be ab le to change the color, letting user change those color while instantiating the class would be useful

Describe the solution you'd like
Add two color variable that can be set through class instantiation.

Additional context
The Idea

export class DefaultRenderer implements Renderer {
  underMeanColor: string
  overMeanColor: string

   constructor(underMeanColor = '#0000ff', overMeanColor = '#ff0000') {
     this.underMeanColor = underMeanColor
     this.overMeanColor = overMeanColor
     super() 
  } 
  
    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) ? this.overMeanColor : this.underMeanColor;
   
   // ...
}
@rbalet rbalet added triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. labels Apr 29, 2024
@rbalet rbalet linked a pull request Apr 29, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage me I really want to be triaged. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant