Published
Edited
Jan 26, 2021
Insert cell
Insert cell
viewof N = slider({ min: 1, max: 200, step: 1, value: 20 })
Insert cell
Insert cell
Insert cell
md`### Visualization related definitions`
Insert cell
scale = (p)=>[xScale(p[0]),yScale(p[1])]
Insert cell
scale([2, 3])
Insert cell
windowAspect = width / height
Insert cell
yScale = d3.scaleLinear().domain([-10, 10]).range([height, 0])
Insert cell
xScale = d3.scaleLinear().domain([-10*windowAspect, 10*windowAspect]).range([0, width])
Insert cell
Insert cell
scene.spheres.map(d => ({
txt: `translate(${xScale(d.x)},${yScale(d.y)})`,
r: xScale(d.x + d.r) - xScale(d.x)
}))
Insert cell
Insert cell
scene.spheres
Insert cell
md`### External Libraries and Tools`
Insert cell
arrowhead
Insert cell
import { arrowhead} from "@harrystevens/linear-algebra"
Insert cell
//import {rangeSlider, themes} from '@mootari/range-slider'
Insert cell
import { slider } from "@jashkenas/inputs"
Insert cell
d3 = require("d3")
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