-
Notifications
You must be signed in to change notification settings - Fork 8
/
ArcInvestigation.js
39 lines (21 loc) · 981 Bytes
/
ArcInvestigation.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import { ArcInvestigation, Comment$ as Comment, XlsxController, JsonController} from "@nfdi4plants/arctrl"
// # Comments
const investigation_comments = ArcInvestigation.init("My Investigation")
const newComment = new Comment("The Name", "The Value")
const newComment2 = new Comment("My other Name", "My other Value")
investigation_comments.Comments.push(newComment)
investigation_comments.Comments.push(newComment2)
console.log(investigation_comments)
// # IO
// ## XLSX - Write
let fswb = XlsxController.Investigation.toFsWorkbook(investigation_comments)
console.log(fswb)
// Xlsx.toFile("test.isa.investigation.xlsx", fswb)
// Json - Write
const investigation = ArcInvestigation.init("My Investigation")
const json = JsonController.Investigation.toJsonString(investigation)
console.log(json)
// Json - Read
const jsonString = json
const investigation_2 = JsonController.Investigation.fromJsonString(jsonString)
console.log(investigation_2.Equals(investigation))