block by zeffii 06972c1773b30ccdb2d8

Glucose over time + food hints

Full Screen

Built with blockbuilder.org

forked from zeffii‘s block: Glucose over time + food hints

forked from zeffii‘s block: Glucose over time + food hints

forked from zeffii‘s block: Glucose over time + food hints

index.html

<!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>

dillitant.js

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);
  
});

sugars.csv

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,-