And now 5.1.20 has been released with mathematical operators! I guess a
simply SVG approach for plotting the data tiddler "data" (
{"10":0,"40":40,"70":100,"120":90}) can be
\define makePoints()
<$list filter="[[data]indexes[]]" variable="key" >
<$set name="xv" filter="[<key>multiply[$(xs)$]]">
<$set name="xval" filter="[<xv>add[10]]">
<$set name="yv" filter="[[data]getindex<key>]">
<$set name="yva" filter="[<yv>mulitply[$(ys)$]]">
<$set name="yval" filter="[[110]subtract<yv>]">
<circle cx=<<xval>> cy=<<yval>> r="1.5"/>
</$set>
</$set>
</$set>
</$set>
</$set>
</$list>
\end
\define makePlot(xsc ysc)
<$set name="xs" filter="[[100]divide[$xsc$]]">
<$set name="ys" filter="[[100]divide[$ysc$]]">
<svg height=120 width=120 preserveAspectRatio="xMidYMid meet">
<line x1="10" y1="110" x2="110" y2="110"
style="stroke:silver;stroke-width:1" />
<line x1="10" y1="110" x2="10" y2="10"
style="stroke:silver;stroke-width:1" />
<<makePoints>>
</svg>
</$set>
</$set>
\end
with call <<makePlot "120" "100">>
However, what is the best way to transclude such a macro in regard of
scaling? I tried to make a tiddler calling the macro with type SVG but it
didn't work, so maybe CSS is the way to go?
- Anders
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/tiddlywikidev/70c17c90-4b26-4291-ae32-3aed26742dbe%40googlegroups.com.