Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scatterplot manual legend #301

Closed
dcooley opened this issue May 8, 2020 · 0 comments
Closed

scatterplot manual legend #301

dcooley opened this issue May 8, 2020 · 0 comments

Comments

@dcooley
Copy link
Collaborator

@dcooley dcooley commented May 8, 2020

The colours don't show up in the legend

set_token( secret::get_secret("mapbox") )

df <- capitals
df$my_colour <- ifelse( substr(df$country, 1, 1) == "A", "#00FF00FF", "#FF0000FF")

l1 <- legend_element(
	variables = c("Begins with A", "Doesn't begin with A")
	, colours = c("#00FF00FF", "#FF0000FF")
	, colour_type = "fill"
	, variable_type = "category"
)
js <- mapdeck_legend(l1)


mapdeck() %>%
	add_scatterplot(
		data = capitals
		, fill_colour = "country"
		, legend = js
	)
	
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.