Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created February 2, 2016 10:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeffii/06972c1773b30ccdb2d8 to your computer and use it in GitHub Desktop.
Save zeffii/06972c1773b30ccdb2d8 to your computer and use it in GitHub Desktop.
Glucose over time + food hints
var svg = d3.select("svg")
d3.csv("sugars.csv", function(error, data) {
if (error) throw error;
# data.forEach(function(d) {
# d.date = parseDate(d.date);
# d["New York"] = +d["New York"];
# d["San Francisco"] = +d["San Francisco"];
# });
console.log(data);
});
<!DOCTYPE html>
<head>
<meta charset="utf-8">
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js"></script>
<style>
body { margin:0;position:fixed;top:0;right:0;bottom:0;left:0; }
svg { width:100%; height: 100% }
</style>
</head>
<body>
<svg></svg>
<script src="dillitant.js"></script>
</body>
time bsl hint food
1 12.3 n -
3 14.3 nn -
4 17.3 n -
6 22.3 n -
11 - - some kind of food
12 22.3 n -
13 12.3 nn -
17 22.3 n -
18 - - some kind of food
20 16.3 n -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment