Skip to content

Commit

Permalink
Merge pull request #107 from DDMAL/sample-csv
Browse files Browse the repository at this point in the history
fix: load sample csv file mei column
  • Loading branch information
yinanazhou authored Jul 5, 2024
2 parents ebec7ef + 2ceefd2 commit e07d4d9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions deployment/scripts/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,12 @@ if (sampleId) {
if (extension === 'csv') {
// handle csv sample
const text = await response.text();
let file = Papa.parse(text);
let data = file.data;
let results = Papa.parse(text, { header: true });
let cressDoc: CressDoc = {
id: sampleId,
name: filename,
header: [],
body: dataListToDict(data),
header: results.meta.fields,
body: results.data,
};
const view = new CressView(cressDoc);
view.start();
Expand Down
2 changes: 1 addition & 1 deletion src/Editor/ImageTools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class ImageTools {
}

// Image Renderer Functions
imgRender(
public imgRender(
instance: Handsontable,
td: HTMLElement,
row: number,
Expand Down
2 changes: 1 addition & 1 deletion src/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type GlyphArray = Glyph[];
export type CressDoc = {
id: string;
name: string;
header: string[];
header: string[] | undefined;
body: any[];
};

Expand Down

0 comments on commit e07d4d9

Please sign in to comment.