python-visualization / branca

This library is a spinoff from folium, that would host the non-map-specific features.
https://python-visualization.github.io/branca/
MIT License
118 stars 66 forks source link

Expose legend_scaler's max_labels in ColorMap #88

Closed martinfleis closed 3 years ago

martinfleis commented 3 years ago

Hi,

I see that legend_scaler has an option to specify the number of labels (max_labels) but that is not accessible form within ColorMap.

Would be great to expose it in ColorMap.__init__ and then pass it to render. With large numbers you get overlaps and there's no way to prevent it.

Relevant bits: https://github.com/python-visualization/branca/blob/ac45f1e1fa95d10a2409409cf3c697f700cad314/branca/utilities.py#L37 https://github.com/python-visualization/branca/blob/ac45f1e1fa95d10a2409409cf3c697f700cad314/branca/colormap.py#L90 Happy to do a PR for that.