Example #1
0
 public function setLayout($where, $layout, $value = NULL)
 {
     if (!is_array($where)) {
         $where = array($where);
     }
     if (func_num_args() > 2) {
         $layout = array($layout => $value);
     }
     foreach ($where as $where) {
         if ($where === self::LAYOUT_GRAPH) {
             $this->graph->setLayout($layout, $value);
         } elseif ($where === self::LAYOUT_EDGE) {
             $this->mergeLayout($this->layoutEdge, $layout);
         } elseif ($where === self::LAYOUT_VERTEX) {
             $this->mergeLayout($this->layoutVertex, $layout);
         } else {
             throw new InvalidArgumentException('Invalid layout identifier');
         }
     }
     return $this;
 }