react-svg-map icon indicating copy to clipboard operation
react-svg-map copied to clipboard

Control path opacity

Open francescocretti opened this issue 2 years ago • 1 comments

Hi, thanks for the useful tool!

I'm wondering if there's an handy way to control the opacity of a map region (so an SVG path).

I'm building an heatmap with an opacity scale based on data incoming from an API, so is not really possible to do that as in the Heatmap example.

Or rather, it's not possible without defining a CSS class for each possible opacity value, that's not something I really wanna do :)

Any suggestions?

Thanks a lot

francescocretti avatar Jul 06 '22 14:07 francescocretti

Hi, It's currently not possible (without defining a CSS class for each possible opacity value), but I think adding the feature to set the style attribute of each location (with a new locationStyle prop for example) would solve your problem. I'll try to work on it in the following weeks, or feel free to create a pull request!

VictorCazanave avatar Feb 24 '23 06:02 VictorCazanave