This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |