Template:NPVIC chart: Difference between revisions

Content deleted Content added
mNo edit summary
Removed white rectangle behind green text
 
(48 intermediate revisions by 5 users not shown)
Line 1:
<includeonly>{{image frame|align=center|width={{#expr: {{{sizewidth|500750}}}+50 }}|caption=History of stateadoption participation inof the NPVIC {{#if:{{{updated|}}}|{{as of|{{JULIANDAY.YEAR|{{MDY to Julian|{{{updated}}}}}}}|{{JULIANDAY.MONTH|{{MDY to Julian|{{{updated}}}}}}}|lc=y}}|}}|link=File:NPVIC participants.svg<! State-by-SVGstate imagedetails isare likelyin tothe betable outdated-->below.|link=Template:NPVIC chart|content=
<div style="width:{{{sizewidth|500750}}}px; height:{{#expr: 0.75*{{{sizeheight|500450}}} }}px; position: relative;
padding: {{#expr: {{{sizeheight|500450}}}/100 }}px 0px {{#expr: {{{sizeheight|500450}}}/100 }}px {{#expr: {{{sizewidth|500750}}}/10016 }}px; {{background:#expr: {{{size|500}}}/13 }}px;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: 90100*{{{sizeheight|500450}}}/500450 }}%; line-height: 125%;">'''Total<br/>Electoralelectoral<br/>Votesvotes of<br/>Adoptiveadoptive<br/>Statesstates'''</div>
</div>
 
{{#if: {{#section:{{FULLPAGENAME}}|passed}} |
<!-- Time-axis markers -->{{for loop|call=NPVIC chart/x-axis|pc1n=updated|pc1v={{{updated|1/1/2017}}}|pc2n=size|pc2v={{{sizeheight|500450}}}|pc3n=year-interval|pc3v={{{year-interval|1}}}
|stop={{#expr: ({{str rightc|{{{updated|1/1/2017}}}|4}} - 2006)/{{{year-interval|1}}} + 1}}
}}
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={{{sizeheight|500450}}}|pc3n=vert-interval|pc3v={{{vert-interval|25}}}
|stop={{#expr: 1.1*{{{max_tot|{{{curr_tot|100}}}}}}/{{{vert-interval|25}}} + 1}}
}}
 
<!--Data bars-->{{for loop||call=NPVIC chart/bar |pc1n=size|pc1v={{{sizeheight|500450}}}|pc2n=max_tot|pc2v={{{max_tot|{{{curr_tot}}}}}}|pc3n=updated|pc3v={{{updated}}}
| {{{1}}}| {{{2}}}| {{{3}}}| {{{4}}}| {{{5}}}| {{{6}}}| {{{7}}}| {{{8}}}| {{{9}}}|{{{10}}}
|{{{11}}}|{{{12}}}|{{{13}}}|{{{14}}}|{{{15}}}|{{{16}}}|{{{17}}}|{{{18}}}|{{{19}}}|{{{20}}}
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: 8090*{{{sizeheight|500450}}}/500450 }}%;">'''← <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*{{{sizeheight|500450}}}/500450 }}%; color: red;">'''270 electoral votes (threshold for activation)'''</div>
|}}
 
<!--Optional time-axis annotations-->
{{#if: {{{note-date1|}}}| {{NPVIC chart/annotation|date={{{note-date1}}}|text={{{note-text1}}}|updated={{{updated}}}|size={{{sizeheight|500450}}}}} }}
{{#if: {{{note-date2|}}}| {{NPVIC chart/annotation|date={{{note-date2}}}|text={{{note-text2}}}|updated={{{updated}}}|size={{{sizeheight|500450}}}}} }}
{{#if: {{{note-date3|}}}| {{NPVIC chart/annotation|date={{{note-date3}}}|text={{{note-text3}}}|updated={{{updated}}}|size={{{sizeheight|500450}}}}} }}
{{#if: {{{note-date4|}}}| {{NPVIC chart/annotation|date={{{note-date4}}}|text={{{note-text4}}}|updated={{{updated}}}|size={{{sizeheight|500450}}}}} }}
{{#if: {{{note-date5|}}}| {{NPVIC chart/annotation|date={{{note-date5}}}|text={{{note-text5}}}|updated={{{updated}}}|size={{{sizeheight|500450}}}}} }}
 
<!--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={{{sizeheight|500450}}}|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={{{sizeheight|500450}}}|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>