Skip to content

Commit

Permalink
stash key to people database in names database
Browse files Browse the repository at this point in the history
  • Loading branch information
Nigel Horne committed Jan 16, 2018
1 parent 1d3bdce commit 77d6c31
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
22 changes: 17 additions & 5 deletions dynamic-site/templates/en/web/Ged2site/Display/graphs.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@
[% ELSIF graph == 'motherchildren' %]
[% SET title = 'Number of Children by Women' %]
[% ELSIF graph == 'namecloud' %]
<link rel="stylesheet" href="/css/web.css" type="text/css" media="screen">
[% SET title = 'First Name Popularity' %]
[% ELSE %]
<link rel="stylesheet" href="/css/web.css" type="text/css" media="screen">
[% SET title = 'Choose a graph' %]
[% END %]
<title>[% title %]</title>
[% IF twitter %]
<meta name="twitter:site" content="@[% twitter %]">
<meta name="twitter:title" content="[% SiteTitle %]">
[% END %]
<!--
<meta http-equiv="Content-Language" content="English">
-->
Expand Down Expand Up @@ -188,11 +193,6 @@
chart.render();
}
</script>
[% ELSIF clouds %]
[% FOREACH year IN clouds %]
<h2>[% year.year * 25 %]</h2>
[% year.data %]
[% END %]
[% END %]
<!--
<style type="text/css">
Expand Down Expand Up @@ -272,6 +272,18 @@
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
<p>This graph only includes data when the year of births of parents and children are known.</p>
<p>This graph only includes data from 5 year periods that contain at least 5 births.</p>
[% ELSIF clouds %]
<div id="header_container">
<center>
<h1>First Name Popularity</h1>
</center>
</div>
<div id="container">
[% FOREACH year IN clouds %]
<h2>[% year.year * 25 %]</h2>
[% year.data %]
[% END %]
</div>
[% ELSE %]
<div id="container">
<h2>Choose a Graph</h2>
Expand Down
8 changes: 5 additions & 3 deletions ged2site
Original file line number Diff line number Diff line change
Expand Up @@ -911,12 +911,14 @@ if(open(my $fout, '>', 'static-site/history.html')) {

if(open($csv, '>', 'dynamic-site/databases/names.csv')) {
# Ready for HTML::TagCloud
print $csv "entry!name!count\n";
print $csv "entry!name!count!people\n";
$index = 1;

foreach my $date(sort keys %name_date) {
foreach my $firstname(sort keys %{$name_date{$date}}) {
print $csv "$date!$firstname!$name_date{$date}{$firstname}\n";
my $count = scalar($name_date{$date}{$firstname});
my $people = join('--', @{$name_date{$date}{$firstname}});
print $csv "$date!$firstname!$count!$people\n";
}
}
close $csv;
Expand Down Expand Up @@ -1060,7 +1062,7 @@ sub print_person
}

if($yob && $firstname) {
$name_date{floor($yob / 25)}{$firstname}++;
push @{$name_date{floor($yob / 25)}{$firstname}}, $person->{'xref'};
}

my $is_alive = is_alive(person => $person);
Expand Down

0 comments on commit 77d6c31

Please sign in to comment.