Skip to content

Commit

Permalink
Favor chart.orientation over chart.inverted
Browse files Browse the repository at this point in the history
In preparation for #23
  • Loading branch information
jakezatecky committed Dec 23, 2015
1 parent c8e7d8b commit 9a92b08
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/d3-funnel/d3-funnel.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class D3Funnel {
height: 400,
bottomWidth: 1 / 3,
bottomPinch: 0,
inverted: false,
orientation: 'top-to-bottom',
animate: 0,
curve: {
enabled: false,
Expand Down Expand Up @@ -120,7 +120,7 @@ class D3Funnel {
this.height = settings.chart.height;
this.bottomWidth = settings.chart.width * settings.chart.bottomWidth;
this.bottomPinch = settings.chart.bottomPinch;
this.isInverted = settings.chart.inverted;
this.isInverted = settings.chart.orientation === 'bottom-to-top';
this.isCurved = settings.chart.curve.enabled;
this.curveHeight = settings.chart.curve.height;
this.fillType = settings.block.fill.type;
Expand Down Expand Up @@ -182,6 +182,12 @@ class D3Funnel {
// Overwrite default settings with user options
settings = Utils.extend(settings, options);

// Backwards compatibility with chart.inverted
if (settings.chart.inverted) {
settings.chart.orientation = 'bottom-to-top';
console.warn('Warning: chart.inverted is deprecated. Use chart.orientation instead.');
}

// In the case that the width or height is not valid, set
// the width/height as its default hard-coded value
if (settings.chart.width <= 0) {
Expand Down

0 comments on commit 9a92b08

Please sign in to comment.