Skip to content

Commit

Permalink
fix(sankey): fix broken custom node sorting (#498)
Browse files Browse the repository at this point in the history
  • Loading branch information
ByronBecker authored and Raphaël Benitte committed Mar 28, 2019
1 parent 41dd564 commit 319e7e0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/sankey/src/enhance.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,10 @@ export default Component =>
getLabel: getLabelGenerator(label, labelFormat),
})),
withPropsOnChange(['sort'], ({ sort }) => {
let sortFunction
if (sort === 'input') {
let sortFunction = sort
if (sort === 'auto') {
sortFunction = undefined
} else if (sort === 'input') {
sortFunction = null
} else if (sort === 'ascending') {
sortFunction = (a, b) => a.value - b.value
Expand Down

0 comments on commit 319e7e0

Please sign in to comment.