Menu

A script to search nodes with on-the-fly filtering

lilive
2020-06-04
2020-07-27
1 2 > >> (Page 1 of 2)
  • lilive

    lilive - 2020-06-04

    [edit] This was the early development discussion about what has become the Jumper add-on. If you want to discuss about Jumper prefer this new discussion.


    Hello,

    I really like tools that provide a search with on-the-fly filtering, so I'm trying a script to do that in Freeplane. My goal is to find nodes as quickly as possible, and I've got the feeling that I can go faster than with the builtin Freeplane tools (search or filter) in some situations. You can find the script here (there is a gif demo).

    Please let me know what you think !

    Lilive

     

    Last edit: lilive 2020-06-26
  • Robertonisola

    Robertonisola - 2020-06-06

    Hi Lilive,

    I think this script is a great idea, especially for large maps. I have some questions and comments:

    Does this script alter the map in any way? Is there any risk of data loss or map corruption?

    How does this script handle clones? I think it should show only search results from the original node, not the clone ones.

    In the next version, I would love to see the ability to search for words in the node's notes too, since I use them heavily. I think this is no simple task, but still hope to see it implemented soon ^^

    Thank you.

     

    Last edit: Robertonisola 2020-06-06
  • sfpcom

    sfpcom - 2020-06-06

    Hi lilive, first of all I tried your script: very nice, thankyou to provide us this tool.

    I think your basic searching is correct. I agree with your way of searching clones (using your flag). Of course I'm sure you are already studying how to search appropriately within notes, details and attributes.
    Currently I do not see any alterations of the original map.
    KR
    SFPC

     
  • lilive

    lilive - 2020-06-06

    Thanks for your feedbacks. This is pleasant after these days of lonely coding ;)

    Does this script alter the map in any way? Is there any risk of data loss or map corruption?

    Currently I do not see any alterations of the original map.

    I confirm that the script don't alter the map in any way, there is no risk.
    But I'm thinking to add this option: as we browse the result list using the up and down keyboard keys, the selected node could be centered in the map. This may need to change the map folding state. In this case I will take care to restore the folding state when the script end. This is the only map alteration I can see for the future, and in case of bug it will be no data loss.

    How does this script handle clones? I think it should show only search results from the original node, not the clone ones.

    I'm not sure: have you seen the checkbox for the clones ? You can show a clone only one time.
    I see no way to identify the "original" clone. I think that Freeplane has no such feature, and it seems right to me: if we delete an original clone, which one of its remaining clones will become the original ?
    That's why, when the checkbox is checked, I keep the clone with the smaller level (meaning the minimal depth in the map hierarchy). If two clones are at the same level, I keep the one with the minimal ID (in alphabetical order, but not sure that it make sense !)
    You make me think about a small script I've got that jump to another clone when invoked on a node with clones. I put it at the end of this message.

    I don't use notes, details and attributes so much, that's why the search doesn't take care of them for now. But if I've planned to include them, I don't think it's big work. I'll let you know.

    At the moment I'm working to make the search to be "transversal". I mean that, for a map containing the nodes "xxx AAAxxx" -> "xxxBBBxxx" -> "xxxCCC xxx", the node "CCC" will be found with the search term "AAA BBB CCC" (in any order).
    It is almost done. When I'll include the notes, details and attributes search, I think that perhaps the transversal search will have to consider them only for the "leaf" clone, and will stick to core text search in the branch.

    By the way, I wondering if you got the same issue than me: the script is quite big and slow to compile, and Freeplane recompile it each time I use it for the first time after launching Freeplane. I've tried a big number in "preferences > compiled scripts cache size", and the associated checkbox is checked, but it don't solve the problem. Have you got the same behavior ? Thank you.

     
  • sfpcom

    sfpcom - 2020-06-09

    Hi lilive, I confirm it, on the first time in a map it takes time to compile, after that is much faster. Exactly as you described. Of course it depends on the size of the map. Now normally I have maps of 2-4000 nodes, and I utilize now your tool.
    Maybe you would think if it could be useful to have the possibility to move up and/or down in the already searched list and showing the next chosen node... just a point.
    In any case it is OK.
    Thanks
    KR
    SFPC
    PS: I already use normally your jump to clone script (useful)

     
  • lilive

    lilive - 2020-06-09

    Hi sfpcom

    on the first time in a map it takes time to compile, after that is much faster. Exactly as you described. Of course it depends on the size of the map

    Thank you for the input.

    I've got something different:
    - I launch FP
    - I start the script
    - I have to wait some seconds before the script window appear
    - After that, the script window appear really fast, even if I use it for another map
    - This continues to be fast until I close FP

    I keep the script in one big groovy file for now, but when it will be more advanced I will make a jar to avoid this compilation time.

    Now normally I have maps of 2-4000 nodes, and I utilize now your tool.

    Glad to read this. I'm also using it and I enjoy it. Even more with the "transversal search that I'm about to share.

    Maybe you would think if it could be useful to have the possibility to move up and/or down in the already searched list and showing the next chosen node... just a point.

    Thank you for proposing. But I'm not sure I understand you. What do you mean with "showing the next chosen node" ? Do you mean that I could make the result list scroll before the selection reach the top or the bottom of the visible results ?

    Also, I'm not satisfied with the script name. "Quick Search"... I don't want to imply that the FP search and filter tools are slow, they are great. But I'm not good in english. What do you think about "Fly Filter" (meaning on-the-fly) ? Please let me know if you've got ideas :)

     

    Last edit: lilive 2020-06-09
  • sfpcom

    sfpcom - 2020-06-09
                    Thank you for proposing. But I'm not sure I understand you. What do you mean with "showing the next chosen node" ? Do you mean that I could make the result list scroll before the selection reach the top or the bottom of the visible results ?
    

    I mean that before chosing the node to read you have already searched and so created a list of nodes, I think to the possibility to jump from the selected node (with the chosen words inside) to another node (of the same selection) and this be possible for the full list. Therefore instead of filtering the map you jump from node to node

    > - After that, the script window appear really fast, even if I use it for another map
    

    Confirmed: before I wasn't so precise

    > "Fly Filter" (meaning on-the-fly)
    

    Just a silly joke: I prefer O.F.F.= On the Fly Filter, better this could be a "Jumper" (jumping filter)
    SFPC

     
  • lilive

    lilive - 2020-06-09

    I'm just passing by to let you know that there is a new version that can do transversal search (a search string found across a branch).

    Next task for me: search in notes, details, attributes.

    sfpcom I will reply to you later !

     

    Last edit: lilive 2020-06-10
  • lilive

    lilive - 2020-06-10

    this could be a "Jumper" (jumping filter)

    I like it ! Thanks :)

    I think to the possibility to jump from the selected node (with the chosen words inside) to another node (of the same selection) and this be possible for the full list. Therefore instead of filtering the map you jump from node to node

    Ok, I get it now.
    You've got a point, but it bother me a little that it looks like the "Find..." and "Find next" Freeplane builtin features. I wrote this script because I wanted to have an overview of the matching nodes, and the possibility to refine the search terms to find a specific node instead of jumping from node to node that match a too much vague criterion.
    For now, to find another node that match the same pattern, you have to call the jumper ;-) and press Alt-Up (or Ctrl-Up) to use the previous search string. You make me think that I could load the last search string when the jumper pop up. If I autoselect the whole string in the text field, it will be replaced as soon as the user start to type another thing.
    I have also this idea: when you browse the results usign the up and down keys, the corresponding node could be selected in the map, and the view centered into it, leaving the jumper dialog opened.
    If we combine the automatic recall of the last search and this last idea, we've got something close enough to what you're suggesting, but not too close from FP builtin "Search next" feature.
    On the other hand, if I do this, why not also provide exactly the fonctionnality you're talking about :-)
    What do you think ?

     
  • sfpcom

    sfpcom - 2020-06-10

    Great! It would be useful.
    Yes agree that the overview is helping and it is the real value added.
    You are right in the actual version it is close to the builtin find next, but with your last idea it is exactly what I was thinking about and something different of the actuals.

    Thankyou for your efforts.
    SFPC

     
  • Dimitry Polivaev

    Could you consider to create an add-on to simpify the installation?
    Check https://www.freeplane.org/wiki/index.php/Add-ons_(Develop)

     

    Last edit: Dimitry Polivaev 2020-06-11
  • lilive

    lilive - 2020-06-11

    Could you consider to create an add-on to simpify the installation?

    Yes. It's in my todo list since 15mn, before I read you ! I have already made the bookmark add-on so I guess I can make a new one quite easily now. Thanks for you attention.
    By the way, do you think I can add the bookmark add-on in the wiki ? I think it lacks visibility, and do not pop up in search engines. I asked the edit rights a couple of time with no luck. I also have some little scripts, like the "jump to next clone" mentionned in this thread.

    About Jumper: the last version is online. The main part of the code is now in a java .jar, meaning that the script start faster.
    @Robertonisola, @sfpcom, the search in details, notes and attributes is coming soon.

     
    • Dimitry Polivaev

      Sometimes things get lost.
      I have sent you your freeplane wiki credentials as a sourceforge message now.

       
  • lilive

    lilive - 2020-06-11

    Sometimes things get lost.

    Yes ! I've got no problem with that ! Thank you, I'm coming back from the wiki, I have added my add-on into the page.

     
  • Robertonisola

    Robertonisola - 2020-06-16

    Hi lilive,

    I got a null pointer exception when I was playing with the highlight color option (ie. I was trying to choose another highlight color rather than the default one).

    Please see the attachment for error log. Thank you.

     
  • lilive

    lilive - 2020-06-16

    Hi Roberto,
    You have this problem when you close the color picker dialog with the Cancel button, am I right ?
    Try the latest release (with options to search in details, notes and attributes), it should be fixed.
    Thank you (the error log was useful)

     

    Last edit: lilive 2020-06-16
  • lilive

    lilive - 2020-06-17

    The add-on version is ready !
    It comes with more improvements.
    Do not forget to remove scripts/Jumper.groovy and lib/Jumper.jar before to install the add-on.

     
  • sfpcom

    sfpcom - 2020-06-17

    Hi lilive, I've installed the addon, but I got this error.
    BR
    SFPC

     
  • sfpcom

    sfpcom - 2020-06-17

    Hi lilive I discover the reason behind it: if there is a formula in a node/attribute with an error your script has been blocked with an error message... it becomes useful to debug eventual node errors.
    Eventually is it possible to change this behaviour?
    BR
    SFPC

     
  • lilive

    lilive - 2020-06-17

    You are right sfpcom. When the script try to get the attributes values text, the formulas are evaluated. I haven't found how to prevent this. So I catch the error and replace the value by [value evaluation error !]. A drawback is that all the other attributes values for the same node also become [value evaluation error !], but I don't see how to do better. Check the new release.

    I'm worried about performances if each formula of each node is evaluate when the script starts.

     
  • lilive

    lilive - 2020-06-21

    Hello,
    This is it, the map view can now follow the node selected in the results, and the window can open with the last search terms. There are options to enable this 2 new features in the version 0.6.0.

     
  • nnako

    nnako - 2020-06-21

    This is it, the map view can now follow the node selected in the
    results, and the window can open with the last search terms...

    excellent work!!! Thank you so much. The whole new feature makes searching in big maps so much easier... :-)

     
  • sfpcom

    sfpcom - 2020-06-21
    It is working nicely, well done!
    I really appreciate it.
    SFPC
    
     
  • lilive

    lilive - 2020-06-23

    I really like to use it myself, and I feel that I find things faster now. But after all this coding I must feel this way (what a waste of time otherwise !)
    That's why I'm glad to read you both, this is proof that I'm not mad ! Thank you.

    There is a new version with some improvements. Perhaps I will slow down now, I have the feeling that it is ok for a first version (except for the possible bugs to come).

     
  • lilive

    lilive - 2020-06-25

    Hello,
    At last ! I just released the version 1.0.0
    (I just made an announcement in the forum but it is "awaiting moderation". Perhaps it is because the post contains links and images, or because I'm to much enthusiastic !)
    Thanks again for all your precious feedbacks and ideas in this discussion.

     

    Last edit: lilive 2020-06-26
1 2 > >> (Page 1 of 2)