This commit is contained in:
Aslam H
2024-09-03 20:58:23 +07:00
parent c4d4afd4df
commit c4c565f7ac
10 changed files with 302 additions and 148 deletions

View File

@@ -32,12 +32,12 @@ async function readJazz() {
]
}
}
],
forceGraphs: [
{
connections: [{}]
}
]
// forceGraphs: [
// {
// connections: [{}]
// }
// ]
}
})
@@ -49,18 +49,18 @@ async function readJazz() {
/*
* Log forceGraphs
*/
const asJsonForceGraphs = globalGroup.root.forceGraphs.map(node => {
console.log({ node }, "node")
return {
name: node.name,
prettyName: node.prettyName,
connections: node.connections?.map(connection => {
return {
name: connection?.name
}
})
}
})
// const asJsonForceGraphs = globalGroup.root.forceGraphs.map(node => {
// console.log({ node }, "node")
// return {
// name: node.name,
// prettyName: node.prettyName,
// connections: node.connections?.map(connection => {
// return {
// name: connection?.name
// }
// })
// }
// })
const asJson = globalGroup.root.topics?.map(node => {
return {
@@ -82,7 +82,7 @@ async function readJazz() {
}
})
console.log({ asJsonForceGraphs }, "asJsonForceGraphs")
// console.log({ asJsonForceGraphs }, "asJsonForceGraphs")
console.log({ asJson }, "asJson")
}

View File

@@ -158,7 +158,7 @@ async function processJsonFiles(): Promise<[LinkManager, TopicJson[]]> {
let files = await fs.readdir(directory)
files.sort((a, b) => a.localeCompare(b)) // sort files alphabetically
files = files.slice(0, 1) // get only 1 file for testing
// files = files.slice(0, 1) // get only 1 file for testing
for (const file of files) {
if (path.extname(file) === ".json") {
@@ -253,9 +253,11 @@ async function saveProcessedData(linkLists: Link[], topics: TopicJson[], chunkSi
{ owner: globalGroup }
)
},
{ owner: globalGroup }
{ owner: globalGroup, unique: { topicName: topic.name } }
)
// console.log("Created topic", topic.name, topicModel.id, "in group", globalGroup.id, topicModel._raw.core.header)
if (!topic.latestGlobalGuide) {
console.error("No sections found in", topic.name)
return
@@ -391,7 +393,7 @@ async function saveForceGraph(connectionLists: Connection[], forceGraphs: ForceG
prettyName: forceGraph.prettyName,
connections: ListOfConnections.create([], { owner: globalGroup })
},
{ owner: globalGroup }
{ owner: globalGroup, unique: { forceGraphName: forceGraph.name } }
)
forceGraph.connections.map(connection => {