Skip to content

Commit

Permalink
feat(bump): remove lodash dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
plouc committed Jun 20, 2020
1 parent edf2daf commit 6f6aff3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion packages/bump/package.json
Expand Up @@ -29,7 +29,6 @@
"@nivo/legends": "0.62.0",
"@nivo/tooltip": "0.62.0",
"d3-shape": "^1.3.5",
"lodash": "^4.17.11",
"react-spring": "^8.0.27"
},
"peerDependencies": {
Expand Down
5 changes: 2 additions & 3 deletions packages/bump/src/area-bump/compute.js
Expand Up @@ -6,7 +6,6 @@
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
import sortBy from 'lodash/sortBy'
import { scalePoint, scaleLinear } from 'd3-scale'

export const computeSeries = ({ data, width, height, align, spacing, xPadding }) => {
Expand Down Expand Up @@ -61,8 +60,8 @@ export const computeSeries = ({ data, width, height, align, spacing, xPadding })
offset = height - sliceHeight
}

sortBy(Array.from(slice.values.values()), 'value')
.reverse()
Array.from(slice.values.values())
.sort((a, b) => b.value - a.value)
.forEach((value, position, all) => {
const previousValues = all.filter((i, pos) => pos < position)
const beforeValue = previousValues.reduce((t, v) => t + v.value, 0)
Expand Down

0 comments on commit 6f6aff3

Please sign in to comment.