Skip to content

Instantly share code, notes, and snippets.

@chule
chule / index.html
Last active June 13, 2019 14:44
D3 Clock / Calendar
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>D3 Clock & Calendar</title>
@chule
chule / index.html
Last active January 1, 2016 05:19
Text on horizontal bar chart - d3
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Text on horizontal bar chart - d3</title>
@chule
chule / index.html
Last active January 3, 2016 05:49
D3 spiral matrix
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>D3 spiral matrix</title>
@chule
chule / d3.layout.cloud.js
Last active August 29, 2015 13:59
Word cloud
// Word cloud layout by Jason Davies, http://www.jasondavies.com/word-cloud/
// Algorithm due to Jonathan Feinberg, http://static.mrfeinberg.com/bv_ch03.pdf
(function(exports) {
function cloud() {
var size = [256, 256],
text = cloudText,
font = cloudFont,
fontSize = cloudFontSize,
fontStyle = cloudFontNormal,
fontWeight = cloudFontNormal,
@chule
chule / flare.json
Last active August 29, 2015 14:01
Loading json files
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@chule
chule / colorbrewer.js
Last active August 29, 2015 14:06
Choropleth with colorbrewer
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
// JavaScript specs as packaged in the D3 library (d3js.org). Please see license at http://colorbrewer.org/export/LICENSE.txt
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
@chule
chule / colorbrewer.js
Last active August 29, 2015 14:06
Proportional Symbol
// This product includes color specifications and designs developed by Cynthia Brewer (http://colorbrewer.org/).
// JavaScript specs as packaged in the D3 library (d3js.org). Please see license at http://colorbrewer.org/export/LICENSE.txt
var colorbrewer = {YlGn: {
3: ["#f7fcb9","#addd8e","#31a354"],
4: ["#ffffcc","#c2e699","#78c679","#238443"],
5: ["#ffffcc","#c2e699","#78c679","#31a354","#006837"],
6: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#31a354","#006837"],
7: ["#ffffcc","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
8: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#005a32"],
9: ["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"]
@chule
chule / croatiatopo.json
Last active August 29, 2015 14:06
Counties of Croatia (from '92. to '97.)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chule
chule / .block
Last active March 20, 2018 23:56
Map of Africa
license: mit
@chule
chule / index.html
Created September 9, 2015 22:58
works with newest version of d3
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>One Graph</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.6/d3.min.js" charset="utf-8"></script>
<script type="text/javascript" src="simple-graph.js"></script>
<style type="text/css">
body { font: 13px sans-serif; }
rect { fill: #fff; }