Template:NPVIC chart: Difference between revisions

Content deleted Content added
Template no longer has any practical connection to image it was based on, at least as far as is useful to link. A link to this template might be useful, so I've changed it to this, but it's atypical for templates to link to themselves.
Removed white rectangle behind green text
 
(38 intermediate revisions by 4 users not shown)
Line 1:
<includeonly>{{image frame|align=center|width={{#expr: {{{width|750}}}+50 }}|caption=History of state enactmentadoption of the NPVIC {{#if:{{{updated|}}}|{{as of|{{JULIANDAY.YEAR|{{MDY to Julian|{{{updated}}}}}}}|{{JULIANDAY.MONTH|{{MDY to Julian|{{{updated}}}}}}}|lc=y}}|}}. State-by-state details are in the table below.|link=Template:NPVIC chart|content=
<div style="width:{{{width|750}}}px; height:{{{height|450}}}px; position: relative;
padding: {{#expr: {{{height|450}}}/100 }}px {{#expr: {{{width|750}}}/100 }}px0px {{#expr: {{{height|450}}}/100 }}px {{#expr: {{{width|750}}}/1316 }}px; background:#F5F5F5">
<div style="border:1px solid; width:8077%; height:81%; position: relativeabsolute; box-sizing: border-box; background:white">
 
<!--Time-axis legend--><!--<div style="display:table; position: absolute; text-align: center; left: 25%; width: 50%; bottom: -12.5%;">'''Year'''</div>-->
 
<!--Vertical-axis legend--><div style="position: absolute; top: 25%; height: 50%; left: 110%; display: table; text-align:center;">
<div style="display:table-cell; vertical-align: middle; font-size: {{#expr: 100*{{{height|450}}}/450 }}%; line-height: 125%;">'''Total<br/>Electoralelectoral<br/>Votesvotes of<br/>Adoptiveadoptive<br/>Statesstates'''</div>
</div>
 
Line 19:
}}
 
<!-- Vertical-axis markers -->{{for loop|call=NPVIC chart/y-axis|pc1n=max_tot|pc1v={{#expr: 1.1*{{{max_tot|{{{curr_tot|100}}}}}}}}|pc2n=size|pc2v={{{height|450}}}|pc3n=vert-interval|pc3v={{{vert-interval|25}}}
|stop={{#expr: 1.1*{{{max_tot|{{{curr_tot|100}}}}}}/{{{vert-interval|25}}} + 1}}
}}
 
Line 31:
}}
 
<!--Current total annotation--><div style="position:absolute; left: 100%; bottom:{{#expr: (100*({{{curr_tot}}}/{{{max_tot|{{{curr_tot}}}}}})/1.1)-5}}%; height: 10%; width:40%;
display: table; text-align:centerleft;">
<div style="display:table-row;"><div style="display:table-cell; vertical-align: middle; color: green; font-size: {{#expr: 90*{{{height|450}}}/450 }}%;">'''← <span style="background-color: white;#F5F5F5">{{{curr_tot}}} ({{percent|{{{curr_tot}}}|270|1}} of 270)</span>'''</div></div>
<div style="display:table-row;"><div style="display:table-cell; height: 4px;"></div></div>
</div>
Line 40:
{{#ifexpr: (1.1*{{{max_tot|{{{curr_tot}}}}}} >= 270) |
<div style="position: absolute; width: 100%; bottom: {{#expr: 100*(270/(1.1*{{{max_tot|{{{curr_tot}}}}}})) }}%; border-bottom: 2px solid red; box-sizing: border-box;
text-align: left; height: 0%; padding: 0% 3%; font-size: {{#expr: 80*{{{height|450}}}/450 }}%; color: red;">'''270 electoral votes (threshold for activation)'''</div>
|}}
 
Line 52:
<!--Census annotations-->
{{#ifexpr: {{MDY to Julian|{{{updated|}}}}} > {{MDY to Julian|1/1/2011}} |
{{NPVIC chart/annotation|date=1/1/2011|text=Reapportionment<br/>based on<br/>2010 Censuscensus|updated={{{updated}}}|size={{{height|450}}}|curr_tot={{{curr_tot}}}|max_tot={{{max_tot|{{{curr_tot}}}}}}|census-year=2010|census_tot=74{{{census_tot_11|0}}}}}
|}}
{{#ifexpr: {{MDY to Julian|{{{updated|}}}}} > {{MDY to Julian|1/1/2021}} |
{{NPVIC chart/annotation|date=1/1/2021|text=Reapportionment<br/>based on<br/>2020 Censuscensus|updated={{{updated}}}|size={{{height|450}}}|curr_tot={{{curr_tot}}}|max_tot={{{max_tot|{{{curr_tot}}}}}}|census-year=2020|census_tot={{{census_tot_21|0}}}}}
|}}
{{#ifexpr: {{MDY to Julian|{{{updated|}}}}} > {{MDY to Julian|1/1/2031}} |
|<includeonly>{{error|This chart relies on data stored elsewhere on this page, which is not available when editing this section in isolation.}}</includeonly>}}
{{NPVIC chart/annotation|date=1/1/2021|text=Reapportionment<br/>based on<br/>2030 census|updated={{{updated}}}|size={{{height|450}}}|curr_tot={{{curr_tot}}}|max_tot={{{max_tot|{{{curr_tot}}}}}}|census-year=2030|census_tot={{{census_tot_31|0}}}}}
|}}
|<includeonly>{{error|This chart relies on data stored elsewhere on this page, which is not available when editing this section in isolation.}}</includeonly>}}
 
</div></div>
}}</includeonly><noinclude>{{docdocumentation}}</noinclude>