Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-koenig committed Feb 20, 2024
2 parents 13c4d7d + aa921e9 commit 726a40b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/isa/generic/TableLoader.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
<thead>
<tr>
{#each columns as column}
<th>{rows[0][column]}</th>
<th>{column}</th>
{/each}
</tr>
</thead>
Expand Down
10 changes: 4 additions & 6 deletions src/components/isa/generic/Uploader.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<script lang="ts">
import { isaObj } from "@/stores/isa";
import TableLoader from "./TableLoader.svelte";
import { DataFrame } from "dataframe-js";
import Schema from "@/lib/schemas.js";
Expand All @@ -8,19 +7,19 @@
export { study as value };
export let jsonPath;
let template = new Blob(["Material Name,Organism,Observation Unit Type,Variety Name,Variety Reference,Latitude,Longitude,Original Coding,Sample Name,Year,Location,Repetition,Block"], { type: 'text/csv;charset=utf-8,' });
//TODO: Add to config
let template = new Blob(["Material Name,Organism,Observation Unit Type,Variety Name,Variety Reference,Latitude,Longitude,Original Coding,Sample Name,Year,Location,Repetition,Block"], { type: 'text/csv;charset=utf-8,' });
let mode: 'long'|'wide' = 'long';
let primary_key = 'Sorte,StufenNrFak1,StufenNrFak2,Wdh'
let previewSize = 5;
function handleApprove(event) {
study.materials.samples = [];
let df = new DataFrame(event.detail.detail.rows, event.detail.detail.columns);
//TODO: make this configurable
let materials = df.select(...primary_key.split(',')).toArray()
.filter((s, index, self) => self.findIndex(item => item.join('-') === s.join('-')) === index);
.filter((s, index, self) => self.findIndex(item => item.join('-') === s.join('-')) === index);
//TODO: add configurable characterisitcs e.g. Anbaugebiete, Standort, Jahr, etc.
study.materials.sources = [];
materials.forEach(source => {
Expand All @@ -32,7 +31,6 @@
study.materials.samples = materials.map((s) => { return { name: s.join('-') } });
}
let previewSize = 5;
</script>

<section>
Expand Down

0 comments on commit 726a40b

Please sign in to comment.