Hi Jonnan On Jul 30, 1:11 am, Jonnan <jonnan.w...@gmail.com> wrote: > I feel like I must be both reinventing the wheel, and the most > retarded caveman ever to do it,but to expand the functionality of > TiddlyWiki for writing stories, I have been trying to get a macro to > interpret/add inline svg graphics to tiddlywiki. > > I have found all sorts of things where people have gone well beyond > the simple thing I want - science graphs, interactive charts, and so > on, and I've found a code snippet (http://softwareas.com/inline-svg) > for doing inline svg that, going by the reactions of seemingly > competent people that posted at the time, seems to obviously just be > something anyone even slightly competent could cut and paste into a > macro and at least get a simple graphic to work.
> <<SVG "<circle r=\"50\" cx=\"50\" cy=\"50\" fill=\"green\"/>">> While this may be beyond your needs, have you looked at Paulo Soares' plugin? http://www.math.ist.utl.pt/~psoares/MathSVG.html The following three lines will produce a SVG graphic of a red circle of radius 50 pixels filled with green. (:graph({width:102,height:102,coords:'none',scales:[-51,51]}) circle([0,0],50,{stroke:'red',fill:'green'}); :) To explain the commands, here is some more information. The commands begin with "(:graph()" and end with ":)". The "(:graph" line has option that set the width and height of the graphic in pixels. I have used 102 pixels to give a 1 pixel boundary to the circle that with have a diameter of 100 pixels. The "coords:'none'" means that the when you hover the mouse over the graphic, the graph co-ordinates of the mouse pointer will not be displayed. By default the co-ordinates are displayed which is fine for a graph but not what you would want for a graphic. The "scales:[-51,51]" sets the lower and upper limits for the (hidden) x-axis and y-axis upon which you are plotting the circle. I have set the value to 51 so as to avoid any clipping when plotting the circle up to x=-50 and x=50. The line "circle([0,0],50,{stroke:'red',fill:'green'}); " draws the actual circle. The "[0,0]" is the co-ordinate of the centre of the circle. The ",50" is the radius of the circle. The options "{stroke:'red',fill:'green'}" set the line colour to 'red' and the fill to 'green'. Finally, the command is ended with ":)". Cheers Andrew Mc --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To post to this group, send email to TiddlyWiki@googlegroups.com To unsubscribe from this group, send email to tiddlywiki+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/TiddlyWiki?hl=en -~----------~----~----~----~------~----~------~--~---