Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no direction #533

Merged
merged 56 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
4ab2e3f
progress on no-directions
SkepticMystic Apr 13, 2024
6e3825c
Progress on no-dirs
SkepticMystic Apr 13, 2024
4a5b19d
Update tests
SkepticMystic Apr 13, 2024
d3f9cdf
Lots of progress on settings migration
SkepticMystic Apr 13, 2024
4c94644
More migration touchups + edge_field_labels on the Views
SkepticMystic Apr 14, 2024
2f192f8
test: migrate_settings
SkepticMystic Apr 14, 2024
da21c51
Better typing on migrate_settings.old
SkepticMystic Apr 14, 2024
92750d4
Change views over to individual/merge_fields
SkepticMystic Apr 14, 2024
4e5dacd
field_group_labels
SkepticMystic Apr 14, 2024
88cad6c
EdgeFieldSettings
SkepticMystic Apr 14, 2024
e166562
EdgeFieldSettings: dirty flag + rename_field
SkepticMystic Apr 14, 2024
9b69612
Apply field_group_labels to more views + bug fixes on merge_fields ap…
SkepticMystic Apr 14, 2024
cf588cd
Add settings for new options
SkepticMystic Apr 14, 2024
f231a46
field-groups codeblock field
SkepticMystic Apr 14, 2024
5759870
Better styling on EdgeSettings + Jump to field/group
SkepticMystic Apr 16, 2024
49c1048
Touchups from review
SkepticMystic Apr 16, 2024
fa7689d
Fixes after running through each function in test-vault
SkepticMystic Apr 16, 2024
35a9b7b
test: V3 mock data for settings migration
SkepticMystic Apr 16, 2024
6ccf8ce
test: Fix implied_kind
SkepticMystic Apr 16, 2024
e604567
Touch up EdgeSettings
SkepticMystic Apr 16, 2024
a7ba638
Merge branch 'master' into no-direction
SkepticMystic Apr 16, 2024
f6233a9
fix: Missing return value
SkepticMystic Apr 16, 2024
09fe8da
fix: break out of migration
SkepticMystic Apr 16, 2024
b44eb9f
perf: Check if each implied_rule even needs to run each round
SkepticMystic Apr 16, 2024
a7bdbab
fix: Round timer.elapsed() result
SkepticMystic Apr 16, 2024
632134e
Lotsa touchups to edgesettings and transitivesettings
SkepticMystic Apr 17, 2024
5cf7beb
Tidy up some TODOs
SkepticMystic Apr 17, 2024
da4ed35
fix(command:threading): Normalise resolved_target_path
SkepticMystic Apr 17, 2024
7692a46
fix(command:threading): Don't drop_ext on source.basename
SkepticMystic Apr 17, 2024
aff730c
Add hierarchy1 group by default
SkepticMystic Apr 17, 2024
5ffcdd4
Improve traversal alg, don't use all_paths in _most_ places
SkepticMystic Apr 18, 2024
0a27d38
docs: Add credits section to README
SkepticMystic Apr 18, 2024
1cfc696
fix: Button icons show their current state, not where they're going
SkepticMystic Apr 18, 2024
607c52d
Various EdgeFieldSettings + ImpliedSettings improvements and fixes
SkepticMystic Apr 19, 2024
9e73f40
refactor: Extract MermaidDiagram component
SkepticMystic Apr 19, 2024
7228cec
feat: Show Mermaid preview on transitive rule settings
SkepticMystic Apr 19, 2024
ba47ac3
Standardise Paths.basename inline with TFile
SkepticMystic Apr 19, 2024
bd76cfa
test: Cover more utils
SkepticMystic Apr 19, 2024
6198969
fix: Wait for metadatacache init before refreshing
SkepticMystic Apr 21, 2024
34dc110
feat: All button on ShowAttributes selector
SkepticMystic Apr 21, 2024
6e26cba
fix: Actually log stats + incorrect setting reference
SkepticMystic Apr 21, 2024
084ab94
Merge branch 'no-direction' of https://github.com/SkepticMystic/bread…
SkepticMystic Apr 21, 2024
c08f927
fix: Rename default_field and field_group_labels on edgefield.label r…
SkepticMystic Apr 21, 2024
4a60dcb
Specify that Date Notes are joined with a "next" field
SkepticMystic Apr 21, 2024
779d5cc
docs: Update donation section
SkepticMystic Apr 21, 2024
d950f5d
fix: Parse codeblock.depth better + extract TreeItemFlair component
SkepticMystic Apr 21, 2024
0ffa45c
fix: metadataCache may already be initialized
SkepticMystic Apr 22, 2024
6e68f43
feat(debugging): FEAT LogLevel for features whose purpose is to log t…
SkepticMystic Apr 22, 2024
c6043a7
fix(builder:list-note): Only validate list-note-neighbour-field if it…
SkepticMystic Apr 22, 2024
b372b1b
Tidy up settings components + Track global settings.is_dirty
SkepticMystic Apr 22, 2024
ed57485
saveSettings resets the is_dirty flag itself
SkepticMystic Apr 22, 2024
f5c52d0
docs: Add HEmile to credits
SkepticMystic Apr 22, 2024
26ff091
feat(view:codeblock:mermaid): Buttons to view image and live edit
SkepticMystic Apr 23, 2024
075f4eb
fix(views): Redraw side views on relevant settings changes
SkepticMystic Apr 23, 2024
06d476c
fix(view:codeblock): Still warn on deprecated dirs field, but gracefu…
SkepticMystic Apr 23, 2024
dab0500
Merge branch 'master' into no-direction
SkepticMystic Apr 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Media related to Breacrumbs. Thanks to everyone for sharing!

## Credits

- [mProjectsCode](https://github.com/mProjectsCode): For their various PRs, insightful suggestions, and efficient graph-traversal algorithms
- [mProjectsCode](https://github.com/mProjectsCode): For their PRs, insightful suggestions, and efficiency improvements.
- [HEmile](https://github.com/HEmile): For their PRs, and helpful discussions on graph-theory.

<!-- NOTE: This heading is linked to in the manifest.fundingUrl. Be sure to change that if updating the heading label -->

Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

84 changes: 8 additions & 76 deletions src/api/index.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,8 @@
import { ListIndex } from "src/commands/list_index";
import {
ARROW_DIRECTIONS,
DIRECTIONS,
type Direction,
} from "src/const/hierarchies";
import type { BCEdgeAttributes } from "src/graph/MyMultiGraph";
import { Traverse } from "src/graph/traverse";
import type { Hierarchy } from "src/interfaces/hierarchies";
import { active_file_store } from "src/stores/active_file";
import {
get_field_hierarchy,
get_opposite_direction,
} from "src/utils/hierarchies";
import { get } from "svelte/store";
import type BCPlugin from "../main";
import { has_edge_attrs, type EdgeAttrFilters } from "src/graph/utils";

export class BCAPI {
plugin: BCPlugin;
Expand All @@ -23,41 +11,23 @@ export class BCAPI {
this.plugin = plugin;
}

public DIRECTIONS = DIRECTIONS;
public ARROW_DIRECTIONS = ARROW_DIRECTIONS;
get fields() {
return this.plugin.settings.edge_fields;
}

// TODO
public buildObsGraph = () => {
throw new Error("Not implemented");
};
get field_groups() {
return this.plugin.settings.edge_field_groups;
}

public refresh = () => this.plugin.refresh();
/** @deprecated Use refresh */
public refreshIndex = this.refresh;

/** @deprecated Filter edges of plugin.graph instead */
public getSubInDirs = (dirs: Direction[], g = this.plugin.graph) => {};

/** @deprecated Filter edges of plugin.graph instead */
public getSubForFields = (fields: string[], g = this.plugin.graph) => {};

public all_paths_depth_first = (
start_node = get(active_file_store)?.path,
graph = this.plugin.graph,
attrs?: EdgeAttrFilters,
) => {
if (!start_node) throw new Error("No active file");

return Traverse.all_paths("depth_first", graph, start_node, (e) =>
has_edge_attrs(e, attrs),
);
};

/** @deprecated Use all_paths_depth_first instead */
public dfsAllPaths = this.all_paths_depth_first;

public nest_all_paths = Traverse.nest_all_paths;
public flatten_all_paths = Traverse.flatten_all_paths;
public build_tree = Traverse.build_tree;
public breadth_first_traversal = Traverse.breadth_first;

public create_list_index = (
start_node = get(active_file_store)?.path,
Expand All @@ -83,42 +53,4 @@ export class BCAPI {

/** @deprecated Use get_neighbours instead */
public getMatrixNeighbours = this.get_neighbours;

public get_opposite_direction = get_opposite_direction;
/** @deprecated Use get_opposite_direction */
public getOppDir = this.get_opposite_direction;

public get_opposite_fields = (field: string) => {
const field_hierarchy = get_field_hierarchy(
this.plugin.settings.hierarchies,
field,
);
if (!field_hierarchy) {
console.error(
"BCAPI.getOppFields: field_hierarchy not found",
field,
);
return [];
}

return this.plugin.settings.hierarchies[field_hierarchy.hierarchy_i]
.dirs[get_opposite_direction(field_hierarchy.dir)];
};

/** @deprecated Use get_opposite_fields */
public getOppFields = this.get_opposite_fields;

public get_field_hierarchy = (field: string) =>
get_field_hierarchy(this.plugin.settings.hierarchies, field);

/** @deprecated Use get_field_hierarchy */
public getFieldInfo = this.get_field_hierarchy;

/** @deprecated Filter plugin.settings.hierarchies instead */
public getFields = (dir: Direction) => {};

/** @deprecated Map plugin.settings.hierachies instead */
public iterateHiers(
cb: (hier: Hierarchy, dir: Direction, field: string) => void,
) {}
}
Loading