autostart, reset and fixes

This commit is contained in:
lana-k
2025-10-28 13:39:38 +01:00
parent f178937440
commit 218ab52ab3
6 changed files with 303 additions and 173 deletions
+2 -3
View File
@@ -13,7 +13,6 @@ export function buildNodes(graph, dataSources, options) {
const nodes = dataSources[docColumn]
.map(json => JSON.parse(json))
.filter(item => item[objectType] === TYPE_NODE)
nodes.forEach(node => {
graph.addNode(node[nodeId], {
data: node,
@@ -89,8 +88,8 @@ export function updateEdges(graph, attributeUpdates) {
}
graph.forEachEdge((edgeId, attributes, source, target) => {
graph.updateEdge(source, target, attributes => {
const newAttributes = { ...attributes }
graph.updateEdgeWithKey(edgeId, source, target, attr => {
const newAttributes = { ...attr }
changeMethods.forEach(method => method(newAttributes, edgeId))
return newAttributes
})