Skip to content

Commit

Permalink
fix(Stats View): 🐛 Fix stats view for mainG
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Nov 20, 2021
1 parent ec65f68 commit 56736d5
Showing 1 changed file with 7 additions and 11 deletions.
18 changes: 7 additions & 11 deletions src/Components/Stats.svelte
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
<script lang="ts">
import { sum } from "lodash";
import { ARROW_DIRECTIONS, DIRECTIONS } from "src/constants";
import { ARROW_DIRECTIONS, DIRECTIONS, STATS_VIEW } from "src/constants";
import type { Directions, HierData } from "src/interfaces";
import type BCPlugin from "src/main";
import {
closeImpliedLinks,
copy,
debug,
getOppDir,
getSubInDir,
getSubForFields,
hierToStr,
makeWiki,
mergeGs,
} from "src/sharedFunctions";
export let plugin: BCPlugin;
Expand Down Expand Up @@ -45,9 +44,6 @@
}
const data = settings.userHierarchies.map((hier) => {
const [up, same, down, next, prev] = DIRECTIONS.map((dir) =>
getSubInDir(mainG, dir)
);
const hierData: HierData = {
//@ts-ignore
up: { Merged: {}, Closed: {}, Implied: {} },
Expand All @@ -63,15 +59,17 @@
DIRECTIONS.forEach((dir) => {
// Merged Graphs
/// Smoosh all fieldGs from one dir into a merged graph for that direction as a whole
const mergedInDir = mergeGs(...Object.values(hier[dir]));
const mergedInDir = getSubForFields(mainG, hier[dir]);
const mergedInOppDir = getSubForFields(mainG, hier[getOppDir(dir)]);
hierData[dir].Merged.graph = mergedInDir;
fillInInfo(dir, "Merged", hierData);
// Closed graphs
if (dir !== "same") {
hierData[dir].Closed.graph = closeImpliedLinks(
mergedInDir,
mergeGs(...Object.values(hier[getOppDir(dir)]))
mergedInOppDir
);
} else {
hierData[dir].Closed.graph = closeImpliedLinks(
Expand All @@ -82,9 +80,7 @@
fillInInfo(dir, "Closed", hierData);
if (dir !== "same") {
hierData[dir].Implied.graph = mergeGs(
...Object.values(hier[getOppDir(dir)])
);
hierData[dir].Implied.graph = mergedInOppDir;
} else {
hierData[dir].Implied.graph = closeImpliedLinks(
mergedInDir,
Expand Down

0 comments on commit 56736d5

Please sign in to comment.