eurostat / gridviz

A package for visualizing gridded data 🌐
https://github.com/eurostat/gridviz
European Union Public License 1.2
199 stars 10 forks source link

non-scaling-stroke for selectionRectangleWidthPix? #91

Closed wahlatlas closed 1 year ago

wahlatlas commented 1 year ago

Not sure if selectionRectangleWidthPix is an SVG rect and if you've experimented with non-scaling-stroke https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/vector-effect

On some zoom-levels the selectionRectangleWidthPix gets too thick for my taste, overlapping neighboring cells significantly, but maybe that's intentional for better discoverability?

stroke

jgaffuri commented 1 year ago

The thickness of the rectangle is defined in screen pixels (4 by default). It cannot be adapted to the zoom level and/or cell size. This parameter type could be changed into a function of the zoom level and cell resolution so that it could be adapted.

jgaffuri commented 1 year ago

OK: the parameter selectionRectangleWidthPix is now a function (r,zf) => 4 which computes this rectangle width in pixel, according to the resolution of the selected cell r and the zoom level zf. In such a way, you can adapt this width depending on the zoom level. This will be in the next release to be deployed today.