Notebook - Welcome to Notebook

Contact/Report Bugs
You can contact me at: bkenwright@xbdev.net












Spirograph effect style body min height 600px font family Arial Helvetica sans serif canvasHolder input position relative circle position relative background black spiro position absolute left 0 image position absolute display none sliders div display inline block padding 10px 5px 5px 0px button margin 10px 5px 0 0 padding 5px border radius 3px draw background 419BF9 color white draw disabled background 97c8fc color white input type checkbox button cursor pointer input type range cursor ew resize input type checkbox disabled button disabled input type range disabled cursor not allowed note opacity 0 6 font 400 11px system ui style script type text javascript src https unpkg com d3 script script type text javascript src https unpkg com d3 selection multi script div id canvasHolder canvas id circle canvas canvas id spiro canvas canvas id image canvas div Show circles input type checkbox id showCircles checked div id sliders div span Set outer circle size span br input type range min 50 max 190 value 150 id bigCircle div div span Set inner circle size span br input type range min 100 max 100 value 52 id smallCircle div div span Set pen position span br input type range min 0 max 1 value 0 6 step any id p div div span Set duration of one circuit span br input type range min 1000 max 5000 value 2000 id loopTime div div div button id draw Draw button a id save button Save image button a button id reset Reset button br br span id note Saved image removes outer and inner grey circles keeping only the spirograph drawing span script type text javascript const width 400 const height 400 let PR window devicePixelRatio 1 let scaledWidth width PR let scaledHeight height PR let showCircles true let loopTime 2000 let tickTime 10 let R 150 let r 52 let l 0 6 let p l r let k r R let t 0 let backContext d3 select canvas circle attrs width scaledWidth height scaledHeight styles width width px height height px node getContext 2d let context d3 select canvas spiro attrs width scaledWidth height scaledHeight styles width width px height height px node getContext 2d let contextIMG d3 select canvas image attrs width scaledWidth height scaledHeight styles width width px height height px node getContext 2d backContext scale PR PR context scale PR PR contextIMG scale PR PR function pinPoint angle return R 1 k Math cos angle l k Math cos 1 k k angle width 2 R 1 k Math sin angle l k Math sin 1 k k angle height 2 let p0 width 2 R r p height 2 backContext strokeStyle gray backContext fillStyle rgba 255 255 255 0 2 context strokeStyle gold function initCircles p l r k r R p0 width 2 R r p height 2 backContext clearRect 0 0 width height backContext beginPath backContext arc width 2 height 2 R 0 Math PI 2 backContext stroke backContext beginPath backContext arc R r Math cos 0 width 2 R r Math sin 0 height 2 Math abs r 0 Math PI 2 backContext fill backContext fillStyle gold backContext beginPath backContext arc p0 3 0 Math PI 2 backContext fill backContext fillStyle rgba 255 255 255 0 2 d3 select bigCircle on input R d3 select bigCircle node value initCircles d3 select smallCircle on input r d3 select smallCircle node value initCircles d3 select p on input l d3 select p node value initCircles d3 select loopTime on input loopTime d3 select loopTime node value d3 select showCircles on click showCircles d3 select showCircles node checked initCircles if showCircles false backContext clearRect 0 0 width height initCircles d3 select draw on click d3 selectAll draw showCircles sliders input attr disabled 1 t d3 interval e let a e loopTime Math PI 2 let xy pinPoint a if showCircles true backContext clearRect 0 0 width height backContext beginPath backContext arc width 2 height 2 R 0 Math PI 2 backContext stroke backContext beginPath backContext arc R r Math cos a width 2 R r Math sin a height 2 Math abs r 0 Math PI 2 backContext fill backContext fillStyle gold backContext beginPath backContext arc xy 3 0 Math PI 2 backContext fill backContext fillStyle rgba 255 255 255 0 2 context beginPath context moveTo p0 context lineTo xy context stroke p0 xy tickTime d3 select save on click t stop d3 select save button attr disabled 1 contextIMG fillStyle black contextIMG fillRect 0 0 width height contextIMG drawImage d3 select spiro node 0 0 width height let image d3 select image node toDataURL d3 select save node href image d3 select save node download spiro png d3 select reset on click if typeof t object t stop showCircles true R 150 r 52 l 0 6 p l r k r R loopTime 2000 p0 width 2 R r p height 2 backContext clearRect 0 0 width height context clearRect 0 0 width height initCircles d3 selectAll draw showCircles save button sliders input attr disabled null showCircles d3 select showCircles node checked true d3 select bigCircle node value 150 d3 select smallCircle node value 52 d3 select p node value 0 6 d3 select loopTime node value 2000 console log ready script

2 backContext strokeStyle gray backContext fillStyle rgba 255 255 255 0 2 context strokeStyle gold function initCircles p l r k r R p0 width 2 R r p height 2 backContext clearRect 0 0 width height backContext beginPath backContext arc width 2 height 2 R 0 Math PI 2 backContext stroke backContext beginPath backContext arc R r Math cos 0 width 2 R r Math sin 0 height 2 Math abs r 0 Math PI 2 backContext fill backContext fillStyle gold backContext beginPath backContext arc p0 3 0 Math PI 2 backContext fill backContext fillStyle rgba 255 255 255 0 2 d3 select bigCircle on input R d3 select bigCircle node value initCircles d3 select smallCircle on input r d3 select smallCircle node value initCircles d3 select p on input l d3 select p node value initCircles d3 select loopTime on input loopTime d3 select loopTime node value d3 select showCircles on click showCircles d3 select showCircles node checked initCircles if showCircles false backContext clearRect 0 0 width height initCircles d3 select draw on click d3 selectAll draw showCircles sliders input attr disabled 1 t d3 interval e let a e loopTime Math PI 2 let xy pinPoint a if showCircles true backContext clearRect 0 0 width height backContext beginPath backContext arc width 2 height 2 R 0 Math PI 2 backContext stroke backContext beginPath backContext arc R r Math cos a width 2 R r Math sin a height 2 Math abs r 0 Math PI 2 backContext fill backContext fillStyle gold backContext beginPath backContext arc xy 3 0 Math PI 2 backContext fill backContext fillStyle rgba 255 255 255 0 2 context beginPath context moveTo p0 context lineTo xy context stroke p0 xy tickTime d3 select save on click t stop d3 select save button attr disabled 1 contextIMG fillStyle black contextIMG fillRect 0 0 width height contextIMG drawImage d3 select spiro node 0 0 width height let image d3 select image node toDataURL d3 select save node href image d3 select save node download spiro png d3 select reset on click if typeof t object t stop showCircles true R 150 r 52 l 0 6 p l r k r R loopTime 2000 p0 width 2 R r p height 2 backContext clearRect 0 0 width height context clearRect 0 0 width height initCircles d3 selectAll draw showCircles save button sliders input attr disabled null showCircles d3 select showCircles node checked true d3 select bigCircle node value 150 d3 select smallCircle node value 52 d3 select p node value 0 6 d3 select loopTime node value 2000 console log ready script

3dplot
a4print
about
acejs
acejs2
acejs3
aessecurity
angularjs
animbackgroundimage
aseformat
assert
asteroidsjs
backgrounds01
backgrounds02
backgrounds03
barnsleyfern
base26
base64
bib
binary
bodypix
bouncy
box2dweb
breakoutjs
browserversion
buslanes
busybutton
bvhreader
calendar
canvas
canvas2
canvas3
canvasmandelbrot
canvasmandelbrot2
canvasnumbers
canvaszoom
capsule
changingimages
chatgptusingopenai
chatgptusingopenai2
chatgptusingopenai3
checkboxtoggle
chinesetiles
classes
classfeatures
clipboardbutton
clonenode
codedropdown
codemirror
codemirror2
collada
colorpick
columnresizer
contextmenu
convnet
cookiebanner
countdown
countdown2
countdown3
crop
css3dbarchart
css3dbarchart2
css3dbook
css3dscene
csscube
csscube2
csscube3
csscubevideos
cssfilelist
csshas
csspulse
cssresizeaspect
cssspin
csszooming
csvtoarray
customcheckbox
d3datamap
d3js
d3js10
d3js11
d3js2
d3js3
d3js4
d3js5
d3js6
d3js7
d3js8
d3js9
d3jsanimatedgrid
d3jsarctransition
d3jsarctransition2
d3jsaxis
d3jsaxischanging
d3jsbars
d3jsbrushing
d3jsbuslanes
d3jsbuslanes2
d3jscalendar
d3jscheat
d3jsclock
d3jscloudmap
d3jscogs
d3jscolors
d3jscovid
d3jscovid2
d3jscovid3
d3jsdashboard
d3jsdashboard2
d3jsdashboard3
d3jsdatakeyfunction
d3jsdensity
d3jsdragresizing
d3jsdragresizing2
d3jseach
d3jsease
d3jsevents
d3jsflower
d3jsforcegroups
d3jsforces
d3jsforces2
d3jsfractaltree
d3jsgeo
d3jsgroupbars
d3jsgroups
d3jsheatmap
d3jshex
d3jshierarchies
d3jshierarchies2
d3jshistogram
d3jshistogram2
d3jshistogram3
d3jshistogram4
d3jsinterpolate
d3jsjoin
d3jskmean
d3jskmean2
d3jsline
d3jsline2
d3jsline3
d3jsline4
d3jslinetransition
d3jslinetransition0
d3jslinetransition2
d3jsmaplocations
d3jsmaps
d3jsmaps2
d3jsmaps3
d3jsmisc
d3jsmisc2
d3jsmodule
d3jsmodulecolor
d3jsmultistyles
d3jsnobel
d3jsoverlappinggraphs
d3jspanel
d3jspie
d3jspieinterpolate
d3jssankey
d3jssankey2
d3jsscatter
d3jsshapes
d3jsslider
d3jsspending
d3jsspending2
d3jsspiralplot
d3jsspirograph
d3jssquare
d3jsstack
d3jsstackedbar
d3jsstackedbar2
d3jssunburst
d3jssunmoon
d3jssvglines
d3jssymbols
d3jstimelines
d3jsuk
d3jsvoronoi
d3scatterplot
d3timeline
d3timeline2
datalist
datamuse
date
dblclickhighlight
deviceorientation
dictionaryapi
dockermenu
doodlepad
downloadgif
dragdroplistitems
dragrotateresizediv
dragrotateresizediv2
dragrotateresizediv3
dragrotateresizediv4
dragrotateresizefontsize
dragselectbrush
drawlinesdiv
dropdown
dualquaternionimages
dynamicgrid
easefunctions
easeinterpolate3dplots
echart
echart2
echart3
encapsulation
epubviewer
errorstack
excalidraw
excalidraw2
excalidraw3
excalidraw5
expandable
faker
fetchplus
fileupload
fixedtopbar
fonts
fonts2
footerbar
fractalmaze
fractalmaze2
fractalnoiseimage
fractals
fractals2
fractaltree
freesvg
fresnel
froggerjs
gantt
gifgiphyapi
gifhex
gltffromscratch
gradients
griditems
griditems2
griditems3
griditems4
gridworms
heat
hexview
hexview2
highlight
icons
icons2
iframes
ik
imagetracertosvg
imgur
inputfile
invadersjs
ipynb
ipynb2
ipynb3
ipynb4
isbn13
isbn2
jpghex
jquery
jquery2
jqueryui
jqueryui2
jsdraganddrop
jslint
jsobfuscate
jsraytracer
jstree
jstree2
jszip
jszipimages
jszipread
keyframes
l2dwidget
lda
leftmenu
less
less2
lineargradientimage
linenumbers
loadimagefromfile
makepdf
maps
markdown
markdown2
markdownalerts
markdownalerts2
markdownbookmarks
markovimage
markovpixelblocks
mathjax
matrices
matsandvects
mazegamejs
md2tex
metrotiles
metrowindows
milestones
misc
misc2
modules
myipdetails
neataptic
networkstructures
networkstructures2
number
obj
objtojson
openaiimages
opencv
opencv2
opencv3
opencv4
opencv5
outline
p2
p5fractalleaf
p5fractalshape
p5js
p5js2
p5js3
p5jsanimatedcover
p5mengercube
p5snowflakes
palindrome
panel
parallax
paste
paste2
pasteimgfromurl
pdfjs
pdfjs2
pdfkit
pdfkit2
pdfkit3
pdfkit4
pdfkit5
pdfkit6
pdfmake
pdfmake2
pdfmake3
pdfmake4
pdfmake5
pdfmake6
perlin
perlin2
perlin3
perspective
pexels
playground
plotly
plotlynoise
plotlyranddist
plyloader
plyloader2
pngtxtencoder
pongjs
pptxgenjs
prettycode
prism
prn
problems
progress
pseudorandom
px2svg
python
quotes
racergame
random
randomprofilepatterns
randomstring
rating
rayambient
raymonte
raymonteprogressive
raymonteprogressive2
raymontewarmstart
reexpcross
reexpcross2
regex
regexbib
regexpfixbib
regexpmultiline
repeatwordsregexp
resizabletable
resizabletable2
revealjs
revealjs2
revealjsmulti
ritalanguage
ritalanguage2
ritalanguage3
rotateimg
rough
rsapublicprivatekeys
rss
rss2
sankey
scrappingsvg
scrolltext
scrolltext2
scrollwidth
sdfboxinboxtwist
sdfhollowbox
setintervalexception
shareurl
shuffle
sidecomment
similarity
simplehighlighter
simpleplatformgamejs
sinecanvas
sliderpopout
slides
smileys
snowfall
snowman
sound
soundsignal
sphererayintersection
springs
sqljs
steganography
stereogram
stringmatching
svg
svgchaos
svgdragresize
svgdragresize2
svgdragresize3
svgdragrotate
svgdrawing
svglines
svglines2
svglines3
svglines4
svglines5
svglinesmandelbrot
svgpathsdragrotate
svgpathsdragrotateresize
svgpie
svgpie2
svgpie3
svgpiepath
svgpiepath2
svgrandomfaces
symbols
synaptic
synaptic2
synonyms
tablerotatecells
tablerotatecells2
tablerotatecells3
tablerotatecells3b
tablerotatecells4
tables
tablezebra
tabularjs
tabularjs2
tabulatordownload
tagcanvas
tensorflowgan
tensorflowjs
tensorflowjsbasic
tensorflowjscnn
tensorflowjssinewave
tensorflowjssound
tensorflowmobilenet
tetrahedronfractal
tetrahedronfractalfolding
tetris
textarea
textareaauto
textareadiv
textareadiv2
textmaskimage
theirorthere
thesaurus
threejs
threejs2
threejs3
threejs4
threejsgltf
threejstokyo
tiles
toaster
tooltip
transition
transitionexpandabledropdown
treeview
treeview2
tricks
tshirt
tshirt2
tshirt3
turningpages
unsplash
urlblob
urlblob2
userdefinepoints
vector
videos
videos2
visualsort
vue
w2ui
w2uientertextdialog
webcam
webgl
webgl2
webgl3
webgl4
webgl5
webglbasic1
webglbasic2
webglcube
webglfov
webglfrustum
webgljson
webglleaves
webgllighting
webglorthographic
webglpoints1
webglpoints2
webglpoints3
webglsquare
webgltexture1
webgltexture2
webgltexture3
webgltransforms
webgltriangle
webgpu
webgpu10
webgpu11
webgpu12
webgpu13
webgpu14
webgpu15
webgpu16
webgpu17
webgpu2
webgpu3
webgpu4
webgpu5
webgpu6
webgpu7
webgpu8
webgpu9
webgpubars
webgpubuffers
webgpubuffers2
webgpucellnoise
webgpuclouds
webgpuclydescope
webgpucompute
webgpucubemap
webgpucubemap2
webgpudeferred
webgpudepth
webgpudof
webgpudrops
webgpuetha
webgpufire
webgpufractalcubes
webgpuglassrain
webgpugltf
webgpugltf2
webgpugrass
webgpugrid
webgpukernel
webgpukleinian
webgpulabupdates
webgpulighting
webgpumandelbrot
webgpumeta3d
webgpumetaballs
webgpumouse
webgpunoise
webgpunormalmapping
webgpuobj
webgpuparallax
webgpuparallax2
webgpuparallax3
webgpuparallaxshadow
webgpuparallaxshadow2
webgpupixel
webgpuquad
webgpuray1
webgpuraytracing
webgpuraytracing2
webgpushadowmaps
webgpushadowmaps2
webgpusierpinski2d
webgpusierpinski3d
webgpusinusoid
webgpussao
webgpustadiumobj
webgpuswirl
webgputestpipe3
webgputoon
webgputopology
webgputt
webgpuvolcloud
webgpuwater
webgpuwireframe
webgpuwireframe2
webpcanvas
webworkers
webxr
webxr2
wiggly
wikipedia