Browse files

very basic

  • Loading branch information...
1 parent e26fc0d commit 28e13c36b2257db3d240385275b52b739cc3d92a @JoeGermuska committed Jun 16, 2012
Showing with 41 additions and 0 deletions.
  1. +23 −0 census/index.html
  2. +18 −0 census/profile.js
View
23 census/index.html
@@ -0,0 +1,23 @@
+<html>
+ <head>
+ <title>
+ Census Profiles
+ </title>
+ <script src="http://maps.google.com/maps/api/js?sensor=true"></script>
+ <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js">
+ </script>
+ <script src="https://raw.github.com/ireapps/census/master/tools/js/ire_census.js"></script>
+ <script type="text/javascript" src="profile.js">
+ </script>
+ </head>
+ <body>
+ <form id="geoid-form"><label for="geoid">GeoID</label><input type="text" name="geoid" value="" placeholder="change the geography" id="geoid"><br></form>
+
+ <div id="name"></div>
+ <div id="gender-breakdown">
+ Male Population: <div id="male-population"></div><div id="male-pct"></div>
+ Female Population: <div id="female-population"></div><div id="female-pct"></div>
+ Total: <div id="total-population"></div>
+ </div>
+ </body>
+</html>
View
18 census/profile.js
@@ -0,0 +1,18 @@
+$(function(){
+ function show_gender_breakdown(data) {
+ $("#male-population").html(ire_census.sf1val(data,'PCT012002','2010'));
+ $("#female-population").html(ire_census.sf1val(data,'PCT012106','2010'));
+ $("#male-pct").html(ire_census.sf1val_pct(data,'PCT012002','2010'));
+ $("#female-pct").html(ire_census.sf1val_pct(data,'PCT012106','2010'));
+ $("#total-population").html(ire_census.sf1val(data,'PCT012001','2010'));
+ }
+ function render_profile(data) {
+ $("#name").html(data.metadata.NAME);
+ show_gender_breakdown(data);
+ }
+ $(document).ready(function() {
+ data = ire_census.do_with_sf1_data('1714000',render_profile)
+ $("#geoid-form").submit(function() { ire_census.do_with_sf1_data($("#geoid").val(),render_profile); return false; })
+ });
+
+});

0 comments on commit 28e13c3

Please sign in to comment.