Template talk:Election results
This template does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | |||||||||||||||
|
|
||
This page has archives. Sections older than 180 days may be automatically archived by Lowercase sigmabot III when more than 4 sections are present. |
Alliance
[edit]Hello, I was wondering if some change could be done to make the table less bulky when there's alliance. Currently, the tables look like this :
Party or alliance | Votes | % | Seats | |||
---|---|---|---|---|---|---|
Union for the Homeland | Union for the Homeland | 8,252,357 | 36.59 | 48 | ||
Civic Front for Santiago | 378,246 | 1.68 | 4 | |||
Más para Entre Ríos | 293,605 | 1.30 | 2 | |||
Front for the Renewal of Concord | 252,335 | 1.12 | 3 | |||
Unión por San Luis | 83,178 | 0.37 | 1 | |||
Renewal Front | 38,770 | 0.17 | 0 | |||
Total | 9,298,491 | 41.23 | 58 | |||
La Libertad Avanza | La Libertad Avanza | 5,804,502 | 25.74 | 28 | ||
Ahora Patria | 305,397 | 1.35 | 2 | |||
Republican Force | 286,594 | 1.27 | 1 | |||
Federal Renewal Party | 152,853 | 0.68 | 1 | |||
Arriba Neuquén | 136,290 | 0.60 | 1 | |||
Faith Party | 126,879 | 0.56 | 1 | |||
Republicanos Unidos | 30,534 | 0.14 | 1 | |||
Total | 6,843,049 | 30.34 | 35 | |||
Juntos por el Cambio | Juntos por el Cambio | 5,519,165 | 24.47 | 27 | ||
Cambia Mendoza | 287,020 | 1.27 | 1 | |||
Juntos por Entre Ríos | 269,189 | 1.19 | 1 | |||
ECO –Vamos Corrientes | 222,006 | 0.98 | 1 | |||
Cambia Jujuy | 96,158 | 0.43 | 1 | |||
Cambia Santa Cruz | 18,595 | 0.08 | 0 | |||
Total | 6,412,133 | 28.43 | 31 | |||
Total | 22,553,673 | 100.00 | 124 |
Don't you think the tables would look better like this ?
Party or alliance | Votes | % | Seats | ||
---|---|---|---|---|---|
Union for the Homeland | 8,252,357 | 33.62 | 48 | ||
Civic Front for Santiago | 378,246 | 1.54 | 4 | ||
Más para Entre Ríos | 293,605 | 1.20 | 2 | ||
Front for the Renewal of Concord | 252,335 | 1.03 | 3 | ||
Unión por San Luis | 83,178 | 0.34 | 1 | ||
Renewal Front | 38,770 | 0.16 | 0 | ||
Total Union for the Homeland | 9,298,491 | 37.88 | 58 | ||
La Libertad Avanza | 5,804,502 | 23.65 | 28 | ||
Ahora Patria | 305,397 | 1.24 | 2 | ||
Republican Force | 286,594 | 1.17 | 1 | ||
Federal Renewal Party | 152,853 | 0.62 | 1 | ||
Arriba Neuquén | 136,290 | 0.56 | 1 | ||
Faith Party | 126,879 | 0.52 | 1 | ||
Republicanos Unidos | 30,534 | 0.12 | 1 | ||
Total La Libertad Avanza | 6,843,049 | 27.88 | 35 | ||
Juntos por el Cambio | 5,519,165 | 22.48 | 27 | ||
Cambia Mendoza | 287,020 | 1.17 | 1 | ||
Juntos por Entre Ríos | 269,189 | 1.10 | 1 | ||
ECO –Vamos Corrientes | 222,006 | 0.90 | 1 | ||
Cambia Jujuy | 96,158 | 0.39 | 1 | ||
Cambia Santa Cruz | 18,595 | 0.08 | 0 | ||
Total Juntos por el Cambio | 6,412,133 | 26.12 | 31 | ||
Total' | 22,553,673 | 100.00 | 124 |
I feel like this would be even more needed when in many countries, alliances often have quite long names, like the french New Ecological and Social People's Union. But I aknowledge that I wouldn't know how to implement this change even if it get approved here. Cordially. Aréat (talk) 01:50, 8 March 2024 (UTC)
- These tables aren't that wide, so I don't really see the need to remove an entire column. It's also somewhat confusing with the two bars of colour, especially if you're not reading a "here's what I changed" description right before. Also slightly concerned about how clear this is for screen readers.
- On the other hand, backend code wouldn't be too difficult to rearrange. Primefac (talk) 15:51, 8 March 2024 (UTC)
- In the second version, I don't think the arrangement of alliances is clear enough. The double column of colours is quite confusing, and only at the bottom do you find out that there is a total (and it's still not clear there that this is an alliance). Number 57 15:57, 8 March 2024 (UTC)
STV elections example
[edit]Hi, I'm happy to help with the coding (I know Julia, which is pretty similar to Lua), but I'm not familiar with this template or how it works.
Could the template be modified to handle STV elections? I think Template:STV Election box begin &co were used for this a few times, but they're a mess (everything strewn around 4 or 5 different templates and with none of the features of the election box template).
An STV template would need to:
- Allow for >2 rounds,
- Keep the total number of votes fixed across rounds (because the total number of ballots doesn't change),
- Indicate eliminations (e.g. with a red X mark),
- Indicate transfers (i.e. the change in each candidate's vote total from round-to-round).
Closed Limelike Curves (talk) 20:29, 20 March 2024 (UTC)
- I don't think so as adding additional rounds requires a large amount of additional code and STV elections can go on for well over ten rounds. It would likely be easier to create a separate module that mirrors the style of this one, but only has the code for multiple vote rounds and doesn't have to factor in multiple combinations of seats/alliances/DSV etc. Number 57 20:53, 20 March 2024 (UTC)
- Makes sense, thanks! Closed Limelike Curves (talk) 00:39, 21 March 2024 (UTC)
- Oh, hmm, wait; it looks like it can already handle 3 rounds, so isn't it possible to just extend whatever loop generates the second/3rd/etc. rounds?
- I'm interested in smaller elections (>10 round elections shouldn't really be displayed in a table like this, which will just get cluttered or confusing). I'm really just looking for something that can handle maybe 5 or 6 rounds. Closed Limelike Curves (talk) 15:48, 21 March 2024 (UTC)
- It doesn't work on a loop basis. Every round has to have its own coding, and it's not just for the candidate rows, but also the headings, total votes, invalid votes, blank votes, electorate etc. Also, what you're proposing would require the existing round rows to be modified, which would add even more code.
- If you're going to have a results template that works for STV, it should be done properly and be able to cover all sizes of STV elections, not just ones that one particular editor is interested in. Number 57 18:06, 21 March 2024 (UTC)
I also think a separate template would be better. I don't know how to do the template code, but I did some manual code tables for such election on the french speaking wiki, for example here and here, if it may help. One particularity that shouldn't be forgotten is the existence of the cumulative exhausted votes, starting with the second "round". Cordially. --Aréat (talk) 09:48, 4 May 2024 (UTC)
- I've started developing {{Election results-STV}}. See how it works here - there are options to include or exclude percentages. There is one last thing I need to fix (the 'Total' row not appearing properly on the version without party names), otherwise I think it is nearly ready to go (the other thing I have not decided on is whether to include gridlines on exhausted rows. Comments welcome of course! Number 57 13:44, 4 May 2024 (UTC)
- Oh, that's awesome, I didn't knew a template was already done this far. Well done!
If you wan't feedback, I find it clearer to understand the results when the rows of eliminated candidates just end and then are empty on their right side while the rows of the candidates still "in" continue to be filled. But that's just my two cents.
More importantly, from your example, it seem to me the fist count column should have the exchausted row filled with a "–" on both Votes and % subcolumns, not just %, so that it doesn't feel like the data is missing (by definition there can't be exhausted ballots in the first count).
And I'm a bit wary of your decision to show percentages with the exhausted. It really should have a "–" as well. As far as I know, exhausted votes are never part of the percentage calculation for the remaining candidates. They're out of the count. That's why on my manual tables I even placed them under the total of remaining votes. (They're still included in the total of valid votes anyways).
Finally, if you keep it above, I believe you will have to make the exhausted votes row be cumulative and indicate it as such, otherwise the total won't hold. Cordially.--Aréat (talk) 23:30, 4 May 2024 (UTC)- I hadn't done any special code for the exhausted row as I am not sure how it is normally shown. In the testcase I just created a normal row with the name 'Exhausted'. I'm open to ideas about how it could work, or whether it's even needed. Number 57 01:12, 5 May 2024 (UTC)
- Wow, that looks amazing @Number 57! Thank you so much for all your hard work on this :)
- From what I can tell, exhausted ballots are typically included in English Wikipedia infoboxes and IRV election results. Examples include 2009 Burlington mayoral election (disclosure: I made this one) along with 2018 Irish presidential election (I didn't make that one, and the rule is applied consistently across Irish elections).
- Exhausted ballots are typically "out of the count" in that they can't affect the results anymore, but still meaningful in that they usually indicate "dissatisfied voters" (ones who are unhappy with all remaining candidates).–Maximum Limelihood Estimator 02:44, 5 May 2024 (UTC)
- I'm a bit confused about what you say, as there were no exhausted ballots in the 2018 Irish presidential election as Higgins won on the first count, while for 2011 Irish presidential election (in which there were), they are not listed. From the STV election articles I've seen, exhausted ballots are not generally included. Number 57 02:55, 5 May 2024 (UTC)
- I don't doubt many STV pages don't have exhausted votes, the same way many STV pages don't even have the different counts, only the first and last ones. Compare the table in the Huon consistency on the 2022 Tasmanian Legislative Council periodic election and its page on the french wiki. That's why a proper table is needed, to make it easy to actually add all the right info. Another example showing exhausted row done right, in my opinion, would be 2018 Guernsey electoral system referendum. The amount of such votes show why the percentage isn't included toward the percentages of the actual options. Cordially. --Aréat (talk) 11:00, 5 May 2024 (UTC)
- In the context of Australian elections, ballots can't become exhausted during the count, because Australia requires full rankings (so the number of exhausted ballots is 0).
- The main issue with excluding exhausted ballots from the percentages is that, depending on context and rules for counting, exhausted ballots can affect the results. This is especially true in STV elections (where they can affect the quota), and is also true of voting systems other than IRV. –Maximum Limelihood Estimator 16:12, 5 May 2024 (UTC)
- Sorry, I meant the 2011 one!
- WRT the 2011 election, I was referring to the infobox. –Maximum Limelihood Estimator 14:38, 5 May 2024 (UTC)
- Exhausted votes definitely exist in Australia. In the example used above, Tasmania, many elections have exhausted votes, for example here in 2018. Not all states require full ranking. New South Wales, for example, doesn't require it for its legislative council. The election of 21 of its members only require voters to mark up to 15 candidates [1], [2]. Anyways, it's important to have a row. I go back on my previous statement, though, as there do seem to be some place like Ireland where indeed they're included in the count. In 2011, a candidate had to gain half of 1,771,762 valid votes, so 885,882. A candidate could thus have 50 % of the remaining non exhausted votes and not be elected until getting that number in a further round. So, the template should simply allow for exhausted votes to be included in the percentages, or not be included. It all depend on the voting system, which varies. Cordially.--Aréat (talk) 19:18, 5 May 2024 (UTC)
- Manually, the table for the irish 2011 election look like this, for example.--Aréat (talk) 19:40, 5 May 2024 (UTC)
- Ooh, I really like this. Thanks! :) –Maximum Limelihood Estimator 19:55, 5 May 2024 (UTC)
- Do you happen to have time to test Number57 template above on the irish election results to see how it compare? :] --Aréat (talk) 14:41, 10 May 2024 (UTC)
- Apologies, I will try and sort it this weekend. Just moved house and well behind on my watchlist! Number 57 22:59, 10 May 2024 (UTC)
- I was asking Maximum! Since he seemed very enthusiasmed by it. You already did a great job as far as I can see. No problem, take your time. --Aréat (talk) 12:14, 11 May 2024 (UTC)
- Apologies, I will try and sort it this weekend. Just moved house and well behind on my watchlist! Number 57 22:59, 10 May 2024 (UTC)
- Do you happen to have time to test Number57 template above on the irish election results to see how it compare? :] --Aréat (talk) 14:41, 10 May 2024 (UTC)
- Ooh, I really like this. Thanks! :) –Maximum Limelihood Estimator 19:55, 5 May 2024 (UTC)
- I don't doubt many STV pages don't have exhausted votes, the same way many STV pages don't even have the different counts, only the first and last ones. Compare the table in the Huon consistency on the 2022 Tasmanian Legislative Council periodic election and its page on the french wiki. That's why a proper table is needed, to make it easy to actually add all the right info. Another example showing exhausted row done right, in my opinion, would be 2018 Guernsey electoral system referendum. The amount of such votes show why the percentage isn't included toward the percentages of the actual options. Cordially. --Aréat (talk) 11:00, 5 May 2024 (UTC)
- I'm a bit confused about what you say, as there were no exhausted ballots in the 2018 Irish presidential election as Higgins won on the first count, while for 2011 Irish presidential election (in which there were), they are not listed. From the STV election articles I've seen, exhausted ballots are not generally included. Number 57 02:55, 5 May 2024 (UTC)
- I hadn't done any special code for the exhausted row as I am not sure how it is normally shown. In the testcase I just created a normal row with the name 'Exhausted'. I'm open to ideas about how it could work, or whether it's even needed. Number 57 01:12, 5 May 2024 (UTC)
- Oh, that's awesome, I didn't knew a template was already done this far. Well done!
Add notes in the "votes" column
[edit]I am currently editing the 1989 Polish parliamentary election article, and the results table has three different columns - one for the constituency seats reserved for independent candidates (which included Solidarity's candidates, since it had no direct nomination rights), one for the constituency seats reserved for PZPR and its satellite parties, and one for the national list (which was reserved entirely for the PZPR bloc). I would like to add a "did not contest" note in italics where the votes column would otherwise go, but the template replaces every text string with 0. Is there a way to add those notes? Glide08 (talk) 22:47, 14 May 2024 (UTC)
I'm editing the same article. In the end we want to make it look something like this:
Alliance | Party | Constituency (contested) | Constituency (reserved) | National list | Totals | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Votes | % | Seats | Votes | % | Seats | Votes | % | Seats | |||||
Patriotic Movement for National Rebirth | |||||||||||||
Polish United Workers' Party | Did not contest | 22,734,348 | 59.26 | 156 | 132,845,385 | 47.19 | 17 | 173 | |||||
United People's Party | 8,865,102 | 23.11 | 67 | 74,921,230 | 26.62 | 9 | 76 | ||||||
Democratic Party | 3,961,124 | 10.32 | 24 | 24,814,903 | 8.82 | 3 | 27 | ||||||
PAX Association | 1,216,681 | 3.17 | 7 | 24,269,761 | 8.62 | 3 | 10 | ||||||
Christian-Social Union | 907,901 | 2.37 | 6 | 16,601,896 | 5.90 | 2 | 8 | ||||||
Polish Catholic-Social Association | 681,199 | 1.78 | 4 | 8,029,911 | 2.85 | 1 | 5 | ||||||
Independents | 6,591,014 | 28.71 | 0 | Did not contest | 0 | ||||||||
Solidarity Citizens' Committee | Independents | 16,369,237 | 71.29 | 161 | 161 | ||||||||
Total | 22,960,251 | 100.00 | 161 | 38,366,355 | 100.00 | 264 | 281,483,086 | 100.00 | 35 | 460 | |||
Total voters | 17,053,171 | 100.00 | |||||||||||
Registered voters/turnout | 27,362,313 | 62.32 |
ImperatorPublius (talk) 23:16, 14 May 2024 (UTC)
Add a fourth round
[edit]I was fiddling with the Template in the sandbox, attempting to recreate the results of the 2022 Italian general election results wikitable, but I noticed that there's no option to add a fourth round like the one seen in the table below. I think it would be worthwhile to have that option for elections like the Italian ones where there are more than 3 sources of votes/seats that are independent from each other.
- TBH I think the table below should not be separated into four – the Aosta Valley is a first-past-the-post constituency and should be included in the FPTP column. Number 57 21:33, 18 June 2024 (UTC)
Coalition | Party | Proportional | First-past-the-post | Aosta Valley | Overseas | Total seats | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Votes | % | Seats | Votes | % | Seats | Votes | % | Seats | Votes | % | Seats | |||||
Centre-right | Brothers of Italy | 7,302,517 | 26.00 | 69 | 12,300,244 | 43.79 | 49 | 16,016 | 28.80 | – | 281,949 | 26.00 | 1 | 119 | ||
League | 2,464,005 | 8.77 | 23 | 42 | – | 1 | 66 | |||||||||
Forza Italia | 2,278,217 | 8.11 | 22 | 23 | – | – | 45 | |||||||||
Us Moderates | 255,505 | 0.91 | – | 7 | – | — | — | — | 7 | |||||||
Centre-left | Democratic Party – IDP | 5,356,180 | 19.07 | 57 | 7,337,975 | 26.13 | 8 | — | — | — | 305,759 | 28.20 | 4 | 69 | ||
Greens and Left Alliance | 1,018,669 | 3.63 | 11 | 1 | — | — | — | 52,994 | 4.89 | – | 12 | |||||
More Europe | 793,961 | 2.83 | – | 2 | — | — | — | 29,971 | 2.76 | – | 2 | |||||
Civic Commitment | 169,165 | 0.60 | – | 1 | — | — | — | 11,590 | 1.07 | – | 1 | |||||
Five Star Movement | 4,333,972 | 15.43 | 41 | 4,333,972 | 15.43 | 10 | — | — | — | 93,338 | 8.61 | 1 | 52 | |||
Action – Italia Viva | 2,186,669 | 7.79 | 21 | 2,186,669 | 7.79 | – | — | — | — | 60,499 | 5.58 | – | 21 | |||
South Tyrolean People's Party – PATT | 117,010 | 0.42 | 1 | 117,010 | 0.42 | 2 | — | — | — | — | — | — | 3 | |||
South calls North | 212,685 | 0.76 | – | 212,685 | 0.76 | 1 | — | — | — | — | — | — | 1 | |||
Aosta Valley | — | — | — | — | — | — | 20,763 | 38.63 | 1 | — | — | — | 1 | |||
Associative Movement of Italians Abroad | — | — | — | — | — | — | — | — | — | 141,356 | 13.04 | 1 | 1 | |||
Others | 1,599,227 | 5.68 | – | 1,599,227 | 5.68 | – | 16,967 | 32.57 | – | 106,847 | 9.85 | – | – | |||
Total | 28,087,782 | 100 | 245 | 28,087,782 | 100 | 146 | 53,746 | 100 | 1 | 1,084,303 | 100 | 8 | 400 |
GlowstoneUnknown (talk) 03:03, 18 June 2024 (UTC)
Percentages
[edit]The template shows the percentages without counting blank votes. This in turn shows wrong results AlexBobCharles (talk) 08:48, 12 July 2024 (UTC)
- Blank votes can be added in cases where they are considered valid votes (such as in Colombian presidential elections). See, for example, here. However, this should only be done when blank votes are deemed to be valid votes (i.e. NOTA). Cheers, Number 57 21:57, 12 July 2024 (UTC)
Night mode: overall statistics barely visible
[edit]Labels of overall statistics are barely visible. This applies to things like the labels of "Valid votes", "Invalid votes", "Blank votes". These labels are set with "background: inherit". The night mode extension applies an #202122 text color of anything with an background color, in the belief that the background color is different than black. In this case though, the background is dark, so the text is barely visible. Snævar (talk) 18:20, 15 July 2024 (UTC)
Can you guys make election results template for Serbian Wikipedia?
[edit]I'll help into making it for Serbian Wikipedia. “Template:Election results” will be “Шаблон:Изборни резултати” (Infobox will be Инфокутија). Votes are “Гласови”, Seats are “Мандати” etc. Hadjnix (talk) 09:05, 19 July 2024 (UTC)
ipct1, ipct2 don't seem to work
[edit]In 2024 Venezuelan presidential election#Results announced by the CNE and 2024 Venezuelan presidential election#Results announced by the PUD there is currently a big problem of poor sourcing. How can we prevent the template from calculating totals when it's too early?
For the PUD version, I tried inserting ipct1= and ipct2 values, but this didn't override the automatic calculations of percentages, and of writing a total. Feel free to edit my sandbox with User:Boud/sandbox#election results template directly if that's faster than explaining. Boud (talk) 11:35, 30 July 2024 (UTC)
- The ipct1, ipct2 variables work,
but only if the count, not total count, is absent. This is a documentation bug.Still, itwould beis (edit) nice to be able to have the official counts and percentages while blocking the total. Boud (talk) 12:26, 30 July 2024 (UTC)- The doc could maybe still be improved slightly, but the functions are fine. Boud (talk) 12:42, 30 July 2024 (UTC)
- Done Boud (talk) 12:47, 30 July 2024 (UTC)
- The doc could maybe still be improved slightly, but the functions are fine. Boud (talk) 12:42, 30 July 2024 (UTC)