Skip to content

Commit

Permalink
Fixed flag file issue, fixed data withheld issue, added choropleth re…
Browse files Browse the repository at this point in the history
…ndering effect
  • Loading branch information
braxex committed Jan 13, 2018
1 parent fae3e1a commit 51f8720
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 19 deletions.
3 changes: 2 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class App extends Component {
let colors = (this.state.radioDataset === 'LPR') ? this.props.lprColors : this.props.niColors;
let thresholds = (this.state.radioDataset === 'LPR') ? this.props.lprThresholds : this.props.niThresholds;
return (

<div className="App">

{/*Header Section*/}
Expand Down Expand Up @@ -441,7 +442,7 @@ App.defaultProps = {
titleNotes = {
lprMsg: "Lawful permanent residents (LPRs, often referred to as “immigrants” or “green card holders”) are non-citizens who are lawfully authorized to live permanently in the US. LPRs may apply to become US citizens if they meet certain eligibility requirements. LPRs do not include foreign nationals granted temporary admission to the US, such as tourists and temporary workers (including H1B visa holders). 5-year average: ≈1.03 million/year. <br/> <br/> For more information, visit <a href='https://goo.gl/dN78yY'>https://goo.gl/dN78yY</a>.",
niMsg: "Nonimmigrants (NIs) are foreign nationals granted temporary admission into the US for reasons including tourism and business trips, academic/vocational study, temporary employment, and to act as a representative of a foreign government or international organization. NIs are authorized to enter the country for specific purposes and defined periods of time, which are prescribed by their class of admission. 5-year average: ≈63.72 million/year. <br/> <br/> For more information visit <a href='https://goo.gl/LJLYzc'>https://goo.gl/LJLYzc</a>.",
genMsg: "Data not shown for those with unknown country of birth/origin and for countries where total activity count was less than 10 people. <br/> DW = Data withheld to limit disclosures, per government sources."
genMsg: "Data not shown for those with unknown country of birth/origin and for countries where total activity count was less than 10 people. <br/> dw = Data withheld to limit disclosures, per government sources."
}

export default App;
31 changes: 18 additions & 13 deletions src/Card.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Card extends Component {
return(
<div className='card-holder' style={{top: (this.props.y), left: this.props.x-425}}>
{!countryData.immigrationData ?
<div className='card-nodata'>No data available.</div>
<div className='card-nodata'>No data provided.</div>
:
<div>
<div className='card-head'>
Expand All @@ -33,41 +33,46 @@ class Card extends Component {
</div>
<div className='card-title'>
<p><b>{countryData.immigrationData.countryName}</b></p>
<p>{selectedYear} Selected Total: <b>{countryData.immigrationData.selectedTotal.toLocaleString()}</b></p>
<p>{selectedYear} Selected {selectedSet} Total: <b>
{selectedSet === "LPR" ?
selectedKeys.length === 6 ? countryData.immigrationData.total.toLocaleString()
: countryData.immigrationData.selectedTotal.toLocaleString()
: selectedKeys.length === 5 ? countryData.immigrationData.total.toLocaleString()
: countryData.immigrationData.selectedTotal.toLocaleString()}</b></p>
</div>
</div>
<div className='card-data lpr-card-data'
style={{display: selectedSet === "LPR" ? 'block' : 'none'}}>
{selectedSet === "LPR" ?
<div>
<p style={{fontWeight: selectedKeys.indexOf('immediateRelative') !== -1 ? 'bold' : 'normal'}}
>Immediate Relative: {countryData.immigrationData.immediateRelative.toLocaleString() ? countryData.immigrationData.immediateRelative.toLocaleString(): 'DW'}</p>
>Immediate Relative: {isNaN(countryData.immigrationData.immediateRelative) ? 'dw' : countryData.immigrationData.immediateRelative.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('familySponsored') !== -1 ? 'bold' : 'normal'}}
>Family-Sponsored: {countryData.immigrationData.familySponsored.toLocaleString() ? countryData.immigrationData.familySponsored.toLocaleString(): 'DW'}</p>
>Family-Sponsored: {isNaN(countryData.immigrationData.familySponsored) ? 'dw' : countryData.immigrationData.familySponsored.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('refugeeAsylee') !== -1 ? 'bold' : 'normal'}}
>Refugee & Asylee: {countryData.immigrationData.refugeeAsylee.toLocaleString() ? countryData.immigrationData.refugeeAsylee.toLocaleString(): 'DW'}</p>
>Refugee & Asylee: {isNaN(countryData.immigrationData.refugeeAsylee) ? 'dw' : countryData.immigrationData.refugeeAsylee.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('employmentBased') !== -1 ? 'bold' : 'normal'}}
>Employment-Based: {countryData.immigrationData.employmentBased.toLocaleString() ? countryData.immigrationData.employmentBased.toLocaleString(): 'DW'}</p>
>Employment-Based: {isNaN(countryData.immigrationData.employmentBased) ? 'dw' : countryData.immigrationData.employmentBased.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('diversityLottery') !== -1 ? 'bold' : 'normal'}}
>Diversity Lottery: {countryData.immigrationData.diversityLottery.toLocaleString() ? countryData.immigrationData.diversityLottery.toLocaleString(): 'DW'}</p>
>Diversity Lottery: {isNaN(countryData.immigrationData.diversityLottery) ? 'dw' : countryData.immigrationData.diversityLottery.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('otherLPR') !== -1 ? 'bold' : 'normal'}}
>Other: {countryData.immigrationData.otherLPR.toLocaleString() ? countryData.immigrationData.otherLPR.toLocaleString(): 'DW'}</p>
>Other: {isNaN(countryData.immigrationData.otherLPR) ? 'dw' : countryData.immigrationData.otherLPR.toLocaleString()}</p>
</div>: <div></div>}
</div>
<div className='card-data ni-card-data'
style={{display: selectedSet === "NI" ? 'block' : 'none'}}>
{selectedSet === "NI" ?
<div>
<p style={{fontWeight: selectedKeys.indexOf('temporaryVisitor') !== -1 ? 'bold' : 'normal'}}
>Temporary Visitor: {countryData.immigrationData.temporaryVisitor.toLocaleString() ? countryData.immigrationData.temporaryVisitor.toLocaleString(): 'DW'}</p>
>Temporary Visitor: {isNaN(countryData.immigrationData.temporaryVisitor) ? 'dw' : countryData.immigrationData.temporaryVisitor.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('temporaryWorker') !== -1 ? 'bold' : 'normal'}}
>Temporary Worker: {countryData.immigrationData.temporaryWorker.toLocaleString() ? countryData.immigrationData.temporaryWorker.toLocaleString(): 'DW'}</p>
>Temporary Worker: {isNaN(countryData.immigrationData.temporaryWorker) ? 'dw' : countryData.immigrationData.temporaryWorker.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('studentExchange') !== -1 ? 'bold' : 'normal'}}
>Student & Exchange: {countryData.immigrationData.studentExchange.toLocaleString() ? countryData.immigrationData.studentExchange.toLocaleString(): 'DW'}</p>
>Student & Exchange: {isNaN(countryData.immigrationData.studentExchange) ? 'dw' : countryData.immigrationData.studentExchange.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('diplomatRep') !== -1 ? 'bold' : 'normal'}}
>Diplomat & Representative: {countryData.immigrationData.diplomatRep.toLocaleString() ? countryData.immigrationData.diplomatRep.toLocaleString(): 'DW'}</p>
>Diplomat & Representative: {isNaN(countryData.immigrationData.diplomatRep) ? 'dw' : countryData.immigrationData.diplomatRep.toLocaleString()}</p>
<p style={{fontWeight: selectedKeys.indexOf('otherNI') !== -1 ? 'bold' : 'normal'}}
>Other: {countryData.immigrationData.otherNI.toLocaleString() ? countryData.immigrationData.otherNI.toLocaleString(): 'DW'}</p>
>Other: {isNaN(countryData.immigrationData.otherNI) ? 'dw' : countryData.immigrationData.otherNI.toLocaleString()}</p>
</div>: <div></div>}
</div>
<div className='card-notes'
Expand Down
3 changes: 3 additions & 0 deletions src/Visualizer.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
path {
-webkit-transition: fill 0.5s ease;
transition: fill 0.5s ease; }
4 changes: 4 additions & 0 deletions src/Visualizer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
path {
-webkit-transition: fill 0.5s ease;
transition: fill 0.5s ease;
}
10 changes: 5 additions & 5 deletions src/flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export let flags = [
['ARM', 'Armenia', 'https://upload.wikimedia.org/wikipedia/commons/d/de/Flag_of_Armenia_%283-2%29.svg'],
['ABW', 'Aruba', 'https://upload.wikimedia.org/wikipedia/commons/f/f6/Flag_of_Aruba.svg'],
['AUS', 'Australia', 'https://upload.wikimedia.org/wikipedia/commons/8/88/Flag_of_Australia_%283-2_aspect_ratio%29.svg'],
['AUT', 'Austria', 'https://commons.wikimedia.org/wiki/File:Flag_of_Austria.svg'],
['AUT', 'Austria', 'https://upload.wikimedia.org/wikipedia/commons/4/41/Flag_of_Austria.svg'],
['AZE', 'Azerbaijan', 'https://upload.wikimedia.org/wikipedia/commons/7/74/Flag_of_Azerbaijan_%283-2%29.svg'],
['BHS', 'Bahamas', 'https://upload.wikimedia.org/wikipedia/commons/8/8f/Flag_of_the_Bahamas_%283-2%29.svg'],
['BHR', 'Bahrain', 'https://upload.wikimedia.org/wikipedia/commons/6/6b/Flag_of_Bahrain_%283-2%29.svg'],
Expand All @@ -26,7 +26,7 @@ export let flags = [
['BMU', 'Bermuda', 'https://upload.wikimedia.org/wikipedia/commons/b/bf/Flag_of_Bermuda.svg'],
['BTN', 'Bhutan', 'https://upload.wikimedia.org/wikipedia/commons/9/91/Flag_of_Bhutan.svg'],
['BOL', 'Bolivia', 'https://upload.wikimedia.org/wikipedia/commons/a/ad/Flag_of_Bolivia_%283-2%29.svg'],
['BIH', 'Bosnia and Herzegovina', 'https://upload.wikimedia.org/wikipedia/commons/e/ed/Flag_of_Bosnia_and_Herzegovina_%283-2%29.svg'],
['BIH', 'Bosnia and Herzegovina', 'https://upload.wikimedia.org/wikipedia/commons/b/bf/Flag_of_Bosnia_and_Herzegovina.svg'],
['BWA', 'Botswana', 'https://upload.wikimedia.org/wikipedia/commons/f/fa/Flag_of_Botswana.svg'],
['BRA', 'Brazil', 'https://upload.wikimedia.org/wikipedia/commons/a/a2/Flag_of_Brazil_%283-2%29.svg'],
['VGB', 'British Virgin Islands', 'https://upload.wikimedia.org/wikipedia/commons/4/42/Flag_of_the_British_Virgin_Islands.svg'],
Expand Down Expand Up @@ -63,13 +63,13 @@ export let flags = [
['ECU', 'Ecuador', 'https://upload.wikimedia.org/wikipedia/commons/e/e8/Flag_of_Ecuador.svg'],
['EGY', 'Egypt', 'https://upload.wikimedia.org/wikipedia/commons/f/fd/Egypt_Flag.svg'],
['SLV', 'El Salvador', 'https://upload.wikimedia.org/wikipedia/commons/8/8c/Flag_of_El_Salvador_%283-2%29.svg'],
['GNQ', 'Equatorial Guinea', 'https://commons.wikimedia.org/wiki/Category:SVG_flags_of_Equatorial_Guinea#/media/File:Flag_of_Equatorial_Guinea.svg'],
['GNQ', 'Equatorial Guinea', 'https://upload.wikimedia.org/wikipedia/commons/3/31/Flag_of_Equatorial_Guinea.svg'],
['ERI', 'Eritrea', 'https://upload.wikimedia.org/wikipedia/commons/2/29/Flag_of_Eritrea.svg'],
['EST', 'Estonia', 'https://upload.wikimedia.org/wikipedia/commons/9/9a/Flag_of_Estonia_%283-2%29.svg'],
['ETH', 'Ethiopia', 'https://upload.wikimedia.org/wikipedia/commons/6/69/Flag_of_Ethiopia_%283-2%29.svg'],
['FSM', 'Federated States of Micronesia', 'https://upload.wikimedia.org/wikipedia/commons/e/e4/Flag_of_the_Federated_States_of_Micronesia.svg'],
['FJI', 'Fiji', 'https://commons.wikimedia.org/wiki/Category:SVG_flags_of_Fiji#/media/File:Flag_of_Fiji_(3-2).svg'],
['FIN', 'Finland', 'https://commons.wikimedia.org/wiki/Category:SVG_flags_of_Finland#/media/File:Flag_of_Finland_(3-2).svg'],
['FJI', 'Fiji', 'https://upload.wikimedia.org/wikipedia/commons/b/ba/Flag_of_Fiji.svg'],
['FIN', 'Finland', 'https://upload.wikimedia.org/wikipedia/commons/b/bc/Flag_of_Finland.svg'],
['FRA', 'France', 'https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg'],
['GUF', 'French Guiana', 'https://upload.wikimedia.org/wikipedia/commons/c/c3/Flag_of_France.svg'],
['PYF', 'French Polynesia', 'https://upload.wikimedia.org/wikipedia/commons/d/db/Flag_of_French_Polynesia.svg'],
Expand Down

0 comments on commit 51f8720

Please sign in to comment.