Sankey::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
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 0
dl 0
loc 4
ccs 0
cts 3
cp 0
crap 2
rs 10
1
<?php
2
3
namespace CMEN\GoogleChartsBundle\GoogleCharts\Options\SankeyDiagram;
4
5
/**
6
 * @author Christophe Meneses
7
 */
8
class Sankey
9
{
10
    /**
11
     * With multilevel sankeys, it's sometimes nonobvious where nodes should be placed for optimal readability. The D3
12
     * layout engine experiments with different node layouts, stopping when sankey.iterations attempts have been made.
13
     * The larger this number, the more pleasing the layout of complex sankeys, but it comes with a cost: the sankeys
14
     * will take longer to render. Conversely, the shorter this number, the quicker your charts will render.
15
     *
16
     * @var int
17
     */
18
    protected $iterations;
19
20
    /**
21
     * @var Link
22
     */
23
    protected $link;
24
25
    /**
26
     * @var Node
27
     */
28
    protected $node;
29
30
    public function __construct()
31
    {
32
        $this->link = new Link();
33
        $this->node = new Node();
34
    }
35
36
    public function getLink(): Link
37
    {
38
        return $this->link;
39
    }
40
41
    public function getNode(): Node
42
    {
43
        return $this->node;
44
    }
45
46
    /**
47
     * @return $this
48
     */
49
    public function setIterations(int $iterations)
50
    {
51
        $this->iterations = $iterations;
52
53
        return $this;
54
    }
55
}
56