swhalemwo / obvz

org-brain visualization via PyQt
70 stars 4 forks source link

Will the graph be clickable at the top? #2

Closed michaelsjackson closed 4 years ago

michaelsjackson commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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:

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 commented 4 years ago

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 commented 4 years ago

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

swhalemwo commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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: ")

swhalemwo commented 4 years ago

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 commented 4 years ago

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

michaelsjackson commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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

swhalemwo commented 4 years ago

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

michaelsjackson commented 4 years ago

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.