Skip to content

Commit

Permalink
fix: 🐛 Everything on the front-end works as it used to
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Aug 12, 2021
1 parent 5389720 commit ea0e8ff
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 16 deletions.
7 changes: 1 addition & 6 deletions src/MatrixView.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
import * as d3 from "d3";
import { color } from "d3";
import type { Graph } from "graphlib";
import { createTreeHierarchy } from "hierarchy-js";
import { cloneDeep } from "lodash";
import { ItemView, Notice, TFile, WorkspaceLeaf } from "obsidian";
import { ItemView, TFile, WorkspaceLeaf } from "obsidian";
import {
DATAVIEW_INDEX_DELAY,
TRAIL_ICON,
VIEW_TYPE_BREADCRUMBS_MATRIX,
} from "src/constants";
import type {
AdjListItem,
BreadcrumbsSettings,
internalLinkObj,
SquareProps,
d3Graph,
} from "src/interfaces";
import type BreadcrumbsPlugin from "src/main";
import {
Expand Down
3 changes: 2 additions & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Relations, visTypes } from "src/interfaces";
import type { Directions, Relations, visTypes } from "src/interfaces";

export const VIEW_TYPE_BREADCRUMBS_MATRIX = "breadcrumbs-matrix";
export const VIEW_TYPE_BREADCRUMBS_STATS = "breadcrumbs-stats";
Expand All @@ -24,6 +24,7 @@ export const VISTYPES: visTypes[] = [
"Radial Tree",
];

export const DIRECTIONS: Directions[] = ["up", "same", "down"];
export const RELATIONS: Relations[] = ["Parent", "Sibling", "Child"];
export const REAlCLOSED = ["Real", "Closed"];
export const ALLUNLINKED = ["All", "No Unlinked"];
5 changes: 1 addition & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ export default class BreadcrumbsPlugin extends Plugin {
}

const relObjArr = await getNeighbourObjArr(this, fileFrontmatterArr);
console.log({ relObjArr });

const { userHierarchies } = this.settings;

Expand Down Expand Up @@ -278,7 +277,7 @@ export default class BreadcrumbsPlugin extends Plugin {
});

debug(this.settings, "graphs inited");
console.log({ graphs });

return graphs;
}

Expand Down Expand Up @@ -398,11 +397,9 @@ export default class BreadcrumbsPlugin extends Plugin {

const allUps = getAllXGs(this, "up");
const allDowns = getAllXGs(this, "down");
console.log({ allUps, allDowns });

const upG = mergeGs(...Object.values(allUps));
const downG = mergeGs(...Object.values(allDowns));
console.log({ upG, downG });

const closedParents = closeImpliedLinks(upG, downG);
const sortedTrails = this.getBreadcrumbs(closedParents);
Expand Down
5 changes: 0 additions & 5 deletions src/sharedFunctions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,6 @@ export async function getNeighbourObjArr(
}[]
> {
const { userHierarchies } = plugin.settings;
console.log({ userHierarchies });

let jugglLinks: JugglLink[] = [];
if (plugin.app.plugins.plugins.juggl !== undefined) {
Expand Down Expand Up @@ -284,15 +283,13 @@ export async function getNeighbourObjArr(
return hierFields;
});

console.log({ neighbourObjArr });
debug(plugin.settings, { neighbourObjArr });
return neighbourObjArr;
}

// This function takes the real & implied graphs for a given relation, and returns a new graphs with both.
// It makes implied relations real
export function closeImpliedLinks(real: Graph, implied: Graph): Graph {
console.log({ real, implied });
const closedG = graphlib.json.read(graphlib.json.write(real));
implied.edges().forEach((impliedEdge) => {
closedG.setEdge(impliedEdge.w, impliedEdge.v);
Expand Down Expand Up @@ -485,8 +482,6 @@ export function getAllXGs(
.filter((field) => field.join() !== "")
.flat();

console.log({ fieldNamesInXDir });

const { currGraphs } = plugin;
const allXGs: { [rel: string]: Graph } = {};

Expand Down

0 comments on commit ea0e8ff

Please sign in to comment.