natefrisch01 / Graph-Link-Types

Link types for Obsidian graph view.
MIT License
82 stars 8 forks source link

Could this be applied to local graphs too? #22

Open oldjove opened 8 months ago

oldjove commented 8 months ago

Very nice plugin. Lots of potential. Personally I would find this very helpful to use on local graphs as well. Would that be possible to implement?

natefrisch01 commented 8 months ago

It should work for local graphs... perhaps there's something else causing it to not work for you? How are your links formatted, what are your filenames, and are they in subfolders? Perhaps this is causing it to not work for local graph.

natefrisch01 commented 8 months ago

image

oldjove commented 8 months ago

Hmm, thanks. Let me investigate further ...

jsmm commented 8 months ago

It doesn't work for me either. I have Dataview installed and linked files are in the same folder.

natefrisch01 commented 8 months ago

Would you be willing to share a screenshot that shows your file structure and a local graph? Also, what OS are you using. It seems some people are having a hard time with local graph, but I havent been able to recreate the error.

jsmm commented 8 months ago

I do have some folders, but I have tested this plugin for local graph with a note that doesn't have any direct link to notes in other folders. I am using macOS 14.3.1.

natefrisch01 commented 8 months ago

Could you please give me example files that would recreate your error?

jsmm commented 8 months ago

Sure. Here they are. The link is in the first file.

Lu_ Angola.md C_g- África.md

natefrisch01 commented 8 months ago

So, I took a look at these, and I'm thinking it has to do with #7. The special characters are probably what's causing the issue. I don't understand why it would work in global view and not local, however.

FancyBEAST commented 7 months ago

I also noticed this issue. But I noticed this only happens when I am not actively focused on the current note for which the local view is used.

Edit: Nvm even when note is focused it still doesn't work sometime. It works good when I have the link mentioned at the top of the note. But if it's in the middle or around the end of note the label doesn't show up

natefrisch01 commented 7 months ago

@FancyBEAST

Do you have other metadata before the metadata with the link as in #25 ?

elvarb commented 6 months ago

I tried a few things for this issue and it seems that the current method works like this

The issues is that the method expects all key/values to be a key followed by a markdown link. If it sees anything else the methods breaks and stops parsing.

What causes confusion is that some frontmatter types seem to be ok and not cause the parsing to stop. This is because some frontmatter types are multi value fields and are therefore stored differently in the source.

For example this does not break the process

---
aliases:
  - graphlinktype
tags:
  - one
  - two
related:: [[graph]]
---

But this does break the process

---
created: 2024-04-19
aliases:
  - graphlinktype
tags:
  - one
  - two
related:: [[graph]]
---

This also breaks the process with regarding inline key/values

---
aliases:
  - graphlinktype
tags:
  - one
  - two
related:: [[graph]]
---

type::Guide

parent:: [[Obsidian Plugins]]