@@ -63,28 +63,36 @@ function render(skin_data, yosys_netlist, done) {
6363
6464 const promise = Promise . all ( promises ) . then ( graphs => {
6565
66- const indexOfMin = graphs . reduce ( ( prev , [ g , _ ] , i ) => {
67- if ( g . width <= prev [ 0 ] )
68- return [ g . width , i ]
66+ const indexOfMin = graphs . reduce ( ( prev , [ g , m ] , i ) => {
67+ m . bendPoints = g . edges . reduce ( ( prev , e ) => {
68+ return prev + e . sections . reduce ( ( p , s ) => p + ( s . bendPoints || [ ] ) . length , 0 )
69+ } , 0 )
70+ if ( m . bendPoints <= prev [ 0 ] )
71+ return [ m . bendPoints , i ]
6972 return prev
7073 } , [ Infinity , 0 ] ) [ 1 ]
7174
7275
73- console . log ( '<div style="display:flex">' )
76+ console . log ( '<div style="display:flex;flex-wrap:wrap ">' )
7477
7578 graphs . forEach ( ( [ g , m ] , i ) => {
7679 console . log ( `<div style="border:1px solid ${ i === indexOfMin ? 'red' : 'lightgrey' } ;margin:10px;padding:10px;">` )
7780 console . log ( klayed_out ( g , m , skin ) )
78- console . log ( '<div style="display:flex">' )
81+ console . log ( '<div style="display:flex;flex-wrap:wrap ">' )
7982 console . log ( '<div style="border:1px solid lightgrey;margin:10px;padding:10px;">' )
8083 console . log ( 'width:' , g . width )
8184 console . log ( '</div>' )
8285 console . log ( '<div style="border:1px solid lightgrey;margin:10px;padding:10px;">' )
8386 console . log ( 'height:' , g . height )
8487 console . log ( '</div>' )
88+ console . log ( '</div>' )
89+ console . log ( '<div style="display:flex;flex-wrap:wrap">' )
8590 console . log ( '<div style="border:1px solid lightgrey;margin:10px;padding:10px;">' )
8691 console . log ( 'area:' , g . height * g . width )
8792 console . log ( '</div>' )
93+ console . log ( '<div style="border:1px solid lightgrey;margin:10px;padding:10px;">' )
94+ console . log ( 'bendPoints:' , m . bendPoints )
95+ console . log ( '</div>' )
8896 console . log ( '</div>' )
8997 console . log ( '</div>' )
9098 } )
0 commit comments