lib/layout.js
function Layout(algorithmName, options) {
  // Save the algorithmName as our algorithm (assume function)
  var algorithm = algorithmName || 'top-down';

  // If the algorithm is a string, look it up
  if (typeof algorithm === 'string') {
    algorithm = algorithms[algorithmName];

    // Assert that the algorithm was found
    assert(algorithm, 'Sorry, the \'' + algorithmName +'\' algorithm could not be loaded.');
  }

  // Create a new PackingSmith with our algorithm and return
  var retSmith = new PackingSmith(algorithm, options);
  return retSmith;
}
function Layout(algorithmName, options) {
  // Save the algorithmName as our algorithm (assume function)
  var algorithm = algorithmName || 'top-down';

  // If the algorithm is a string, look it up
  if (typeof algorithm === 'string') {
    algorithm = algorithms[algorithmName];

    // Assert that the algorithm was found
    assert(algorithm, 'Sorry, the \'' + algorithmName +'\' algorithm could not be loaded.');
  }

  // Create a new PackingSmith with our algorithm and return
  var retSmith = new PackingSmith(algorithm, options);
  return retSmith;
}
function Layout ( algorithmName , options ) { // Save the algorithmName as our algorithm (assume function) var algorithm = algorithmName || 'top-down' ; // If the algorithm is a string, look it up if ( typeof algorithm === 'string' ) { algorithm = algorithms [ algorithmName ] ; // Assert that the algorithm was found assert ( algorithm , 'Sorry, the \'' + algorithmName + '\' algorithm could not be loaded.' ) ; } // Create a new PackingSmith with our algorithm and return var retSmith = new PackingSmith ( algorithm , options ) ; return retSmith ; }
Layout adds items in an algorithmic fashion
@constructor
@param {String|Object} [algorithm="top-down"] Name of algorithm or custom algorithm to use
@param {Mixed} [options] Options to provide for the algorithm
Layout adds items in an algorithmic fashion