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 viewBox 0 20 200 200 script const svg d3 select svg let node data x 100 y 10 r 5 x 50 y 45 r 2 x 30 y 20 r 4 let edge data source 0 target 1 source 1 target 2 source 2 target 0 let n frames to simulate 5 create a copy of the node data nodes node data map d Object create d 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 collide d3 forceCollide radius d d r 1 use the node s actual radius stop tick n frames to simulate bind data and draw nodes var node svg selectAll node data nodes enter append circle attr class node attr r d d r attr cx d d x attr cy d d y call force drag indicate how we should update the graph for each tick sim on tick node attr cx d d x attr cy d d y script script type text javascript src https d3js org d3 v7 min js script svg viewBox 0 20 200 200 script const svg d3 select svg let node data x 100 y 10 r 5 x 50 y 45 r 2 x 30 y 20 r 4 node data for let i 0 i 50 i node data i x Math random 200 y Math random 200 r 1 Math random 10 let edge data source 0 target 1 source 1 target 2 source 2 target 0 let n frames to simulate 5 create a copy of the node data nodes node data map d Object create d 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 collide d3 forceCollide radius d d r 1 use the node s actual radius stop tick n frames to simulate let col d3 interpolate d3 rgb 70 130 180 d3 rgb 169 169 169 0 5 rgb 120 150 175 bind data and draw nodes var node svg selectAll node data nodes enter append circle attr class node attr r d d r attr cx d d x attr cy d d y attr fill d col Math random call force drag indicate how we should update the graph for each tick sim on tick node attr cx d d x attr cy d d y script Connects the nodes together script type text javascript src https d3js org d3 v7 min js script svg viewBox 0 20 200 200 script const svg d3 select svg let node data x 100 y 10 r 5 x 50 y 45 r 2 x 30 y 20 r 4 let edge data source 0 target 1 source 1 target 2 source 2 target 0 let n frames to simulate 5 create a copy of the node data nodes node data map d Object create d edges edge data map d Object create d 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 collide d3 forceCollide radius d d r 1 use the node s actual radius force link d3 forceLink edges force charge d3 forceManyBody strength 8 force collide d3 forceCollide radius 9 stop tick n frames to simulate d3 interpolate to obtain a color within the range of two colors let col d3 interpolate d3 rgb 70 130 180 d3 rgb 169 169 169 0 5 rgb 120 150 175 Draw lines for Links between Nodes var link svg selectAll line data edges enter append line style stroke ccc style stroke width 2 bind data and draw nodes var node svg selectAll node data nodes enter append circle attr class node attr r d d r attr cx d d x attr cy d d y attr fill d col Math random call force drag indicate how we should update the graph for each tick sim on tick link attr x1 function d return d source x attr y1 function d return d source y attr x2 function d return d target x attr y2 function d return d target y node attr cx d d x attr cy d d y script No size information or starting positions just data and the links script type text javascript src https d3js org d3 v7 min js script svg viewBox 0 20 200 200 script const svg d3 select svg var data nodes name Sachin name Murali name Glenn McGrath name AB de Villiers name Akram name BCCI edges source 0 target 1 source 0 target 2 source 2 target 3 source 2 target 4 source 3 target 4 let col d3 interpolate d3 rgb 70 130 180 d3 rgb 169 169 169 0 5 rgb 120 150 175 init a force layout using the nodes and edges in dataset var force d3 forceSimulation data nodes force x d3 forceX 100 2 force y d3 forceY 100 2 force collide d3 forceCollide radius d d r 1 use the node s actual radius force link d3 forceLink data edges force charge d3 forceManyBody strength 5 force collide d3 forceCollide radius 9 tick 2 start time create edges var edges svg selectAll line data data edges enter append line style stroke ccc style stroke width 2 create nodes var nodes svg selectAll circle data data nodes enter append circle attr r 3 attr fill d col Math random style fill red call force drag On every tick event re render force on tick function edges attr x1 function d return d source x attr y1 function d return d source y attr x2 function d return d target x attr y2 function d return d target y nodes attr cx function d return d x attr cy function d return d y script Added in dragging image for item and text script type text javascript src https d3js org d3 v7 min js script script src https cdn jsdelivr net npm d3 selection 3 script svg viewBox 0 20 200 200 script const svg d3 select svg var data nodes name Sachin name Murali name Glenn McGrath name AB de Villiers name Akram name BCCI edges source 0 target 1 source 0 target 2 source 2 target 3 source 2 target 4 source 3 target 4 let col d3 interpolate d3 rgb 70 130 180 d3 rgb 169 169 169 0 5 rgb 120 150 175 init a force layout using the nodes and edges in dataset var force d3 forceSimulation data nodes force x d3 forceX 100 2 strength 0 1 force y d3 forceY 100 2 strength 0 1 force collide d3 forceCollide radius d d r 1 use the node s actual radius force link d3 forceLink data edges strength 1 force charge d3 forceManyBody strength 5 call force drag force force collide d3 forceCollide radius 9 tick 2 create edges var edges svg selectAll line data data edges enter append line style stroke ccc style stroke width 2 create nodes var nodes svg selectAll circle data data nodes enter append svg g nodes append svg image append circle attr class circle attr xlink href https github com favicon ico style fill red attr r 3 attr fill d col Math random attr x 4px attr y 4px attr width 8px attr height 8px d3 selectAll circle call force drag nodes append svg text attr class nodetext attr font size 5 attr dx 12 attr dy 35em text function d return d name d3 selectAll image nodes call d3 drag on start dragstarted on drag dragged on end dragended on click clicked On every tick event re render force on tick tick function tick edges attr x1 function d return d source x attr y1 function d return d source y attr x2 function d return d target x attr y2 function d return d target y nodes attr cx function d return d x attr cy function d return d y nodes attr transform function d return translate d x d y function dragstarted d3 select this attr stroke black d3 select this attr fill blue force stop console log child this children 0 console log grabbing d3 select this raise style cursor grabbing force alphaTarget 0 3 restart function dragged event d d x event x d y event y d3 select this raise attr cx d x event x attr cy d y event y d3 select this raise attr transform d translate d x d y force alpha 0 3 restart force alphaTarget 0 3 restart force restart force tick tick function dragended force alphaTarget 0 3 restart d3 select this attr stroke null d3 select this attr fill black force alphaTarget 0 3 restart force stop force restart script Grouping of forces script type text javascript src https d3js org d3 v7 min js script script src https cdn jsdelivr net npm d3 selection 3 script svg viewBox 0 20 300 300 script const svg d3 select svg set the dimensions and margins of the graph const width 200 const height 200 create dummy data just one element per circle const data name A group 1 name B group 1 name C group 1 name D group 1 name E group 1 name F group 1 name G group 2 name H group 2 name I group 2 name J group 2 name K group 2 name L group 2 name M group 3 name N group 3 name O group 3 A scale that gives a X target position for each group const x d3 scaleOrdinal domain 1 2 3 range 50 100 140 A color scale const color d3 scaleOrdinal domain 1 2 3 range F8766D 00BA38 619CFF Initialize the circle all located at the center of the svg area const node svg append g selectAll circle data data join circle attr r 9 attr cx width 2 attr cy height 2 style fill d color d group style fill opacity 0 8 attr stroke black style stroke width 2 call d3 drag call specific function when circle is dragged on start dragstarted on drag dragged on end dragended Features of the forces applied to the nodes var simulation d3 forceSimulation force x d3 forceX strength 0 5 x d x d group force y d3 forceY strength 0 1 y height 2 force center d3 forceCenter x width 2 y height 2 Attraction to the center of the svg area force charge d3 forceManyBody strength 1 Nodes are attracted one each other of value is 0 force collide d3 forceCollide strength 1 radius 9 iterations 1 Force that avoids circle overlapping Apply these forces to the nodes and update their positions Once the force algorithm is happy with positions alpha value is low enough simulations will stop simulation nodes data on tick function d node attr cx d d x attr cy d d y What happens when a circle is dragged function dragstarted event d if event active simulation alphaTarget 03 restart d fx d x d fy d y function dragged event d d fx event x d fy event y function dragended event d if event active simulation alphaTarget 03 d fx null d fy null script

get y nodes attr cx function d return d x attr cy function d return d y script Added in dragging image for item and text script type text javascript src https d3js org d3 v7 min js script script src https cdn jsdelivr net npm d3 selection 3 script svg viewBox 0 20 200 200 script const svg d3 select svg var data nodes name Sachin name Murali name Glenn McGrath name AB de Villiers name Akram name BCCI edges source 0 target 1 source 0 target 2 source 2 target 3 source 2 target 4 source 3 target 4 let col d3 interpolate d3 rgb 70 130 180 d3 rgb 169 169 169 0 5 rgb 120 150 175 init a force layout using the nodes and edges in dataset var force d3 forceSimulation data nodes force x d3 forceX 100 2 strength 0 1 force y d3 forceY 100 2 strength 0 1 force collide d3 forceCollide radius d d r 1 use the node s actual radius force link d3 forceLink data edges strength 1 force charge d3 forceManyBody strength 5 call force drag force force collide d3 forceCollide radius 9 tick 2 create edges var edges svg selectAll line data data edges enter append line style stroke ccc style stroke width 2 create nodes var nodes svg selectAll circle data data nodes enter append svg g nodes append svg image append circle attr class circle attr xlink href https github com favicon ico style fill red attr r 3 attr fill d col Math random attr x 4px attr y 4px attr width 8px attr height 8px d3 selectAll circle call force drag nodes append svg text attr class nodetext attr font size 5 attr dx 12 attr dy 35em text function d return d name d3 selectAll image nodes call d3 drag on start dragstarted on drag dragged on end dragended on click clicked On every tick event re render force on tick tick function tick edges attr x1 function d return d source x attr y1 function d return d source y attr x2 function d return d target x attr y2 function d return d target y nodes attr cx function d return d x attr cy function d return d y nodes attr transform function d return translate d x d y function dragstarted d3 select this attr stroke black d3 select this attr fill blue force stop console log child this children 0 console log grabbing d3 select this raise style cursor grabbing force alphaTarget 0 3 restart function dragged event d d x event x d y event y d3 select this raise attr cx d x event x attr cy d y event y d3 select this raise attr transform d translate d x d y force alpha 0 3 restart force alphaTarget 0 3 restart force restart force tick tick function dragended force alphaTarget 0 3 restart d3 select this attr stroke null d3 select this attr fill black force alphaTarget 0 3 restart force stop force restart script Grouping of forces script type text javascript src https d3js org d3 v7 min js script script src https cdn jsdelivr net npm d3 selection 3 script svg viewBox 0 20 300 300 script const svg d3 select svg set the dimensions and margins of the graph const width 200 const height 200 create dummy data just one element per circle const data name A group 1 name B group 1 name C group 1 name D group 1 name E group 1 name F group 1 name G group 2 name H group 2 name I group 2 name J group 2 name K group 2 name L group 2 name M group 3 name N group 3 name O group 3 A scale that gives a X target position for each group const x d3 scaleOrdinal domain 1 2 3 range 50 100 140 A color scale const color d3 scaleOrdinal domain 1 2 3 range F8766D 00BA38 619CFF Initialize the circle all located at the center of the svg area const node svg append g selectAll circle data data join circle attr r 9 attr cx width 2 attr cy height 2 style fill d color d group style fill opacity 0 8 attr stroke black style stroke width 2 call d3 drag call specific function when circle is dragged on start dragstarted on drag dragged on end dragended Features of the forces applied to the nodes var simulation d3 forceSimulation force x d3 forceX strength 0 5 x d x d group force y d3 forceY strength 0 1 y height 2 force center d3 forceCenter x width 2 y height 2 Attraction to the center of the svg area force charge d3 forceManyBody strength 1 Nodes are attracted one each other of value is 0 force collide d3 forceCollide strength 1 radius 9 iterations 1 Force that avoids circle overlapping Apply these forces to the nodes and update their positions Once the force algorithm is happy with positions alpha value is low enough simulations will stop simulation nodes data on tick function d node attr cx d d x attr cy d d y What happens when a circle is dragged function dragstarted event d if event active simulation alphaTarget 03 restart d fx d x d fy d y function dragged event d d fx event x d fy event y function dragended event d if event active simulation alphaTarget 03 d fx null d fy null 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