-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1428 lines (1192 loc) · 38.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>How will the Rajya Sabha elections affect NDA & UPA numbers?</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no, shrink-to-fit=no">
<!-- PUT GOOGLE ANALYTICS SNIPPET HERE -->
<script type="text/javascript">
(function (i, s, o, g, r, a, m) {
i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () {
(i[r].q = i[r].q || []).push(arguments)
}, i[r].l = 1 * new Date(); a = s.createElement(o),
m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m)
})(window, document, 'script', 'https://www.google-analytics.com/analytics.js', 'ga');
ga('create', 'UA-78400808-1', 'auto');
ga('send', 'pageview');
</script>
<!-- for Facebook -->
<meta property="og:title" content="How will the Rajya Sabha elections affect NDA & UPA numbers?" />
<meta property="og:type" content="article" />
<meta property="og:image" content="http://i.imgur.com/U2eRCH1.png" />
<meta property="og:description" content="What do the recent Rajya Sabha elections mean for the NDA and UPA and how will future polls impact their numbers in parliament? Click here to find out." />
<!-- for Twitter -->
<meta name="twitter:card" content="summary" />
<meta name="twitter:title" content="How will the Rajya Sabha elections affect NDA & UPA numbers?" />
<meta name="twitter:description" content="What do the recent Rajya Sabha elections mean for the NDA and UPA and how will future polls impact their numbers in parliament? Click here to find out." />
<meta name="twitter:image" content="http://i.imgur.com/AoH8cfS.png" />
<link rel="stylesheet" href="css/reveal.css">
<link rel="stylesheet" href="css/black_yellow.css" id="theme">
<!-- <link rel="stylesheet" href="css/additional.css" id="theme"> -->
<!-- seems reveal.js relies on head.js for dependency loading -->
<script src="js/head.min.js"></script>
<script src="js/reveal_modified.js"></script>
<script src="js/W.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/4.9.1/d3.min.js"></script>
<!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script> -->
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<section data-state="section01" id="section01">
<h2>How will the Rajya<br/>Sabha elections affect<br/>NDA & UPA numbers?</h2>
<div id='section01_container'></div>
<p>The Rajya Sabha seats from Gujarat so hotly contested this week were three of 10 seats in the Upper House (including six from West Bengal) that were up for election.</p>
<p>How will this and future Rajya Sabha elections affect the state of play on the national stage? How will they impact the numbers in parliament of the two major coalitions -- the ruling National Democratic Alliance (NDA) led by the Bharatiya Janata Party and the United Progressive Alliance (UPA) led by Congress(I)? Flick up or scroll down to find out.</p>
<script type="text/javascript">
Reveal.addEventListener( 'section01', function() {
var vh = W.getViewportHeight()/100 //creating a duplicate viewport height unit
// set the dimensions and margins of the graph
var margin = {top: 0*vh, right: 1.5*vh, bottom: 0*vh, left: 1.5*vh},
width = (60*vh) - margin.left - margin.right,
height = (38*vh) - margin.top - margin.bottom
;
// append the svg object to the body of the page
// append a 'group' element to 'svg'
// moves the 'group' element to the top left margin
var svg = d3
.select('#section01_container')
.html('')
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")")
;
d3.xml("svgs/pg1_min.svg", function(error, xml) {
if (error) {console.log(error); return;}
var svg_node = xml
.getElementsByTagName("svg")[0]
;
svg
.node()
.appendChild(svg_node)
;
d3
.select("#path5161")
.attr("fill", "#4f4f4f")
.attr("fill-opacity","1")
;
});
} );
</script>
</section>
<section data-state="section04" id="section04">
<h2>WHAT WILL THE RAJYA<br/>SABHA LOOK LIKE?</h2>
<p>Despite all the shenanigans, the polls in Gujarat went largely as expected, with BJP winning two seats and Congress(I) getting the remaining one. The table below shows us what the numbers will be in the Rajya Sabha when the new MPs from Gujarat and West Bengal take up their seats on August 19.</p>
<br/>
<div id='section04_container'>
<table >
<tbody>
<tr>
<th>NDA members</th>
<th>No. of MPs</th>
<th>Unallied parties</th>
<th>No. of MPs</th>
</tr>
<tr>
<td>Bharatiya Janata Party</td>
<td>56</td>
<td>Samajwadi Party</td>
<td>18</td>
</tr>
<tr>
<td>Janata Dal (United)</td>
<td>10</td>
<td>AIADMK</td>
<td>13</td>
</tr>
<tr>
<td>Telugu Desam Party</td>
<td>6</td>
<td>All India Trinamool Congress</td>
<td>13</td>
</tr>
<tr>
<td>Shiromani Akali Dal</td>
<td>3</td>
<td>Biju Janta Dal</td>
<td>8</td>
</tr>
<tr>
<td>Shiv Sena</td>
<td>3</td>
<td>Communist Party of India (M)</td>
<td>7</td>
</tr>
<tr>
<td>J&K People's Democratic Party</td>
<td>2</td>
<td>Independent</td>
<td>6</td>
</tr>
<tr>
<td>Sikkim Democratic Front</td>
<td>1</td>
<td>Bahujan Samaj Party</td>
<td>5</td>
</tr>
<tr>
<td>Naga People's Front</td>
<td>1</td>
<td>Nationalist Congress Party</td>
<td>5</td>
</tr>
<tr>
<td>Bodoland People's Front</td>
<td>1</td>
<td>Rashtriya Janata Dal</td>
<td>3</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Telangana Rashtra Samithi</td>
<td>3</td>
</tr>
<tr>
<th>UPA members</th>
<th>No. of MPs</th>
<td>Communist Party of India</td>
<td>1</td>
</tr>
<tr>
<td>Congress (I)</td>
<td>57</td>
<td>Indian National Lok Dal</td>
<td>1</td>
</tr>
<tr>
<td>DMK</td>
<td>4</td>
<td>Janata Dal (Secular)</td>
<td>1</td>
</tr>
<tr>
<td>Indian Union Muslim League</td>
<td>1</td>
<td>Jharkhand Mukti Morcha</td>
<td>1</td>
</tr>
<tr>
<td>Kerala Congress (M)</td>
<td>1</td>
<td>Republican Party of India (A)</td>
<td>1</td>
</tr>
<tr>
<td></td>
<td></td>
<td>YSR Congress Party</td>
<td>1</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Nominated</td>
<td>8</td>
</tr>
<tr>
<td></td>
<td></td>
<td>Vacancies</td>
<td>4</td>
</tr>
</tbody>
</table>
</div>
</section>
<section data-state="section05" id="section05">
<h2>NO MAJORITY IN<br/>SIGHT FOR NDA</h2>
<p>And if we tot up the numbers below for the two coalitions in the Rajya Sabha after August 19, (and also take into account the upcoming resignations of BJP MPs Manohar Parrikar and Venkaiah Naidu given they are now in the posts of Chief Minister of Goa and Vice-president respectively), we see the NDA is still some way away from any kind of majority in the Upper House.</p>
</br>
<div id='section05_container'></div>
</br>
<p>A simple majority of 123 seats is important because it makes it easier to pass bills, while a two-thirds majority of 162 is needed to amend the constitution or pass laws on matters otherwise on the state list. So if the NDA wants to do anything like this, it will have to rely on others.</p>
<script type="text/javascript">
Reveal.addEventListener( 'section05', function() {
d3.csv("data/rs_strength_bar_chart.csv", function(data) {
var vh = W.getViewportHeight()/100 //creating a duplicate viewport height unit
var margin = {top: 2*vh, right: 3*vh, bottom: 4*vh, left: 8*vh},
width = (60*vh) - margin.left - margin.right,
height = (25*vh) - margin.top - margin.bottom;
// set the ranges
var y = d3.scaleBand()
.range([0, height])
.padding(0.1);
var x = d3.scaleLinear()
.range([0, width]);
// append the svg object to the body of the page
// append a 'group' element to 'svg'
// moves the 'group' element to the top left margin
var svg = d3
.select('#section05_container')
.html('')
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");
// format the data
data.forEach(function(d) {
d.seats = +d.seats;
});
// Scale the range of the data in the domains
x.domain([0, 230])
y.domain(data.map(function(d) { return d.party; }));
//y.domain([0, d3.max(data, function(d) { return d.seats; })]);
// append the rectangles for the bar chart
svg.selectAll(".bar")
.data(data)
.enter()
.append("g")
.attr("class", "bars")
.append("rect")
.attr("class", "bar")
//.attr("x", function(d) { return x(d.seats); })
.attr("width", function(d) {return x(d.seats); } )
.attr("y", function(d) { return y(d.party); })
.attr("height", y.bandwidth())
;
var bars = svg
.selectAll(".bars");
bars
.append("text")
.attr('class','svgtext')
//.attr("class", "label")
//.attr('transform', 'rotate(-90)')
.attr("x", function(d) { return x(d.seats) + (1*vh); })
.attr("y", function(d) { return y(d.party) + (3*vh); })
.text(function(d) { return d.seats; });
// add the x Axis
svg.append("g")
.attr("transform", "translate(0," + height + ")")
.attr('class','axis')
.call(d3.axisBottom(x));
// add the y Axis
svg.append("g")
// .attr("transform", "translate(" + width/5 + ",0)")
.attr('class','axis')
.call(d3.axisLeft(y));
//code below from https://groups.google.com/forum/#!topic/d3-js/LiI1JAY79E8
svg.append('line')
.style("stroke", '#4f4f4f')
.style("stroke-dasharray", "5, 5")
.attr('x1', x(123)) // x() is your scaling function, 10 is the value where you want a line to be placed
.attr('y1', height) // height of your chart
.attr('x2', x(123)) // same as x1 for a horizontal line
.attr('y2', 0) // height of your chart
;
svg
.append("text")
.attr("x", x(126))
.attr("y", 0.05 * height)
.attr("text-anchor", "start")
.text('--NDA 40 seats away from')
.attr('class','svgtext')
;
svg
.append("text")
.attr("x", x(126))
.attr("y", 0.15 * height)
.attr("text-anchor", "start")
.text('simple majority of 123')
.attr('class','svgtext')
;
svg.append('line')
.style("stroke", '#4f4f4f')
.style("stroke-dasharray", "5,5")
.attr('x1', x(162))
.attr('y1', height)
.attr('x2', x(162))
.attr('y2', 0.4 * height)
;
svg
.append("text")
.attr("x", x(165))
.attr("y", 0.5 * height)
.attr("text-anchor", "start")
.text('--NDA 79 seats')
.attr('class','svgtext')
;
svg
.append("text")
.attr("x", x(165))
.attr("y", 0.6 * height)
.attr("text-anchor", "start")
.text('away from 2/3')
.attr('class','svgtext')
;
svg
.append("text")
.attr("x", x(165))
.attr("y", 0.7 * height)
.attr("text-anchor", "start")
.text('majority of 162')
.attr('class','svgtext')
;
});
} );
</script>
</section>
<section data-state="section08" id="section08">
<h2>What should the NDA<br/>do to get an R.S. majority?</h2>
<p>To start changing its numbers in the Rajya Sabha, the NDA will have to win states which are in the hands of the opposition. States such as Karnataka and Himachal Pradesh, which together provide a total of 15 MPs to the Rajya Sabha, are currently with the UPA and will be going to the polls in 2018, along with eight other states mentioned below.</p>
<div id='section08_container'></div>
<script type="text/javascript">
Reveal.addEventListener( 'section08', function() {
d3.json("data/india_4_rs.geojson", function (json) {
var vh = W.getViewportHeight()/100 //creating a duplicate viewport height unit, basically a multiplicative factor
var margin = {top: 0*vh, right: 0*vh, bottom: 1*vh, left: 0*vh},
w = (60*vh) - margin.left - margin.right,
h = (55*vh) - margin.top - margin.bottom;
var svg = d3
.select('#section08_container')
.html('')
.append("svg")
.attr("width", w + margin.left + margin.right)
.attr("height", h + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");
var map = svg
.append("g")
.attr("transform", "translate(" + margin.left + "," + margin.top + ")")
.attr("width", w)
.attr("height", h)
;
var proj = d3
.geoMercator()
.fitSize([w, h], json)
;
var pathx = d3
.geoPath()
.projection(proj)
;
//list of states going to polls in 2017 & 2018
var state_list = ['Himachal Pradesh','Gujarat', 'Meghalaya', 'Nagaland', 'Tripura', 'Karnataka', 'Mizoram', 'Chhattisgarh', 'Madhya Pradesh', 'Rajasthan'];
var label_dict = {'Himachal Pradesh':'HP','Gujarat':'GJ', 'Meghalaya':'ML', 'Nagaland':'NL', 'Tripura':'TR', 'Karnataka':'KA', 'Mizoram':'MZ', 'Chhattisgarh':'CG', 'Madhya Pradesh':'MP', 'Rajasthan':'RJ'};
map
.selectAll("path")
.data(json.features)
.enter()
.append("path")
.attr("d", pathx)
.style("stroke", function(d) {
var state_name = d.properties.ST_NM
if( state_list.indexOf(state_name) === -1){
return '#4f4f4f';
} else {
return '#ffda29'; }
})
.style("opacity","1")
.style("stroke-width", "1px")
.attr("fill", function(d) {
var state_name = d.properties.ST_NM
if( state_list.indexOf(state_name) === -1){
return '#ffda29';
} else {
return '#4f4f4f'; }
})
;
//the code below is for generating backgrounds of the text labels, it's from http://stackoverflow.com/questions/42327183/d3-tick-with-background and http://stackoverflow.com/questions/15500894/background-color-of-text-in-svg
var filter = map
.append("defs")
.append("filter")
.attr("x", "0")
.attr("y", "0")
.attr("width", "1")
.attr("height", "0.8")
.attr("id", "background");
filter
.append("feFlood")
.attr("flood-color", "#ffda29");
filter
.append("feComposite")
.attr("in", "SourceGraphic");
map
.selectAll("text.state_label")
.data(json.features)
.enter()
.append("text")
.attr('class','state_label')
.text(function(d){
var state_name = d.properties.ST_NM
if( state_list.indexOf(state_name) === -1){
return '';
} else {
return label_dict[state_name]; }
})
/*.attr("x", function(d){
return pathx.centroid(d)[0];
})
.attr("y", function(d){
return pathx.centroid(d)[1];
})*/
.attr("transform", function (d) { return "translate(" + pathx.centroid(d) + ")"; })
//.attr("dy", "1em")
.attr("filter","url(#background)")
// .style("opacity","1")
;
map
.append("text")
.text('CG : Chhattisgarh')
.attr("x", (5*w)/9)
.attr("y", (6.3*h)/9)
.attr('class','legend')
;
map.append("text")
.text('GJ : Gujarat')
.attr("x", (5*w)/9)
.attr("y", (6.6*h)/9)
.attr('class','legend')
;
map.append("text")
.text('HP : Himachal Pradesh')
.attr("x", (5*w)/9)
.attr("y", (6.9*h)/9)
.attr('class','legend')
;
map.append("text")
.text('KA : Karnataka')
.attr("x", (5*w)/9)
.attr("y", (7.2*h)/9)
.attr('class','legend')
;
map.append("text")
.text('MP : Madhya Pradesh')
.attr("x", (5*w)/9)
.attr("y", (7.5*h)/9)
.attr('class','legend')
;
map.append("text")
.text('ML : Meghalaya')
.attr("x", (5*w)/9)
.attr("y", (7.8*h)/9)
.attr('class','legend')
;
map.append("text")
.text('MZ : Mizoram')
.attr("x", (5*w)/9)
.attr("y", (8.1*h)/9)
.attr('class','legend')
;
map.append("text")
.text('NL : Nagaland')
.attr("x", (5*w)/9)
.attr("y", (8.4*h)/9)
.attr('class','legend')
;
map.append("text")
.text('RJ : Rajasthan')
.attr("x", (5*w)/9)
.attr("y", (8.7*h)/9)
.attr('class','legend')
;
map.append("text")
.text('TR : Tripura')
.attr("x", (5*w)/9)
.attr("y", (9*h)/9)
.attr('class','legend')
;
});
} );
</script>
</section>
<section data-state="section09" id="section09">
<h2>WHEN ARE RAJYA SABHA<br/>SEATS UP FOR ELECTION?</h2>
<p>The table below tells us how many R.S. seats from a state are up for election each year. </p>
<div id='section09_container'>
<table id='translucent' class="table table-bordered table-hover table-condensed ">
<tbody><tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<th>State</th>
<th align="right">2018</th>
<th align="right">2019</th>
<th align="right">2020</th>
<th align="right">2021</th>
<th align="right">2022</th>
<th align="right">2023</th>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Andhra Pradesh</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Arunachal Pradesh</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Assam</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Bihar</td>
<td align="right">6</td>
<td align="right"></td>
<td align="right">5</td>
<td align="right"></td>
<td align="right">5</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Chhattisgarh</td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Delhi</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Goa</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Gujarat</td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">3</td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Haryana</td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Himachal Pradesh</td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Jammu & Kashmir</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Jharkhand</td>
<td align="right">2</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Karnataka</td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Kerala</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">3</td>
<td align="right">3</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Madhya Pradesh</td>
<td align="right">5</td>
<td align="right"></td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">3</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Maharashtra</td>
<td align="right">6</td>
<td align="right"></td>
<td align="right">7</td>
<td align="right"></td>
<td align="right">6</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Manipur</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Meghalaya</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Mizoram</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Nagaland</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Nominated</td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">7</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Odisha</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
<td align="right">3</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Puducherry</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Punjab</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">7</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Rajasthan</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">4</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Sikkim</td>
<td align="right">1</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Tamil Nadu</td>
<td align="right"></td>
<td align="right">6</td>
<td align="right">6</td>
<td align="right"></td>
<td align="right">6</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Telangana</td>
<td align="right">3</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
<td align="right">2</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Tripura</td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Uttar Pradesh</td>
<td align="right">10</td>
<td align="right"></td>
<td align="right">10</td>
<td align="right"></td>
<td align="right">11</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>Uttarakhand</td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
<td align="right">1</td>
<td align="right"></td>
</tr>
<tr style="border-bottom: 1px solid rgba(79,79,79,0.03);">
<td>West Bengal</td>
<td align="right">5</td>
<td align="right"></td>
<td align="right">5</td>
<td align="right"></td>
<td align="right"></td>
<td align="right">6</td>
</tr>
</tbody></table>
</div>
</section>
<section data-state="section06" id="section06">
<h2>What does the future<br/>hold for the NDA?</h2>
<p>The previous table tells us that even if the NDA starts winning states that are with the UPA, the benefits won't be seen immediately. The elections for Rajya Sabha seats of a particular state are held in different years, so any impact will be gradual.</p>
<div id='section06_container'></div>
<p>The chart above is an attempt to calculate what the Rajya Sabha numbers of the UPA and NDA will be over the coming years, given what we know about the party composition of different state assemblies. If an R.S. seat is up for election from a state after its assembly term is over, nothing can be said about where it ends up, so it won't be counted. </p>
<p>We see here that the NDA will have at least 87 seats in the Rajya Sabha after May 4, 2018.</p>
<script type="text/javascript">
Reveal.addEventListener( 'section06', function() {
//code from https://bl.ocks.org/d3noob/4db972df5d7efc7d611255d1cc6f3c4f
// Get the data
d3.csv("data/alliances_strength_combined.csv", function(error, data) {
if (error) throw error;
var vh = W.getViewportHeight()/100 //creating a duplicate viewport height unit, basically a multiplicative factor
var margin = {top: 2*vh, right: 2*vh, bottom: 3*vh, left: 6*vh},
width = (60*vh) - margin.left - margin.right,
height = (25*vh) - margin.top - margin.bottom;
// parse the date / time
var parseTime = d3.timeParse("%d-%m-%Y");
// set the ranges
var x = d3.scaleTime().range([0, width]);
var y = d3.scaleLinear().range([height, 0]);
// append the svg obgect to the body of the page
// appends a 'group' element to 'svg'
// moves the 'group' element to the top left margin
var svg = d3
.select('#section06_container')
.html('')
.append("svg")
.attr("width", width + margin.left + margin.right)
.attr("height", height + margin.top + margin.bottom)
.append("g")
.attr("transform",
"translate(" + margin.left + "," + margin.top + ")");
// format the data
data.forEach(function(d) {
d.date = parseTime(d.date);
d.upa_r = +d.upa_r;
d.nda_r = +d.nda_r;
});
// Scale the range of the data
x.domain(d3.extent(data, function(d) { return d.date; }));
y.domain([0, d3.max(data, function(d) {
return Math.max(d.upa_r, d.nda_r); })]);
// define the 1st line
var valueline = d3.line()
.x(function(d) { return x(d.date); })
.y(function(d) { return y(d.nda_r); })
;
// define the 2nd line
var valueline2 = d3.line()
.x(function(d) { return x(d.date); })
.y(function(d) { return y(d.upa_r); })
;