Browse Source

fix ordering

pull/12/head
vargburz 2 years ago
parent
commit
ccbf72d17f
  1. 9
      src/services/exporter.ts

9
src/services/exporter.ts

@ -98,7 +98,7 @@ export class Exporter {
}
private _updateColumns(columnsToUpdate: string[], queriedColumns: string[]): string[] {
// slice(1) to avoid time fields
// slice(1) to avoid key fields
return _.concat(columnsToUpdate, queriedColumns.slice(1));
}
@ -116,10 +116,11 @@ export class Exporter {
}
private _getRowsFromDict(dict: any, columns: string[]): (number | null)[][] {
let keyList = _.orderBy(_.keys(dict));
const keyList = _.map(_.keys(dict), value => _.toNumber(value));
const orderedKeyList = _.orderBy(keyList);
let rows = [];
for(const keyIdx in keyList) {
const key = _.toNumber(keyList[keyIdx]);
for(const keyIdx in orderedKeyList) {
const key = orderedKeyList[keyIdx];
rows[keyIdx] = [key];
for(const column of columns) {
const value = dict[key][column] || null;

Loading…
Cancel
Save