Skip to content

Commit

Permalink
Make all curve calculations based on curve.height
Browse files Browse the repository at this point in the history
Remove the arbitrary 10 number such that changing curve.height will not ruin proportions.
  • Loading branch information
jakezatecky committed Jan 31, 2017
1 parent 21cb4ff commit a23f7d5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/d3-funnel/D3Funnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ class D3Funnel {

// Move down if there is an initial curve
if (this.isCurved) {
prevHeight = 10;
prevHeight = this.curveHeight / 2;
}

let totalHeight = this.height;
Expand Down Expand Up @@ -693,15 +693,15 @@ class D3Funnel {

// Create path from top-most block
const paths = blockPaths[0];
const topCurve = paths[1][1] + (this.curveHeight - 10);
const topCurve = paths[1][1] + (this.curveHeight / 2);

const path = this.navigator.plot([
['M', paths[0][0], paths[0][1]],
['Q', centerX, topCurve],
[' ', paths[2][0], paths[2][1]],
['M', paths[2][0], 10],
['M', paths[2][0], this.curveHeight / 2],
['Q', centerX, 0],
[' ', paths[0][0], 10],
[' ', paths[0][0], this.curveHeight / 2],
]);

// Draw top oval
Expand Down
2 changes: 1 addition & 1 deletion src/d3-funnel/Navigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class Navigator {
},
p01: {
x: centerX,
y: prevHeight + (curveHeight - 10),
y: prevHeight + (curveHeight / 2),
},
p02: {
x: prevRightX,
Expand Down

0 comments on commit a23f7d5

Please sign in to comment.