Skip to content

Commit

Permalink
color and fix rufuspollock-okfn#15 with #224
Browse files Browse the repository at this point in the history
  • Loading branch information
hkmac authored and hkmac committed Oct 27, 2019
1 parent 604ef45 commit 05743c6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion demos/assets/scripts/bubbletree.js
Original file line number Diff line number Diff line change
Expand Up @@ -1181,7 +1181,7 @@ var BubbleTree = function(config, onHover, onUnHover) {

rad2 = 0 - Math.max(
//hw *0.8 - tgtScale * (a2rad(node.parent.amount)+a2rad(node.amount)), // maximum visible part
hw * 0.8 - tgtScale * (a2rad(node.parent.amount) + a2rad(Math.max(node.amount*1.15 + node.maxChildAmount*1.15, node.left.amount * 0.85, node.right.amount * 0.85))),
hw * 0.8 - tgtScale * (a2rad(node.parent.amount) + a2rad(Math.max(node.amount*1.15 + node.maxChildAmount*1.15, (node.left ? node.left.amount : 0) * 0.85, (node.right ? node.right.amount : 0) * 0.85))),
tgtScale*a2rad(node.parent.amount)*-1 + hw*0.15 // minimum visible part
) + hw;

Expand Down
11 changes: 5 additions & 6 deletions demos/random/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,24 +52,23 @@
{
"label": "I am the 1st child",
"amount": 400000,
"color": "ff000f",
"children":[
{
"label": "I am the 1st child of the 1st",
"amount": 200000
"amount": 200000,
"color": "ff000f"
},
{
"label": "I am the 2nd child of the 1st",
"amount": 200000
"amount": 200000,
"color": "ff00ff"
}
]
},
{
"label": "I am the 2nd child",
"amount": 600000
},
{
"label": "I am the 3rd child",
"amount": 600000
}
]
}`);
Expand Down
2 changes: 1 addition & 1 deletion src/js/bubbletree.js
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ var BubbleTree = function(config, onHover, onUnHover) {

rad2 = 0 - Math.max(
//hw *0.8 - tgtScale * (a2rad(node.parent.amount)+a2rad(node.amount)), // maximum visible part
hw * 0.8 - tgtScale * (a2rad(node.parent.amount) + a2rad(Math.max(node.amount*1.15 + node.maxChildAmount*1.15, node.left.amount * 0.85, node.right.amount * 0.85))),
hw * 0.8 - tgtScale * (a2rad(node.parent.amount) + a2rad(Math.max(node.amount*1.15 + node.maxChildAmount*1.15, (node.left ? node.left.amount : 0) * 0.85, (node.right ? node.right.amount : 0) * 0.85))),
tgtScale*a2rad(node.parent.amount)*-1 + hw*0.15 // minimum visible part
) + hw;

Expand Down

0 comments on commit 05743c6

Please sign in to comment.