Example #1
0
 /**
  * @param Image $image
  * @param NodeInfo $node
  */
 protected function writeContent(Image $image, NodeInfo $node)
 {
     $content = $node->content();
     $rect = $node->rectangle();
     foreach ($content->content() as $line) {
         $image->text($line[0], $rect->left + $line[1], $rect->top + $line[2], function (AbstractFont $font) use($line) {
             $font->color($line[4]);
             $font->size($line[3]);
             $font->align($line[5]);
             $font->valign($line[6]);
             $font->file(static::$fontPath);
         });
     }
 }
 /**
  * @param NodeInfo $node
  * @param string $mapId
  */
 public function nodeRenderrer(NodeInfo $node, $mapId)
 {
     if ($node->isLeaf()) {
         $data = $node->data();
         $node->content()->html("<span style='line-height:{$node->rectangle()->height}px'>{$data[$this->nameAttribute]}</span>");
     } elseif ($node->level() == 0) {
         $node->visible(true);
         $data = $node->data();
         $node->content()->html("<a title='" . htmlspecialchars($data[$this->nameAttribute]) . "' href='#{$mapId}-{$node->id()}'>{$data[$this->nameAttribute]}</a>");
         $node->background('transparent');
     } else {
         $node->visible(false);
     }
 }
Example #3
0
 /**
  * @param NodeInfo $node
  */
 public function nodeRenderrer(NodeInfo $node)
 {
     if (!$node->isLeaf()) {
         $node->visible(false);
     }
 }