Published
Edited
Apr 8, 2021
1 fork
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
qwe = function (ctx, x, y) {
console.log ('function; ctx', ctx)
// cf. https://stackoverflow.com/questions/4899799/whats-the-best-way-to-set-a-single-pixel-in-an-html5-canvas
// setting individual pixels is usually slow
// for the sake of performace we should investigate manipulating the pixel array instead, putImageData
ctx.fillRect(x, y, 1, 1)
}
Insert cell
import {slider} from "@jashkenas/inputs"
Insert cell
viewof x = slider({
title:"X"
})
Insert cell
//viewof r = slider({
// min: 2,
// max: 16,
// step: 2,
// title: "R"
//})
Insert cell
function xcalc(x, r){
var result = r*x*(1-x);
return result;
}
Insert cell
{
let r = 1
let xcurrent = x
for(let i = 0; i<=100; i++){
array[i] = xcalc(xcurrent, r)
xcurrent = xcurrent*r*(1-xcurrent)
if(i%25==0){r = r+1}
}
}
Insert cell
array = []
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