I have a treeMap in GoJS and this function:
const exportDiagram = () => {
const diagram = diagramRef.value
if (diagram) {
const json = diagram.model.toJson().replace(/\\"/, '')
const blob = new Blob([json], { type: 'application/json' })
const url = URL.createObjectURL(blob)
const a = document.createElement('a')
a.href = url
a.download = 'diagram.json'
a.click()
URL.revokeObjectURL(url)
}
}
which exports the entire diagram. However, I would like to export only the linkDataArray
items that are of category “Mapping”. For example:
{"category":"Mapping","from":"ChildFirstName","to":"form1[0].#subform[0].PtAILine5_FirstName[0]"},
{"category":"Mapping","from":"CLsFirstName","to":"form1[0].#subform[0].PtAILine5_FirstName[0]"},
{"category":"Mapping","from":"SpouseFirstName","to":"form1[0].#subform[0].PtAILine5_FirstName[0]"}
How can I do this?