Skip to content

Commit

Permalink
refactor(Vis View): ♻️ Consistent argArr for all visType functions
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Aug 9, 2021
1 parent 34ac8cc commit ffc91a5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions src/Visualisations/EdgeBundling.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
import * as d3 from "d3";
import type { Graph } from "graphlib";
import type { TFile } from "obsidian";
import { dfsFlatAdjList } from "src/VisModal";
import type { App, TFile } from "obsidian";
import { dfsFlatAdjList, VisModal } from "src/VisModal";

export const edgeBundling = (
graph: Graph,
contentEl: HTMLElement,
app: App,
currFile: TFile,
modal: VisModal,
width: number,
height: number
) => {
Expand Down
7 changes: 4 additions & 3 deletions src/Visualisations/ForceDirectedG.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,17 @@ import type { Graph } from "graphlib";
import { openOrSwitch } from "src/sharedFunctions";
import type { d3Node } from "src/interfaces";
import { graphlibToD3, VisModal } from "src/VisModal";
import type { App } from "obsidian";
import type { App, TFile } from "obsidian";

export const forceDirectedG = (
g: Graph,
graph: Graph,
app: App,
currFile: TFile,
modal: VisModal,
width: number,
height: number
) => {
const data = graphlibToD3(g);
const data = graphlibToD3(graph);

const links = data.links.map((d) => Object.create(d));
const nodes = data.nodes.map((d) => Object.create(d));
Expand Down

0 comments on commit ffc91a5

Please sign in to comment.