Skip to content

Commit

Permalink
fix: optimize scrollbar range calculate
Browse files Browse the repository at this point in the history
  • Loading branch information
lessmost committed Nov 28, 2019
1 parent e2a02ac commit 2ab4201
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/interaction/helper/data-range.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,7 @@ export const getDataByScaleRange = (
vertical: boolean = false
): object[] => {
const groupedData = groupBy(data, field);
const newValues = vertical
? values
.slice()
.reverse()
.slice(start, end)
.reverse()
: values.slice(start, end);
const newValues = vertical ? values.slice(values.length - end, values.length - start) : values.slice(start, end);

return flatten(map(newValues, (value: string) => groupedData[value] || []));
};

0 comments on commit 2ab4201

Please # to comment.