Skip to content

Instantly share code, notes, and snippets.

@cirofdo
cirofdo / data.csv
Last active March 10, 2017 20:07
Pie Chart with Mouse Interactions
id var
A 2704659
B 4499890
C 2159981
D 3853788
E 14106543
F 8819342
G 612463
@cirofdo
cirofdo / data.csv
Last active March 8, 2017 19:16
Grouped Bar Chart
lead motivo_a motivo_b motivo_c motivo_d motivo_e
lead_15 300 251 149 57 885
lead_25 798 498 481 455 475
lead_30 781 146 545 221 112
lead_45 788 745 452 214 214
lead_60 1021 178 445 665 77
lead_80 787 445 454 522 123
lead_120 785 631 465 489 654
@cirofdo
cirofdo / d3-sankey.js
Last active November 7, 2022 21:56
Collapsible Sankey Diagram Aligned Left
// https://github.com/vasturiano/d3-sankey Version 0.4.2.
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-collection'), require('d3-interpolate')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-collection', 'd3-interpolate'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3,global.d3));
}(this, (function (exports,d3Array,d3Collection,d3Interpolate) { 'use strict';
var sankey = function() {
var sankey = {},
nodeWidth = 24,
@cirofdo
cirofdo / index.html
Last active March 9, 2017 03:07
D3 Bar Chart
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>D3: SVG bar chart with value labels (centered)</title>
<script type="text/javascript" src="http://d3js.org/d3.v3.min.js"></script>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>