Skip to content

Commit

Permalink
add warning if scale has no nice method
Browse files Browse the repository at this point in the history
  • Loading branch information
mhkeller committed Oct 25, 2018
1 parent db05bb4 commit 158b4f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/layercake.js
Expand Up @@ -207,7 +207,11 @@ export default class LayerCakeStore extends Store {
}

if (settings[`${s}Nice`] === true) {
scale.nice();
if (typeof scale.nice === 'function') {
scale.nice();
} else {
console.error(`Layer Cake warning: You set \`${s}Nice: true\` but the ${s}Scale does not have a \`.nice\` method. Ignoring...`);
}
}

if (settings.rRange) {
Expand Down

0 comments on commit 158b4f6

Please sign in to comment.