Menu

Feature request: two-way links

Bal Simon
2015-03-21
2019-08-09
  • Bal Simon

    Bal Simon - 2015-03-21

    When I create a link between nodes in my mindmaps, I would like Freeplane to ask me if I want to create a "return link" at the same time. If the destination node already has a link associated with it, Freeplane would then create an attribute called "return link" and put the URL for the link in the value column. If I decline the offer, then the current behavior (just a destination link) would go forward as usual.

    Doable? Of use? Thoughts?
    - Bal

     
  • user0123

    user0123 - 2015-03-23

    It's most likely doable as in order to create even a std-link one has to know both the start and link-to node. So basically the required connection info is there and available...
    Now, I don't know how linking is actually done...haven't looked into that. Hopefully the linking of nodes isn't a painted into a corner part of the code...then it could be well...something else.

     
  • Volker Börchers

    Bal, this is a very special request. As with many of these it's doable with scripting. Of course it isn't easy to start with scripting but it's worth the effort.

    Volker

     
  • Bal Simon

    Bal Simon - 2015-03-26

    Hi Volker,

    Well, if I was up for learning the scripting I'd go for it. But I'm not any kind of programmer and when I looked at the instructions about scripting I get lost pretty quickly. (The last time I tried was a couple of months ago.)

    It just seems to me that while 1.4 is in development, given that clones are part of that development effort, and that what I am asking for seems be a variety of filtering, I thought it would be timely to make this kind of request now.

    Obviously, this is for the dev team to decide on. But if they did, then all users, even those users, who like me who aren't programmers, would benefit from the feature.

    Cheers.
    - Bal

     
  • Volker Börchers

    As a part of the dev team I judge your request as a very special one: The only "natural" choice of a two-way-link would be actually normal node-to-node links on both ends. But this could only work if the target not doesn't have a link already. More naturally for this task seem normal connectors which are navigatable via the context menu.

    As I said requests like this should be implemented by the requester via scripts.

    Volker

     
  • Bal Simon

    Bal Simon - 2015-03-26

    OK. I wasn't aware that you were on the dev team. So I'll consider this request answered. Thanks for taking the time to put it to rest.

    As a side note - and not as a way of trying to change your mind - one of my earliest exposures to hypertext was with a program by a company called Persoft, called IZE. When you created a link, it was always 2-way. I've never seen it implemented in any other software. I guess it was an idea that turned out less than useful for the user community at large.

    • Bal

    P.S. - I also just realized I was conflating two requests here. Two way links and revealing clones... Apologies for that.

     

    Last edit: Bal Simon 2015-03-26
    • Miguel Boyer

      Miguel Boyer - 2015-03-27

      Bal, don't give up. Freeplane is worth the effort. It pays off, believe me.
      I am no programer either, but i learnt the sript thing and i have
      customized many mind maps in amazing ways.
      But above all.... Scripting is NOT that difficult. It is not object
      oriented, groovy syntax is very forgiving, the object model is not that
      weird, and there are tons of information about the underlying java classes.
      When Volker tells you to give a try at scripts it is for a very good
      reason. Over time you will see a boost in productivity if you work with
      information. Not if you do manual work. But in don't think that is your
      case.
      Be courageous about it.

       

      Last edit: Volker Börchers 2015-03-28
  • Bal Simon

    Bal Simon - 2015-03-27

    Hi Miguel,

    I appreciate the encouragement. Where is a good place to start?
    If there are specific things I want to do with a script, is
    there searchable documentation that can guide me?

    We're going off the opening topic, but since, as a feature request
    the opener is dead anyway, I figure we can have this quick
    discussion here.

    The thing I wanted to do with a script before, but got lost in
    trying to figure out, was how to script Freeplane to create N number
    of children and to give them all a specific style and set of
    one or more attributes. I would manually enter the values for the
    attributes.

    I'm guessing this was a relatively advanced objective, and, as
    I said, I couldn't find anything on point in the documentation.
    I'm not saying the documentation doesn't exist or that it is
    difficult to find. The fault may be 100% mine.

    Thoughts? Can you point me in a more productive direction, e.g.,
    "Learn the basics, Bal," or perhaps something more directly on
    point?

    Thanks a lot, Miguel.

    Regards,
    - Bal

     
  • Quinbus

    Quinbus - 2015-03-27

    Bal,

    I'm not a programmer either and I share your frustration learning how to program in groovy. It seems like it is a language you have to be born into, because there aren't any "Groovy for Dummies" books out there that I've been able to find.

    Having said that, what I'm always doing is scanning for scripts that will basically do what I would like to do and then work to modify them to my needs. That's hard enough without having to recreate the entire thing from scratch. In my case, the need was great enough to offset the cost of frustration.

    I had a need similar to what you described. I wanted to be able to "pre-condition" a bunch of nodes that would represent the outline to a meeting: Start, End, Attendees, Agenda topics, location and travel information. I wanted a uniform look and feel for each type of meeting record that would remain the same across time (color, icons, formatting, etc). What I ended up doing is making up a template folder stored elsewhere in my map that contained all the various types of meeting structures that I normally encountered (single calls, conference calls, one-day meeting, meetings involving travel, etc). Then it was a simple(r) matter to figure out how to hack other people's scripts to select one of these templates from a pull-down list and then copy it into the map location I needed it. It is then a simple matter to delete any extra nodes that I might not need at the time (for example, if there are no expenses associated with the meeting, I could simply delete the parent and children that were pre-formatted for this need). This was easier for me than trying to figure out to write a script that would do it all from within the script each time.

    Perhaps this approach won't work in your case, but I thought I'd at least offer an alternative approach if it would help.

    Q!

     

    Last edit: Quinbus 2015-03-27
    • Miguel Boyer

      Miguel Boyer - 2015-03-27

      Bal, I don't know about your specific problem. At first glance it looks pretty standard to me. No the link thing, but the attributes. I don't know anything about links, never use them, and much less in scripts. But i do use attributes.

      Anyway, start in this page:
      http://www.freeplane.org/wiki/index.php/Scripting
      Read the examples.

      Then check the links at the end of that page, under "Further reading",
      mainly "Groovy tutorials", but above all, "Scripts collection".

      Then go to Freeplane and check the menu "Help - Sripting Api". It gets you into a mindmap showing the "object model" (may not be the proper name), it gives you hints about how to manipulate things in the program. From there if you click in many nodes, you get redirected to http://freeplane.sourceforge.net/doc/api/overview-summary.html

      I know this last page is not very specific, difficult to deal with. But you may get an idea how to use the objects.

      And lastly, when you feel there is a function or an object you may need to use, Google it together with "freeplane". Sometimes you can find code that helps, so you will just need to modify it.

      One more piece of advice: Don't try to get your main problem solved
      directly. Learn little things on the side: how to change color of a node.
      How to copy a node to a different one. How to change text. How to set
      attributes. Once you start to see how really small scripts change cool
      little things you will discover it is actually fun and kind of amazing.
      Only then can you start to build more complex scripts with a more difficult structure, recursion, things like that. Then you will have most of what you need mastered, and you will be amazed how powerful the whole product is.
      Once you get automation into the cocktail, you can manage info in a totally new way. There is a new level o joy in computers when you upgrade from simple user to a bit of programing.

      Sorry i can't get into the specifics of your problem. I don't have those things ready to go in my mind, like Volker of Dimitry always do. But you fill find out. :)

      m.

       

      Last edit: Volker Börchers 2015-03-28
  • Volker Börchers

    Miguel and Quinbus, that's very good advice! I have added your posts [http://freeplane.sourceforge.net/wiki/index.php/Scripting#What_users_say to the scripting page]. Note that I have cut the e-mail citations from your original posts, I hope that's okay.

    One additional advice: Once you have specific problems or questions you can always ask in the forum.

    Regards, Volker

     
  • Bal Simon

    Bal Simon - 2015-03-28

    Got it - thanks, guys.
    - Bal

     
  • fpay

    fpay - 2015-03-29

    Hi Bal,

    much easier than scripting is to work with shortcuts. You need 3 of them.
    1) set anchor-node (main menu second from left - in german: "Bearbeiten" - Hyperlink)
    2) create link FROM anchor-node to target-node
    3) create link TO anchor-node from target-node

    With these 3 shortcuts you create a two-way link in a split-second.

    Ay

     
    • Ken Hill

      Ken Hill - 2019-08-09

      fpay,

      Just stumbled on this. I have been using steps 1 and 3 for a while now, using shortcut keys. I'm very glad to know about step 2. Got my 3 shortcut keys ready for extensive service.

      This will save lots of time vs my previous procedure. I wonder how much treasure is waiting to be discovered in this marvelous Freeplane and the forum.

      Thanks.

      Bal, Thanks for asking the question.

       
  • Bal Simon

    Bal Simon - 2015-03-29

    Wonderful - it fits the need!

    Thank you!
    - Bal

     
  • Bal Simon

    Bal Simon - 2015-03-30

    Ay - I want to say again - thank you! Your idea works great and saves me a great deal of time and aggravation.

    Best,
    - Bal

     
    • fpay

      fpay - 2015-03-30

      You are welcome!

      Kind regards, Ay

       
  • kurztipp

    kurztipp - 2015-06-16

    As a script. It's not really tested.

    // @ExecutionModes({ON_SINGLE_NODE})
    def linkId=node.link.getText().tokenize('_')[1]
    c.find{it.getId().tokenize('_')[1]==linkId}[0].link.setNode(node)