Skip to content

Commit

Permalink
refactor(Vis View): 🚧 FDG: Attempt save layout (not working yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Sep 5, 2021
1 parent 7721bbc commit 99e5b5a
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Visualisations/ForceDirectedG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ export const forceDirectedG = (
});
});

// const saveLayoutButton = modal.contentEl.createEl('button', { text: 'Save Layout' })
// .addEventListener('click', saveGraph)

const data = graphlibToD3(graph);

const links: {
Expand Down Expand Up @@ -268,7 +271,7 @@ export const forceDirectedG = (
})
.on("mouseout", unfocus);

function focusNeighbours(d, event: MouseEvent) {}
function focusNeighbours(d, event: MouseEvent) { }

function unfocus() {
// labelNode.attr("display", "block");
Expand Down Expand Up @@ -300,4 +303,9 @@ export const forceDirectedG = (
.scaleExtent([0.5, 10])
.on("zoom", zoomed)
);

function saveGraph() {
const clone = svg.clone(true)
localStorage.setItem('FDG', JSON.stringify(clone))
}
};

0 comments on commit 99e5b5a

Please sign in to comment.