Ok, understood, Keep going, I think you contribution will prove of great value.
I tried “Nearby Neighbours Plugin” on a copy of tiddlywiki.com which is already setup with a lot of relationships.
A small reflection; No need to respond, just make use of if helpful.
Many tiddlers may appear to be “only one step away” eg B is transcluded in this A, A is tagged with B.
I would be reluctant to choose one over the other as “closer”, and apply a weight.
I wonder if “first we eliminate the obvious” then “analyse the distance” to the not so obvious. The idea is identify all “directly connected” which the info tab and other tools already do, and exclude them from the nearby algorithm, returning “Nearby but you would not have known” items.
With this work in mind and a long held desire I am building a seperate set of tools for establishing a network of tiddlers, rather than a hierarchy like the TOC and “new hear” methods do.
In the near future I hope to have a set of test data that may prove useful for this project.
Is it possible to show the relationship? For example, is the node is a tagged tiddler, or the one has the shared tag?
Nice work! We may categorize this in the group of node explorers (e.g. TZK, Mehregan, Shiraz Node Explorer, Stroll, TiddlyResearch, kin filter, …).
Some suggestions (ignore if not related)
S1.
Like above request, I like to know the relationship! So, if you add an option to let me turn on/off to show what is the relation of displayed node to current tiddler!
A dream would be to see nearby plugin output in a graph like Tidgraph. May be nearby could replace the old Tidgraph.
S2.
It would be great if there were some config tiddlers, allow me to display only selected categories! For example, if I do not want to show the linked nodes, or when I like to ignore all nodes tagged with the current tiddler.
Thank you for all your efforts and new plugins and tools you added to TW ecosystem.
Yes, I didn’t know all of these when I went looking, but they are clearly related ideas. I had seen https://zettelkasten.sorenbjornstad.com/, which is wonderful, but far more than what I wanted for my usage. The same goes for your fantastic Node Explorer.
I told Tony I would think about this question a bit:
And I believe the following answers Tony and gives at least a partial answer to why my initial pass at this won’t likely show that information:
TiddlyWiki is used for all sorts of purposes. As an ultra-portable, easily editable, content storage and display system, its uses tend towards individuals or small groups who are both creators and consumers of that content. Its sheer adaptability makes it able to handle all sorts of complex requirements in a consistent manner.
But there is another style of usage, one where content creation and consumption are mostly separate. That’s where I’m focused right now. I’m working on a system where I’m the only – and soon to be one of only a few – people creating content. That content will be used by a few hundred others. Those others will likely know nothing at all of Tiddlywiki, and won’t even know its name unless they look at some fine print.
I’m using Tiddlywiki for this because of its microcontent focus, with the ability to reuse snippets across the pages, and to have various sorts of linkages between parts. I’m using it because I can make a simple link to the six specific pages this particular user really needs to read to solve a given problem. I’m using it because I can not only point to the URL, but also send the user an email with all the content packaged together. In short, I’m using it for many of the things that make TW great; but I’m not using it for any abilities of a user to add content. I’m not using it as a true wiki; that is reserved for just a few content-creators.
In this usage, I definitely do not want to show users that A is tagged B, that C transcludes D, that X links to Y. They should never care. But they might want to know that M is conceptually close to N. They might want to Q and R share some important connection. They would use this as an explorer, but a limited one. Here it would mostly be used for, “Well, I thought that page would answer the question I was asking, but it wasn’t quite it. What else is close by?”
While I and the other content creators could try to answer that with a related field or some such, that’s likely to be brittle and subject to all sorts of biases and oversights. It’s fairly rigid. The goal of Nearby is to gather that information organically from the structure of the wiki itself. It would be used to surf the documentation, following various trails through it marked by their own interest and not what I had in mind when creating it.
So the short answer to Tony’s question, is that this nearby algorithm will benefit wikis where the consumers will want to find their own ways through the content, not dependent on any particular schema or taxonomy the creators imposed. (This does not imply that it’s useless for personal wikis. The consumer and the creator could well be the same person.)
Yes, I’m hoping to create a graphical view, although likely not a tree. The list of links is a temporary placeholder. Although I’d seen Tidgraph a few years ago, I’d forgotten all about it. I will look to its implementation for inspiration.
Here’s where I see myself going with this:
Figure out a storage mechanism for a set of distance measurements across the whole wiki, perhaps a JSON Tiddler whose keys look like "Tiddler 1|Tiddler 2" and whose values are numbers.
Run Dijkstra’s algorithm or some other shortest path tool, using the distances I’m already creating as initial edge weights, to create a full set of distances. (Some may be infinite if this doesn’t connect the graph of tiddlers; I don’t think that’s a problem.)
Figure out a layout mechanism to display these in a graph, using the distances as guidance, centering a specific node (the current tiddler). If I try something like a force-directed graph, then perhaps make this an animation on expansion of the Nearby section. I imagine this will only involve the few dozen closest nodes, and not the whole wiki, although that might be a fun bonus of this technique.
Determine whether this is fast enough to run on a large wiki every time the user opens a tiddler or every time they expand a Nearby section. If it is (I’m doubtful), then proceed to the cleanup step.
If that’s too slow, figure out how to run steps 2 and 3 only occasionally. For my own purposes, this could be only at startup; but it might be possible to schedule this to run periodically on a Web Worker.
(Cleanup) Make this configurable in various ways. I’m thinking especially about the factors discussed in #5638 weighting the various kinds of connections and about the View provided to show the nearby neighbors.
I don’t know that I have the skills to do all of that, nor do I know if I’m willing to commit the time. But that’s how I would like to proceed. If I find myself unable to continue, I’ll probably at least do #6 to turn this from a POC to at least a beta level plugin.
Even discussing this here, I’m thinking about a potential alternative view, one that might appeal to those working on more personal notebook-style wikis: Lay out a graph of the whole wiki, and then, to show the neighborhood of one tiddler, pan and zoom that into focus. This might also include multiple edges between tiddlers with colors to indicate the type of connection. There’s a fair chance that this would be too busy, and that we’d have to find a way to remove or deemphasize edges for tiddlers not in the current view. This may be beyond my skills; I haven’t done much with graphics coding, but I could see this as a wonderful way to experience a complex wiki.
That’s definitely in the plans. I want to expand the set of factors used, make the weights they’re assigned configurable, and allow the user to select only a subset of these factors. I can think of some others sorts of configuration as well. I was assuming that this configuration would be global, but I can imagine the ability to override the global config with a field on a particular tiddler. (That would not work well with my more grandiose ideas for displaying the whole neighborhood in a large pannable, zoomable graph; I don’t think that’s a problem.)
The backlinks operator only detects hard links, but not links in transcluded content and such; see also https://tiddlywiki.com/#Hard%20and%20Soft%20Links
Could this be the reason for unexpected behavior?
This is what it looks in my wiki with icons instead of text (showing in the SideBar, hence the muted colors):
Most of the relations are spouse (there are tiddlers which have both the current and the listed tiddlers as tags, and these are mostly journal tiddlers). Some siblings, children and links / backlinks are also shown.
I had to pixellate the text as this is my work wiki – my other wikis do not have so many related tiddlers.
The icons have tooltips to explain their meaning for when I forget.
If you’re talking about the code in Yaisog’s first post to this thread, then I don’t see that backlinkedTiddlers is even defined. I thought the explanation I quoted was the reason. Yaisog believes these are too expensive to calculate for something like this. But maybe I missed the definition somewhere.