Node   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 18
c 1
b 0
f 0
dl 0
loc 88
ccs 0
cts 16
cp 0
rs 10
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A setNodePadding() 0 5 1
A setLabelPadding() 0 5 1
A setColorMode() 0 5 1
A getLabel() 0 3 1
A setInteractivity() 0 5 1
A __construct() 0 3 1
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\SankeyDiagram;
4
5
use CMEN\GoogleChartsBundle\GoogleCharts\Options\ColorsTrait;
6
use CMEN\GoogleChartsBundle\GoogleCharts\Options\WidthTrait;
7
8
/**
9
 * @author Christophe Meneses
10
 */
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)
85
    {
86
        $this->nodePadding = $nodePadding;
87
88
        return $this;
89
    }
90
91
    /**
92
     * @return $this
93
     */
94
    public function setColorMode(string $colorMode)
95
    {
96
        $this->colorMode = $colorMode;
97
98
        return $this;
99
    }
100
}
101