mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
wip
This commit is contained in:
36
cli/run.ts
36
cli/run.ts
@@ -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")
|
||||
}
|
||||
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
Reference in New Issue
Block a user