Comments (4)
I think we need to revert back to the previous way of defining the parliament style in the draw_...()
functions. It is unfortunate, but I think in the long run it will create more issues for us fixing a "bug" that has been sent to CRAN and other users receive warnings when they try to plot their ggparliament object. What do you think @RobWHickman ?
from ggparliament.
I wonder if there's a way to map the type of parliament onto the data. My brain is too fried at the moment to think of any other than an extra column of 'type' which is obviously a bad idea.
Otherwise, I wonder if the x/y positions of the 'seats' can imply the type? But I cant really think of a good way to do that either.
A final other option might be to kind of do what the original package did where the user calls a function that wraps ggplot() + geoms() + scales() + ... but again, seems suboptimal.
Think you might be right that going back to defining the type each line is the best way but something about it sets my teeth on edge
from ggparliament.
Another option is we get draw_...()
to recognize where to print regardless of the type. For example, draw_totalseats()
can be rewritten so the y coordinate for the total seats label is 25% of the height of y axis. Then we wouldn't need to specify y = 3 and y = 0.2 for horseshoe and semicircle parliaments, respectively.
The same goes for party labels - I wonder if we can move outwards from the last row using percentage points or unit points or whatever.
If you look at the majority threshold function, it kind of already works like this.. The opposing bench style finds the x and y coordinates for n, the majority threshold number, and draws a line between the the minimum value for x and the maximum value for x given that y is the same as the y coordinate for n.
I tried to figure out how to do this for horseshoe and semicircle but I kind of gave up, LOL. The main issue was that the minimum value for x,y start at (0,0) because the plot starts at that point instead of at (0, min(row 1 for majority threshold)). We should be able to find the point for n, then find the closest row 1 and the max row nearest to n, then draw a line from min(y coord for row) - 0.5 to max(y coord for row) + 0.5.
If we can solve that issue, the only problem is that the opposing bench line is horizontal, not vertical. But I've been thinking about switching that around anyway, so that one bench is on top and the other is below which would fix the problem. Or we can create a switch option here, where the user can switch between horizontal or vertical orientation... Which would be much better than defining by type every time, I agree.
from ggparliament.
yeah that makes sense. I think also might feed into changing the benches geom to being one plot rather than two patched together? I haven't interrogated patchwork, but I imagine drawing a line across two plots won't make it happy?
from ggparliament.
Related Issues (20)
- Paper HOT 1
- classroom parliaments flipped HOT 1
- Unknown or uninitialised column: 'party'. HOT 1
- Will parliament_data work for long data sets?
- Submission to CRAN HOT 2
- Minor issues to fix for next release HOT 2
- error with german government data HOT 3
- README/ Vignette self-defined data walkthrough
- Solid filling HOT 4
- Sort parties by ideological position HOT 1
- Vignettes -- fuzzy graphs
- Issue in scale color manual 'limits' argument HOT 4
- Add JOSS Badge to README HOT 1
- Migrate from travis-ci to github actions HOT 1
- Maintenance HOT 2
- Add data for German "Bundestag" elections in 2021
- Error with colour data for 'australia'
- geoms versus monolithic ggplot objects HOT 5
- scale_colour_party() HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ggparliament.