1
0
mirror of https://github.com/lana-k/sqliteviz.git synced 2025-12-10 03:58:54 +08:00

autostart, reset and fixes

This commit is contained in:
lana-k
2025-08-17 21:21:21 +02:00
parent f178937440
commit 218ab52ab3
6 changed files with 303 additions and 173 deletions

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
})