Skip to content

Instantly share code, notes, and snippets.

@crongro
crongro / .block
Created May 6, 2019 16:00 — forked from mbostock/.block
Radial Tidy Tree
license: gpl-3.0
border: no
height: 1060
redirect: https://beta.observablehq.com/@mbostock/d3-radial-tidy-tree
const fs = require('fs');
//functional util
const pipe = (...fns) => (value) => fns.reduce((acc, fn) => fn(acc), value);
const reduceByFun = (data) => (fun) => (initValue) => data.reduce((p,n) => fun(p,n), initValue);
//string utils
const trim = (s) => s.trim(s);
const removeNewLine = (s) => s.replace(/[\r\n]/g, '');