Skip to content

Commit 0b63de5

Browse files
committed
Attempt to make the static graphic outputs accessible by incorporating them into a simple page instead of just linking the graphic itself.
1 parent 6c79831 commit 0b63de5

2 files changed

Lines changed: 69 additions & 0 deletions

File tree

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!DOCTYPE html>
2+
<html lang="en-GB">
3+
<head>
4+
<title>Trafford Data Lab: Resident Population of Trafford</title>
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"/>
6+
<meta charset="UTF-8"/>
7+
8+
<link rel="stylesheet" href="../css/accessible_graphics.css"/>
9+
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans%7CRoboto"/>
10+
</head>
11+
12+
<body>
13+
<main>
14+
<h1>Resident Population of Trafford</h1>
15+
<cite>Source: Mid-2018 population statistics, Office for National Statistics.</cite>
16+
17+
<figure>
18+
<img src="https://www.trafforddatalab.io/maps/static/output/trafford_population_2018.png" width="100%" alt="Map of Trafford showing the 21 wards coloured according to their mid-2018 population estimates."/>
19+
<figcaption>
20+
Broadheath ward located in the South of Trafford has the highest resident population in the borough with just over 14,000 people living there. The neighbouring ward of Altrincham is next with just 1,000 fewer residents. The Northern wards of Gorse Hill, Longford and Clifford also have relatively large populations of around 12,500 people. Bowdon ward in the South and Davyhulme East ward in the West of Trafford have the fewest residents, around 9,500 people living in each. The remaining 14 wards have between 10,000 and 12,000 residents.
21+
</figcaption>
22+
</figure>
23+
</main>
24+
</body>
25+
</html>

css/accessible_graphics.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
body
2+
{
3+
padding: 0;
4+
margin: 0;
5+
font-family: 'Open Sans', sans-serif;
6+
color: #212121;
7+
}
8+
9+
h1
10+
{
11+
font-family: 'Roboto', sans-serif;
12+
color: #707070;
13+
margin-bottom: 0.1em; /* to make the heading closer to the citation text */
14+
}
15+
16+
h1, cite
17+
{
18+
margin-left: 2rem;
19+
}
20+
21+
cite
22+
{
23+
font-size: 0.75em;
24+
}
25+
26+
img
27+
{
28+
border: 0;
29+
max-height: 100vh; /* we want the graphic to be completely visible in the full height of the display */
30+
max-width: 90vw; /* we also want the graphic to be completely visible in the width of the display with out scrolling - NOTE: the img has a width attribute set to 100% to prevent it appearing full size if the page is rendered without CSS */
31+
width: auto;
32+
display: block;
33+
margin: auto;
34+
}
35+
36+
figcaption
37+
{
38+
display: block;
39+
margin-top: 1em;
40+
padding: 0.5em;
41+
line-height: 1.75em;
42+
background-color: #ddd;
43+
box-shadow: 0 0 9px #ccc;
44+
}

0 commit comments

Comments
 (0)