Inspired by Trulia Trends - but with code and using SVG.
Example data shows concurrent user sessions over time, taken from a development environment.
| license: gpl-3.0 |
| /* | |
| ** Client side - /public/src/app.js | |
| */ | |
| var myApp = { | |
| // Collections | |
| Collections: { | |
| list: Backbone.Collection.extend() | |
| }, | |
| // Views |
| class LazyCollection extends Backbone.Collection | |
| indexQuerystring: 'index' | |
| index: 1 | |
| lastLength: 0 | |
| fetch: (options) -> | |
| options or= {} | |
| if options.reset | |
| @index = 1 | |
| @lastLength = 0 | |
| else |
| require 'pp' | |
| require 'socket' | |
| module BluetoothPolarHrm | |
| AF_BLUETOOTH=31 # these are correct for the Linux Bluez stack | |
| BTPROTO_RFCOMM=3 | |
| class << self | |
| def connect_bt address_str,channel=1 | |
| bytes=address_str.split(/:/).map {|x| x.to_i(16) } | |
| s=Socket.new(AF_BLUETOOTH, :STREAM, BTPROTO_RFCOMM) |
| //Practically all this code comes from https://github.com/alangrafu/radar-chart-d3 | |
| //I only made some additions and aesthetic adjustments to make the chart look better | |
| //(of course, that is only my point of view) | |
| //Such as a better placement of the titles at each line end, | |
| //adding numbers that reflect what each circular level stands for | |
| //Not placing the last level and slight differences in color | |
| // | |
| //For a bit of extra information check the blog about it: | |
| //http://nbremer.blogspot.nl/2013/09/making-d3-radar-chart-look-bit-better.html |
| !function(){ | |
| var Donut3D={}; | |
| function pieTop(d, rx, ry, ir ){ | |
| if(d.endAngle - d.startAngle == 0 ) return "M 0 0"; | |
| var sx = rx*Math.cos(d.startAngle), | |
| sy = ry*Math.sin(d.startAngle), | |
| ex = rx*Math.cos(d.endAngle), | |
| ey = ry*Math.sin(d.endAngle); | |
Inspired by Trulia Trends - but with code and using SVG.
Example data shows concurrent user sessions over time, taken from a development environment.
This is the map of Nielen Designated Marketing Areas using D3.js. Hover over for data related to each area.
See map here
###Credits
| package main | |
| import "fmt" | |
| func A(x, y int) { | |
| fmt.Println("The deferred A-call", x, y) | |
| } | |
| func B() int { | |
| theAnswer := 42 |