index.js
/**
     * Create new connection and line, add this connection to circle with lower id
     * Also update weights of squares adjacent to new line and weights of lines adjacent to this updated squares
     * @param {Number} from
     * @param {Number} to
     * @param {Number} id
     */
Create new connection and line, add this connection to circle with lower id
Also update weights of squares adjacent to new line and weights of lines adjacent to this updated squares
@param {Number} from
@param {Number} to
@param {Number} id
Create new connection and line add this connection to circle with lower id Also update weights of squares adjacent to new line and weights of lines adjacent to this updated squares @param { Number } from @param { Number } to @param { Number } id
function drawLine(from, to, id) {
        from.connected.push(to.id);
        to.connected.push(from.id);
        if(!id) id = Line.getLineId(from.id, to.id, CIRCLE_COUNT);
        lines[id].show();
        for (let i = 0; i < lines[id].squares.length; i++) {
            let squareId = lines[id].squares[i];
            squares[squareId].weight++;
            updateSquareLinesWeight(squareId);
        }
    }
function drawLine ( from , to , id ) { from . connected . push ( to . id ) ; to . connected . push ( from . id ) ; if ( ! id ) id = Line . getLineId ( from . id , to . id , CIRCLE_COUNT ) ; lines [ id ] . show ( ) ; for ( let i = 0 ; i < lines [ id ] . squares . length ; i ++ ) { let squareId = lines [ id ] . squares [ i ] ; squares [ squareId ] . weight ++ ; updateSquareLinesWeight ( squareId ) ; } }
Create new connection and line, add this connection to circle with lower id
 Also update weights of squares adjacent to new line and weights of lines adjacent to this updated squares
 @param {Number} from
 @param {Number} to
 @param {Number} id
Create new connection and line add this connection to circle with lower id Also update weights of squares adjacent to new line and weights of lines adjacent to this updated squares @param { Number } from @param { Number } to @param { Number } id
// Update square weight // Update line weight