Skip to content

Commit b3e1bb9

Browse files
committed
working prototype
1 parent 66c6730 commit b3e1bb9

File tree

1 file changed

+2
-38
lines changed

1 file changed

+2
-38
lines changed

src/traces/icicle/partition.js

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,9 @@ module.exports = function partition(entry, size, opts) {
77
var flipY = opts.flipY;
88
var swapXY = opts.packing === 'dice-slice';
99

10-
var top = opts.pad[flipY ? 'bottom' : 'top'];
11-
var left = opts.pad[flipX ? 'right' : 'left'];
12-
var right = opts.pad[flipX ? 'left' : 'right'];
13-
var bottom = opts.pad[flipY ? 'top' : 'bottom'];
14-
15-
var tmp;
16-
if(swapXY) {
17-
tmp = left;
18-
left = top;
19-
top = tmp;
20-
21-
tmp = right;
22-
right = bottom;
23-
bottom = tmp;
24-
}
25-
2610
var result = d3Hierarchy
27-
.icicle()
28-
.tile(getTilingMethod(opts.packing, opts.squarifyratio))
29-
.paddingInner(opts.pad.inner)
30-
.paddingLeft(left)
31-
.paddingRight(right)
32-
.paddingTop(top)
33-
.paddingBottom(bottom)
11+
.partition()
12+
.padding(opts.pad.inner)
3413
.size(
3514
swapXY ? [size[1], size[0]] : size
3615
)(entry);
@@ -45,21 +24,6 @@ module.exports = function partition(entry, size, opts) {
4524
return result;
4625
};
4726

48-
function getTilingMethod(key, squarifyratio) {
49-
switch(key) {
50-
case 'squarify':
51-
return d3Hierarchy.icicleSquarify.ratio(squarifyratio);
52-
case 'binary':
53-
return d3Hierarchy.icicleBinary;
54-
case 'dice':
55-
return d3Hierarchy.icicleDice;
56-
case 'slice':
57-
return d3Hierarchy.icicleSlice;
58-
default: // i.e. 'slice-dice' | 'dice-slice'
59-
return d3Hierarchy.icicleSliceDice;
60-
}
61-
}
62-
6327
function flipTree(node, size, opts) {
6428
var tmp;
6529

0 commit comments

Comments
 (0)