Open MikeLydeamore opened 1 year ago
Ideally, I think what you would want to use is an in-javascript filter on a single layer? That's planned, but I don't have a timeframe for it yet.
Manual legends aren't totally useless and I agree that adding a dummy constant and using a category scale is clunky (it also adds bloat).
I think manual legends are related to aggregation legends (also not available yet) --- workaround there is to create a dummy layer, which is a hack.
I think something like this for the api for both could work:
color <- function(color, legend=TRUE) {}
color_range <- function(palette, legend=TRUE) {}
Passing a string instead of an
accessor
intoget_scatterplot_layer
doesn't seem to produce a legend, even whenvisible = TRUE
is enabled.I can bypass this by creating a dummy column that is the same for every row in the object, and then using
scale_color_*
but this feels like a bit of a clunky workaround.An example of the map I would expect to see a fill legend for:
The workaround is to change
get_fill_color
to:I understand the normal use case for a string in
get_fill_color
is probably a useless single-valued legend. My use case is controlling several very similar layers with shiny that have each dataset on it's own layer (for individual toggling) and so the ability to create a "manual" legend would be very useful.