| Total Complexity | 6 |
| Total Lines | 88 |
| Duplicated Lines | 0 % |
| Coverage | 0% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | class Node |
||
| 12 | { |
||
| 13 | use WidthTrait; |
||
| 14 | |||
| 15 | use ColorsTrait; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var Label |
||
| 19 | */ |
||
| 20 | protected $label; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * Allows you to select nodes. |
||
| 24 | * |
||
| 25 | * @var bool |
||
| 26 | */ |
||
| 27 | protected $interactivity; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Horizontal distance between the label and the node. |
||
| 31 | * |
||
| 32 | * @var int |
||
| 33 | */ |
||
| 34 | protected $labelPadding; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Vertical distance between nodes. |
||
| 38 | * |
||
| 39 | * @var int |
||
| 40 | */ |
||
| 41 | protected $nodePadding; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Sets a coloring mode for the sankey nodes. Possible values: |
||
| 45 | * 'unique' - Each node will receive a unique color. |
||
| 46 | * |
||
| 47 | * @var string |
||
| 48 | */ |
||
| 49 | protected $colorMode; |
||
| 50 | |||
| 51 | public function __construct() |
||
| 52 | { |
||
| 53 | $this->label = new Label(); |
||
| 54 | } |
||
| 55 | |||
| 56 | public function getLabel(): Label |
||
| 57 | { |
||
| 58 | return $this->label; |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * @return $this |
||
| 63 | */ |
||
| 64 | public function setInteractivity(bool $interactivity) |
||
| 65 | { |
||
| 66 | $this->interactivity = $interactivity; |
||
| 67 | |||
| 68 | return $this; |
||
| 69 | } |
||
| 70 | |||
| 71 | /** |
||
| 72 | * @return $this |
||
| 73 | */ |
||
| 74 | public function setLabelPadding(int $labelPadding) |
||
| 75 | { |
||
| 76 | $this->labelPadding = $labelPadding; |
||
| 77 | |||
| 78 | return $this; |
||
| 79 | } |
||
| 80 | |||
| 81 | /** |
||
| 82 | * @return $this |
||
| 83 | */ |
||
| 84 | public function setNodePadding(int $nodePadding) |
||
| 89 | } |
||
| 90 | |||
| 91 | /** |
||
| 92 | * @return $this |
||
| 93 | */ |
||
| 94 | public function setColorMode(string $colorMode) |
||
| 99 | } |
||
| 100 | } |
||
| 101 |