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

Will the graph be clickable at the top? #2

Closed
michaelsjackson opened this issue Feb 17, 2020 · 16 comments
Closed

Will the graph be clickable at the top? #2

michaelsjackson opened this issue Feb 17, 2020 · 16 comments

Comments

@michaelsjackson
Copy link

Hey, thanks for sharing this cool project. I found it simply by github's suggestion list on the right side, somehow it seems to know what I am interested in :)

In the last weeks or month there are some new interesting graphing projects around org-brain, org-graph-view, now discovering this, cool, best would be if we could just use them all in parallel, and indeed nothing is against that. This reminded me of the old touchgraph* visualization of TheBrain, many years ago. There was one more interesting graphing project at that time, but I do not remember its name now. Your style goes in this direction. If your graph could be exported also as .svg that could be very useful, if you want to explain something around those words, in a lecture context for example. Instead of starting from zero, you would start from this network, and add here and there comments, color it, painting more, and ready would be the nice overview! No need for any extra mind mapping tool, just your tool, exported as .svg, then converted to pdf, then opened in xournal, then drawing on it! Thanks again for all your efforts!

@bepolymathe
Copy link

I can confirm that this project is very interesting and refers to the discussions we have had here, for example.
I'm going to test it ;-)

@swhalemwo
Copy link
Owner

thanks for your nice words! I'm quite happy too to see multiple concept mapping visualization tools emerging, it's a functionality I've long been searching for as well. I agree that image export is nice to have (it's on the list of future ideas), and PyQt has a SVG module so there don't seem to be any substantial technical difficulties (otoh, this is all new territory for me so there might be issues i'm not aware of). I'll give it a shot soon™ ;)

@michaelsjackson
Copy link
Author

michaelsjackson commented Feb 20, 2020

Actually, your python solution has even the potential, getting something similar what I know as java project, maybe you know it already, Mandala Browser*, if we could get something similar directly inside emacs, and python, without java, but that would be ok as well, that would be phenomenal. What mandala browser does is following:

  • splitting entire text into chunks of smaller pieces, e.g. if you have each sentence in a separate line, you could use lines as chunks, or you could add one empty line separation and those would be your chunks
  • each chunk is represented as a dot in a circle, outside, being some kind of metallic objects, which can be pulled by 'magnets'
  • then you can define 'magnets' which are simply regex searches, on the entire text, and the hits are attracted to that magnet at the center somewhere
  • now you can add more magnets, meaning more regex definitions, and new hits are pulled there, and if a hit appears in both regexes, it is represented between those magnets
    ... this is kind of the general idea

What I like about this method is you can work interactively, and getting some interesting visual representation, maybe this tool could get additionally a similar representation, just giving it as an idea not, not a must. I can use already the java solution, but it is not inside emacs, inside emacs would be much more fun, I would use it much more often. And it would not hit my cpu that hard as java does, somehow, at least that code, so I was limiting the cpu consumption of java programs, not to heat my laptop too much, while using mandala browser.

@swhalemwo
Copy link
Owner

Hi, didn't know that program, it sure looks fancy! While I'm not sure if I'm getting the idea of it, it should indeed be possible to visualize most things that can be modeled as some entities connected by edges. If lines are a kind of entity, and regex search terms another, it shouldn't be too difficult to connect the text lines to the regexs, and create some additional nodes for lines which match multiple regexs. I think org-brain would not be the best form of data storage in this case, but the current python script is quite agnostic wrt to the source of the data; all it does is visualize nodes and links, which could be generated by other elisp snippets as well. of course there would be some additional aesthetic customization necessary wrt to node and edge drawing (my manual reconstruction doesn't look as fancy as the screenshot), but I'd say the idea is definitely possible.

Screenshot from 2020-02-20 19-52-10

@bepolymathe
Copy link

Nice @swhalemwo. Have you ever tried playing with brain-friend ?

@swhalemwo
Copy link
Owner

@bepolymathe do you mean org-brain's friend relationships? if so, they are currently included (in the example above; e.g. the "match" nodes are friends of the "people" nodes). or do you mean something different?

@bepolymathe
Copy link

Yeah, I meant that kind of connection. For me, the interest of org-brain lies in this possibility (interest of roam research too).

In my mind, these "friends" links can be org-brain-add-friendship but also with org-insert-link to a brain: entry from a word in the text... I wonder what that would look like graphically...

@swhalemwo
Copy link
Owner

thanks for the clarification! I think friends added with =org-brain-add-friendship= are covered then. I don't really have a solution for the second case tho since I don't know how files which are not indexed in org-brain would be detected as having links to org-brain entries. For now all entries and edges are based on org-brain functionality, so it's just a hard requirement for now that only org-brain entities can be visualized. It is possible to visualize networks from other sources (e.g. org-roam or texts/lines), but it would just require writing the elisp code to generate the network information (primarily edge lists and node texts).

@bepolymathe
Copy link

For the second case, links can be integrated by org-brain but without a specific ID. For this, you need the org-brain-backlink command.

image

image

In your config file, you this line for this :
(setq org-brain-backlink "backlink: ")

This was referenced Feb 23, 2020
@swhalemwo
Copy link
Owner

Hi @michaelsjackson, export to svg (and dot) is now included. The window itself is not interactive/clickable, but the currently visualized graph can be exported. Does this address the original post (i.e. was it geared more to file export or to interaction with the window?)

@swhalemwo
Copy link
Owner

To sort this thread out, I've also opened separate issues for the mandala browser and the backlinks, lets continue the conversation there.

@michaelsjackson
Copy link
Author

Hi @michaelsjackson, export to svg (and dot) is now included. The window itself is not interactive/clickable, but the currently visualized graph can be exported. Does this address the original post (i.e. was it geared more to file export or to interaction with the window?)

Thanks a lot, yes, I prefer file svg export, it seems you implemented this already, interactive use not required here, at least not as svg. Unfortunately your tool requires emacs 26, I have 25.3. At later time point I will revisit this. Thanks again!

@swhalemwo
Copy link
Owner

@michaelsjackson ah that's a bummer with the versions. it seems the issue is the recent addition of org-ql (which requires emacs 26.1) to org-brain, so there's unfortunately nothing i can do about it. hope you can give it a try when you switch to a newer version :)

@Kungsgeten
Copy link

org-ql isn't needed by org-brain anymore, so I should probably change the required Emacs version.

@swhalemwo
Copy link
Owner

thanks for the info! I've updated the README :)

@michaelsjackson
Copy link
Author

Hi, didn't know that program, it sure looks fancy! While I'm not sure if I'm getting the idea of it, it should indeed be possible to visualize most things that can be modeled as some entities connected by edges. If lines are a kind of entity, and regex search terms another, it shouldn't be too difficult to connect the text lines to the regexs, and create some additional nodes for lines which match multiple regexs. I think org-brain would not be the best form of data storage in this case, but the current python script is quite agnostic wrt to the source of the data; all it does is visualize nodes and links, which could be generated by other elisp snippets as well. of course there would be some additional aesthetic customization necessary wrt to node and edge drawing (my manual reconstruction doesn't look as fancy as the screenshot), but I'd say the idea is definitely possible.

Did you model or write the queries in cls_matches? Any example code what you used above? Or you just did it manually?

If we could throw in some regexex into all .org files or some, then getting the matches as obvz visualization could be useful for sure, especially with multi-matches sorted out, like in mandala browser, what you did in your example with romeo and juliet.

Next missing step would be only, clicking on entry in obvz, then showing that entry in emacs, if possible, in some future. That would give the essence of mandala browser, but now in emacs, with all its power.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants