Skip to content

Instantly share code, notes, and snippets.

// If you have data like this
const dataExample = {
charts: [
{
id: "chart1",
something1: {
something2: 1
},
something3: {
histogram: [1, 2, 3]
@biovisualize
biovisualize / .block
Created June 8, 2021 17:49
Chinese ascii fork from @enjalot
license: mit
@biovisualize
biovisualize / top10b_airports.json
Created October 4, 2019 16:05
top10 airports b
{"nodes":[{"id":"ORD","color":"#a6cee3"},{"id":"BRL","color":"silver"},{"id":"DEC","color":"silver"},{"id":"ATL","color":"#1f78b4"},{"id":"LWB","color":"silver"},{"id":"MCN","color":"silver"},{"id":"MEI","color":"silver"},{"id":"MSL","color":"silver"},{"id":"PIB","color":"silver"},{"id":"TUP","color":"silver"},{"id":"AMS","color":"#b2df8a"},{"id":"NDR","color":"silver"},{"id":"TNG","color":"silver"},{"id":"PEK","color":"#33a02c"},{"id":"CKG","color":"silver"},{"id":"CTU","color":"silver"},{"id":"WXN","color":"silver"},{"id":"ZHY","color":"silver"},{"id":"LAX","color":"#fb9a99"},{"id":"LAS","color":"silver"},{"id":"DFW","color":"#e31a1c"},{"id":"EZE","color":"silver"},{"id":"JFK","color":"#fdbf6f"},{"id":"MEX","color":"silver"},{"id":"HAM","color":"silver"},{"id":"CDG","color":"#ff7f00"},{"id":"FRA","color":"#cab2d6"},{"id":"HDF","color":"silver"},{"id":"LHR","color":"#6a3d9a"},{"id":"CGN","color":"silver"},{"id":"STR","color":"silver"},{"id":"TXL","color":"silver"},{"id":"MNL","color":"silver"},{"id":"KMG","c
@biovisualize
biovisualize / index.html
Last active March 10, 2023 22:00
top 10 airports network viz
<head>
<script src="//unpkg.com/force-graph"></script>
<style>
body {
margin: 0;
padding: 0;
background: #1e1e1e;
}
</style>
</head>
@biovisualize
biovisualize / top10_airports.json
Created September 14, 2019 16:11
top10 airports
{"nodes":[{"id":"ORD","color":"#a6cee3"},{"id":"BRL","color":"silver"},{"id":"DEC","color":"silver"},{"id":"ATL","color":"#1f78b4"},{"id":"LWB","color":"silver"},{"id":"MCN","color":"silver"},{"id":"MEI","color":"silver"},{"id":"MSL","color":"silver"},{"id":"PIB","color":"silver"},{"id":"TUP","color":"silver"},{"id":"AMS","color":"#b2df8a"},{"id":"NDR","color":"silver"},{"id":"TNG","color":"silver"},{"id":"PEK","color":"#33a02c"},{"id":"CKG","color":"silver"},{"id":"CTU","color":"silver"},{"id":"WXN","color":"silver"},{"id":"ZHY","color":"silver"},{"id":"LAX","color":"#fb9a99"},{"id":"LAS","color":"silver"},{"id":"DFW","color":"#e31a1c"},{"id":"EZE","color":"silver"},{"id":"JFK","color":"#fdbf6f"},{"id":"MEX","color":"silver"},{"id":"HAM","color":"silver"},{"id":"CDG","color":"#ff7f00"},{"id":"FRA","color":"#cab2d6"},{"id":"HDF","color":"silver"},{"id":"LHR","color":"#6a3d9a"},{"id":"CGN","color":"silver"},{"id":"STR","color":"silver"},{"id":"TXL","color":"silver"},{"id":"MNL","color":"silver"},{"id":"KMG","c
@biovisualize
biovisualize / index.html
Created September 11, 2019 22:55
Network viz, 2d version
<html>
<head>
<script src="//unpkg.com/force-graph"></script>
<style>
body { margin: 0; }
</style>
</head>
<body>
<div id="graph"></div>
<script>
@biovisualize
biovisualize / top20b_airports.js
Created September 11, 2019 22:34
top20b_airports
{"nodes":[{"id":"ORD","color":"rgba(166,206,227,0.3)"},{"id":"BRL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"DEC\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"BCN","color":"rgba(31,120,180,0.3)"},{"id":"BJL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKG","color":"rgba(178,223,138,0.3)"},{"id":"SIN\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"SIN","color":"rgba(51,160,44,0.3)"},{"id":"BKK\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"DRW\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HAK\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HGH\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKG\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKT\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"KUL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"MNL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PEN\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PER\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PNH\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"REP\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"RGN\r","color":"rgba(200, 200,
@biovisualize
biovisualize / index.html
Last active September 11, 2019 22:33
Network viz
<html>
<head>
<script src="//unpkg.com/3d-force-graph"></script>
<style>
body { margin: 0; }
</style>
</head>
<body>
<div id="3d-graph"></div>
<script>
@biovisualize
biovisualize / top20_airports.json
Created September 6, 2019 17:34
Top 20 airports with most traffic
{"nodes":[{"id":"ORD","color":"#a6cee3"},{"id":"BRL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"DEC\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"BCN","color":"#1f78b4"},{"id":"BJL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKG","color":"#b2df8a"},{"id":"SIN\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"SIN","color":"#33a02c"},{"id":"BKK\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"DRW\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HAK\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HGH\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKG\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"HKT\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"KUL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"MNL\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PEN\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PER\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"PNH\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"REP\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"RGN\r","color":"rgba(200, 200, 200, 0.3)"},{"id":"SGN\r","color":"rgba(200, 200, 20
@biovisualize
biovisualize / index.html
Last active March 10, 2023 22:03
Générateur de noms de villages français
<html>
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/5.7.0/d3.min.js"></script>
</head>
<body>
<div id="display"></div>
<script>
var start = ['peu', 'prou', 'fil', 'né', 'che', 'mir', 'tré',
'cor', 'fèri', 'mol', 'fente', 'chon', 'plume', 'mériè',
'mis', 'motte', 'saint-', 'bi', 'glu'];