Skip to content

Commit

Permalink
Merge pull request #272 from nfdi4plants/docu
Browse files Browse the repository at this point in the history
js-docs: replace auto-transpiled discriminate unions with helper functions
  • Loading branch information
HLWeil authored Nov 28, 2023
2 parents 67c0f90 + 6529d26 commit 725c34e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docs/scripts_js/EXAMPLE_CreateAssayFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const myAssay = arctrl.ArcAssay.init("MyAssay");
const growth = arctrl.ArcTable.init("Growth");

// Add input column with one value to table
growth.AddColumn(new arctrl.CompositeHeader(11, [new arctrl.IOType(0, [])]), [arctrl.CompositeCell.createFreeText("Input1")]);
growth.AddColumn(new arctrl.CompositeHeader.input(arctrl.IOType.source), [arctrl.CompositeCell.createFreeText("Input1")]);

// Add characteristic column with one value
const oa_species = arctrl.OntologyAnnotation.fromString("species", "GO", "GO:0123456");
const oa_chlamy = arctrl.OntologyAnnotation.fromString("Chlamy", "NCBI", "NCBI:0123456");
growth.AddColumn(new arctrl.CompositeHeader(1, [oa_species]), [arctrl.CompositeCell.createTerm(oa_chlamy)]);
growth.AddColumn(new arctrl.CompositeHeader.characteristic(oa_species), [arctrl.CompositeCell.createTerm(oa_chlamy)]);

// Add table to assay
myAssay.AddTable(growth);
Expand Down
4 changes: 2 additions & 2 deletions docs/scripts_js/Tables.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ const oa_chlamy =
// in xlsx this will be exactly 1 column.
// Syntax on CompositeHeader, IOType and even CompositeCell will soon improve!
growth.AddColumn(
new CompositeHeader(11, [new IOType(0, [])]),
CompositeHeader.input(IOType.source),
[CompositeCell.createFreeText("Input1")]
);

// append second column to table.
// this will create an Characteristic [species] column with one row cell.
// in xlsx this will be exactly 3 columns.
growth.AddColumn(
new CompositeHeader(1, [oa_species]),
CompositeHeader.characteristic(oa_species),
[CompositeCell.createTerm(oa_chlamy)]
);

Expand Down
8 changes: 4 additions & 4 deletions docs/scripts_js/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/scripts_js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Kevin Frey",
"license": "MIT",
"dependencies": {
"@nfdi4plants/arctrl": "^1.0.0-beta.7",
"@nfdi4plants/arctrl": "^1.0.0-beta.9",
"@fslab/fsspreadsheet": "^5.0.0"
}
}

0 comments on commit 725c34e

Please sign in to comment.