foam icon indicating copy to clipboard operation
foam copied to clipboard

Foam Graph: What's next?

Open jmg-duarte opened this issue 3 years ago • 7 comments

Foam Graph

This is a mixture between current state of affairs and a call to action.

That is, every issue and possible improvement point you see here can be thought as a place where Foam can be improved. As improvements will be required to be PR'd into the repository, discussion is also open

Current State

Customization

This year we added some customization settings to the graph in: https://github.com/foambubble/foam/pull/438

We hope to add many more during 2021.

Coloring by Date

Recently, I saw the following issue: https://github.com/foambubble/foam/pull/485

In summary, the issue suggests nodes to be colored according to "Last Modification Date". While I do not think it is a feature that should get into the core, I can understand why it would be an awesome feature and I have some ideas.

If you use git you can highlight nodes according to their status, or track the knowledge-base progress through time. This of course may not even be possible, but would be cool nonetheless.

Coloring by Attributes

I consider attributes to be embedded metadata on the file. These can be tags, or other "keys" defined in the YAML frontmatter (see https://github.com/foambubble/foam/issues/388).

This is inspired by https://github.com/foambubble/foam/issues/2.

Filtering

Filtering should not be too hard to implement, however we are still thinking of ways to filter nodes.

Existing Requests

Text Filtering

Filtering would not be complete without filtering by text (even though I forgot about it). If the search feature is available in the VSCode API, we can take advantage of that too.

Filtering by date could also be a thing. Being honest, if the filtering is flexible enough we can filter on a ton of things, but do not get your hopes up just yet.

Regardless, we are open to suggestions!

Grouping

I will preface this part by saying that grouping is (almost) entirely dependent on the graph library.

Why almost you ask? Because we can always add some fake nodes and hack our way into have a semi supported version of grouping. Grouping by folder would actually work that way by nature, but tags would require a second graph to be built.

The ideas around grouping are the same as for filtering:

  • By tags
  • By folder

Data Dump

This is useful for many reasons, mostly for support on the web and other visualization tools. https://github.com/foambubble/foam/issues/308

While it is not supported yet, adding it in is just a matter of deciding on the graph structure and commit to it.

There are several formats we can pick from, for example Turtle (https://en.wikipedia.org/wiki/Turtle_(syntax)).

Performance

Performance is not perfect yet. In this field we are currently dependent on the graph library we use https://github.com/vasturiano/force-graph. I encourage anyone with JavaScript experience to take a look into the issues below.

Relevant Issues

Other Thoughts

Most of the ideas in this document are dependent on some previous work over the graph. The API needs to be stabilized, a work that can only be done by using it for more features and ironing out the kinks.

jmg-duarte avatar Mar 15 '21 14:03 jmg-duarte

What would it take to add linking via tags? Does it suffer from the same hurdle/issue as grouping by tags?

ShaunaGordon avatar Mar 22 '21 16:03 ShaunaGordon

If you want to have a data dump, shouldn't you define for what use? Is it for importing to web apps (OWL/RDS - json-LD) or is it to be able to analyze in a Network Graph tool like Cytoscape, Gephi, Constellation or OpenMappr where you should export to a graph format like graphML or similar.

To have a interchangeable format with a research and analyzing tool like any of those would be a great feature for many researchers that what to use markdown as their research log formats (me included)...

I watched the youtube chat you had in March and there you mentioned labels on edges... and something about talk to others to maybe create a "standard" for networked graphs... have any of you looked at https://github.com/HEmile/juggl .

StoltHD avatar Apr 12 '21 16:04 StoltHD

With regards to filtering, if you can allow user's fuzzy search into a text box with display a graph with responsive filtering based on what's being input, that would be amazing, kind of like fzf on the command line, but for graph view.

holajoyce avatar May 04 '21 14:05 holajoyce

Would also be nice to filter/distinguish edges of the graph (e.g. set "colors" of edges). Sometimes I want to have the link to another node, but don't have to complicate the structure (which may be a good thing, but still). No idea if that is feasible though.

Casyfill avatar May 15 '21 16:05 Casyfill

I just add the comment about JUGGL here to...

JUGGL for Obsidian has most of what you talk about, and he is open to help to implement it for other markdowns editors...

I am not a developer, so I can't really help much more than give you som tips and comments... Another benefit of JUGGL is that it use cytoscape and it can already save a graph to cytoscape JSON, this json file can be opened/imported to the desktop version of cytoscape, if you need to analyze larger graphs... Emile is also planning to create a new feature as a plugin that import your graph and notes to neo4j... The first version of JUGGL (before the rename) actually did use neo4j.

StoltHD avatar May 26 '21 13:05 StoltHD

Would be great to have an option to output the data powering the graph as JSON locally, can then easily be consumed by something like Gatsby 👍

revett avatar Jul 30 '21 09:07 revett

Github & VSCode have been working together recently on new VS Code API's and libraries to help facilitate more dynamic and custom UI experiences in VS Code that could help with the new Foam graph experience's

I've started a discussion in the link below with more details & would llove to hear the Foam community's thoughts 💡 🙏

  • https://github.com/foambubble/foam/discussions/951

cliffordfajardo avatar Mar 03 '22 15:03 cliffordfajardo