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 script src https unpkg com d3 sankey 0 12 3 dist d3 sankey min js script script src https cdn jsdelivr net npm d3 sankey script style body min height 400px node rect fill opacity 9 shape rendering crispEdges node text pointer events none text shadow 0 1px 0 fff link fill none stroke 000 stroke opacity 2 link hover stroke opacity 5 style svg svg script function getRndBiasGauss min max N D var a 1 b 50 c D 100 var influence Math floor Math random 101 x Math floor Math random max min 1 min return x N x Math floor gauss influence N x x Math floor gauss influence x N function gauss x return a Math exp x b x b 2 c c function getRndBias min max bias influence var rnd Math random max min min random in range mix Math random influence random mixer return rnd 1 mix bias mix mix full range and bias let data for let l 0 l 4 l for let k 0 k 100 k let rn getRndBias 0 100 60 1 0 data push lab l mark rn name sn k group labs together var datagroup d3 group data d d lab console log datagroup datagroup get 0 length datagroup get 1 length console log extent d3 extent datagroup get 0 d d mark d3 extent datagroup get 3 d d mark let h d3 histogram value function d return d mark domain 0 100 thresholds 0 25 50 75 100 let layer h datagroup get 0 h datagroup get 1 h datagroup get 2 h datagroup get 3 console log num bins layer 0 length console log layer 0 0 length console log layer 0 1 length console log layer 0 2 length console log layer 0 3 length console log datagroup get 0 var sankeydata nodes node 0 name 0 25 lab 0 node 1 name 25 50 lab 0 node 2 name 50 75 lab 0 node 3 name 75 100 lab 0 node 4 name 0 25 node 5 name 25 50 node 6 name 50 75 node 7 name 75 100 node 8 name 0 25 node 9 name 25 50 node 10 name 50 75 node 11 name 75 100 node 12 name 0 25 node 13 name 25 50 node 14 name 75 100 node 15 name 75 100 links lab 1 2 source 0 target 4 value layer 0 0 length source 0 target 5 value layer 0 1 length source 0 target 6 value layer 0 2 length source 0 target 7 value layer 0 3 length source 1 target 4 value layer 0 0 length source 1 target 5 value layer 0 1 length source 1 target 6 value layer 0 2 length source 1 target 7 value layer 0 3 length source 2 target 4 value layer 0 0 length source 2 target 5 value layer 0 1 length source 2 target 6 value layer 0 2 length source 2 target 7 value layer 0 3 length source 3 target 4 value layer 0 0 length source 3 target 5 value layer 0 1 length source 3 target 6 value layer 0 2 length source 3 target 7 value layer 0 3 length lab 2 3 source 4 target 8 value layer 1 0 length source 4 target 9 value layer 1 1 length source 4 target 10 value layer 1 2 length source 4 target 11 value layer 1 3 length source 5 target 8 value layer 1 0 length source 5 target 9 value layer 1 1 length source 5 target 10 value layer 1 2 length source 5 target 11 value layer 1 3 length source 6 target 8 value layer 1 0 length source 6 target 9 value layer 1 1 length source 6 target 10 value layer 1 2 length source 6 target 11 value layer 1 3 length source 7 target 8 value layer 1 0 length source 7 target 9 value layer 1 1 length source 7 target 10 value layer 1 2 length source 7 target 11 value layer 1 3 length lab 3 4 source 8 target 12 value layer 2 0 length source 8 target 13 value layer 2 1 length source 8 target 14 value layer 2 2 length source 8 target 15 value layer 2 3 length source 9 target 12 value layer 2 0 length source 9 target 13 value layer 2 1 length source 9 target 14 value layer 2 2 length source 9 target 15 value layer 2 3 length source 10 target 12 value layer 2 0 length source 10 target 13 value layer 2 1 length source 10 target 14 value layer 2 2 length source 10 target 15 value layer 2 3 length source 11 target 12 value layer 2 0 length source 11 target 13 value layer 2 1 length source 11 target 14 value layer 2 2 length source 11 target 15 value layer 2 3 length set the dimensions and margins of the graph var margin top 10 right 10 bottom 40 left 10 var width 600 margin left margin right var height 300 margin top margin bottom format variables var formatNumber d3 format 0f zero decimal places var format function d return formatNumber d var color d3 scaleOrdinal d3 schemeCategory10 append the svg object to the body of the page var svg d3 select svg attr width width margin left margin right attr height height margin top margin bottom append g attr transform translate margin left margin top Set the sankey diagram properties var sankey d3 sankey nodeWidth 36 nodePadding 40 size width height var path sankey links var graph sankey sankeydata add in the links var link svg append g selectAll link data graph links enter append path attr class link attr d d3 sankeyLinkHorizontal attr stroke width function d return d width add the link titles link append title text function d return d source name d target name n format d value add in the nodes var node svg append g selectAll node data graph nodes enter append g attr class node add the rectangles for the nodes node append rect attr x function d return d x0 attr y function d return d y0 attr height function d return d y1 d y0 attr width sankey nodeWidth style fill function d k return d color color k 4 style stroke function d return d3 rgb d color darker 2 append title text function d return d name n format d value add in the title for the nodes node append text attr x function d return d x0 6 attr y function d return d y1 d y0 2 attr dy 0 35em attr text anchor end text function d return d name filter function d return d x0 width 2 attr x function d return d x1 6 attr text anchor start lab number node append text attr x function d return d x0 attr y function d return height margin top margin bottom 30 filter function d k return k 4 0 text function d k return Lab k 4 console log ready script

target 11 value layer 1 3 length source 6 target 8 value layer 1 0 length source 6 target 9 value layer 1 1 length source 6 target 10 value layer 1 2 length source 6 target 11 value layer 1 3 length source 7 target 8 value layer 1 0 length source 7 target 9 value layer 1 1 length source 7 target 10 value layer 1 2 length source 7 target 11 value layer 1 3 length lab 3 4 source 8 target 12 value layer 2 0 length source 8 target 13 value layer 2 1 length source 8 target 14 value layer 2 2 length source 8 target 15 value layer 2 3 length source 9 target 12 value layer 2 0 length source 9 target 13 value layer 2 1 length source 9 target 14 value layer 2 2 length source 9 target 15 value layer 2 3 length source 10 target 12 value layer 2 0 length source 10 target 13 value layer 2 1 length source 10 target 14 value layer 2 2 length source 10 target 15 value layer 2 3 length source 11 target 12 value layer 2 0 length source 11 target 13 value layer 2 1 length source 11 target 14 value layer 2 2 length source 11 target 15 value layer 2 3 length set the dimensions and margins of the graph var margin top 10 right 10 bottom 40 left 10 var width 600 margin left margin right var height 300 margin top margin bottom format variables var formatNumber d3 format 0f zero decimal places var format function d return formatNumber d var color d3 scaleOrdinal d3 schemeCategory10 append the svg object to the body of the page var svg d3 select svg attr width width margin left margin right attr height height margin top margin bottom append g attr transform translate margin left margin top Set the sankey diagram properties var sankey d3 sankey nodeWidth 36 nodePadding 40 size width height var path sankey links var graph sankey sankeydata add in the links var link svg append g selectAll link data graph links enter append path attr class link attr d d3 sankeyLinkHorizontal attr stroke width function d return d width add the link titles link append title text function d return d source name d target name n format d value add in the nodes var node svg append g selectAll node data graph nodes enter append g attr class node add the rectangles for the nodes node append rect attr x function d return d x0 attr y function d return d y0 attr height function d return d y1 d y0 attr width sankey nodeWidth style fill function d k return d color color k 4 style stroke function d return d3 rgb d color darker 2 append title text function d return d name n format d value add in the title for the nodes node append text attr x function d return d x0 6 attr y function d return d y1 d y0 2 attr dy 0 35em attr text anchor end text function d return d name filter function d return d x0 width 2 attr x function d return d x1 6 attr text anchor start lab number node append text attr x function d return d x0 attr y function d return height margin top margin bottom 30 filter function d k return k 4 0 text function d k return Lab k 4 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
neural_network_plot_in_vs_out
neuralnetworkarrays
neuralnetworkblocks
neuralnetworksinewave
neuralnetworksnolibs
neuralnetworkvisualization
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