I installed Freeplane 1.6.6 and I discover with great pleasure the possibility of carrying out calculations in the attributes.
Only after several attempts the formula returns an erroneous result.
Not knowing the language I find it difficult to find the error.
Could anyone help me?
This solution was the one I had thought of at the bottom and in the end I find that this solution seems therefore the most viable.
Nevertheless, after analyzing several maps, I noticed the addition at the beginning of the formula "= children.size ()> 0?" to check that the nodes were not empty in verification and that the attributes were not empty and therefore to avoid the formulation of an error. Also I would have 3 questions:
- Does this formula start verifying whether the node is empty or not?
- This notation corresponds to what syntax?
- Where can I find a doc on these different syntaxes, the documentation being very vast?
indeed, the possibility of making formulas is very interesting especially in a conceptual map, unfortunately, there is very little documentation or help on this subject especially for a non-professional programming or application development.
thank you in advance for any additional answers
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The formula in my previous post does not check the size of children to be more than 0. Though some map developed using older Freeplane veresion may need the size check, it will not give you an error on Freeplane version 1.6.3, whether there's no child, or no target attribute name e.g. Durée, in the current node. If the formula gives you an error please state your Freeplane version and upload the map where you run into problem.
If you want to avoid the theoretical (since the formula above doesn't actually give an error on a childless node) null exception error, you can use the safe navigation operator.
Hello,
I installed Freeplane 1.6.6 and I discover with great pleasure the possibility of carrying out calculations in the attributes.
Only after several attempts the formula returns an erroneous result.
Not knowing the language I find it difficult to find the error.
Could anyone help me?
"=children.size()>0?children.sum(0){it["Durée"].num0}:Current["Durée"].num0"
the formula summates the child nodes but does not add the current node.
thanking you in advance
Hello,
Thank you for your answer.
This solution was the one I had thought of at the bottom and in the end I find that this solution seems therefore the most viable.
Nevertheless, after analyzing several maps, I noticed the addition at the beginning of the formula "= children.size ()> 0?" to check that the nodes were not empty in verification and that the attributes were not empty and therefore to avoid the formulation of an error. Also I would have 3 questions:
- Does this formula start verifying whether the node is empty or not?
- This notation corresponds to what syntax?
- Where can I find a doc on these different syntaxes, the documentation being very vast?
indeed, the possibility of making formulas is very interesting especially in a conceptual map, unfortunately, there is very little documentation or help on this subject especially for a non-professional programming or application development.
thank you in advance for any additional answers
The formula in my previous post does not check the size of children to be more than 0. Though some map developed using older Freeplane veresion may need the size check, it will not give you an error on Freeplane version 1.6.3, whether there's no child, or no target attribute name e.g. Durée, in the current node. If the formula gives you an error please state your Freeplane version and upload the map where you run into problem.
If you want to avoid the theoretical (since the formula above doesn't actually give an error on a childless node) null exception error, you can use the safe navigation operator.
Formulas are similar to Groovy scripting. And in Freeplane API documentation, "node" refers to the currently selected node.
http://groovy-lang.org/operators.html#_normal_arithmetic_operators
https://www.freeplane.org/wiki/index.php/Formulas
https://www.freeplane.org/wiki/index.php/Scripting#Hello_Controller
Thank you for the clarification
hello,
how do i close a post?
Just let it drift into eternety...
On 15 Sep 2017 12:47, "b_alary" balric@users.sf.net wrote:
No way to close them, they just stay as history in the forum
On 15 Sep 2017 20:48, "zipizap" zipizap@users.sf.net wrote:
Can you mark a post as "Answered: <previous post="" subject="">"? That would be good manners and nice housekeeping.