Skip to content

Commit

Permalink
nf-graph: better behavior when setting yMin, yMax to null
Browse files Browse the repository at this point in the history
Previously, setting `yMin` or `yMax` to `undefined` caused

> Error: Invalid value for <g> attribute transform="translate(520, NaN)"

There was no way to set `yMin` or `yMax` to "something if it's defined,
or default behavior otherwise". This now treats the following as
equivalent:

```hbs
{{!-- no yMax specified: --}}
{{nf-graph}}

{{!-- yMax set to undefined: --}}
{{nf-graph yMax=somePropertyThatIsUndefined}}
```
  • Loading branch information
James A. Rosen committed Jul 3, 2015
1 parent 189af95 commit 892044f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/components/nf-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ var minProperty = function(axis, defaultTickCount){
var mode = this.get(_MinMode_);
var ext;

if(arguments.length > 1) {
if(value != null) {
this[__Min_] = value;
} else {
var change = function(val) {
Expand Down Expand Up @@ -183,7 +183,7 @@ var maxProperty = function(axis, defaultTickCount) {
var mode = this.get(_MaxMode_);
var ext;

if(arguments.length > 1) {
if(value != null) {
this[__Max_] = value;
} else {
var change = function(val) {
Expand Down

0 comments on commit 892044f

Please sign in to comment.