constructor(shapes) {
    this.shapes = shapes;
    this.blocks = [];
    this.positions = [];

    for (const [index, shape] of this.shapes.entries()) {
      if (!shape.master) {
        const { width, height } = shape.getDimensions();
        this.blocks.push({ index, width, height });
      }

      this.positions.push({ x: 0, y: 0 });
    }

    this.blocks.sort((a, b) => Math.max(b.width, b.height) - Math.max(a.width, a.height));
    this.root = {
      x: 0,
      y: 0,
      width: 0,
      height: 0
    };
  }
CSS sprite packer

@param {Array<SVGShape>} shapes        Shapes