Closed mtennekes closed 1 year ago
Do you mean overwrite 200, 400, 600 with small, medium large?
That's not currently implemented with addLegendSize
but is possible with a bit more sweat equity and addLegendImage
. I should be able to add that in.
Yes, indeed. That would be great!
From how I understand your (great) package, I will use:
addLegendNumeric
for color gradientsaddLegendSize
for symbols varying in size (and optionally color or fill)addLegendSymbols
for symbols varying in shape and/or color/fill)addLegendLine
for line width (and optionally color or fill)Is addLegendImage
the most flexible? Is that correct or do you have suggestions?
Is it possible to generate symbols with makeSymbol
and feed that into addLegendImage
? If so, I would consider that (because it gives more options. e.g. to vary size, color and shape at the same time.
Btw, can I show a label for missing values in the addLegendNumeric
?
Just playing with addLegendImage
in combination with makeSymbol
: awesome! Just what I need.
From the source code of makeSymbol
I figured out how to change the stroke width: 'stroke-width' = 0.1
. Why not just add an argument strokeWidth
?
There are some helper functions too: https://roh.engineering/posts/2021/05/map-symbols-and-size-legends-for-leaflet/
e.g. makeSymbolSize
addLegendImage
is the most versatile of those functions, but I think in terms of overwriting text. addLegendFactor
can satisfy most of what you need.
Instead of listing all presentation attributes out as arguments, you can use ...
to pass them on. strokeWidth
is needed for some internal alignment and sizing calculations and I was trying to create a consistent "naming" convention with the "leaflet" package which I wasn't a fan of weight
.
I'm thinking of adding functionality to addLegendSize
where you can pass the breaks as a named list e.g. c(small = 10, medium = 20, large = 30)
. The names would be the label/text.
I was looking for exactly this functionality in addLegendSize. Thank you, @tomroh, for this superb package and for adding features like this!
a75fd0f700991fa39f79e3614ea9e87b8680a250
Can the legend labels be specified in addLegendSize? I'd like to be able to specify any text (e.g. "Very large", "Large", "Medium", > "Small") for the symbol sizes. Btw, can I show a label for missing values in the
addLegendNumeric
?
Moving this to #62. The addLegendNumeric
is more complex than the other legends and spacing labels becomes an issue for overriding the breaks.
This is complete for other legend functions.
I'm working on implementing leaflegend in tmap v4 (https://github.com/r-tmap/tmap/issues/699). One important question:
Can the legend labels be specified in
addLegendSize
? I'd like to be able to specify any text (e.g. "Very large", "Large", "Medium", "Small") for the symbol sizes.