-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
1342 lines (1075 loc) · 62.5 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>Texas AFT - Respect Campaign Map</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico?">
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.8.0/dist/leaflet.css"
integrity="sha512-hoalWLoI8r4UszCkZ5kL8vayOGVae1oxXe/2A4AO6J9+580uKHDO3JdHb7NzwwzK5xr/Fs0W40kiNHxM9vyTtQ=="
crossorigin=""/>
<script src="https://unpkg.com/leaflet@1.8.0/dist/leaflet.js"
integrity="sha512-BB3hKbKWOc9Ez/TAwyWxNXeoV9c1v6FIeYiBieIWkpLjauysF18NzgR1MBNBXf8/KABdlkX68nAhlwcDFLGPCQ=="
crossorigin=""></script>
<script src="https://cdn.jsdelivr.net/npm/leaflet-search@3.0.2/dist/leaflet-search.src.min.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/leaflet-search@3.0.2/dist/leaflet-search.min.css">
<script src="https://unpkg.com/leaflet-responsive-popup@1.0.0/leaflet.responsive.popup.js"></script>
<link rel="stylesheet" href="https://unpkg.com/leaflet-responsive-popup@1.0.0/leaflet.responsive.popup.css" />
<script src='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/Leaflet.fullscreen.min.js'></script>
<link href='https://api.mapbox.com/mapbox.js/plugins/leaflet-fullscreen/v1.0.1/leaflet.fullscreen.css' rel='stylesheet' />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<style>
#respect-map {
height: 650px
}
#respect-map-modal {
height: 300px
}
.info {
padding: 6px 8px;
font: 14px/16px Arial, Helvetica, sans-serif;
background: white;
background: rgba(255,255,255,0.8);
box-shadow: 0 0 15px rgba(0,0,0,0.2);
border-radius: 4px;
}
.info h4 {
margin: 0 0 5px;
color: #777;
}
.legend {
line-height: 18px;
color: #555;
}
.legend i {
width: 18px;
height: 18px;
float: left;
margin-right: 8px;
opacity: 0.7;
}
a, p, h1, h2, h3, h4, h5, h6, label, li {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.respect-campaign-map-button {
color: white;
padding: 7px;
margin: auto;
font-size: 14px;
background-color: white;
border: 1px solid gray;
border-radius: 4px;
}
.respect-campaign-map-button:hover {
opacity: 0.5;
color: white;
padding: 7px;
cursor: pointer;
margin: auto;
}
.respect-campaign-popup-button {
padding: 7px;
border: 1px solid gray;
border-radius: 4px;
color: white;
}
.respect-campaign-popup-button:hover {
opacity: 0.5
}
.overlay {
height: 100%;
width: 0;
position: fixed;
z-index: 1000;
top: 0;
left: 0;
background-color: #003366;
overflow-x: hidden;
transition: 0.5s;
}
.overlay-content {
position: relative;
top: 10%;
width: 100%;
margin-top: 30px;
padding: 30px;
background-color: white;
color: black;
}
.overlay .closebtn {
position: absolute;
top: 10px;
right: 15px;
font-size: 48px;
color: #FFCC33;
}
.overlay .closebtn:hover {
color: #A57F13;
}
@media screen and (max-height: 450px) {
.overlay a {font-size: 20px}
.overlay .closebtn {
font-size: 24px;
top: 15px;
right: 35px;
}
}
.district-name-linked {
color: royalblue;
text-decoration: none;
cursor: pointer;
}
.district-name-linked:hover {
color: #003366;
text-decoration: none;
cursor: pointer;
}
.my-popup {pointer-events: none;}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: none;
}
.chart-container {
width: 80%;
margin: 0 auto;
}
.pie-chart-container {
height: 280px;
width: 280px;
margin: auto;
}
.bar-chart-chart-container {
width: 80%;
height: 180px;
margin: 0 auto;
}
.bar-chart-container {
max-height: 180px;
width: 80%;
margin: auto;
clear: right;
}
.modal-subheader {
text-decoration: underline;
}
.header {
background-color: #003366;
color: white;
top: 0;
position: fixed;
width: 100%;
clear: right;
padding: 10px;
}
body {
padding: 0;
margin: 0;
}
</style>
</head>
<body>
<div class="header">
<a href="https://www.texasaft.org" target="_blank" style="cursor: pointer;"><img src="logo.svg" alt="Texas AFT logo" height="60px"></a>
</div>
<div style="margin: 30px; margin-top: 110px;">
<h1>Respect Campaign Map</h1>
<p style="font-size: 24px;">School district salary analysis and local organizing wins</p>
<div style="margin: 30px; border: 1px solid lightgrey; border-radius: 4px; text-align: center; padding: 15px 30px;">
<h3>School employees have been underpaid and suffered a lack of respect at work for <u>too long.</u></h3>
<p>School districts are experiencing the consequences as the <u>so-called "recruitment/retention crisis."</u></p>
<p>However, we are <u>fighting for change in school districts across the state</u> and <u>laying the groundwork for change in the Texas Legislature in 2023.</u> AFT members won significant victories across Texas by organizing in their districts' budget processes, and they brought home much-needed and well-deserved pay raises and benefits enhancements in 2022.</p>
<p>Our work is far from over. The below map displays Texas's school districts shaded according to the percentage change in the average teacher salary in the district between the 2009-2010 and 2020-2021 school years in 2021 U.S. dollars.</p>
<p>Texas AFT has a local or organizing committee in the school districts outlined in blue.</p>
<p><b>Find or search for your school district below (using the 🔍 or 🏠 buttons)</b> to learn more about stagnant teacher pay in your district, explore details regarding the victories led by AFT members, and lead change in your community together with AFT and your colleagues by joining your union.</p>
</div>
</div>
<div id="respect-map" style="margin-bottom: 45px;"></div>
<div id="myNav" class="overlay">
<a href="javascript:void(0)" class="closebtn" style="text-decoration: none;" onclick="closeNav()">×</a>
<div class="overlay-content">
<div style="clear: right; width: 100%"><span style="float: left;"><h1 id="detail-district-name" style="margin-left: 30px; margin-top: 30px;"></h1></span><span style="float: right; margin-right: 65px;">
<div id="detail-join-houston-local" style="display: none; margin: 2.5px; border: 1px solid lightgrey; border-radius: 4px; padding: 7px; background-color: #1167B0; color: white; text-align: center;">
<label for="houston-locals" style="font-size: 14px;">JOIN OUR UNION:</label></br>
<select name="houston-locals" id="houston-locals" onchange="var houstonLocals = document.getElementById('houston-locals'); if (houstonLocals.value === 'hft') {
let a = document.createElement('a');
a.target= '_blank';
a.href= 'https://join.aft.org/form/houston-federation-of-teachers/local/02415/hft-membership-application';
a.click();
} else if (houstonLocals.value === 'hesp') {
let a = document.createElement('a');
a.target= '_blank';
a.href= 'https://www.texasaft.org/wp-content/uploads/2022/07/HESPDuesForm2022-202350.pdf';
a.click();
} " required>
<option disabled>SELECT STAFF TYPE</option>
<option value="hft">Certified & Classroom Personnel - HFT</option>
<option value="hesp">Support & Auxiliary Staff - HESP</option>
</select>
</div>
<a id="raw-data-link" href="#" style="text-decoration: none; color: white; font-size: 14px; cursor: pointer;"><button class="respect-campaign-map-button" style="cursor: pointer; background-color: #880808; font-size: 14px; margin: 2.5px;">DATA: EMPLOYEE PAY</button></a>
<a style="color: white; font-size: 14px; text-decoration: none; cursor: pointer;" href="https://actionnetwork.org/forms/take-the-respect-pledge" target="_blank"><button class="respect-campaign-map-button" style="cursor: pointer; background: linear-gradient(166deg, rgba(2,0,36,1) 0%, rgba(0,51,102,1) 52%, rgba(255,204,51,1) 98%); margin: 5px;">SIGN RESPECT PLEDGE</button></a>
<a onclick="var districtName = document.getElementById('detail-district-name').innerText;
TexasDistrictsFeatureCollection.features.forEach(district => {
if (district.properties.NAME.replace(' County)', ')') == districtName.replace(' County)', ')')) {
window.open(district.properties.JoinTAFT, '_blank');
}
})" href="#" style="color: white; text-decoration: none; cursor: pointer; font-size: 14px;"><button class="respect-campaign-map-button" id="detail-join-union-button" style="background-color: #1167B0; font-size: 14px; margin: 2.5px; cursor: pointer;">JOIN OUR UNION</button></a>
</span></div>
<div style="margin-left: 30px;"><h3 style="clear: left">CDN: <span id="detail-district-number" style="font-weight: normal;"></span></h3></div>
<div id="respect-map-modal"></div>
<br>
<div style="text-align: center;">
<h2>School District Profile</h2>
<br>
<div style="text-align: left; max-width: 650px; margin: auto; display: flex; flex-direction: column">
<div style="text-align: center; padding: 15px; border: 1px solid lightgrey; border-radius: 4px;">
<h4 class="modal-subheader"><a id="raw-data-link-3">2009-2010 TO 2020-2021 % CHANGE IN<br>AVERAGE PAY BY PROFESSIONAL STAFF TYPE<br>(2021 USD)</a></h4>
<p style="font-weight: bold; text-align: center;">
<h5 style="margin-bottom: 0; padding-bottom: 0;">ALL TEACHERS</h5>
<div style="display: flex; flex-direction: row">
<div style="flex: 0.5">
<p style="font-weight: bold;">Texas Average:</p>
<p style="color: black">-3.89%</p>
</div>
<div style="flex: 0.5">
<p style="font-weight: bold;" id="detail-district-name-2"></p>
<p id="detail-district-teacher-pay"></p>
</div>
</div>
<div style="border: 1px solid lightgrey; border-radius: 4px;">
<h5>COMPARISON BY STAFF TYPE</h5>
<div class="bar-chart-chart-container" style="display: block; height: 180px; width: 90%; clear: right;">
<div class="bar-chart-container" style="display: block; height: 180px; width: 90%;">
<canvas id="myBarChart2" style="display: block; height: 180px; width: 90%;"></canvas>
</div>
</div>
</div>
<div style="display: block; font-weight: normal; font-size: 0.85em; width: 80%; margin: auto; margin-top: 20px;"><p>This chart represents the change in the average salary by professional staff type in the district between the 2009-2010 and 2020-2021 school years after being adjusted for the impact of inflation.</p><p>This figure does not capture changes in the local cost of living, nor does it capture the fairness of the actual salaries.</p><p>Click on the <a id="raw-data-link-2" href="" target="_blank">DATA: EMPLOYEE PAY</a> button above to dig deeper into the data.</p></div>
</p>
</div>
<br>
<div style="text-align: center; border: 1px solid lightgrey; border-radius: 4px; padding: 15px;">
<h4 class="modal-subheader">2020-2021 ATTENDANCE/ENROLLMENT</h4>
<p style="font-weight: bold;">5-year % enrollment change: <span id="detail-district-enrollment-change" style="font-weight: normal;"></span></p>
<div style="display: flex; flex-direction: row;">
<div style="flex: 0.33; text-align: center;">
<p style="font-weight: bold;"><a href="https://tealprod.tea.state.tx.us/fsp/Reports/ReportSelection.aspx">Attendance:</a>
<br>
<br>
<br>
<span id="detail-district-attendance" style="font-weight: normal;"></span>
</p>
</div>
<div style="flex: 0.33; text-align: center;">
<p style="font-weight: bold;"><a href="https://rptsvr1.tea.texas.gov/adhocrpt/adste.html" target="_blank">Enrollment:</a>
<br>
<br>
<br>
<span id="detail-district-enrollment" style="font-weight: normal;"></span>
</p>
</div>
<div style="flex: 0.33; text-align: center;">
<p style="font-weight: bold;">Attendance % of Enrollment:
<br>
<br>
<span id="detail-district-ada-percent" style="font-weight: normal;"></span>
</p>
</div>
</div>
</div>
<br>
<div style="text-align: center; border: 1px solid lightgrey; border-radius: 4px; padding: 15px;">
<h4 class="modal-subheader"><a id="detail-charter-cost-link">2020-2021 COST OF CHARTERS</a></h4>
<div style="display: flex; flex-direction: row;">
<div style="flex: 0.33; flex-direction: column">
<p style="font-weight: bold;">Estimated Revenue Loss, Per Student:
<br>
<br>
<span id="detail-district-charter-cost-per-student" style="font-weight: normal;"></span>
</p>
</div>
<div style="flex: 0.33; flex-direction: column">
<p style="font-weight: bold;">Charter Transfers Out, Total:
<br>
<br>
<span id="detail-charter-transfers" style="font-weight: normal;"></span>
</p>
</div>
<div style="flex: 0.33; flex-direction: column">
<p style="font-weight: bold;">Estimated Revenue Loss from Charter Transfers:
<br>
<br>
<span id="detail-district-charter-cost" style="font-weight: normal;"></span>
</p>
</div>
</div>
</div>
<br>
<div style="border: 1px solid lightgrey; border-radius: 4px; text-align: center; padding: 15px;">
<h4 class="modal-subheader"><a id="peims-actual-link">2020-2021 OPERATING REVENUE</a></h4>
<div class="chart-container" style="padding: 15px;">
<div class="pie-chart-container">
<canvas id="pie-chartcanvas-1"></canvas>
</div>
</div>
<div style="display: flex; flex-direction: row;">
<div style="flex: 0.25; flex-direction: column; text-align: center;">
<p style="font-weight: bold; flex: 0.5; padding: 5px;">Local Property Tax from M&O (excl. recapture):
<br>
<br>
<span id="detail-local-funding" style="font-weight: normal; flex: 0.5"></span>
</p>
</div>
<div style="flex: 0.25; flex-direction: column; text-align: center;">
<p style="font-weight: bold; flex: 0.5; padding: 5px;">State Operating Funds:
<br>
<br>
<br>
<span id="detail-state-funding" style="font-weight: normal; flex: 0.5"></span>
</p>
</div>
<div style="flex: 0.25; flex-direction: column; text-align: center;">
<p style="font-weight: bold; flex: 0.5; padding: 5px;">Federal Funds:
<br>
<br>
<br>
<br>
<span id="detail-federal-funding" style="font-weight: normal; flex: 0.5"></span>
</p>
</div>
<div style="flex: 0.25; flex-direction: column; text-align: center;">
<p style="font-weight: bold; flex: 0.5; padding: 5px;">Other Local:
<br>
<br>
<br>
<br>
<span id="detail-other-local-funding" style="font-weight: normal; flex: 0.5;"></span>
</p>
</div>
</div>
<div>
<h4 style="text-decoration: underline;">FUNDING/COST COMPARISON</h4>
<div class="bar-chart-chart-container" style="height: 240px; max-height: 180px; width: 85%;">
<div class="bar-chart-container" style="width: 100%;">
<canvas id="myBarChart" style="height: 180px; width: 100%; max-height: 180px;"></canvas>
</div>
</div>
<p style="font-weight: bold;">2020-2021 Cost of Recapture: <span id="detail-district-recapture" style="font-weight: normal;"></span></p>
<p style="font-weight: bold;">Estimated Revenue Loss from Charter Transfers: <span id="detail-district-charter-cost-2" style="font-weight: normal;"></span></p>
</div>
</div>
</div>
</div>
<br>
<div style="border: 1px solid lightgrey; border-radius: 4px; padding: 15px; max-width: 80%; margin: auto;">
<div style="text-align: center;">
<h4 class="modal-subheader" style="padding-bottom: 0; margin-bottom: 0;">LEGISLATIVE DISTRICTS</h4>
<p style="font-weight: bold;">Who Represents Us in the Texas Legislature:</p>
</div>
<div style="display: flex; flex-direction: row;">
<div style="flex: 0.5; text-align: center;">
<h4 style="text-decoration: underline;"><a href="https://data.capitol.texas.gov/dataset/planh2316" target="_blank">Texas House District: % of School District Within HD</a></h4>
<div id="house-districts" style="text-align: left; max-width: 400px; margin: auto;">
</div>
</div>
<div style="flex: 0.5; text-align: center;">
<h4 style="text-decoration: underline;"><a href="https://data.capitol.texas.gov/dataset/plans2168" target="_blank">Texas Senate District: % of School District Within SD</a></h4>
<div id="senate-districts" style="text-align: left; max-width: 400px; margin: auto;">
</div>
</div>
</div>
</div>
</div>
</div>
<script src="Districts2020to2021.js" type="text/javascript"></script>
<script src="DistrictsData.js" type="text/javascript"></script>
<script src="PLANHD.js" type="text/javascript"></script>
<script src="PLANSD.js" type="text/javascript"></script>
<script src="PLANCD.js" type="text/javascript"></script>
<script src="PLANED.js" type="text/javascript"></script>
<script src="Texas AFT locals.js" type="text/javascript"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js@3.9.1/dist/chart.min.js" type="text/javascript"></script>
</body>
<footer>
<script>
function initMap() {
var map = L.map('respect-map', {
fullscreenControl: {
pseudoFullscreen: true // if true, fullscreen to page width and height
}
}).setView([31.6623, -99.0306], 6);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(map);
var geojson;
var geojsonhd;
var geojsonsd;
var geojsoncd;
var geojsoned;
var geojsonLocals;
function getColorByStagnantPay(d) {
return d < -30 ? '#99000d' :
d < -25 ? '#cb181d' :
d < -20 ? '#ef3b2c' :
d < -15 ? '#fb6a4a' :
d < -10 ? '#fc9272' :
d < -5 ? '#fcbba1' :
d < 0 ? '#fee5d9' :
'white';
}
function style(feature) {
return {
fillColor: getColorByStagnantPay(feature.properties.PercentChangeTeacherPay),
weight: 0.5,
opacity: 1,
color: '#bdbdbd',
fillOpacity: 0.7,
smoothFactor: 0,
};
}
function highlightFeature(e) {
var layer = e.target;
layer.setStyle({
weight: 3,
fillColor: getColorByStagnantPay(layer.feature.properties.PercentChangeTeacherPay),
color: 'black',
dashArray: '',
fillOpacity: 0.7,
smoothFactor: 0,
});
if (!L.Browser.ie & !L.Browser.opera && !L.Browser.edge) {
layer.bringToFront();
}
info.update(layer.feature.properties);
}
function resetHighlight(e) {
window.geojson.resetStyle(e.target);
info.update();
}
function zoomToFeature(e) {
map.fitBounds(e.target.getBounds());
}
var info = L.control();
info.onAdd = function (map) {
this._div = L.DomUtil.create('div', 'info');
this.update();
return this._div;
};
info.update = function (props) {
this._div.innerHTML = '<h4>School District</h4>' + (props ?
'<h1 style="line-height: 1em;" class="district-name-linked">'+props.NAME+'</h1><h2>CDN: <span style="font-weight: normal; float: right;">'+props.DISTRICT_C+'</span></h2><p style="font-weight: bold;">2009-2010 - 2020-2021 %<br/>Change in Average Teacher<br/>Salary (2021 USD): <span id="teacher-pay-modal" style="float: right; font-weight: normal; font-size: 1.5em;">'+props.PercentChangeTeacherPay+'%</span></p><p style="font-weight: bold;">"" Texas (2021 USD): <span style="float: right; font-weight: normal; font-size: 1.5em;">-3.89%</span></p>'
: 'Hover over a district');
this._div.style.width = '250px';
if (props) {
var el = document.getElementById('teacher-pay-modal')
if (parseFloat(el.innerHTML) < 0) {
el.style.color = 'red';
} else {
el.style.color = 'black';
}
}
};
info.addTo(map)
var legend = L.control({position: 'bottomright'});
legend.onAdd = function (map) {
var div = L.DomUtil.create('div', 'info legend');
var grades = [-50, -30, -25, -20, -15, -10, -5, 0];
var labels = [];
for (var n = 0; n < grades.length; n++) {
div.innerHTML +=
`<i style="background: ${getColorByStagnantPay(grades[n])}"></i> ${grades[n]}% ${(grades[n] ? ' – ' + grades[n + 1] + '%' + '</br>' : '+')}`;
}
return div;
};
legend.addTo(map);
var districtData = DistrictsData;
window.TexasDistrictsFeatureCollection = texasDistrictsFeatureCollection;
for (var i=0; i < TexasDistrictsFeatureCollection['features'].length; i++) {
var districtNumber = TexasDistrictsFeatureCollection['features'][i].properties.DISTRICT_C;
TexasDistrictsFeatureCollection['features'][i].properties["PercentChangeTeacherPay"] = districtData[districtNumber]["PercentChangeTeacherPay"]
TexasDistrictsFeatureCollection['features'][i].properties["PercentChangeBeginningTeacherPay"] = districtData[districtNumber]["PercentChangeBeginningTeacherPay"]
TexasDistrictsFeatureCollection['features'][i].properties["PercentChangeCampusAdminPay"] = districtData[districtNumber]["PercentChangeCampusAdminPay"]
TexasDistrictsFeatureCollection['features'][i].properties["PercentChangeCentralAdminPay"] = districtData[districtNumber]["PercentChangeCentralAdminPay"]
TexasDistrictsFeatureCollection['features'][i].properties["PercentChangeSupportStaffPay"] = districtData[districtNumber]["PercentChangeSupportStaffPay"]
TexasDistrictsFeatureCollection['features'][i].properties["RecaptureAmount"] = districtData[districtNumber]["RecaptureAmount"]
TexasDistrictsFeatureCollection['features'][i].properties["EnrollmentChange"] = districtData[districtNumber]["EnrollmentChange"]
TexasDistrictsFeatureCollection['features'][i].properties["Enrollment"] = districtData[districtNumber]["Enrollment"]
TexasDistrictsFeatureCollection['features'][i].properties["Victories"] = districtData[districtNumber]["Victories"]
TexasDistrictsFeatureCollection['features'][i].properties["JoinTAFT"] = districtData[districtNumber]["JoinTAFT"]
TexasDistrictsFeatureCollection['features'][i].properties["RawDataLink"] = districtData[districtNumber]["RawDataLink"]
TexasDistrictsFeatureCollection['features'][i].properties["House"] = districtData[districtNumber]["House"]
TexasDistrictsFeatureCollection['features'][i].properties["Senate"] = districtData[districtNumber]["Senate"]
TexasDistrictsFeatureCollection['features'][i].properties["PerStudentCostOfCharters"] = districtData[districtNumber]["PerStudentCostOfCharters"]
TexasDistrictsFeatureCollection['features'][i].properties["CostOfCharters"] = districtData[districtNumber]["CostOfCharters"]
TexasDistrictsFeatureCollection['features'][i].properties["CharterTransfers"] = districtData[districtNumber]["CharterTransfers"]
TexasDistrictsFeatureCollection['features'][i].properties["Attendance"] = districtData[districtNumber]["Attendance"]
TexasDistrictsFeatureCollection['features'][i].properties["LocalFunding"] = districtData[districtNumber]["LocalFunding"]
TexasDistrictsFeatureCollection['features'][i].properties["StateFunding"] = districtData[districtNumber]["StateFunding"]
TexasDistrictsFeatureCollection['features'][i].properties["FederalFunding"] = districtData[districtNumber]["FederalFunding"]
TexasDistrictsFeatureCollection['features'][i].properties["OtherLocalFunding"] = districtData[districtNumber]["OtherLocalFunding"]
TexasDistrictsFeatureCollection['features'][i].properties["CharterCostLink"] = districtData[districtNumber]["CharterCostLink"]
}
window.geojson = L.geoJSON(TexasDistrictsFeatureCollection, {
style: style,
onEachFeature: function (feature, layer) {
var color;
var display;
if (feature.properties.PercentChangeTeacherPay < 0) {
color = 'red'
} else {
color = 'black'
}
if (feature.properties.Victories) {
display = 'block';
} else {
display = 'none';
}
layer.on({
mouseover: highlightFeature,
mouseout: resetHighlight,
click: zoomToFeature,
})
var houstonTrigger;
if (feature.properties.NAME == 'Houston ISD') {
houstonTrigger = 'block'
} else {
houstonTrigger = 'none'
}
var popup = L.responsivePopup().setContent(`<div><h1><a class="district-name-linked" onclick="openNav(name='${feature.properties.NAME.toString()}', number='${feature.properties.DISTRICT_C.toString()}', teacherPay='${feature.properties.PercentChangeTeacherPay.toString()}%', recaptureAmount='${feature.properties.RecaptureAmount.toString()}', enrollmentChange='${feature.properties.EnrollmentChange.toString()}', rawDataLink='${feature.properties.RawDataLink}')">${feature.properties.NAME.toString()}</a></h1><h2>CDN: <span style="font-weight: normal">${feature.properties.DISTRICT_C.toString()}</span></h2><div style="border: 1px solid lightgrey; border-radius: 4px;"><h4 style="text-align: center; padding-bottom: 0; margin-bottom: 0;">2009-2010 - 2020-2021 % Change in Average Teacher Salary (2021 USD)</h4><div style="display: flex; flex: 1; flex-direction: row"><div style="flex: 0.5"><h3 style="text-align: center; text-decoration: underline;">${feature.properties.NAME}:</h3><h3 style="text-align: center; color: ${color}">${feature.properties.PercentChangeTeacherPay.toString()}%</h3></div><div style="flex: 0.5"><h3 style="text-align: center; text-decoration: underline;">Texas:</h3><h3 style="text-align: center; color: black;">-3.89%</h3></div></div></div><h3 id="respect-campaign-victories-subheader" style="display: ${display}">RESPECT CAMPAIGN Victories:</h3><div style="display: ${display}">${feature.properties.Victories}</div><h3>Lead change in ${feature.properties.NAME}:</h3><p>Where do you work? Select employer below.</p>
<input type="radio" id="employer1" name="employer" value="k-12" checked>
<label for="employer1">K-12 Public School (ISD)</label><br>
<select style="display: ${houstonTrigger}; clear: right; width: 100%" name="hisd-employer" id="hisd-employer" required>
<option value="NONE" disabled>SELECT STAFF TYPE</option>
<option value="hft">Certified & Classroom Personnel - HFT</option>
<option value="hesp">Support & Auxiliary Staff - HESP</option>
<br/>
</select>
<input type="radio" id="employer2" name="employer" value="higher-ed">
<label for="employer2">Higher Education</label><br>
<input type="radio" id="employer3" name="employer" value="charter">
<label for="employer3">Charter School</label><br>
<input type="radio" id="employer4" name="employer" value="retiree">
<label for="employer4">Retiree</label><br>
<input type="radio" id="employer5" name="employer" value="student">
<label for="employer5">Student Membership</label><br>
<div style="margin: auto; text-align: center;">
<a href="#" onclick="
var employers = document.getElementsByName('employer');
for (var i = 0; i < employers.length; i++) {if (employers[i].checked) {
var employerType = employers[i].value;
if (employerType == 'k-12') {
if ('${feature.properties.NAME}' == 'Houston ISD') {
var houstonEmployer = document.getElementById('hisd-employer').value;
if (houstonEmployer == 'hft') {
window.open('https://join.aft.org/form/houston-federation-of-teachers/local/02415/hft-membership-application', '_blank');
} else if (houstonEmployer == 'hesp') {
window.open('https://www.texasaft.org/wp-content/uploads/2022/07/HESPDuesForm2022-202350.pdf', '_blank');
} else {
alert('REQUIRED: Select your staff type below to join AFT.')
}
} else {
window.open('${feature.properties.JoinTAFT.toString()}', '_blank');
}
} else if (employerType == 'higher-ed') {
window.open('https://www.texasaft.org/join', '_blank');
} else if (employerType == 'charter') {
window.open('https://www.texasaft.org/charter-school-membership/', '_blank');
} else if (employerType == 'retiree') {
window.open('https://join.aft.org/form/texas-aft-retiree-plus/local/08041/texas-aft-retiree-plus-membership-form', '_blank');
} else if (employerType == 'student') {
window.open('https://www.texasaft.org/student-membership-application/', '_blank');
}
}}" style="text-decoration: none; color: white; font-size: 14px; cursor: pointer;"><button class="respect-campaign-popup-button" style="background-color: #1167B0; margin-top: 10px; width: 100%; font-size: 14px; cursor: pointer;">JOIN OUR UNION</button></a>
<a style="color: white; font-size: 14px; text-decoration: none; cursor: pointer;" href="https://actionnetwork.org/forms/take-the-respect-pledge" target="_blank"><button class="respect-campaign-popup-button" style="font-size: 14px; margin-top: 10px; width: 100%; cursor: pointer; background: linear-gradient(166deg, rgba(2,0,36,1) 0%, rgba(0,51,102,1) 52%, rgba(255,204,51,1) 98%);">SIGN RESPECT PLEDGE</button></a>
</div></div>`);
layer.bindPopup(popup, {maxHeight: 550});
}
}).addTo(map)
window.geojsonhd = L.geoJSON(planhd, {
style: {
fillColor: 'white',
weight: 3,
opacity: 1,
color: 'red',
fillOpacity: 0,
smoothFactor: 0,
},
onEachFeature: function (feature, layer) {
layer.bindTooltip(feature.properties.District.toString(), {permanent: false, direction:"center"})
}
})
window.geojsonsd = L.geoJSON(plansd, {
style: {
fillColor: 'white',
weight: 3,
opacity: 1,
color: 'red',
fillOpacity: 0,
smoothFactor: 0,
},
onEachFeature: function (feature, layer) {
layer.bindTooltip(feature.properties.District.toString(), {permanent: false, direction:"center"})
}
})
window.geojsoncd = L.geoJSON(plancd, {
style: {
fillColor: 'white',
weight: 3,
opacity: 1,
color: 'red',
fillOpacity: 0,
smoothFactor: 0,
},
onEachFeature: function (feature, layer) {
layer.bindTooltip(feature.properties.District.toString(), {permanent: false, direction:"center"})
}
})
window.geojsoned = L.geoJSON(planed, {
style: {
fillColor: 'white',
weight: 3,
opacity: 1,
color: 'red',
fillOpacity: 0,
smoothFactor: 0,
},
onEachFeature: function (feature, layer) {
layer.bindTooltip(feature.properties.District.toString(), {permanent: false, direction:"center"})
}
})
map.addControl( new L.Control.Search({layer: window.geojson, propertyName: 'NAME', marker: {icon: false, animate: true, circle: true}, zoom: 10}).on("search:locationfound", function (e) {
if (e.layer._popup) e.layer.openPopup();
}));
window.geojsonLocals = L.geoJSON(TexasAFTLocals, {
style: {
fillColor: 'black',
weight: 1.75,
opacity: 1,
color: '#1167B0',
fillOpacity: 0,
smoothFactor: 0,
pointerEvents: 'none',
},
interactive: false,
text: ''
}).addTo(map)
var overlayMaps = {
"Texas AFT Locals/Org Committees": window.geojsonLocals,
"School Districts": window.geojson,
"Texas House": window.geojsonhd,
"Texas Senate": window.geojsonsd,
"Congress": window.geojsoncd,
"SBOE": window.geojsoned,
}
var layerControl = L.control.layers(null, overlayMaps).addTo(map);
L.Control.FindMyLocation = L.Control.extend({
onAdd: function(map) {
var button = L.DomUtil.create('button');
button.innerText = '🏠'
button.style.width = '35px';
button.style.height = '35px';
button.onclick = function () {
map.locate({setView: true, maxZoom: 12})
function onLocationFound(e) {
var radius = e.accuracy;
L.marker(e.latlng).addTo(map)
.bindPopup('You are within ' + radius + ' meters from this point');
L.circle(e.latlng, radius).addTo(map);
}
map.on('locationfound', onLocationFound); function onLocationError(e) {
alert(e.message);
}
map.on('locationerror', onLocationError);
}
return button;
},
onRemove: function(map) {
// Nothing to do here
}
});
L.control.findmylocationbutton = function(opts) {
return new L.Control.FindMyLocation(opts);
}
L.control.findmylocationbutton({ position: 'bottomleft' }).addTo(map);
}
initMap()
// functions opening and closing the district detail page, loading with data
function openNav(name, number, teacherPay, recaptureAmount, enrollmentChange, rawDataLink) {
var mapModal = L.map('respect-map-modal').setView([31.6623, -99.0306], 6);
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
}).addTo(mapModal);
for (var i=0; i < window.TexasDistrictsFeatureCollection.features.length; i++) {
var districtLocal = window.TexasDistrictsFeatureCollection.features[i]
if (districtLocal.properties.NAME === name) {
// console.log(districtLocal.properties)
window.geojsonSchoolDistrict = L.geoJSON(districtLocal, {
style: {
fillColor: 'green',
weight: 2,
opacity: 1,
color: 'green',
fillOpacity: 0,
smoothFactor: 0,
pointerEvents: 'none',
},
interactive: false,
text: ''
}).addTo(mapModal)
var overlayMaps = {
"Texas AFT Locals/Org Committees": geojsonLocals,
"Texas House": geojsonhd,
"Texas Senate": geojsonsd,
"Congress": geojsoncd,
"SBOE": geojsoned,
}
var layerControl = L.control.layers(null, overlayMaps).addTo(mapModal);
mapModal.fitBounds(geojsonSchoolDistrict.getBounds())
mapModal.setZoom(9)
// TODO: dynamically create table of lege districts (House + Senate)
var houseDistricts = districtLocal.properties.House
var senateDistricts = districtLocal.properties.Senate
var houseList = '<ul>';
for (var n = 0; n < houseDistricts.length; n++) {
houseList += `<li><a target="_blank" href="https://house.texas.gov/members/member-page/?district=${houseDistricts[n][0].replace('DISTRICT ', '')}">${houseDistricts[n][0]}</a>: <span style="float: right;">${houseDistricts[n][1]}</span></li>`;
}
houseList += '</ul>';
var houseDistrictsUnordered = document.getElementById('house-districts');
houseDistrictsUnordered.innerHTML = houseList
var senateList = '<ul>';
for (var m = 0; m < senateDistricts.length; m++) {
senateList += `<li><a target="_blank" href="https://senate.texas.gov/member.php?d=${senateDistricts[m][0].replace('DISTRICT ', '')}">${senateDistricts[m][0]}</a>: <span style="float: right;">${senateDistricts[m][1]}</span></li>`;
}
senateList += '</ul>';
var senateDistrictsUnordered = document.getElementById('senate-districts');
senateDistrictsUnordered.innerHTML = senateList
var adaPercent = document.getElementById('detail-district-ada-percent');
adaPercent.innerText = `${((parseFloat(districtLocal.properties.Attendance)/parseFloat(districtLocal.properties.Enrollment)) * 100).toFixed(2)}%`
var enrollment = document.getElementById('detail-district-enrollment');
enrollment.innerText = `${districtLocal.properties.Enrollment.toLocaleString()}`
var attendance = document.getElementById('detail-district-attendance');
attendance.innerText = `${districtLocal.properties.Attendance.toLocaleString()}`
var charterCost = document.getElementById('detail-district-charter-cost');
var charterCostText = districtLocal.properties.CostOfCharters
charterCost.innerText = `${charterCostText}`
var charterCost2 = document.getElementById('detail-district-charter-cost-2');
charterCost2.innerText = `${charterCostText}`
var charterCostPerStudent = document.getElementById('detail-district-charter-cost-per-student');
var charterCostPerStudentText = districtLocal.properties.PerStudentCostOfCharters
charterCostPerStudent.innerText = `${charterCostPerStudentText}`
var charterCostLink = document.getElementById('detail-charter-cost-link');
charterCostLink.href = districtLocal.properties.CharterCostLink;
charterCostLink.target = "_blank";
var stateFunding = document.getElementById('detail-state-funding');
stateFunding.innerText = `$${districtLocal.properties.StateFunding.toLocaleString()} (${((districtLocal.properties.StateFunding/(districtLocal.properties.StateFunding + districtLocal.properties.LocalFunding + districtLocal.properties.FederalFunding + districtLocal.properties.OtherLocalFunding)) * 100).toFixed(2)}%)`
var localFunding = document.getElementById('detail-local-funding');
localFunding.innerText = `$${districtLocal.properties.LocalFunding.toLocaleString()} (${((districtLocal.properties.LocalFunding/(districtLocal.properties.StateFunding + districtLocal.properties.LocalFunding + districtLocal.properties.FederalFunding + districtLocal.properties.OtherLocalFunding)) * 100).toFixed(2)}%)`
var federalFunding = document.getElementById('detail-federal-funding');
federalFunding.innerText = `$${districtLocal.properties.FederalFunding.toLocaleString()} (${((districtLocal.properties.FederalFunding/(districtLocal.properties.StateFunding + districtLocal.properties.LocalFunding + districtLocal.properties.FederalFunding + districtLocal.properties.OtherLocalFunding)) * 100).toFixed(2)}%)`
var otherLocalFunding = document.getElementById('detail-other-local-funding');
otherLocalFunding.innerText = `$${districtLocal.properties.OtherLocalFunding.toLocaleString()} (${((districtLocal.properties.OtherLocalFunding/(districtLocal.properties.StateFunding + districtLocal.properties.LocalFunding + districtLocal.properties.FederalFunding + districtLocal.properties.OtherLocalFunding)) * 100).toFixed(2)}%)`
var charterTransfers = document.getElementById('detail-charter-transfers');
charterTransfers.innerText = `${districtLocal.properties.CharterTransfers.toLocaleString()}`
var pieChart = document.getElementById('pie-chartcanvas-1');
var options = {
responsive: true,
title: {
display: true,
position: "top",
text: "Pie Chart",
fontSize: 18,
fontColor: "#111"
},
legend: {
display: true,
position: "bottom",
labels: {
fontColor: "#333",
fontSize: 16
}
}