Published
Edited
Aug 27, 2021
Insert cell
Insert cell
Insert cell
Insert cell
update = chart.update(data, counter)
Insert cell
md`# Input Parameters`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md`# Data and Random Walk`
Insert cell
Insert cell
Insert cell
md` # Other Parameters`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md` Outer Color of Node based on community assignment`
Insert cell
color_outer = {
const scale = d3.scaleOrdinal(d3.schemePaired);
return d => scale(d);
}
Insert cell
Insert cell
/*
color_inner = {
const scale = d3.scaleOrdinal(d3.schemeCategory10);
//const scale = d3.interpolateSpectral;
return d => scale(d);
}
*/
color_inner = d3.interpolateRainbow
Insert cell
Insert cell
Insert cell
viewof counter = Inputs.button([["Increment", value => value + 1],["Reset", value=> -1]], {value: -1})
Insert cell
counter
Insert cell
play(random_walk[counter].note);
Insert cell
random_walk[counter]
Insert cell
/*
counter = {
start_walk;
let i = 0;
while (i < random_walk.length) {
play(random_walk[i].note);
yield Promises.delay(random_walk[i].duration, ++i);
}
}
*/
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
function linkArc(d) {
const r = Math.hypot(d.target.x - d.source.x, d.target.y - d.source.y);
return `
M${d.source.x},${d.source.y}
A${r},${r} 0 0,1 ${lineX2(d)},${lineY2(d)}
`;
}
Insert cell
md ` Section for defining and testing Synthesizer. Code adapted from https://observablehq.com/@tmcw/playing-with-tone-js`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
md `Imports`
Insert cell
d3 = require("d3@5")
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more