Skip to content

Instantly share code, notes, and snippets.

@BMPMS
BMPMS / boo.png
Last active September 28, 2018 11:10
d3.js - merge a group of DOM objects
boo.png
@BMPMS
BMPMS / index.html
Last active May 16, 2018 10:21
D3 v4 Merge - demo key and no key
<!DOCTYPE html>
<meta charset="utf-8">
<head>
<title>Merge with and without Key</title>
</head>
<style>
body {
font-family: "Helvetica Neue", Helvetica, sans-serif;
font-size: 14px;
@BMPMS
BMPMS / hygiene.css
Last active March 28, 2017 12:07
Map Error
table,th,td {
font-family: Roboto;
font-size: 22px;
border: 1px solid black;
width: 100%;
}
#my_map {
width: 100%;
height: 600px;
margin: 0;
@BMPMS
BMPMS / README.md
Last active January 7, 2017 10:31
Bath Air Quality Dashboard

Air Quality Dashboard using data from Bath Hacked Data Store.

The dashboard looks at average NO2 and PM10 readings over two complete years of data - 2015 and 2016 - from four different air sensors.

Report on Sensor Data Errors can be found here.

GIST includes 7 files:

  • air_vis.py - python file which wrangles data into required format
  • all_data.csv - chart data initally formatted to fit adapted Peter Cook circular heat map also used for line chart
@BMPMS
BMPMS / index.html
Last active December 14, 2016 17:16
2015 PISA
<!DOCTYPE html>
<html>
<title>PISA 2015 Visualisation</title>
<link rel="stylesheet" type="text/css" href="pisa.css" media="screen" />
<head>
<meta charset="utf-8">
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="pisa.js"></script>
@BMPMS
BMPMS / boom_style.css
Created November 24, 2016 11:14
Waterfall
/*general */
text {
font: 10px sans-serif;
}
/*tooltip */
@BMPMS
BMPMS / boom_style.css
Last active November 24, 2016 11:12
Donut Chart
/*general */
text {
font: 10px sans-serif;
}
/*tooltip */
@BMPMS
BMPMS / d3.legend.js
Last active October 18, 2016 11:29
Sustainix Top 100 Rankings
// d3.legend.js
// (C) 2012 ziggy.jonsson.nyc@gmail.com
// MIT licence
(function() {
d3.legend = function(g) {
g.each(function() {
var g= d3.select(this),
items = {},
svg = d3.select(g.property("nearestViewportElement")),
@BMPMS
BMPMS / balance.html
Last active October 18, 2016 13:14
Bank of England
<!DOCTYPE html>
<meta charset="utf-8">
<style> /* set the CSS */
</style>
<body>
<!-- load the d3.js library -->
<link rel="stylesheet" type="text/css" href="popups.css" media="screen" />
@BMPMS
BMPMS / dvis.html
Last active July 18, 2016 15:41
Test website
<html>
<head>
</head>
<body>
<style>
table{
width: 800px;
margin-left: auto;
margin-right: auto;
margin-top: 20px;