googlemaps / googlemaps/js-markerclusterer
[ClusterStats] compute lazily
Open
good first issue
priority: p3
type: feature request
- Dominant language
- TypeScript
- Stars
- 293
- Forks
- 104
- Avg merge
- 3m
- Merged PRs (30d)
- 18
Description
As of today the stats are computed eagerly as they are constructed:
https://github.com/googlemaps/js-markerclusterer/blob/e8eecf49b1d1f59579f3316c705f2c131b796560/src/renderer.ts#L35-L50
That's wasted CPU cycles when the stats are not required (i.e. with a custom renderer).
We should compute the stats lazily when one of the `markers`'s property is first accessed to avoid that.
This could be done in a backward compatible way using getters.
Contributor guide
Assessment
This issue has not been assessed yet.