Skip to content

Commit

Permalink
Refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
maryia-lapata committed Apr 8, 2020
1 parent a72aa56 commit 1168932
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,12 @@ export const buildPointSeriesData = (table: Table, dimensions: Dimensions) => {

chart.yAxisLabel = table.columns[y.accessor].name;

chart.values = [];
table.rows.forEach((row, rowIndex) => {
if (row && row[yAccessor] !== 'NaN') {
chart.values.push({
x: row[xAccessor] as number,
y: row[yAccessor] as number,
});
}
});
chart.values = table.rows
.filter(row => row && row[yAccessor] !== 'NaN')
.map(row => ({
x: row[xAccessor] as number,
y: row[yAccessor] as number,
}));

if (!chart.values.length) {
chart.values.push({} as any);
Expand Down

0 comments on commit 1168932

Please sign in to comment.