more like:
\define m()
<$set name=pmar value=<<rpn a:$(currentVal)$ b:$(targetVal)$
operation:"/">>>
<<mymacro>>
</$set>
\end
\define mymacro()
<svg><text x=<<rpn a:$(pmar)$ b:520 operation:"*">> y=16
fill="red">▼</text></svg>
\end
$set name=currentVal value={{!!tracker_current_value}}>
<$set name=targetVal value={{!!tracker_target_value}}>
<<m>>
</$set>
On Thursday, October 26, 2017 at 5:47:01 PM UTC+2, hubertgk wrote:
>
> Thanks for the idea, BJ. Unfortunately, it doesn't seem to work.
>
> When I invoke <<mymacro>> (as below), nothing happens (just a few empty
> lines are entered). But when I change the x value from x=$ProgressMark$ to,
> say, x=50 (or any other number), the svg/text element is displayed and
> moved as expected.
>
> Below is the updated code. Is there any other way I could get
> $ProgressMark$ evaluated?
>
> \define Proportion()
> <$macrocall $name="rpn" a=$(currentVal)$ b=$(targetVal)$ operation="/">
> \end
>
> \define ProgressMark()
> <$macrocall $name="rpn" a=<<Proportion>> b=520 operation="*">
> \end
>
> \define mymacro(ProgressMark)
> <svg><text x=$ProgressMark$ y=16 fill="red">▼</text></svg>
> \end
>
> <$set name=currentVal value={{!!tracker_current_value}}>
> <$set name=targetVal value={{!!tracker_target_value}}>
>
> <<mymacro>>
>
> </$set>
>
> Thank you again!
>
>
> On Thursday, 26 October 2017 16:03:35 UTC+1, BJ wrote:
>>
>> You can see what is going on by using the text widget:
>>
>>
>> <$text text=<<ProgressMark>>/>
>>
>> gives
>>
>> <$macrocall $name="rpn" a=<<Proportion>> b=520 operation="*">
>>
>> - macro are not 'wikified' when used in params
>>
>> I would use a macro around the svg
>>
>> \define mymacro(ProgressMark)
>> <svg><text x=$ProgressMark$ y=16 fill="red">▼</text></svg>
>> \end
>>
>> Maybe this is what you are saying....
>>
>>
>> On Thursday, October 26, 2017 at 3:59:00 PM UTC+2, hubertgk wrote:
>>>
>>> Hi All,
>>>
>>> I'm building a goal tracker using two html elements: <progress> and
>>> <svg>, the brilliant "rpn" macro by Thomas Elmiger and a simple "DaysDiff"
>>> macro that I created myself (it returns the number of days elapsed from a
>>> given date).
>>>
>>> The <svg> HTML element moves along the x axis and shows the completion
>>> rate (using the fields 'tracker_current_value' divided by
>>> 'tracker_target_value' multiplied by 520 [px] as "520" is the width that
>>> amounts to "100% completion"); the <svg> element moves in parallel to the
>>> <progress> element that is measuring the time that's elapsed:
>>>
>>> The relevant snippets of code:
>>>
>>> <svg><text x=<<ProgressMark>> y=16 fill="red">▼</text></svg>
>>> <progress value=<<some value>> max=<<max value>>></progress>
>>>
>>> The problem that I have is that the <svg> element will not accept the
>>> output value of the <<ProgressMark>> macro that I've defined ad-hoc in the
>>> tiddler in order to calculate the position of the <svg> element in this way:
>>>
>>> \define Proportion()
>>> <$macrocall $name="rpn" a=$(currentVal)$ b=$(targetVal)$ operation="/">
>>> \end
>>>
>>> \define ProgressMark()
>>> <$macrocall $name="rpn" a=<<Proportion>> b=520 operation="*">
>>> \end
>>>
>>> <$set name=currentVal value={{!!tracker_current_value}}>
>>> <$set name=targetVal value={{!!tracker_target_value}}>
>>>
>>> <svg> does accept the value if it's entered as <<SomeMacro 12345>> but
>>> not when entered as <$macrocall...> or <<ProgressMark>> even though the
>>> <<ProgressMark>> returns the correct value when used outside of the <svg>
>>> element.
>>>
>>> How can I process the result of the macro? Could I use <$wikify>
>>> perhaps? If so, how? I've looked around this group and could not find a
>>> satisfactory solution.
>>>
>>> Thank you very much for any suggestions!
>>>
>>>
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywiki/4a53f9c6-8c3e-401d-be3b-163cfa0f3e14%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.