File tree Expand file tree Collapse file tree
obsidian-site-action/layouts Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,10 +59,14 @@ <h2>Pages <span class="page-count">({page_count})</span></h2>
5959 const nodeRadius = d => 3 + ( d . count / maxCount ) * 10 ;
6060 const nodeColor = d3 . scaleSequential ( d3 . interpolateBlues ) . domain ( [ 0 , maxCount ] ) ;
6161
62+ const size = Math . min ( width , height ) ;
63+
6264 const simulation = d3 . forceSimulation ( data . nodes )
63- . force ( 'link' , d3 . forceLink ( data . links ) . id ( d => d . id ) . distance ( 60 ) )
64- . force ( 'charge' , d3 . forceManyBody ( ) . strength ( - 80 ) )
65- . force ( 'center' , d3 . forceCenter ( width / 2 , height / 2 ) )
65+ . force ( 'link' , d3 . forceLink ( data . links ) . id ( d => d . id ) . distance ( 40 ) )
66+ . force ( 'charge' , d3 . forceManyBody ( ) . strength ( - 40 ) )
67+ . force ( 'x' , d3 . forceX ( width / 2 ) . strength ( 0.1 ) )
68+ . force ( 'y' , d3 . forceY ( height / 2 ) . strength ( 0.1 ) )
69+ . force ( 'radial' , d3 . forceRadial ( size * 0.3 , width / 2 , height / 2 ) . strength ( 0.15 ) )
6670 . force ( 'collision' , d3 . forceCollide ( ) . radius ( d => nodeRadius ( d ) + 2 ) ) ;
6771
6872 const link = g . append ( 'g' )
You can’t perform that action at this time.
0 commit comments