On Observable.

Notebook Visualizer

@azizcodes/sin-from-scratch-playing-with-variables d3 d3 chart chart d3->chart yAxis yAxis d3->yAxis line line d3->line x x d3->x y y d3->y xAxis xAxis d3->xAxis width width width->chart width->x height height height->chart height->y height->xAxis yAxis->chart data data data->chart data->x data->xAxis line->chart x->chart x->line x->xAxis pi pi pi->chart xt xt pi->xt margin margin margin->chart margin->yAxis margin->x margin->y margin->xAxis xt->chart y->chart y->yAxis y->line yt yt yt->chart t t t->xt t->yt require require require->d3 thedata thedata thedata->data

Notes

I unsuccessfully tried to convert this script from observable notebook to vanilla JS. In particular, I couldn’t figure out the equivelent of a generator. Sure I can for and while loops in vanilla JS, but when executed it wouldnt’ show any results until the script finishes execution, which is never.

References