Skip to content

Instantly share code, notes, and snippets.

@zeffii
Created February 2, 2016 10:22
Show Gist options
  • Save zeffii/3c280b21451e269ba759 to your computer and use it in GitHub Desktop.
Save zeffii/3c280b21451e269ba759 to your computer and use it in GitHub Desktop.
Glucose over time + food hints
var svg = d3.select("svg")
svg.append("rect")
.attr({x: 100, y: 10, width: 700, height: 480})
.style({ fill: "#a72d1a"})
.transition().duration(3000).ease("bounce")
.style({ fill: "#5db9e3"})
<!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