Skip to content

Instantly share code, notes, and snippets.

@elon-
Last active May 5, 2016 05:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save elon-/e7c275826d5d4d6ca78ee1a0fbc86890 to your computer and use it in GitHub Desktop.
Save elon-/e7c275826d5d4d6ca78ee1a0fbc86890 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<title>visa issued by indian embassy</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css" integrity="sha384-fLW2N01lMqjakBkx3l/M9EahuwpSfeNvV63J5ezn3uZzapT0u7EYsXMjQV+0En5r" crossorigin="anonymous">
<link href='https://fonts.googleapis.com/css?family=Lora' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<center><h1>Comprehensive Analysis of Various Visa Issued to the Different Nationalities by India embassy</h1>
</center>
<div class="container">
<div class="row ">
<div class=" col-md-12 introduction ">
<p> Indians are moving out of their home country a lot faster than like before. There are many articles on web giving information on how many Indian are moving out in search of better education and work.Wikipedia says more than 30 million Indian live overseas, which is the same as the total population of Canada.<br> Whether building the world’s tallest skyscraper in Dubai (The Burj Khalifa) or developing google's and FB next software updates you can always find Indians in your team.<br> This article is the other way around, This is all about why people around the world like traveling to India. I have tried to pull data from <a href="https://data.gov.in/">Digital india initiative</a> to perform a comprehensive analysis on various visas issued by india embassy to people from different nationality. </p>
<p>I would be answering the following question: </p>
<ol>
<li>Do people travel to india just for tourism, or is india also a popular destination for business and education.</li>
<li>Did the cricket world cup in 2011 bring more people and boost tourism to the nation.</li>
<li>Why is India building the world’s most expensive wall at its border.</li>
</ol>
</div>
</div>
</div>
<div class="container">
<div class="row ">
<h2><center><u>Number of visa issued has been increasing on yearly bases.</u></center></h2>
<div class="well col-md-6 line_chart ">
<h4><center><u>Visa approved every year</u></center></h4>
</div>
<div class=" col-md-6 ">
<h2><u>Inference Box</u></h2>
<ol class="line_chart_text">
<li>Visa stamping increased to <em>30 times</em> more in 2011 compared to previous year 2010.</li>
<ul>
<li>The 2011 cricket world cup might have made the buzz as more people from England, Bangladesh and Sri Lankan come to visit the nation to see there country play the games.</li>
</ul>
<li>The year 2012 is the peak year as 2.9 million people were issued which highest number of visa is issued so for.</li>
<ul>
<li>Interestingly almost close to 1 million people from Bangladesh and England were issued. I will keep trying to find any supposing reason why this disproportionality exits.</li>
</ul>
<li> The year 2013 saw a <em>12 %</em> drop in visa issuesed with respect to the previouse year 2012.</li>
<ul>
<li>The reason might be india was headed towords elections and growing anti-incumbency to the ruling party led to a large political chaos and protest.</li>
</ul>
</ol>
</div>
</div>
</div>
<div class="container">
<div class="row ">
<div class="well col-md-12 stacked_bar">
<h3><center><u>Annual visa approval for different categories</u></center></h3>
<div class="radio">
<label class="radio-inline">
<input type="radio" name="optionsRadios" id="s" value="stacked" checked>
stacked
</label >
<label class="radio-inline">
<input type="radio" name="optionsRadios" id="g" value="group" >
group
</label>
</div>
</div>
<div class=" col-md-12 different_visa">
<p>There are 21 different categories of visa type stamped by Indian embassy. The top 5 categories [Employment, Tourist, Business, Visitor, Art Surrogacy and Student] add up 90% of total visa approved by the embassy. About 93% of total visa stamped are Tourist visa as in last 4 years close to 6 million people have travel to visit India for their holidays. As India steps up to global business this can be seen as increase in business trip to India but is this a significant increase, is whole lot of different analysis to do in future. </p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 well multi_series">
<h3><center><u>Top 5 country's with most number of visa approved</u></center></h3>
</div>
<div class="col-md-4 people">
</div>
</div>
<div class="row top_country">
<div class="col-md-12">
<p>During my initial observation I was able to find out that out of 82 country top 10 county contribute 85% of the visa stamped and top 5 [Bangladesh, United Kingdom, America, Germany] contribute to 60% of visa approved. Out of the top 5 country, Bangladesh is odd one and it seems a lot of Bangladesh people has been moving into the country on increasing phrase. During this period there has been number of issues that illegal immigration that cases tension between the nations. These immigration issues where even outspoken by various party during the 2013 election as the problem moves beyond immigration as two nation are dominated by two different religion mainly Hindu and Muslim. This is the reason behind India building world’s most expensive wall to control people from Bangladesh from coming. A <a href="https://www.youtube.com/watch?v=mlTFOQoq0iw">test-tube video</a> has a lot more details if you are interested on world’s most expensive wall.
</p>
</div>
</div>
</div>
<!-- Libery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
<!-- D3.js -->
<script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="http://d3js.org/queue.v1.min.js"></script>
<!-- D3 legand -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/d3-legend/1.10.0/d3-legend.js'></script>
<!-- tooltip-->
<link rel="stylesheet" href="//rawgithub.com/Caged/d3-tip/master/examples/example-styles.css">
<!-- Dimple.js -->
<script src="http://dimplejs.org/dist/dimple.v2.1.6.min.js"></script>
<!-- User Files -->
<script type="text/javascript" src="line_chart.js"></script>
</body>
</html>
function line_chart(data){
var margin = { top: 10, right: 10, bottom: 30, left: 40 },
width = 540 - margin.left - margin.right,
height = 440 - margin.top - margin.bottom;
var svg=dimple.newSvg('.line_chart',420,320);
var myChart=new dimple.chart(svg,data);
myChart.setBounds(50, 20, 330, 250);
var x = myChart.addTimeAxis('x', 'YEAR','%Y','%Y');
myChart.addMeasureAxis('y', 'VISA APPROVED');
x.addOrderRule('Year');
var line=myChart.addSeries(null, dimple.plot.line);
line.lineWeight=3;
line.lineMarkers=true;
myChart.draw();
}
// stack bar//
function stack_chart(data){
var margin = {top: 20, right: 50, bottom: 30, left: 70},
width = 800 - margin.left - margin.right,
height = 420 - margin.top - margin.bottom,
padding = 5;
/*var yGroupMax=d3.max(layer,function(layer){return d3.max(layer,function(d){return d.y;});});*/
var n=5;
var visa=Object.keys(data[0]).slice(1);
var stack_data=visa.map(function(v){
return data.map(function(d){
return {x:d.DATE,y:+d[v]};
});
});
var layout=d3.layout.stack();
layer=layout(stack_data);
var yGroupMax=d3.max(layer,function(layer){return d3.max(layer,function(d){return d.y;});});
var yStackedMax=d3.max(layer,function(d){return d3.max(d,function(d){return d.y+d.y0;});});
// setting up scale
//stetting up x-scale
var x =d3.scale.ordinal()
.domain(layer[0].map(function(d){
return (d.x);
}))
.rangeRoundBands([0,width],.3);
// setting up y-scale
var y=d3.scale.linear()
.domain([0,
d3.max(layer,function(d){
return d3.max(d,function(d){
return d.y+d.y0;
});
})])
.range([height,0]);
// color for the bar
var colorRange = d3.scale.category10();
var color = d3.scale.ordinal()
.range(colorRange.range());
// legend
var legend = d3.legend.color()
.shapeWidth(70)
.orient('vertical')
.labels(['EMPLOYMENT','TOURIST','BUSINESS','VISITOR','ART SURROGACY','STUDENT'])
.scale(color);
// Creating Axis
var xAxis= d3.svg.axis()
.scale(x)
.tickSize(10)
.tickPadding(3)
.orient('bottom');
var yAxis=d3.svg.axis()
.scale(y)
.tickSize(10)
.tickPadding(10)
.tickFormat(d3.format('s'))
.orient('left');
// Creat a svg for stacked bar
var svg=d3.select('.stacked_bar').append('svg')
.attr('width',width + margin.left + margin.right)
.attr('height',height +margin.top+margin.bottom)
.append('g')
.attr('transform','translate('+margin.left+',20)');
var layer=svg.selectAll('.layer')
.data(layer)
.enter().append('g')
.attr('class','layer')
.style('fill',function(d,i){
return color(i);});
var rect=layer.selectAll('rect')
.data(function (d){return d;})
.enter().append('rect')
.attr('x',function(d)
{ return x(d.x);})
.attr('y',height)
.attr('width',101)
.attr('height',0 );
rect.transition()
.delay(function(d,i){
return i*10;
})
.attr('y',function(d){
return y(d.y0+d.y);})
.attr('height',function(d){
return y(d.y0)-y(d.y+d.y0) ;});
//drawing axis
// xAxis
svg.append('g')
.attr('class','x axis' )
.attr('transform','translate(5,'+height+')' )
.call(xAxis);
// yAxis
svg.append('g')
.attr('class','y axis')
.attr('transform','translate(15,0)')
.call(yAxis);
// legend
svg.append('g')
.attr('class','legend_title' ).append('text')
.attr('transform','translate(50,5)')
.text('Visa Categories');
svg.append('g')
.attr('class','legend')
.attr('transform','translate(50,15)')
.call(legend);
// y-axis label
svg.append('g').attr('class','y_label' ).append('text')
.attr('text-anchor', 'middle') // this makes it easy to centre the text as the transform is applied to the anchor
.attr('transform', 'translate(-50,'+(height/2)+')rotate(-90)') // text is drawn off the screen top left, move down and out and rotate
.text('Visa Approved');
d3.selectAll('input').on('change',change);
var timeout=setTimeout(function(){
d3.select('input[value=\'group\']').property('checked',true).each(change);
},2000);
function change(){
clearTimeout(timeout);
if (this.value==='group')transitionGroup();
else transitionStacked();
}
function transitionGroup(){
y.domain([0,yGroupMax]);
rect.transition()
.duration(500)
.delay(function(d,i){return i*10;})
.attr('x',function(d,i,j){return x(d.x)+x.rangeBand()/n*j;} )
.attr('width',x.rangeBand()/n )
.transition()
.attr('y',function(d) {return y(d.y);})
.attr('height',function(d){return height-y(d.y);} )
;
}
function transitionStacked(){
y.domain([0,yStackedMax]);
rect.transition()
.duration(500)
.delay(function(d,i){return i*10;})
.attr('y',function(d){return y(d.y0+d.y);} )
.attr('height',function(d){return y(d.y0)-y(d.y0+d.y); } )
.transition()
.attr('x',function(d){return x(d.x);} )
.attr('width',101);
}
}
function multi_line(multi_series){
var svg=dimple.newSvg('.multi_series', 500,320);
var data=dimple.filterData(multi_series,'COUNTRY',['BANGLADESH','UNITED KINGDOM','USA','GERMANY','SRI LANKA']);
var myChart= new dimple.chart(svg,data);
var x = myChart.addCategoryAxis('x', 'YEAR');
x.addOrderRule('Year');
myChart.addMeasureAxis('y', 'VISA APPROVED');
var s = myChart.addSeries('COUNTRY', dimple.plot.line);
s.lineWeight=3;
s.lineMarkers=true;
s.interpolation = 'cardinal';
myChart.addLegend(60, 10, 500, 20, 'left');
myChart.draw();
}
var file_loc = ['line_chart_total_visa.csv','stack_bar_data.csv','line_chart_top_5_country.csv'];
queue()
.defer(d3.csv,file_loc[0])
.defer(d3.csv,file_loc[1])
.defer(d3.csv,file_loc[2])
.await(analyze);
function analyze(error,line,stacked,multi_series){
if (error){ console.log(error);}
else{
line_chart(line);
stack_chart(stacked);
multi_line(multi_series);
}
}
Unnamed: 0 COUNTRY YEAR VISA APPROVED
0 14 BANGLADESH 2012 457565
1 168 UNITED KINGDOM 2012 405456
2 15 BANGLADESH 2013 372970
3 13 BANGLADESH 2011 293770
4 169 UNITED KINGDOM 2013 267256
5 170 USA 2012 241215
6 171 USA 2013 199659
7 147 SRI LANKA 2012 177929
8 53 GERMANY 2012 174035
9 50 FRANCE 2012 160992
10 90 MALAYSIA 2012 136676
11 32 CHINA 2012 133674
12 28 CANADA 2012 125785
13 54 GERMANY 2013 123595
14 129 RUSSIAN FEDERATION 2013 123580
15 167 UNITED KINGDOM 2011 118625
16 51 FRANCE 2013 115497
17 148 SRI LANKA 2013 113684
18 33 CHINA 2013 110295
19 91 MALAYSIA 2013 108820
20 4 AUSTRALIA 2012 100315
21 78 JAPAN 2013 97825
22 52 GERMANY 2011 96056
23 128 RUSSIAN FEDERATION 2012 95065
24 5 AUSTRALIA 2013 76065
25 165 UNITED ARAB EMIRATES 2012 71170
26 166 UNITED ARAB EMIRATES 2013 68381
27 75 ITALY 2012 63922
28 27 CANADA 2011 57756
29 77 JAPAN 2012 57598
30 160 THAILAND 2012 56845
31 136 SINGAPORE 2013 54894
32 84 KOREA(REPUBLIC OF) 2013 52485
33 117 PAKISTAN 2013 51979
34 3 AUSTRALIA 2011 51455
35 83 KOREA(REPUBLIC OF) 2012 49664
36 76 ITALY 2013 49266
37 144 SPAIN 2012 47814
38 161 THAILAND 2013 46974
39 103 NETHERLANDS 2012 44673
40 135 SINGAPORE 2012 44128
41 115 OMAN 2013 42847
42 29 CANADA 2013 42640
43 31 CHINA 2011 39526
44 49 FRANCE 2011 39288
45 156 SWITZERLAND 2012 33326
46 146 SRI LANKA 2011 32734
47 153 SWEDEN 2012 31437
48 102 NETHERLANDS 2011 31160
49 104 NETHERLANDS 2013 29856
50 145 SPAIN 2013 29419
51 17 BELGIUM 2012 28095
52 12 BANGLADESH 2010 27746
53 73 ISRAEL 2013 27172
54 157 SWITZERLAND 2013 24011
55 141 SOUTH AFRICA 2013 23976
56 7 AUSTRIA 2012 23957
57 89 MALAYSIA 2011 23381
58 154 SWEDEN 2013 22710
59 18 BELGIUM 2013 20413
60 159 TAIWAN 2013 20321
61 158 TAIWAN 2012 19716
62 69 IRAN 2013 19176
63 68 IRAN 2012 18727
64 155 SWITZERLAND 2011 17641
65 8 AUSTRIA 2013 17363
66 47 FINLAND 2012 16315
67 109 NIGERIA 2012 16060
68 112 NORWAY 2012 15556
69 66 INDONESIA 2013 14824
70 124 POLAND 2013 14627
71 114 OMAN 2012 14408
72 16 BELGIUM 2011 14395
73 106 NEW ZEALAND 2012 13877
74 140 SOUTH AFRICA 2012 13272
75 72 ISRAEL 2012 11558
76 122 PHILIPPINES 2013 10926
77 110 NIGERIA 2013 10850
78 41 DENMARK 2013 10549
79 48 FINLAND 2013 10502
80 131 SAUDI ARABIA 2012 10399
81 46 FINLAND 2011 10389
82 113 NORWAY 2013 10349
83 176 YEMEN 2013 9728
84 107 NEW ZEALAND 2013 9378
85 80 KAZAKHSTAN 2013 9224
86 20 BRAZIL 2013 9120
87 65 INDONESIA 2012 8341
88 123 POLAND 2012 8272
89 82 KENYA 2013 8213
90 71 IRELAND 2013 8042
91 94 MAURITIUS 2013 7821
92 175 VIETNAM 2013 7594
93 11 BAHRAIN 2013 7201
94 96 MEXICO 2013 7059
95 10 BAHRAIN 2012 6858
96 101 NEPAL 2013 6831
97 1 ARGENTINA 2013 6805
98 163 UKRAINE 2013 6571
99 162 TURKEY 2013 6565
100 99 MYANMAR 2013 6389
101 132 SAUDI ARABIA 2013 6368
102 174 VIETNAM 2012 6234
103 39 CZECH 2013 6146
104 126 PORTUGAL 2013 5878
105 74 ITALY 2011 5307
106 105 NEW ZEALAND 2011 4962
107 164 UNITED ARAB EMIRATES 2011 4798
108 56 GHANA 2013 4041
109 19 BRAZIL 2012 3934
110 43 EGYPT 2013 3884
111 125 PORTUGAL 2012 3839
112 79 KAZAKHSTAN 2012 3791
113 40 DENMARK 2012 3639
114 42 EGYPT 2012 3635
115 62 HUNGARY 2013 3635
116 35 COLOMBIA 2013 3335
117 58 GREECE 2013 3199
118 55 GHANA 2012 2807
119 95 MEXICO 2012 2801
120 57 GREECE 2012 2800
121 98 MOZAMBIQUE 2013 2656
122 61 HUNGARY 2012 2508
123 121 PHILIPPINES 2012 2426
124 143 SPAIN 2011 2424
125 0 ARGENTINA 2012 2253
126 45 ETHIOPIA 2013 2129
127 111 NORWAY 2011 2121
128 81 KENYA 2012 1911
129 25 CAMBODIA 2013 1880
130 24 CAMBODIA 2012 1790
131 6 AUSTRIA 2011 1744
132 92 MALDIVES 2012 1491
133 172 UZBEKISTAN 2013 1491
134 139 SLOVENIA 2013 1462
135 138 SLOVENIA 2012 1451
136 44 ETHIOPIA 2012 1375
137 100 NEPAL 2012 1326
138 151 SUDAN 2013 1195
139 37 CROATIA 2013 1176
140 116 PAKISTAN 2012 1123
141 34 COLOMBIA 2012 1101
142 93 MALDIVES 2013 1052
143 127 ROMANIA 2013 1052
144 120 PERU 2013 1051
145 30 CHILE 2013 960
146 38 CZECH 2012 847
147 87 LAOS 2013 763
148 85 KUWAIT 2013 715
149 23 BULGARIA 2013 711
150 97 MOZAMBIQUE 2012 673
151 137 SLOVAK REPUBLIC 2013 598
152 22 BRUNEI 2013 566
153 86 LAOS 2012 516
154 64 INDIA 2013 516
155 21 BRUNEI 2012 461
156 119 PERU 2012 363
157 60 GUATEMALA 2013 322
158 130 SAUDI ARABIA 2011 296
159 36 CROATIA 2012 215
160 70 IRELAND 2012 202
161 9 AZERBAIJAN 2013 182
162 2 ARMENIA 2013 178
163 88 LATVIA 2013 161
164 59 GUATEMALA 2012 131
165 133 SERBIA 2013 116
166 173 VENEZUELA 2013 103
167 67 IRAN 2011 101
168 134 SINGAPORE 2011 68
169 152 SWEDEN 2011 66
170 63 ICELAND 2013 60
171 118 PALESTINIAN 2013 33
172 142 SOUTH SUDAN 2012 5
173 149 SUDAN 2011 5
174 150 SUDAN 2012 2
175 108 NIGERIA 2011 2
176 26 CANADA 2010 1
YEAR EMPLOYMENT VISA TOURIST VISA BUSINESS VISA CONFERENCE VISA BUS VISA INDSPOUSE BUSINESS VISA TRANSFER DIPLOMATIC VISA DIPLOMATIC DEPENDANT VISA EMPLOYMENT VISA INDSPOUSE ENTRY VISA MEDICAL VISA MEDICAL ATTENDENT VISA MISSIONARY VISA PILGRIMAGE VISA RESEARCH VISA PROJECT VISA TRANSIT VISA VISIT VISA ART SURROGACY LONG TERM VISA TRANSFER STUDENT VISA VISA APPROVED
2010 0 27137 298 70 0 0 0 0 0 0 0 0 0 0 0 0 91 6 145 0 0 27747
2011 4010 735946 98998 3372 0 122 645 0 0 0 0 0 0 0 0 96 1922 19 2940 0 0 848070
2012 16819 2426728 496095 16988 75 1100 3083 0 247 0 0 0 46 15 0 1337 7119 769 19920 2 2 2990345
2013 17515 2023428 468817 16799 71 1012 3473 105 310 0 0 0 55 10644 0 987 10958 34818 5383 7 15529 2609911
DATE EMPLOYMENT VISA TOURIST VISA BUSINESS VISA VISIT VISA ART SURROGACY STUDENT VISA
2010 0 27137 298 6 145 0
2011 4010 735946 98998 19 2940 0
2012 16819 2426728 496095 769 19920 2
2013 17515 2023428 468817 34818 5383 15529
body{
font-family: 'Lora', serif;
border: 3px solid #73AD21;
}
@media (min-width: 1200px) {
.container {
width: 70%;
}
}
h1{
}
.introduction {
font-family: 'Lora', serif;
font-size:20px;
}
span{
font-size:20px
}
.radio{
font-size: 20px;
left: 10%;
}
p{
text-align: justify;
font-family: 'Droid Sans', sans-serif;
}
.line_chart{
margin-top: 1.2cm;
}
.line_chart_text{
font-size:15px;
font-family: 'Lora', serif;
}
.different_visa{
font-size:20px;
}
.top_country{
font-size:20px;
}
.y path{
fill:none;
stroke:black;
stroke-opacity=0.8;
}
.axis line {
fill: none;
stroke: black;
shape-rendering: crispEdges;
}
.y_label,
.axis text {
font-family: sans-serif;
font-size: 16px;
}
.x.axis path {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment