Skip to content

Commit 729a489

Browse files
committed
fixed combined array const issue
1 parent 8bc02e3 commit 729a489

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/line-graph.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,7 @@ export class LineGraph extends HTMLElement {
3636
});
3737
this.shadowRoot.appendChild(svg);
3838
var newData = this.formatMutlipleData(data, this.dataset.group);
39-
if(newData.length > 0) {
40-
this.renderGraph(this.parseData(newData), svg);
41-
}
39+
this.renderGraph(this.parseData(newData), svg);
4240
}
4341

4442

@@ -62,7 +60,6 @@ export class LineGraph extends HTMLElement {
6260
formatMutlipleData(records, groupName) {
6361
var arr = [];
6462
var group, keys, values, res;
65-
const combinedArray = [];
6663
for (let data of records) {
6764
group = this.findByProp(data, groupName);
6865
keys = Object.keys(data.values);
@@ -76,7 +73,7 @@ export class LineGraph extends HTMLElement {
7673
});
7774
arr.push(res);
7875
}
79-
combinedArray.concat(...arr);
76+
const combinedArray = [].concat(...arr);
8077
return combinedArray;
8178
}
8279

0 commit comments

Comments
 (0)