Menu

Possible sort children by icon "priority" or "progress"?

Cadux
2017-09-09
2018-01-25
  • Cadux

    Cadux - 2017-09-09

    Hi.
    In menu>edit>move sort there is the option "sort children", which seems to sort just alphabetically.
    Is it possible to sort children by icon "priority" or "progress"?
    Maybe through script?
    Thanks for info!

     
  • zipizap

    zipizap - 2017-09-10

    You can get the names of the icons that a node has, with

    node.icons.icons
    

    In the attached screenshot, you can see all the names of these icons

    Then you can reorder a node be the upper-most (0) or second-node (1) or ... or last-one (-1) with:

    node.moveTo(node.parent, 0)
    

    With these bare-pieces, you could try to make a simple script, to search if a node has a certain icon, and reorg it to be the first node or second, or ...
    Hope it helps

    Share back your progress :)

    BR

     
  • Cadux

    Cadux - 2017-09-10

    Many thanks for directions for the script zipizap!
    I've started learning scripts, but my knowledge is still limited.
    I'd appreciate a further help to achieve the script syntax.
    Taking as references the icons full-1, full-2 and full-3, what would be the script to sort the children nodes in the following order:

    full-1
    full-2
    full-3
    any other icon
    no icon

     
    • zipizap

      zipizap - 2017-09-10

      To be honest I'm not too skilled with groovy, my best language is Ruby
      (which is similar enough for simple scripts)

      Someday I intend to finish an addon - FreeplaneJrubyInstaller - that will
      let Ruby scripts run also in freeplane (just like groovy scripts) and then
      I could make your script in Ruby. The thing is that for this icons-script,
      to code the remaining logic in groovy would take me too much efforth/time
      as I am not very used to use groovy with arrays/lists and other things that
      I think would be necessary.

      If nobody else makes this groovy script for you, remind me when I get
      that FreeplaneJrubyInstaller
      finished

      Br

       
  • Cadux

    Cadux - 2017-09-10

    Thanks for feedback zipizap. Looking forward to using FreeplaneJrubyInstaller! All the best with the development!

    If anyone can help with a groovy script for sorting children by priority it is very welcomed.

     
  • Cadux

    Cadux - 2017-09-15

    Hey guys,

    Any idea about a script syntax to sort children by priority?

    Desirable sorting based on icon name:
    full-0
    full-1
    full-2
    full-3
    ...
    full-9
    any other icon
    no icon

    Many thanks!

     

    Last edit: Cadux 2017-09-16
  • Cadux

    Cadux - 2017-10-07

    Hi,

    It seems to be not so easy to implement sorting by priority through scripting, so I created a formal feature request since many users that deals with project/task management could benifit from this feature:
    https://sourceforge.net/p/freeplane/featurerequests/2408/

    In the feature request I also mentioned the possibility implement sort by "Modified time". It is possible to see/sort "modified time" through Freeplane "search and replace" tool, but a native sorting direct on the nodes would be handier.

    I've attached a screenshot about the suggestion.

    Cheers,
    Carlos

     
    • zipizap

      zipizap - 2017-10-10

      Cadux, I've finally finished/published the addon, and made a ruby script to sort children by icons

      You will need to:

       

      Last edit: zipizap 2017-10-10
  • Leo Staley

    Leo Staley - 2018-01-25

    That screenshot comparison of Xmind and Freeplane has another sort method that I'd really like: by modified. Is it possible to make such an option with something similar to your addon?

     
  • Leo Staley

    Leo Staley - 2018-01-25

    Apologies for being unclear. I was wondering if there was a way to sort children by modified or created times, the way the above script allows you to sort by progress.