Skip to content

Instantly share code, notes, and snippets.

@yppmark
Created March 28, 2015 16:18
Show Gist options
  • Save yppmark/12feece2ab0cc50d09a8 to your computer and use it in GitHub Desktop.
Save yppmark/12feece2ab0cc50d09a8 to your computer and use it in GitHub Desktop.
Sleep In Mammals Test
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Loading CSV Data with D3</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.js"></script>
</head>
<body>
<p>Not much to see here; try looking in the console!</p>
<script type="text/javascript">
//Load in contents of CSV file
d3.csv("SleepInMammals.csv", function(data) {
//Now CSV contents have been transformed into
//an array of JSON objects.
//Log 'data' to the console, for verification.
console.log(data);
});
</script>
</body>
</html>
Species of animal Body Weight (kg) Brain Weight (g) Slow wave sleep (hrs/day) Paradoxical sleep (hrs/day) Total sleep (hrs/day) Maximum life span (years) Gestation time (days) Predation index Sleep exposure index Overall danger index
African giant pouched rat 1 6.6 6.3 2 8.3 4.5 42 3 1 3
Asian elephant 2547 4603 2.1 1.8 3.9 69 624 3 5 4
Baboon 10.55 179.5 9.1 0.7 9.8 27 180 4 4 4
Big brown bat 0.023 0.3 15.8 3.9 19.7 19 35 1 1 1
Brazilian tapir 160 169 5.2 1 6.2 30.4 392 4 5 4
Cat 3.3 25.6 10.9 3.6 14.5 28 63 1 2 1
Chimpanzee 52.16 440 8.3 1.4 9.7 50 230 1 1 1
Chinchilla 0.425 6.4 11 1.5 12.5 7 112 5 4 4
Cow 465 423 3.2 0.7 3.9 30 281 5 5 5
Eastern American mole 0.075 1.2 6.3 2.1 8.4 3.5 42 1 1 1
Echidna 3 25 8.6 0 8.6 50 28 2 2 2
European hedgehog 0.785 3.5 6.6 4.1 10.7 6 42 2 2 2
Galago 0.2 5 9.5 1.2 10.7 10.4 120 2 2 2
Goat 27.66 115 3.3 0.5 3.8 20 148 5 5 5
Golden hamster 0.12 1 11 3.4 14.4 3.9 16 3 1 2
Gray seal 85 325 4.7 1.5 6.2 41 310 1 3 1
Ground squirrel 0.101 4 10.4 3.4 13.8 9 28 5 1 3
Guinea pig 1.04 5.5 7.4 0.8 8.2 7.6 68 5 3 4
Horse 521 655 2.1 0.8 2.9 46 336 5 5 5
Lesser short-tailed shrew 0.005 0.14 7.7 1.4 9.1 2.6 21.5 5 2 4
Little brown bat 0.01 0.25 17.9 2 19.9 24 50 1 1 1
Human 62 1320 6.1 1.9 8 100 267 1 1 1
Mouse 0.023 0.4 11.9 1.3 13.2 3.2 19 4 1 3
Musk shrew 0.048 0.33 10.8 2 12.8 2 30 4 1 3
N. American opossum 1.7 6.3 13.8 5.6 19.4 5 12 2 1 1
Nine-banded armadillo 3.5 10.8 14.3 3.1 17.4 6.5 120 2 1 1
Owl monkey 0.48 15.5 15.2 1.8 17 12 140 2 2 2
Patas monkey 10 115 10 0.9 10.9 20.2 170 4 4 4
Phanlanger 1.62 11.4 11.9 1.8 13.7 13 17 2 1 2
Pig 192 180 6.5 1.9 8.4 27 115 4 4 4
Rabbit 2.5 12.1 7.5 0.9 8.4 18 31 5 5 5
Rat 0.28 1.9 10.6 2.6 13.2 4.7 21 3 1 3
Red fox 4.235 50.4 7.4 2.4 9.8 9.8 52 1 1 1
Rhesus monkey 6.8 179 8.4 1.2 9.6 29 164 2 3 2
Sheep 55.5 175 3.2 0.6 3.8 20 151 5 5 5
Tenrec 0.9 2.6 11 2.3 13.3 4.5 60 2 1 2
Tree hyrax 2 12.3 4.9 0.5 5.4 7.5 200 3 1 3
Tree shrew 0.104 2.5 13.2 2.6 15.8 2.3 46 3 2 2
Vervet 4.19 58 9.7 0.6 10.3 24 210 4 3 4
Water opossum 3.5 3.9 12.8 6.6 19.4 3 14 2 1 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment