Skip to content

Instantly share code, notes, and snippets.

const MERMAID = 'https://unpkg.com/mermaid@8.0.0/dist/mermaid.min.js'
const loadResource = url => new Promise((resolve) => {
const head = document.getElementsByTagName('head')[0];
const theScript = document.createElement('script');
theScript.src = url;
theScript.onload = () => {
resolve();
};
head.appendChild(theScript);
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Pie Chart Notebook - iodide</title>
<link rel="stylesheet" type="text/css" href="https://iodide-project.github.io/master/iodide.master.css">
</head>
<body>
<script id="jsmd" type="text/jsmd">
%% meta
@bcolloran
bcolloran / ply.js
Last active March 13, 2018 22:59 — forked from hamilton/ply.js
/*
ply.js is a small library that crunches down data, loosely based on Hadley Wickham's dplyr for R. Here's a rundown of the API:
this is an edit
- `.group(...facets)` --- groups the data set based on `facets`, each full combination of which acts as a grouping facet.
- `.reduce(reducerFunctions)` --- takes an object with keys representing the variable to be created by the reducer, and the value is a function that takes all the grouped data and outputs a single value. The output is a reduced data set with all the `facets` defined by the `group` function and all the reduced values.
- `.filter(fcn)` --- filters the data set by a particular function. Works just like an Array filter.
- `.map(fcn)` --- maps the data set onto