Skip to content

Commit

Permalink
Reduce complexity
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Jun 26, 2019
1 parent 8bcf0c0 commit cc6eda4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/scales/scale.category.js
Expand Up @@ -75,10 +75,12 @@ module.exports = Scale.extend({
me._reversePixels = !me._reversePixels;
}

if (ticks) {
me._startValue = me.minIndex - (offset ? 0.5 : 0);
me._valueRange = Math.max(ticks.length - (offset ? 0 : 1), 1);
if (!ticks) {
return;
}

me._startValue = me.minIndex - (offset ? 0.5 : 0);
me._valueRange = Math.max(ticks.length - (offset ? 0 : 1), 1);
},

// Used to get data value locations. Value can either be an index or a numerical value
Expand Down

0 comments on commit cc6eda4

Please sign in to comment.