Node::setNodePadding()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 3
cp 0
crap 2
rs 10
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