Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To csv #150

Merged
merged 5 commits into from
Jul 10, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add column headers
  • Loading branch information
segarman authored and texodus committed Jul 10, 2018
commit 91ccfb5e3d92a8307b1a8104d3b8a4f7cd3e6f49
8 changes: 4 additions & 4 deletions packages/perspective/src/js/perspective.js
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ to_format = async function(options, formatter) {
slice = __MODULE__.get_data_two(this.ctx, start_row, end_row, start_col, end_col);
}

let data;
let data = formatter.initDataValue;

let col_names = [[]].concat(this._column_names());
let row, prev_row;
Expand All @@ -533,7 +533,7 @@ to_format = async function(options, formatter) {
}
if (this.sides() === 0) {
let col_name = col_names[start_col + cidx + 1];
formatter.setColumnValue(row, col_name, slice[idx])
formatter.setColumnValue(data, row, col_name, slice[idx])
} else {
if (cidx === 0) {
if (this.config.row_pivot[0] !== 'psp_okey') {
Expand All @@ -542,13 +542,13 @@ to_format = async function(options, formatter) {
formatter.initColumnValue(row, col_name)
for (let i = 0; i < row_path.size(); i++) {
const value = __MODULE__.scalar_vec_to_val(row_path, i);
formatter.addColumnValue(row, col_name, value);
formatter.addColumnValue(data, row, col_name, value);
}
row_path.delete();
}
} else {
let col_name = col_names[start_col + cidx];
formatter.setColumnValue(row, col_name, slice[idx])
formatter.setColumnValue(data, row, col_name, slice[idx])
}
}
}
Expand Down