Skip to content

Instantly share code, notes, and snippets.

@jebeck
jebeck / index.html
Last active August 29, 2015 13:57
hidden axis toggle
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8'>
<title>
UI Experiment: Hidden Axis Toggle
</title>
<script src='http://d3js.org/d3.v3.min.js' charset='utf-8'></script>
<style type='text/css'>
svg {
@jebeck
jebeck / CDT all about D3 time scales.png
Last active June 2, 2022 02:21
all about D3 time scales
CDT all about D3 time scales.png
@jebeck
jebeck / README.md
Last active May 30, 2023 05:03
SVG foreignObject tooltips in D3

SVG foreignObject tooltips in D3

Just a little proof-of-concept here - using an SVG <foreignObject> element as a container for a tooltip that can involve handy HTML features like text-wrapping and (semi-)dynamic sizing.

Gotchas so far:

  • Like an <svg> element, a <foreignObject> element needs a width and a height in order to be rendered.

  • However, specifying width and/or height can be delayed. Here I specify a width (foWidth) of 300px, then find the height of the contained <div> using getBoundingClientRect() and use that to specify the height of the containing <foreignObject>.

@jebeck
jebeck / README.md
Last active September 18, 2020 04:55
Dexcom .csv merge

Dexcom .csv merge

A simple tool to merge several Dexcom Studio .csv/.txt export files into a single file.

NB: Now being further developed in iPancreas-dexcom.

@jebeck
jebeck / README.md
Last active August 4, 2016 08:01
profile a Python module with hotshot

Python Hotshot Profiler

Just a quick script to profile any Python module (filename passed in as a command-line arg; has to have a main()) using hotshot. Logs to stdout.

@jebeck
jebeck / README.md
Last active August 29, 2015 14:02
playing with SVG line markers in D3

SVG Line Markers

This is a quick exploration of SVG circle line markers (with a transparent line) as an alternative to drawing many circles.

With constantly updating data, this seems to render quite a bit smoother than circles, with the FPS only dropping below ~40 at about 600 items.

Disclaimer: Not (yet) a scientific study ;)

@jebeck
jebeck / README.md
Last active August 29, 2015 14:02
second verse...not same as the first

Constant-Update Scatterplot

The standard constant-updating scatterplot model, drawing many independent circles.

Seems to render slower than SVG circle line markers on a single transparent line, with the FPS dropping below ~40 at about 450 items.

Disclaimer: not (yet) a scientific study ;)

@jebeck
jebeck / README.md
Last active August 29, 2015 14:04
Heatmap of blood glucose data by day of week.

Heatmap of Blood Glucose Data by Day of Week

This heat map shows the distribution of a week's worth of blood glucose values (acquired from a Dexcom continuous glucose monitor) according to the day of the week and by bin, where each bin represents a 20-point range of blood glucose values.

@jebeck
jebeck / README.md
Last active August 29, 2015 14:04
Heatmap of blood glucose data by hour of day.

Heatmap of Blood Glucose Data by Hour of Day

This heat map shows the distribution of a week's worth of blood glucose values (acquired from a Dexcom continuous glucose monitor) according to the hour of the day and by bin, where each bin represents a 20-point range of blood glucose values.

@jebeck
jebeck / README.md
Last active August 29, 2015 14:04
Horizontal histogram of blood glucose data.

Horizontal Histogram of Blood Glucose Data

This horizontal histogram provides a quick summary view of an entire week's worth of blood glucose values (acquired from a Dexcom continuous glucose monitor), where each bar represents a 20-point range of blood glucose values (in mg/dL).