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

Displaying multiple variables in a single bin #12

Open
ciflikli opened this issue Dec 9, 2017 · 5 comments
Open

Displaying multiple variables in a single bin #12

ciflikli opened this issue Dec 9, 2017 · 5 comments

Comments

@ciflikli
Copy link

ciflikli commented Dec 9, 2017

Background: I'm working on a shiny app that visualises US House and Senate voting patterns (with two types of scores, so four combinations). Currently I use the highcharter package however I want to switch to statebins - it looks really neat! Highcharter also takes forever to load every time a setting is changed - I'm hoping statebins would be faster (although not yet tested).

Request: Would it be possible to show more than one variable value in a single bin (w/o using faceting)? I really like the new facet functionality, but I also don't want to display 2x2 US maps to the user on a single page. I couldn't really find a working example (which might be telling), so I am attaching some hastily done photoshop'd possibilities:

bars
number
two_colurs

Not sure about the feasibility of any of these, but looking forward to your response! Cheers.

/Gokhan

@hrbrmstr
Copy link
Owner

hrbrmstr commented Dec 9, 2017

This is a neat idea!

Started pondering potential solutions. I fear they all might be slow-ish but I won't know until I try a few out. The "WI 52" one is the most easily doable but I'll see what might make sense for the others.

For the "WI Blue/Red", wld that always be half/half? That might be not-too-hard to do either if so.

@ciflikli
Copy link
Author

ciflikli commented Dec 9, 2017

Thanks for looking into it!

To me, from a design point of view (i.e. not considering the programming aspect), the "WI Blue/Red" solution would be ideal assuming the implementation is something like: pass two fill/variable arguments, split the bins into halves (either vertical/diagonal; always the same), then fill the respective halves with the values. So the blue part of WI can display Democrat scores and the red Republicans. The intensity of colours can indicate the effect: say, darker colours indicate higher values - I'm trying to think of a way w/o resorting to a double-legend.

I assumed "WI 52" solution would be the easier one to implement, however I suspect it may not be very intuitive for some users. With that said, I'll take any enhancement that accomplishes the task!

@hrbrmstr
Copy link
Owner

hrbrmstr commented Dec 12, 2017

Just a quick note to say that progress has been made

image

Each one of those is a geom_oscar() (coming from the latin alphabet position of the nautical flag it looks like "O" or "Oscar" in clearspeak). I just made a random tester for it first.

Still much work to do, but it's all downhill from here. Well kinda. Making it rounded it going to be "fun" but we'll see how that goes. I need to add more polygons for the border spacing as well. But, progress is progress!

@ciflikli
Copy link
Author

Looks very promising! Happy to give it a go once it's out.

@mkiang
Copy link
Contributor

mkiang commented Apr 12, 2018

Late to the party, but I'm working on a similar issue. If you have only two variables with relatively few categories (~3), statebins works great with a bivariate color ramp. Something similar to this suggestion by Brewer. Hoping to have a public version ready to share in about a week as an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants