/**
  * @return Canvas
  */
 private function renderItem(array $data, $namedRangeName)
 {
     $this->logger->debug("[START] Rendering START for item {$namedRangeName}");
     $data = array_change_key_case($data, CASE_UPPER);
     $namedRangeName = strtoupper($namedRangeName);
     $namedRange = $this->namedRanges[$namedRangeName];
     if (!isset($namedRange)) {
         throw new \RuntimeException("Could not find named range {$namedRangeName}");
     }
     $canvas = new Canvas($this->logger);
     $compiledData = $this->reportDataCompiler->compile($data, $namedRange);
     //zero-base all data
     $compiledData = array_values($compiledData);
     foreach ($compiledData as &$row) {
         $row = array_values($row);
     }
     $canvas->write($compiledData);
     $i = 0;
     foreach ($data as $node => $item) {
         if (is_array($item)) {
             $itemNamedRange = isset($this->namedRanges[$node]) ? $this->namedRanges[$node] : null;
             if (self::isDeepArray($item) && $itemNamedRange) {
                 $this->logger->debug("[START] List and Insert operation for {$node}");
                 $y = $this->calculateOffsetY($namedRange, $itemNamedRange);
                 $h = count($itemNamedRange);
                 $x = $this->calculateOffsetX($namedRange, $itemNamedRange);
                 //$w = count($this->namedRanges[$node][array_keys($this->namedRanges[$node])[0]]);
                 $w = 0;
                 $itemCanvas = $this->renderList($item, $node);
                 $canvas->insert($itemCanvas, $y, $x, $h, $w);
                 $this->logger->debug("[DONE] List and Insert operation for {$node}");
             }
         }
         $i++;
     }
     $this->logger->debug("[DONE] Rendering for item {$namedRangeName}");
     return $canvas;
 }
 public function render(Canvas $fromCanvas, Canvas $toCanvas)
 {
     $toCanvas->write((array) $fromCanvas);
     $toCanvas->setPointer($toCanvas->getHighestCol() + 1);
 }