Notebook - Welcome to Notebook

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












script type text javascript src https d3js org d3 v7 min js script svg width 600 height 600 style border 1px solid blue script const svg d3 select svg const graph svg append g attr transform translate 20 20 console log here let nodeData x 100 y 500 r 5 c red date 2010 01 title cats x 60 y 500 r 2 c green date 2011 01 title bats x 62 y 500 r 4 c blue date 2012 01 title frogs x 53 y 500 r 3 c orange date 2012 01 title simple x 57 y 500 r 9 c pink date 2012 01 title pink x 40 y 500 r 4 c yellow date 2013 01 title aaa x 40 y 500 r 5 c purple date 2016 01 title fast x 40 y 500 r 6 c brown date 2020 01 title lost for let i 0 i 50 i nodeData push x Math random 100 r 2 Math random 6 y 500 c green title test date Math round 2010 Math random 10 01 console log nodeData nodeData nodeData map function d d date new Date d date return d const daterange d3 extent nodeData d return d date console log date range daterange var x d3 scaleTime domain daterange range 0 600 40 var x d3 scaleLinear domain 0 100 range 0 400 var y d3 scaleLinear domain 0 100 range 0 600 40 create a tooltip var Tooltip d3 select body append div style position absolute style opacity 0 attr class tooltip style background color white style border solid style border width 2px style border radius 5px style padding 5px var mouseover function i d Tooltip style opacity 1 style display block disable outline around point d3 select this style stroke black style opacity 1 var mousemove function i d console log pointer d3 pointer i 0 let mp d3 pointer i Tooltip html The exact value of this cell is d x mp mp 0 mp 1 style left mp 0 50 px style top mp 1 px var mouseleave function i d Tooltip style opacity 0 style display none draw outline around point d3 select this style stroke none style opacity 0 8 let n frames to simulate 142 create a copy of the node data nodes nodeData map d Object create d console log 2016 01 01 x new Date 2016 01 01 console log y invert 0 y invert 0 console log y invert 100 y invert 100 create new force simulation specifying the forces to use and in our case how many ticks or frames we ll want to simulate sim d3 forceSimulation nodes force x d3 forceX 100 2 force y d3 forceY 100 2 force x d3 forceX x d return x new Date d date strength 0 1 force yy d3 forceY d return 700 strength 0 06 force x d3 forceX x d 100 strength 0 3 force y d3 forceY y d 600 40 strength 0 1 force collide d3 forceCollide radius d d r 1 0 Math random 0 5 use the node s actual radius force collide2 d3 forceCollide 10 force y gravityForceY force aboveaxis aboveaxis force coll2 coll2 force collide d3 forceCollide strength 0 01 radius d d r iterations 1 force charge d3 forceManyBody strength 2000 force collision d3 forceCollide strength 10 radius 25 stop tick n frames to simulate start tick sim alpha 0 1 sim alphaDecay 0 01 sim alpha 0 1 function coll2 alpha var ggg nodes length for let iter 0 iter 3 iter for let ii 0 ii ggg ii for var pp 0 pp ggg pp if ii pp continue var node0 nodes ii var node1 nodes pp node0 vy 0 005 node1 vy 0 005 let dxx node0 x node1 x let dyy node0 y node1 y let dist Math sqrt dxx dxx dyy dyy let beta 8 1 if dist 20 let err 20 dist Math random 0 1 node0 vx err 0 5 beta node0 vy err 0 5 beta node1 vx err 0 5 beta node1 vy err 0 5 beta let ymax 600 40 if node0 y ymax let err node0 y ymax node y node vy 0 01 node vy err alpha 0 9 node0 vy err 0 05 node0 vy 0 95 let spa 0 01 node0 x node0 vx spa node0 y node0 vy spa node1 x node1 vx spa node1 y node1 vy spa bind data and draw nodes var node graph selectAll node data nodes enter append circle attr r d d r attr cx d return x new Date d date attr cy d d y Math random 100 return y Math random 100 attr fill d d c attr transform translate 0 0 on mouseover mouseover on mousemove mousemove on mouseleave mouseleave indicate how we should update the graph for each tick sim on tick for let i 0 i 10 i coll2 node attr cx d x new Date d date attr cy d d y sim restart var cc 0 d3 select body style cursor arrow var xAxis d3 axisBottom x graph append g attr transform translate 0 300 call xAxis var xAxis d3 axisBottom x tickFormat function date if d3 timeYear date date return d3 timeFormat m date else return d3 timeFormat Y date graph append g attr transform translate 0 600 40 call xAxis console log ready script

strength 0 06 force x d3 forceX x d 100 strength 0 3 force y d3 forceY y d 600 40 strength 0 1 force collide d3 forceCollide radius d d r 1 0 Math random 0 5 use the node s actual radius force collide2 d3 forceCollide 10 force y gravityForceY force aboveaxis aboveaxis force coll2 coll2 force collide d3 forceCollide strength 0 01 radius d d r iterations 1 force charge d3 forceManyBody strength 2000 force collision d3 forceCollide strength 10 radius 25 stop tick n frames to simulate start tick sim alpha 0 1 sim alphaDecay 0 01 sim alpha 0 1 function coll2 alpha var ggg nodes length for let iter 0 iter 3 iter for let ii 0 ii ggg ii for var pp 0 pp ggg pp if ii pp continue var node0 nodes ii var node1 nodes pp node0 vy 0 005 node1 vy 0 005 let dxx node0 x node1 x let dyy node0 y node1 y let dist Math sqrt dxx dxx dyy dyy let beta 8 1 if dist 20 let err 20 dist Math random 0 1 node0 vx err 0 5 beta node0 vy err 0 5 beta node1 vx err 0 5 beta node1 vy err 0 5 beta let ymax 600 40 if node0 y ymax let err node0 y ymax node y node vy 0 01 node vy err alpha 0 9 node0 vy err 0 05 node0 vy 0 95 let spa 0 01 node0 x node0 vx spa node0 y node0 vy spa node1 x node1 vx spa node1 y node1 vy spa bind data and draw nodes var node graph selectAll node data nodes enter append circle attr r d d r attr cx d return x new Date d date attr cy d d y Math random 100 return y Math random 100 attr fill d d c attr transform translate 0 0 on mouseover mouseover on mousemove mousemove on mouseleave mouseleave indicate how we should update the graph for each tick sim on tick for let i 0 i 10 i coll2 node attr cx d x new Date d date attr cy d d y sim restart var cc 0 d3 select body style cursor arrow var xAxis d3 axisBottom x graph append g attr transform translate 0 300 call xAxis var xAxis d3 axisBottom x tickFormat function date if d3 timeYear date date return d3 timeFormat m date else return d3 timeFormat Y date graph append g attr transform translate 0 600 40 call xAxis 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
candycrush
candycrush2
canvas
canvas2
canvas3
canvasmandelbrot
canvasmandelbrot2
canvasnumbers
canvaszoom
capsule
changingimages
chaosgame
chaosrandom
chaosrandomhisto
chaosrandomhisto2
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
curleffect
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
fluiddynamics
fluiddynamics2
fluiddynamics3
fluidsmokedynamics
fluidsmokedynamics2
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
jsfire
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
minkowski2dboxes
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
randomcalcpie
randomgenerator
randomprofilepatterns
randomsinhistogram
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