Skip to content

Commit

Permalink
fix helper function for threshold labels
Browse files Browse the repository at this point in the history
  • Loading branch information
susielu committed Feb 7, 2018
1 parent 6d7ebaf commit c1bcef8
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 20 deletions.
9 changes: 4 additions & 5 deletions d3-legend.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion d3-legend.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/d3-legend.min.js

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions indexRollup.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion indexRollup.js.map

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions indexRollupNext.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion indexRollupNext.js.map

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions src/helpers.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
export const thresholdLabels = function({ i, genLength, generatedLabels }){

if (i === 0 ){
return generatedLabels[i].replace('NaN to', 'Less than')
export const thresholdLabels = function({ i, genLength, generatedLabels }) {
if (i === 0) {
return generatedLabels[i].replace("NaN to", "Less than")
} else if (i === genLength - 1) {
return `More than ${generatedLabels[genLength - 1].replace(' to NaN', '')}`
return `${generatedLabels[genLength - 1].replace(" to NaN", "")} or more`
}
return generatedLabels[i]
}
Expand Down

0 comments on commit c1bcef8

Please sign in to comment.